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_DOCUMENTFRAGMENT_HXX
29 #define DOM_DOCUMENTFRAGMENT_HXX
30 
31 #include <com/sun/star/uno/Reference.h>
32 #include <com/sun/star/xml/dom/XDocumentFragment.hpp>
33 
34 #include <node.hxx>
35 
36 
37 using ::rtl::OUString;
38 using namespace com::sun::star::uno;
39 using namespace com::sun::star::xml::dom;
40 
41 namespace DOM
42 {
43     typedef ::cppu::ImplInheritanceHelper1< CNode, XDocumentFragment >
44         CDocumentFragment_Base;
45 
46     class CDocumentFragment
47         : public CDocumentFragment_Base
48     {
49     private:
50         friend class CDocument;
51 
52     protected:
53         CDocumentFragment(
54                 CDocument const& rDocument, ::osl::Mutex const& rMutex,
55                 xmlNodePtr const pNode);
56 
57     public:
58         virtual bool IsChildTypeAllowed(NodeType const nodeType);
59 
60         // ---- resolve uno inheritance problems...
61         // overrides for XNode base
62         virtual OUString SAL_CALL getNodeName()
63             throw (RuntimeException);
64         virtual OUString SAL_CALL getNodeValue()
65             throw (RuntimeException);
66     // --- delegation for XNde base.
67     virtual Reference< XNode > SAL_CALL appendChild(const Reference< XNode >& newChild)
68         throw (RuntimeException, DOMException)
69     {
70         return CNode::appendChild(newChild);
71     }
72     virtual Reference< XNode > SAL_CALL cloneNode(sal_Bool deep)
73         throw (RuntimeException)
74     {
75         return CNode::cloneNode(deep);
76     }
77     virtual Reference< XNamedNodeMap > SAL_CALL getAttributes()
78         throw (RuntimeException)
79     {
80         return CNode::getAttributes();
81     }
82     virtual Reference< XNodeList > SAL_CALL getChildNodes()
83         throw (RuntimeException)
84     {
85         return CNode::getChildNodes();
86     }
87     virtual Reference< XNode > SAL_CALL getFirstChild()
88         throw (RuntimeException)
89     {
90         return CNode::getFirstChild();
91     }
92     virtual Reference< XNode > SAL_CALL getLastChild()
93         throw (RuntimeException)
94     {
95         return CNode::getLastChild();
96     }
97     virtual OUString SAL_CALL getLocalName()
98         throw (RuntimeException)
99     {
100         return CNode::getLocalName();
101     }
102     virtual OUString SAL_CALL getNamespaceURI()
103         throw (RuntimeException)
104     {
105         return CNode::getNamespaceURI();
106     }
107     virtual Reference< XNode > SAL_CALL getNextSibling()
108         throw (RuntimeException)
109     {
110         return CNode::getNextSibling();
111     }
112     virtual NodeType SAL_CALL getNodeType()
113         throw (RuntimeException)
114     {
115         return CNode::getNodeType();
116     }
117     virtual Reference< XDocument > SAL_CALL getOwnerDocument()
118         throw (RuntimeException)
119     {
120         return CNode::getOwnerDocument();
121     }
122     virtual Reference< XNode > SAL_CALL getParentNode()
123         throw (RuntimeException)
124     {
125         return CNode::getParentNode();
126     }
127     virtual OUString SAL_CALL getPrefix()
128         throw (RuntimeException)
129     {
130         return CNode::getPrefix();
131     }
132     virtual Reference< XNode > SAL_CALL getPreviousSibling()
133         throw (RuntimeException)
134     {
135         return CNode::getPreviousSibling();
136     }
137     virtual sal_Bool SAL_CALL hasAttributes()
138         throw (RuntimeException)
139     {
140         return CNode::hasAttributes();
141     }
142     virtual sal_Bool SAL_CALL hasChildNodes()
143         throw (RuntimeException)
144     {
145         return CNode::hasChildNodes();
146     }
147     virtual Reference< XNode > SAL_CALL insertBefore(
148             const Reference< XNode >& newChild, const Reference< XNode >& refChild)
149         throw (RuntimeException, DOMException)
150     {
151         return CNode::insertBefore(newChild, refChild);
152     }
153     virtual sal_Bool SAL_CALL isSupported(const OUString& feature, const OUString& ver)
154         throw (RuntimeException)
155     {
156         return CNode::isSupported(feature, ver);
157     }
158     virtual void SAL_CALL normalize()
159         throw (RuntimeException)
160     {
161         CNode::normalize();
162     }
163     virtual Reference< XNode > SAL_CALL removeChild(const Reference< XNode >& oldChild)
164         throw (RuntimeException, DOMException)
165     {
166         return CNode::removeChild(oldChild);
167     }
168     virtual Reference< XNode > SAL_CALL replaceChild(
169             const Reference< XNode >& newChild, const Reference< XNode >& oldChild)
170         throw (RuntimeException, DOMException)
171     {
172         return CNode::replaceChild(newChild, oldChild);
173     }
174     virtual void SAL_CALL setNodeValue(const OUString& nodeValue)
175         throw (RuntimeException, DOMException)
176     {
177         return CNode::setNodeValue(nodeValue);
178     }
179     virtual void SAL_CALL setPrefix(const OUString& prefix)
180         throw (RuntimeException, DOMException)
181     {
182         return CNode::setPrefix(prefix);
183     }
184 
185 
186     };
187 }
188 #endif
189 
190