update dev300-m58
[ooovba.git] / configmgr / source / api2 / elementaccess.hxx
blob8bf73774a2eafed76da070898008e8f4df2f5d21
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: elementaccess.hxx,v $
10 * $Revision: 1.6 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #ifndef CONFIGMGR_API_ELEMENTACCESS_HXX_
32 #define CONFIGMGR_API_ELEMENTACCESS_HXX_
34 #include <com/sun/star/container/XChild.hpp>
35 #include <com/sun/star/container/XNamed.hpp>
36 #include <com/sun/star/configuration/XTemplateInstance.hpp>
37 #include <com/sun/star/lang/XLocalizable.hpp>
38 #include <com/sun/star/lang/XUnoTunnel.hpp>
39 #include <com/sun/star/lang/XComponent.hpp>
40 #include <com/sun/star/lang/XServiceInfo.hpp>
41 #include <com/sun/star/util/XChangesNotifier.hpp>
42 #include <com/sun/star/util/XChangesBatch.hpp>
43 #include <cppuhelper/implbase3.hxx>
44 #include <cppuhelper/implbase5.hxx>
45 #include <cppuhelper/implbase6.hxx>
47 namespace configmgr
49 //-----------------------------------------------------------------------------
50 namespace css = ::com::sun::star;
51 namespace uno = ::com::sun::star::uno;
53 //-----------------------------------------------------------------------------
54 namespace configapi
56 class NodeAccess;
57 class InnerElement;
58 class SetElement;
59 class RootElement;
60 class UpdateRootElement;
62 //-----------------------------------------------------------------------------
64 /** implements the interfaces supported by a inner node
65 within the configuration tree that is a plain node (group member).
66 <p> Is an interface adapter around
67 <type scope='configmgr::configapi'>NodeAccess</type> and
68 <type scope='configmgr::configapi'>InnerElement</type>.</p>
70 class BasicInnerElement : public cppu::WeakImplHelper3< css::container::XChild, css::container::XNamed, css::lang::XServiceInfo >
72 protected:
73 // Destructors
74 virtual ~BasicInnerElement() {}
76 public:
77 // Interface methods
78 // XInterface ('dispose' management) - partial implementation
79 virtual void SAL_CALL acquire() throw();
80 virtual void SAL_CALL release() throw();
82 // XTypeProvider (from implhelper) - partial implementation
83 virtual uno::Sequence<sal_Int8> SAL_CALL
84 getImplementationId( )
85 throw(uno::RuntimeException);
87 // XChild
88 virtual uno::Reference< uno::XInterface > SAL_CALL
89 getParent( )
90 throw(uno::RuntimeException);
92 virtual void SAL_CALL // not supported
93 setParent( const uno::Reference< uno::XInterface >& Parent )
94 throw(css::lang::NoSupportException, css::uno::RuntimeException);
96 // XNamed
97 virtual rtl::OUString SAL_CALL
98 getName( )
99 throw(uno::RuntimeException);
101 virtual void SAL_CALL // not supported (! - missing exception)
102 setName( const rtl::OUString& aName )
103 throw(uno::RuntimeException);
105 // XServiceInfo
106 virtual rtl::OUString SAL_CALL
107 getImplementationName( )
108 throw(uno::RuntimeException);
110 virtual sal_Bool SAL_CALL
111 supportsService( const rtl::OUString& ServiceName )
112 throw(uno::RuntimeException);
114 virtual uno::Sequence< rtl::OUString > SAL_CALL
115 getSupportedServiceNames( )
116 throw(uno::RuntimeException);
118 protected:
119 virtual configapi::InnerElement& getElementClass() = 0;
120 virtual configapi::NodeAccess& getNodeAccess() = 0;
122 //-----------------------------------------------------------------------------
124 /** implements the interfaces supported by a node
125 within the configuration tree that is a set element (or floating free).
126 <p> Is an interface adapter around
127 <type scope='configmgr::configapi'>NodeAccess</type> and
128 <type scope='configmgr::configapi'>SetElement</type>.</p>
130 class BasicSetElement : public cppu::WeakImplHelper6< css::container::XChild, css::container::XNamed, css::lang::XComponent, css::lang::XServiceInfo, css::configuration::XTemplateInstance, css::lang::XUnoTunnel >
132 protected:
133 // Destructors
134 virtual ~BasicSetElement() {}
136 public:
137 // Interface methods
138 // XInterface ('dispose' management) - partial implementation
139 virtual void SAL_CALL acquire() throw();
140 virtual void SAL_CALL release() throw();
142 // XTypeProvider (from implhelper) - partial implementation
143 virtual uno::Sequence<sal_Int8> SAL_CALL
144 getImplementationId( )
145 throw(uno::RuntimeException);
147 // XChild
148 virtual uno::Reference< uno::XInterface > SAL_CALL
149 getParent( )
150 throw(uno::RuntimeException);
152 virtual void SAL_CALL // currently not supported
153 setParent( const uno::Reference< uno::XInterface >& Parent )
154 throw(css::lang::NoSupportException, css::uno::RuntimeException);
156 // XNamed
157 virtual rtl::OUString SAL_CALL
158 getName( )
159 throw(uno::RuntimeException);
161 virtual void SAL_CALL // generally not supported (! - missing exception)
162 setName( const rtl::OUString& aName )
163 throw(uno::RuntimeException);
165 // XComponent
166 virtual void SAL_CALL
167 dispose( )
168 throw(uno::RuntimeException);
170 virtual void SAL_CALL
171 addEventListener( const uno::Reference< css::lang::XEventListener >& xListener )
172 throw(uno::RuntimeException);
174 virtual void SAL_CALL
175 removeEventListener( const uno::Reference< css::lang::XEventListener >& aListener )
176 throw(uno::RuntimeException);
178 // XServiceInfo
179 virtual rtl::OUString SAL_CALL
180 getImplementationName( )
181 throw(uno::RuntimeException);
183 virtual sal_Bool SAL_CALL
184 supportsService( const rtl::OUString& ServiceName )
185 throw(uno::RuntimeException);
187 virtual uno::Sequence< rtl::OUString > SAL_CALL
188 getSupportedServiceNames( )
189 throw(uno::RuntimeException);
191 // XTemplateInstance
192 virtual rtl::OUString SAL_CALL
193 getTemplateName( )
194 throw(uno::RuntimeException);
196 // XUnoTunnel
197 virtual sal_Int64 SAL_CALL
198 getSomething( const uno::Sequence< sal_Int8 >& aIdentifier )
199 throw(uno::RuntimeException);
201 protected:
202 virtual configapi::SetElement& getElementClass() = 0;
203 virtual configapi::NodeAccess& getNodeAccess() = 0;
205 //-----------------------------------------------------------------------------
207 /** implements the interfaces supported by a node
208 within the configuration that is the root of a read-only access
209 <p> Is an interface adapter around
210 <type scope='configmgr::configapi'>NodeAccess</type> and
211 <type scope='configmgr::configapi'>SetElement</type>.</p>
213 class BasicRootElement : public cppu::WeakImplHelper5< css::container::XNamed, css::util::XChangesNotifier, css::lang::XComponent, css::lang::XServiceInfo, css::lang::XLocalizable >
215 protected:
216 // Destructors
217 virtual ~BasicRootElement() {}
219 public:
220 // Interface methods
221 // XInterface ('dispose' management) - partial implementation
222 virtual void SAL_CALL acquire() throw();
223 virtual void SAL_CALL release() throw();
225 // XTypeProvider (from implhelper) - partial implementation
226 virtual uno::Sequence<sal_Int8> SAL_CALL
227 getImplementationId( )
228 throw(uno::RuntimeException);
230 // XNamed
231 virtual rtl::OUString SAL_CALL
232 getName( )
233 throw(uno::RuntimeException);
235 virtual void SAL_CALL // generally not supported (! - missing exception)
236 setName( const rtl::OUString& aName )
237 throw(uno::RuntimeException);
239 // XChangesNotifier
240 virtual void SAL_CALL
241 addChangesListener( const uno::Reference< css::util::XChangesListener >& xListener )
242 throw(uno::RuntimeException);
244 virtual void SAL_CALL
245 removeChangesListener( const uno::Reference< css::util::XChangesListener >& xListener )
246 throw(uno::RuntimeException);
248 // XComponent
249 virtual void SAL_CALL
250 dispose( )
251 throw(uno::RuntimeException);
253 virtual void SAL_CALL
254 addEventListener( const uno::Reference< css::lang::XEventListener >& xListener )
255 throw(uno::RuntimeException);
257 virtual void SAL_CALL
258 removeEventListener( const uno::Reference< css::lang::XEventListener >& aListener )
259 throw(uno::RuntimeException);
261 // XServiceInfo
262 virtual rtl::OUString SAL_CALL
263 getImplementationName( )
264 throw(uno::RuntimeException);
266 virtual sal_Bool SAL_CALL
267 supportsService( const rtl::OUString& ServiceName )
268 throw(uno::RuntimeException);
270 virtual uno::Sequence< rtl::OUString > SAL_CALL
271 getSupportedServiceNames( )
272 throw(uno::RuntimeException);
274 // XLocalizable
275 virtual css::lang::Locale SAL_CALL
276 getLocale( )
277 throw(uno::RuntimeException);
279 virtual void SAL_CALL // maybe not supported (! - missing exception)
280 setLocale( const css::lang::Locale& eLocale )
281 throw(uno::RuntimeException);
283 protected:
284 virtual configapi::RootElement& getElementClass() = 0;
285 virtual configapi::NodeAccess& getNodeAccess() = 0;
287 //-----------------------------------------------------------------------------
289 /** implements the interfaces supported by a node
290 within the configuration that is the root of an update access
291 <p> Is an interface adapter around
292 <type scope='configmgr::configapi'>NodeAccess</type> and
293 <type scope='configmgr::configapi'>SetElement</type>.</p>
295 class BasicUpdateElement : public cppu::WeakImplHelper6< css::container::XNamed, css::util::XChangesNotifier, css::lang::XComponent, css::lang::XServiceInfo, css::lang::XLocalizable, css::util::XChangesBatch >
297 protected:
298 // Destructors
299 virtual ~BasicUpdateElement() {}
301 public:
302 // Interface methods
303 // XInterface ('dispose' management) - partial implementation
304 virtual void SAL_CALL acquire() throw();
305 virtual void SAL_CALL release() throw();
307 // XTypeProvider (from implhelper) - partial implementation
308 virtual uno::Sequence<sal_Int8> SAL_CALL
309 getImplementationId( )
310 throw(uno::RuntimeException);
312 // XNamed
313 virtual rtl::OUString SAL_CALL
314 getName( )
315 throw(uno::RuntimeException);
317 virtual void SAL_CALL // generally not supported (! - missing exception)
318 setName( const rtl::OUString& aName )
319 throw(uno::RuntimeException);
321 // XChangesNotifier
322 virtual void SAL_CALL
323 addChangesListener( const uno::Reference< css::util::XChangesListener >& xListener )
324 throw(uno::RuntimeException);
326 virtual void SAL_CALL
327 removeChangesListener( const uno::Reference< css::util::XChangesListener >& xListener )
328 throw(uno::RuntimeException);
330 // XComponent
331 virtual void SAL_CALL
332 dispose( )
333 throw(uno::RuntimeException);
335 virtual void SAL_CALL
336 addEventListener( const uno::Reference< css::lang::XEventListener >& xListener )
337 throw(uno::RuntimeException);
339 virtual void SAL_CALL
340 removeEventListener( const uno::Reference< css::lang::XEventListener >& aListener )
341 throw(uno::RuntimeException);
343 // XServiceInfo
344 virtual rtl::OUString SAL_CALL
345 getImplementationName( )
346 throw(uno::RuntimeException);
348 virtual sal_Bool SAL_CALL
349 supportsService( const rtl::OUString& ServiceName )
350 throw(uno::RuntimeException);
352 virtual uno::Sequence< rtl::OUString > SAL_CALL
353 getSupportedServiceNames( )
354 throw(uno::RuntimeException);
356 // XChangesBatch
357 virtual void SAL_CALL
358 commitChanges( )
359 throw(css::lang::WrappedTargetException, uno::RuntimeException);
361 virtual sal_Bool SAL_CALL
362 hasPendingChanges( )
363 throw(uno::RuntimeException);
365 virtual uno::Sequence< css::util::ElementChange > SAL_CALL
366 getPendingChanges( )
367 throw(uno::RuntimeException);
369 // XLocalizable
370 virtual css::lang::Locale SAL_CALL
371 getLocale( )
372 throw(uno::RuntimeException);
374 virtual void SAL_CALL // maybe not supported (! - missing exception)
375 setLocale( const css::lang::Locale& eLocale )
376 throw(uno::RuntimeException);
378 protected:
379 virtual configapi::UpdateRootElement& getElementClass() = 0;
380 virtual configapi::NodeAccess& getNodeAccess() = 0;
382 //-----------------------------------------------------------------------------
384 #endif // CONFIGMGR_API_ELEMENTACCESS_HXX_