1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3  * This file is part of the LibreOffice project.
4  *
5  * This Source Code Form is subject to the terms of the Mozilla Public
6  * License, v. 2.0. If a copy of the MPL was not distributed with this
7  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8  *
9  * This file incorporates work covered by the following license notice:
10  *
11  *   Licensed to the Apache Software Foundation (ASF) under one or more
12  *   contributor license agreements. See the NOTICE file distributed
13  *   with this work for additional information regarding copyright
14  *   ownership. The ASF licenses this file to you under the Apache
15  *   License, Version 2.0 (the "License"); you may not use this file
16  *   except in compliance with the License. You may obtain a copy of
17  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
18  */
19 
20 #ifndef INCLUDED_SHELL_SOURCE_BACKENDS_LOCALEBE_LOCALEBACKEND_HXX
21 #define INCLUDED_SHELL_SOURCE_BACKENDS_LOCALEBE_LOCALEBACKEND_HXX
22 
23 #include <sal/config.h>
24 
25 #include <com/sun/star/beans/Optional.hpp>
26 #include <com/sun/star/beans/XPropertySet.hpp>
27 #include <com/sun/star/lang/XServiceInfo.hpp>
28 #include <cppuhelper/implbase.hxx>
29 #include <rtl/string.hxx>
30 
31 
32 namespace uno = css::uno ;
33 namespace lang = css::lang ;
34 
35 class LocaleBackend final : public ::cppu::WeakImplHelper <
36         css::beans::XPropertySet,
37         lang::XServiceInfo >
38 {
39 
40     public:
41 
42         static LocaleBackend* createInstance();
43 
44         // XServiceInfo
45         virtual OUString SAL_CALL
46             getImplementationName(  ) override ;
47 
48         virtual sal_Bool SAL_CALL
49             supportsService( const OUString& aServiceName ) override ;
50 
51         virtual uno::Sequence<OUString> SAL_CALL
52             getSupportedServiceNames(  ) override ;
53 
54         /**
55           Provides the implementation name.
56 
57           @return   implementation name
58           */
59         static OUString getBackendName() ;
60         /**
61           Provides the supported services names
62 
63           @return   service names
64           */
65         static uno::Sequence<OUString> getBackendServiceNames() ;
66 
67         // XPropertySet
68         virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL
getPropertySetInfo()69         getPropertySetInfo() override
70         { return css::uno::Reference< css::beans::XPropertySetInfo >(); }
71 
72         virtual void SAL_CALL setPropertyValue(
73             OUString const &, css::uno::Any const &) override;
74 
75         virtual css::uno::Any SAL_CALL getPropertyValue(
76             OUString const & PropertyName) override;
77 
addPropertyChangeListener(OUString const &,css::uno::Reference<css::beans::XPropertyChangeListener> const &)78         virtual void SAL_CALL addPropertyChangeListener(
79             OUString const &,
80             css::uno::Reference< css::beans::XPropertyChangeListener > const &) override
81         {}
82 
removePropertyChangeListener(OUString const &,css::uno::Reference<css::beans::XPropertyChangeListener> const &)83         virtual void SAL_CALL removePropertyChangeListener(
84             OUString const &,
85             css::uno::Reference< css::beans::XPropertyChangeListener > const &) override
86         {}
87 
addVetoableChangeListener(OUString const &,css::uno::Reference<css::beans::XVetoableChangeListener> const &)88         virtual void SAL_CALL addVetoableChangeListener(
89             OUString const &,
90             css::uno::Reference< css::beans::XVetoableChangeListener > const &) override
91         {}
92 
removeVetoableChangeListener(OUString const &,css::uno::Reference<css::beans::XVetoableChangeListener> const &)93         virtual void SAL_CALL removeVetoableChangeListener(
94             OUString const &,
95             css::uno::Reference< css::beans::XVetoableChangeListener > const &) override
96         {}
97 
98     private:
99         /**
100           Service constructor from a service factory.
101 
102           @param xContext   component context
103           */
104         LocaleBackend();
105 
106         /** Destructor */
107         virtual ~LocaleBackend() override ;
108 
109         // Returns the user locale
110         static css::beans::Optional<css::uno::Any> getLocale();
111 
112         // Returns the user UI locale
113         static css::beans::Optional<css::uno::Any> getUILocale();
114 
115         // Returns the system default locale
116         static css::beans::Optional<css::uno::Any> getSystemLocale();
117 } ;
118 
119 
120 #endif // INCLUDED_SHELL_SOURCE_BACKENDS_LOCALEBE_LOCALEBACKEND_HXX
121 
122 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
123