#include <e32std.h>
class TExtendedLocale |
Public Member Functions | |
---|---|
TExtendedLocale() | |
IMPORT_C TPtrC | GetCurrencySymbol() |
TLocale * | GetLocale() |
IMPORT_C TInt | GetLocaleDllName(TLocaleAspect, TDes &) |
IMPORT_C TPtrC | GetLongDateFormatSpec() |
IMPORT_C TCollationMethod | GetPreferredCollationMethod(TInt) |
IMPORT_C TPtrC | GetShortDateFormatSpec() |
IMPORT_C TPtrC | GetTimeFormatSpec() |
IMPORT_C TInt | LoadLocale(const TDesC &) |
IMPORT_C TInt | LoadLocale(const TDesC &, const TDesC &, const TDesC &) |
IMPORT_C TInt | LoadLocaleAspect(TUint, const TDesC &) |
IMPORT_C TInt | LoadLocaleAspect(const TDesC &) |
IMPORT_C void | LoadSystemSettings() |
IMPORT_C TInt | SaveSystemSettings() |
IMPORT_C TInt | SetCurrencySymbol(const TDesC &) |
Extended locale class
This class holds a collection of locale information. It contains a TLocale internally. It has methods to load a locale DLL and to set the system wide locale information.
IMPORT_C | TExtendedLocale | ( | ) |
Default constructor.
It constructs an empty object
This is an empty copy of TExtendedLocale. To get the system locale you can use TExtendedLocale::LoadSystemSettings. The current settings may be saved to the system with TLocale::SaveSystemSettings().
See also: TExtendedLocale::LoadSystemSettings TExtendedLocale::SaveSystemSettings
IMPORT_C TPtrC | GetCurrencySymbol | ( | ) |
Get the Currency Symbol from SLocaleLocaleSettings object
Returns: TPtrC Pointer holding the Currency Symbol
IMPORT_C TInt | GetLocaleDllName | ( | TLocaleAspect | aLocaleDataSet, |
TDes & | aDllName | |||
) |
Returns the name of the DLL containing the given bits of locale information
Given the bits of locale information specified in aLocaleDataSet, it returns the name of the locale DLL storing the information. TExtendedLocale can contain information from different DLLs.
Parameter | Description |
---|---|
aLocaleDataSet | The TLocaleAspect specifying a group of locale properties |
aDllName | The descriptor that will contain the name of DLL containing the specifying bits of locale information (valid if the method is successful) |
Returns: KErrNone if successful, system wide error otherwise
IMPORT_C TPtrC | GetLongDateFormatSpec | ( | ) |
Get the Long Date Format from SLocaleTimeDateFormat object
Returns: TPtrC Pointer holding the Long Date Format
IMPORT_C TCollationMethod | GetPreferredCollationMethod | ( | TInt | index = 0 | ) |
Get the preferred collation method for the preferred charset.
Note that some charsets may contain more than one collation method (e.g "dictionary" v "phonebook" ordering) so an optional index parameter can be used to select between them.
See also: TCollationMethod
Parameter | Description |
---|---|
index | Optional parameter specifying the index of the collation method in the locale to get. This is the responsibility of the caller to make sure that the index is less than the total number of collation methods in the preferred charset in this locale. |
Returns: TCollationMethod representing the requested collation method.
IMPORT_C TPtrC | GetShortDateFormatSpec | ( | ) |
Get the Short Date Format from SLocaleTimeDateFormat object
Returns: TPtrC Pointer holding the Short Date Format
IMPORT_C TPtrC | GetTimeFormatSpec | ( | ) |
Get the Time Format from SLocaleTimeDateFormat object
Returns: TPtrC Pointer holding the Time Format
Loads a locale Dll and get the locale information
It loads a locale DLL and it initialises the contents of this TExtendedLocale with the locale information stored in the DLL. The locale information is only stored in this TExtendedLocale. If you want to set the system wide settings with the locale information in the DLL, you can call TExtendedLocale::SaveSystemSettings after calling this function.
See also: TExtendedLocale::SaveSystemSettings
Parameter | Description |
---|---|
aLocaleDllName | The name of the locale DLL to be loaded |
Returns: KErrNone if successful, system wide error if not
IMPORT_C TInt | LoadLocale | ( | const TDesC & | aLanguageLocaleDllName, |
const TDesC & | aRegionLocaleDllName, | |||
const TDesC & | aCollationLocaleDllName | |||
) |
Loads locale data from three locale dlls, which are language, region, and collation locale dlls
It loads three locale DLLs and it initialises the contents of this TExtendedLocale with the locale information stored in the DLLs. The locale information is only stored in this TExtendedLocale. If you want to set the system wide settings with the locale information in the DLL, you can call TExtendedLocale::SaveSystemSettings after calling this function.
See also: TExtendedLocale::SaveSystemSettings
Parameter | Description |
---|---|
aLanguageLocaleDllName | The name of the language locale DLL to be loaded |
aRegionLocaleDllName | The name of the region locale DLL to be loaded |
aCollationLocaleDllName | The name of the collation locale DLL to be loaded |
Returns: KErrNone if successful, system wide error if not
Loads a DLL and get some locale information
It loads the specified locale DLL and depending on the aAspectGroup it overwrites locale information in this TExtendedLocale with the locale information stored in the DLL. aAspectGroup is a bitmap of TLocaleAspect values specifying what to be overwritten. The locale information is only stored in this TExtendedLocale. If you want to set the system wide settings with the locale information in the DLL, you can call TExtendedLocale::SaveSystemSettings after calling this function.
Parameter | Description |
---|---|
aAspectGroup | A bitmap of TLocaleAspect values specifying what to be overwritten in this TExtendedLocale. (eg.: ELocaleLanguageSettings | ELocaleTimeDateSettings) |
aLocaleDllName | The name of the locale DLL to be loaded |
Returns: KErrNone if the method is successful, a system wide error code if not
Loads a DLL and get some locale information
It loads the specified locale DLL, and it overwrites locale information in this TExtendedLocale with the locale information stored in the DLL. The locale information is only stored in this TExtendedLocale. If you want to set the system wide settings with the locale information in the DLL, you can call TExtendedLocale::SaveSystemSettings after calling this function.
See also: TExtendedLocale::SaveSystemSettings
Parameter | Description |
---|---|
aLocaleDllName | The name of the locale DLL to be loaded |
Returns: KErrNone if the method is successful, a system wide error code if not
IMPORT_C void | LoadSystemSettings | ( | ) |
Load system wide locale settings
It initialises this TExtendedLocale with the system wide locale settings. The settings stored in the TExtendedLocale are overwritten with the system wide locale.
See also: TExtendedLocale::SaveSystemSettings
IMPORT_C TInt | SaveSystemSettings | ( | ) |
Make the current locale information system wide
It overwrites the system wide locale information with the locale information stored in this TExtendedLocale. This will generate a notification for system locale changes. In case of an error, the locale might be in an unconsistent state.
Returns: KErrNone if successful, otherwise one of the other system wide error codes.
Sets the currency symbol
It sets the currency symbol. The maximum lenght for the currency symbol is KMaxCurrencySymbol. Trying to pass a descriptor longer than that, will result in a panic.
Parameter | Description |
---|---|
aSymbol | The new currency symbol |
Returns: KErrNone if successful, otherwise one of the other system wide error codes.