ICU 56.1: locdspnm.h Source File

ICU 56.1 56.1

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

- File List
- Globals

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
UDisplayContext
UDisplayContext
Display context settings.
Definition: udisplaycontext.h:56
UScriptCode
UScriptCode
Constants for ISO 15924 script codes.
Definition: uscript.h:52
udisplaycontext.h
C API: Display context types (enum values)
uscript.h
C API: Unicode Script Information.
U_I18N_API
#define U_I18N_API
Set to export library symbols from inside the i18n library, and to import them from outside...
Definition: utypes.h:358
U_NAMESPACE_BEGIN
#define U_NAMESPACE_BEGIN
This is used to begin a declaration of a public ICU C++ API.
Definition: uversion.h:129
ULDN_STANDARD_NAMES
Use standard names when generating a locale name, e.g.
Definition: uldnames.h:31
UDialectHandling
UDialectHandling
Enum used in LocaleDisplayNames::createInstance.
Definition: uldnames.h:25
U_NAMESPACE_END
#define U_NAMESPACE_END
This is used to end a declaration of a public ICU C++ API.
Definition: uversion.h:130
UDisplayContextType
UDisplayContextType
Display context types, for getting values of a particular setting.
Definition: udisplaycontext.h:25
locid.h
C++ API: Locale ID object.
utypes.h
Basic definitions for ICU, for both C and C++ APIs.
icu::UnicodeString
UnicodeString is a string class that stores Unicode characters directly and provides similar function...
Definition: unistr.h:293
icu::LocaleDisplayNames
Returns display names of Locales and components of Locales.
Definition: locdspnm.h:33
icu::UObject
UObject is the common ICU "boilerplate" class.
Definition: uobject.h:221
uldnames.h
C API: Provides display names of Locale ids and their components.
icu::Locale
A Locale object represents a specific geographical, political, or cultural region.
Definition: locid.h:185