Version 6.4.0.0.beta1, tag libreoffice-6.4.0.0.beta1
[LibreOffice.git] / unoxml / source / dom / characterdata.hxx
blob8a3179d3de77ddf0421d9aa789cf13653ae895d7
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 #ifndef INCLUDED_UNOXML_SOURCE_DOM_CHARACTERDATA_HXX
21 #define INCLUDED_UNOXML_SOURCE_DOM_CHARACTERDATA_HXX
23 #include <libxml/tree.h>
25 #include <sal/types.h>
27 #include <cppuhelper/implbase.hxx>
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>
33 #include <node.hxx>
35 namespace DOM
37 typedef ::cppu::ImplInheritanceHelper< CNode, css::xml::dom::XCharacterData >
38 CCharacterData_Base;
40 class CCharacterData
41 : public CCharacterData_Base
44 protected:
45 CCharacterData(CDocument const& rDocument, ::osl::Mutex const& rMutex,
46 css::xml::dom::NodeType const& reNodeType, xmlNodePtr const& rpNode);
48 void dispatchEvent_Impl(
49 OUString const& prevValue, OUString const& newValue);
51 public:
52 /**
53 Append the string to the end of the character data of the node.
55 virtual void SAL_CALL appendData(const OUString& arg) override;
57 /**
58 Remove a range of 16-bit units from the node.
60 virtual void SAL_CALL deleteData(sal_Int32 offset, sal_Int32 count) override;
62 /**
63 Return the character data of the node that implements this interface.
65 virtual OUString SAL_CALL getData() override;
67 /**
68 The number of 16-bit units that are available through data and the
69 substringData method below.
71 virtual sal_Int32 SAL_CALL getLength() override;
73 /**
74 Insert a string at the specified 16-bit unit offset.
76 virtual void SAL_CALL insertData(sal_Int32 offset, const OUString& arg) override;
78 /**
79 Replace the characters starting at the specified 16-bit unit offset
80 with the specified string.
82 virtual void SAL_CALL replaceData(sal_Int32 offset, sal_Int32 count, const OUString& arg) override;
84 /**
85 Set the character data of the node that implements this interface.
87 virtual void SAL_CALL setData(const OUString& data) override;
89 /**
90 Extracts a range of data from the node.
92 virtual OUString SAL_CALL subStringData(sal_Int32 offset, sal_Int32 count) override;
94 // --- delegation for XNode base.
95 virtual css::uno::Reference< css::xml::dom::XNode > SAL_CALL appendChild(const css::uno::Reference< css::xml::dom::XNode >& newChild) override
97 return CNode::appendChild(newChild);
99 virtual css::uno::Reference< css::xml::dom::XNode > SAL_CALL cloneNode(sal_Bool deep) override
101 return CNode::cloneNode(deep);
103 virtual css::uno::Reference< css::xml::dom::XNamedNodeMap > SAL_CALL getAttributes() override
105 return CNode::getAttributes();
107 virtual css::uno::Reference< css::xml::dom::XNodeList > SAL_CALL getChildNodes() override
109 return CNode::getChildNodes();
111 virtual css::uno::Reference< css::xml::dom::XNode > SAL_CALL getFirstChild() override
113 return CNode::getFirstChild();
115 virtual css::uno::Reference< css::xml::dom::XNode > SAL_CALL getLastChild() override
117 return CNode::getLastChild();
119 virtual OUString SAL_CALL getLocalName() override
121 return CNode::getLocalName();
123 virtual OUString SAL_CALL getNamespaceURI() override
125 return CNode::getNamespaceURI();
127 virtual css::uno::Reference< css::xml::dom::XNode > SAL_CALL getNextSibling() override
129 return CNode::getNextSibling();
131 virtual OUString SAL_CALL getNodeName() override
133 return CNode::getNodeName();
135 virtual css::xml::dom::NodeType SAL_CALL getNodeType() override
137 return CNode::getNodeType();
139 virtual OUString SAL_CALL getNodeValue() override
141 return getData();
143 virtual css::uno::Reference< css::xml::dom::XDocument > SAL_CALL getOwnerDocument() override
145 return CNode::getOwnerDocument();
147 virtual css::uno::Reference< css::xml::dom::XNode > SAL_CALL getParentNode() override
149 return CNode::getParentNode();
151 virtual OUString SAL_CALL getPrefix() override
153 return CNode::getPrefix();
155 virtual css::uno::Reference< css::xml::dom::XNode > SAL_CALL getPreviousSibling() override
157 return CNode::getPreviousSibling();
159 virtual sal_Bool SAL_CALL hasAttributes() override
161 return CNode::hasAttributes();
163 virtual sal_Bool SAL_CALL hasChildNodes() override
165 return CNode::hasChildNodes();
167 virtual css::uno::Reference< css::xml::dom::XNode > SAL_CALL insertBefore(
168 const css::uno::Reference< css::xml::dom::XNode >& newChild, const css::uno::Reference< css::xml::dom::XNode >& refChild) override
170 return CNode::insertBefore(newChild, refChild);
172 virtual sal_Bool SAL_CALL isSupported(const OUString& feature, const OUString& ver) override
174 return CNode::isSupported(feature, ver);
176 virtual void SAL_CALL normalize() override
178 CNode::normalize();
180 virtual css::uno::Reference< css::xml::dom::XNode > SAL_CALL removeChild(const css::uno::Reference< css::xml::dom::XNode >& oldChild) override
182 return CNode::removeChild(oldChild);
184 virtual css::uno::Reference< css::xml::dom::XNode > SAL_CALL replaceChild(
185 const css::uno::Reference< css::xml::dom::XNode >& newChild, const css::uno::Reference< css::xml::dom::XNode >& oldChild) override
187 return CNode::replaceChild(newChild, oldChild);
189 virtual void SAL_CALL setNodeValue(const OUString& nodeValue) override
191 return setData(nodeValue);
193 virtual void SAL_CALL setPrefix(const OUString& prefix) override
195 return CNode::setPrefix(prefix);
202 #endif
204 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */