Line data Source code
1 : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : /*
3 : * This file is part of the LibreOffice project.
4 : *
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/.
8 : *
9 : * This file incorporates work covered by the following license notice:
10 : *
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 .
18 : */
19 :
20 : #ifndef INCLUDED_UNOXML_SOURCE_DOM_ENTITY_HXX
21 : #define INCLUDED_UNOXML_SOURCE_DOM_ENTITY_HXX
22 :
23 : #include <libxml/tree.h>
24 : #include <libxml/entities.h>
25 :
26 : #include <sal/types.h>
27 :
28 : #include <com/sun/star/uno/Reference.h>
29 : #include <com/sun/star/xml/dom/XEntity.hpp>
30 :
31 : #include <node.hxx>
32 :
33 : namespace DOM
34 : {
35 : typedef ::cppu::ImplInheritanceHelper1< CNode, css::xml::dom::XEntity > CEntity_Base;
36 :
37 0 : class CEntity
38 : : public CEntity_Base
39 : {
40 : private:
41 : friend class CDocument;
42 :
43 : private:
44 : xmlEntityPtr m_aEntityPtr;
45 :
46 : protected:
47 : CEntity(CDocument const& rDocument, ::osl::Mutex const& rMutex,
48 : xmlEntityPtr const pEntity);
49 :
50 : public:
51 : virtual bool IsChildTypeAllowed(css::xml::dom::NodeType const nodeType) SAL_OVERRIDE;
52 :
53 : /**
54 : For unparsed entities, the name of the notation for the entity.
55 : */
56 : virtual OUString SAL_CALL getNotationName() throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
57 :
58 : /**
59 : The public identifier associated with the entity, if specified.
60 : */
61 : virtual OUString SAL_CALL getPublicId() throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
62 :
63 : /**
64 : The system identifier associated with the entity, if specified.
65 : */
66 : virtual OUString SAL_CALL getSystemId() throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
67 :
68 : // ---- resolve uno inheritance problems...
69 : // overrides for XNode base
70 : virtual OUString SAL_CALL getNodeName()
71 : throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
72 : virtual OUString SAL_CALL getNodeValue()
73 : throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
74 : // --- delegation for XNode base.
75 0 : virtual css::uno::Reference< css::xml::dom::XNode > SAL_CALL appendChild(const css::uno::Reference< css::xml::dom::XNode >& newChild)
76 : throw (css::uno::RuntimeException, css::xml::dom::DOMException, std::exception) SAL_OVERRIDE
77 : {
78 0 : return CNode::appendChild(newChild);
79 : }
80 0 : virtual css::uno::Reference< css::xml::dom::XNode > SAL_CALL cloneNode(sal_Bool deep)
81 : throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE
82 : {
83 0 : return CNode::cloneNode(deep);
84 : }
85 0 : virtual css::uno::Reference< css::xml::dom::XNamedNodeMap > SAL_CALL getAttributes()
86 : throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE
87 : {
88 0 : return CNode::getAttributes();
89 : }
90 0 : virtual css::uno::Reference< css::xml::dom::XNodeList > SAL_CALL getChildNodes()
91 : throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE
92 : {
93 0 : return CNode::getChildNodes();
94 : }
95 0 : virtual css::uno::Reference< css::xml::dom::XNode > SAL_CALL getFirstChild()
96 : throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE
97 : {
98 0 : return CNode::getFirstChild();
99 : }
100 0 : virtual css::uno::Reference< css::xml::dom::XNode > SAL_CALL getLastChild()
101 : throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE
102 : {
103 0 : return CNode::getLastChild();
104 : }
105 0 : virtual OUString SAL_CALL getLocalName()
106 : throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE
107 : {
108 0 : return CNode::getLocalName();
109 : }
110 0 : virtual OUString SAL_CALL getNamespaceURI()
111 : throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE
112 : {
113 0 : return CNode::getNamespaceURI();
114 : }
115 0 : virtual css::uno::Reference< css::xml::dom::XNode > SAL_CALL getNextSibling()
116 : throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE
117 : {
118 0 : return CNode::getNextSibling();
119 : }
120 0 : virtual css::xml::dom::NodeType SAL_CALL getNodeType()
121 : throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE
122 : {
123 0 : return CNode::getNodeType();
124 : }
125 0 : virtual css::uno::Reference< css::xml::dom::XDocument > SAL_CALL getOwnerDocument()
126 : throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE
127 : {
128 0 : return CNode::getOwnerDocument();
129 : }
130 0 : virtual css::uno::Reference< css::xml::dom::XNode > SAL_CALL getParentNode()
131 : throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE
132 : {
133 0 : return CNode::getParentNode();
134 : }
135 0 : virtual OUString SAL_CALL getPrefix()
136 : throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE
137 : {
138 0 : return CNode::getPrefix();
139 : }
140 0 : virtual css::uno::Reference< css::xml::dom::XNode > SAL_CALL getPreviousSibling()
141 : throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE
142 : {
143 0 : return CNode::getPreviousSibling();
144 : }
145 0 : virtual sal_Bool SAL_CALL hasAttributes()
146 : throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE
147 : {
148 0 : return CNode::hasAttributes();
149 : }
150 0 : virtual sal_Bool SAL_CALL hasChildNodes()
151 : throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE
152 : {
153 0 : return CNode::hasChildNodes();
154 : }
155 0 : virtual css::uno::Reference< css::xml::dom::XNode > SAL_CALL insertBefore(
156 : const css::uno::Reference< css::xml::dom::XNode >& newChild, const css::uno::Reference< css::xml::dom::XNode >& refChild)
157 : throw (css::uno::RuntimeException, css::xml::dom::DOMException, std::exception) SAL_OVERRIDE
158 : {
159 0 : return CNode::insertBefore(newChild, refChild);
160 : }
161 0 : virtual sal_Bool SAL_CALL isSupported(const OUString& feature, const OUString& ver)
162 : throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE
163 : {
164 0 : return CNode::isSupported(feature, ver);
165 : }
166 0 : virtual void SAL_CALL normalize()
167 : throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE
168 : {
169 0 : CNode::normalize();
170 0 : }
171 0 : virtual css::uno::Reference< css::xml::dom::XNode > SAL_CALL removeChild(const css::uno::Reference< css::xml::dom::XNode >& oldChild)
172 : throw (css::uno::RuntimeException, css::xml::dom::DOMException, std::exception) SAL_OVERRIDE
173 : {
174 0 : return CNode::removeChild(oldChild);
175 : }
176 0 : virtual css::uno::Reference< css::xml::dom::XNode > SAL_CALL replaceChild(
177 : const css::uno::Reference< css::xml::dom::XNode >& newChild, const css::uno::Reference< css::xml::dom::XNode >& oldChild)
178 : throw (css::uno::RuntimeException, css::xml::dom::DOMException, std::exception) SAL_OVERRIDE
179 : {
180 0 : return CNode::replaceChild(newChild, oldChild);
181 : }
182 0 : virtual void SAL_CALL setNodeValue(const OUString& nodeValue)
183 : throw (css::uno::RuntimeException, css::xml::dom::DOMException, std::exception) SAL_OVERRIDE
184 : {
185 0 : return CNode::setNodeValue(nodeValue);
186 : }
187 0 : virtual void SAL_CALL setPrefix(const OUString& prefix)
188 : throw (css::uno::RuntimeException, css::xml::dom::DOMException, std::exception) SAL_OVERRIDE
189 : {
190 0 : return CNode::setPrefix(prefix);
191 : }
192 :
193 :
194 : };
195 : }
196 :
197 : #endif
198 :
199 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|