xref: /trunk/main/unoxml/source/dom/processinginstruction.hxx (revision 45c5a00162811bd03b87fcb4fe9996782f2b59ec)
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_PROCESSINGINSTRUCTION_HXX
25 #define DOM_PROCESSINGINSTRUCTION_HXX
26 
27 #include <libxml/tree.h>
28 
29 #include <com/sun/star/uno/Reference.h>
30 #include <com/sun/star/xml/dom/XProcessingInstruction.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, XProcessingInstruction >
42         CProcessingInstruction_Base;
43 
44     class CProcessingInstruction
45         : public CProcessingInstruction_Base
46     {
47     private:
48         friend class CDocument;
49 
50     protected:
51         CProcessingInstruction(
52                 CDocument const& rDocument, ::osl::Mutex const& rMutex,
53                 xmlNodePtr const pNode);
54 
55     public:
56 
57         virtual void saxify(const Reference< XDocumentHandler >& i_xHandler);
58 
59         /**
60         The content of this processing instruction.
61         */
62         virtual OUString SAL_CALL getData();
63 
64         /**
65         The target of this processing instruction.
66         */
67         virtual OUString SAL_CALL getTarget();
68 
69         /**
70         The content of this processing instruction.
71         */
72         virtual void SAL_CALL setData(const OUString& data);
73 
74         // ---- resolve uno inheritance problems...
75         // overrides for XNode base
76         virtual OUString SAL_CALL getNodeName();
77         virtual OUString SAL_CALL getNodeValue();
78         virtual void SAL_CALL setNodeValue(OUString const& rNodeValue);
79 
80     // --- delegation for XNde base.
81     virtual Reference< XNode > SAL_CALL appendChild(const Reference< XNode >& newChild)
82     {
83         return CNode::appendChild(newChild);
84     }
85     virtual Reference< XNode > SAL_CALL cloneNode(sal_Bool deep)
86     {
87         return CNode::cloneNode(deep);
88     }
89     virtual Reference< XNamedNodeMap > SAL_CALL getAttributes()
90     {
91         return CNode::getAttributes();
92     }
93     virtual Reference< XNodeList > SAL_CALL getChildNodes()
94     {
95         return CNode::getChildNodes();
96     }
97     virtual Reference< XNode > SAL_CALL getFirstChild()
98     {
99         return CNode::getFirstChild();
100     }
101     virtual Reference< XNode > SAL_CALL getLastChild()
102     {
103         return CNode::getLastChild();
104     }
105     virtual OUString SAL_CALL getLocalName()
106     {
107         return CNode::getLocalName();
108     }
109     virtual OUString SAL_CALL getNamespaceURI()
110     {
111         return CNode::getNamespaceURI();
112     }
113     virtual Reference< XNode > SAL_CALL getNextSibling()
114     {
115         return CNode::getNextSibling();
116     }
117     virtual NodeType SAL_CALL getNodeType()
118     {
119         return CNode::getNodeType();
120     }
121     virtual Reference< XDocument > SAL_CALL getOwnerDocument()
122     {
123         return CNode::getOwnerDocument();
124     }
125     virtual Reference< XNode > SAL_CALL getParentNode()
126     {
127         return CNode::getParentNode();
128     }
129     virtual OUString SAL_CALL getPrefix()
130     {
131         return CNode::getPrefix();
132     }
133     virtual Reference< XNode > SAL_CALL getPreviousSibling()
134     {
135         return CNode::getPreviousSibling();
136     }
137     virtual sal_Bool SAL_CALL hasAttributes()
138     {
139         return CNode::hasAttributes();
140     }
141     virtual sal_Bool SAL_CALL hasChildNodes()
142     {
143         return CNode::hasChildNodes();
144     }
145     virtual Reference< XNode > SAL_CALL insertBefore(
146             const Reference< XNode >& newChild, const Reference< XNode >& refChild)
147     {
148         return CNode::insertBefore(newChild, refChild);
149     }
150     virtual sal_Bool SAL_CALL isSupported(const OUString& feature, const OUString& ver)
151     {
152         return CNode::isSupported(feature, ver);
153     }
154     virtual void SAL_CALL normalize()
155     {
156         CNode::normalize();
157     }
158     virtual Reference< XNode > SAL_CALL removeChild(const Reference< XNode >& oldChild)
159     {
160         return CNode::removeChild(oldChild);
161     }
162     virtual Reference< XNode > SAL_CALL replaceChild(
163             const Reference< XNode >& newChild, const Reference< XNode >& oldChild)
164     {
165         return CNode::replaceChild(newChild, oldChild);
166     }
167     virtual void SAL_CALL setPrefix(const OUString& prefix)
168     {
169         return CNode::setPrefix(prefix);
170     }
171 
172     };
173 }
174 
175 #endif
176