1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 
24 #ifndef DOM_ENTITYREFERENCE_HXX
25 #define DOM_ENTITYREFERENCE_HXX
26 
27 #include <libxml/tree.h>
28 
29 #include <com/sun/star/uno/Reference.h>
30 #include <com/sun/star/xml/dom/XEntityReference.hpp>
31 
32 #include <node.hxx>
33 
34 
35 using ::rtl::OUString;
36 using namespace com::sun::star::uno;
37 using namespace com::sun::star::xml::dom;
38 
39 namespace DOM
40 {
41     typedef ::cppu::ImplInheritanceHelper1< CNode, XEntityReference >
42         CEntityReference_Base;
43 
44     class CEntityReference
45         : public CEntityReference_Base
46     {
47     private:
48         friend class CDocument;
49 
50     protected:
51         CEntityReference(
52             CDocument const& rDocument, ::osl::Mutex const& rMutex,
53             xmlNodePtr const pNode);
54 
55     public:
56         virtual bool IsChildTypeAllowed(NodeType const nodeType);
57 
58         // ---- resolve uno inheritance problems...
59         // overrides for XNode base
60         virtual OUString SAL_CALL getNodeName()
61             throw (RuntimeException);
62         virtual OUString SAL_CALL getNodeValue()
63             throw (RuntimeException);
64     // --- delegation for XNde base.
appendChild(const Reference<XNode> & newChild)65     virtual Reference< XNode > SAL_CALL appendChild(const Reference< XNode >& newChild)
66         throw (RuntimeException, DOMException)
67     {
68         return CNode::appendChild(newChild);
69     }
cloneNode(sal_Bool deep)70     virtual Reference< XNode > SAL_CALL cloneNode(sal_Bool deep)
71         throw (RuntimeException)
72     {
73         return CNode::cloneNode(deep);
74     }
getAttributes()75     virtual Reference< XNamedNodeMap > SAL_CALL getAttributes()
76         throw (RuntimeException)
77     {
78         return CNode::getAttributes();
79     }
getChildNodes()80     virtual Reference< XNodeList > SAL_CALL getChildNodes()
81         throw (RuntimeException)
82     {
83         return CNode::getChildNodes();
84     }
getFirstChild()85     virtual Reference< XNode > SAL_CALL getFirstChild()
86         throw (RuntimeException)
87     {
88         return CNode::getFirstChild();
89     }
getLastChild()90     virtual Reference< XNode > SAL_CALL getLastChild()
91         throw (RuntimeException)
92     {
93         return CNode::getLastChild();
94     }
getLocalName()95     virtual OUString SAL_CALL getLocalName()
96         throw (RuntimeException)
97     {
98         return CNode::getLocalName();
99     }
getNamespaceURI()100     virtual OUString SAL_CALL getNamespaceURI()
101         throw (RuntimeException)
102     {
103         return CNode::getNamespaceURI();
104     }
getNextSibling()105     virtual Reference< XNode > SAL_CALL getNextSibling()
106         throw (RuntimeException)
107     {
108         return CNode::getNextSibling();
109     }
getNodeType()110     virtual NodeType SAL_CALL getNodeType()
111         throw (RuntimeException)
112     {
113         return CNode::getNodeType();
114     }
getOwnerDocument()115     virtual Reference< XDocument > SAL_CALL getOwnerDocument()
116         throw (RuntimeException)
117     {
118         return CNode::getOwnerDocument();
119     }
getParentNode()120     virtual Reference< XNode > SAL_CALL getParentNode()
121         throw (RuntimeException)
122     {
123         return CNode::getParentNode();
124     }
getPrefix()125     virtual OUString SAL_CALL getPrefix()
126         throw (RuntimeException)
127     {
128         return CNode::getPrefix();
129     }
getPreviousSibling()130     virtual Reference< XNode > SAL_CALL getPreviousSibling()
131         throw (RuntimeException)
132     {
133         return CNode::getPreviousSibling();
134     }
hasAttributes()135     virtual sal_Bool SAL_CALL hasAttributes()
136         throw (RuntimeException)
137     {
138         return CNode::hasAttributes();
139     }
hasChildNodes()140     virtual sal_Bool SAL_CALL hasChildNodes()
141         throw (RuntimeException)
142     {
143         return CNode::hasChildNodes();
144     }
insertBefore(const Reference<XNode> & newChild,const Reference<XNode> & refChild)145     virtual Reference< XNode > SAL_CALL insertBefore(
146             const Reference< XNode >& newChild, const Reference< XNode >& refChild)
147         throw (RuntimeException, DOMException)
148     {
149         return CNode::insertBefore(newChild, refChild);
150     }
isSupported(const OUString & feature,const OUString & ver)151     virtual sal_Bool SAL_CALL isSupported(const OUString& feature, const OUString& ver)
152         throw (RuntimeException)
153     {
154         return CNode::isSupported(feature, ver);
155     }
normalize()156     virtual void SAL_CALL normalize()
157         throw (RuntimeException)
158     {
159         CNode::normalize();
160     }
removeChild(const Reference<XNode> & oldChild)161     virtual Reference< XNode > SAL_CALL removeChild(const Reference< XNode >& oldChild)
162         throw (RuntimeException, DOMException)
163     {
164         return CNode::removeChild(oldChild);
165     }
replaceChild(const Reference<XNode> & newChild,const Reference<XNode> & oldChild)166     virtual Reference< XNode > SAL_CALL replaceChild(
167             const Reference< XNode >& newChild, const Reference< XNode >& oldChild)
168         throw (RuntimeException, DOMException)
169     {
170         return CNode::replaceChild(newChild, oldChild);
171     }
setNodeValue(const OUString & nodeValue)172     virtual void SAL_CALL setNodeValue(const OUString& nodeValue)
173         throw (RuntimeException, DOMException)
174     {
175         return CNode::setNodeValue(nodeValue);
176     }
setPrefix(const OUString & prefix)177     virtual void SAL_CALL setPrefix(const OUString& prefix)
178         throw (RuntimeException, DOMException)
179     {
180         return CNode::setPrefix(prefix);
181     }
182 
183     };
184 }
185 #endif
186