1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: elementaccess.hxx,v $
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>
49 //-----------------------------------------------------------------------------
50 namespace css
= ::com::sun::star
;
51 namespace uno
= ::com::sun::star::uno
;
53 //-----------------------------------------------------------------------------
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
>
74 virtual ~BasicInnerElement() {}
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
);
88 virtual uno::Reference
< uno::XInterface
> SAL_CALL
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
);
97 virtual rtl::OUString SAL_CALL
99 throw(uno::RuntimeException
);
101 virtual void SAL_CALL
// not supported (! - missing exception)
102 setName( const rtl::OUString
& aName
)
103 throw(uno::RuntimeException
);
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
);
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
>
134 virtual ~BasicSetElement() {}
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
);
148 virtual uno::Reference
< uno::XInterface
> SAL_CALL
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
);
157 virtual rtl::OUString SAL_CALL
159 throw(uno::RuntimeException
);
161 virtual void SAL_CALL
// generally not supported (! - missing exception)
162 setName( const rtl::OUString
& aName
)
163 throw(uno::RuntimeException
);
166 virtual void SAL_CALL
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
);
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
);
192 virtual rtl::OUString SAL_CALL
194 throw(uno::RuntimeException
);
197 virtual sal_Int64 SAL_CALL
198 getSomething( const uno::Sequence
< sal_Int8
>& aIdentifier
)
199 throw(uno::RuntimeException
);
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
>
217 virtual ~BasicRootElement() {}
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
);
231 virtual rtl::OUString SAL_CALL
233 throw(uno::RuntimeException
);
235 virtual void SAL_CALL
// generally not supported (! - missing exception)
236 setName( const rtl::OUString
& aName
)
237 throw(uno::RuntimeException
);
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
);
249 virtual void SAL_CALL
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
);
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
);
275 virtual css::lang::Locale SAL_CALL
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
);
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
>
299 virtual ~BasicUpdateElement() {}
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
);
313 virtual rtl::OUString SAL_CALL
315 throw(uno::RuntimeException
);
317 virtual void SAL_CALL
// generally not supported (! - missing exception)
318 setName( const rtl::OUString
& aName
)
319 throw(uno::RuntimeException
);
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
);
331 virtual void SAL_CALL
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
);
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
);
357 virtual void SAL_CALL
359 throw(css::lang::WrappedTargetException
, uno::RuntimeException
);
361 virtual sal_Bool SAL_CALL
363 throw(uno::RuntimeException
);
365 virtual uno::Sequence
< css::util::ElementChange
> SAL_CALL
367 throw(uno::RuntimeException
);
370 virtual css::lang::Locale SAL_CALL
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
);
379 virtual configapi::UpdateRootElement
& getElementClass() = 0;
380 virtual configapi::NodeAccess
& getNodeAccess() = 0;
382 //-----------------------------------------------------------------------------
384 #endif // CONFIGMGR_API_ELEMENTACCESS_HXX_