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_COMMENT_HXX 25 #define DOM_COMMENT_HXX 26 27 #include <com/sun/star/uno/Reference.h> 28 #include <com/sun/star/xml/dom/XComment.hpp> 29 30 #include <characterdata.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< CCharacterData, XComment > 40 CComment_Base; 41 42 class CComment 43 : public CComment_Base 44 { 45 private: 46 friend class CDocument; 47 48 protected: 49 CComment(CDocument const& rDocument, ::osl::Mutex const& rMutex, 50 xmlNodePtr const pNode); 51 52 public: 53 54 virtual void saxify(const Reference< XDocumentHandler >& i_xHandler); 55 56 // --- delegations for XCharacterData appendData(const OUString & arg)57 virtual void SAL_CALL appendData(const OUString& arg) 58 { 59 CCharacterData::appendData(arg); 60 } deleteData(sal_Int32 offset,sal_Int32 count)61 virtual void SAL_CALL deleteData(sal_Int32 offset, sal_Int32 count) 62 { 63 CCharacterData::deleteData(offset, count); 64 } getData()65 virtual OUString SAL_CALL getData() 66 { 67 return CCharacterData::getData(); 68 } getLength()69 virtual sal_Int32 SAL_CALL getLength() 70 { 71 return CCharacterData::getLength(); 72 } insertData(sal_Int32 offset,const OUString & arg)73 virtual void SAL_CALL insertData(sal_Int32 offset, const OUString& arg) 74 { 75 CCharacterData::insertData(offset, arg); 76 } replaceData(sal_Int32 offset,sal_Int32 count,const OUString & arg)77 virtual void SAL_CALL replaceData(sal_Int32 offset, sal_Int32 count, const OUString& arg) 78 { 79 CCharacterData::replaceData(offset, count, arg); 80 } setData(const OUString & data)81 virtual void SAL_CALL setData(const OUString& data) 82 { 83 CCharacterData::setData(data); 84 } subStringData(sal_Int32 offset,sal_Int32 count)85 virtual OUString SAL_CALL subStringData(sal_Int32 offset, sal_Int32 count) 86 { 87 return CCharacterData::subStringData(offset, count); 88 } 89 90 91 // --- overrides for XNode base 92 virtual OUString SAL_CALL getNodeName(); 93 virtual OUString SAL_CALL getNodeValue(); 94 95 // --- delegation for XNde base. appendChild(const Reference<XNode> & newChild)96 virtual Reference< XNode > SAL_CALL appendChild(const Reference< XNode >& newChild) 97 { 98 return CCharacterData::appendChild(newChild); 99 } cloneNode(sal_Bool deep)100 virtual Reference< XNode > SAL_CALL cloneNode(sal_Bool deep) 101 { 102 return CCharacterData::cloneNode(deep); 103 } getAttributes()104 virtual Reference< XNamedNodeMap > SAL_CALL getAttributes() 105 { 106 return CCharacterData::getAttributes(); 107 } getChildNodes()108 virtual Reference< XNodeList > SAL_CALL getChildNodes() 109 { 110 return CCharacterData::getChildNodes(); 111 } getFirstChild()112 virtual Reference< XNode > SAL_CALL getFirstChild() 113 { 114 return CCharacterData::getFirstChild(); 115 } getLastChild()116 virtual Reference< XNode > SAL_CALL getLastChild() 117 { 118 return CCharacterData::getLastChild(); 119 } getLocalName()120 virtual OUString SAL_CALL getLocalName() 121 { 122 return CCharacterData::getLocalName(); 123 } getNamespaceURI()124 virtual OUString SAL_CALL getNamespaceURI() 125 { 126 return CCharacterData::getNamespaceURI(); 127 } getNextSibling()128 virtual Reference< XNode > SAL_CALL getNextSibling() 129 { 130 return CCharacterData::getNextSibling(); 131 } getNodeType()132 virtual NodeType SAL_CALL getNodeType() 133 { 134 return CCharacterData::getNodeType(); 135 } getOwnerDocument()136 virtual Reference< XDocument > SAL_CALL getOwnerDocument() 137 { 138 return CCharacterData::getOwnerDocument(); 139 } getParentNode()140 virtual Reference< XNode > SAL_CALL getParentNode() 141 { 142 return CCharacterData::getParentNode(); 143 } getPrefix()144 virtual OUString SAL_CALL getPrefix() 145 { 146 return CCharacterData::getPrefix(); 147 } getPreviousSibling()148 virtual Reference< XNode > SAL_CALL getPreviousSibling() 149 { 150 return CCharacterData::getPreviousSibling(); 151 } hasAttributes()152 virtual sal_Bool SAL_CALL hasAttributes() 153 { 154 return CCharacterData::hasAttributes(); 155 } hasChildNodes()156 virtual sal_Bool SAL_CALL hasChildNodes() 157 { 158 return CCharacterData::hasChildNodes(); 159 } insertBefore(const Reference<XNode> & newChild,const Reference<XNode> & refChild)160 virtual Reference< XNode > SAL_CALL insertBefore( 161 const Reference< XNode >& newChild, const Reference< XNode >& refChild) 162 { 163 return CCharacterData::insertBefore(newChild, refChild); 164 } isSupported(const OUString & feature,const OUString & ver)165 virtual sal_Bool SAL_CALL isSupported(const OUString& feature, const OUString& ver) 166 { 167 return CCharacterData::isSupported(feature, ver); 168 } normalize()169 virtual void SAL_CALL normalize() 170 { 171 CCharacterData::normalize(); 172 } removeChild(const Reference<XNode> & oldChild)173 virtual Reference< XNode > SAL_CALL removeChild(const Reference< XNode >& oldChild) 174 { 175 return CCharacterData::removeChild(oldChild); 176 } replaceChild(const Reference<XNode> & newChild,const Reference<XNode> & oldChild)177 virtual Reference< XNode > SAL_CALL replaceChild( 178 const Reference< XNode >& newChild, const Reference< XNode >& oldChild) 179 { 180 return CCharacterData::replaceChild(newChild, oldChild); 181 } setNodeValue(const OUString & nodeValue)182 virtual void SAL_CALL setNodeValue(const OUString& nodeValue) 183 { 184 return CCharacterData::setNodeValue(nodeValue); 185 } setPrefix(const OUString & prefix)186 virtual void SAL_CALL setPrefix(const OUString& prefix) 187 { 188 return CCharacterData::setPrefix(prefix); 189 } 190 191 }; 192 } 193 194 #endif 195