Symbian
Symbian Developer Library

SYMBIAN OS V9.4

Feedback

[Index] [Previous] [Next]

#include <e32std.h>
Link against: euser.lib

Class TExtendedLocale

class TExtendedLocale;

Description

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.

Members

Defined in TExtendedLocale:


Construction and destruction


TExtendedLocale()

IMPORT_C TExtendedLocale();

Description

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:

[Top]


Member functions


LoadSystemSettings()

IMPORT_C void LoadSystemSettings();

Description

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:


SaveSystemSettings()

Capability: WriteDeviceData

IMPORT_C TInt SaveSystemSettings();

Description

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.

Return value

TInt

KErrNone if successful, otherwise one of the other system wide error codes.


LoadLocale(const TDesC &)

IMPORT_C TInt LoadLocale(const TDesC &aLocaleDllName);

Description

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.

Parameters

const TDesC16 &aLocaleDllName

The name of the locale DLL to be loaded

Return value

TInt

KErrNone if successful, system wide error if not

See also:


LoadLocaleAspect(TUint,const TDesC &)

IMPORT_C TInt LoadLocaleAspect(TUint aAspectGroup, const TDesC &aLocaleDllName);

Description

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.

Parameters

TUint aAspectGroup

A bitmap of TLocaleAspect values specifying what to be overwritten in this TExtendedLocale. (eg.: ELocaleLanguageSettings | ELocaleTimeDateSettings)

const TDesC16 &aLocaleDllName

The name of the locale DLL to be loaded

Return value

TInt

KErrNone if the method is successful, a system wide error code if not

See also:


SetCurrencySymbol(const TDesC &)

Capability: WriteDeviceData

IMPORT_C TInt SetCurrencySymbol(const TDesC &aSymbol);

Description

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.

Parameters

const TDesC16 &aSymbol

The new currency symbol

Return value

TInt

KErrNone if successful, otherwise one of the other system wide error codes.

Panic codes

USER

119, if the length of aSymbol is greater than KMaxCurrencySymbol.


GetLocaleDllName(TLocaleAspect,TDes &)

IMPORT_C TInt GetLocaleDllName(TLocaleAspect aLocaleDataSet, TDes &aDllName);

Description

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.

Parameters

TLocaleAspect aLocaleDataSet

The TLocaleAspect specifying a group of locale properties

TDes16 &aDllName

The descriptor that will contain the name of DLL containing the specifying bits of locale information (valid if the method is successful)

Return value

TInt

KErrNone if successful, system wide error otherwise


GetPreferredCollationMethod(TInt)

IMPORT_C TCollationMethod GetPreferredCollationMethod(TInt index=0);

Description

Parameters

TInt index

Return value

TCollationMethod


GetCurrencySymbol()

IMPORT_C TPtrC GetCurrencySymbol();

Description

Get the Currency Symbol from SLocaleLocaleSettings object

Return value

TPtrC16

TPtrC Pointer holding the Currency Symbol


GetLongDateFormatSpec()

IMPORT_C TPtrC GetLongDateFormatSpec();

Description

Get the Long Date Format from SLocaleTimeDateFormat object

Return value

TPtrC16

TPtrC Pointer holding the Long Date Format


GetShortDateFormatSpec()

IMPORT_C TPtrC GetShortDateFormatSpec();

Description

Get the Short Date Format from SLocaleTimeDateFormat object

Return value

TPtrC16

TPtrC Pointer holding the Short Date Format


GetTimeFormatSpec()

IMPORT_C TPtrC GetTimeFormatSpec();

Description

Get the Time Format from SLocaleTimeDateFormat object

Return value

TPtrC16

TPtrC Pointer holding the Time Format


GetLocale()

inline TLocale* GetLocale();

Description

Return value

TLocale *