|
ICU 73.2
73.2
|
00001 // © 2016 and later: Unicode, Inc. and others. 00002 // License & terms of use: http://www.unicode.org/copyright.html 00003 /* 00004 ******************************************************************************* 00005 * Copyright (C) 2010-2016, International Business Machines Corporation and 00006 * others. All Rights Reserved. 00007 ******************************************************************************* 00008 */ 00009 00010 #ifndef __ULDNAMES_H__ 00011 #define __ULDNAMES_H__ 00012 00018 #include "unicode/utypes.h" 00019 #include "unicode/uscript.h" 00020 #include "unicode/udisplaycontext.h" 00021 00022 #if U_SHOW_CPLUSPLUS_API 00023 #include "unicode/localpointer.h" 00024 #endif // U_SHOW_CPLUSPLUS_API 00025 00030 typedef enum { 00036 ULDN_STANDARD_NAMES = 0, 00042 ULDN_DIALECT_NAMES 00043 } UDialectHandling; 00044 00049 struct ULocaleDisplayNames; 00050 00055 typedef struct ULocaleDisplayNames ULocaleDisplayNames; 00056 00057 #if !UCONFIG_NO_FORMATTING 00058 00071 U_CAPI ULocaleDisplayNames * U_EXPORT2 00072 uldn_open(const char * locale, 00073 UDialectHandling dialectHandling, 00074 UErrorCode *pErrorCode); 00075 00081 U_CAPI void U_EXPORT2 00082 uldn_close(ULocaleDisplayNames *ldn); 00083 00084 #if U_SHOW_CPLUSPLUS_API 00085 00086 U_NAMESPACE_BEGIN 00087 00097 U_DEFINE_LOCAL_OPEN_POINTER(LocalULocaleDisplayNamesPointer, ULocaleDisplayNames, uldn_close); 00098 00099 U_NAMESPACE_END 00100 00101 #endif 00102 00103 /* getters for state */ 00104 00112 U_CAPI const char * U_EXPORT2 00113 uldn_getLocale(const ULocaleDisplayNames *ldn); 00114 00121 U_CAPI UDialectHandling U_EXPORT2 00122 uldn_getDialectHandling(const ULocaleDisplayNames *ldn); 00123 00124 /* names for entire locales */ 00125 00137 U_CAPI int32_t U_EXPORT2 00138 uldn_localeDisplayName(const ULocaleDisplayNames *ldn, 00139 const char *locale, 00140 UChar *result, 00141 int32_t maxResultSize, 00142 UErrorCode *pErrorCode); 00143 00144 /* names for components of a locale */ 00145 00157 U_CAPI int32_t U_EXPORT2 00158 uldn_languageDisplayName(const ULocaleDisplayNames *ldn, 00159 const char *lang, 00160 UChar *result, 00161 int32_t maxResultSize, 00162 UErrorCode *pErrorCode); 00163 00175 U_CAPI int32_t U_EXPORT2 00176 uldn_scriptDisplayName(const ULocaleDisplayNames *ldn, 00177 const char *script, 00178 UChar *result, 00179 int32_t maxResultSize, 00180 UErrorCode *pErrorCode); 00181 00193 U_CAPI int32_t U_EXPORT2 00194 uldn_scriptCodeDisplayName(const ULocaleDisplayNames *ldn, 00195 UScriptCode scriptCode, 00196 UChar *result, 00197 int32_t maxResultSize, 00198 UErrorCode *pErrorCode); 00199 00211 U_CAPI int32_t U_EXPORT2 00212 uldn_regionDisplayName(const ULocaleDisplayNames *ldn, 00213 const char *region, 00214 UChar *result, 00215 int32_t maxResultSize, 00216 UErrorCode *pErrorCode); 00217 00229 U_CAPI int32_t U_EXPORT2 00230 uldn_variantDisplayName(const ULocaleDisplayNames *ldn, 00231 const char *variant, 00232 UChar *result, 00233 int32_t maxResultSize, 00234 UErrorCode *pErrorCode); 00235 00247 U_CAPI int32_t U_EXPORT2 00248 uldn_keyDisplayName(const ULocaleDisplayNames *ldn, 00249 const char *key, 00250 UChar *result, 00251 int32_t maxResultSize, 00252 UErrorCode *pErrorCode); 00253 00266 U_CAPI int32_t U_EXPORT2 00267 uldn_keyValueDisplayName(const ULocaleDisplayNames *ldn, 00268 const char *key, 00269 const char *value, 00270 UChar *result, 00271 int32_t maxResultSize, 00272 UErrorCode *pErrorCode); 00273 00288 U_CAPI ULocaleDisplayNames * U_EXPORT2 00289 uldn_openForContext(const char * locale, UDisplayContext *contexts, 00290 int32_t length, UErrorCode *pErrorCode); 00291 00302 U_CAPI UDisplayContext U_EXPORT2 00303 uldn_getContext(const ULocaleDisplayNames *ldn, UDisplayContextType type, 00304 UErrorCode *pErrorCode); 00305 00306 #endif /* !UCONFIG_NO_FORMATTING */ 00307 #endif /* __ULDNAMES_H__ */
1.7.6.1