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: singlebackendadapter.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_BACKEND_SINGLEBACKENDADAPTER_HXX_
32 #define CONFIGMGR_BACKEND_SINGLEBACKENDADAPTER_HXX_
34 #include <com/sun/star/configuration/backend/XBackend.hpp>
35 #include <com/sun/star/configuration/backend/XBackendEntities.hpp>
36 #include <com/sun/star/configuration/backend/XSchemaSupplier.hpp>
37 #include <com/sun/star/uno/XComponentContext.hpp>
38 #include <com/sun/star/lang/XInitialization.hpp>
39 #include <com/sun/star/lang/XServiceInfo.hpp>
40 #include <cppuhelper/compbase5.hxx>
42 namespace configmgr
{ namespace backend
{
44 namespace css
= com::sun::star
;
45 namespace uno
= css::uno
;
46 namespace lang
= css::lang
;
47 namespace backenduno
= css::configuration::backend
;
50 Class implementing the Backend service for remote access.
51 It just transfers calls to a SingleBackend implementation.
53 class SingleBackendAdapter
: public cppu::WeakComponentImplHelper5
< backenduno::XBackend
, backenduno::XBackendEntities
, backenduno::XSchemaSupplier
, lang::XInitialization
, lang::XServiceInfo
> {
56 Service constructor from a service factory.
58 @param aFactory service factory
61 const uno::Reference
<uno::XComponentContext
>& xContext
) ;
63 ~SingleBackendAdapter(void) ;
66 virtual void SAL_CALL
initialize(
67 const uno::Sequence
<uno::Any
>& aParameters
)
68 throw (uno::RuntimeException
, uno::Exception
) ;
71 virtual uno::Reference
<backenduno::XSchema
>
72 SAL_CALL
getComponentSchema(const rtl::OUString
& aComponent
)
73 throw (backenduno::BackendAccessException
,
74 lang::IllegalArgumentException
,
75 uno::RuntimeException
) ;
78 virtual uno::Sequence
<uno::Reference
<backenduno::XLayer
> >
79 SAL_CALL
listOwnLayers(const rtl::OUString
& aComponent
)
80 throw (backenduno::BackendAccessException
,
81 lang::IllegalArgumentException
,
82 uno::RuntimeException
) ;
84 virtual uno::Reference
<backenduno::XUpdateHandler
>
85 SAL_CALL
getOwnUpdateHandler(const rtl::OUString
& aComponent
)
86 throw (backenduno::BackendAccessException
,
87 lang::IllegalArgumentException
,
88 lang::NoSupportException
,
89 uno::RuntimeException
) ;
90 virtual uno::Sequence
<uno::Reference
<backenduno::XLayer
> > SAL_CALL
91 listLayers(const rtl::OUString
& aComponent
,
92 const rtl::OUString
& aEntity
)
93 throw (backenduno::BackendAccessException
,
94 lang::IllegalArgumentException
,
95 uno::RuntimeException
) ;
96 virtual uno::Reference
<backenduno::XUpdateHandler
> SAL_CALL
97 getUpdateHandler(const rtl::OUString
& aComponent
,
98 const rtl::OUString
& aEntity
)
99 throw (backenduno::BackendAccessException
,
100 lang::IllegalArgumentException
,
101 lang::NoSupportException
,
102 uno::RuntimeException
) ;
105 virtual rtl::OUString SAL_CALL
107 throw (uno::RuntimeException
);
109 virtual rtl::OUString SAL_CALL
111 throw (uno::RuntimeException
);
113 virtual sal_Bool SAL_CALL
114 supportsEntity( const rtl::OUString
& aEntity
)
115 throw (backenduno::BackendAccessException
, uno::RuntimeException
);
117 virtual sal_Bool SAL_CALL
118 isEqualEntity( const rtl::OUString
& aEntity
, const rtl::OUString
& aOtherEntity
)
119 throw ( backenduno::BackendAccessException
,
120 lang::IllegalArgumentException
,
121 uno::RuntimeException
);
124 virtual rtl::OUString SAL_CALL
getImplementationName(void)
125 throw (uno::RuntimeException
) ;
126 virtual sal_Bool SAL_CALL
supportsService(
127 const rtl::OUString
& aServiceName
)
128 throw (uno::RuntimeException
) ;
129 virtual uno::Sequence
<rtl::OUString
> SAL_CALL
130 getSupportedServiceNames(void) throw (uno::RuntimeException
) ;
133 /** Service factory */
134 uno::Reference
<lang::XMultiServiceFactory
> mFactory
;
135 /** Mutex for resource protection */
137 /** Remote backend that the offline cache is handling */
138 uno::Reference
<backenduno::XSchemaSupplier
> mBackend
;
139 /* checks if object is in initialized and undisposed state */
143 } } // configmgr.backend
145 #endif // CONFIGMGR_BACKEND_SINGLEBACKENDADAPTER_HXX_