LibreOffice Module svl (master) 1
Public Member Functions | Private Attributes | List of all members
OnDemandLocaleDataWrapper Class Reference

Switch between LANGUAGE_SYSTEM and LANGUAGE_ENGLISH_US and any other LocaleDataWrapper. More...

#include <ondemand.hxx>

Collaboration diagram for OnDemandLocaleDataWrapper:
[legend]

Public Member Functions

 OnDemandLocaleDataWrapper ()
 
bool isInitialized () const
 
void init (const css::uno::Reference< css::uno::XComponentContext > &rxContext, const LanguageTag &rLanguageTag)
 
void changeLocale (const LanguageTag &rLanguageTag)
 
LanguageType getCurrentLanguage () const
 
const LocaleDataWrapperget () const
 
const LocaleDataWrapperoperator-> () const
 
const LocaleDataWrapperoperator* () const
 

Private Attributes

css::uno::Reference< css::uno::XComponentContext > m_xContext
 
SvtSysLocale aSysLocale
 
LanguageType eCurrentLanguage
 
LanguageType eLastAnyLanguage
 
std::optional< LocaleDataWrappermoEnglish
 
std::optional< LocaleDataWrappermoAny
 
int nCurrent
 
bool bInitialized
 

Detailed Description

Switch between LANGUAGE_SYSTEM and LANGUAGE_ENGLISH_US and any other LocaleDataWrapper.

SvNumberformatter uses it upon switching locales.

@descr Avoids reloading and analysing of locale data again and again.

@ATTENTION If the default ctor is used the init() method MUST be called before accessing any locale data. The passed parameters Locale and LanguageType must match each other.

Definition at line 52 of file ondemand.hxx.

Constructor & Destructor Documentation

◆ OnDemandLocaleDataWrapper()

OnDemandLocaleDataWrapper::OnDemandLocaleDataWrapper ( )
inline

Definition at line 64 of file ondemand.hxx.

References eCurrentLanguage, LANGUAGE_DONTKNOW, and LANGUAGE_SYSTEM.

Member Function Documentation

◆ changeLocale()

void OnDemandLocaleDataWrapper::changeLocale ( const LanguageTag rLanguageTag)
inline

◆ get()

const LocaleDataWrapper * OnDemandLocaleDataWrapper::get ( ) const
inline

◆ getCurrentLanguage()

LanguageType OnDemandLocaleDataWrapper::getCurrentLanguage ( ) const
inline

Definition at line 110 of file ondemand.hxx.

References eCurrentLanguage.

Referenced by SvNumberFormatter::GetLangDecimalSep().

◆ init()

void OnDemandLocaleDataWrapper::init ( const css::uno::Reference< css::uno::XComponentContext > &  rxContext,
const LanguageTag rLanguageTag 
)
inline

Definition at line 74 of file ondemand.hxx.

References bInitialized, changeLocale(), and m_xContext.

Referenced by SvNumberFormatter::ImpConstruct().

◆ isInitialized()

bool OnDemandLocaleDataWrapper::isInitialized ( ) const
inline

Definition at line 72 of file ondemand.hxx.

References bInitialized.

◆ operator*()

const LocaleDataWrapper & OnDemandLocaleDataWrapper::operator* ( ) const
inline

Definition at line 128 of file ondemand.hxx.

References get().

◆ operator->()

const LocaleDataWrapper * OnDemandLocaleDataWrapper::operator-> ( ) const
inline

Definition at line 127 of file ondemand.hxx.

References get().

Member Data Documentation

◆ aSysLocale

SvtSysLocale OnDemandLocaleDataWrapper::aSysLocale
private

Definition at line 55 of file ondemand.hxx.

Referenced by get().

◆ bInitialized

bool OnDemandLocaleDataWrapper::bInitialized
private

Definition at line 61 of file ondemand.hxx.

Referenced by init(), and isInitialized().

◆ eCurrentLanguage

LanguageType OnDemandLocaleDataWrapper::eCurrentLanguage
private

Definition at line 56 of file ondemand.hxx.

Referenced by changeLocale(), getCurrentLanguage(), and OnDemandLocaleDataWrapper().

◆ eLastAnyLanguage

LanguageType OnDemandLocaleDataWrapper::eLastAnyLanguage
private

Definition at line 57 of file ondemand.hxx.

Referenced by changeLocale().

◆ m_xContext

css::uno::Reference<css::uno::XComponentContext> OnDemandLocaleDataWrapper::m_xContext
private

Definition at line 54 of file ondemand.hxx.

Referenced by changeLocale(), and init().

◆ moAny

std::optional<LocaleDataWrapper> OnDemandLocaleDataWrapper::moAny
private

Definition at line 59 of file ondemand.hxx.

Referenced by changeLocale(), and get().

◆ moEnglish

std::optional<LocaleDataWrapper> OnDemandLocaleDataWrapper::moEnglish
private

Definition at line 58 of file ondemand.hxx.

Referenced by changeLocale(), and get().

◆ nCurrent

int OnDemandLocaleDataWrapper::nCurrent
private

Definition at line 60 of file ondemand.hxx.

Referenced by changeLocale(), and get().


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