LibreOffice Module unoxml (master) 1
characterdata.hxx
Go to the documentation of this file.
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
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
34namespace DOM
35{
36 typedef ::cppu::ImplInheritanceHelper< CNode, css::xml::dom::XCharacterData >
38
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
48 OUString const& prevValue, OUString const& newValue);
49
50 public:
54 virtual void SAL_CALL appendData(const OUString& arg) override;
55
59 virtual void SAL_CALL deleteData(sal_Int32 offset, sal_Int32 count) override;
60
64 virtual OUString SAL_CALL getData() override;
65
70 virtual sal_Int32 SAL_CALL getLength() override;
71
75 virtual void SAL_CALL insertData(sal_Int32 offset, const OUString& arg) override;
76
81 virtual void SAL_CALL replaceData(sal_Int32 offset, sal_Int32 count, const OUString& arg) override;
82
86 virtual void SAL_CALL setData(const OUString& data) override;
87
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 {
96 return CNode::appendChild(newChild);
97 }
98 virtual css::uno::Reference< css::xml::dom::XNode > SAL_CALL cloneNode(sal_Bool deep) override
99 {
100 return CNode::cloneNode(deep);
101 }
102 virtual css::uno::Reference< css::xml::dom::XNamedNodeMap > SAL_CALL getAttributes() override
103 {
104 return CNode::getAttributes();
105 }
106 virtual css::uno::Reference< css::xml::dom::XNodeList > SAL_CALL getChildNodes() override
107 {
108 return CNode::getChildNodes();
109 }
110 virtual css::uno::Reference< css::xml::dom::XNode > SAL_CALL getFirstChild() override
111 {
112 return CNode::getFirstChild();
113 }
114 virtual css::uno::Reference< css::xml::dom::XNode > SAL_CALL getLastChild() override
115 {
116 return CNode::getLastChild();
117 }
118 virtual OUString SAL_CALL getLocalName() override
119 {
120 return CNode::getLocalName();
121 }
122 virtual OUString SAL_CALL getNamespaceURI() override
123 {
124 return CNode::getNamespaceURI();
125 }
126 virtual css::uno::Reference< css::xml::dom::XNode > SAL_CALL getNextSibling() override
127 {
128 return CNode::getNextSibling();
129 }
130 virtual OUString SAL_CALL getNodeName() override
131 {
132 return CNode::getNodeName();
133 }
134 virtual css::xml::dom::NodeType SAL_CALL getNodeType() override
135 {
136 return CNode::getNodeType();
137 }
138 virtual OUString SAL_CALL getNodeValue() override
139 {
140 return getData();
141 }
142 virtual css::uno::Reference< css::xml::dom::XDocument > SAL_CALL getOwnerDocument() override
143 {
144 return CNode::getOwnerDocument();
145 }
146 virtual css::uno::Reference< css::xml::dom::XNode > SAL_CALL getParentNode() override
147 {
148 return CNode::getParentNode();
149 }
150 virtual OUString SAL_CALL getPrefix() override
151 {
152 return CNode::getPrefix();
153 }
154 virtual css::uno::Reference< css::xml::dom::XNode > SAL_CALL getPreviousSibling() override
155 {
156 return CNode::getPreviousSibling();
157 }
158 virtual sal_Bool SAL_CALL hasAttributes() override
159 {
160 return CNode::hasAttributes();
161 }
162 virtual sal_Bool SAL_CALL hasChildNodes() override
163 {
164 return CNode::hasChildNodes();
165 }
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 {
169 return CNode::insertBefore(newChild, refChild);
170 }
171 virtual sal_Bool SAL_CALL isSupported(const OUString& feature, const OUString& ver) override
172 {
173 return CNode::isSupported(feature, ver);
174 }
175 virtual void SAL_CALL normalize() override
176 {
177 CNode::normalize();
178 }
179 virtual css::uno::Reference< css::xml::dom::XNode > SAL_CALL removeChild(const css::uno::Reference< css::xml::dom::XNode >& oldChild) override
180 {
181 return CNode::removeChild(oldChild);
182 }
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 {
186 return CNode::replaceChild(newChild, oldChild);
187 }
188 virtual void SAL_CALL setNodeValue(const OUString& nodeValue) override
189 {
190 return setData(nodeValue);
191 }
192 virtual void SAL_CALL setPrefix(const OUString& prefix) override
193 {
194 return CNode::setPrefix(prefix);
195 }
196
197
198 };
199}
200
201/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual OUString SAL_CALL getData() override
Return the character data of the node that implements this interface.
virtual OUString SAL_CALL getNodeValue() override
virtual OUString SAL_CALL getLocalName() override
virtual OUString SAL_CALL getNamespaceURI() override
virtual css::uno::Reference< css::xml::dom::XNode > SAL_CALL getNextSibling() override
virtual css::uno::Reference< css::xml::dom::XNodeList > SAL_CALL getChildNodes() override
CCharacterData(CDocument const &rDocument, ::osl::Mutex const &rMutex, css::xml::dom::NodeType const &reNodeType, xmlNodePtr const &rpNode)
virtual css::uno::Reference< css::xml::dom::XNode > SAL_CALL insertBefore(const css::uno::Reference< css::xml::dom::XNode > &newChild, const css::uno::Reference< css::xml::dom::XNode > &refChild) override
virtual css::uno::Reference< css::xml::dom::XNode > SAL_CALL appendChild(const css::uno::Reference< css::xml::dom::XNode > &newChild) override
virtual void SAL_CALL replaceData(sal_Int32 offset, sal_Int32 count, const OUString &arg) override
Replace the characters starting at the specified 16-bit unit offset with the specified string.
virtual void SAL_CALL setPrefix(const OUString &prefix) override
virtual sal_Int32 SAL_CALL getLength() override
The number of 16-bit units that are available through data and the substringData method below.
virtual void SAL_CALL setData(const OUString &data) override
Set the character data of the node that implements this interface.
virtual void SAL_CALL normalize() override
void dispatchEvent_Impl(OUString const &prevValue, OUString const &newValue)
virtual css::uno::Reference< css::xml::dom::XNamedNodeMap > SAL_CALL getAttributes() override
virtual void SAL_CALL insertData(sal_Int32 offset, const OUString &arg) override
Insert a string at the specified 16-bit unit offset.
virtual sal_Bool SAL_CALL isSupported(const OUString &feature, const OUString &ver) override
virtual css::uno::Reference< css::xml::dom::XNode > SAL_CALL getFirstChild() override
virtual OUString SAL_CALL subStringData(sal_Int32 offset, sal_Int32 count) override
Extracts a range of data from the node.
virtual css::uno::Reference< css::xml::dom::XNode > SAL_CALL getLastChild() override
virtual css::uno::Reference< css::xml::dom::XNode > SAL_CALL getParentNode() override
virtual css::uno::Reference< css::xml::dom::XDocument > SAL_CALL getOwnerDocument() override
virtual css::uno::Reference< css::xml::dom::XNode > SAL_CALL replaceChild(const css::uno::Reference< css::xml::dom::XNode > &newChild, const css::uno::Reference< css::xml::dom::XNode > &oldChild) override
virtual void SAL_CALL setNodeValue(const OUString &nodeValue) override
virtual void SAL_CALL appendData(const OUString &arg) override
Append the string to the end of the character data of the node.
virtual sal_Bool SAL_CALL hasChildNodes() override
virtual OUString SAL_CALL getNodeName() override
virtual sal_Bool SAL_CALL hasAttributes() override
virtual OUString SAL_CALL getPrefix() override
virtual css::uno::Reference< css::xml::dom::XNode > SAL_CALL removeChild(const css::uno::Reference< css::xml::dom::XNode > &oldChild) override
virtual css::uno::Reference< css::xml::dom::XNode > SAL_CALL cloneNode(sal_Bool deep) override
virtual css::uno::Reference< css::xml::dom::XNode > SAL_CALL getPreviousSibling() override
virtual void SAL_CALL deleteData(sal_Int32 offset, sal_Int32 count) override
Remove a range of 16-bit units from the node.
virtual css::xml::dom::NodeType SAL_CALL getNodeType() override
Definition: attr.cxx:38
::cppu::ImplInheritanceHelper< CNode, css::xml::dom::XCharacterData > CCharacterData_Base
unsigned char sal_Bool