1 /*************************************************************************
2  *
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * Copyright 2000, 2010 Oracle and/or its affiliates.
6  *
7  * OpenOffice.org - a multi-platform office productivity suite
8  *
9  * This file is part of OpenOffice.org.
10  *
11  * OpenOffice.org is free software: you can redistribute it and/or modify
12  * it under the terms of the GNU Lesser General Public License version 3
13  * only, as published by the Free Software Foundation.
14  *
15  * OpenOffice.org is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU Lesser General Public License version 3 for more details
19  * (a copy is included in the LICENSE file that accompanied this code).
20  *
21  * You should have received a copy of the GNU Lesser General Public License
22  * version 3 along with OpenOffice.org.  If not, see
23  * <http://www.openoffice.org/license.html>
24  * for a copy of the LGPLv3 License.
25  *
26  ************************************************************************/
27 
28 #ifndef DOM_PROCESSINGINSTRUCTION_HXX
29 #define DOM_PROCESSINGINSTRUCTION_HXX
30 
31 #include <libxml/tree.h>
32 
33 #include <com/sun/star/uno/Reference.h>
34 #include <com/sun/star/xml/dom/XProcessingInstruction.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, XProcessingInstruction >
46         CProcessingInstruction_Base;
47 
48     class CProcessingInstruction
49         : public CProcessingInstruction_Base
50     {
51     private:
52         friend class CDocument;
53 
54     protected:
55         CProcessingInstruction(
56                 CDocument const& rDocument, ::osl::Mutex const& rMutex,
57                 xmlNodePtr const pNode);
58 
59     public:
60 
61         virtual void saxify(const Reference< XDocumentHandler >& i_xHandler);
62 
63         /**
64         The content of this processing instruction.
65         */
66         virtual OUString SAL_CALL getData() throw (RuntimeException);
67 
68         /**
69         The target of this processing instruction.
70         */
71         virtual OUString SAL_CALL getTarget() throw (RuntimeException);
72 
73         /**
74         The content of this processing instruction.
75         */
76         virtual void SAL_CALL setData(const OUString& data) throw (RuntimeException, DOMException);
77 
78         // ---- resolve uno inheritance problems...
79         // overrides for XNode base
80         virtual OUString SAL_CALL getNodeName()
81             throw (RuntimeException);
82         virtual OUString SAL_CALL getNodeValue()
83             throw (RuntimeException);
84         virtual void SAL_CALL setNodeValue(OUString const& rNodeValue)
85             throw (RuntimeException, DOMException);
86 
87     // --- delegation for XNde base.
88     virtual Reference< XNode > SAL_CALL appendChild(const Reference< XNode >& newChild)
89         throw (RuntimeException, DOMException)
90     {
91         return CNode::appendChild(newChild);
92     }
93     virtual Reference< XNode > SAL_CALL cloneNode(sal_Bool deep)
94         throw (RuntimeException)
95     {
96         return CNode::cloneNode(deep);
97     }
98     virtual Reference< XNamedNodeMap > SAL_CALL getAttributes()
99         throw (RuntimeException)
100     {
101         return CNode::getAttributes();
102     }
103     virtual Reference< XNodeList > SAL_CALL getChildNodes()
104         throw (RuntimeException)
105     {
106         return CNode::getChildNodes();
107     }
108     virtual Reference< XNode > SAL_CALL getFirstChild()
109         throw (RuntimeException)
110     {
111         return CNode::getFirstChild();
112     }
113     virtual Reference< XNode > SAL_CALL getLastChild()
114         throw (RuntimeException)
115     {
116         return CNode::getLastChild();
117     }
118     virtual OUString SAL_CALL getLocalName()
119         throw (RuntimeException)
120     {
121         return CNode::getLocalName();
122     }
123     virtual OUString SAL_CALL getNamespaceURI()
124         throw (RuntimeException)
125     {
126         return CNode::getNamespaceURI();
127     }
128     virtual Reference< XNode > SAL_CALL getNextSibling()
129         throw (RuntimeException)
130     {
131         return CNode::getNextSibling();
132     }
133     virtual NodeType SAL_CALL getNodeType()
134         throw (RuntimeException)
135     {
136         return CNode::getNodeType();
137     }
138     virtual Reference< XDocument > SAL_CALL getOwnerDocument()
139         throw (RuntimeException)
140     {
141         return CNode::getOwnerDocument();
142     }
143     virtual Reference< XNode > SAL_CALL getParentNode()
144         throw (RuntimeException)
145     {
146         return CNode::getParentNode();
147     }
148     virtual OUString SAL_CALL getPrefix()
149         throw (RuntimeException)
150     {
151         return CNode::getPrefix();
152     }
153     virtual Reference< XNode > SAL_CALL getPreviousSibling()
154         throw (RuntimeException)
155     {
156         return CNode::getPreviousSibling();
157     }
158     virtual sal_Bool SAL_CALL hasAttributes()
159         throw (RuntimeException)
160     {
161         return CNode::hasAttributes();
162     }
163     virtual sal_Bool SAL_CALL hasChildNodes()
164         throw (RuntimeException)
165     {
166         return CNode::hasChildNodes();
167     }
168     virtual Reference< XNode > SAL_CALL insertBefore(
169             const Reference< XNode >& newChild, const Reference< XNode >& refChild)
170         throw (RuntimeException, DOMException)
171     {
172         return CNode::insertBefore(newChild, refChild);
173     }
174     virtual sal_Bool SAL_CALL isSupported(const OUString& feature, const OUString& ver)
175         throw (RuntimeException)
176     {
177         return CNode::isSupported(feature, ver);
178     }
179     virtual void SAL_CALL normalize()
180         throw (RuntimeException)
181     {
182         CNode::normalize();
183     }
184     virtual Reference< XNode > SAL_CALL removeChild(const Reference< XNode >& oldChild)
185         throw (RuntimeException, DOMException)
186     {
187         return CNode::removeChild(oldChild);
188     }
189     virtual Reference< XNode > SAL_CALL replaceChild(
190             const Reference< XNode >& newChild, const Reference< XNode >& oldChild)
191         throw (RuntimeException, DOMException)
192     {
193         return CNode::replaceChild(newChild, oldChild);
194     }
195     virtual void SAL_CALL setPrefix(const OUString& prefix)
196         throw (RuntimeException, DOMException)
197     {
198         return CNode::setPrefix(prefix);
199     }
200 
201     };
202 }
203 
204 #endif
205