LibreOffice
LibreOffice 5.3 SDK C/C++ API Reference
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Classes | Typedefs | Functions
locale.h File Reference
#include <sal/config.h>
#include <rtl/ustring.h>
#include <sal/saldllapi.h>

Go to the source code of this file.

Classes

struct  _rtl_Locale
 The implementation structure of a locale. More...
 

Typedefs

typedef struct _rtl_Locale rtl_Locale
 The implementation structure of a locale. More...
 

Functions

SAL_DLLPUBLIC rtl_Localertl_locale_register (const sal_Unicode *language, const sal_Unicode *country, const sal_Unicode *variant)
 Register a locale from language, country and variant. More...
 
SAL_DLLPUBLIC rtl_Localertl_locale_getDefault (void)
 Common method of getting the current default Locale. More...
 
SAL_DLLPUBLIC void rtl_locale_setDefault (const sal_Unicode *language, const sal_Unicode *country, const sal_Unicode *variant)
 Sets the default. More...
 
SAL_DLLPUBLIC rtl_uString * rtl_locale_getLanguage (rtl_Locale *This)
 Getter for programmatic name of field, a lowercased two-letter ISO 639-1 or three-letter ISO 639-3 code. More...
 
SAL_DLLPUBLIC rtl_uString * rtl_locale_getCountry (rtl_Locale *This)
 Getter for programmatic name of field, an uppercased two-letter ISO-3166 code. More...
 
SAL_DLLPUBLIC rtl_uString * rtl_locale_getVariant (rtl_Locale *This)
 Getter for programmatic name of field. More...
 
SAL_DLLPUBLIC sal_Int32 rtl_locale_hashCode (rtl_Locale *This)
 Returns the hash code of the locale This. More...
 
SAL_DLLPUBLIC sal_Int32 rtl_locale_equals (rtl_Locale *This, rtl_Locale *obj)
 Returns true if the locals are equal, otherwise false. More...
 

Typedef Documentation

typedef struct _rtl_Locale rtl_Locale

The implementation structure of a locale.

Do not create this structure direct. Only use the functions rtl_locale_register and rtl_locale_setDefault. The strings Language, Country and Variant are constants, so it is not necessary to acquire and release them.

Function Documentation

SAL_DLLPUBLIC sal_Int32 rtl_locale_equals ( rtl_Locale This,
rtl_Locale obj 
)

Returns true if the locals are equal, otherwise false.

SAL_DLLPUBLIC rtl_uString* rtl_locale_getCountry ( rtl_Locale This)

Getter for programmatic name of field, an uppercased two-letter ISO-3166 code.

See Also
getDisplayCountry
SAL_DLLPUBLIC rtl_Locale* rtl_locale_getDefault ( void  )

Common method of getting the current default Locale.

Used for the presentation: menus, dialogs, etc. 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 will allow users to use different locales for different fields, e.g. in a spreadsheet.
Note that the initial setting will match the host system.

SAL_DLLPUBLIC rtl_uString* rtl_locale_getLanguage ( rtl_Locale This)

Getter for programmatic name of field, a lowercased two-letter ISO 639-1 or three-letter ISO 639-3 code.

See Also
getDisplayLanguage
SAL_DLLPUBLIC rtl_uString* rtl_locale_getVariant ( rtl_Locale This)

Getter for programmatic name of field.

See Also
getDisplayVariant
SAL_DLLPUBLIC sal_Int32 rtl_locale_hashCode ( rtl_Locale This)

Returns the hash code of the locale This.

SAL_DLLPUBLIC rtl_Locale* rtl_locale_register ( const sal_Unicode language,
const sal_Unicode country,
const sal_Unicode variant 
)

Register a locale from language, country and variant.

Parameters
languagelowercase two-letter ISO 639-1 or three-letter ISO 639-3 code.
countryuppercase two-letter ISO-3166 code. May be null.
variantvendor and browser specific code. May be null.
SAL_DLLPUBLIC void rtl_locale_setDefault ( const sal_Unicode language,
const sal_Unicode country,
const sal_Unicode variant 
)

Sets the default.

Normally set once at the beginning of applet or application, then never reset. setDefault does not reset the host locale.

Parameters
languagelowercase two-letter ISO 639-1 or three-letter ISO 639-3 code.
countryuppercase two-letter ISO-3166 code.
variantvendor and browser specific code. See class description.