Location:
e32std.h
Link against: euser.lib
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.
Defined in TLocale
:
AmPmSpaceBetween()
, AmPmSymbolPosition()
, ClockFormat()
, CountryCode()
, CurrencyDecimalPlaces()
, CurrencyNegativeInBrackets()
, CurrencySpaceBetween()
, CurrencySymbolPosition()
, CurrencyTriadsAllowed()
, DateFormat()
, DateSeparator()
, DaylightSaving()
, DecimalSeparator()
, DeviceTime()
, DigitType()
, EDeviceUserTime
, EFlagNegativeCurrencySymbolOpposite
, EFlagNegativeLoseSpace
, EInBrackets
, EInterveningMinusSign
, ELeadingMinusSign
, ENITZNetworkTimeSync
, ETrailingMinusSign
, FormatCurrency()
, FormatCurrency()
, FormatCurrency()
, FormatCurrency()
, HomeDaylightSavingZone()
, LanguageDowngrade()
, NegativeCurrencyFormat()
, NegativeCurrencySymbolOpposite()
, NegativeLoseSpace()
, QueryHomeHasDaylightSavingOn()
, Refresh()
, Set()
, SetAmPmSpaceBetween()
, SetAmPmSymbolPosition()
, SetClockFormat()
, SetCountryCode()
, SetCurrencyDecimalPlaces()
, SetCurrencyNegativeInBrackets()
, SetCurrencySpaceBetween()
, SetCurrencySymbolPosition()
, SetCurrencyTriadsAllowed()
, SetDateFormat()
, SetDateSeparator()
, SetDecimalSeparator()
, SetDeviceTime()
, SetDigitType()
, SetLanguageDowngrade()
, SetNegativeCurrencyFormat()
, SetNegativeCurrencySymbolOpposite()
, SetNegativeLoseSpace()
, SetStartOfWeek()
, SetThousandsSeparator()
, SetTimeFormat()
, SetTimeSeparator()
, SetUnitsDistanceLong()
, SetUnitsDistanceShort()
, SetUnitsGeneral()
, SetWorkDays()
, StartOfWeek()
, TDeviceTimeState
, TLocale()
, TLocale()
, TNegativeCurrencyFormat
, ThousandsSeparator()
, TimeFormat()
, TimeSeparator()
, UnitsDistanceLong()
, UnitsDistanceShort()
, UnitsGeneral()
, UniversalTimeOffset()
, WorkDays()
, anonymous
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.
IMPORT_C void Refresh();
Refreshes the contents of this object with the system's locale settings.
Capability: | WriteDeviceData |
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.
|
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.
|
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.
|
inline TInt CountryCode() const;
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.
|
inline void SetCountryCode(TInt aCode);
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.
|
inline TTimeIntervalSeconds UniversalTimeOffset() const;
Gets the locale's universal time offset.
|
inline TDateFormat DateFormat() const;
Gets the date format.
|
inline void SetDateFormat(TDateFormat aFormat);
Sets the date format.
|
inline TTimeFormat TimeFormat() const;
Gets the time format (12 or 24 hour).
|
inline void SetTimeFormat(TTimeFormat aFormat);
Sets the time format (12 or 24 hour).
|
inline TLocalePos CurrencySymbolPosition() const;
Gets the currency symbol position.
For negative currency values, this position may be reversed using SetNegativeCurrencySymbolOpposite()
.
|
inline void SetCurrencySymbolPosition(TLocalePos aPos);
Sets the currency symbol position.
|
inline TBool CurrencySpaceBetween() const;
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()
.
|
inline void SetCurrencySpaceBetween(TBool aSpace);
Sets whether a space is inserted between the currency symbol and the currency amount.
|
inline TInt CurrencyDecimalPlaces() const;
Gets the number of decimal places to which currency values are set.
|
inline void SetCurrencyDecimalPlaces(TInt aPlaces);
Sets the number of decimal places to which currency values should be set.
|
inline TBool CurrencyNegativeInBrackets() const;
Gets whether negative currency values are enclosed in brackets rather than being preceded by a minus sign.
This is deprecated, use NegativeCurrencyFormat()
instead.
|
inline void SetCurrencyNegativeInBrackets(TBool aBool);
Sets whether negative currency values are enclosed in brackets rather than being preceded by a minus sign.
This is deprecated, use SetNegativeCurrencyFormat()
instead.
|
inline TBool CurrencyTriadsAllowed() const;
Gets whether triads are allowed in currency values. Triads are groups of three digits separated by the thousands separator.
|
inline void SetCurrencyTriadsAllowed(TBool aBool);
Sets whether triads are allowed in currency values.
|
inline TChar ThousandsSeparator() const;
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.
|
inline void SetThousandsSeparator(const TChar &aChar);
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.
|
inline TChar DecimalSeparator() const;
Gets the character used to separate a whole number from its fractional part.
|
inline void SetDecimalSeparator(const TChar &aChar);
Sets the character to be used to separate a whole number from its fractional part.
|
inline TChar DateSeparator(TInt aIndex) const;
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.
|
|
inline void SetDateSeparator(const TChar &aChar, TInt aIndex);
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.
|
inline TChar TimeSeparator(TInt aIndex) const;
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.
|
|
inline void SetTimeSeparator(const TChar &aChar, TInt aIndex);
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.
|
inline TBool AmPmSpaceBetween() const;
Tests whether or not a space is inserted between the time and the preceding or trailing am/pm text.
|
inline void SetAmPmSpaceBetween(TBool aSpace);
Sets whether a space is inserted between the time and the preceding or trailing am/pm text.
|
inline TLocalePos AmPmSymbolPosition() const;
Gets the am/pm text position (before or after the time value).
|
inline void SetAmPmSymbolPosition(TLocalePos aPos);
Sets the am/pm text position (before or after the time value).
|
inline TUint DaylightSaving() const;
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.
|
inline TBool QueryHomeHasDaylightSavingOn() const;
Tests whether or not daylight saving is set for the home city.
|
inline TDaylightSavingZone HomeDaylightSavingZone() const;
Gets the daylight saving zone in which the home city is located.
|
inline TUint WorkDays() const;
Gets a bit mask representing the days of the week which are considered as working days.
|
inline void SetWorkDays(TUint aMask);
Sets the days of the week which are considered as working days.
|
inline TDay StartOfWeek() const;
Gets the day which is considered the first day of the week.
|
inline void SetStartOfWeek(TDay aDay);
Sets the day which is considered to be the first day of the week.
|
inline TClockFormat ClockFormat() const;
Gets the clock display format.
|
inline void SetClockFormat(TClockFormat aFormat);
Sets the clock display format.
|
inline TUnitsFormat UnitsGeneral() const;
Gets the general units of measurement.
This function should be used when both short and long distances use the same units of measurement.
|
inline void SetUnitsGeneral(TUnitsFormat aFormat);
Sets the general units of measurement. This function should be used when both short and long distances use the same units of measurement.
|
inline TUnitsFormat UnitsDistanceShort() const;
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.
|
inline void SetUnitsDistanceShort(TUnitsFormat aFormat);
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.
|
inline TUnitsFormat UnitsDistanceLong() const;
Gets the units of measurement for long distances.
Long distances are those which would normally be represented by either miles or kilometres.
|
inline void SetUnitsDistanceLong(TUnitsFormat aFormat);
Sets the units of measurement for long distances.
Long distances are those which would normally be represented by either miles or kilometres.
|
inline TNegativeCurrencyFormat NegativeCurrencyFormat() const;
Gets the negative currency format.
|
inline void SetNegativeCurrencyFormat(TNegativeCurrencyFormat aNegativeCurrencyFormat);
Sets the negative currency format.
|
inline TBool NegativeLoseSpace() const;
Gets whether negative currency values lose the space between the currency symbol and the value.
|
inline void SetNegativeLoseSpace(TBool aBool);
Sets whether negative currency values lose the space between the currency symbol and the value.
|
inline TBool NegativeCurrencySymbolOpposite() const;
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()
).
|
inline void SetNegativeCurrencySymbolOpposite(TBool aBool);
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()
).
|
inline TLanguage LanguageDowngrade(TInt aIndex) const;
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().
|
|
inline void SetLanguageDowngrade(TInt aIndex, TLanguage aLanguage);
Sets a language in the customisable part of the language downgrade path.
|
inline TDigitType DigitType() const;
Gets the number mode stored in the locale.
|
inline void SetDigitType(TDigitType aDigitType);
Sets the number mode for the locale.
|
inline TDeviceTimeState DeviceTime() const;
Gets the device time state.
|
inline void SetDeviceTime(TDeviceTimeState aState);
Sets the device time state.
|
TNegativeCurrencyFormat
Indicates how negative currency values are formatted.
|
n/a
Flags for negative currency values formatting
|
TDeviceTimeState
Indicates how the device universal time is maintained
|