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() throw (RuntimeException);
63 
64         /**
65         The target of this processing instruction.
66         */
67         virtual OUString SAL_CALL getTarget() throw (RuntimeException);
68 
69         /**
70         The content of this processing instruction.
71         */
72         virtual void SAL_CALL setData(const OUString& data) throw (RuntimeException, DOMException);
73 
74         // ---- resolve uno inheritance problems...
75         // overrides for XNode base
76         virtual OUString SAL_CALL getNodeName()
77             throw (RuntimeException);
78         virtual OUString SAL_CALL getNodeValue()
79             throw (RuntimeException);
80         virtual void SAL_CALL setNodeValue(OUString const& rNodeValue)
81             throw (RuntimeException, DOMException);
82 
83     // --- delegation for XNde base.
appendChild(const Reference<XNode> & newChild)84     virtual Reference< XNode > SAL_CALL appendChild(const Reference< XNode >& newChild)
85         throw (RuntimeException, DOMException)
86     {
87         return CNode::appendChild(newChild);
88     }
cloneNode(sal_Bool deep)89     virtual Reference< XNode > SAL_CALL cloneNode(sal_Bool deep)
90         throw (RuntimeException)
91     {
92         return CNode::cloneNode(deep);
93     }
getAttributes()94     virtual Reference< XNamedNodeMap > SAL_CALL getAttributes()
95         throw (RuntimeException)
96     {
97         return CNode::getAttributes();
98     }
getChildNodes()99     virtual Reference< XNodeList > SAL_CALL getChildNodes()
100         throw (RuntimeException)
101     {
102         return CNode::getChildNodes();
103     }
getFirstChild()104     virtual Reference< XNode > SAL_CALL getFirstChild()
105         throw (RuntimeException)
106     {
107         return CNode::getFirstChild();
108     }
getLastChild()109     virtual Reference< XNode > SAL_CALL getLastChild()
110         throw (RuntimeException)
111     {
112         return CNode::getLastChild();
113     }
getLocalName()114     virtual OUString SAL_CALL getLocalName()
115         throw (RuntimeException)
116     {
117         return CNode::getLocalName();
118     }
getNamespaceURI()119     virtual OUString SAL_CALL getNamespaceURI()
120         throw (RuntimeException)
121     {
122         return CNode::getNamespaceURI();
123     }
getNextSibling()124     virtual Reference< XNode > SAL_CALL getNextSibling()
125         throw (RuntimeException)
126     {
127         return CNode::getNextSibling();
128     }
getNodeType()129     virtual NodeType SAL_CALL getNodeType()
130         throw (RuntimeException)
131     {
132         return CNode::getNodeType();
133     }
getOwnerDocument()134     virtual Reference< XDocument > SAL_CALL getOwnerDocument()
135         throw (RuntimeException)
136     {
137         return CNode::getOwnerDocument();
138     }
getParentNode()139     virtual Reference< XNode > SAL_CALL getParentNode()
140         throw (RuntimeException)
141     {
142         return CNode::getParentNode();
143     }
getPrefix()144     virtual OUString SAL_CALL getPrefix()
145         throw (RuntimeException)
146     {
147         return CNode::getPrefix();
148     }
getPreviousSibling()149     virtual Reference< XNode > SAL_CALL getPreviousSibling()
150         throw (RuntimeException)
151     {
152         return CNode::getPreviousSibling();
153     }
hasAttributes()154     virtual sal_Bool SAL_CALL hasAttributes()
155         throw (RuntimeException)
156     {
157         return CNode::hasAttributes();
158     }
hasChildNodes()159     virtual sal_Bool SAL_CALL hasChildNodes()
160         throw (RuntimeException)
161     {
162         return CNode::hasChildNodes();
163     }
insertBefore(const Reference<XNode> & newChild,const Reference<XNode> & refChild)164     virtual Reference< XNode > SAL_CALL insertBefore(
165             const Reference< XNode >& newChild, const Reference< XNode >& refChild)
166         throw (RuntimeException, DOMException)
167     {
168         return CNode::insertBefore(newChild, refChild);
169     }
isSupported(const OUString & feature,const OUString & ver)170     virtual sal_Bool SAL_CALL isSupported(const OUString& feature, const OUString& ver)
171         throw (RuntimeException)
172     {
173         return CNode::isSupported(feature, ver);
174     }
normalize()175     virtual void SAL_CALL normalize()
176         throw (RuntimeException)
177     {
178         CNode::normalize();
179     }
removeChild(const Reference<XNode> & oldChild)180     virtual Reference< XNode > SAL_CALL removeChild(const Reference< XNode >& oldChild)
181         throw (RuntimeException, DOMException)
182     {
183         return CNode::removeChild(oldChild);
184     }
replaceChild(const Reference<XNode> & newChild,const Reference<XNode> & oldChild)185     virtual Reference< XNode > SAL_CALL replaceChild(
186             const Reference< XNode >& newChild, const Reference< XNode >& oldChild)
187         throw (RuntimeException, DOMException)
188     {
189         return CNode::replaceChild(newChild, oldChild);
190     }
setPrefix(const OUString & prefix)191     virtual void SAL_CALL setPrefix(const OUString& prefix)
192         throw (RuntimeException, DOMException)
193     {
194         return CNode::setPrefix(prefix);
195     }
196 
197     };
198 }
199 
200 #endif
201