19#ifndef INCLUDED_UNOTOOLS_CONFIGNODE_HXX
20#define INCLUDED_UNOTOOLS_CONFIGNODE_HXX
43 css::uno::Reference< css::container::XHierarchicalNameAccess >
45 css::uno::Reference< css::container::XNameAccess >
47 css::uno::Reference< css::container::XNameReplace >
49 css::uno::Reference< css::container::XNameContainer >
53 OConfigurationNode insertNode(
const OUString& _rName,
const css::uno::Reference< css::uno::XInterface >& _xNode)
const noexcept;
58 const css::uno::Reference< css::uno::XInterface >& _rxNode
61 const css::uno::Reference< css::container::XNameAccess >&
77 OUString getLocalName()
const;
86 return openNode( OUString::createFromAscii( _pAsciiPath ) );
104 bool removeNode(
const OUString& _rName)
const noexcept;
113 css::uno::Any getNodeValue(
const OUString& _rPath)
const noexcept;
117 return getNodeValue( OUString::createFromAscii( _pAsciiPath ) );
126 bool setNodeValue(
const OUString& _rPath,
const css::uno::Any& _rValue)
const noexcept;
128 bool setNodeValue(
const char* _pAsciiPath,
const css::uno::Any& _rValue )
const
130 return setNodeValue( OUString::createFromAscii( _pAsciiPath ), _rValue );
134 css::uno::Sequence< OUString >
135 getNodeNames() const noexcept;
138 virtual
void clear() noexcept;
143 bool isSetNode() const;
146 bool hasByName(const OUString& _rName) const noexcept;
149 bool hasByHierarchicalName( const OUString& _rName ) const noexcept;
152 bool isValid()
const {
return m_xHierarchyAccess.is(); }
159 virtual void _disposing(
const css::lang::EventObject& _rSource )
override;
167 OUString normalizeName(
const OUString& _rName, NAMEORIGIN _eOrigin)
const;
179 css::uno::Reference< css::util::XChangesBatch >
184 const css::uno::Reference< css::uno::XInterface >& _rxRootNode
206 const css::uno::Reference<css::uno::XComponentContext> & i_rContext,
207 const OUString& i_rNodePath,
208 const bool i_bUpdatable
227 const css::uno::Reference< css::lang::XMultiServiceFactory >& _rxConfProvider,
228 const OUString& _rPath,
245 static OConfigurationTreeRoot createWithComponentContext(
const css::uno::Reference< css::uno::XComponentContext >& _rxContext,
246 const OUString& _rPath, sal_Int32 _nDepth = -1,
CREATION_MODE _eMode = CM_UPDATABLE);
254 static OConfigurationTreeRoot tryCreateWithComponentContext(
const css::uno::Reference< css::uno::XComponentContext >& rxContext,
255 const OUString& _rPath, sal_Int32 _nDepth = -1,
CREATION_MODE _eMode = CM_UPDATABLE );
262 bool commit() const noexcept;
265 virtual
void clear() noexcept override;
a small wrapper around a configuration node.
css::uno::Reference< css::container::XNameReplace > m_xReplaceAccess
accessing children (mandatory interface of our UNO object)
bool m_bEscapeNames
modifying set nodes (optional interface of our UNO object)
OConfigurationNode()
constructs an empty and invalid node object
bool setNodeValue(const char *_pAsciiPath, const css::uno::Any &_rValue) const
css::uno::Reference< css::container::XHierarchicalNameAccess > m_xHierarchyAccess
css::uno::Reference< css::container::XNameContainer > m_xContainerAccess
replacing child values
OConfigurationNode(const css::uno::Reference< css::uno::XInterface > &_rxNode)
constructs a node object with an interface representing a node
css::uno::Reference< css::container::XNameAccess > m_xDirectAccess
accessing children grandchildren (mandatory interface of our UNO object)
css::uno::Any getNodeValue(const char *_pAsciiPath) const
const css::uno::Reference< css::container::XNameAccess > & getUNONode() const
bool setNodeValue(const OUString &_rPath, const css::uno::Any &_rValue) const noexcept
write a node valueThe value given is written into the node specified by the given relative path.
OConfigurationNode openNode(const char *_pAsciiPath) const
bool isReadonly() const
check whether the object is read-only of updatable
a specialized version of an OConfigurationNode, representing the root of a configuration sub treeOnly...
OConfigurationTreeRoot()
default ctorThe object constructed here is invalid (i.e.
css::uno::Reference< css::util::XChangesBatch > m_xCommitter
CREATION_MODE
modes to use when creating a top-level node object
@ CM_READONLY
open the node (i.e. sub tree) for read access only
OConfigurationTreeRoot(const css::uno::Reference< css::uno::XInterface > &_rxRootNode)
ctor for a readonly node
OConfigurationTreeRoot(const css::uno::Reference< css::uno::XComponentContext > &i_rContext, const OUString &i_rNodePath, const bool i_bUpdatable)
creates a configuration tree for the given path in the given mode
base class for non-UNO dispose listeners