ICU 4.4.2 4.4.2
|
00001 /* 00002 ********************************************************************** 00003 * Copyright (C) 1997-2010, International Business Machines 00004 * Corporation and others. All Rights Reserved. 00005 ********************************************************************** 00006 * 00007 * File ULOC.H 00008 * 00009 * Modification History: 00010 * 00011 * Date Name Description 00012 * 04/01/97 aliu Creation. 00013 * 08/22/98 stephen JDK 1.2 sync. 00014 * 12/08/98 rtg New C API for Locale 00015 * 03/30/99 damiba overhaul 00016 * 03/31/99 helena Javadoc for uloc functions. 00017 * 04/15/99 Madhu Updated Javadoc 00018 ******************************************************************************** 00019 */ 00020 00021 #ifndef ULOC_H 00022 #define ULOC_H 00023 00024 #include "unicode/utypes.h" 00025 #include "unicode/uenum.h" 00026 00201 #define ULOC_CHINESE "zh" 00202 00203 #define ULOC_ENGLISH "en" 00204 00205 #define ULOC_FRENCH "fr" 00206 00207 #define ULOC_GERMAN "de" 00208 00209 #define ULOC_ITALIAN "it" 00210 00211 #define ULOC_JAPANESE "ja" 00212 00213 #define ULOC_KOREAN "ko" 00214 00215 #define ULOC_SIMPLIFIED_CHINESE "zh_CN" 00216 00217 #define ULOC_TRADITIONAL_CHINESE "zh_TW" 00218 00220 #define ULOC_CANADA "en_CA" 00221 00222 #define ULOC_CANADA_FRENCH "fr_CA" 00223 00224 #define ULOC_CHINA "zh_CN" 00225 00226 #define ULOC_PRC "zh_CN" 00227 00228 #define ULOC_FRANCE "fr_FR" 00229 00230 #define ULOC_GERMANY "de_DE" 00231 00232 #define ULOC_ITALY "it_IT" 00233 00234 #define ULOC_JAPAN "ja_JP" 00235 00236 #define ULOC_KOREA "ko_KR" 00237 00238 #define ULOC_TAIWAN "zh_TW" 00239 00240 #define ULOC_UK "en_GB" 00241 00242 #define ULOC_US "en_US" 00243 00249 #define ULOC_LANG_CAPACITY 12 00250 00256 #define ULOC_COUNTRY_CAPACITY 4 00257 00262 #define ULOC_FULLNAME_CAPACITY 157 00263 00269 #define ULOC_SCRIPT_CAPACITY 6 00270 00275 #define ULOC_KEYWORDS_CAPACITY 50 00276 00281 #define ULOC_KEYWORD_AND_VALUES_CAPACITY 100 00282 00288 #define ULOC_KEYWORD_SEPARATOR '@' 00289 00293 #define ULOC_KEYWORD_ASSIGN '=' 00294 00298 #define ULOC_KEYWORD_ITEM_SEPARATOR ';' 00299 00314 typedef enum { 00318 ULOC_ACTUAL_LOCALE = 0, 00322 ULOC_VALID_LOCALE = 1, 00323 00324 #ifndef U_HIDE_DEPRECATED_API 00325 00328 ULOC_REQUESTED_LOCALE = 2, 00329 #endif /* U_HIDE_DEPRECATED_API */ 00330 00331 ULOC_DATA_LOCALE_TYPE_LIMIT = 3 00332 } ULocDataLocaleType ; 00333 00334 00346 U_STABLE const char* U_EXPORT2 00347 uloc_getDefault(void); 00348 00366 U_STABLE void U_EXPORT2 00367 uloc_setDefault(const char* localeID, 00368 UErrorCode* status); 00369 00382 U_STABLE int32_t U_EXPORT2 00383 uloc_getLanguage(const char* localeID, 00384 char* language, 00385 int32_t languageCapacity, 00386 UErrorCode* err); 00387 00400 U_STABLE int32_t U_EXPORT2 00401 uloc_getScript(const char* localeID, 00402 char* script, 00403 int32_t scriptCapacity, 00404 UErrorCode* err); 00405 00418 U_STABLE int32_t U_EXPORT2 00419 uloc_getCountry(const char* localeID, 00420 char* country, 00421 int32_t countryCapacity, 00422 UErrorCode* err); 00423 00436 U_STABLE int32_t U_EXPORT2 00437 uloc_getVariant(const char* localeID, 00438 char* variant, 00439 int32_t variantCapacity, 00440 UErrorCode* err); 00441 00442 00459 U_STABLE int32_t U_EXPORT2 00460 uloc_getName(const char* localeID, 00461 char* name, 00462 int32_t nameCapacity, 00463 UErrorCode* err); 00464 00482 U_STABLE int32_t U_EXPORT2 00483 uloc_canonicalize(const char* localeID, 00484 char* name, 00485 int32_t nameCapacity, 00486 UErrorCode* err); 00487 00495 U_STABLE const char* U_EXPORT2 00496 uloc_getISO3Language(const char* localeID); 00497 00498 00506 U_STABLE const char* U_EXPORT2 00507 uloc_getISO3Country(const char* localeID); 00508 00517 U_STABLE uint32_t U_EXPORT2 00518 uloc_getLCID(const char* localeID); 00519 00536 U_STABLE int32_t U_EXPORT2 00537 uloc_getDisplayLanguage(const char* locale, 00538 const char* displayLocale, 00539 UChar* language, 00540 int32_t languageCapacity, 00541 UErrorCode* status); 00542 00559 U_STABLE int32_t U_EXPORT2 00560 uloc_getDisplayScript(const char* locale, 00561 const char* displayLocale, 00562 UChar* script, 00563 int32_t scriptCapacity, 00564 UErrorCode* status); 00565 00582 U_STABLE int32_t U_EXPORT2 00583 uloc_getDisplayCountry(const char* locale, 00584 const char* displayLocale, 00585 UChar* country, 00586 int32_t countryCapacity, 00587 UErrorCode* status); 00588 00589 00606 U_STABLE int32_t U_EXPORT2 00607 uloc_getDisplayVariant(const char* locale, 00608 const char* displayLocale, 00609 UChar* variant, 00610 int32_t variantCapacity, 00611 UErrorCode* status); 00612 00653 U_STABLE int32_t U_EXPORT2 00654 uloc_getDisplayKeyword(const char* keyword, 00655 const char* displayLocale, 00656 UChar* dest, 00657 int32_t destCapacity, 00658 UErrorCode* status); 00679 U_STABLE int32_t U_EXPORT2 00680 uloc_getDisplayKeywordValue( const char* locale, 00681 const char* keyword, 00682 const char* displayLocale, 00683 UChar* dest, 00684 int32_t destCapacity, 00685 UErrorCode* status); 00702 U_STABLE int32_t U_EXPORT2 00703 uloc_getDisplayName(const char* localeID, 00704 const char* inLocaleID, 00705 UChar* result, 00706 int32_t maxResultSize, 00707 UErrorCode* err); 00708 00709 00720 U_STABLE const char* U_EXPORT2 00721 uloc_getAvailable(int32_t n); 00722 00729 U_STABLE int32_t U_EXPORT2 uloc_countAvailable(void); 00730 00740 U_STABLE const char* const* U_EXPORT2 00741 uloc_getISOLanguages(void); 00742 00752 U_STABLE const char* const* U_EXPORT2 00753 uloc_getISOCountries(void); 00754 00768 U_STABLE int32_t U_EXPORT2 00769 uloc_getParent(const char* localeID, 00770 char* parent, 00771 int32_t parentCapacity, 00772 UErrorCode* err); 00773 00774 00775 00776 00796 U_STABLE int32_t U_EXPORT2 00797 uloc_getBaseName(const char* localeID, 00798 char* name, 00799 int32_t nameCapacity, 00800 UErrorCode* err); 00801 00811 U_STABLE UEnumeration* U_EXPORT2 00812 uloc_openKeywords(const char* localeID, 00813 UErrorCode* status); 00814 00826 U_STABLE int32_t U_EXPORT2 00827 uloc_getKeywordValue(const char* localeID, 00828 const char* keywordName, 00829 char* buffer, int32_t bufferCapacity, 00830 UErrorCode* status); 00831 00832 00852 U_STABLE int32_t U_EXPORT2 00853 uloc_setKeywordValue(const char* keywordName, 00854 const char* keywordValue, 00855 char* buffer, int32_t bufferCapacity, 00856 UErrorCode* status); 00857 00863 typedef enum { 00864 ULOC_LAYOUT_LTR = 0, /* left-to-right. */ 00865 ULOC_LAYOUT_RTL = 1, /* right-to-left. */ 00866 ULOC_LAYOUT_TTB = 2, /* top-to-bottom. */ 00867 ULOC_LAYOUT_BTT = 3, /* bottom-to-top. */ 00868 ULOC_LAYOUT_UNKNOWN 00869 } ULayoutType; 00870 00879 U_STABLE ULayoutType U_EXPORT2 00880 uloc_getCharacterOrientation(const char* localeId, 00881 UErrorCode *status); 00882 00891 U_STABLE ULayoutType U_EXPORT2 00892 uloc_getLineOrientation(const char* localeId, 00893 UErrorCode *status); 00894 00901 typedef enum { 00902 ULOC_ACCEPT_FAILED = 0, /* No exact match was found. */ 00903 ULOC_ACCEPT_VALID = 1, /* An exact match was found. */ 00904 ULOC_ACCEPT_FALLBACK = 2 /* A fallback was found, for example, 00905 Accept list contained 'ja_JP' 00906 which matched available locale 'ja'. */ 00907 } UAcceptResult; 00908 00909 00922 U_STABLE int32_t U_EXPORT2 00923 uloc_acceptLanguageFromHTTP(char *result, int32_t resultAvailable, 00924 UAcceptResult *outResult, 00925 const char *httpAcceptLanguage, 00926 UEnumeration* availableLocales, 00927 UErrorCode *status); 00928 00942 U_STABLE int32_t U_EXPORT2 00943 uloc_acceptLanguage(char *result, int32_t resultAvailable, 00944 UAcceptResult *outResult, const char **acceptList, 00945 int32_t acceptListCount, 00946 UEnumeration* availableLocales, 00947 UErrorCode *status); 00948 00949 00962 U_STABLE int32_t U_EXPORT2 00963 uloc_getLocaleForLCID(uint32_t hostID, char *locale, int32_t localeCapacity, 00964 UErrorCode *status); 00965 00966 01000 U_STABLE int32_t U_EXPORT2 01001 uloc_addLikelySubtags(const char* localeID, 01002 char* maximizedLocaleID, 01003 int32_t maximizedLocaleIDCapacity, 01004 UErrorCode* err); 01005 01006 01040 U_STABLE int32_t U_EXPORT2 01041 uloc_minimizeSubtags(const char* localeID, 01042 char* minimizedLocaleID, 01043 int32_t minimizedLocaleIDCapacity, 01044 UErrorCode* err); 01045 01069 U_DRAFT int32_t U_EXPORT2 01070 uloc_forLanguageTag(const char* langtag, 01071 char* localeID, 01072 int32_t localeIDCapacity, 01073 int32_t* parsedLength, 01074 UErrorCode* err); 01075 01097 U_DRAFT int32_t U_EXPORT2 01098 uloc_toLanguageTag(const char* localeID, 01099 char* langtag, 01100 int32_t langtagCapacity, 01101 UBool strict, 01102 UErrorCode* err); 01103 01104 #endif /*_ULOC*/