class TLocale |
Sets and gets the system's locale settings.
Symbian OS maintains the locale information internally. On construction, this object is initialized with the system information for all locale items.
Public Member Enumerations | |
---|---|
enum | anonymous { EFlagNegativeLoseSpace = 0x00000001, EFlagNegativeCurrencySymbolOpposite = 0x00000002 } |
enum | TDeviceTimeState { EDeviceUserTime, ENITZNetworkTimeSync } |
enum | TNegativeCurrencyFormat { ELeadingMinusSign, EInBrackets, ETrailingMinusSign, EInterveningMinusSign } |
IMPORT_C | TLocale | ( | ) |
Default constructor.
It constructs the object with the system's locale settings.
A single copy of the locale information is maintained by the system. This copy may be refreshed under application control with TLocale::Refresh(), and the settings may be saved to the system with TLocale::Set(). However, the settings are never updated by the system apart from under application control. This enables applications to guarantee that consistent locale information is used.
TBool | AmPmSpaceBetween | ( | ) | const [inline] |
Tests whether or not a space is inserted between the time and the preceding or trailing am/pm text.
TLocalePos | AmPmSymbolPosition | ( | ) | const [inline] |
Gets the am/pm text position (before or after the time value).
TInt | CountryCode | ( | ) | const [inline] |
Gets the code which is used to select country-specific locale data.
The country code is the code used as the international dialling prefix. This code is also used to identify a country by the dialling software.
TInt | CurrencyDecimalPlaces | ( | ) | const [inline] |
Gets the number of decimal places to which currency values are set.
TBool | CurrencyNegativeInBrackets | ( | ) | const [inline] |
Gets whether negative currency values are enclosed in brackets rather than being preceded by a minus sign.
This is deprecated, use NegativeCurrencyFormat() instead.
TBool | CurrencySpaceBetween | ( | ) | const [inline] |
Gets whether or not a space is inserted between the currency symbol and the currency value.
For negative currency values, the space can be removed using SetNegativeLoseSpace().
TLocalePos | CurrencySymbolPosition | ( | ) | const [inline] |
Gets the currency symbol position.
For negative currency values, this position may be reversed using SetNegativeCurrencySymbolOpposite().
TBool | CurrencyTriadsAllowed | ( | ) | const [inline] |
Gets whether triads are allowed in currency values. Triads are groups of three digits separated by the thousands separator.
TChar | DateSeparator | ( | TInt | aIndex | ) | const [inline] |
Gets one of the four characters used to separate the day, month and year components of the date.
If the four separators are represented by S0, S1, S2 and S3 and the three date components are represented by XX, YY and ZZ, then the separators are located: S0 XX S1 YY S2 ZZ S3.
TInt aIndex | An index indicating which of the four separators is being accessed. This must be a value between zero and three inclusive. |
TUint | DaylightSaving | ( | ) | const [inline] |
Gets the zones in which daylight saving is in effect.
If daylight saving is in effect, one hour is added to the time.
Use TLocale::QueryHomeHasDaylightSavingOn() to find out whether daylight saving is in effect for the home city. This is because the daylight saving setting for the home city may differ from that of the zone in which home is located.
TLocale::QueryHomeHasDaylightSavingOn TDaylightSavingZoneUse the timezone server to retrieve information on timezones and DST. This method will always indicate that DST is inactive, in order to preserve compatibility.
TChar | DecimalSeparator | ( | ) | const [inline] |
Gets the character used to separate a whole number from its fractional part.
TDeviceTimeState | DeviceTime | ( | ) | const [inline] |
Gets the device time state.
Use the timezone server to coordinate automatic time adjustment.
IMPORT_C void | FormatCurrency | ( | TDes & | aText, |
TInt | aAmount | |||
) |
Renders a currency value as text, based on the locale's currency and numeric format settings.
These settings include the currency symbol, the symbol's position and the way negative values are formatted.
IMPORT_C void | FormatCurrency | ( | TDes & | aText, |
TInt64 | aAmount | |||
) |
Renders a currency value as text, based on the locale's currency and numeric format settings.
These settings include the currency symbol, the symbol's position and the way negative values are formatted.
IMPORT_C void | FormatCurrency | ( | TDes & | aText, |
TDesOverflow & | aOverflowHandler, | |||
TInt | aAmount | |||
) |
Renders a currency value as text, based on the locale's currency and numeric format settings.
These settings include the currency symbol, the symbol's position and the way negative values are formatted. If aText is not long enough to hold the formatted currency value, the overflow handler's Overflow() function is called.
TDes & aText | On return, contains the currency value as text, formatted according to the locale's currency format settings. |
TDesOverflow & aOverflowHandler | An object derived from TDesOverflow which handles descriptor overflows. |
TInt aAmount | The currency value to be formatted. |
IMPORT_C void | FormatCurrency | ( | TDes & | aText, |
TDesOverflow & | aOverflowHandler, | |||
TInt64 | aAmount | |||
) |
Renders a currency value as text, based on the locale's currency and numeric format settings.
These settings include the currency symbol, the symbol's position and the way negative values are formatted. If aText is not long enough to hold the formatted currency value, the overflow handler's Overflow() function is called.
TDes & aText | On return, contains the currency value as text, formatted according to the locale's currency format settings. |
TDesOverflow & aOverflowHandler | An object derived from TDesOverflow which handles descriptor overflows. |
TInt64 aAmount | The currency value to be formatted. |
TDaylightSavingZone | HomeDaylightSavingZone | ( | ) | const [inline] |
Gets the daylight saving zone in which the home city is located.
Use the timezone server to retrieve information on timezones and DST.
TLanguage | LanguageDowngrade | ( | TInt | aIndex | ) | const [inline] |
Gets the language that is stored at the specified index into the customisable part of the language downgrade path.
The second, third and fourth languages in the language downgrade path can be customised. These can be enquired using this function. The first language in the path is always the language of the current locale, as returned by User::Language().
The languages in the downgrade path are used in turn by the BaflUtils::NearestLanguageFile() function to find the best matching language-specific version of a language-neutral filename.
The full language downgrade path can be retrieved using BaflUtils::GetDowngradePath().
BaflUtils::NearestLanguageFile BaflUtils::GetDowngradePath
TInt aIndex | An index into the customisable part of the language downgrade path. Between zero and two inclusive. |
TNegativeCurrencyFormat | NegativeCurrencyFormat | ( | ) | const [inline] |
Gets the negative currency format.
TBool | NegativeCurrencySymbolOpposite | ( | ) | const [inline] |
Gets whether in negative currency values, the position of the currency symbol is set to be the opposite of the position used for non-negative values (before or after the value, as set by SetCurrencySymbolPosition()).
TBool | NegativeLoseSpace | ( | ) | const [inline] |
Gets whether negative currency values lose the space between the currency symbol and the value.
TBool | QueryHomeHasDaylightSavingOn | ( | ) | const [inline] |
Tests whether or not daylight saving is set for the home city.
Use the timezone server to retrieve information on timezones and DST. This method will always indicate that DST is inactive, in order to preserve compatibility.
IMPORT_C void | Refresh | ( | ) |
Refreshes the contents of this object with the system's locale settings.
IMPORT_C TInt | Set | ( | ) | const |
Transfers the locale settings from this object to the system. Note that the timezone offset and daylight savings flags are ignored as setting these through TLocale is no longer supported.
After this function has been called, other applications may use the new settings for newly-constructed TLocale objects, or if they use TLocale::Refresh(), to refresh their settings from the system copy.
void | SetAmPmSpaceBetween | ( | TBool | aSpace | ) | [inline] |
Sets whether a space is inserted between the time and the preceding or trailing am/pm text.
TBool aSpace |
void | SetAmPmSymbolPosition | ( | TLocalePos | aPos | ) | [inline] |
Sets the am/pm text position (before or after the time value).
TLocalePos aPos |
void | SetClockFormat | ( | TClockFormat | aFormat | ) | [inline] |
Sets the clock display format.
TClockFormat aFormat | The clock display format. |
void | SetCountryCode | ( | TInt | aCode | ) | [inline] |
Sets the value which is used to select country-specific locale data.
This value can be retrieved by using TLocale::CountryCode(). The country code is the code used as the international dialling prefix. This code is also used to identify a country by the dialling software.
TInt aCode | The country code. |
void | SetCurrencyDecimalPlaces | ( | TInt | aPlaces | ) | [inline] |
Sets the number of decimal places to which currency values should be set.
TInt aPlaces | The number of decimal places. |
void | SetCurrencyNegativeInBrackets | ( | TBool | aBool | ) | [inline] |
Sets whether negative currency values are enclosed in brackets rather than being preceded by a minus sign.
This is deprecated, use SetNegativeCurrencyFormat() instead.
TBool aBool | ETrue, if a negative currency value must be enclosed in brackets without a minus sign; EFalse, if a negative currency value is preceded by a minus sign without any enclosing brackets. |
void | SetCurrencySpaceBetween | ( | TBool | aSpace | ) | [inline] |
Sets whether a space is inserted between the currency symbol and the currency amount.
TBool aSpace | ETrue if a space is inserted; EFalse if not. |
void | SetCurrencySymbolPosition | ( | TLocalePos | aPos | ) | [inline] |
Sets the currency symbol position.
TLocalePos aPos | The currency symbol position. |
void | SetCurrencyTriadsAllowed | ( | TBool | aBool | ) | [inline] |
Sets whether triads are allowed in currency values.
TBool aBool | ETrue if triads are allowed; EFalse if triads not allowed. |
void | SetDateFormat | ( | TDateFormat | aFormat | ) | [inline] |
Sets the date format.
TDateFormat aFormat | The date format to be used. |
void | SetDateSeparator | ( | const TChar & | aChar, |
TInt | aIndex | |||
) | [inline] |
Sets one of the four characters used to separate the day, month and year components of the date.
If the four separators are represented by S0, S1, S2 and S3 and the three date components are represented by XX, YY and ZZ, then the separators are located: S0 XX S1 YY S2 ZZ S3.
void | SetDecimalSeparator | ( | const TChar & | aChar | ) | [inline] |
Sets the character to be used to separate a whole number from its fractional part.
const TChar & aChar | The character to be used as the decimal separator. |
void | SetDeviceTime | ( | TDeviceTimeState | aState | ) | [inline] |
Sets the device time state.
Use the timezone server to coordinate automatic time adjustment.
TDeviceTimeState aState | The device time state. |
void | SetDigitType | ( | TDigitType | aDigitType | ) | [inline] |
Sets the number mode for the locale.
TDigitType aDigitType | The number mode to be set. |
void | SetLanguageDowngrade | ( | TInt | aIndex, |
TLanguage | aLanguage | |||
) | [inline] |
Sets a language in the customisable part of the language downgrade path.
BaflUtils::NearestLanguageFile BaflUtils::GetDowngradePath
TInt aIndex | An index into the customisable part of the path at which to add the language, a value between zero and two. |
TLanguage aLanguage | The language to add. ELangNone is considered to be the last language in the path, no more will be searched, so can be used to specify that no language downgrade is required. |
void | SetNegativeCurrencyFormat | ( | TNegativeCurrencyFormat | aNegativeCurrencyFormat | ) | [inline] |
Sets the negative currency format.
TNegativeCurrencyFormat aNegativeCurrencyFormat | How negative currency values are formatted. |
void | SetNegativeCurrencySymbolOpposite | ( | TBool | aBool | ) | [inline] |
Sets whether the position of the currency symbol for negative currency values should be the opposite of the position used for non-negative values (before or after the value, as set by SetCurrencySymbolPosition()).
TBool aBool | ETrue to set the position of the currency symbol in negative currency values to be the opposite of the position as set using SetCurrencySymbolPosition(). EFalse to leave the position unchanged. |
void | SetNegativeLoseSpace | ( | TBool | aBool | ) | [inline] |
Sets whether negative currency values lose the space between the currency symbol and the value.
TBool aBool | ETrue to set a flag which indicates that negative currency values should lose the space between the value and the symbol. EFalse to unset it. |
void | SetStartOfWeek | ( | TDay | aDay | ) | [inline] |
Sets the day which is considered to be the first day of the week.
TDay aDay | The first day of the week. |
void | SetThousandsSeparator | ( | const TChar & | aChar | ) | [inline] |
Sets the character to be used to separate groups of three digits to the left of the decimal separator.
A thousands separator character is only displayed in currency values if currency triads are allowed.
const TChar & aChar | The character to be used as the thousands separator. |
void | SetTimeFormat | ( | TTimeFormat | aFormat | ) | [inline] |
Sets the time format (12 or 24 hour).
TTimeFormat aFormat | The time format. |
void | SetTimeSeparator | ( | const TChar & | aChar, |
TInt | aIndex | |||
) | [inline] |
Sets one of the four characters used to separate the hour, minute and second components of the date.
If the four separators are represented by S0, S1, S2 and S3 and the three time components are represented by XX, YY and ZZ, then the separators are located: S0 XX S1 YY S2 ZZ S3.
void | SetUnitsDistanceLong | ( | TUnitsFormat | aFormat | ) | [inline] |
Sets the units of measurement for long distances.
Long distances are those which would normally be represented by either miles or kilometres.
TUnitsFormat aFormat | Units of measurement for long distances. |
void | SetUnitsDistanceShort | ( | TUnitsFormat | aFormat | ) | [inline] |
Sets the units of measurement for short distances.
Short distances are those which would normally be represented by either metres and centimetres or feet and inches.
TUnitsFormat aFormat | Units of measurement for short distances. |
void | SetUnitsGeneral | ( | TUnitsFormat | aFormat | ) | [inline] |
Sets the general units of measurement. This function should be used when both short and long distances use the same units of measurement.
TUnitsFormat aFormat | General units of measurement. |
void | SetWorkDays | ( | TUint | aMask | ) | [inline] |
Sets the days of the week which are considered as working days.
TUint aMask | A bit mask of seven bits indicating (by being set) which days are workdays. The least significant bit corresponds to Monday, the next bit is Tuesday and so on. |
TDay | StartOfWeek | ( | ) | const [inline] |
Gets the day which is considered the first day of the week.
TChar | ThousandsSeparator | ( | ) | const [inline] |
Gets the character used to separate groups of three digits to the left of the decimal separator.
A thousands separator character is only displayed in currency values if currency triads are allowed.
TChar | TimeSeparator | ( | TInt | aIndex | ) | const [inline] |
Gets one of the four characters used to separate the hour, second and minute components of the time.
If the four separators are represented by S0, S1, S2 and S3 and the three time components are represented by XX, YY and ZZ, then the separators are located: S0 XX S1 YY S2 ZZ S3.
TInt aIndex | An index indicating which of the four separators is being accessed. This must be a value between zero and three inclusive. |
TUnitsFormat | UnitsDistanceLong | ( | ) | const [inline] |
Gets the units of measurement for long distances.
Long distances are those which would normally be represented by either miles or kilometres.
TUnitsFormat | UnitsDistanceShort | ( | ) | const [inline] |
Gets the units of measurement for short distances.
Short distances are those which would normally be represented by either metres and centimetres or feet and inches.
TUnitsFormat | UnitsGeneral | ( | ) | const [inline] |
Gets the general units of measurement.
This function should be used when both short and long distances use the same units of measurement.
TTimeIntervalSeconds | UniversalTimeOffset | ( | ) | const [inline] |
Gets the locale's universal time offset.
Use User::UTCOffset to get the current offset inclusive of daylight savings time. This function returns the same value, for compatibility.
TUint | WorkDays | ( | ) | const [inline] |
Gets a bit mask representing the days of the week which are considered as working days.
Flags for negative currency values formatting
EFlagNegativeLoseSpace = 0x00000001 |
If this flag is set and the currency value being formatted is negative, if there is a space between the currency symbol and the value, that space is lost. |
EFlagNegativeCurrencySymbolOpposite = 0x00000002 |
If this flag is set and the currency value being formatted is negative, the position of the currency symbol is placed in the opposite direction from the position set for the positive currency value. |
Indicates how the device universal time is maintained
EDeviceUserTime |
Universal time is maintained by the device RTC and the user selection of the locale of the device indicating offset from GMT and daylight saving |
ENITZNetworkTimeSync |
Universal time and offset from GMT is supplied by the mobile network and maintained by device RTC |
Indicates how negative currency values are formatted.
ELeadingMinusSign |
A minus sign is inserted before the currency symbol and value. |
EInBrackets |
The currency value and symbol are enclosed in brackets (no minus sign is used). |
ETrailingMinusSign |
A minus sign is inserted after the currency symbol and value. |
EInterveningMinusSign |
A minus sign is inserted between the currency symbol and the value. |
TNegativeCurrencyFormat | iNegativeCurrencyFormat | [private] |
Copyright ©2010 Nokia Corporation and/or its subsidiary(-ies).
All rights
reserved. Unless otherwise stated, these materials are provided under the terms of the Eclipse Public License
v1.0.