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