1*ed2f6d3bSAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3*ed2f6d3bSAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*ed2f6d3bSAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*ed2f6d3bSAndrew Rist  * distributed with this work for additional information
6*ed2f6d3bSAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*ed2f6d3bSAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*ed2f6d3bSAndrew Rist  * "License"); you may not use this file except in compliance
9*ed2f6d3bSAndrew Rist  * with the License.  You may obtain a copy of the License at
10*ed2f6d3bSAndrew Rist  *
11*ed2f6d3bSAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12*ed2f6d3bSAndrew Rist  *
13*ed2f6d3bSAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*ed2f6d3bSAndrew Rist  * software distributed under the License is distributed on an
15*ed2f6d3bSAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*ed2f6d3bSAndrew Rist  * KIND, either express or implied.  See the License for the
17*ed2f6d3bSAndrew Rist  * specific language governing permissions and limitations
18*ed2f6d3bSAndrew Rist  * under the License.
19*ed2f6d3bSAndrew Rist  *
20*ed2f6d3bSAndrew Rist  *************************************************************/
21*ed2f6d3bSAndrew Rist 
22*ed2f6d3bSAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir #ifndef _FIXEDVALUEBACKEND_HXX_
25cdf0e10cSrcweir #define _FIXEDVALUEBACKEND_HXX_
26cdf0e10cSrcweir 
27cdf0e10cSrcweir #include <com/sun/star/beans/XPropertySet.hpp>
28cdf0e10cSrcweir #include <com/sun/star/lang/XServiceInfo.hpp>
29cdf0e10cSrcweir #include <cppuhelper/implbase2.hxx>
30cdf0e10cSrcweir #include <rtl/string.hxx>
31cdf0e10cSrcweir 
32cdf0e10cSrcweir 
33cdf0e10cSrcweir namespace css = com::sun::star ;
34cdf0e10cSrcweir namespace uno = css::uno ;
35cdf0e10cSrcweir namespace lang = css::lang ;
36cdf0e10cSrcweir 
37cdf0e10cSrcweir class LocaleBackend : public ::cppu::WeakImplHelper2 <
38cdf0e10cSrcweir         css::beans::XPropertySet,
39cdf0e10cSrcweir         lang::XServiceInfo > {
40cdf0e10cSrcweir 
41cdf0e10cSrcweir     public :
42cdf0e10cSrcweir 
43cdf0e10cSrcweir         static LocaleBackend* createInstance();
44cdf0e10cSrcweir 
45cdf0e10cSrcweir         // XServiceInfo
46cdf0e10cSrcweir         virtual rtl::OUString SAL_CALL
47cdf0e10cSrcweir             getImplementationName(  )
48cdf0e10cSrcweir                 throw (uno::RuntimeException) ;
49cdf0e10cSrcweir 
50cdf0e10cSrcweir         virtual sal_Bool SAL_CALL
51cdf0e10cSrcweir             supportsService( const rtl::OUString& aServiceName )
52cdf0e10cSrcweir                 throw (uno::RuntimeException) ;
53cdf0e10cSrcweir 
54cdf0e10cSrcweir         virtual uno::Sequence<rtl::OUString> SAL_CALL
55cdf0e10cSrcweir             getSupportedServiceNames(  )
56cdf0e10cSrcweir                 throw (uno::RuntimeException) ;
57cdf0e10cSrcweir 
58cdf0e10cSrcweir         /**
59cdf0e10cSrcweir           Provides the implementation name.
60cdf0e10cSrcweir 
61cdf0e10cSrcweir           @return   implementation name
62cdf0e10cSrcweir           */
63cdf0e10cSrcweir         static rtl::OUString SAL_CALL getBackendName(void) ;
64cdf0e10cSrcweir         /**
65cdf0e10cSrcweir           Provides the supported services names
66cdf0e10cSrcweir 
67cdf0e10cSrcweir           @return   service names
68cdf0e10cSrcweir           */
69cdf0e10cSrcweir         static uno::Sequence<rtl::OUString> SAL_CALL getBackendServiceNames(void) ;
70cdf0e10cSrcweir 
71cdf0e10cSrcweir         // XPropertySet
72cdf0e10cSrcweir         virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL
getPropertySetInfo()73cdf0e10cSrcweir         getPropertySetInfo() throw (css::uno::RuntimeException)
74cdf0e10cSrcweir         { return css::uno::Reference< css::beans::XPropertySetInfo >(); }
75cdf0e10cSrcweir 
76cdf0e10cSrcweir         virtual void SAL_CALL setPropertyValue(
77cdf0e10cSrcweir             rtl::OUString const &, css::uno::Any const &)
78cdf0e10cSrcweir             throw (
79cdf0e10cSrcweir                 css::beans::UnknownPropertyException,
80cdf0e10cSrcweir                 css::beans::PropertyVetoException,
81cdf0e10cSrcweir                 css::lang::IllegalArgumentException,
82cdf0e10cSrcweir                 css::lang::WrappedTargetException, css::uno::RuntimeException);
83cdf0e10cSrcweir 
84cdf0e10cSrcweir         virtual css::uno::Any SAL_CALL getPropertyValue(
85cdf0e10cSrcweir             rtl::OUString const & PropertyName)
86cdf0e10cSrcweir             throw (
87cdf0e10cSrcweir                 css::beans::UnknownPropertyException,
88cdf0e10cSrcweir                 css::lang::WrappedTargetException, css::uno::RuntimeException);
89cdf0e10cSrcweir 
addPropertyChangeListener(rtl::OUString const &,css::uno::Reference<css::beans::XPropertyChangeListener> const &)90cdf0e10cSrcweir         virtual void SAL_CALL addPropertyChangeListener(
91cdf0e10cSrcweir             rtl::OUString const &,
92cdf0e10cSrcweir             css::uno::Reference< css::beans::XPropertyChangeListener > const &)
93cdf0e10cSrcweir             throw (
94cdf0e10cSrcweir                 css::beans::UnknownPropertyException,
95cdf0e10cSrcweir                 css::lang::WrappedTargetException, css::uno::RuntimeException)
96cdf0e10cSrcweir         {}
97cdf0e10cSrcweir 
removePropertyChangeListener(rtl::OUString const &,css::uno::Reference<css::beans::XPropertyChangeListener> const &)98cdf0e10cSrcweir         virtual void SAL_CALL removePropertyChangeListener(
99cdf0e10cSrcweir             rtl::OUString const &,
100cdf0e10cSrcweir             css::uno::Reference< css::beans::XPropertyChangeListener > const &)
101cdf0e10cSrcweir             throw (
102cdf0e10cSrcweir                 css::beans::UnknownPropertyException,
103cdf0e10cSrcweir                 css::lang::WrappedTargetException, css::uno::RuntimeException)
104cdf0e10cSrcweir         {}
105cdf0e10cSrcweir 
addVetoableChangeListener(rtl::OUString const &,css::uno::Reference<css::beans::XVetoableChangeListener> const &)106cdf0e10cSrcweir         virtual void SAL_CALL addVetoableChangeListener(
107cdf0e10cSrcweir             rtl::OUString const &,
108cdf0e10cSrcweir             css::uno::Reference< css::beans::XVetoableChangeListener > const &)
109cdf0e10cSrcweir             throw (
110cdf0e10cSrcweir                 css::beans::UnknownPropertyException,
111cdf0e10cSrcweir                 css::lang::WrappedTargetException, css::uno::RuntimeException)
112cdf0e10cSrcweir         {}
113cdf0e10cSrcweir 
removeVetoableChangeListener(rtl::OUString const &,css::uno::Reference<css::beans::XVetoableChangeListener> const &)114cdf0e10cSrcweir         virtual void SAL_CALL removeVetoableChangeListener(
115cdf0e10cSrcweir             rtl::OUString const &,
116cdf0e10cSrcweir             css::uno::Reference< css::beans::XVetoableChangeListener > const &)
117cdf0e10cSrcweir             throw (
118cdf0e10cSrcweir                 css::beans::UnknownPropertyException,
119cdf0e10cSrcweir                 css::lang::WrappedTargetException, css::uno::RuntimeException)
120cdf0e10cSrcweir         {}
121cdf0e10cSrcweir 
122cdf0e10cSrcweir     protected:
123cdf0e10cSrcweir         /**
124cdf0e10cSrcweir           Service constructor from a service factory.
125cdf0e10cSrcweir 
126cdf0e10cSrcweir           @param xContext   component context
127cdf0e10cSrcweir           */
128cdf0e10cSrcweir         LocaleBackend();
129cdf0e10cSrcweir 
130cdf0e10cSrcweir         /** Destructor */
131cdf0e10cSrcweir         ~LocaleBackend(void) ;
132cdf0e10cSrcweir 
133cdf0e10cSrcweir     private:
134cdf0e10cSrcweir         // Returns the user locale
135cdf0e10cSrcweir         static rtl::OUString getLocale(void);
136cdf0e10cSrcweir 
137cdf0e10cSrcweir         // Returns the user UI locale
138cdf0e10cSrcweir         static rtl::OUString getUILocale(void);
139cdf0e10cSrcweir 
140cdf0e10cSrcweir         // Returns the system default locale
141cdf0e10cSrcweir         static rtl::OUString getSystemLocale(void);
142cdf0e10cSrcweir } ;
143cdf0e10cSrcweir 
144cdf0e10cSrcweir 
145cdf0e10cSrcweir #endif // _FIXEDVALUEBACKEND_HXX_
146