Version 6.1.0.2, tag libreoffice-6.1.0.2
[LibreOffice.git] / shell / source / backends / localebe / localebackend.hxx
blob006d669db0ee8c3c0358cfb1b55744fb43167478
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
20 #ifndef INCLUDED_SHELL_SOURCE_BACKENDS_LOCALEBE_LOCALEBACKEND_HXX
21 #define INCLUDED_SHELL_SOURCE_BACKENDS_LOCALEBE_LOCALEBACKEND_HXX
23 #include <sal/config.h>
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>
32 namespace uno = css::uno ;
33 namespace lang = css::lang ;
35 class LocaleBackend final : public ::cppu::WeakImplHelper <
36 css::beans::XPropertySet,
37 lang::XServiceInfo >
40 public:
42 static LocaleBackend* createInstance();
44 // XServiceInfo
45 virtual OUString SAL_CALL
46 getImplementationName( ) override ;
48 virtual sal_Bool SAL_CALL
49 supportsService( const OUString& aServiceName ) override ;
51 virtual uno::Sequence<OUString> SAL_CALL
52 getSupportedServiceNames( ) override ;
54 /**
55 Provides the implementation name.
57 @return implementation name
59 static OUString getBackendName() ;
60 /**
61 Provides the supported services names
63 @return service names
65 static uno::Sequence<OUString> getBackendServiceNames() ;
67 // XPropertySet
68 virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL
69 getPropertySetInfo() override
70 { return css::uno::Reference< css::beans::XPropertySetInfo >(); }
72 virtual void SAL_CALL setPropertyValue(
73 OUString const &, css::uno::Any const &) override;
75 virtual css::uno::Any SAL_CALL getPropertyValue(
76 OUString const & PropertyName) override;
78 virtual void SAL_CALL addPropertyChangeListener(
79 OUString const &,
80 css::uno::Reference< css::beans::XPropertyChangeListener > const &) override
83 virtual void SAL_CALL removePropertyChangeListener(
84 OUString const &,
85 css::uno::Reference< css::beans::XPropertyChangeListener > const &) override
88 virtual void SAL_CALL addVetoableChangeListener(
89 OUString const &,
90 css::uno::Reference< css::beans::XVetoableChangeListener > const &) override
93 virtual void SAL_CALL removeVetoableChangeListener(
94 OUString const &,
95 css::uno::Reference< css::beans::XVetoableChangeListener > const &) override
98 private:
99 /**
100 Service constructor from a service factory.
102 @param xContext component context
104 LocaleBackend();
106 /** Destructor */
107 virtual ~LocaleBackend() override ;
109 // Returns the user locale
110 static css::beans::Optional<css::uno::Any> getLocale();
112 // Returns the user UI locale
113 static css::beans::Optional<css::uno::Any> getUILocale();
115 // Returns the system default locale
116 static css::beans::Optional<css::uno::Any> getSystemLocale();
120 #endif // INCLUDED_SHELL_SOURCE_BACKENDS_LOCALEBE_LOCALEBACKEND_HXX
122 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */