LibreOffice Module unotools (master) 1
|
#include <syslocaleoptions.hxx>
Public Types | |
enum class | EOption { Locale , Currency , DatePatterns } |
Public Member Functions | |
SvtSysLocaleOptions () | |
virtual | ~SvtSysLocaleOptions () override |
bool | IsModified () const |
void | Commit () |
virtual void | BlockBroadcasts (bool bBlock) override |
Add a listener to react on config changes which are broadcasted in a SfxSimpleHint. More... | |
void | SetLocaleConfigString (const OUString &rStr) |
The config string may be empty to denote the SYSTEM locale. More... | |
LanguageTag | GetLanguageTag () const |
Get locale set, not resolved to the real locale. More... | |
const LanguageTag & | GetRealLanguageTag () const |
Get locale set, always resolved to the real locale. More... | |
void | SetUILocaleConfigString (const OUString &rStr) |
The config string may be empty to denote the SYSTEM locale. More... | |
const LanguageTag & | GetRealUILanguageTag () const |
Get UI locale set, always resolved to the real locale. More... | |
const OUString & | GetCurrencyConfigString () const |
The config string may be empty to denote the default currency of the locale. More... | |
void | SetCurrencyConfigString (const OUString &rStr) |
const OUString & | GetDatePatternsConfigString () const |
The config string may be empty to denote the default DateAcceptancePatterns of the locale. More... | |
void | SetDatePatternsConfigString (const OUString &rStr) |
bool | IsDecimalSeparatorAsLocale () const |
void | SetDecimalSeparatorAsLocale (bool bSet) |
bool | IsIgnoreLanguageChange () const |
void | SetIgnoreLanguageChange (bool bSet) |
void | GetCurrencyAbbrevAndLanguage (OUString &rAbbrev, LanguageType &eLang) const |
bool | IsReadOnly (EOption eOption) const |
return the readonly state of the queried option. More... | |
Public Member Functions inherited from utl::detail::Options | |
Options () | |
virtual | ~Options () override=0 |
Public Member Functions inherited from utl::ConfigurationBroadcaster | |
void | AddListener (utl::ConfigurationListener *pListener) |
void | RemoveListener (utl::ConfigurationListener const *pListener) |
void | NotifyListeners (ConfigurationHints nHint) |
ConfigurationBroadcaster () | |
ConfigurationBroadcaster (ConfigurationBroadcaster const &) | |
virtual | ~ConfigurationBroadcaster () |
ConfigurationBroadcaster & | operator= (ConfigurationBroadcaster const &other) |
virtual void | BlockBroadcasts (bool bBlock) |
Public Member Functions inherited from utl::ConfigurationListener | |
virtual | ~ConfigurationListener () |
virtual void | ConfigurationChanged (ConfigurationBroadcaster *p, ConfigurationHints nHint)=0 |
Static Public Member Functions | |
static void | GetCurrencyAbbrevAndLanguage (OUString &rAbbrev, LanguageType &eLang, const OUString &rConfigString) |
Get currency abbreviation and locale from an USD-en-US or EUR-de-DE string. More... | |
static OUString | CreateCurrencyConfigString (const OUString &rAbbrev, LanguageType eLang) |
Create an USD-en-US or EUR-de-DE string. More... | |
static void | SetCurrencyChangeLink (const Link< LinkParamNone *, void > &rLink) |
Set a link to a method to be called whenever the default currency changes. More... | |
static const Link< LinkParamNone *, void > & | GetCurrencyChangeLink () |
Private Member Functions | |
virtual void | ConfigurationChanged (utl::ConfigurationBroadcaster *p, ConfigurationHints nHint) override |
Private Attributes | |
std::shared_ptr< SvtSysLocaleOptions_Impl > | pImpl |
Additional Inherited Members | |
Protected Member Functions inherited from utl::detail::Options | |
virtual void | ConfigurationChanged (::utl::ConfigurationBroadcaster *p, ConfigurationHints nHint) override |
Definition at line 34 of file syslocaleoptions.hxx.
|
strong |
Enumerator | |
---|---|
Locale | |
Currency | |
DatePatterns |
Definition at line 42 of file syslocaleoptions.hxx.
SvtSysLocaleOptions::SvtSysLocaleOptions | ( | ) |
Definition at line 535 of file syslocaleoptions.cxx.
References ItemHolder1::holdConfigItem(), utl::ConfigManager::IsFuzzing(), pImpl, and SysLocaleOptions.
|
overridevirtual |
Definition at line 549 of file syslocaleoptions.cxx.
References pImpl.
|
overridevirtual |
Add a listener to react on config changes which are broadcasted in a SfxSimpleHint.
bBlock | <TRUE>: broadcasts are blocked until reversed. <FALSE>: broadcasts are not blocked anymore. Pending hints are broadcasted if no other instance blocks the broadcast. |
@ATTENTION All SvtSysLocaleOptions instances point to exactly one refcounted internal representation instance and broadcast blocks are counted. Thus if you issue a BlockBroadcasts(true) you MUST issue a matching BlockBroadcasts(false) or otherwise pending hints would never be broadcasted again.
Reimplemented from utl::ConfigurationBroadcaster.
Definition at line 568 of file syslocaleoptions.cxx.
References pImpl.
void SvtSysLocaleOptions::Commit | ( | ) |
Definition at line 562 of file syslocaleoptions.cxx.
References pImpl.
|
overrideprivatevirtual |
Implements utl::ConfigurationListener.
Definition at line 681 of file syslocaleoptions.cxx.
References Link< typename Arg, typename Ret >::Call(), utl::detail::Options::ConfigurationChanged(), Currency, GetCurrencyChangeLink(), and p.
|
static |
Create an USD-en-US or EUR-de-DE string.
Definition at line 654 of file syslocaleoptions.cxx.
References LanguageTag::convertToBcp47().
|
inline |
Definition at line 129 of file syslocaleoptions.hxx.
|
static |
Get currency abbreviation and locale from an USD-en-US or EUR-de-DE string.
Definition at line 635 of file syslocaleoptions.cxx.
References LanguageTag::convertToLanguageTypeWithFallback(), LANGUAGE_NONE, and LANGUAGE_SYSTEM.
|
static |
Definition at line 675 of file syslocaleoptions.cxx.
Referenced by ConfigurationChanged().
const OUString & SvtSysLocaleOptions::GetCurrencyConfigString | ( | ) | const |
The config string may be empty to denote the default currency of the locale.
Definition at line 584 of file syslocaleoptions.cxx.
References pImpl.
const OUString & SvtSysLocaleOptions::GetDatePatternsConfigString | ( | ) | const |
The config string may be empty to denote the default DateAcceptancePatterns of the locale.
Definition at line 595 of file syslocaleoptions.cxx.
References pImpl.
Referenced by SvtSysLocale_Impl::getDateAcceptancePatternsConfig().
LanguageTag SvtSysLocaleOptions::GetLanguageTag | ( | ) | const |
Get locale set, not resolved to the real locale.
Definition at line 692 of file syslocaleoptions.cxx.
References pImpl.
const LanguageTag & SvtSysLocaleOptions::GetRealLanguageTag | ( | ) | const |
Get locale set, always resolved to the real locale.
Definition at line 698 of file syslocaleoptions.cxx.
References pImpl.
Referenced by SvtSysLocale_Impl::ConfigurationChanged(), SvtSysLocale_Impl::GetCharClass(), and SvtSysLocale_Impl::SvtSysLocale_Impl().
const LanguageTag & SvtSysLocaleOptions::GetRealUILanguageTag | ( | ) | const |
Get UI locale set, always resolved to the real locale.
Definition at line 703 of file syslocaleoptions.cxx.
References pImpl.
bool SvtSysLocaleOptions::IsDecimalSeparatorAsLocale | ( | ) | const |
Definition at line 606 of file syslocaleoptions.cxx.
References pImpl.
bool SvtSysLocaleOptions::IsIgnoreLanguageChange | ( | ) | const |
Definition at line 617 of file syslocaleoptions.cxx.
References pImpl.
bool SvtSysLocaleOptions::IsModified | ( | ) | const |
Definition at line 556 of file syslocaleoptions.cxx.
References pImpl.
bool SvtSysLocaleOptions::IsReadOnly | ( | EOption | eOption | ) | const |
return the readonly state of the queried option.
Definition at line 628 of file syslocaleoptions.cxx.
References pImpl.
|
static |
Set a link to a method to be called whenever the default currency changes.
This can be only one method, and normally it is the static link method which calls SvNumberFormatter::SetDefaultSystemCurrency(). This is needed because the number formatter isn't part of the svl light library, otherwise we could call SetDefaultSystemCurrency() directly.
Definition at line 667 of file syslocaleoptions.cxx.
References DBG_ASSERT.
void SvtSysLocaleOptions::SetCurrencyConfigString | ( | const OUString & | rStr | ) |
Definition at line 590 of file syslocaleoptions.cxx.
References pImpl.
void SvtSysLocaleOptions::SetDatePatternsConfigString | ( | const OUString & | rStr | ) |
Definition at line 601 of file syslocaleoptions.cxx.
References pImpl.
void SvtSysLocaleOptions::SetDecimalSeparatorAsLocale | ( | bool | bSet | ) |
Definition at line 612 of file syslocaleoptions.cxx.
References pImpl.
void SvtSysLocaleOptions::SetIgnoreLanguageChange | ( | bool | bSet | ) |
Definition at line 623 of file syslocaleoptions.cxx.
References pImpl.
void SvtSysLocaleOptions::SetLocaleConfigString | ( | const OUString & | rStr | ) |
The config string may be empty to denote the SYSTEM locale.
Definition at line 574 of file syslocaleoptions.cxx.
References pImpl.
void SvtSysLocaleOptions::SetUILocaleConfigString | ( | const OUString & | rStr | ) |
The config string may be empty to denote the SYSTEM locale.
Definition at line 579 of file syslocaleoptions.cxx.
References pImpl.
|
private |
Definition at line 36 of file syslocaleoptions.hxx.
Referenced by BlockBroadcasts(), Commit(), GetCurrencyConfigString(), GetDatePatternsConfigString(), GetLanguageTag(), GetRealLanguageTag(), GetRealUILanguageTag(), IsDecimalSeparatorAsLocale(), IsIgnoreLanguageChange(), IsModified(), IsReadOnly(), SetCurrencyConfigString(), SetDatePatternsConfigString(), SetDecimalSeparatorAsLocale(), SetIgnoreLanguageChange(), SetLocaleConfigString(), SetUILocaleConfigString(), SvtSysLocaleOptions(), and ~SvtSysLocaleOptions().