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: localebackend.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 _FIXEDVALUEBACKEND_HXX_
32 #define _FIXEDVALUEBACKEND_HXX_
34 #include <com/sun/star/configuration/backend/XSingleLayerStratum.hpp>
35 #include <com/sun/star/uno/XComponentContext.hpp>
36 #include <com/sun/star/lang/XServiceInfo.hpp>
37 #include <com/sun/star/configuration/backend/XBackendChangesNotifier.hpp>
38 #include <cppuhelper/implbase2.hxx>
39 #include <rtl/string.hxx>
42 namespace css
= com::sun::star
;
43 namespace uno
= css::uno
;
44 namespace lang
= css::lang
;
45 namespace backend
= css::configuration::backend
;
49 Implements the SingleLayerStratum service.
51 class LocaleBackend
: public ::cppu::WeakImplHelper2
<
52 backend::XSingleLayerStratum
,
53 lang::XServiceInfo
> {
57 static LocaleBackend
* createInstance(const uno::Reference
<uno::XComponentContext
>& xContext
);
60 virtual rtl::OUString SAL_CALL
61 getImplementationName( )
62 throw (uno::RuntimeException
) ;
64 virtual sal_Bool SAL_CALL
65 supportsService( const rtl::OUString
& aServiceName
)
66 throw (uno::RuntimeException
) ;
68 virtual uno::Sequence
<rtl::OUString
> SAL_CALL
69 getSupportedServiceNames( )
70 throw (uno::RuntimeException
) ;
73 Provides the implementation name.
75 @return implementation name
77 static rtl::OUString SAL_CALL
getBackendName(void) ;
79 Provides the supported services names
83 static uno::Sequence
<rtl::OUString
> SAL_CALL
getBackendServiceNames(void) ;
85 Provides the supported component nodes
87 @return supported component nodes
89 static uno::Sequence
<rtl::OUString
> SAL_CALL
getSupportedComponents(void) ;
92 virtual uno::Reference
<backend::XLayer
> SAL_CALL
93 getLayer( const rtl::OUString
& aLayerId
, const rtl::OUString
& aTimestamp
)
94 throw (backend::BackendAccessException
,
95 lang::IllegalArgumentException
) ;
97 virtual uno::Reference
<backend::XUpdatableLayer
> SAL_CALL
98 getUpdatableLayer( const rtl::OUString
& aLayerId
)
99 throw (backend::BackendAccessException
,
100 lang::NoSupportException
,
101 lang::IllegalArgumentException
) ;
104 Service constructor from a service factory.
106 @param xContext component context
108 LocaleBackend(const uno::Reference
<uno::XComponentContext
>& xContext
)
109 throw (backend::BackendAccessException
);
112 ~LocaleBackend(void) ;
116 uno::Reference
<uno::XComponentContext
> m_xContext
;
117 uno::Reference
<backend::XLayer
> m_xSystemLayer
;
119 // Returns a time stamp in the appropriate format
120 // for configuration layers.
121 static rtl::OUString
createTimeStamp(void);
123 // Returns the user locale
124 static rtl::OUString
getLocale(void);
126 // Returns the user UI locale
127 static rtl::OUString
getUILocale(void);
129 // Returns the system default locale
130 static rtl::OUString
getSystemLocale(void);
134 #endif // _FIXEDVALUEBACKEND_HXX_