ICU 55.1 55.1

- Main Page
- Related Pages
- Modules
- Namespaces
- Data Structures
- Files

- File List
- Globals

All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
locdspnm.h
Go to the documentation of this file.
1 /*
2 ******************************************************************************
3 * Copyright (C) 2010-2014, International Business Machines Corporation and
4 * others. All Rights Reserved.
5 ******************************************************************************
6 */
7
8 #ifndef LOCDSPNM_H
9 #define LOCDSPNM_H
10
11 #include "unicode/utypes.h"
12
18 #if !UCONFIG_NO_FORMATTING
19
20 #include "unicode/locid.h"
21 #include "unicode/uscript.h"
22 #include "unicode/uldnames.h"
23 #include "unicode/udisplaycontext.h"
24
25 U_NAMESPACE_BEGIN
26
33 class U_I18N_API LocaleDisplayNames : public UObject {
34 public:
39 virtual ~LocaleDisplayNames();
40
49 static LocaleDisplayNames* U_EXPORT2 createInstance(const Locale& locale);
50
61 static LocaleDisplayNames* U_EXPORT2 createInstance(const Locale& locale,
62 UDialectHandling dialectHandling);
63
75 static LocaleDisplayNames* U_EXPORT2 createInstance(const Locale& locale,
76 UDisplayContext *contexts, int32_t length);
77
78 // getters for state
85 virtual const Locale& getLocale() const = 0;
86
92 virtual UDialectHandling getDialectHandling() const = 0;
93
100 virtual UDisplayContext getContext(UDisplayContextType type) const = 0;
101
102 // names for entire locales
110 virtual UnicodeString& localeDisplayName(const Locale& locale,
111 UnicodeString& result) const = 0;
112
120 virtual UnicodeString& localeDisplayName(const char* localeId,
121 UnicodeString& result) const = 0;
122
123 // names for components of a locale id
131 virtual UnicodeString& languageDisplayName(const char* lang,
132 UnicodeString& result) const = 0;
133
141 virtual UnicodeString& scriptDisplayName(const char* script,
142 UnicodeString& result) const = 0;
143
151 virtual UnicodeString& scriptDisplayName(UScriptCode scriptCode,
152 UnicodeString& result) const = 0;
153
161 virtual UnicodeString& regionDisplayName(const char* region,
162 UnicodeString& result) const = 0;
163
171 virtual UnicodeString& variantDisplayName(const char* variant,
172 UnicodeString& result) const = 0;
173
181 virtual UnicodeString& keyDisplayName(const char* key,
182 UnicodeString& result) const = 0;
183
192 virtual UnicodeString& keyValueDisplayName(const char* key, const char* value,
193 UnicodeString& result) const = 0;
194 };
195
196 inline LocaleDisplayNames* LocaleDisplayNames::createInstance(const Locale& locale) {
197 return LocaleDisplayNames::createInstance(locale, ULDN_STANDARD_NAMES);
198 }
199
200 U_NAMESPACE_END
201
202 #endif
203
204 #endif