LibreOffice Module sfx2 (master) 1
Public Member Functions | Protected Member Functions | List of all members
sfx2::XmlIdRegistry Class Referenceabstract

handles registration of XMetadatable. More...

Inheritance diagram for sfx2::XmlIdRegistry:
[legend]
Collaboration diagram for sfx2::XmlIdRegistry:
[legend]

Public Member Functions

 XmlIdRegistry ()
 
virtual css::uno::Reference< css::rdf::XMetadatable > GetElementByMetadataReference (const css::beans::StringPair &i_rReference) const override
 get the ODF element with the given metadata reference. More...
 
virtual void RegisterMetadatableAndCreateID (Metadatable &i_xObject)=0
 register an ODF element at a newly generated, unique metadata reference. More...
 
virtual bool TryRegisterMetadatable (Metadatable &i_xObject, OUString const &i_rStreamName, OUString const &i_rIdref)=0
 try to register an ODF element at a given XML ID, or update its registration to a different XML ID. More...
 
virtual void UnregisterMetadatable (Metadatable const &)=0
 unregister an ODF element. More...
 
css::beans::StringPair GetXmlIdForElement (Metadatable const &) const
 get the metadata reference for the given element. More...
 
virtual void RemoveXmlIdForElement (Metadatable const &)=0
 remove the metadata reference for the given element. More...
 
- Public Member Functions inherited from sfx2::IXmlIdRegistry
virtual ~IXmlIdRegistry ()
 
virtual css::uno::Reference< css::rdf::XMetadatable > GetElementByMetadataReference (const css::beans::StringPair &i_rXmlId) const =0
 

Protected Member Functions

virtual bool LookupXmlId (const Metadatable &i_xObject, OUString &o_rStream, OUString &o_rIdref) const =0
 
virtual Metadatable * LookupElement (const OUString &i_rStreamName, const OUString &i_rIdref) const =0
 

Detailed Description

handles registration of XMetadatable.

This class is responsible for guaranteeing that XMetadatable objects always have XML IDs that are unique within a stream.

This is an abstract base class; see subclasses XmlIdRegistryDocument and XmlIdRegistryClipboard.

See also
SwDoc::GetXmlIdRegistry
SwDocShell::GetXmlIdRegistry

Definition at line 143 of file Metadatable.cxx.

Constructor & Destructor Documentation

◆ XmlIdRegistry()

sfx2::XmlIdRegistry::XmlIdRegistry ( )

Definition at line 360 of file Metadatable.cxx.

Member Function Documentation

◆ GetElementByMetadataReference()

css::uno::Reference< css::rdf::XMetadatable > sfx2::XmlIdRegistry::GetElementByMetadataReference ( const css::beans::StringPair &  i_rReference) const
overridevirtual

get the ODF element with the given metadata reference.

Implements sfx2::IXmlIdRegistry.

Definition at line 365 of file Metadatable.cxx.

References LookupElement(), and pObject.

◆ GetXmlIdForElement()

beans::StringPair sfx2::XmlIdRegistry::GetXmlIdForElement ( Metadatable const &  i_rObject) const

get the metadata reference for the given element.

Definition at line 374 of file Metadatable.cxx.

References LookupElement(), and LookupXmlId().

◆ LookupElement()

virtual Metadatable * sfx2::XmlIdRegistry::LookupElement ( const OUString &  i_rStreamName,
const OUString &  i_rIdref 
) const
protectedpure virtual

◆ LookupXmlId()

virtual bool sfx2::XmlIdRegistry::LookupXmlId ( const Metadatable &  i_xObject,
OUString &  o_rStream,
OUString &  o_rIdref 
) const
protectedpure virtual

Referenced by GetXmlIdForElement().

◆ RegisterMetadatableAndCreateID()

virtual void sfx2::XmlIdRegistry::RegisterMetadatableAndCreateID ( Metadatable &  i_xObject)
pure virtual

register an ODF element at a newly generated, unique metadata reference.

Find a fresh XML ID, and register it for the element. The generated ID does not occur in any stream of the document.

◆ RemoveXmlIdForElement()

virtual void sfx2::XmlIdRegistry::RemoveXmlIdForElement ( Metadatable const &  )
pure virtual

remove the metadata reference for the given element.

◆ TryRegisterMetadatable()

virtual bool sfx2::XmlIdRegistry::TryRegisterMetadatable ( Metadatable &  i_xObject,
OUString const &  i_rStreamName,
OUString const &  i_rIdref 
)
pure virtual

try to register an ODF element at a given XML ID, or update its registration to a different XML ID.

If the given new metadata reference is not already occupied in the document, unregister the element at its old metadata reference if it has one, and register the new metadata reference for the element. Note that this method only ensures that XML IDs are unique per stream, so using the same XML ID in both content.xml and styles.xml is allowed.

Returns
true iff the element has successfully been registered

◆ UnregisterMetadatable()

virtual void sfx2::XmlIdRegistry::UnregisterMetadatable ( Metadatable const &  )
pure virtual

unregister an ODF element.

Unregister the element at its metadata reference. Does not remove the metadata reference from the element.

See also
RemoveXmlIdForElement

The documentation for this class was generated from the following file: