1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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 DOM_CHARACTERDATA_HXX
21 #define DOM_CHARACTERDATA_HXX
23 #include <libxml/tree.h>
25 #include <sal/types.h>
27 #include <cppuhelper/implbase1.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>
36 using namespace com::sun::star::uno
;
37 using namespace com::sun::star::xml::dom
;
41 typedef ::cppu::ImplInheritanceHelper1
< CNode
, XCharacterData
>
45 : public CCharacterData_Base
49 CCharacterData(CDocument
const& rDocument
, ::osl::Mutex
const& rMutex
,
50 NodeType
const& reNodeType
, xmlNodePtr
const& rpNode
);
52 void dispatchEvent_Impl(
53 OUString
const& prevValue
, OUString
const& newValue
);
57 Append the string to the end of the character data of the node.
59 virtual void SAL_CALL
appendData(const OUString
& arg
)
60 throw (RuntimeException
, DOMException
);
63 Remove a range of 16-bit units from the node.
65 virtual void SAL_CALL
deleteData(sal_Int32 offset
, sal_Int32 count
)
66 throw (RuntimeException
, DOMException
);
69 Return the character data of the node that implements this interface.
71 virtual OUString SAL_CALL
getData() throw (RuntimeException
);
74 The number of 16-bit units that are available through data and the
75 substringData method below.
77 virtual sal_Int32 SAL_CALL
getLength() throw (RuntimeException
);
80 Insert a string at the specified 16-bit unit offset.
82 virtual void SAL_CALL
insertData(sal_Int32 offset
, const OUString
& arg
)
83 throw (RuntimeException
, DOMException
);
86 Replace the characters starting at the specified 16-bit unit offset
87 with the specified string.
89 virtual void SAL_CALL
replaceData(sal_Int32 offset
, sal_Int32 count
, const OUString
& arg
)
90 throw (RuntimeException
, DOMException
);
93 Set the character data of the node that implements this interface.
95 virtual void SAL_CALL
setData(const OUString
& data
)
96 throw (RuntimeException
, DOMException
);
99 Extracts a range of data from the node.
101 virtual OUString SAL_CALL
subStringData(sal_Int32 offset
, sal_Int32 count
)
102 throw (RuntimeException
, DOMException
);
104 // --- delegation for XNode base.
105 virtual Reference
< XNode
> SAL_CALL
appendChild(const Reference
< XNode
>& newChild
)
106 throw (RuntimeException
, DOMException
)
108 return CNode::appendChild(newChild
);
110 virtual Reference
< XNode
> SAL_CALL
cloneNode(sal_Bool deep
)
111 throw (RuntimeException
)
113 return CNode::cloneNode(deep
);
115 virtual Reference
< XNamedNodeMap
> SAL_CALL
getAttributes()
116 throw (RuntimeException
)
118 return CNode::getAttributes();
120 virtual Reference
< XNodeList
> SAL_CALL
getChildNodes()
121 throw (RuntimeException
)
123 return CNode::getChildNodes();
125 virtual Reference
< XNode
> SAL_CALL
getFirstChild()
126 throw (RuntimeException
)
128 return CNode::getFirstChild();
130 virtual Reference
< XNode
> SAL_CALL
getLastChild()
131 throw (RuntimeException
)
133 return CNode::getLastChild();
135 virtual OUString SAL_CALL
getLocalName()
136 throw (RuntimeException
)
138 return CNode::getLocalName();
140 virtual OUString SAL_CALL
getNamespaceURI()
141 throw (RuntimeException
)
143 return CNode::getNamespaceURI();
145 virtual Reference
< XNode
> SAL_CALL
getNextSibling()
146 throw (RuntimeException
)
148 return CNode::getNextSibling();
150 virtual OUString SAL_CALL
getNodeName()
151 throw (RuntimeException
)
153 return CNode::getNodeName();
155 virtual NodeType SAL_CALL
getNodeType()
156 throw (RuntimeException
)
158 return CNode::getNodeType();
160 virtual OUString SAL_CALL
getNodeValue()
161 throw (RuntimeException
)
165 virtual Reference
< XDocument
> SAL_CALL
getOwnerDocument()
166 throw (RuntimeException
)
168 return CNode::getOwnerDocument();
170 virtual Reference
< XNode
> SAL_CALL
getParentNode()
171 throw (RuntimeException
)
173 return CNode::getParentNode();
175 virtual OUString SAL_CALL
getPrefix()
176 throw (RuntimeException
)
178 return CNode::getPrefix();
180 virtual Reference
< XNode
> SAL_CALL
getPreviousSibling()
181 throw (RuntimeException
)
183 return CNode::getPreviousSibling();
185 virtual sal_Bool SAL_CALL
hasAttributes()
186 throw (RuntimeException
)
188 return CNode::hasAttributes();
190 virtual sal_Bool SAL_CALL
hasChildNodes()
191 throw (RuntimeException
)
193 return CNode::hasChildNodes();
195 virtual Reference
< XNode
> SAL_CALL
insertBefore(
196 const Reference
< XNode
>& newChild
, const Reference
< XNode
>& refChild
)
197 throw (RuntimeException
, DOMException
)
199 return CNode::insertBefore(newChild
, refChild
);
201 virtual sal_Bool SAL_CALL
isSupported(const OUString
& feature
, const OUString
& ver
)
202 throw (RuntimeException
)
204 return CNode::isSupported(feature
, ver
);
206 virtual void SAL_CALL
normalize()
207 throw (RuntimeException
)
211 virtual Reference
< XNode
> SAL_CALL
removeChild(const Reference
< XNode
>& oldChild
)
212 throw (RuntimeException
, DOMException
)
214 return CNode::removeChild(oldChild
);
216 virtual Reference
< XNode
> SAL_CALL
replaceChild(
217 const Reference
< XNode
>& newChild
, const Reference
< XNode
>& oldChild
)
218 throw (RuntimeException
, DOMException
)
220 return CNode::replaceChild(newChild
, oldChild
);
222 virtual void SAL_CALL
setNodeValue(const OUString
& nodeValue
)
223 throw (RuntimeException
, DOMException
)
225 return setData(nodeValue
);
227 virtual void SAL_CALL
setPrefix(const OUString
& prefix
)
228 throw (RuntimeException
, DOMException
)
230 return CNode::setPrefix(prefix
);
239 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */