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_DOCUMENTFRAGMENT_HXX 25 #define DOM_DOCUMENTFRAGMENT_HXX 26 27 #include <com/sun/star/uno/Reference.h> 28 #include <com/sun/star/xml/dom/XDocumentFragment.hpp> 29 30 #include <node.hxx> 31 32 33 using ::rtl::OUString; 34 using namespace com::sun::star::uno; 35 using namespace com::sun::star::xml::dom; 36 37 namespace DOM 38 { 39 typedef ::cppu::ImplInheritanceHelper1< CNode, XDocumentFragment > 40 CDocumentFragment_Base; 41 42 class CDocumentFragment 43 : public CDocumentFragment_Base 44 { 45 private: 46 friend class CDocument; 47 48 protected: 49 CDocumentFragment( 50 CDocument const& rDocument, ::osl::Mutex const& rMutex, 51 xmlNodePtr const pNode); 52 53 public: 54 virtual bool IsChildTypeAllowed(NodeType const nodeType); 55 56 // ---- resolve uno inheritance problems... 57 // overrides for XNode base 58 virtual OUString SAL_CALL getNodeName() 59 throw (RuntimeException); 60 virtual OUString SAL_CALL getNodeValue() 61 throw (RuntimeException); 62 // --- delegation for XNde base. appendChild(const Reference<XNode> & newChild)63 virtual Reference< XNode > SAL_CALL appendChild(const Reference< XNode >& newChild) 64 throw (RuntimeException, DOMException) 65 { 66 return CNode::appendChild(newChild); 67 } cloneNode(sal_Bool deep)68 virtual Reference< XNode > SAL_CALL cloneNode(sal_Bool deep) 69 throw (RuntimeException) 70 { 71 return CNode::cloneNode(deep); 72 } getAttributes()73 virtual Reference< XNamedNodeMap > SAL_CALL getAttributes() 74 throw (RuntimeException) 75 { 76 return CNode::getAttributes(); 77 } getChildNodes()78 virtual Reference< XNodeList > SAL_CALL getChildNodes() 79 throw (RuntimeException) 80 { 81 return CNode::getChildNodes(); 82 } getFirstChild()83 virtual Reference< XNode > SAL_CALL getFirstChild() 84 throw (RuntimeException) 85 { 86 return CNode::getFirstChild(); 87 } getLastChild()88 virtual Reference< XNode > SAL_CALL getLastChild() 89 throw (RuntimeException) 90 { 91 return CNode::getLastChild(); 92 } getLocalName()93 virtual OUString SAL_CALL getLocalName() 94 throw (RuntimeException) 95 { 96 return CNode::getLocalName(); 97 } getNamespaceURI()98 virtual OUString SAL_CALL getNamespaceURI() 99 throw (RuntimeException) 100 { 101 return CNode::getNamespaceURI(); 102 } getNextSibling()103 virtual Reference< XNode > SAL_CALL getNextSibling() 104 throw (RuntimeException) 105 { 106 return CNode::getNextSibling(); 107 } getNodeType()108 virtual NodeType SAL_CALL getNodeType() 109 throw (RuntimeException) 110 { 111 return CNode::getNodeType(); 112 } getOwnerDocument()113 virtual Reference< XDocument > SAL_CALL getOwnerDocument() 114 throw (RuntimeException) 115 { 116 return CNode::getOwnerDocument(); 117 } getParentNode()118 virtual Reference< XNode > SAL_CALL getParentNode() 119 throw (RuntimeException) 120 { 121 return CNode::getParentNode(); 122 } getPrefix()123 virtual OUString SAL_CALL getPrefix() 124 throw (RuntimeException) 125 { 126 return CNode::getPrefix(); 127 } getPreviousSibling()128 virtual Reference< XNode > SAL_CALL getPreviousSibling() 129 throw (RuntimeException) 130 { 131 return CNode::getPreviousSibling(); 132 } hasAttributes()133 virtual sal_Bool SAL_CALL hasAttributes() 134 throw (RuntimeException) 135 { 136 return CNode::hasAttributes(); 137 } hasChildNodes()138 virtual sal_Bool SAL_CALL hasChildNodes() 139 throw (RuntimeException) 140 { 141 return CNode::hasChildNodes(); 142 } insertBefore(const Reference<XNode> & newChild,const Reference<XNode> & refChild)143 virtual Reference< XNode > SAL_CALL insertBefore( 144 const Reference< XNode >& newChild, const Reference< XNode >& refChild) 145 throw (RuntimeException, DOMException) 146 { 147 return CNode::insertBefore(newChild, refChild); 148 } isSupported(const OUString & feature,const OUString & ver)149 virtual sal_Bool SAL_CALL isSupported(const OUString& feature, const OUString& ver) 150 throw (RuntimeException) 151 { 152 return CNode::isSupported(feature, ver); 153 } normalize()154 virtual void SAL_CALL normalize() 155 throw (RuntimeException) 156 { 157 CNode::normalize(); 158 } removeChild(const Reference<XNode> & oldChild)159 virtual Reference< XNode > SAL_CALL removeChild(const Reference< XNode >& oldChild) 160 throw (RuntimeException, DOMException) 161 { 162 return CNode::removeChild(oldChild); 163 } replaceChild(const Reference<XNode> & newChild,const Reference<XNode> & oldChild)164 virtual Reference< XNode > SAL_CALL replaceChild( 165 const Reference< XNode >& newChild, const Reference< XNode >& oldChild) 166 throw (RuntimeException, DOMException) 167 { 168 return CNode::replaceChild(newChild, oldChild); 169 } setNodeValue(const OUString & nodeValue)170 virtual void SAL_CALL setNodeValue(const OUString& nodeValue) 171 throw (RuntimeException, DOMException) 172 { 173 return CNode::setNodeValue(nodeValue); 174 } setPrefix(const OUString & prefix)175 virtual void SAL_CALL setPrefix(const OUString& prefix) 176 throw (RuntimeException, DOMException) 177 { 178 return CNode::setPrefix(prefix); 179 } 180 181 182 }; 183 } 184 #endif 185 186