1 /************************************************************************* 2 * 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 * 5 * Copyright 2000, 2010 Oracle and/or its affiliates. 6 * 7 * OpenOffice.org - a multi-platform office productivity suite 8 * 9 * This file is part of OpenOffice.org. 10 * 11 * OpenOffice.org is free software: you can redistribute it and/or modify 12 * it under the terms of the GNU Lesser General Public License version 3 13 * only, as published by the Free Software Foundation. 14 * 15 * OpenOffice.org is distributed in the hope that it will be useful, 16 * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 * GNU Lesser General Public License version 3 for more details 19 * (a copy is included in the LICENSE file that accompanied this code). 20 * 21 * You should have received a copy of the GNU Lesser General Public License 22 * version 3 along with OpenOffice.org. If not, see 23 * <http://www.openoffice.org/license.html> 24 * for a copy of the LGPLv3 License. 25 * 26 ************************************************************************/ 27 28 #ifndef DOM_ENTITY_HXX 29 #define DOM_ENTITY_HXX 30 31 #include <libxml/tree.h> 32 #include <libxml/entities.h> 33 34 #include <sal/types.h> 35 36 #include <com/sun/star/uno/Reference.h> 37 #include <com/sun/star/xml/dom/XEntity.hpp> 38 39 #include <node.hxx> 40 41 42 using ::rtl::OUString; 43 using namespace com::sun::star::uno; 44 using namespace com::sun::star::xml::dom; 45 46 namespace DOM 47 { 48 typedef ::cppu::ImplInheritanceHelper1< CNode, XEntity > CEntity_Base; 49 50 class CEntity 51 : public CEntity_Base 52 { 53 private: 54 friend class CDocument; 55 56 private: 57 xmlEntityPtr m_aEntityPtr; 58 59 protected: 60 CEntity(CDocument const& rDocument, ::osl::Mutex const& rMutex, 61 xmlEntityPtr const pEntity); 62 63 public: 64 virtual bool IsChildTypeAllowed(NodeType const nodeType); 65 66 /** 67 For unparsed entities, the name of the notation for the entity. 68 */ 69 virtual OUString SAL_CALL getNotationName() throw (RuntimeException); 70 71 /** 72 The public identifier associated with the entity, if specified. 73 */ 74 virtual OUString SAL_CALL getPublicId() throw (RuntimeException); 75 76 /** 77 The system identifier associated with the entity, if specified. 78 */ 79 virtual OUString SAL_CALL getSystemId() throw (RuntimeException); 80 81 // ---- resolve uno inheritance problems... 82 // overrides for XNode base 83 virtual OUString SAL_CALL getNodeName() 84 throw (RuntimeException); 85 virtual OUString SAL_CALL getNodeValue() 86 throw (RuntimeException); 87 // --- delegation for XNde base. 88 virtual Reference< XNode > SAL_CALL appendChild(const Reference< XNode >& newChild) 89 throw (RuntimeException, DOMException) 90 { 91 return CNode::appendChild(newChild); 92 } 93 virtual Reference< XNode > SAL_CALL cloneNode(sal_Bool deep) 94 throw (RuntimeException) 95 { 96 return CNode::cloneNode(deep); 97 } 98 virtual Reference< XNamedNodeMap > SAL_CALL getAttributes() 99 throw (RuntimeException) 100 { 101 return CNode::getAttributes(); 102 } 103 virtual Reference< XNodeList > SAL_CALL getChildNodes() 104 throw (RuntimeException) 105 { 106 return CNode::getChildNodes(); 107 } 108 virtual Reference< XNode > SAL_CALL getFirstChild() 109 throw (RuntimeException) 110 { 111 return CNode::getFirstChild(); 112 } 113 virtual Reference< XNode > SAL_CALL getLastChild() 114 throw (RuntimeException) 115 { 116 return CNode::getLastChild(); 117 } 118 virtual OUString SAL_CALL getLocalName() 119 throw (RuntimeException) 120 { 121 return CNode::getLocalName(); 122 } 123 virtual OUString SAL_CALL getNamespaceURI() 124 throw (RuntimeException) 125 { 126 return CNode::getNamespaceURI(); 127 } 128 virtual Reference< XNode > SAL_CALL getNextSibling() 129 throw (RuntimeException) 130 { 131 return CNode::getNextSibling(); 132 } 133 virtual NodeType SAL_CALL getNodeType() 134 throw (RuntimeException) 135 { 136 return CNode::getNodeType(); 137 } 138 virtual Reference< XDocument > SAL_CALL getOwnerDocument() 139 throw (RuntimeException) 140 { 141 return CNode::getOwnerDocument(); 142 } 143 virtual Reference< XNode > SAL_CALL getParentNode() 144 throw (RuntimeException) 145 { 146 return CNode::getParentNode(); 147 } 148 virtual OUString SAL_CALL getPrefix() 149 throw (RuntimeException) 150 { 151 return CNode::getPrefix(); 152 } 153 virtual Reference< XNode > SAL_CALL getPreviousSibling() 154 throw (RuntimeException) 155 { 156 return CNode::getPreviousSibling(); 157 } 158 virtual sal_Bool SAL_CALL hasAttributes() 159 throw (RuntimeException) 160 { 161 return CNode::hasAttributes(); 162 } 163 virtual sal_Bool SAL_CALL hasChildNodes() 164 throw (RuntimeException) 165 { 166 return CNode::hasChildNodes(); 167 } 168 virtual Reference< XNode > SAL_CALL insertBefore( 169 const Reference< XNode >& newChild, const Reference< XNode >& refChild) 170 throw (RuntimeException, DOMException) 171 { 172 return CNode::insertBefore(newChild, refChild); 173 } 174 virtual sal_Bool SAL_CALL isSupported(const OUString& feature, const OUString& ver) 175 throw (RuntimeException) 176 { 177 return CNode::isSupported(feature, ver); 178 } 179 virtual void SAL_CALL normalize() 180 throw (RuntimeException) 181 { 182 CNode::normalize(); 183 } 184 virtual Reference< XNode > SAL_CALL removeChild(const Reference< XNode >& oldChild) 185 throw (RuntimeException, DOMException) 186 { 187 return CNode::removeChild(oldChild); 188 } 189 virtual Reference< XNode > SAL_CALL replaceChild( 190 const Reference< XNode >& newChild, const Reference< XNode >& oldChild) 191 throw (RuntimeException, DOMException) 192 { 193 return CNode::replaceChild(newChild, oldChild); 194 } 195 virtual void SAL_CALL setNodeValue(const OUString& nodeValue) 196 throw (RuntimeException, DOMException) 197 { 198 return CNode::setNodeValue(nodeValue); 199 } 200 virtual void SAL_CALL setPrefix(const OUString& prefix) 201 throw (RuntimeException, DOMException) 202 { 203 return CNode::setPrefix(prefix); 204 } 205 206 207 }; 208 } 209 210 #endif 211