namespace com::sun::star::container { class XHierarchicalNameAccess; } namespace com::sun::star::container { class XNameAccess; } namespace com::sun::star::container { class XNameContainer; } namespace com::sun::star::container { class XNameReplace; } namespace com::sun::star::lang { class XMultiServiceFactory; } namespace com::sun::star::uno { class XComponentContext; } namespace com::sun::star::util { class XChangesBatch; }
namespace utl
{
/** a small wrapper around a configuration node.<p/> Nodesintheterminologyusedhereinare<em>inner</em>nodesofaconfiguration tree,whichmeans<em>noleafs</em>.
*/ class UNOTOOLS_DLLPUBLIC OConfigurationNode : public ::utl::OEventListenerAdapter
{ private:
css::uno::Reference< css::container::XHierarchicalNameAccess >
m_xHierarchyAccess; /// accessing children grandchildren (mandatory interface of our UNO object)
css::uno::Reference< css::container::XNameAccess >
m_xDirectAccess; /// accessing children (mandatory interface of our UNO object)
css::uno::Reference< css::container::XNameReplace >
m_xReplaceAccess; /// replacing child values
css::uno::Reference< css::container::XNameContainer >
m_xContainerAccess; /// modifying set nodes (optional interface of our UNO object) bool m_bEscapeNames; /// escape names before accessing children ?
protected: /// constructs a node object with an interface representing a node
OConfigurationNode( const css::uno::Reference< css::uno::XInterface >& _rxNode
);
/// returns the local name of the node
OUString getLocalName() const;
/** open a sub node @param_rPathaccesspathoftheto-be-openedsubnode.Maybeahierarchicalpath.
*/
OConfigurationNode openNode(const OUString& _rPath) const noexcept;
/// return the names of the existing children
css::uno::Sequence< OUString >
getNodeNames() const noexcept;
/// invalidate the object virtualvoid clear() noexcept;
// meta information about the node
/// checks whether or not the object represents a set node. bool isSetNode() const;
/// checks whether or not a direct child with a given name exists bool hasByName(const OUString& _rName) const noexcept;
/// checks whether or not a descendent (no matter if direct or indirect) with the given name exists bool hasByHierarchicalName( const OUString& _rName ) const noexcept;
/// check if the objects represents a valid configuration node bool isValid() const { return m_xHierarchyAccess.is(); }
/// check whether the object is read-only of updatable bool isReadonly() const { return !m_xReplaceAccess.is(); }
protected: enum NAMEORIGIN
{
NO_CONFIGURATION, /// the name came from a configuration node
NO_CALLER /// the name came from a client of this class
};
OUString normalizeName(const OUString& _rName, NAMEORIGIN _eOrigin) const;
};
//= OConfigurationTreeRoot
/** a specialized version of an OConfigurationNode, representing the root ofaconfigurationsubtree<p/> OnlythisclassisabletocommitanychangesmadeanyanyOConfigurationNode objects.
*/ class UNOTOOLS_DLLPUBLIC OConfigurationTreeRoot final : public OConfigurationNode
{
css::uno::Reference< css::util::XChangesBatch >
m_xCommitter; /** ctor for a readonly node
*/
OConfigurationTreeRoot( const css::uno::Reference< css::uno::XInterface >& _rxRootNode
);
public: /// modes to use when creating a top-level node object enum CREATION_MODE
{ /// 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
};
/** creates a configuration tree for the given path in the given mode
*/
OConfigurationTreeRoot( const css::uno::Reference<css::uno::XComponentContext> & i_rContext, const OUString& i_rNodePath, constbool i_bUpdatable
);
/** commit all changes made on the subtree the object is the root for<p/> AllchangesmadeonanyOConfigurationNodeobjectretrieved(maybeindirect)fromthisroot objectarecommittedwhencallingthismethod. @returnsal_Trueifandonlyifthecommitwassuccessful
*/ bool commit() const noexcept;
/// invalidate the object virtualvoid clear() noexcept override;
};
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.