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