Version 7.6.3.2-android, tag libreoffice-7.6.3.2-android
[LibreOffice.git] / unoxml / source / dom / characterdata.hxx
blob7728f65ef1359c4a2bed4e30314eb5edb1cd4a84
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 #pragma once
22 #include <libxml/tree.h>
24 #include <sal/types.h>
26 #include <cppuhelper/implbase.hxx>
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>
32 #include <node.hxx>
34 namespace DOM
36 typedef ::cppu::ImplInheritanceHelper< CNode, css::xml::dom::XCharacterData >
37 CCharacterData_Base;
39 class CCharacterData
40 : public CCharacterData_Base
43 protected:
44 CCharacterData(CDocument const& rDocument, ::osl::Mutex const& rMutex,
45 css::xml::dom::NodeType const& reNodeType, xmlNodePtr const& rpNode);
47 void dispatchEvent_Impl(
48 OUString const& prevValue, OUString const& newValue);
50 public:
51 /**
52 Append the string to the end of the character data of the node.
54 virtual void SAL_CALL appendData(const OUString& arg) override;
56 /**
57 Remove a range of 16-bit units from the node.
59 virtual void SAL_CALL deleteData(sal_Int32 offset, sal_Int32 count) override;
61 /**
62 Return the character data of the node that implements this interface.
64 virtual OUString SAL_CALL getData() override;
66 /**
67 The number of 16-bit units that are available through data and the
68 substringData method below.
70 virtual sal_Int32 SAL_CALL getLength() override;
72 /**
73 Insert a string at the specified 16-bit unit offset.
75 virtual void SAL_CALL insertData(sal_Int32 offset, const OUString& arg) override;
77 /**
78 Replace the characters starting at the specified 16-bit unit offset
79 with the specified string.
81 virtual void SAL_CALL replaceData(sal_Int32 offset, sal_Int32 count, const OUString& arg) override;
83 /**
84 Set the character data of the node that implements this interface.
86 virtual void SAL_CALL setData(const OUString& data) override;
88 /**
89 Extracts a range of data from the node.
91 virtual OUString SAL_CALL subStringData(sal_Int32 offset, sal_Int32 count) override;
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
96 return CNode::appendChild(newChild);
98 virtual css::uno::Reference< css::xml::dom::XNode > SAL_CALL cloneNode(sal_Bool deep) override
100 return CNode::cloneNode(deep);
102 virtual css::uno::Reference< css::xml::dom::XNamedNodeMap > SAL_CALL getAttributes() override
104 return CNode::getAttributes();
106 virtual css::uno::Reference< css::xml::dom::XNodeList > SAL_CALL getChildNodes() override
108 return CNode::getChildNodes();
110 virtual css::uno::Reference< css::xml::dom::XNode > SAL_CALL getFirstChild() override
112 return CNode::getFirstChild();
114 virtual css::uno::Reference< css::xml::dom::XNode > SAL_CALL getLastChild() override
116 return CNode::getLastChild();
118 virtual OUString SAL_CALL getLocalName() override
120 return CNode::getLocalName();
122 virtual OUString SAL_CALL getNamespaceURI() override
124 return CNode::getNamespaceURI();
126 virtual css::uno::Reference< css::xml::dom::XNode > SAL_CALL getNextSibling() override
128 return CNode::getNextSibling();
130 virtual OUString SAL_CALL getNodeName() override
132 return CNode::getNodeName();
134 virtual css::xml::dom::NodeType SAL_CALL getNodeType() override
136 return CNode::getNodeType();
138 virtual OUString SAL_CALL getNodeValue() override
140 return getData();
142 virtual css::uno::Reference< css::xml::dom::XDocument > SAL_CALL getOwnerDocument() override
144 return CNode::getOwnerDocument();
146 virtual css::uno::Reference< css::xml::dom::XNode > SAL_CALL getParentNode() override
148 return CNode::getParentNode();
150 virtual OUString SAL_CALL getPrefix() override
152 return CNode::getPrefix();
154 virtual css::uno::Reference< css::xml::dom::XNode > SAL_CALL getPreviousSibling() override
156 return CNode::getPreviousSibling();
158 virtual sal_Bool SAL_CALL hasAttributes() override
160 return CNode::hasAttributes();
162 virtual sal_Bool SAL_CALL hasChildNodes() override
164 return CNode::hasChildNodes();
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
169 return CNode::insertBefore(newChild, refChild);
171 virtual sal_Bool SAL_CALL isSupported(const OUString& feature, const OUString& ver) override
173 return CNode::isSupported(feature, ver);
175 virtual void SAL_CALL normalize() override
177 CNode::normalize();
179 virtual css::uno::Reference< css::xml::dom::XNode > SAL_CALL removeChild(const css::uno::Reference< css::xml::dom::XNode >& oldChild) override
181 return CNode::removeChild(oldChild);
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
186 return CNode::replaceChild(newChild, oldChild);
188 virtual void SAL_CALL setNodeValue(const OUString& nodeValue) override
190 return setData(nodeValue);
192 virtual void SAL_CALL setPrefix(const OUString& prefix) override
194 return CNode::setPrefix(prefix);
201 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */