LibreOffice Module unotools (master) 1
Public Types | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | List of all members
SvtSysLocaleOptions Class Referencefinal

#include <syslocaleoptions.hxx>

Inheritance diagram for SvtSysLocaleOptions:
[legend]
Collaboration diagram for SvtSysLocaleOptions:
[legend]

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 LanguageTagGetRealLanguageTag () 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 LanguageTagGetRealUILanguageTag () 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 ()
 
ConfigurationBroadcasteroperator= (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_ImplpImpl
 

Additional Inherited Members

- Protected Member Functions inherited from utl::detail::Options
virtual void ConfigurationChanged (::utl::ConfigurationBroadcaster *p, ConfigurationHints nHint) override
 

Detailed Description

Definition at line 34 of file syslocaleoptions.hxx.

Member Enumeration Documentation

◆ EOption

enum class SvtSysLocaleOptions::EOption
strong
Enumerator
Locale 
Currency 
DatePatterns 

Definition at line 42 of file syslocaleoptions.hxx.

Constructor & Destructor Documentation

◆ SvtSysLocaleOptions()

SvtSysLocaleOptions::SvtSysLocaleOptions ( )

◆ ~SvtSysLocaleOptions()

SvtSysLocaleOptions::~SvtSysLocaleOptions ( )
overridevirtual

Definition at line 549 of file syslocaleoptions.cxx.

References pImpl.

Member Function Documentation

◆ BlockBroadcasts()

void SvtSysLocaleOptions::BlockBroadcasts ( bool  bBlock)
overridevirtual

Add a listener to react on config changes which are broadcasted in a SfxSimpleHint.

Returns
<TRUE> if added <FALSE> if not added Block broadcasts and accumulate hints. This may be useful if, for example, the locale and currency are changed and the currency was empty before, since changing the locale with an empty currency does also broadcast a change hint for the currency which would result in two currency changes broadcasted.
Parameters
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.

◆ Commit()

void SvtSysLocaleOptions::Commit ( )

Definition at line 562 of file syslocaleoptions.cxx.

References pImpl.

◆ ConfigurationChanged()

void SvtSysLocaleOptions::ConfigurationChanged ( utl::ConfigurationBroadcaster p,
ConfigurationHints  nHint 
)
overrideprivatevirtual

◆ CreateCurrencyConfigString()

OUString SvtSysLocaleOptions::CreateCurrencyConfigString ( const OUString &  rAbbrev,
LanguageType  eLang 
)
static

Create an USD-en-US or EUR-de-DE string.

Definition at line 654 of file syslocaleoptions.cxx.

References LanguageTag::convertToBcp47().

◆ GetCurrencyAbbrevAndLanguage() [1/2]

void SvtSysLocaleOptions::GetCurrencyAbbrevAndLanguage ( OUString &  rAbbrev,
LanguageType eLang 
) const
inline

Definition at line 129 of file syslocaleoptions.hxx.

◆ GetCurrencyAbbrevAndLanguage() [2/2]

void SvtSysLocaleOptions::GetCurrencyAbbrevAndLanguage ( OUString &  rAbbrev,
LanguageType eLang,
const OUString &  rConfigString 
)
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.

◆ GetCurrencyChangeLink()

const Link< LinkParamNone *, void > & SvtSysLocaleOptions::GetCurrencyChangeLink ( )
static

Definition at line 675 of file syslocaleoptions.cxx.

Referenced by ConfigurationChanged().

◆ GetCurrencyConfigString()

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.

◆ GetDatePatternsConfigString()

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().

◆ GetLanguageTag()

LanguageTag SvtSysLocaleOptions::GetLanguageTag ( ) const

Get locale set, not resolved to the real locale.

Definition at line 692 of file syslocaleoptions.cxx.

References pImpl.

◆ GetRealLanguageTag()

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().

◆ GetRealUILanguageTag()

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.

◆ IsDecimalSeparatorAsLocale()

bool SvtSysLocaleOptions::IsDecimalSeparatorAsLocale ( ) const

Definition at line 606 of file syslocaleoptions.cxx.

References pImpl.

◆ IsIgnoreLanguageChange()

bool SvtSysLocaleOptions::IsIgnoreLanguageChange ( ) const

Definition at line 617 of file syslocaleoptions.cxx.

References pImpl.

◆ IsModified()

bool SvtSysLocaleOptions::IsModified ( ) const

Definition at line 556 of file syslocaleoptions.cxx.

References pImpl.

◆ IsReadOnly()

bool SvtSysLocaleOptions::IsReadOnly ( EOption  eOption) const

return the readonly state of the queried option.

Definition at line 628 of file syslocaleoptions.cxx.

References pImpl.

◆ SetCurrencyChangeLink()

void SvtSysLocaleOptions::SetCurrencyChangeLink ( const Link< LinkParamNone *, void > &  rLink)
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.

◆ SetCurrencyConfigString()

void SvtSysLocaleOptions::SetCurrencyConfigString ( const OUString &  rStr)

Definition at line 590 of file syslocaleoptions.cxx.

References pImpl.

◆ SetDatePatternsConfigString()

void SvtSysLocaleOptions::SetDatePatternsConfigString ( const OUString &  rStr)

Definition at line 601 of file syslocaleoptions.cxx.

References pImpl.

◆ SetDecimalSeparatorAsLocale()

void SvtSysLocaleOptions::SetDecimalSeparatorAsLocale ( bool  bSet)

Definition at line 612 of file syslocaleoptions.cxx.

References pImpl.

◆ SetIgnoreLanguageChange()

void SvtSysLocaleOptions::SetIgnoreLanguageChange ( bool  bSet)

Definition at line 623 of file syslocaleoptions.cxx.

References pImpl.

◆ SetLocaleConfigString()

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.

◆ SetUILocaleConfigString()

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.

Member Data Documentation

◆ pImpl

std::shared_ptr<SvtSysLocaleOptions_Impl> SvtSysLocaleOptions::pImpl
private

The documentation for this class was generated from the following files: