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