update dev300-m58
[ooovba.git] / configmgr / source / localbe / localschemasupplier.hxx
blob2025c1c3d6401af524a5b65072322cef1dd40950
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: localschemasupplier.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_LOCALBE_LOCALSCHEMASUPPLIER_HXX_
32 #define CONFIGMGR_LOCALBE_LOCALSCHEMASUPPLIER_HXX_
34 #include <com/sun/star/configuration/backend/XVersionedSchemaSupplier.hpp>
35 #include <com/sun/star/uno/XComponentContext.hpp>
36 #include <com/sun/star/lang/XServiceInfo.hpp>
37 #include <com/sun/star/lang/XMultiServiceFactory.hpp>
38 #include <com/sun/star/lang/XInitialization.hpp>
39 #include <com/sun/star/configuration/InvalidBootstrapFileException.hpp>
40 #include <com/sun/star/configuration/backend/CannotConnectException.hpp>
41 #include <cppuhelper/compbase3.hxx>
43 namespace configmgr { namespace localbe {
45 namespace css = com::sun::star ;
46 namespace uno = css::uno ;
47 namespace lang = css::lang ;
48 namespace backend = css::configuration::backend ;
50 /**
51 Implements the SchemaSupplier service for local schema file access.
53 class LocalSchemaSupplier : public cppu::WeakComponentImplHelper3<backend::XVersionedSchemaSupplier, lang::XInitialization, lang::XServiceInfo> {
54 public :
55 /**
56 Service constructor from a service factory.
58 @param xConxtext Component Context
60 LocalSchemaSupplier(const uno::Reference<uno::XComponentContext>& xContext) ;
62 /** Destructor */
63 ~LocalSchemaSupplier(void) ;
66 // XInitialize
67 virtual void SAL_CALL
68 initialize( const uno::Sequence<uno::Any>& aParameters)
69 throw (uno::RuntimeException, uno::Exception,
70 css::configuration::InvalidBootstrapFileException,
71 backend::CannotConnectException,
72 backend::BackendSetupException);
74 // XVersionedSchemaSupplier
75 virtual rtl::OUString SAL_CALL
76 getSchemaVersion( const rtl::OUString& aComponent )
77 throw (backend::BackendAccessException,
78 lang::IllegalArgumentException,
79 uno::RuntimeException) ;
81 // XSchemaSupplier
82 virtual uno::Reference<backend::XSchema> SAL_CALL
83 getComponentSchema( const rtl::OUString& aComponent )
84 throw (backend::BackendAccessException,
85 lang::IllegalArgumentException,
86 uno::RuntimeException) ;
88 // XServiceInfo
89 virtual rtl::OUString SAL_CALL
90 getImplementationName( )
91 throw (uno::RuntimeException) ;
93 virtual sal_Bool SAL_CALL
94 supportsService( const rtl::OUString& aServiceName )
95 throw (uno::RuntimeException) ;
97 virtual uno::Sequence<rtl::OUString> SAL_CALL
98 getSupportedServiceNames( )
99 throw (uno::RuntimeException) ;
101 private :
102 /** Service factory */
103 uno::Reference<lang::XMultiServiceFactory> mFactory ;
104 /** Mutex for resources protection */
105 osl::Mutex mMutex ;
106 /**
107 Base of the schema data. Is a list to allow
108 for multiple schema directories.
110 uno::Sequence<rtl::OUString> mSchemaDataUrls ;
111 /** Version of the schema repository */
112 // TODO: Add support for repository-specific versions
113 rtl::OUString mSchemaVersion;
116 } } // configmgr.localschemasupplirt
118 #endif // CONFIGMGR_LOCALBE_LOCALSCHEMASUPPLIER_HXX_