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 DOM_CHARACTERDATA_HXX
21 : #define DOM_CHARACTERDATA_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/XCharacterData.hpp>
32 :
33 : #include <node.hxx>
34 :
35 :
36 : using ::rtl::OUString;
37 : using namespace com::sun::star::uno;
38 : using namespace com::sun::star::xml::dom;
39 :
40 : namespace DOM
41 : {
42 : typedef ::cppu::ImplInheritanceHelper1< CNode, XCharacterData >
43 : CCharacterData_Base;
44 :
45 2695 : class CCharacterData
46 : : public CCharacterData_Base
47 : {
48 :
49 : protected:
50 : CCharacterData(CDocument const& rDocument, ::osl::Mutex const& rMutex,
51 : NodeType const& reNodeType, xmlNodePtr const& rpNode);
52 :
53 : void dispatchEvent_Impl(
54 : OUString const& prevValue, OUString const& newValue);
55 :
56 : public:
57 : /**
58 : Append the string to the end of the character data of the node.
59 : */
60 : virtual void SAL_CALL appendData(const OUString& arg)
61 : throw (RuntimeException, DOMException);
62 :
63 : /**
64 : Remove a range of 16-bit units from the node.
65 : */
66 : virtual void SAL_CALL deleteData(sal_Int32 offset, sal_Int32 count)
67 : throw (RuntimeException, DOMException);
68 :
69 : /**
70 : Return the character data of the node that implements this interface.
71 : */
72 : virtual OUString SAL_CALL getData() throw (RuntimeException);
73 :
74 : /**
75 : The number of 16-bit units that are available through data and the
76 : substringData method below.
77 : */
78 : virtual sal_Int32 SAL_CALL getLength() throw (RuntimeException);
79 :
80 : /**
81 : Insert a string at the specified 16-bit unit offset.
82 : */
83 : virtual void SAL_CALL insertData(sal_Int32 offset, const OUString& arg)
84 : throw (RuntimeException, DOMException);
85 :
86 : /**
87 : Replace the characters starting at the specified 16-bit unit offset
88 : with the specified string.
89 : */
90 : virtual void SAL_CALL replaceData(sal_Int32 offset, sal_Int32 count, const OUString& arg)
91 : throw (RuntimeException, DOMException);
92 :
93 : /**
94 : Set the character data of the node that implements this interface.
95 : */
96 : virtual void SAL_CALL setData(const OUString& data)
97 : throw (RuntimeException, DOMException);
98 :
99 : /**
100 : Extracts a range of data from the node.
101 : */
102 : virtual OUString SAL_CALL subStringData(sal_Int32 offset, sal_Int32 count)
103 : throw (RuntimeException, DOMException);
104 :
105 : // --- delegation for XNode base.
106 0 : virtual Reference< XNode > SAL_CALL appendChild(const Reference< XNode >& newChild)
107 : throw (RuntimeException, DOMException)
108 : {
109 0 : return CNode::appendChild(newChild);
110 : }
111 0 : virtual Reference< XNode > SAL_CALL cloneNode(sal_Bool deep)
112 : throw (RuntimeException)
113 : {
114 0 : return CNode::cloneNode(deep);
115 : }
116 0 : virtual Reference< XNamedNodeMap > SAL_CALL getAttributes()
117 : throw (RuntimeException)
118 : {
119 0 : return CNode::getAttributes();
120 : }
121 0 : virtual Reference< XNodeList > SAL_CALL getChildNodes()
122 : throw (RuntimeException)
123 : {
124 0 : return CNode::getChildNodes();
125 : }
126 214 : virtual Reference< XNode > SAL_CALL getFirstChild()
127 : throw (RuntimeException)
128 : {
129 214 : return CNode::getFirstChild();
130 : }
131 0 : virtual Reference< XNode > SAL_CALL getLastChild()
132 : throw (RuntimeException)
133 : {
134 0 : return CNode::getLastChild();
135 : }
136 0 : virtual OUString SAL_CALL getLocalName()
137 : throw (RuntimeException)
138 : {
139 0 : return CNode::getLocalName();
140 : }
141 0 : virtual OUString SAL_CALL getNamespaceURI()
142 : throw (RuntimeException)
143 : {
144 0 : return CNode::getNamespaceURI();
145 : }
146 214 : virtual Reference< XNode > SAL_CALL getNextSibling()
147 : throw (RuntimeException)
148 : {
149 214 : return CNode::getNextSibling();
150 : }
151 0 : virtual OUString SAL_CALL getNodeName()
152 : throw (RuntimeException)
153 : {
154 0 : return CNode::getNodeName();
155 : }
156 832 : virtual NodeType SAL_CALL getNodeType()
157 : throw (RuntimeException)
158 : {
159 832 : return CNode::getNodeType();
160 : }
161 618 : virtual OUString SAL_CALL getNodeValue()
162 : throw (RuntimeException)
163 : {
164 618 : return getData();
165 : }
166 298 : virtual Reference< XDocument > SAL_CALL getOwnerDocument()
167 : throw (RuntimeException)
168 : {
169 298 : return CNode::getOwnerDocument();
170 : }
171 0 : virtual Reference< XNode > SAL_CALL getParentNode()
172 : throw (RuntimeException)
173 : {
174 0 : return CNode::getParentNode();
175 : }
176 0 : virtual OUString SAL_CALL getPrefix()
177 : throw (RuntimeException)
178 : {
179 0 : return CNode::getPrefix();
180 : }
181 0 : virtual Reference< XNode > SAL_CALL getPreviousSibling()
182 : throw (RuntimeException)
183 : {
184 0 : return CNode::getPreviousSibling();
185 : }
186 0 : virtual sal_Bool SAL_CALL hasAttributes()
187 : throw (RuntimeException)
188 : {
189 0 : return CNode::hasAttributes();
190 : }
191 0 : virtual sal_Bool SAL_CALL hasChildNodes()
192 : throw (RuntimeException)
193 : {
194 0 : return CNode::hasChildNodes();
195 : }
196 0 : virtual Reference< XNode > SAL_CALL insertBefore(
197 : const Reference< XNode >& newChild, const Reference< XNode >& refChild)
198 : throw (RuntimeException, DOMException)
199 : {
200 0 : return CNode::insertBefore(newChild, refChild);
201 : }
202 0 : virtual sal_Bool SAL_CALL isSupported(const OUString& feature, const OUString& ver)
203 : throw (RuntimeException)
204 : {
205 0 : return CNode::isSupported(feature, ver);
206 : }
207 0 : virtual void SAL_CALL normalize()
208 : throw (RuntimeException)
209 : {
210 0 : CNode::normalize();
211 0 : }
212 0 : virtual Reference< XNode > SAL_CALL removeChild(const Reference< XNode >& oldChild)
213 : throw (RuntimeException, DOMException)
214 : {
215 0 : return CNode::removeChild(oldChild);
216 : }
217 0 : virtual Reference< XNode > SAL_CALL replaceChild(
218 : const Reference< XNode >& newChild, const Reference< XNode >& oldChild)
219 : throw (RuntimeException, DOMException)
220 : {
221 0 : return CNode::replaceChild(newChild, oldChild);
222 : }
223 42 : virtual void SAL_CALL setNodeValue(const OUString& nodeValue)
224 : throw (RuntimeException, DOMException)
225 : {
226 42 : return setData(nodeValue);
227 : }
228 0 : virtual void SAL_CALL setPrefix(const OUString& prefix)
229 : throw (RuntimeException, DOMException)
230 : {
231 0 : return CNode::setPrefix(prefix);
232 : }
233 :
234 :
235 : };
236 : }
237 :
238 : #endif
239 :
240 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|