merge the formfield patch from ooo-build
[ooovba.git] / shell / source / backends / kdebe / kdebackend.hxx
blob5305c4414ab788e588f065ca63f08c0729e0a024
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: kdebackend.hxx,v $
10 * $Revision: 1.4 $
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 KDEBACKEND_HXX_
32 #define KDEBACKEND_HXX_
34 #ifndef _COM_SUN_STAR_CONFIGURATION_BACKEND_XSCHEMASUPPLIER_HPP_
35 #include <com/sun/star/configuration/backend/XSingleLayerStratum.hpp>
36 #endif
37 #include <com/sun/star/lang/XInitialization.hpp>
38 #include <com/sun/star/uno/XComponentContext.hpp>
39 #include <com/sun/star/lang/XServiceInfo.hpp>
40 #include <com/sun/star/configuration/InvalidBootstrapFileException.hpp>
41 #include <com/sun/star/configuration/backend/CannotConnectException.hpp>
42 #include <cppuhelper/compbase2.hxx>
44 #ifndef INCLUDED_MAP
45 #include <map>
46 #define INCLUDED_MAP
47 #endif
49 namespace css = com::sun::star ;
50 namespace uno = css::uno ;
51 namespace lang = css::lang ;
52 namespace backend = css::configuration::backend ;
55 //------------------------------------------------------------------------------
56 typedef cppu::WeakComponentImplHelper2<backend::XSingleLayerStratum,
57 lang::XServiceInfo> BackendBase ;
59 /**
60 Implements the SingleLayerStratum service for KDE access.
62 class KDEBackend : public BackendBase {
63 public :
65 static KDEBackend* createInstance(const uno::Reference<uno::XComponentContext>& xContext);
67 // XServiceInfo
68 virtual rtl::OUString SAL_CALL getImplementationName( )
69 throw (uno::RuntimeException) ;
71 virtual sal_Bool SAL_CALL supportsService( const rtl::OUString& aServiceName )
72 throw (uno::RuntimeException) ;
74 virtual uno::Sequence<rtl::OUString> SAL_CALL getSupportedServiceNames( )
75 throw (uno::RuntimeException) ;
77 /**
78 Provides the implementation name.
80 @return implementation name
82 static rtl::OUString SAL_CALL getBackendName(void) ;
84 /**
85 Provides the supported services names
87 @return service names
89 static uno::Sequence<rtl::OUString> SAL_CALL getBackendServiceNames(void) ;
91 //XSingleLayerStratum
92 virtual uno::Reference<backend::XLayer> SAL_CALL
93 getLayer( const rtl::OUString& aLayerId, const rtl::OUString& aTimestamp )
94 throw (backend::BackendAccessException, lang::IllegalArgumentException) ;
96 virtual uno::Reference<backend::XUpdatableLayer> SAL_CALL
97 getUpdatableLayer( const rtl::OUString& aLayerId )
98 throw (backend::BackendAccessException, lang::NoSupportException,
99 lang::IllegalArgumentException) ;
101 protected:
103 Service constructor from a service factory.
105 @param xContext component context
107 KDEBackend(const uno::Reference<uno::XComponentContext>& xContext)
108 throw (backend::BackendAccessException);
110 /** Destructor */
111 ~KDEBackend(void) ;
113 private:
115 /** Build KDE/OO mapping table */
116 void initializeMappingTable ();
119 /** The component context */
120 uno::Reference<uno::XComponentContext> m_xContext;
122 /** Mutex for reOOurces protection */
123 osl::Mutex mMutex ;
125 static KDEBackend* mInstance;
128 #endif // CONFIGMGR_LOCALBE_LOCALSINGLESTRATUM_HXX_