/src/libreoffice/unoxml/source/dom/characterdata.hxx
Line | Count | Source |
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 | | #pragma once |
21 | | |
22 | | #include <libxml/tree.h> |
23 | | |
24 | | #include <sal/types.h> |
25 | | |
26 | | #include <cppuhelper/implbase.hxx> |
27 | | |
28 | | #include <com/sun/star/uno/Reference.h> |
29 | | #include <com/sun/star/xml/dom/XNode.hpp> |
30 | | #include <com/sun/star/xml/dom/XCharacterData.hpp> |
31 | | |
32 | | #include <node.hxx> |
33 | | |
34 | | namespace DOM |
35 | | { |
36 | | typedef ::cppu::ImplInheritanceHelper< CNode, css::xml::dom::XCharacterData > |
37 | | CCharacterData_Base; |
38 | | |
39 | | class CCharacterData |
40 | | : public CCharacterData_Base |
41 | | { |
42 | | |
43 | | protected: |
44 | | CCharacterData(CDocument const& rDocument, ::osl::Mutex const& rMutex, |
45 | | css::xml::dom::NodeType const& reNodeType, xmlNodePtr const& rpNode); |
46 | | |
47 | | void dispatchEvent_Impl(::osl::ClearableMutexGuard& guard, |
48 | | OUString const& prevValue, OUString const& newValue); |
49 | | |
50 | | public: |
51 | | /** |
52 | | Append the string to the end of the character data of the node. |
53 | | */ |
54 | | virtual void SAL_CALL appendData(const OUString& arg) override; |
55 | | |
56 | | /** |
57 | | Remove a range of 16-bit units from the node. |
58 | | */ |
59 | | virtual void SAL_CALL deleteData(sal_Int32 offset, sal_Int32 count) override; |
60 | | |
61 | | /** |
62 | | Return the character data of the node that implements this interface. |
63 | | */ |
64 | | virtual OUString SAL_CALL getData() override; |
65 | | |
66 | | /** |
67 | | The number of 16-bit units that are available through data and the |
68 | | substringData method below. |
69 | | */ |
70 | | virtual sal_Int32 SAL_CALL getLength() override; |
71 | | |
72 | | /** |
73 | | Insert a string at the specified 16-bit unit offset. |
74 | | */ |
75 | | virtual void SAL_CALL insertData(sal_Int32 offset, const OUString& arg) override; |
76 | | |
77 | | /** |
78 | | Replace the characters starting at the specified 16-bit unit offset |
79 | | with the specified string. |
80 | | */ |
81 | | virtual void SAL_CALL replaceData(sal_Int32 offset, sal_Int32 count, const OUString& arg) override; |
82 | | |
83 | | /** |
84 | | Set the character data of the node that implements this interface. |
85 | | */ |
86 | | virtual void SAL_CALL setData(const OUString& data) override; |
87 | | |
88 | | /** |
89 | | Extracts a range of data from the node. |
90 | | */ |
91 | | virtual OUString SAL_CALL subStringData(sal_Int32 offset, sal_Int32 count) override; |
92 | | |
93 | | // --- delegation for XNode base. |
94 | | virtual css::uno::Reference< css::xml::dom::XNode > SAL_CALL appendChild(const css::uno::Reference< css::xml::dom::XNode >& newChild) override |
95 | 0 | { |
96 | 0 | return CNode::appendChild(newChild); |
97 | 0 | } |
98 | | virtual css::uno::Reference< css::xml::dom::XNode > SAL_CALL cloneNode(sal_Bool deep) override |
99 | 0 | { |
100 | 0 | return CNode::cloneNode(deep); |
101 | 0 | } |
102 | | virtual css::uno::Reference< css::xml::dom::XNamedNodeMap > SAL_CALL getAttributes() override |
103 | 0 | { |
104 | 0 | return CNode::getAttributes(); |
105 | 0 | } |
106 | | virtual css::uno::Reference< css::xml::dom::XNodeList > SAL_CALL getChildNodes() override |
107 | 0 | { |
108 | 0 | return CNode::getChildNodes(); |
109 | 0 | } |
110 | | virtual css::uno::Reference< css::xml::dom::XNode > SAL_CALL getFirstChild() override |
111 | 0 | { |
112 | 0 | return CNode::getFirstChild(); |
113 | 0 | } |
114 | | virtual css::uno::Reference< css::xml::dom::XNode > SAL_CALL getLastChild() override |
115 | 0 | { |
116 | 0 | return CNode::getLastChild(); |
117 | 0 | } |
118 | | virtual OUString SAL_CALL getLocalName() override |
119 | 0 | { |
120 | 0 | return CNode::getLocalName(); |
121 | 0 | } |
122 | | virtual OUString SAL_CALL getNamespaceURI() override |
123 | 0 | { |
124 | 0 | return CNode::getNamespaceURI(); |
125 | 0 | } |
126 | | virtual css::uno::Reference< css::xml::dom::XNode > SAL_CALL getNextSibling() override |
127 | 0 | { |
128 | 0 | return CNode::getNextSibling(); |
129 | 0 | } |
130 | | virtual OUString SAL_CALL getNodeName() override |
131 | 0 | { |
132 | 0 | return CNode::getNodeName(); |
133 | 0 | } |
134 | | virtual css::xml::dom::NodeType SAL_CALL getNodeType() override |
135 | 69.0k | { |
136 | 69.0k | return CNode::getNodeType(); |
137 | 69.0k | } |
138 | | virtual OUString SAL_CALL getNodeValue() override |
139 | 69.0k | { |
140 | 69.0k | return getData(); |
141 | 69.0k | } |
142 | | virtual css::uno::Reference< css::xml::dom::XDocument > SAL_CALL getOwnerDocument() override |
143 | 0 | { |
144 | 0 | return CNode::getOwnerDocument(); |
145 | 0 | } |
146 | | virtual css::uno::Reference< css::xml::dom::XNode > SAL_CALL getParentNode() override |
147 | 0 | { |
148 | 0 | return CNode::getParentNode(); |
149 | 0 | } |
150 | | virtual OUString SAL_CALL getPrefix() override |
151 | 0 | { |
152 | 0 | return CNode::getPrefix(); |
153 | 0 | } |
154 | | virtual css::uno::Reference< css::xml::dom::XNode > SAL_CALL getPreviousSibling() override |
155 | 0 | { |
156 | 0 | return CNode::getPreviousSibling(); |
157 | 0 | } |
158 | | virtual sal_Bool SAL_CALL hasAttributes() override |
159 | 0 | { |
160 | 0 | return CNode::hasAttributes(); |
161 | 0 | } |
162 | | virtual sal_Bool SAL_CALL hasChildNodes() override |
163 | 0 | { |
164 | 0 | return CNode::hasChildNodes(); |
165 | 0 | } |
166 | | virtual css::uno::Reference< css::xml::dom::XNode > SAL_CALL insertBefore( |
167 | | const css::uno::Reference< css::xml::dom::XNode >& newChild, const css::uno::Reference< css::xml::dom::XNode >& refChild) override |
168 | 0 | { |
169 | 0 | return CNode::insertBefore(newChild, refChild); |
170 | 0 | } |
171 | | virtual sal_Bool SAL_CALL isSupported(const OUString& feature, const OUString& ver) override |
172 | 0 | { |
173 | 0 | return CNode::isSupported(feature, ver); |
174 | 0 | } |
175 | | virtual void SAL_CALL normalize() override |
176 | 0 | { |
177 | 0 | CNode::normalize(); |
178 | 0 | } |
179 | | virtual css::uno::Reference< css::xml::dom::XNode > SAL_CALL removeChild(const css::uno::Reference< css::xml::dom::XNode >& oldChild) override |
180 | 0 | { |
181 | 0 | return CNode::removeChild(oldChild); |
182 | 0 | } |
183 | | virtual css::uno::Reference< css::xml::dom::XNode > SAL_CALL replaceChild( |
184 | | const css::uno::Reference< css::xml::dom::XNode >& newChild, const css::uno::Reference< css::xml::dom::XNode >& oldChild) override |
185 | 0 | { |
186 | 0 | return CNode::replaceChild(newChild, oldChild); |
187 | 0 | } |
188 | | virtual void SAL_CALL setNodeValue(const OUString& nodeValue) override |
189 | 8.62k | { |
190 | 8.62k | return setData(nodeValue); |
191 | 8.62k | } |
192 | | virtual void SAL_CALL setPrefix(const OUString& prefix) override |
193 | 0 | { |
194 | 0 | return CNode::setPrefix(prefix); |
195 | 0 | } |
196 | | |
197 | | |
198 | | }; |
199 | | } |
200 | | |
201 | | /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |