LibreOffice
LibreOffice 6.4 SDK API Reference
Public Member Functions | List of all members
XLocale Interface Referencepublished

offers some operations on com::sun::star::lang::Locale structures. More...

import"XLocale.idl";

Inheritance diagram for XLocale:
XInterface

Public Member Functions

com::sun::star::lang::Locale create ([in] string aLanguage, [in] string aCountry, [in] string aVariant)
 creates a locale from language, country, and variant. More...
 
com::sun::star::lang::Locale getDefault ()
 the common method of getting the current default locale. More...
 
void setDefault ([in] com::sun::star::lang::Locale newLocale)
 sets the default locale for the whole environment. More...
 
sequence< com::sun::star::lang::LocalegetAvailableLocales ()
 
sequence< string > getISOCountries ()
 
sequence< string > getISOLanguages ()
 
sequence< string > getLanguagesForCountry ([in] string country)
 
string getISO3Language ([in] com::sun::star::lang::Locale locale) raises ( com::sun::star::resource::MissingResourceException )
 
string getISO3Country ([in] com::sun::star::lang::Locale locale) raises ( com::sun::star::resource::MissingResourceException )
 
string getDisplayLanguage_Default ([in] com::sun::star::lang::Locale locale)
 
string getDisplayLanguage ([in] com::sun::star::lang::Locale locale, [in] com::sun::star::lang::Locale inLocale)
 
string getDisplayCountry_Default ([in] com::sun::star::lang::Locale locale)
 
string getDisplayCountry ([in] com::sun::star::lang::Locale locale, [in] com::sun::star::lang::Locale inLocale)
 
string getDisplayVariant_Default ([in] com::sun::star::lang::Locale locale)
 
string getDisplayVariant ([in] com::sun::star::lang::Locale locale, [in] com::sun::star::lang::Locale inLocale)
 
string getDisplayName_Default ([in] com::sun::star::lang::Locale locale)
 
string getDisplayName ([in] com::sun::star::lang::Locale locale, [in] com::sun::star::lang::Locale inLocale)
 
boolean equals ([in] com::sun::star::lang::Locale l1, [in] com::sun::star::lang::Locale l2)
 
- Public Member Functions inherited from XInterface
any queryInterface ([in] type aType)
 queries for a new interface to an existing UNO object. More...
 
void acquire ()
 increases the reference counter by one. More...
 
void release ()
 decreases the reference counter by one. More...
 

Detailed Description

offers some operations on com::sun::star::lang::Locale structures.

See also
Locale

Member Function Documentation

◆ create()

com::sun::star::lang::Locale create ( [in] string  aLanguage,
[in] string  aCountry,
[in] string  aVariant 
)

creates a locale from language, country, and variant.

NOTE: ISO 639 is not a stable standard; some of the language codes it defines (specifically iw, ji, and in) have changed. This constructor accepts both the old codes (iw, ji, and in) and the new codes (he, yi, and id), but all other API on XLocale will return only the NEW codes.

Note: The Java class Locale returns the old codes.

◆ equals()

boolean equals ( [in] com::sun::star::lang::Locale  l1,
[in] com::sun::star::lang::Locale  l2 
)
Returns
TRUE if the com::sun::star::lang::Locale l1 is equal to the other one.

A locale is deemed equal to another locale with identical language, country, and variant, and unequal to all other objects.

◆ getAvailableLocales()

sequence<com::sun::star::lang::Locale> getAvailableLocales ( )
Returns
a sequence of all locales which are available in the system.

◆ getDefault()

the common method of getting the current default locale.

It is used for the presentation (for menus, dialogs, etc.). It is, generally, set once when your applet or application is initialized, then never reset. (If you do reset the default locale, you probably want to reload your GUI, so that the change is reflected in your interface.)

More advanced programs allow users to use different locales for different fields, for example, in a spreadsheet.


Note that the initial setting will match the host system.

◆ getDisplayCountry()

string getDisplayCountry ( [in] com::sun::star::lang::Locale  locale,
[in] com::sun::star::lang::Locale  inLocale 
)
Returns
country code for display of field to user. If the localized name is not found, returns the ISO codes.
Parameters
localethe locale.
inLocalespecifies the desired user country.

◆ getDisplayCountry_Default()

string getDisplayCountry_Default ( [in] com::sun::star::lang::Locale  locale)
Returns
country code for display of field to user. If the localized name is not found, returns the ISO code. The desired user country is from the default locale.

◆ getDisplayLanguage()

string getDisplayLanguage ( [in] com::sun::star::lang::Locale  locale,
[in] com::sun::star::lang::Locale  inLocale 
)
Returns
language code for display of field to user. If the localized name is not found, returns the ISO codes.
Parameters
localethe locale.
inLocalespecifies the desired user language.

◆ getDisplayLanguage_Default()

string getDisplayLanguage_Default ( [in] com::sun::star::lang::Locale  locale)
Returns
language code for display of field to user. If the localized name is not found, returns the ISO code. The desired user language is from the default locale.

◆ getDisplayName()

string getDisplayName ( [in] com::sun::star::lang::Locale  locale,
[in] com::sun::star::lang::Locale  inLocale 
)
Returns
a string to display the entire locale to user. If the localized name is not found, uses the ISO codes.
Parameters
localethe locale.
inLocalespecifies the desired user locale.

◆ getDisplayName_Default()

string getDisplayName_Default ( [in] com::sun::star::lang::Locale  locale)
Returns
a string to display the entire locale to user. If the localized name is not found, uses the ISO codes. The default locale is used for the presentation language.
Parameters
localethe locale.

◆ getDisplayVariant()

string getDisplayVariant ( [in] com::sun::star::lang::Locale  locale,
[in] com::sun::star::lang::Locale  inLocale 
)
Returns
variant code for display of field to user. If the localized name is not found, returns the ISO codes.
Parameters
localethe locale.
inLocalespecifies the desired user variant.

◆ getDisplayVariant_Default()

string getDisplayVariant_Default ( [in] com::sun::star::lang::Locale  locale)
Returns
variant code for display of field to user. The desired user variant is from the default locale.

◆ getISO3Country()

string getISO3Country ( [in] com::sun::star::lang::Locale  locale)
raises (com::sun::star::resource::MissingResourceException
)
Returns
the ISO country code for the specified locale.

◆ getISO3Language()

string getISO3Language ( [in] com::sun::star::lang::Locale  locale)
raises (com::sun::star::resource::MissingResourceException
)
Returns
the ISO language code for the specified locale.

◆ getISOCountries()

sequence<string> getISOCountries ( )
Returns
a sequence of all ISO country codes known to the component.

◆ getISOLanguages()

sequence<string> getISOLanguages ( )
Returns
a sequence of all ISO language codes known to the component.

◆ getLanguagesForCountry()

sequence<string> getLanguagesForCountry ( [in] string  country)
Returns
a sequence for language codes which are valid within the given country.

◆ setDefault()

void setDefault ( [in] com::sun::star::lang::Locale  newLocale)

sets the default locale for the whole environment.

It is normally set once at the beginning of an application, then never reset. setDefault does not reset the host locale.


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