LibreOffice Module unoxml (master) 1
|
#include <document.hxx>
Public Member Functions | |
static ::rtl::Reference< CDocument > | CreateCDocument (xmlDocPtr const pDoc) |
factory: only way to create instance! More... | |
virtual | ~CDocument () override |
::osl::Mutex & | GetMutex () |
events::CEventDispatcher & | GetEventDispatcher () |
::rtl::Reference< CElement > | GetDocumentElement () |
::rtl::Reference< CNode > | GetCNode (xmlNodePtr const pNode, bool const bCreate=true) |
get UNO wrapper instance for a libxml node More... | |
void | RemoveCNode (xmlNodePtr const pNode, CNode const *const pCNode) |
remove a UNO wrapper instance More... | |
virtual CDocument & | GetOwnerDocument () override |
virtual void | saxify (const css::uno::Reference< css::xml::sax::XDocumentHandler > &i_xHandler) override |
virtual void | fastSaxify (Context &rContext) override |
virtual bool | IsChildTypeAllowed (css::xml::dom::NodeType const nodeType, css::xml::dom::NodeType const *pReplacedNodeType) override |
virtual css::uno::Reference< css::xml::dom::XAttr > SAL_CALL | createAttribute (const OUString &name) override |
Creates an Attr of the given name. More... | |
virtual css::uno::Reference< css::xml::dom::XAttr > SAL_CALL | createAttributeNS (const OUString &namespaceURI, const OUString &qualifiedName) override |
Creates an attribute of the given qualified name and namespace URI. More... | |
virtual css::uno::Reference< css::xml::dom::XCDATASection > SAL_CALL | createCDATASection (const OUString &data) override |
Creates a CDATASection node whose value is the specified string. More... | |
virtual css::uno::Reference< css::xml::dom::XComment > SAL_CALL | createComment (const OUString &data) override |
Creates a Comment node given the specified string. More... | |
virtual css::uno::Reference< css::xml::dom::XDocumentFragment > SAL_CALL | createDocumentFragment () override |
Creates an empty DocumentFragment object. More... | |
virtual css::uno::Reference< css::xml::dom::XElement > SAL_CALL | createElement (const OUString &tagName) override |
Creates an element of the type specified. More... | |
virtual css::uno::Reference< css::xml::dom::XElement > SAL_CALL | createElementNS (const OUString &namespaceURI, const OUString &qualifiedName) override |
Creates an element of the given qualified name and namespace URI. More... | |
virtual css::uno::Reference< css::xml::dom::XEntityReference > SAL_CALL | createEntityReference (const OUString &name) override |
Creates an EntityReference object. More... | |
virtual css::uno::Reference< css::xml::dom::XProcessingInstruction > SAL_CALL | createProcessingInstruction (const OUString &target, const OUString &data) override |
Creates a ProcessingInstruction node given the specified name and data strings. More... | |
virtual css::uno::Reference< css::xml::dom::XText > SAL_CALL | createTextNode (const OUString &data) override |
Creates a Text node given the specified string. More... | |
virtual css::uno::Reference< css::xml::dom::XDocumentType > SAL_CALL | getDoctype () override |
The Document Type Declaration (see DocumentType) associated with this document. More... | |
virtual css::uno::Reference< css::xml::dom::XElement > SAL_CALL | getDocumentElement () override |
This is a convenience attribute that allows direct access to the child node that is the root element of the document. More... | |
virtual css::uno::Reference< css::xml::dom::XElement > SAL_CALL | getElementById (const OUString &elementId) override |
Returns the Element whose ID is given by elementId. More... | |
virtual css::uno::Reference< css::xml::dom::XNodeList > SAL_CALL | getElementsByTagName (const OUString &tagname) override |
Returns a NodeList of all the Elements with a given tag name in the order in which they are encountered in a preorder traversal of the Document tree. More... | |
virtual css::uno::Reference< css::xml::dom::XNodeList > SAL_CALL | getElementsByTagNameNS (const OUString &namespaceURI, const OUString &localName) override |
Returns a NodeList of all the Elements with a given local name and namespace URI in the order in which they are encountered in a preorder traversal of the Document tree. More... | |
virtual css::uno::Reference< css::xml::dom::XDOMImplementation > SAL_CALL | getImplementation () override |
The DOMImplementation object that handles this document. More... | |
virtual css::uno::Reference< css::xml::dom::XNode > SAL_CALL | importNode (const css::uno::Reference< css::xml::dom::XNode > &importedNode, sal_Bool deep) override |
Imports a node from another document to this document. More... | |
virtual css::uno::Reference< css::xml::dom::events::XEvent > SAL_CALL | createEvent (const OUString &eventType) override |
virtual void SAL_CALL | addListener (const css::uno::Reference< css::io::XStreamListener > &aListener) override |
virtual void SAL_CALL | removeListener (const css::uno::Reference< css::io::XStreamListener > &aListener) override |
virtual void SAL_CALL | start () override |
virtual void SAL_CALL | terminate () override |
virtual void SAL_CALL | setOutputStream (const css::uno::Reference< css::io::XOutputStream > &aStream) override |
virtual css::uno::Reference< css::io::XOutputStream > SAL_CALL | getOutputStream () override |
virtual OUString SAL_CALL | getNodeName () override |
virtual OUString SAL_CALL | getNodeValue () override |
virtual css::uno::Reference< css::xml::dom::XNode > SAL_CALL | cloneNode (sal_Bool deep) override |
virtual css::uno::Reference< css::xml::dom::XNode > SAL_CALL | appendChild (const css::uno::Reference< css::xml::dom::XNode > &newChild) override |
virtual css::uno::Reference< css::xml::dom::XNamedNodeMap > SAL_CALL | getAttributes () override |
virtual css::uno::Reference< css::xml::dom::XNodeList > SAL_CALL | getChildNodes () override |
virtual css::uno::Reference< css::xml::dom::XNode > SAL_CALL | getFirstChild () override |
virtual css::uno::Reference< css::xml::dom::XNode > SAL_CALL | getLastChild () override |
virtual OUString SAL_CALL | getLocalName () override |
virtual OUString SAL_CALL | getNamespaceURI () override |
virtual css::uno::Reference< css::xml::dom::XNode > SAL_CALL | getNextSibling () override |
virtual css::xml::dom::NodeType SAL_CALL | getNodeType () override |
virtual css::uno::Reference< css::xml::dom::XDocument > SAL_CALL | getOwnerDocument () override |
virtual css::uno::Reference< css::xml::dom::XNode > SAL_CALL | getParentNode () override |
virtual OUString SAL_CALL | getPrefix () override |
virtual css::uno::Reference< css::xml::dom::XNode > SAL_CALL | getPreviousSibling () override |
virtual sal_Bool SAL_CALL | hasAttributes () override |
virtual sal_Bool SAL_CALL | hasChildNodes () override |
virtual css::uno::Reference< css::xml::dom::XNode > SAL_CALL | insertBefore (const css::uno::Reference< css::xml::dom::XNode > &newChild, const css::uno::Reference< css::xml::dom::XNode > &refChild) override |
virtual sal_Bool SAL_CALL | isSupported (const OUString &feature, const OUString &ver) override |
virtual void SAL_CALL | normalize () override |
virtual css::uno::Reference< css::xml::dom::XNode > SAL_CALL | removeChild (const css::uno::Reference< css::xml::dom::XNode > &oldChild) override |
virtual css::uno::Reference< css::xml::dom::XNode > SAL_CALL | replaceChild (const css::uno::Reference< css::xml::dom::XNode > &newChild, const css::uno::Reference< css::xml::dom::XNode > &oldChild) override |
virtual void SAL_CALL | setNodeValue (const OUString &nodeValue) override |
virtual void SAL_CALL | setPrefix (const OUString &prefix) override |
virtual void SAL_CALL | serialize (const css::uno::Reference< css::xml::sax::XDocumentHandler > &i_xHandler, const css::uno::Sequence< css::beans::StringPair > &i_rNamespaces) override |
virtual void SAL_CALL | fastSerialize (const css::uno::Reference< css::xml::sax::XFastDocumentHandler > &handler, const css::uno::Reference< css::xml::sax::XFastTokenHandler > &tokenHandler, const css::uno::Sequence< css::beans::StringPair > &i_rNamespaces, const css::uno::Sequence< css::beans::Pair< OUString, sal_Int32 > > &namespaces) override |
Private Types | |
typedef o3tl::sorted_vector< css::uno::Reference< css::io::XStreamListener > > | listenerlist_t |
typedef std::unordered_map< xmlNodePtr, ::std::pair< css::uno::WeakReference< css::xml::dom::XNode >, CNode * > > | nodemap_t |
Private Member Functions | |
CDocument (xmlDocPtr const pDocPtr) | |
Private Attributes | |
::osl::Mutex | m_Mutex |
this Mutex is used for synchronization of all UNO wrapper objects that belong to this document More... | |
xmlDocPtr const | m_aDocPtr |
the libxml document: freed in destructor => all UNO wrapper objects must keep the CDocument alive More... | |
listenerlist_t | m_streamListeners |
css::uno::Reference< css::io::XOutputStream > | m_rOutputStream |
nodemap_t | m_NodeMap |
::std::unique_ptr< events::CEventDispatcher > const | m_pEventDispatcher |
Definition at line 66 of file document.hxx.
|
private |
Definition at line 79 of file document.hxx.
|
private |
Definition at line 84 of file document.hxx.
|
explicitprivate |
Definition at line 86 of file document.cxx.
Referenced by CreateCDocument(), and GetCNode().
|
overridevirtual |
Definition at line 106 of file document.cxx.
|
overridevirtual |
Definition at line 314 of file document.cxx.
References o3tl::sorted_vector< typename Value, typename Compare, template< typename, typename > class Find, bool >::insert(), m_Mutex, and m_streamListeners.
|
inlineoverridevirtual |
Definition at line 234 of file document.hxx.
|
overridevirtual |
Definition at line 923 of file document.cxx.
References CreateCDocument(), get(), m_aDocPtr, and m_rMutex.
|
overridevirtual |
Creates an Attr of the given name.
Definition at line 415 of file document.cxx.
References get(), GetCNode(), m_aDocPtr, m_Mutex, name, OUStringToOString(), and pName.
|
overridevirtual |
Creates an attribute of the given qualified name and namespace URI.
Definition at line 431 of file document.cxx.
References get(), GetCNode(), i, m_aDocPtr, m_Mutex, ns, and OUStringToOString().
|
overridevirtual |
Creates a CDATASection node whose value is the specified string.
Definition at line 466 of file document.cxx.
References get(), GetCNode(), m_aDocPtr, m_Mutex, OUStringToOString(), and pData.
rtl::Reference< CDocument > DOM::CDocument::CreateCDocument | ( | xmlDocPtr const | pDoc | ) |
factory: only way to create instance!
Definition at line 94 of file document.cxx.
References CDocument().
Referenced by cloneNode(), DOM::CDocumentBuilder::newDocument(), DOM::CDocumentBuilder::parse(), and DOM::CDocumentBuilder::parseURI().
|
overridevirtual |
Creates a Comment node given the specified string.
Definition at line 483 of file document.cxx.
References get(), GetCNode(), m_aDocPtr, m_Mutex, OUStringToOString(), and pData.
|
overridevirtual |
Creates an empty DocumentFragment object.
Definition at line 497 of file document.cxx.
References get(), GetCNode(), m_aDocPtr, and m_Mutex.
|
overridevirtual |
Creates an element of the type specified.
Definition at line 509 of file document.cxx.
References get(), GetCNode(), m_aDocPtr, m_Mutex, OUStringToOString(), and pName.
|
overridevirtual |
Creates an element of the given qualified name and namespace URI.
Definition at line 523 of file document.cxx.
References get(), GetCNode(), i, m_aDocPtr, m_Mutex, ns, OUStringToOString(), and pName.
|
overridevirtual |
Creates an EntityReference object.
Definition at line 559 of file document.cxx.
References get(), GetCNode(), m_aDocPtr, m_Mutex, name, OUStringToOString(), and pName.
|
overridevirtual |
Definition at line 938 of file document.cxx.
|
overridevirtual |
Creates a ProcessingInstruction node given the specified name and data strings.
Definition at line 574 of file document.cxx.
References get(), GetCNode(), m_aDocPtr, m_Mutex, OUStringToOString(), and pData.
|
overridevirtual |
Creates a Text node given the specified string.
Definition at line 592 of file document.cxx.
References get(), GetCNode(), m_aDocPtr, m_Mutex, OUStringToOString(), and pData.
|
overridevirtual |
Definition at line 282 of file document.cxx.
References GetCNode(), and DOM::Context::mxDocHandler.
Referenced by fastSerialize().
|
overridevirtual |
Definition at line 989 of file document.cxx.
References fastSaxify(), DOM::lcl_getDocumentRootPtr(), m_aDocPtr, m_Mutex, DOM::Context::maNamespaceMap, DOM::nscleanup(), OUStringToOString(), and prefix.
|
inlineoverridevirtual |
Definition at line 238 of file document.hxx.
|
inlineoverridevirtual |
Definition at line 242 of file document.hxx.
rtl::Reference< CNode > DOM::CDocument::GetCNode | ( | xmlNodePtr const | pNode, |
bool const | bCreate = true |
||
) |
get UNO wrapper instance for a libxml node
NB: this is the CNode factory.
it is the only place where CNodes may be instantiated. all CNodes must be registered at the m_NodeMap.
Definition at line 161 of file document.cxx.
References CDocument(), i, m_Mutex, and m_NodeMap.
Referenced by createAttribute(), createAttributeNS(), createCDATASection(), createComment(), createDocumentFragment(), createElement(), createElementNS(), createEntityReference(), createProcessingInstruction(), createTextNode(), DOM::events::CEventDispatcher::dispatchEvent(), fastSaxify(), getDoctype(), GetDocumentElement(), getDocumentElement(), getElementById(), and saxify().
|
overridevirtual |
The Document Type Declaration (see DocumentType) associated with this document.
Definition at line 607 of file document.cxx.
References get(), GetCNode(), DOM::lcl_getDocumentType(), m_aDocPtr, and m_Mutex.
rtl::Reference< CElement > DOM::CDocument::GetDocumentElement | ( | ) |
Definition at line 127 of file document.cxx.
References get(), GetCNode(), DOM::lcl_getDocumentRootPtr(), and m_aDocPtr.
Referenced by getElementsByTagName(), and getElementsByTagNameNS().
|
overridevirtual |
This is a convenience attribute that allows direct access to the child node that is the root element of the document.
Definition at line 620 of file document.cxx.
References get(), GetCNode(), DOM::lcl_getDocumentRootPtr(), m_aDocPtr, and m_Mutex.
|
overridevirtual |
Returns the Element whose ID is given by elementId.
Definition at line 660 of file document.cxx.
References get(), GetCNode(), DOM::lcl_getDocumentRootPtr(), DOM::lcl_search_element_by_id(), m_aDocPtr, m_Mutex, and OUStringToOString().
|
overridevirtual |
Returns a NodeList of all the Elements with a given tag name in the order in which they are encountered in a preorder traversal of the Document tree.
Definition at line 678 of file document.cxx.
References GetDocumentElement(), and m_Mutex.
|
overridevirtual |
Returns a NodeList of all the Elements with a given local name and namespace URI in the order in which they are encountered in a preorder traversal of the Document tree.
Definition at line 687 of file document.cxx.
References GetDocumentElement(), and m_Mutex.
events::CEventDispatcher & DOM::CDocument::GetEventDispatcher | ( | ) |
Definition at line 122 of file document.cxx.
References m_pEventDispatcher.
|
inlineoverridevirtual |
Definition at line 246 of file document.hxx.
|
overridevirtual |
The DOMImplementation object that handles this document.
Definition at line 698 of file document.cxx.
References DOM::CDOMImplementation::get().
|
inlineoverridevirtual |
Definition at line 250 of file document.hxx.
|
inlineoverridevirtual |
Definition at line 254 of file document.hxx.
|
inline |
Definition at line 100 of file document.hxx.
References m_Mutex.
|
inlineoverridevirtual |
Definition at line 258 of file document.hxx.
|
inlineoverridevirtual |
Definition at line 262 of file document.hxx.
|
overridevirtual |
Definition at line 911 of file document.cxx.
|
inlineoverridevirtual |
Definition at line 266 of file document.hxx.
|
overridevirtual |
Definition at line 917 of file document.cxx.
|
overridevirtual |
Definition at line 407 of file document.cxx.
References m_Mutex, and m_rOutputStream.
|
overridevirtual |
Definition at line 265 of file document.cxx.
|
inlineoverridevirtual |
Definition at line 270 of file document.hxx.
|
inlineoverridevirtual |
Definition at line 274 of file document.hxx.
|
inlineoverridevirtual |
Definition at line 278 of file document.hxx.
|
inlineoverridevirtual |
Definition at line 282 of file document.hxx.
|
inlineoverridevirtual |
Definition at line 286 of file document.hxx.
|
inlineoverridevirtual |
Definition at line 290 of file document.hxx.
|
overridevirtual |
Imports a node from another document to this document.
Definition at line 881 of file document.cxx.
References DOM::lcl_ImportNode().
|
inlineoverridevirtual |
Definition at line 294 of file document.hxx.
|
overridevirtual |
Definition at line 294 of file document.cxx.
References DOM::lcl_getDocumentRootPtr(), DOM::lcl_getDocumentType(), and m_aDocPtr.
|
inlineoverridevirtual |
Definition at line 299 of file document.hxx.
|
inlineoverridevirtual |
Definition at line 303 of file document.hxx.
|
inlineoverridevirtual |
Definition at line 307 of file document.hxx.
void DOM::CDocument::RemoveCNode | ( | xmlNodePtr const | pNode, |
CNode const *const | pCNode | ||
) |
remove a UNO wrapper instance
Definition at line 136 of file document.cxx.
|
overridevirtual |
Definition at line 321 of file document.cxx.
References o3tl::sorted_vector< typename Value, typename Compare, template< typename, typename > class Find, bool >::erase(), m_Mutex, and m_streamListeners.
|
inlineoverridevirtual |
Definition at line 311 of file document.hxx.
|
overridevirtual |
|
overridevirtual |
Definition at line 964 of file document.cxx.
References DOM::lcl_getDocumentRootPtr(), m_aDocPtr, m_Mutex, DOM::nscleanup(), OUStringToOString(), prefix, and saxify().
|
inlineoverridevirtual |
Definition at line 316 of file document.hxx.
|
overridevirtual |
Definition at line 400 of file document.cxx.
References m_Mutex, and m_rOutputStream.
|
inlineoverridevirtual |
Definition at line 320 of file document.hxx.
References prefix.
|
overridevirtual |
Definition at line 361 of file document.cxx.
References DOM::closeCallback(), m_Mutex, m_rOutputStream, m_streamListeners, pOut, and DOM::writeCallback().
|
overridevirtual |
Definition at line 395 of file document.cxx.
|
private |
the libxml document: freed in destructor => all UNO wrapper objects must keep the CDocument alive
Definition at line 76 of file document.hxx.
Referenced by cloneNode(), createAttribute(), createAttributeNS(), createCDATASection(), createComment(), createDocumentFragment(), createElement(), createElementNS(), createEntityReference(), createProcessingInstruction(), createTextNode(), fastSerialize(), getDoctype(), GetDocumentElement(), getDocumentElement(), getElementById(), IsChildTypeAllowed(), serialize(), and ~CDocument().
|
private |
this Mutex is used for synchronization of all UNO wrapper objects that belong to this document
Definition at line 73 of file document.hxx.
Referenced by addListener(), createAttribute(), createAttributeNS(), createCDATASection(), createComment(), createDocumentFragment(), createElement(), createElementNS(), createEntityReference(), createProcessingInstruction(), createTextNode(), fastSerialize(), GetCNode(), getDoctype(), getDocumentElement(), getElementById(), getElementsByTagName(), getElementsByTagNameNS(), GetMutex(), getOutputStream(), removeListener(), serialize(), setOutputStream(), start(), and ~CDocument().
|
private |
Definition at line 85 of file document.hxx.
Referenced by GetCNode(), RemoveCNode(), and ~CDocument().
|
private |
Definition at line 87 of file document.hxx.
Referenced by GetEventDispatcher().
|
private |
Definition at line 81 of file document.hxx.
Referenced by getOutputStream(), setOutputStream(), and start().
|
private |
Definition at line 80 of file document.hxx.
Referenced by addListener(), removeListener(), and start().