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