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: kde4backend.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 ************************************************************************/
33 #include <com/sun/star/configuration/backend/XSingleLayerStratum.hpp>
34 #include <com/sun/star/lang/XInitialization.hpp>
35 #include <com/sun/star/uno/XComponentContext.hpp>
36 #include <com/sun/star/lang/XServiceInfo.hpp>
37 #include <com/sun/star/configuration/InvalidBootstrapFileException.hpp>
38 #include <com/sun/star/configuration/backend/CannotConnectException.hpp>
39 #include <cppuhelper/compbase2.hxx>
46 namespace css
= com::sun::star
;
47 namespace uno
= css::uno
;
48 namespace lang
= css::lang
;
49 namespace backend
= css::configuration::backend
;
52 //------------------------------------------------------------------------------
53 typedef cppu::WeakComponentImplHelper2
<backend::XSingleLayerStratum
,
54 lang::XServiceInfo
> BackendBase
;
57 Implements the SingleLayerStratum service for KDE access.
59 class KDEBackend
: public BackendBase
{
62 static KDEBackend
* createInstance(const uno::Reference
<uno::XComponentContext
>& xContext
);
65 virtual rtl::OUString SAL_CALL
getImplementationName( )
66 throw (uno::RuntimeException
) ;
68 virtual sal_Bool SAL_CALL
supportsService( const rtl::OUString
& aServiceName
)
69 throw (uno::RuntimeException
) ;
71 virtual uno::Sequence
<rtl::OUString
> SAL_CALL
getSupportedServiceNames( )
72 throw (uno::RuntimeException
) ;
75 Provides the implementation name.
77 @return implementation name
79 static rtl::OUString SAL_CALL
getBackendName(void) ;
82 Provides the supported services names
86 static uno::Sequence
<rtl::OUString
> SAL_CALL
getBackendServiceNames(void) ;
89 virtual uno::Reference
<backend::XLayer
> SAL_CALL
90 getLayer( const rtl::OUString
& aLayerId
, const rtl::OUString
& aTimestamp
)
91 throw (backend::BackendAccessException
, lang::IllegalArgumentException
) ;
93 virtual uno::Reference
<backend::XUpdatableLayer
> SAL_CALL
94 getUpdatableLayer( const rtl::OUString
& aLayerId
)
95 throw (backend::BackendAccessException
, lang::NoSupportException
,
96 lang::IllegalArgumentException
) ;
100 Service constructor from a service factory.
102 @param xContext component context
104 KDEBackend(const uno::Reference
<uno::XComponentContext
>& xContext
)
105 throw (backend::BackendAccessException
);
112 /** Build KDE/OO mapping table */
113 void initializeMappingTable ();
116 /** The component context */
117 uno::Reference
<uno::XComponentContext
> m_xContext
;
119 /** Mutex for reOOurces protection */
122 static KDEBackend
* mInstance
;