bump product version to 4.1.6.2
[LibreOffice.git] / unoxml / source / dom / text.hxx
blob35d8c6b9802c3b0d72f8fbcb55dfd6084f612e3d
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #ifndef DOM_TEXT_HXX
21 #define DOM_TEXT_HXX
23 #include <libxml/tree.h>
25 #include <sal/types.h>
27 #include <cppuhelper/implbase1.hxx>
29 #include <com/sun/star/uno/Reference.h>
30 #include <com/sun/star/xml/dom/XNode.hpp>
31 #include <com/sun/star/xml/dom/XText.hpp>
33 #include <characterdata.hxx>
36 using namespace com::sun::star::uno;
37 using namespace com::sun::star::xml::dom;
39 namespace DOM
41 typedef ::cppu::ImplInheritanceHelper1< CCharacterData, XText > CText_Base;
43 class CText
44 : public CText_Base
46 private:
47 friend class CDocument;
49 protected:
50 CText(CDocument const& rDocument, ::osl::Mutex const& rMutex,
51 NodeType const& reNodeType, xmlNodePtr const& rpNode);
52 CText(CDocument const& rDocument, ::osl::Mutex const& rMutex,
53 xmlNodePtr const pNode);
55 public:
57 virtual void saxify(const Reference< XDocumentHandler >& i_xHandler);
59 virtual void fastSaxify( Context& io_rContext );
61 // Breaks this node into two nodes at the specified offset, keeping
62 // both in the tree as siblings.
63 virtual Reference< XText > SAL_CALL splitText(sal_Int32 offset)
64 throw (RuntimeException);
67 // --- delegations for XCharacterData
68 virtual void SAL_CALL appendData(const OUString& arg)
69 throw (RuntimeException, DOMException)
71 CCharacterData::appendData(arg);
73 virtual void SAL_CALL deleteData(sal_Int32 offset, sal_Int32 count)
74 throw (RuntimeException, DOMException)
76 CCharacterData::deleteData(offset, count);
78 virtual OUString SAL_CALL getData() throw (RuntimeException)
80 return CCharacterData::getData();
82 virtual sal_Int32 SAL_CALL getLength() throw (RuntimeException)
84 return CCharacterData::getLength();
86 virtual void SAL_CALL insertData(sal_Int32 offset, const OUString& arg)
87 throw (RuntimeException, DOMException)
89 CCharacterData::insertData(offset, arg);
91 virtual void SAL_CALL replaceData(sal_Int32 offset, sal_Int32 count, const OUString& arg)
92 throw (RuntimeException, DOMException)
94 CCharacterData::replaceData(offset, count, arg);
96 virtual void SAL_CALL setData(const OUString& data)
97 throw (RuntimeException, DOMException)
99 CCharacterData::setData(data);
101 virtual OUString SAL_CALL subStringData(sal_Int32 offset, sal_Int32 count)
102 throw (RuntimeException, DOMException)
104 return CCharacterData::subStringData(offset, count);
108 // --- overrides for XNode base
109 virtual OUString SAL_CALL getNodeName()
110 throw (RuntimeException);
112 // --- resolve uno inheritance problems...
113 // --- delegation for XNde base.
114 virtual Reference< XNode > SAL_CALL appendChild(const Reference< XNode >& newChild)
115 throw (RuntimeException, DOMException)
117 return CCharacterData::appendChild(newChild);
119 virtual Reference< XNode > SAL_CALL cloneNode(sal_Bool deep)
120 throw (RuntimeException)
122 return CCharacterData::cloneNode(deep);
124 virtual Reference< XNamedNodeMap > SAL_CALL getAttributes()
125 throw (RuntimeException)
127 return CCharacterData::getAttributes();
129 virtual Reference< XNodeList > SAL_CALL getChildNodes()
130 throw (RuntimeException)
132 return CCharacterData::getChildNodes();
134 virtual Reference< XNode > SAL_CALL getFirstChild()
135 throw (RuntimeException)
137 return CCharacterData::getFirstChild();
139 virtual Reference< XNode > SAL_CALL getLastChild()
140 throw (RuntimeException)
142 return CCharacterData::getLastChild();
144 virtual OUString SAL_CALL getLocalName()
145 throw (RuntimeException)
147 return CCharacterData::getLocalName();
149 virtual OUString SAL_CALL getNamespaceURI()
150 throw (RuntimeException)
152 return CCharacterData::getNamespaceURI();
154 virtual Reference< XNode > SAL_CALL getNextSibling()
155 throw (RuntimeException)
157 return CCharacterData::getNextSibling();
159 virtual NodeType SAL_CALL getNodeType()
160 throw (RuntimeException)
162 return CCharacterData::getNodeType();
164 virtual OUString SAL_CALL getNodeValue() throw (RuntimeException)
166 return CCharacterData::getNodeValue();
168 virtual Reference< XDocument > SAL_CALL getOwnerDocument()
169 throw (RuntimeException)
171 return CCharacterData::getOwnerDocument();
173 virtual Reference< XNode > SAL_CALL getParentNode()
174 throw (RuntimeException)
176 return CCharacterData::getParentNode();
178 virtual OUString SAL_CALL getPrefix()
179 throw (RuntimeException)
181 return CCharacterData::getPrefix();
183 virtual Reference< XNode > SAL_CALL getPreviousSibling()
184 throw (RuntimeException)
186 return CCharacterData::getPreviousSibling();
188 virtual sal_Bool SAL_CALL hasAttributes()
189 throw (RuntimeException)
191 return CCharacterData::hasAttributes();
193 virtual sal_Bool SAL_CALL hasChildNodes()
194 throw (RuntimeException)
196 return CCharacterData::hasChildNodes();
198 virtual Reference< XNode > SAL_CALL insertBefore(
199 const Reference< XNode >& newChild, const Reference< XNode >& refChild)
200 throw (RuntimeException, DOMException)
202 return CCharacterData::insertBefore(newChild, refChild);
204 virtual sal_Bool SAL_CALL isSupported(const OUString& feature, const OUString& ver)
205 throw (RuntimeException)
207 return CCharacterData::isSupported(feature, ver);
209 virtual void SAL_CALL normalize()
210 throw (RuntimeException)
212 CCharacterData::normalize();
214 virtual Reference< XNode > SAL_CALL removeChild(const Reference< XNode >& oldChild)
215 throw (RuntimeException, DOMException)
217 return CCharacterData::removeChild(oldChild);
219 virtual Reference< XNode > SAL_CALL replaceChild(
220 const Reference< XNode >& newChild, const Reference< XNode >& oldChild)
221 throw (RuntimeException, DOMException)
223 return CCharacterData::replaceChild(newChild, oldChild);
225 virtual void SAL_CALL setNodeValue(const OUString& nodeValue)
226 throw (RuntimeException, DOMException)
228 return CCharacterData::setNodeValue(nodeValue);
230 virtual void SAL_CALL setPrefix(const OUString& prefix)
231 throw (RuntimeException, DOMException)
233 return CCharacterData::setPrefix(prefix);
238 #endif
240 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */