| 0 |      1 | // Copyright (c) 1994-2009 Nokia Corporation and/or its subsidiary(-ies).
 | 
|  |      2 | // All rights reserved.
 | 
|  |      3 | // This component and the accompanying materials are made available
 | 
|  |      4 | // under the terms of the License "Eclipse Public License v1.0"
 | 
|  |      5 | // which accompanies this distribution, and is available
 | 
|  |      6 | // at the URL "http://www.eclipse.org/legal/epl-v10.html".
 | 
|  |      7 | //
 | 
|  |      8 | // Initial Contributors:
 | 
|  |      9 | // Nokia Corporation - initial contribution.
 | 
|  |     10 | //
 | 
|  |     11 | // Contributors:
 | 
|  |     12 | //
 | 
|  |     13 | // Description:
 | 
|  |     14 | // f32test\locl\t_table.cpp
 | 
|  |     15 | // 
 | 
|  |     16 | //
 | 
|  |     17 | 
 | 
|  |     18 | #include <kernel/localise.h>
 | 
|  |     19 | 
 | 
|  |     20 | EXPORT_C TLanguage Locl::Language()
 | 
|  |     21 | //
 | 
|  |     22 | // Returns the language type.
 | 
|  |     23 | //
 | 
|  |     24 | 	{
 | 
|  |     25 | 
 | 
|  |     26 | 	return(LCountry::Language);
 | 
|  |     27 | 	}
 | 
|  |     28 | 
 | 
|  |     29 | EXPORT_C void Locl::LocaleData(SLocaleData *aLocale)
 | 
|  |     30 | //
 | 
|  |     31 | // Create the localisation table.
 | 
|  |     32 | //
 | 
|  |     33 | 	{
 | 
|  |     34 | 
 | 
|  |     35 | 	aLocale->iCountryCode=LCountry::CountryCode;
 | 
|  |     36 | 	aLocale->iUniversalTimeOffset=LCountry::UniversalTimeOffset;
 | 
|  |     37 | 	aLocale->iDateFormat=LCountry::DateFormat;
 | 
|  |     38 | 	aLocale->iTimeFormat=LCountry::TimeFormat;
 | 
|  |     39 | 	aLocale->iCurrencySymbolPosition=LCountry::CurrencySymbolPosition;
 | 
|  |     40 | 	aLocale->iCurrencySpaceBetween=LCountry::CurrencySpaceBetween;
 | 
|  |     41 | 	aLocale->iCurrencyDecimalPlaces=LCountry::CurrencyDecimalPlaces;
 | 
|  |     42 | 	aLocale->iNegativeCurrencyFormat=(TNegativeCurrencyFormat)LCountry::CurrencyNegativeInBrackets;
 | 
|  |     43 | 	aLocale->iCurrencyTriadsAllowed=LCountry::CurrencyTriadsAllowed;
 | 
|  |     44 | 	aLocale->iThousandsSeparator=*LCountry::ThousandsSeparator;
 | 
|  |     45 | 	aLocale->iDecimalSeparator=*LCountry::DecimalSeparator;
 | 
|  |     46 | 	TInt i=0;
 | 
|  |     47 | 	for(;i<KMaxDateSeparators;i++)
 | 
|  |     48 | 		aLocale->iDateSeparator[i]=*LCountry::DateSeparator[i];
 | 
|  |     49 | 	for(i=0;i<KMaxTimeSeparators;i++)
 | 
|  |     50 | 		aLocale->iTimeSeparator[i]=*LCountry::TimeSeparator[i];
 | 
|  |     51 | 	aLocale->iAmPmSymbolPosition=LCountry::AmPmSymbolPosition;
 | 
|  |     52 | 	aLocale->iAmPmSpaceBetween=LCountry::AmPmSpaceBetween;
 | 
|  |     53 | //	aLocale->iDaylightSaving=LCountry::DaylightSaving;
 | 
|  |     54 | 	aLocale->iHomeDaylightSavingZone=LCountry::HomeDaylightSavingZone;
 | 
|  |     55 | 	aLocale->iWorkDays=LCountry::WorkDays;
 | 
|  |     56 | 	aLocale->iStartOfWeek=LCountry::StartOfWeek;
 | 
|  |     57 | 	aLocale->iClockFormat=LCountry::ClockFormat;
 | 
|  |     58 | 	aLocale->iUnitsGeneral=LCountry::UnitsGeneral;
 | 
|  |     59 | 	aLocale->iUnitsDistanceLong=LCountry::UnitsGeneral;
 | 
|  |     60 | 	aLocale->iUnitsDistanceShort=LCountry::UnitsGeneral;
 | 
|  |     61 | 	}
 | 
|  |     62 | 
 | 
|  |     63 | EXPORT_C const TText * Locl::CurrencySymbol()
 | 
|  |     64 | //
 | 
|  |     65 | // Returns the address of the currency symbol.
 | 
|  |     66 | //
 | 
|  |     67 | 	{
 | 
|  |     68 | 
 | 
|  |     69 | 	return(LCountry::CurrencySymbol);
 | 
|  |     70 | 	}
 | 
|  |     71 | 
 | 
|  |     72 | EXPORT_C const TText* Locl::ShortDateFormatSpec()
 | 
|  |     73 | //
 | 
|  |     74 | // Returns the address of the short date format.
 | 
|  |     75 | //
 | 
|  |     76 | 	{
 | 
|  |     77 | 
 | 
|  |     78 | 	return(LCountry::ShortDateFormatSpec);
 | 
|  |     79 | 	}
 | 
|  |     80 | 
 | 
|  |     81 | EXPORT_C const TText* Locl::LongDateFormatSpec()
 | 
|  |     82 | //
 | 
|  |     83 | // Returns the address of the long date format.
 | 
|  |     84 | //
 | 
|  |     85 | 	{
 | 
|  |     86 | 
 | 
|  |     87 | 	return(LCountry::LongDateFormatSpec);
 | 
|  |     88 | 	}
 | 
|  |     89 | 
 | 
|  |     90 | EXPORT_C const TText* Locl::TimeFormatSpec()
 | 
|  |     91 | //
 | 
|  |     92 | // Returns the address of the long date format.
 | 
|  |     93 | //
 | 
|  |     94 | 	{
 | 
|  |     95 | 
 | 
|  |     96 | 	return(LCountry::TimeFormatSpec);
 | 
|  |     97 | 	}
 | 
|  |     98 | 
 | 
|  |     99 | EXPORT_C const TFatUtilityFunctions* Locl::FatUtilityFunctions()
 | 
|  |    100 | //
 | 
|  |    101 | // Returns the addresses of the FAT utility functions.
 | 
|  |    102 | //
 | 
|  |    103 | 	{
 | 
|  |    104 | 
 | 
|  |    105 | 	return(LCountry::FatUtilityFunctions);
 | 
|  |    106 | 	}
 | 
|  |    107 | 
 | 
|  |    108 | EXPORT_C const TText * const * Locl::DateSuffixTable()
 | 
|  |    109 | //
 | 
|  |    110 | // Returns the address of the date suffix table.
 | 
|  |    111 | //
 | 
|  |    112 | 	{
 | 
|  |    113 | 
 | 
|  |    114 | 	return(&LLanguage::DateSuffixTable[0]);
 | 
|  |    115 | 	}
 | 
|  |    116 | 
 | 
|  |    117 | EXPORT_C const TText * const * Locl::DayTable()
 | 
|  |    118 | //
 | 
|  |    119 | // Returns the address of the day table.
 | 
|  |    120 | //
 | 
|  |    121 | 	{
 | 
|  |    122 | 
 | 
|  |    123 | 	return(&LLanguage::DayTable[0]);
 | 
|  |    124 | 	}
 | 
|  |    125 | 
 | 
|  |    126 | EXPORT_C const TText * const * Locl::DayAbbTable()
 | 
|  |    127 | //
 | 
|  |    128 | // Returns the address of the abbreviated day table.
 | 
|  |    129 | //
 | 
|  |    130 | 	{
 | 
|  |    131 | 
 | 
|  |    132 | 	return(&LLanguage::DayAbbTable[0]);
 | 
|  |    133 | 	}
 | 
|  |    134 | 
 | 
|  |    135 | EXPORT_C const TText * const * Locl::MonthTable()
 | 
|  |    136 | //
 | 
|  |    137 | // Returns the address of the month table.
 | 
|  |    138 | //
 | 
|  |    139 | 	{
 | 
|  |    140 | 
 | 
|  |    141 | 	return(&LLanguage::MonthTable[0]);
 | 
|  |    142 | 	}
 | 
|  |    143 | 
 | 
|  |    144 | EXPORT_C const TText * const * Locl::MonthAbbTable()
 | 
|  |    145 | //
 | 
|  |    146 | // Returns the address of the abbreviated month table.
 | 
|  |    147 | //
 | 
|  |    148 | 	{
 | 
|  |    149 | 
 | 
|  |    150 | 	return(&LLanguage::MonthAbbTable[0]);
 | 
|  |    151 | 	}
 | 
|  |    152 | 
 | 
|  |    153 | EXPORT_C const TText * const * Locl::AmPmTable()
 | 
|  |    154 | //
 | 
|  |    155 | // Returns the address of the AmPm table.
 | 
|  |    156 | //
 | 
|  |    157 | 	{
 | 
|  |    158 | 
 | 
|  |    159 | 	return(&LLanguage::AmPmTable[0]);
 | 
|  |    160 | 	}
 | 
|  |    161 | 
 | 
|  |    162 | EXPORT_C const TText * const * Locl::MsgTable()
 | 
|  |    163 | //
 | 
|  |    164 | // Returns the address of the message table.
 | 
|  |    165 | //
 | 
|  |    166 | 	{
 | 
|  |    167 | 
 | 
|  |    168 | 	return(&LMessages::MsgTable[0]);
 | 
|  |    169 | 	}
 | 
|  |    170 | 
 | 
|  |    171 | // Return the address of the locale character set object: contains collation rules etc.
 | 
|  |    172 | EXPORT_C const LCharSet* Locl::CharSet()
 | 
|  |    173 | 	{
 | 
|  |    174 | 	#ifdef _UNICODE
 | 
|  |    175 | 		return &TheCharSet;
 | 
|  |    176 | 	#else
 | 
|  |    177 | 		return NULL;
 | 
|  |    178 | 	#endif
 | 
|  |    179 | 	}
 | 
|  |    180 | 
 | 
|  |    181 | // The functions returning locale-specific character attribute tables do not exist in the Unicode build.
 | 
|  |    182 | EXPORT_C const TUint8 * Locl::TypeTable()
 | 
|  |    183 | //
 | 
|  |    184 | // Return the address of the type table.
 | 
|  |    185 | //
 | 
|  |    186 | 	{
 | 
|  |    187 | 	#ifdef _UNICODE
 | 
|  |    188 | 		return NULL;
 | 
|  |    189 | 	#else
 | 
|  |    190 | 		return(&LAlphabet::TypeTable[0]);
 | 
|  |    191 | 	#endif 		
 | 
|  |    192 | 	}
 | 
|  |    193 | 
 | 
|  |    194 | 
 | 
|  |    195 | EXPORT_C const TText * Locl::UpperTable()
 | 
|  |    196 | //
 | 
|  |    197 | // Return the address of the upper table.
 | 
|  |    198 | //
 | 
|  |    199 | 	{
 | 
|  |    200 | 	#ifdef _UNICODE
 | 
|  |    201 | 		return NULL;
 | 
|  |    202 | 	#else
 | 
|  |    203 | 		return(&LAlphabet::UpperTable[0]);
 | 
|  |    204 | 	#endif 
 | 
|  |    205 | 
 | 
|  |    206 | 	}
 | 
|  |    207 | 
 | 
|  |    208 | 
 | 
|  |    209 | EXPORT_C const TText * Locl::LowerTable()
 | 
|  |    210 | //
 | 
|  |    211 | // Return the address of the lower table.
 | 
|  |    212 | //
 | 
|  |    213 | 	{
 | 
|  |    214 | 	#ifdef _UNICODE
 | 
|  |    215 | 		return NULL;
 | 
|  |    216 | 	#else
 | 
|  |    217 | 		return(&LAlphabet::LowerTable[0]);
 | 
|  |    218 | 	#endif 
 | 
|  |    219 | 	}
 | 
|  |    220 | 
 | 
|  |    221 | 
 | 
|  |    222 | EXPORT_C const TText * Locl::FoldTable()
 | 
|  |    223 | //
 | 
|  |    224 | // Return the address of the fold table.
 | 
|  |    225 | //
 | 
|  |    226 | 	{
 | 
|  |    227 | 	#ifdef _UNICODE
 | 
|  |    228 | 		return NULL;
 | 
|  |    229 | 	#else
 | 
|  |    230 | 		return(&LAlphabet::FoldTable[0]);
 | 
|  |    231 | 	#endif 
 | 
|  |    232 | 	}
 | 
|  |    233 | 
 | 
|  |    234 | EXPORT_C const TText * Locl::CollTable()
 | 
|  |    235 | //
 | 
|  |    236 | // Return the address of the collate table.
 | 
|  |    237 | //
 | 
|  |    238 | 	{
 | 
|  |    239 | 	#ifdef _UNICODE
 | 
|  |    240 | 		return NULL;
 | 
|  |    241 | 	#else
 | 
|  |    242 | 		return(&LAlphabet::CollTable[0]);
 | 
|  |    243 | 	#endif 
 | 
|  |    244 | 	}
 | 
|  |    245 | 
 | 
|  |    246 | EXPORT_C TBool Locl::UniCode()
 | 
|  |    247 | //
 | 
|  |    248 | // Returns ETrue for Unicode Build 
 | 
|  |    249 | //
 | 
|  |    250 | 	{
 | 
|  |    251 | 	#ifdef _UNICODE
 | 
|  |    252 | 		return ETrue;
 | 
|  |    253 | 	#else
 | 
|  |    254 | 		return EFalse;
 | 
|  |    255 | 	#endif 
 | 
|  |    256 | 	}
 | 
|  |    257 | 
 |