1 /*************************************************************************
2  *
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * Copyright 2000, 2010 Oracle and/or its affiliates.
6  *
7  * OpenOffice.org - a multi-platform office productivity suite
8  *
9  * This file is part of OpenOffice.org.
10  *
11  * OpenOffice.org is free software: you can redistribute it and/or modify
12  * it under the terms of the GNU Lesser General Public License version 3
13  * only, as published by the Free Software Foundation.
14  *
15  * OpenOffice.org is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU Lesser General Public License version 3 for more details
19  * (a copy is included in the LICENSE file that accompanied this code).
20  *
21  * You should have received a copy of the GNU Lesser General Public License
22  * version 3 along with OpenOffice.org.  If not, see
23  * <http://www.openoffice.org/license.html>
24  * for a copy of the LGPLv3 License.
25  *
26  ************************************************************************/
27 
28 #ifndef DOM_ENTITYREFERENCE_HXX
29 #define DOM_ENTITYREFERENCE_HXX
30 
31 #include <libxml/tree.h>
32 
33 #include <com/sun/star/uno/Reference.h>
34 #include <com/sun/star/xml/dom/XEntityReference.hpp>
35 
36 #include <node.hxx>
37 
38 
39 using ::rtl::OUString;
40 using namespace com::sun::star::uno;
41 using namespace com::sun::star::xml::dom;
42 
43 namespace DOM
44 {
45     typedef ::cppu::ImplInheritanceHelper1< CNode, XEntityReference >
46         CEntityReference_Base;
47 
48     class CEntityReference
49         : public CEntityReference_Base
50     {
51     private:
52         friend class CDocument;
53 
54     protected:
55         CEntityReference(
56             CDocument const& rDocument, ::osl::Mutex const& rMutex,
57             xmlNodePtr const pNode);
58 
59     public:
60         virtual bool IsChildTypeAllowed(NodeType const nodeType);
61 
62         // ---- resolve uno inheritance problems...
63         // overrides for XNode base
64         virtual OUString SAL_CALL getNodeName()
65             throw (RuntimeException);
66         virtual OUString SAL_CALL getNodeValue()
67             throw (RuntimeException);
68     // --- delegation for XNde base.
69     virtual Reference< XNode > SAL_CALL appendChild(const Reference< XNode >& newChild)
70         throw (RuntimeException, DOMException)
71     {
72         return CNode::appendChild(newChild);
73     }
74     virtual Reference< XNode > SAL_CALL cloneNode(sal_Bool deep)
75         throw (RuntimeException)
76     {
77         return CNode::cloneNode(deep);
78     }
79     virtual Reference< XNamedNodeMap > SAL_CALL getAttributes()
80         throw (RuntimeException)
81     {
82         return CNode::getAttributes();
83     }
84     virtual Reference< XNodeList > SAL_CALL getChildNodes()
85         throw (RuntimeException)
86     {
87         return CNode::getChildNodes();
88     }
89     virtual Reference< XNode > SAL_CALL getFirstChild()
90         throw (RuntimeException)
91     {
92         return CNode::getFirstChild();
93     }
94     virtual Reference< XNode > SAL_CALL getLastChild()
95         throw (RuntimeException)
96     {
97         return CNode::getLastChild();
98     }
99     virtual OUString SAL_CALL getLocalName()
100         throw (RuntimeException)
101     {
102         return CNode::getLocalName();
103     }
104     virtual OUString SAL_CALL getNamespaceURI()
105         throw (RuntimeException)
106     {
107         return CNode::getNamespaceURI();
108     }
109     virtual Reference< XNode > SAL_CALL getNextSibling()
110         throw (RuntimeException)
111     {
112         return CNode::getNextSibling();
113     }
114     virtual NodeType SAL_CALL getNodeType()
115         throw (RuntimeException)
116     {
117         return CNode::getNodeType();
118     }
119     virtual Reference< XDocument > SAL_CALL getOwnerDocument()
120         throw (RuntimeException)
121     {
122         return CNode::getOwnerDocument();
123     }
124     virtual Reference< XNode > SAL_CALL getParentNode()
125         throw (RuntimeException)
126     {
127         return CNode::getParentNode();
128     }
129     virtual OUString SAL_CALL getPrefix()
130         throw (RuntimeException)
131     {
132         return CNode::getPrefix();
133     }
134     virtual Reference< XNode > SAL_CALL getPreviousSibling()
135         throw (RuntimeException)
136     {
137         return CNode::getPreviousSibling();
138     }
139     virtual sal_Bool SAL_CALL hasAttributes()
140         throw (RuntimeException)
141     {
142         return CNode::hasAttributes();
143     }
144     virtual sal_Bool SAL_CALL hasChildNodes()
145         throw (RuntimeException)
146     {
147         return CNode::hasChildNodes();
148     }
149     virtual Reference< XNode > SAL_CALL insertBefore(
150             const Reference< XNode >& newChild, const Reference< XNode >& refChild)
151         throw (RuntimeException, DOMException)
152     {
153         return CNode::insertBefore(newChild, refChild);
154     }
155     virtual sal_Bool SAL_CALL isSupported(const OUString& feature, const OUString& ver)
156         throw (RuntimeException)
157     {
158         return CNode::isSupported(feature, ver);
159     }
160     virtual void SAL_CALL normalize()
161         throw (RuntimeException)
162     {
163         CNode::normalize();
164     }
165     virtual Reference< XNode > SAL_CALL removeChild(const Reference< XNode >& oldChild)
166         throw (RuntimeException, DOMException)
167     {
168         return CNode::removeChild(oldChild);
169     }
170     virtual Reference< XNode > SAL_CALL replaceChild(
171             const Reference< XNode >& newChild, const Reference< XNode >& oldChild)
172         throw (RuntimeException, DOMException)
173     {
174         return CNode::replaceChild(newChild, oldChild);
175     }
176     virtual void SAL_CALL setNodeValue(const OUString& nodeValue)
177         throw (RuntimeException, DOMException)
178     {
179         return CNode::setNodeValue(nodeValue);
180     }
181     virtual void SAL_CALL setPrefix(const OUString& prefix)
182         throw (RuntimeException, DOMException)
183     {
184         return CNode::setPrefix(prefix);
185     }
186 
187     };
188 }
189 #endif
190