uloc.h

Go to the documentation of this file.
00001 /*
00002 **********************************************************************
00003 *   Copyright (C) 1997-2006, 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 56
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 
00864 typedef enum {
00865   ULOC_ACCEPT_FAILED   = 0,  /* No exact match was found. */
00866   ULOC_ACCEPT_VALID    = 1,  /* An exact match was found. */
00867   ULOC_ACCEPT_FALLBACK = 2   /* A fallback was found, for example, 
00868                                 Accept list contained 'ja_JP'
00869                                 which matched available locale 'ja'. */
00870 } UAcceptResult;
00871 
00872 
00885 U_STABLE int32_t U_EXPORT2
00886 uloc_acceptLanguageFromHTTP(char *result, int32_t resultAvailable,
00887                             UAcceptResult *outResult,
00888                             const char *httpAcceptLanguage,
00889                             UEnumeration* availableLocales,
00890                             UErrorCode *status);
00891 
00905 U_STABLE int32_t U_EXPORT2
00906 uloc_acceptLanguage(char *result, int32_t resultAvailable, 
00907                     UAcceptResult *outResult, const char **acceptList,
00908                     int32_t acceptListCount,
00909                     UEnumeration* availableLocales,
00910                     UErrorCode *status);
00911 
00912 
00913 #endif /*_ULOC*/
00914 
00915 

Generated on Mon Aug 13 07:17:24 2007 for ICU 3.6 by  doxygen 1.5.2