summaryrefslogtreecommitdiff
path: root/unotools/inc/unotools
diff options
context:
space:
mode:
authorFrank Schoenheit [fs] <frank.schoenheit@sun.com>2010-03-18 12:42:35 +0100
committerFrank Schoenheit [fs] <frank.schoenheit@sun.com>2010-03-18 12:42:35 +0100
commitcd95230c2f9a46805d494981152d91df8481424a (patch)
tree0668d7a3c240f83ca022bd6c9c902467dfd4b578 /unotools/inc/unotools
parent2aed134a5ce8e49f4aa5c736ec39880d272572a1 (diff)
slidecopy: convenience ctor for OConfigurationTreeRoot / removed the CM_PREFER_UPDATABLE value, role taken over by CM_UPDATABLE
Diffstat (limited to 'unotools/inc/unotools')
-rw-r--r--unotools/inc/unotools/confignode.hxx56
1 files changed, 33 insertions, 23 deletions
diff --git a/unotools/inc/unotools/confignode.hxx b/unotools/inc/unotools/confignode.hxx
index 2e305030fa2b..a1271b1eeed1 100644
--- a/unotools/inc/unotools/confignode.hxx
+++ b/unotools/inc/unotools/confignode.hxx
@@ -38,6 +38,11 @@
#include <com/sun/star/util/XChangesBatch.hpp>
#include <unotools/eventlisteneradapter.hxx>
+namespace comphelper
+{
+ class ComponentContext;
+}
+
//........................................................................
namespace utl
{
@@ -62,19 +67,23 @@ namespace utl
m_xReplaceAccess; /// replacing child values
::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer >
m_xContainerAccess; /// modifying set nodes (optional interface of our UNO object)
- ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >
- m_xProvider; /// the configuration provider which supplied the nodes of the hierarchy we're a part of
+ ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >
+ m_xDummy;
sal_Bool m_bEscapeNames; /// escape names before accessing children ?
::rtl::OUString
m_sCompletePath;
OConfigurationNode insertNode(const ::rtl::OUString& _rName,const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _xNode) const throw();
+
protected:
/// constructs a node object with an interface representing a node
OConfigurationNode(
- const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _rxNode,
- const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxProvider);
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _rxNode
+ );
+
+ const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess >&
+ getUNONode() const { return m_xDirectAccess; }
public:
/// constructs an empty and invalid node object
@@ -189,14 +198,6 @@ namespace utl
*/
sal_Bool getEscape() const { return m_bEscapeNames; }
- /** clone the object, creating a new hierarchy where the root represents the same node as the object
- where this method is called does.<p/>
- The new hierarchy does not share any updates with the one the object is a part of, i.e. any changes made
- in the existing hierarchy are not visible to the newly created one until committed (and vice versa).
- @param _rRoot out parameter. upon return, contains the object representing the root of the new hierarchy.
- */
- OConfigurationTreeRoot cloneAsRoot() const throw();
-
/// invalidate the object
virtual void clear() throw();
@@ -249,22 +250,23 @@ namespace utl
/** ctor<p/>
*/
OConfigurationTreeRoot(
- const ::com::sun::star::uno::Reference< ::com::sun::star::util::XChangesBatch >& _rxRootNode,
- const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxProvider);
+ const ::com::sun::star::uno::Reference< ::com::sun::star::util::XChangesBatch >& _rxRootNode
+ );
/** ctor for a readonly node
*/
OConfigurationTreeRoot(
- const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _rxRootNode,
- const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxProvider);
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _rxRootNode
+ );
public:
- /// modes to used when creating a top-level node object
+ /// modes to use when creating a top-level node object
enum CREATION_MODE
{
- CM_READONLY, /// open the node (i.e. sub tree) for read access only
- CM_UPDATABLE, /// open the node (i.e. sub tree) for read and write access
- CM_PREFER_UPDATABLE /// open the node (i.e. sub tree) for read and write access, if this fails, open it for read acces
+ /// open the node (i.e. sub tree) for read access only
+ CM_READONLY,
+ /// open the node (i.e. sub tree) for read and write access, fall back to read-only if write access is not possible
+ CM_UPDATABLE
};
public:
@@ -273,6 +275,14 @@ namespace utl
*/
OConfigurationTreeRoot() :OConfigurationNode() { }
+ /** creates a configuration tree for the given path in the given mode
+ */
+ OConfigurationTreeRoot(
+ const ::comphelper::ComponentContext& i_rContext,
+ const sal_Char* i_pAsciiNodePath,
+ const bool i_bUpdatable
+ );
+
/// copy ctor
OConfigurationTreeRoot(const OConfigurationTreeRoot& _rSource)
:OConfigurationNode(_rSource), m_xCommitter(_rSource.m_xCommitter) { }
@@ -296,7 +306,7 @@ namespace utl
const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxConfProvider,
const ::rtl::OUString& _rPath,
sal_Int32 _nDepth = -1,
- CREATION_MODE _eMode = CM_PREFER_UPDATABLE,
+ CREATION_MODE _eMode = CM_UPDATABLE,
sal_Bool _bLazyWrite = sal_True
);
@@ -313,7 +323,7 @@ namespace utl
@param _eMode specifies which privileges should be applied when retrieving the node
*/
static OConfigurationTreeRoot createWithServiceFactory(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxORB,
- const ::rtl::OUString& _rPath, sal_Int32 _nDepth = -1, CREATION_MODE _eMode = CM_PREFER_UPDATABLE, sal_Bool _bLazyWrite = sal_True);
+ const ::rtl::OUString& _rPath, sal_Int32 _nDepth = -1, CREATION_MODE _eMode = CM_UPDATABLE, sal_Bool _bLazyWrite = sal_True);
/** tolerant version of the <member>createWithServiceFactory</member>
@@ -322,7 +332,7 @@ namespace utl
given node path does not exist) are still asserted.</p>
*/
static OConfigurationTreeRoot tryCreateWithServiceFactory( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxORB,
- const ::rtl::OUString& _rPath, sal_Int32 _nDepth = -1, CREATION_MODE _eMode = CM_PREFER_UPDATABLE, sal_Bool _bLazyWrite = sal_True );
+ const ::rtl::OUString& _rPath, sal_Int32 _nDepth = -1, CREATION_MODE _eMode = CM_UPDATABLE, sal_Bool _bLazyWrite = sal_True );
/** commit all changes made on the subtree the object is the root for<p/>
All changes made on any <type>OConfigurationNode</type> object retrieved (maybe indirect) from this root