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