]>
Commit | Line | Data |
---|---|---|
f3c0d7a5 A |
1 | // © 2016 and later: Unicode, Inc. and others. |
2 | // License & terms of use: http://www.unicode.org/copyright.html | |
51004dcb A |
3 | /* |
4 | ***************************************************************************************** | |
2ca993e8 | 5 | * Copyright (C) 2014-2016, International Business Machines |
51004dcb A |
6 | * Corporation and others. All Rights Reserved. |
7 | ***************************************************************************************** | |
8 | */ | |
9 | ||
10 | #ifndef UDISPLAYCONTEXT_H | |
11 | #define UDISPLAYCONTEXT_H | |
12 | ||
13 | #include "unicode/utypes.h" | |
14 | ||
15 | #if !UCONFIG_NO_FORMATTING | |
16 | ||
57a6839d A |
17 | /** |
18 | * \file | |
19 | * \brief C API: Display context types (enum values) | |
20 | */ | |
21 | ||
51004dcb A |
22 | /** |
23 | * Display context types, for getting values of a particular setting. | |
24 | * Note, the specific numeric values are internal and may change. | |
57a6839d | 25 | * @stable ICU 51 |
51004dcb A |
26 | */ |
27 | enum UDisplayContextType { | |
51004dcb A |
28 | /** |
29 | * Type to retrieve the dialect handling setting, e.g. | |
30 | * UDISPCTX_STANDARD_NAMES or UDISPCTX_DIALECT_NAMES. | |
57a6839d | 31 | * @stable ICU 51 |
51004dcb A |
32 | */ |
33 | UDISPCTX_TYPE_DIALECT_HANDLING = 0, | |
34 | /** | |
35 | * Type to retrieve the capitalization context setting, e.g. | |
36 | * UDISPCTX_CAPITALIZATION_NONE, UDISPCTX_CAPITALIZATION_FOR_MIDDLE_OF_SENTENCE, | |
37 | * UDISPCTX_CAPITALIZATION_FOR_BEGINNING_OF_SENTENCE, etc. | |
57a6839d A |
38 | * @stable ICU 51 |
39 | */ | |
2ca993e8 | 40 | UDISPCTX_TYPE_CAPITALIZATION = 1, |
b331163b A |
41 | /** |
42 | * Type to retrieve the display length setting, e.g. | |
43 | * UDISPCTX_LENGTH_FULL, UDISPCTX_LENGTH_SHORT. | |
2ca993e8 | 44 | * @stable ICU 54 |
b331163b | 45 | */ |
f3c0d7a5 | 46 | UDISPCTX_TYPE_DISPLAY_LENGTH = 2, |
f3c0d7a5 A |
47 | /** |
48 | * Type to retrieve the substitute handling setting, e.g. | |
49 | * UDISPCTX_SUBSTITUTE, UDISPCTX_NO_SUBSTITUTE. | |
0f5d89e8 | 50 | * @stable ICU 58 |
f3c0d7a5 A |
51 | */ |
52 | UDISPCTX_TYPE_SUBSTITUTE_HANDLING = 3 | |
57a6839d | 53 | #ifndef U_HIDE_INTERNAL_API |
b331163b | 54 | , |
57a6839d | 55 | /** |
b331163b A |
56 | * Apple-specific type to retrieve the display length setting, e.g. |
57 | * UADISPCTX_LENGTH_STANDARD, UADISPCTX_LENGTH_SHORT | |
57a6839d | 58 | * @internal ICU 54 |
51004dcb | 59 | */ |
57a6839d A |
60 | UADISPCTX_TYPE_LENGTH = 32, |
61 | #endif /* U_HIDE_INTERNAL_API */ | |
51004dcb A |
62 | }; |
63 | /** | |
57a6839d | 64 | * @stable ICU 51 |
51004dcb A |
65 | */ |
66 | typedef enum UDisplayContextType UDisplayContextType; | |
67 | ||
51004dcb A |
68 | /** |
69 | * Display context settings. | |
70 | * Note, the specific numeric values are internal and may change. | |
57a6839d | 71 | * @stable ICU 51 |
51004dcb A |
72 | */ |
73 | enum UDisplayContext { | |
51004dcb A |
74 | /** |
75 | * ================================ | |
76 | * DIALECT_HANDLING can be set to one of UDISPCTX_STANDARD_NAMES or | |
77 | * UDISPCTX_DIALECT_NAMES. Use UDisplayContextType UDISPCTX_TYPE_DIALECT_HANDLING | |
78 | * to get the value. | |
79 | */ | |
80 | /** | |
81 | * A possible setting for DIALECT_HANDLING: | |
82 | * use standard names when generating a locale name, | |
83 | * e.g. en_GB displays as 'English (United Kingdom)'. | |
57a6839d | 84 | * @stable ICU 51 |
51004dcb A |
85 | */ |
86 | UDISPCTX_STANDARD_NAMES = (UDISPCTX_TYPE_DIALECT_HANDLING<<8) + 0, | |
87 | /** | |
88 | * A possible setting for DIALECT_HANDLING: | |
89 | * use dialect names, when generating a locale name, | |
90 | * e.g. en_GB displays as 'British English'. | |
57a6839d | 91 | * @stable ICU 51 |
51004dcb A |
92 | */ |
93 | UDISPCTX_DIALECT_NAMES = (UDISPCTX_TYPE_DIALECT_HANDLING<<8) + 1, | |
94 | /** | |
95 | * ================================ | |
96 | * CAPITALIZATION can be set to one of UDISPCTX_CAPITALIZATION_NONE, | |
97 | * UDISPCTX_CAPITALIZATION_FOR_MIDDLE_OF_SENTENCE, | |
98 | * UDISPCTX_CAPITALIZATION_FOR_BEGINNING_OF_SENTENCE, | |
99 | * UDISPCTX_CAPITALIZATION_FOR_UI_LIST_OR_MENU, or | |
100 | * UDISPCTX_CAPITALIZATION_FOR_STANDALONE. | |
101 | * Use UDisplayContextType UDISPCTX_TYPE_CAPITALIZATION to get the value. | |
102 | */ | |
103 | /** | |
104 | * The capitalization context to be used is unknown (this is the default value). | |
57a6839d | 105 | * @stable ICU 51 |
51004dcb A |
106 | */ |
107 | UDISPCTX_CAPITALIZATION_NONE = (UDISPCTX_TYPE_CAPITALIZATION<<8) + 0, | |
108 | /** | |
109 | * The capitalization context if a date, date symbol or display name is to be | |
110 | * formatted with capitalization appropriate for the middle of a sentence. | |
57a6839d | 111 | * @stable ICU 51 |
51004dcb A |
112 | */ |
113 | UDISPCTX_CAPITALIZATION_FOR_MIDDLE_OF_SENTENCE = (UDISPCTX_TYPE_CAPITALIZATION<<8) + 1, | |
114 | /** | |
115 | * The capitalization context if a date, date symbol or display name is to be | |
116 | * formatted with capitalization appropriate for the beginning of a sentence. | |
57a6839d | 117 | * @stable ICU 51 |
51004dcb A |
118 | */ |
119 | UDISPCTX_CAPITALIZATION_FOR_BEGINNING_OF_SENTENCE = (UDISPCTX_TYPE_CAPITALIZATION<<8) + 2, | |
120 | /** | |
121 | * The capitalization context if a date, date symbol or display name is to be | |
122 | * formatted with capitalization appropriate for a user-interface list or menu item. | |
57a6839d | 123 | * @stable ICU 51 |
51004dcb A |
124 | */ |
125 | UDISPCTX_CAPITALIZATION_FOR_UI_LIST_OR_MENU = (UDISPCTX_TYPE_CAPITALIZATION<<8) + 3, | |
126 | /** | |
127 | * The capitalization context if a date, date symbol or display name is to be | |
128 | * formatted with capitalization appropriate for stand-alone usage such as an | |
129 | * isolated name on a calendar page. | |
57a6839d A |
130 | * @stable ICU 51 |
131 | */ | |
2ca993e8 | 132 | UDISPCTX_CAPITALIZATION_FOR_STANDALONE = (UDISPCTX_TYPE_CAPITALIZATION<<8) + 4, |
b331163b A |
133 | /** |
134 | * ================================ | |
135 | * DISPLAY_LENGTH can be set to one of UDISPCTX_LENGTH_FULL or | |
136 | * UDISPCTX_LENGTH_SHORT. Use UDisplayContextType UDISPCTX_TYPE_DISPLAY_LENGTH | |
137 | * to get the value. | |
138 | */ | |
139 | /** | |
140 | * A possible setting for DISPLAY_LENGTH: | |
141 | * use full names when generating a locale name, | |
142 | * e.g. "United States" for US. | |
2ca993e8 | 143 | * @stable ICU 54 |
b331163b A |
144 | */ |
145 | UDISPCTX_LENGTH_FULL = (UDISPCTX_TYPE_DISPLAY_LENGTH<<8) + 0, | |
146 | /** | |
147 | * A possible setting for DISPLAY_LENGTH: | |
148 | * use short names when generating a locale name, | |
149 | * e.g. "U.S." for US. | |
2ca993e8 | 150 | * @stable ICU 54 |
b331163b | 151 | */ |
f3c0d7a5 | 152 | UDISPCTX_LENGTH_SHORT = (UDISPCTX_TYPE_DISPLAY_LENGTH<<8) + 1, |
f3c0d7a5 A |
153 | /** |
154 | * ================================ | |
155 | * SUBSTITUTE_HANDLING can be set to one of UDISPCTX_SUBSTITUTE or | |
156 | * UDISPCTX_NO_SUBSTITUTE. Use UDisplayContextType UDISPCTX_TYPE_SUBSTITUTE_HANDLING | |
157 | * to get the value. | |
158 | */ | |
159 | /** | |
160 | * A possible setting for SUBSTITUTE_HANDLING: | |
161 | * Returns a fallback value (e.g., the input code) when no data is available. | |
162 | * This is the default value. | |
0f5d89e8 | 163 | * @stable ICU 58 |
f3c0d7a5 A |
164 | */ |
165 | UDISPCTX_SUBSTITUTE = (UDISPCTX_TYPE_SUBSTITUTE_HANDLING<<8) + 0, | |
166 | /** | |
167 | * A possible setting for SUBSTITUTE_HANDLING: | |
168 | * Returns a null value when no data is available. | |
0f5d89e8 | 169 | * @stable ICU 58 |
f3c0d7a5 A |
170 | */ |
171 | UDISPCTX_NO_SUBSTITUTE = (UDISPCTX_TYPE_SUBSTITUTE_HANDLING<<8) + 1 | |
57a6839d | 172 | #ifndef U_HIDE_INTERNAL_API |
b331163b | 173 | , |
57a6839d A |
174 | /** |
175 | * ================================ | |
b331163b | 176 | * Apple-specific LENGTH can be set to one of UADISPCTX_LENGTH_STANDARD or |
57a6839d A |
177 | * UADISPCTX_LENGTH_SHORT. Use UDisplayContextType UADISPCTX_TYPE_LENGTH |
178 | * to get the value. | |
179 | */ | |
180 | /** | |
b331163b | 181 | * A possible Apple-specific setting for LENGTH: |
57a6839d A |
182 | * use standard length names when generating a locale name. |
183 | * @internal ICU 54 | |
184 | */ | |
185 | UADISPCTX_LENGTH_STANDARD = (UADISPCTX_TYPE_LENGTH<<8) + 0, | |
186 | /** | |
b331163b | 187 | * A possible Apple-specific setting for LENGTH: |
57a6839d A |
188 | * use short length names (if available) when generating a locale name |
189 | * (in most cases short names are not available and the standard | |
190 | * name will be used). | |
191 | * @internal ICU 54 | |
51004dcb | 192 | */ |
57a6839d A |
193 | UADISPCTX_LENGTH_SHORT = (UADISPCTX_TYPE_LENGTH<<8) + 1, |
194 | #endif /* U_HIDE_INTERNAL_API */ | |
f3c0d7a5 | 195 | |
51004dcb A |
196 | }; |
197 | /** | |
57a6839d | 198 | * @stable ICU 51 |
51004dcb A |
199 | */ |
200 | typedef enum UDisplayContext UDisplayContext; | |
201 | ||
202 | #endif /* #if !UCONFIG_NO_FORMATTING */ | |
203 | ||
204 | #endif |