|
||
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()const
Tests whether or not a space is inserted between the time and the preceding or t...AmPmSymbolPosition()const
Gets the am/pm text position (before or after the time value).ClockFormat()const
Gets the clock display format.CountryCode()const
Gets the code which is used to select country-specific locale data.CurrencyDecimalPlaces()const
Gets the number of decimal places to which currency values are set.CurrencyNegativeInBrackets()const
Gets whether negative currency values are enclosed in brackets rather than being...CurrencySpaceBetween()const
Gets whether or not a space is inserted between the currency symbol and the curr...CurrencySymbolPosition()const
Gets the currency symbol position.CurrencyTriadsAllowed()const
Gets whether triads are allowed in currency values. Triads are groups of three d...DateFormat()const
Gets the date format.DateSeparator(TInt)const
Gets one of the four characters used to separate the day, month and year compone...DaylightSaving()const
Gets the zones in which daylight saving is in effect.DecimalSeparator()const
Gets the character used to separate a whole number from its fractional part.DeviceTime()const
Gets the device time state.DigitType()const
Gets the number mode stored in the locale.EDeviceUserTime
Universal time is maintained by the device RTC and the user selection of the loc...EFlagNegativeCurrencySymbolOpposite
If this flag is set and the currency value being formatted is negative, the posi...EFlagNegativeLoseSpace
If this flag is set and the currency value being formatted is negative, if there...EInBrackets
The currency value and symbol are enclosed in brackets (no minus sign is used).EInterveningMinusSign
A minus sign is inserted between the currency symbol and the value. ELeadingMinusSign
A minus sign is inserted before the currency symbol and value.ENITZNetworkTimeSync
Universal time and offset from GMT is supplied by the mobile network and maintai...ETrailingMinusSign
A minus sign is inserted after the currency symbol and value. FormatCurrency(TDes &,TDesOverflow &,TInt)
Renders a currency value as text, based on the locale's currency and numeric for...FormatCurrency(TDes &,TDesOverflow &,TInt64)
Renders a currency value as text, based on the locale's currency and numeric for...FormatCurrency(TDes &,TInt)
Renders a currency value as text, based on the locale's currency and numeric for...FormatCurrency(TDes &,TInt64)
Renders a currency value as text, based on the locale's currency and numeric for...HomeDaylightSavingZone()const
Gets the daylight saving zone in which the home city is located.LanguageDowngrade(TInt)const
Gets the language that is stored at the specified index into the customisable pa...NegativeCurrencyFormat()const
Gets the negative currency format.NegativeCurrencySymbolOpposite()const
Gets whether in negative currency values, the position of the currency symbol is...NegativeLoseSpace()const
Gets whether negative currency values lose the space between the currency symbol...QueryHomeHasDaylightSavingOn()const
Tests whether or not daylight saving is set for the home city.Refresh()
Refreshes the contents of this object with the system's locale settings. Set()const
Transfers the locale settings from this object to the system. Note that the time...SetAmPmSpaceBetween(TBool)
Sets whether a space is inserted between the time and the preceding or trailing ...SetAmPmSymbolPosition(TLocalePos)
Sets the am/pm text position (before or after the time value).SetClockFormat(TClockFormat)
Sets the clock display format.SetCountryCode(TInt)
Sets the value which is used to select country-specific locale data.SetCurrencyDecimalPlaces(TInt)
Sets the number of decimal places to which currency values should be set.SetCurrencyNegativeInBrackets(TBool)
Sets whether negative currency values are enclosed in brackets rather than being...SetCurrencySpaceBetween(TBool)
Sets whether a space is inserted between the currency symbol and the currency am...SetCurrencySymbolPosition(TLocalePos)
Sets the currency symbol position.SetCurrencyTriadsAllowed(TBool)
Sets whether triads are allowed in currency values.SetDateFormat(TDateFormat)
Sets the date format.SetDateSeparator(const TChar &,TInt)
Sets one of the four characters used to separate the day, month and year compone...SetDecimalSeparator(const TChar &)
Sets the character to be used to separate a whole number from its fractional par...SetDeviceTime(TDeviceTimeState)
Sets the device time state.SetDigitType(TDigitType)
Sets the number mode for the locale.SetLanguageDowngrade(TInt,TLanguage)
Sets a language in the customisable part of the language downgrade path.SetNegativeCurrencyFormat(TNegativeCurrencyFormat)
Sets the negative currency format.SetNegativeCurrencySymbolOpposite(TBool)
Sets whether the position of the currency symbol for negative currency values sh...SetNegativeLoseSpace(TBool)
Sets whether negative currency values lose the space between the currency symbol...SetStartOfWeek(TDay)
Sets the day which is considered to be the first day of the week.SetThousandsSeparator(const TChar &)
Sets the character to be used to separate groups of three digits to the left of ...SetTimeFormat(TTimeFormat)
Sets the time format (12 or 24 hour).SetTimeSeparator(const TChar &,TInt)
Sets one of the four characters used to separate the hour, minute and second com...SetUnitsDistanceLong(TUnitsFormat)
Sets the units of measurement for long distances.SetUnitsDistanceShort(TUnitsFormat)
Sets the units of measurement for short distances.SetUnitsGeneral(TUnitsFormat)
Sets the general units of measurement. This function should be used when both sh...SetWorkDays(TUint)
Sets the days of the week which are considered as working days.StartOfWeek()const
Gets the day which is considered the first day of the week.TDeviceTimeState
Indicates how the device universal time is maintained TLocale()
Default constructor.TLocale(TInt)
TNegativeCurrencyFormat
Indicates how negative currency values are formatted. ThousandsSeparator()const
Gets the character used to separate groups of three digits to the left of the de...TimeFormat()const
Gets the time format (12 or 24 hour).TimeSeparator(TInt)const
Gets one of the four characters used to separate the hour, second and minute com...UnitsDistanceLong()const
Gets the units of measurement for long distances.UnitsDistanceShort()const
Gets the units of measurement for short distances.UnitsGeneral()const
Gets the general units of measurement.UniversalTimeOffset()const
Gets the locale's universal time offset.WorkDays()const
Gets a bit mask representing the days of the week which are considered as workin...anonymous
Flags for negative currency values formattingIMPORT_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()const
. 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.
TLocale::Refresh()
Refreshes the contents of this object with the system's locale settings. TLocale::Set()const
Transfers the locale settings from this object to the system. Note that the time...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.
|
TLocale::Refresh()
Refreshes the contents of this object with the system's locale settings. 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()const
. 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.
|
TLocale::CountryCode()const
Gets the code which is used to select country-specific locale data.Interface status: | deprecated | Use User::UTCOffset to get the current offset inclusive of daylight savings time. This function returns the same value, for compatibility. |
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 TLocale::SetNegativeCurrencySymbolOpposite(TBool)
.
|
TLocale::SetNegativeCurrencySymbolOpposite(TBool)
Sets whether the position of the currency symbol for negative currency values sh...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 TLocale::SetNegativeLoseSpace(TBool)
.
|
TLocale::SetNegativeLoseSpace(TBool)
Sets whether negative currency values lose the space between the currency symbol...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.
|
Interface status: | deprecated |
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 TLocale::NegativeCurrencyFormat()const
instead.
|
TLocale::NegativeCurrencyFormat()const
Gets the negative currency format.Interface status: | deprecated |
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 TLocale::SetNegativeCurrencyFormat(TNegativeCurrencyFormat)
instead.
|
TLocale::SetNegativeCurrencyFormat(TNegativeCurrencyFormat)
Sets the negative currency format.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).
|
Interface status: | deprecated | 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. |
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()const
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()const
Tests whether or not daylight saving is set for the home city.Interface status: | deprecated | 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. |
inline TBool QueryHomeHasDaylightSavingOn() const;
Tests whether or not daylight saving is set for the home city.
|
Interface status: | deprecated | Use the timezone server to retrieve information on timezones and DST. |
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 TLocale::SetCurrencySymbolPosition(TLocalePos)
).
|
TLocale::SetCurrencySymbolPosition(TLocalePos)
Sets the currency symbol position.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 TLocale::SetCurrencySymbolPosition(TLocalePos)
).
|
TLocale::SetCurrencySymbolPosition(TLocalePos)
Sets the currency symbol position.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.
|
Interface status: | deprecated | Use the timezone server to coordinate automatic time adjustment. |
inline TDeviceTimeState DeviceTime() const;
Gets the device time state.
|
Interface status: | deprecated | Use the timezone server to coordinate automatic time adjustment. |
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
|