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 INCLUDED_UNOXML_SOURCE_DOM_TEXT_HXX
21 #define INCLUDED_UNOXML_SOURCE_DOM_TEXT_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/XText.hpp>
33 #include "characterdata.hxx"
37 typedef ::cppu::ImplInheritanceHelper
< CCharacterData
, css::xml::dom::XText
> CText_Base
;
43 friend class CDocument
;
46 CText(CDocument
const& rDocument
, ::osl::Mutex
const& rMutex
,
47 css::xml::dom::NodeType
const& reNodeType
, xmlNodePtr
const& rpNode
);
48 CText(CDocument
const& rDocument
, ::osl::Mutex
const& rMutex
,
49 xmlNodePtr
const pNode
);
53 virtual void saxify(const css::uno::Reference
< css::xml::sax::XDocumentHandler
>& i_xHandler
) override
;
55 virtual void fastSaxify( Context
& io_rContext
) override
;
57 // Breaks this node into two nodes at the specified offset, keeping
58 // both in the tree as siblings.
59 virtual css::uno::Reference
< css::xml::dom::XText
> SAL_CALL
splitText(sal_Int32 offset
) override
;
62 // --- delegations for XCharacterData
63 virtual void SAL_CALL
appendData(const OUString
& arg
) override
65 CCharacterData::appendData(arg
);
67 virtual void SAL_CALL
deleteData(sal_Int32 offset
, sal_Int32 count
) override
69 CCharacterData::deleteData(offset
, count
);
71 virtual OUString SAL_CALL
getData() override
73 return CCharacterData::getData();
75 virtual sal_Int32 SAL_CALL
getLength() override
77 return CCharacterData::getLength();
79 virtual void SAL_CALL
insertData(sal_Int32 offset
, const OUString
& arg
) override
81 CCharacterData::insertData(offset
, arg
);
83 virtual void SAL_CALL
replaceData(sal_Int32 offset
, sal_Int32 count
, const OUString
& arg
) override
85 CCharacterData::replaceData(offset
, count
, arg
);
87 virtual void SAL_CALL
setData(const OUString
& data
) override
89 CCharacterData::setData(data
);
91 virtual OUString SAL_CALL
subStringData(sal_Int32 offset
, sal_Int32 count
) override
93 return CCharacterData::subStringData(offset
, count
);
97 // --- overrides for XNode base
98 virtual OUString SAL_CALL
getNodeName() override
;
100 // --- resolve uno inheritance problems...
101 // --- delegation for XNode base.
102 virtual css::uno::Reference
< css::xml::dom::XNode
> SAL_CALL
appendChild(const css::uno::Reference
< css::xml::dom::XNode
>& newChild
) override
104 return CCharacterData::appendChild(newChild
);
106 virtual css::uno::Reference
< css::xml::dom::XNode
> SAL_CALL
cloneNode(sal_Bool deep
) override
108 return CCharacterData::cloneNode(deep
);
110 virtual css::uno::Reference
< css::xml::dom::XNamedNodeMap
> SAL_CALL
getAttributes() override
112 return CCharacterData::getAttributes();
114 virtual css::uno::Reference
< css::xml::dom::XNodeList
> SAL_CALL
getChildNodes() override
116 return CCharacterData::getChildNodes();
118 virtual css::uno::Reference
< css::xml::dom::XNode
> SAL_CALL
getFirstChild() override
120 return CCharacterData::getFirstChild();
122 virtual css::uno::Reference
< css::xml::dom::XNode
> SAL_CALL
getLastChild() override
124 return CCharacterData::getLastChild();
126 virtual OUString SAL_CALL
getLocalName() override
128 return CCharacterData::getLocalName();
130 virtual OUString SAL_CALL
getNamespaceURI() override
132 return CCharacterData::getNamespaceURI();
134 virtual css::uno::Reference
< css::xml::dom::XNode
> SAL_CALL
getNextSibling() override
136 return CCharacterData::getNextSibling();
138 virtual css::xml::dom::NodeType SAL_CALL
getNodeType() override
140 return CCharacterData::getNodeType();
142 virtual OUString SAL_CALL
getNodeValue() override
144 return CCharacterData::getNodeValue();
146 virtual css::uno::Reference
< css::xml::dom::XDocument
> SAL_CALL
getOwnerDocument() override
148 return CCharacterData::getOwnerDocument();
150 virtual css::uno::Reference
< css::xml::dom::XNode
> SAL_CALL
getParentNode() override
152 return CCharacterData::getParentNode();
154 virtual OUString SAL_CALL
getPrefix() override
156 return CCharacterData::getPrefix();
158 virtual css::uno::Reference
< css::xml::dom::XNode
> SAL_CALL
getPreviousSibling() override
160 return CCharacterData::getPreviousSibling();
162 virtual sal_Bool SAL_CALL
hasAttributes() override
164 return CCharacterData::hasAttributes();
166 virtual sal_Bool SAL_CALL
hasChildNodes() override
168 return CCharacterData::hasChildNodes();
170 virtual css::uno::Reference
< css::xml::dom::XNode
> SAL_CALL
insertBefore(
171 const css::uno::Reference
< css::xml::dom::XNode
>& newChild
, const css::uno::Reference
< css::xml::dom::XNode
>& refChild
) override
173 return CCharacterData::insertBefore(newChild
, refChild
);
175 virtual sal_Bool SAL_CALL
isSupported(const OUString
& feature
, const OUString
& ver
) override
177 return CCharacterData::isSupported(feature
, ver
);
179 virtual void SAL_CALL
normalize() override
181 CCharacterData::normalize();
183 virtual css::uno::Reference
< css::xml::dom::XNode
> SAL_CALL
removeChild(const css::uno::Reference
< css::xml::dom::XNode
>& oldChild
) override
185 return CCharacterData::removeChild(oldChild
);
187 virtual css::uno::Reference
< css::xml::dom::XNode
> SAL_CALL
replaceChild(
188 const css::uno::Reference
< css::xml::dom::XNode
>& newChild
, const css::uno::Reference
< css::xml::dom::XNode
>& oldChild
) override
190 return CCharacterData::replaceChild(newChild
, oldChild
);
192 virtual void SAL_CALL
setNodeValue(const OUString
& nodeValue
) override
194 return CCharacterData::setNodeValue(nodeValue
);
196 virtual void SAL_CALL
setPrefix(const OUString
& prefix
) override
198 return CCharacterData::setPrefix(prefix
);
205 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */