1 /************************************************************** 2 * 3 * Licensed to the Apache Software Foundation (ASF) under one 4 * or more contributor license agreements. See the NOTICE file 5 * distributed with this work for additional information 6 * regarding copyright ownership. The ASF licenses this file 7 * to you under the Apache License, Version 2.0 (the 8 * "License"); you may not use this file except in compliance 9 * with the License. You may obtain a copy of the License at 10 * 11 * http://www.apache.org/licenses/LICENSE-2.0 12 * 13 * Unless required by applicable law or agreed to in writing, 14 * software distributed under the License is distributed on an 15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 * KIND, either express or implied. See the License for the 17 * specific language governing permissions and limitations 18 * under the License. 19 * 20 *************************************************************/ 21 22 23 24 #ifndef DOM_ENTITY_HXX 25 #define DOM_ENTITY_HXX 26 27 #include <libxml/tree.h> 28 #include <libxml/entities.h> 29 30 #include <sal/types.h> 31 32 #include <com/sun/star/uno/Reference.h> 33 #include <com/sun/star/xml/dom/XEntity.hpp> 34 35 #include <node.hxx> 36 37 38 using ::rtl::OUString; 39 using namespace com::sun::star::uno; 40 using namespace com::sun::star::xml::dom; 41 42 namespace DOM 43 { 44 typedef ::cppu::ImplInheritanceHelper1< CNode, XEntity > CEntity_Base; 45 46 class CEntity 47 : public CEntity_Base 48 { 49 private: 50 friend class CDocument; 51 52 private: 53 xmlEntityPtr m_aEntityPtr; 54 55 protected: 56 CEntity(CDocument const& rDocument, ::osl::Mutex const& rMutex, 57 xmlEntityPtr const pEntity); 58 59 public: 60 virtual bool IsChildTypeAllowed(NodeType const nodeType); 61 62 /** 63 For unparsed entities, the name of the notation for the entity. 64 */ 65 virtual OUString SAL_CALL getNotationName() throw (RuntimeException); 66 67 /** 68 The public identifier associated with the entity, if specified. 69 */ 70 virtual OUString SAL_CALL getPublicId() throw (RuntimeException); 71 72 /** 73 The system identifier associated with the entity, if specified. 74 */ 75 virtual OUString SAL_CALL getSystemId() throw (RuntimeException); 76 77 // ---- resolve uno inheritance problems... 78 // overrides for XNode base 79 virtual OUString SAL_CALL getNodeName() 80 throw (RuntimeException); 81 virtual OUString SAL_CALL getNodeValue() 82 throw (RuntimeException); 83 // --- delegation for XNde base. appendChild(const Reference<XNode> & newChild)84 virtual Reference< XNode > SAL_CALL appendChild(const Reference< XNode >& newChild) 85 throw (RuntimeException, DOMException) 86 { 87 return CNode::appendChild(newChild); 88 } cloneNode(sal_Bool deep)89 virtual Reference< XNode > SAL_CALL cloneNode(sal_Bool deep) 90 throw (RuntimeException) 91 { 92 return CNode::cloneNode(deep); 93 } getAttributes()94 virtual Reference< XNamedNodeMap > SAL_CALL getAttributes() 95 throw (RuntimeException) 96 { 97 return CNode::getAttributes(); 98 } getChildNodes()99 virtual Reference< XNodeList > SAL_CALL getChildNodes() 100 throw (RuntimeException) 101 { 102 return CNode::getChildNodes(); 103 } getFirstChild()104 virtual Reference< XNode > SAL_CALL getFirstChild() 105 throw (RuntimeException) 106 { 107 return CNode::getFirstChild(); 108 } getLastChild()109 virtual Reference< XNode > SAL_CALL getLastChild() 110 throw (RuntimeException) 111 { 112 return CNode::getLastChild(); 113 } getLocalName()114 virtual OUString SAL_CALL getLocalName() 115 throw (RuntimeException) 116 { 117 return CNode::getLocalName(); 118 } getNamespaceURI()119 virtual OUString SAL_CALL getNamespaceURI() 120 throw (RuntimeException) 121 { 122 return CNode::getNamespaceURI(); 123 } getNextSibling()124 virtual Reference< XNode > SAL_CALL getNextSibling() 125 throw (RuntimeException) 126 { 127 return CNode::getNextSibling(); 128 } getNodeType()129 virtual NodeType SAL_CALL getNodeType() 130 throw (RuntimeException) 131 { 132 return CNode::getNodeType(); 133 } getOwnerDocument()134 virtual Reference< XDocument > SAL_CALL getOwnerDocument() 135 throw (RuntimeException) 136 { 137 return CNode::getOwnerDocument(); 138 } getParentNode()139 virtual Reference< XNode > SAL_CALL getParentNode() 140 throw (RuntimeException) 141 { 142 return CNode::getParentNode(); 143 } getPrefix()144 virtual OUString SAL_CALL getPrefix() 145 throw (RuntimeException) 146 { 147 return CNode::getPrefix(); 148 } getPreviousSibling()149 virtual Reference< XNode > SAL_CALL getPreviousSibling() 150 throw (RuntimeException) 151 { 152 return CNode::getPreviousSibling(); 153 } hasAttributes()154 virtual sal_Bool SAL_CALL hasAttributes() 155 throw (RuntimeException) 156 { 157 return CNode::hasAttributes(); 158 } hasChildNodes()159 virtual sal_Bool SAL_CALL hasChildNodes() 160 throw (RuntimeException) 161 { 162 return CNode::hasChildNodes(); 163 } insertBefore(const Reference<XNode> & newChild,const Reference<XNode> & refChild)164 virtual Reference< XNode > SAL_CALL insertBefore( 165 const Reference< XNode >& newChild, const Reference< XNode >& refChild) 166 throw (RuntimeException, DOMException) 167 { 168 return CNode::insertBefore(newChild, refChild); 169 } isSupported(const OUString & feature,const OUString & ver)170 virtual sal_Bool SAL_CALL isSupported(const OUString& feature, const OUString& ver) 171 throw (RuntimeException) 172 { 173 return CNode::isSupported(feature, ver); 174 } normalize()175 virtual void SAL_CALL normalize() 176 throw (RuntimeException) 177 { 178 CNode::normalize(); 179 } removeChild(const Reference<XNode> & oldChild)180 virtual Reference< XNode > SAL_CALL removeChild(const Reference< XNode >& oldChild) 181 throw (RuntimeException, DOMException) 182 { 183 return CNode::removeChild(oldChild); 184 } replaceChild(const Reference<XNode> & newChild,const Reference<XNode> & oldChild)185 virtual Reference< XNode > SAL_CALL replaceChild( 186 const Reference< XNode >& newChild, const Reference< XNode >& oldChild) 187 throw (RuntimeException, DOMException) 188 { 189 return CNode::replaceChild(newChild, oldChild); 190 } setNodeValue(const OUString & nodeValue)191 virtual void SAL_CALL setNodeValue(const OUString& nodeValue) 192 throw (RuntimeException, DOMException) 193 { 194 return CNode::setNodeValue(nodeValue); 195 } setPrefix(const OUString & prefix)196 virtual void SAL_CALL setPrefix(const OUString& prefix) 197 throw (RuntimeException, DOMException) 198 { 199 return CNode::setPrefix(prefix); 200 } 201 202 203 }; 204 } 205 206 #endif 207