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_ENTITY_HXX
21 #define INCLUDED_UNOXML_SOURCE_DOM_ENTITY_HXX
23 #include <libxml/tree.h>
24 #include <libxml/entities.h>
26 #include <sal/types.h>
28 #include <com/sun/star/uno/Reference.h>
29 #include <com/sun/star/xml/dom/XEntity.hpp>
31 #include <cppuhelper/implbase.hxx>
36 typedef ::cppu::ImplInheritanceHelper
< CNode
, css::xml::dom::XEntity
> CEntity_Base
;
42 friend class CDocument
;
45 xmlEntityPtr m_aEntityPtr
;
48 CEntity(CDocument
const& rDocument
, ::osl::Mutex
const& rMutex
,
49 xmlEntityPtr
const pEntity
);
52 virtual bool IsChildTypeAllowed(css::xml::dom::NodeType
const nodeType
) override
;
55 For unparsed entities, the name of the notation for the entity.
57 virtual OUString SAL_CALL
getNotationName() throw (css::uno::RuntimeException
, std::exception
) override
;
60 The public identifier associated with the entity, if specified.
62 virtual OUString SAL_CALL
getPublicId() throw (css::uno::RuntimeException
, std::exception
) override
;
65 The system identifier associated with the entity, if specified.
67 virtual OUString SAL_CALL
getSystemId() throw (css::uno::RuntimeException
, std::exception
) override
;
69 // ---- resolve uno inheritance problems...
70 // overrides for XNode base
71 virtual OUString SAL_CALL
getNodeName()
72 throw (css::uno::RuntimeException
, std::exception
) override
;
73 virtual OUString SAL_CALL
getNodeValue()
74 throw (css::uno::RuntimeException
, std::exception
) override
;
75 // --- delegation for XNode base.
76 virtual css::uno::Reference
< css::xml::dom::XNode
> SAL_CALL
appendChild(const css::uno::Reference
< css::xml::dom::XNode
>& newChild
)
77 throw (css::uno::RuntimeException
, css::xml::dom::DOMException
, std::exception
) override
79 return CNode::appendChild(newChild
);
81 virtual css::uno::Reference
< css::xml::dom::XNode
> SAL_CALL
cloneNode(sal_Bool deep
)
82 throw (css::uno::RuntimeException
, std::exception
) override
84 return CNode::cloneNode(deep
);
86 virtual css::uno::Reference
< css::xml::dom::XNamedNodeMap
> SAL_CALL
getAttributes()
87 throw (css::uno::RuntimeException
, std::exception
) override
89 return CNode::getAttributes();
91 virtual css::uno::Reference
< css::xml::dom::XNodeList
> SAL_CALL
getChildNodes()
92 throw (css::uno::RuntimeException
, std::exception
) override
94 return CNode::getChildNodes();
96 virtual css::uno::Reference
< css::xml::dom::XNode
> SAL_CALL
getFirstChild()
97 throw (css::uno::RuntimeException
, std::exception
) override
99 return CNode::getFirstChild();
101 virtual css::uno::Reference
< css::xml::dom::XNode
> SAL_CALL
getLastChild()
102 throw (css::uno::RuntimeException
, std::exception
) override
104 return CNode::getLastChild();
106 virtual OUString SAL_CALL
getLocalName()
107 throw (css::uno::RuntimeException
, std::exception
) override
109 return CNode::getLocalName();
111 virtual OUString SAL_CALL
getNamespaceURI()
112 throw (css::uno::RuntimeException
, std::exception
) override
114 return CNode::getNamespaceURI();
116 virtual css::uno::Reference
< css::xml::dom::XNode
> SAL_CALL
getNextSibling()
117 throw (css::uno::RuntimeException
, std::exception
) override
119 return CNode::getNextSibling();
121 virtual css::xml::dom::NodeType SAL_CALL
getNodeType()
122 throw (css::uno::RuntimeException
, std::exception
) override
124 return CNode::getNodeType();
126 virtual css::uno::Reference
< css::xml::dom::XDocument
> SAL_CALL
getOwnerDocument()
127 throw (css::uno::RuntimeException
, std::exception
) override
129 return CNode::getOwnerDocument();
131 virtual css::uno::Reference
< css::xml::dom::XNode
> SAL_CALL
getParentNode()
132 throw (css::uno::RuntimeException
, std::exception
) override
134 return CNode::getParentNode();
136 virtual OUString SAL_CALL
getPrefix()
137 throw (css::uno::RuntimeException
, std::exception
) override
139 return CNode::getPrefix();
141 virtual css::uno::Reference
< css::xml::dom::XNode
> SAL_CALL
getPreviousSibling()
142 throw (css::uno::RuntimeException
, std::exception
) override
144 return CNode::getPreviousSibling();
146 virtual sal_Bool SAL_CALL
hasAttributes()
147 throw (css::uno::RuntimeException
, std::exception
) override
149 return CNode::hasAttributes();
151 virtual sal_Bool SAL_CALL
hasChildNodes()
152 throw (css::uno::RuntimeException
, std::exception
) override
154 return CNode::hasChildNodes();
156 virtual css::uno::Reference
< css::xml::dom::XNode
> SAL_CALL
insertBefore(
157 const css::uno::Reference
< css::xml::dom::XNode
>& newChild
, const css::uno::Reference
< css::xml::dom::XNode
>& refChild
)
158 throw (css::uno::RuntimeException
, css::xml::dom::DOMException
, std::exception
) override
160 return CNode::insertBefore(newChild
, refChild
);
162 virtual sal_Bool SAL_CALL
isSupported(const OUString
& feature
, const OUString
& ver
)
163 throw (css::uno::RuntimeException
, std::exception
) override
165 return CNode::isSupported(feature
, ver
);
167 virtual void SAL_CALL
normalize()
168 throw (css::uno::RuntimeException
, std::exception
) override
172 virtual css::uno::Reference
< css::xml::dom::XNode
> SAL_CALL
removeChild(const css::uno::Reference
< css::xml::dom::XNode
>& oldChild
)
173 throw (css::uno::RuntimeException
, css::xml::dom::DOMException
, std::exception
) override
175 return CNode::removeChild(oldChild
);
177 virtual css::uno::Reference
< css::xml::dom::XNode
> SAL_CALL
replaceChild(
178 const css::uno::Reference
< css::xml::dom::XNode
>& newChild
, const css::uno::Reference
< css::xml::dom::XNode
>& oldChild
)
179 throw (css::uno::RuntimeException
, css::xml::dom::DOMException
, std::exception
) override
181 return CNode::replaceChild(newChild
, oldChild
);
183 virtual void SAL_CALL
setNodeValue(const OUString
& nodeValue
)
184 throw (css::uno::RuntimeException
, css::xml::dom::DOMException
, std::exception
) override
186 return CNode::setNodeValue(nodeValue
);
188 virtual void SAL_CALL
setPrefix(const OUString
& prefix
)
189 throw (css::uno::RuntimeException
, css::xml::dom::DOMException
, std::exception
) override
191 return CNode::setPrefix(prefix
);
200 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */