xref: /trunk/main/unoxml/source/dom/documenttype.hxx (revision 91144cd0085a7583d2099b982122deb2184ab956)
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_DOCUMENTTYPE_HXX
25 #define DOM_DOCUMENTTYPE_HXX
26 
27 #include <libxml/tree.h>
28 
29 #include <sal/types.h>
30 
31 #include <com/sun/star/uno/Reference.h>
32 #include <com/sun/star/xml/dom/XDocumentType.hpp>
33 #include <com/sun/star/xml/dom/XNodeList.hpp>
34 #include <com/sun/star/xml/dom/XNamedNodeMap.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, XDocumentType >
46         CDocumentType_Base;
47 
48     class CDocumentType
49         : public CDocumentType_Base
50     {
51     private:
52         friend class CDocument;
53 
54     private:
55         xmlDtdPtr m_aDtdPtr;
56 
57     protected:
58         CDocumentType(CDocument const& rDocument, ::osl::Mutex const& rMutex,
59                 xmlDtdPtr const pDtd);
60 
61     public:
62         /**
63         A NamedNodeMap containing the general entities, both external and
64         internal, declared in the DTD.
65         */
66         virtual Reference< XNamedNodeMap > SAL_CALL getEntities();
67 
68         /**
69         The internal subset as a string, or null if there is none.
70         */
71         virtual OUString SAL_CALL getInternalSubset();
72 
73         /**
74         The name of DTD; i.e., the name immediately following the DOCTYPE
75         keyword.
76         */
77         virtual OUString SAL_CALL getName();
78 
79         /**
80         A NamedNodeMap containing the notations declared in the DTD.
81         */
82         virtual Reference< XNamedNodeMap > SAL_CALL getNotations();
83 
84         /**
85         The public identifier of the external subset.
86         */
87         virtual OUString SAL_CALL getPublicId();
88 
89         /**
90         The system identifier of the external subset.
91         */
92         virtual OUString SAL_CALL getSystemId();
93 
94         // ---- resolve uno inheritance problems...
95         // overrides for XNode base
96         virtual OUString SAL_CALL getNodeName();
97         virtual OUString SAL_CALL getNodeValue();
98     // --- delegation for XNde base.
appendChild(const Reference<XNode> & newChild)99     virtual Reference< XNode > SAL_CALL appendChild(const Reference< XNode >& newChild)
100     {
101         return CNode::appendChild(newChild);
102     }
cloneNode(sal_Bool deep)103     virtual Reference< XNode > SAL_CALL cloneNode(sal_Bool deep)
104     {
105         return CNode::cloneNode(deep);
106     }
getAttributes()107     virtual Reference< XNamedNodeMap > SAL_CALL getAttributes()
108     {
109         return CNode::getAttributes();
110     }
getChildNodes()111     virtual Reference< XNodeList > SAL_CALL getChildNodes()
112     {
113         return CNode::getChildNodes();
114     }
getFirstChild()115     virtual Reference< XNode > SAL_CALL getFirstChild()
116     {
117         return CNode::getFirstChild();
118     }
getLastChild()119     virtual Reference< XNode > SAL_CALL getLastChild()
120     {
121         return CNode::getLastChild();
122     }
getLocalName()123     virtual OUString SAL_CALL getLocalName()
124     {
125         return CNode::getLocalName();
126     }
getNamespaceURI()127     virtual OUString SAL_CALL getNamespaceURI()
128     {
129         return CNode::getNamespaceURI();
130     }
getNextSibling()131     virtual Reference< XNode > SAL_CALL getNextSibling()
132     {
133         return CNode::getNextSibling();
134     }
getNodeType()135     virtual NodeType SAL_CALL getNodeType()
136     {
137         return CNode::getNodeType();
138     }
getOwnerDocument()139     virtual Reference< XDocument > SAL_CALL getOwnerDocument()
140     {
141         return CNode::getOwnerDocument();
142     }
getParentNode()143     virtual Reference< XNode > SAL_CALL getParentNode()
144     {
145         return CNode::getParentNode();
146     }
getPrefix()147     virtual OUString SAL_CALL getPrefix()
148     {
149         return CNode::getPrefix();
150     }
getPreviousSibling()151     virtual Reference< XNode > SAL_CALL getPreviousSibling()
152     {
153         return CNode::getPreviousSibling();
154     }
hasAttributes()155     virtual sal_Bool SAL_CALL hasAttributes()
156     {
157         return CNode::hasAttributes();
158     }
hasChildNodes()159     virtual sal_Bool SAL_CALL hasChildNodes()
160     {
161         return CNode::hasChildNodes();
162     }
insertBefore(const Reference<XNode> & newChild,const Reference<XNode> & refChild)163     virtual Reference< XNode > SAL_CALL insertBefore(
164             const Reference< XNode >& newChild, const Reference< XNode >& refChild)
165     {
166         return CNode::insertBefore(newChild, refChild);
167     }
isSupported(const OUString & feature,const OUString & ver)168     virtual sal_Bool SAL_CALL isSupported(const OUString& feature, const OUString& ver)
169     {
170         return CNode::isSupported(feature, ver);
171     }
normalize()172     virtual void SAL_CALL normalize()
173     {
174         CNode::normalize();
175     }
removeChild(const Reference<XNode> & oldChild)176     virtual Reference< XNode > SAL_CALL removeChild(const Reference< XNode >& oldChild)
177     {
178         return CNode::removeChild(oldChild);
179     }
replaceChild(const Reference<XNode> & newChild,const Reference<XNode> & oldChild)180     virtual Reference< XNode > SAL_CALL replaceChild(
181             const Reference< XNode >& newChild, const Reference< XNode >& oldChild)
182     {
183         return CNode::replaceChild(newChild, oldChild);
184     }
setNodeValue(const OUString & nodeValue)185     virtual void SAL_CALL setNodeValue(const OUString& nodeValue)
186     {
187         return CNode::setNodeValue(nodeValue);
188     }
setPrefix(const OUString & prefix)189     virtual void SAL_CALL setPrefix(const OUString& prefix)
190     {
191         return CNode::setPrefix(prefix);
192     }
193 
194     };
195 }
196 #endif
197