Line data Source code
1 : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : /*
3 : * This file is part of the LibreOffice project.
4 : *
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/.
8 : *
9 : * This file incorporates work covered by the following license notice:
10 : *
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 .
18 : */
19 :
20 : #ifndef INCLUDED_UNOXML_SOURCE_DOM_TEXT_HXX
21 : #define INCLUDED_UNOXML_SOURCE_DOM_TEXT_HXX
22 :
23 : #include <libxml/tree.h>
24 :
25 : #include <sal/types.h>
26 :
27 : #include <cppuhelper/implbase1.hxx>
28 :
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>
32 :
33 : #include <characterdata.hxx>
34 :
35 :
36 : using namespace com::sun::star::uno;
37 : using namespace com::sun::star::xml::dom;
38 :
39 : namespace DOM
40 : {
41 : typedef ::cppu::ImplInheritanceHelper1< CCharacterData, XText > CText_Base;
42 :
43 0 : class CText
44 : : public CText_Base
45 : {
46 : private:
47 : friend class CDocument;
48 :
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);
54 :
55 : public:
56 :
57 : virtual void saxify(const Reference< XDocumentHandler >& i_xHandler) SAL_OVERRIDE;
58 :
59 : virtual void fastSaxify( Context& io_rContext ) SAL_OVERRIDE;
60 :
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, std::exception) SAL_OVERRIDE;
65 :
66 :
67 : // --- delegations for XCharacterData
68 0 : virtual void SAL_CALL appendData(const OUString& arg)
69 : throw (RuntimeException, DOMException, std::exception) SAL_OVERRIDE
70 : {
71 0 : CCharacterData::appendData(arg);
72 0 : }
73 0 : virtual void SAL_CALL deleteData(sal_Int32 offset, sal_Int32 count)
74 : throw (RuntimeException, DOMException, std::exception) SAL_OVERRIDE
75 : {
76 0 : CCharacterData::deleteData(offset, count);
77 0 : }
78 0 : virtual OUString SAL_CALL getData() throw (RuntimeException, std::exception) SAL_OVERRIDE
79 : {
80 0 : return CCharacterData::getData();
81 : }
82 0 : virtual sal_Int32 SAL_CALL getLength() throw (RuntimeException, std::exception) SAL_OVERRIDE
83 : {
84 0 : return CCharacterData::getLength();
85 : }
86 0 : virtual void SAL_CALL insertData(sal_Int32 offset, const OUString& arg)
87 : throw (RuntimeException, DOMException, std::exception) SAL_OVERRIDE
88 : {
89 0 : CCharacterData::insertData(offset, arg);
90 0 : }
91 0 : virtual void SAL_CALL replaceData(sal_Int32 offset, sal_Int32 count, const OUString& arg)
92 : throw (RuntimeException, DOMException, std::exception) SAL_OVERRIDE
93 : {
94 0 : CCharacterData::replaceData(offset, count, arg);
95 0 : }
96 0 : virtual void SAL_CALL setData(const OUString& data)
97 : throw (RuntimeException, DOMException, std::exception) SAL_OVERRIDE
98 : {
99 0 : CCharacterData::setData(data);
100 0 : }
101 0 : virtual OUString SAL_CALL subStringData(sal_Int32 offset, sal_Int32 count)
102 : throw (RuntimeException, DOMException, std::exception) SAL_OVERRIDE
103 : {
104 0 : return CCharacterData::subStringData(offset, count);
105 : }
106 :
107 :
108 : // --- overrides for XNode base
109 : virtual OUString SAL_CALL getNodeName()
110 : throw (RuntimeException, std::exception) SAL_OVERRIDE;
111 :
112 : // --- resolve uno inheritance problems...
113 : // --- delegation for XNde base.
114 0 : virtual Reference< XNode > SAL_CALL appendChild(const Reference< XNode >& newChild)
115 : throw (RuntimeException, DOMException, std::exception) SAL_OVERRIDE
116 : {
117 0 : return CCharacterData::appendChild(newChild);
118 : }
119 0 : virtual Reference< XNode > SAL_CALL cloneNode(sal_Bool deep)
120 : throw (RuntimeException, std::exception) SAL_OVERRIDE
121 : {
122 0 : return CCharacterData::cloneNode(deep);
123 : }
124 0 : virtual Reference< XNamedNodeMap > SAL_CALL getAttributes()
125 : throw (RuntimeException, std::exception) SAL_OVERRIDE
126 : {
127 0 : return CCharacterData::getAttributes();
128 : }
129 0 : virtual Reference< XNodeList > SAL_CALL getChildNodes()
130 : throw (RuntimeException, std::exception) SAL_OVERRIDE
131 : {
132 0 : return CCharacterData::getChildNodes();
133 : }
134 0 : virtual Reference< XNode > SAL_CALL getFirstChild()
135 : throw (RuntimeException, std::exception) SAL_OVERRIDE
136 : {
137 0 : return CCharacterData::getFirstChild();
138 : }
139 0 : virtual Reference< XNode > SAL_CALL getLastChild()
140 : throw (RuntimeException, std::exception) SAL_OVERRIDE
141 : {
142 0 : return CCharacterData::getLastChild();
143 : }
144 0 : virtual OUString SAL_CALL getLocalName()
145 : throw (RuntimeException, std::exception) SAL_OVERRIDE
146 : {
147 0 : return CCharacterData::getLocalName();
148 : }
149 0 : virtual OUString SAL_CALL getNamespaceURI()
150 : throw (RuntimeException, std::exception) SAL_OVERRIDE
151 : {
152 0 : return CCharacterData::getNamespaceURI();
153 : }
154 0 : virtual Reference< XNode > SAL_CALL getNextSibling()
155 : throw (RuntimeException, std::exception) SAL_OVERRIDE
156 : {
157 0 : return CCharacterData::getNextSibling();
158 : }
159 0 : virtual NodeType SAL_CALL getNodeType()
160 : throw (RuntimeException, std::exception) SAL_OVERRIDE
161 : {
162 0 : return CCharacterData::getNodeType();
163 : }
164 0 : virtual OUString SAL_CALL getNodeValue() throw (RuntimeException, std::exception) SAL_OVERRIDE
165 : {
166 0 : return CCharacterData::getNodeValue();
167 : }
168 0 : virtual Reference< XDocument > SAL_CALL getOwnerDocument()
169 : throw (RuntimeException, std::exception) SAL_OVERRIDE
170 : {
171 0 : return CCharacterData::getOwnerDocument();
172 : }
173 0 : virtual Reference< XNode > SAL_CALL getParentNode()
174 : throw (RuntimeException, std::exception) SAL_OVERRIDE
175 : {
176 0 : return CCharacterData::getParentNode();
177 : }
178 0 : virtual OUString SAL_CALL getPrefix()
179 : throw (RuntimeException, std::exception) SAL_OVERRIDE
180 : {
181 0 : return CCharacterData::getPrefix();
182 : }
183 0 : virtual Reference< XNode > SAL_CALL getPreviousSibling()
184 : throw (RuntimeException, std::exception) SAL_OVERRIDE
185 : {
186 0 : return CCharacterData::getPreviousSibling();
187 : }
188 0 : virtual sal_Bool SAL_CALL hasAttributes()
189 : throw (RuntimeException, std::exception) SAL_OVERRIDE
190 : {
191 0 : return CCharacterData::hasAttributes();
192 : }
193 0 : virtual sal_Bool SAL_CALL hasChildNodes()
194 : throw (RuntimeException, std::exception) SAL_OVERRIDE
195 : {
196 0 : return CCharacterData::hasChildNodes();
197 : }
198 0 : virtual Reference< XNode > SAL_CALL insertBefore(
199 : const Reference< XNode >& newChild, const Reference< XNode >& refChild)
200 : throw (RuntimeException, DOMException, std::exception) SAL_OVERRIDE
201 : {
202 0 : return CCharacterData::insertBefore(newChild, refChild);
203 : }
204 0 : virtual sal_Bool SAL_CALL isSupported(const OUString& feature, const OUString& ver)
205 : throw (RuntimeException, std::exception) SAL_OVERRIDE
206 : {
207 0 : return CCharacterData::isSupported(feature, ver);
208 : }
209 0 : virtual void SAL_CALL normalize()
210 : throw (RuntimeException, std::exception) SAL_OVERRIDE
211 : {
212 0 : CCharacterData::normalize();
213 0 : }
214 0 : virtual Reference< XNode > SAL_CALL removeChild(const Reference< XNode >& oldChild)
215 : throw (RuntimeException, DOMException, std::exception) SAL_OVERRIDE
216 : {
217 0 : return CCharacterData::removeChild(oldChild);
218 : }
219 0 : virtual Reference< XNode > SAL_CALL replaceChild(
220 : const Reference< XNode >& newChild, const Reference< XNode >& oldChild)
221 : throw (RuntimeException, DOMException, std::exception) SAL_OVERRIDE
222 : {
223 0 : return CCharacterData::replaceChild(newChild, oldChild);
224 : }
225 0 : virtual void SAL_CALL setNodeValue(const OUString& nodeValue)
226 : throw (RuntimeException, DOMException, std::exception) SAL_OVERRIDE
227 : {
228 0 : return CCharacterData::setNodeValue(nodeValue);
229 : }
230 0 : virtual void SAL_CALL setPrefix(const OUString& prefix)
231 : throw (RuntimeException, DOMException, std::exception) SAL_OVERRIDE
232 : {
233 0 : return CCharacterData::setPrefix(prefix);
234 : }
235 :
236 : };
237 : }
238 : #endif
239 :
240 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|