LibreOffice Module unotools (master) 1
syslocaleoptions.hxx
Go to the documentation of this file.
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_UNOTOOLS_SYSLOCALEOPTIONS_HXX
21#define INCLUDED_UNOTOOLS_SYSLOCALEOPTIONS_HXX
22
24#include <sal/types.h>
25#include <rtl/ustring.hxx>
26#include <i18nlangtag/lang.h>
28#include <unotools/options.hxx>
29
31class LinkParamNone;
32template <typename Arg, typename Ret> class Link;
33
35{
36 std::shared_ptr<SvtSysLocaleOptions_Impl> pImpl;
37
39
40public:
41
42 enum class EOption
43 {
44 Locale,
47 };
49 virtual ~SvtSysLocaleOptions() override;
50
51 // ConfigItem methods
52
53 bool IsModified() const;
54 void Commit();
55
81 virtual void BlockBroadcasts( bool bBlock ) override;
82
83 // config value access methods
84
86 void SetLocaleConfigString( const OUString& rStr );
88 LanguageTag GetLanguageTag() const;
90 const LanguageTag& GetRealLanguageTag() const;
91
93 void SetUILocaleConfigString( const OUString& rStr );
95 const LanguageTag& GetRealUILanguageTag() const;
96
98 const OUString& GetCurrencyConfigString() const;
99 void SetCurrencyConfigString( const OUString& rStr );
100
103 const OUString& GetDatePatternsConfigString() const;
104 void SetDatePatternsConfigString( const OUString& rStr );
105
106 // determine whether the decimal separator defined in the keyboard layout is used
107 // or the one appropriate to the locale
108 bool IsDecimalSeparatorAsLocale() const;
109 void SetDecimalSeparatorAsLocale( bool bSet);
110
111 // determine whether to ignore changes to the system keyboard/locale/language when
112 // determining the language for newly entered text
113 bool IsIgnoreLanguageChange() const;
114 void SetIgnoreLanguageChange( bool bSet);
115
116 // convenience methods
117
119 static void GetCurrencyAbbrevAndLanguage(
120 OUString& rAbbrev,
121 LanguageType& eLang,
122 const OUString& rConfigString );
123
125 static OUString CreateCurrencyConfigString(
126 const OUString& rAbbrev,
127 LanguageType eLang );
128
130 OUString& rAbbrev,
131 LanguageType& eLang ) const
132 {
133 GetCurrencyAbbrevAndLanguage( rAbbrev,
134 eLang, GetCurrencyConfigString() );
135 }
136
143 static void SetCurrencyChangeLink( const Link<LinkParamNone*,void>& rLink );
144 static const Link<LinkParamNone*,void>& GetCurrencyChangeLink();
145
147 bool IsReadOnly( EOption eOption ) const;
148};
149
150#endif // INCLUDED_UNOTOOLS_SYSLOCALEOPTIONS_HXX
151
152/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
std::shared_ptr< SvtSysLocaleOptions_Impl > pImpl
void GetCurrencyAbbrevAndLanguage(OUString &rAbbrev, LanguageType &eLang) const
virtual void BlockBroadcasts(bool bBlock)
Definition: options.cxx:90
virtual void ConfigurationChanged(::utl::ConfigurationBroadcaster *p, ConfigurationHints nHint) override
Definition: options.cxx:109
bool IsReadOnly(EOption eOption)
ConfigurationHints
Definition: options.hxx:30
#define SAL_WARN_UNUSED
#define UNOTOOLS_DLLPUBLIC