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_ENTITYREFERENCE_HXX
21 : #define INCLUDED_UNOXML_SOURCE_DOM_ENTITYREFERENCE_HXX
22 :
23 : #include <libxml/tree.h>
24 :
25 : #include <com/sun/star/uno/Reference.h>
26 : #include <com/sun/star/xml/dom/XEntityReference.hpp>
27 :
28 : #include <node.hxx>
29 :
30 : namespace DOM
31 : {
32 : typedef ::cppu::ImplInheritanceHelper1< CNode, css::xml::dom::XEntityReference >
33 : CEntityReference_Base;
34 :
35 20 : class CEntityReference
36 : : public CEntityReference_Base
37 : {
38 : private:
39 : friend class CDocument;
40 :
41 : protected:
42 : CEntityReference(
43 : CDocument const& rDocument, ::osl::Mutex const& rMutex,
44 : xmlNodePtr const pNode);
45 :
46 : public:
47 : virtual bool IsChildTypeAllowed(css::xml::dom::NodeType const nodeType) SAL_OVERRIDE;
48 :
49 : // ---- resolve uno inheritance problems...
50 : // overrides for XNode base
51 : virtual OUString SAL_CALL getNodeName()
52 : throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
53 : virtual OUString SAL_CALL getNodeValue()
54 : throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
55 : // --- delegation for XNode base.
56 4 : virtual css::uno::Reference< css::xml::dom::XNode > SAL_CALL appendChild(const css::uno::Reference< css::xml::dom::XNode >& newChild)
57 : throw (css::uno::RuntimeException, css::xml::dom::DOMException, std::exception) SAL_OVERRIDE
58 : {
59 4 : return CNode::appendChild(newChild);
60 : }
61 4 : virtual css::uno::Reference< css::xml::dom::XNode > SAL_CALL cloneNode(sal_Bool deep)
62 : throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE
63 : {
64 4 : return CNode::cloneNode(deep);
65 : }
66 2 : virtual css::uno::Reference< css::xml::dom::XNamedNodeMap > SAL_CALL getAttributes()
67 : throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE
68 : {
69 2 : return CNode::getAttributes();
70 : }
71 2 : virtual css::uno::Reference< css::xml::dom::XNodeList > SAL_CALL getChildNodes()
72 : throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE
73 : {
74 2 : return CNode::getChildNodes();
75 : }
76 10 : virtual css::uno::Reference< css::xml::dom::XNode > SAL_CALL getFirstChild()
77 : throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE
78 : {
79 10 : return CNode::getFirstChild();
80 : }
81 8 : virtual css::uno::Reference< css::xml::dom::XNode > SAL_CALL getLastChild()
82 : throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE
83 : {
84 8 : return CNode::getLastChild();
85 : }
86 2 : virtual OUString SAL_CALL getLocalName()
87 : throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE
88 : {
89 2 : return CNode::getLocalName();
90 : }
91 2 : virtual OUString SAL_CALL getNamespaceURI()
92 : throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE
93 : {
94 2 : return CNode::getNamespaceURI();
95 : }
96 2 : virtual css::uno::Reference< css::xml::dom::XNode > SAL_CALL getNextSibling()
97 : throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE
98 : {
99 2 : return CNode::getNextSibling();
100 : }
101 2 : virtual css::xml::dom::NodeType SAL_CALL getNodeType()
102 : throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE
103 : {
104 2 : return CNode::getNodeType();
105 : }
106 30 : virtual css::uno::Reference< css::xml::dom::XDocument > SAL_CALL getOwnerDocument()
107 : throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE
108 : {
109 30 : return CNode::getOwnerDocument();
110 : }
111 8 : virtual css::uno::Reference< css::xml::dom::XNode > SAL_CALL getParentNode()
112 : throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE
113 : {
114 8 : return CNode::getParentNode();
115 : }
116 2 : virtual OUString SAL_CALL getPrefix()
117 : throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE
118 : {
119 2 : return CNode::getPrefix();
120 : }
121 2 : virtual css::uno::Reference< css::xml::dom::XNode > SAL_CALL getPreviousSibling()
122 : throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE
123 : {
124 2 : return CNode::getPreviousSibling();
125 : }
126 2 : virtual sal_Bool SAL_CALL hasAttributes()
127 : throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE
128 : {
129 2 : return CNode::hasAttributes();
130 : }
131 6 : virtual sal_Bool SAL_CALL hasChildNodes()
132 : throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE
133 : {
134 6 : return CNode::hasChildNodes();
135 : }
136 8 : virtual css::uno::Reference< css::xml::dom::XNode > SAL_CALL insertBefore(
137 : const css::uno::Reference< css::xml::dom::XNode >& newChild, const css::uno::Reference< css::xml::dom::XNode >& refChild)
138 : throw (css::uno::RuntimeException, css::xml::dom::DOMException, std::exception) SAL_OVERRIDE
139 : {
140 8 : return CNode::insertBefore(newChild, refChild);
141 : }
142 2 : virtual sal_Bool SAL_CALL isSupported(const OUString& feature, const OUString& ver)
143 : throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE
144 : {
145 2 : return CNode::isSupported(feature, ver);
146 : }
147 2 : virtual void SAL_CALL normalize()
148 : throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE
149 : {
150 2 : CNode::normalize();
151 2 : }
152 6 : virtual css::uno::Reference< css::xml::dom::XNode > SAL_CALL removeChild(const css::uno::Reference< css::xml::dom::XNode >& oldChild)
153 : throw (css::uno::RuntimeException, css::xml::dom::DOMException, std::exception) SAL_OVERRIDE
154 : {
155 6 : return CNode::removeChild(oldChild);
156 : }
157 10 : virtual css::uno::Reference< css::xml::dom::XNode > SAL_CALL replaceChild(
158 : const css::uno::Reference< css::xml::dom::XNode >& newChild, const css::uno::Reference< css::xml::dom::XNode >& oldChild)
159 : throw (css::uno::RuntimeException, css::xml::dom::DOMException, std::exception) SAL_OVERRIDE
160 : {
161 10 : return CNode::replaceChild(newChild, oldChild);
162 : }
163 2 : virtual void SAL_CALL setNodeValue(const OUString& nodeValue)
164 : throw (css::uno::RuntimeException, css::xml::dom::DOMException, std::exception) SAL_OVERRIDE
165 : {
166 2 : return CNode::setNodeValue(nodeValue);
167 : }
168 2 : virtual void SAL_CALL setPrefix(const OUString& prefix)
169 : throw (css::uno::RuntimeException, css::xml::dom::DOMException, std::exception) SAL_OVERRIDE
170 : {
171 2 : return CNode::setPrefix(prefix);
172 : }
173 :
174 : };
175 : }
176 : #endif
177 :
178 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|