• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright (C) 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 };
56 /**
57 *  @stable ICU 51
58 */
59 typedef enum UDisplayContextType UDisplayContextType;
60 
61 /**
62  * Display context settings.
63  * Note, the specific numeric values are internal and may change.
64  * @stable ICU 51
65  */
66 enum UDisplayContext {
67     /**
68      * ================================
69      * DIALECT_HANDLING can be set to one of UDISPCTX_STANDARD_NAMES or
70      * UDISPCTX_DIALECT_NAMES. Use UDisplayContextType UDISPCTX_TYPE_DIALECT_HANDLING
71      * to get the value.
72      */
73     /**
74      * A possible setting for DIALECT_HANDLING:
75      * use standard names when generating a locale name,
76      * e.g. en_GB displays as 'English (United Kingdom)'.
77      * @stable ICU 51
78      */
79     UDISPCTX_STANDARD_NAMES = (UDISPCTX_TYPE_DIALECT_HANDLING<<8) + 0,
80     /**
81      * A possible setting for DIALECT_HANDLING:
82      * use dialect names, when generating a locale name,
83      * e.g. en_GB displays as 'British English'.
84      * @stable ICU 51
85      */
86     UDISPCTX_DIALECT_NAMES = (UDISPCTX_TYPE_DIALECT_HANDLING<<8) + 1,
87     /**
88      * ================================
89      * CAPITALIZATION can be set to one of UDISPCTX_CAPITALIZATION_NONE,
90      * UDISPCTX_CAPITALIZATION_FOR_MIDDLE_OF_SENTENCE,
91      * UDISPCTX_CAPITALIZATION_FOR_BEGINNING_OF_SENTENCE,
92      * UDISPCTX_CAPITALIZATION_FOR_UI_LIST_OR_MENU, or
93      * UDISPCTX_CAPITALIZATION_FOR_STANDALONE.
94      * Use UDisplayContextType UDISPCTX_TYPE_CAPITALIZATION to get the value.
95      */
96     /**
97      * The capitalization context to be used is unknown (this is the default value).
98      * @stable ICU 51
99      */
100     UDISPCTX_CAPITALIZATION_NONE = (UDISPCTX_TYPE_CAPITALIZATION<<8) + 0,
101     /**
102      * The capitalization context if a date, date symbol or display name is to be
103      * formatted with capitalization appropriate for the middle of a sentence.
104      * @stable ICU 51
105      */
106     UDISPCTX_CAPITALIZATION_FOR_MIDDLE_OF_SENTENCE = (UDISPCTX_TYPE_CAPITALIZATION<<8) + 1,
107     /**
108      * The capitalization context if a date, date symbol or display name is to be
109      * formatted with capitalization appropriate for the beginning of a sentence.
110      * @stable ICU 51
111      */
112     UDISPCTX_CAPITALIZATION_FOR_BEGINNING_OF_SENTENCE = (UDISPCTX_TYPE_CAPITALIZATION<<8) + 2,
113     /**
114      * The capitalization context if a date, date symbol or display name is to be
115      * formatted with capitalization appropriate for a user-interface list or menu item.
116      * @stable ICU 51
117      */
118     UDISPCTX_CAPITALIZATION_FOR_UI_LIST_OR_MENU = (UDISPCTX_TYPE_CAPITALIZATION<<8) + 3,
119     /**
120      * The capitalization context if a date, date symbol or display name is to be
121      * formatted with capitalization appropriate for stand-alone usage such as an
122      * isolated name on a calendar page.
123      * @stable ICU 51
124      */
125     UDISPCTX_CAPITALIZATION_FOR_STANDALONE = (UDISPCTX_TYPE_CAPITALIZATION<<8) + 4,
126     /**
127      * ================================
128      * DISPLAY_LENGTH can be set to one of UDISPCTX_LENGTH_FULL or
129      * UDISPCTX_LENGTH_SHORT. Use UDisplayContextType UDISPCTX_TYPE_DISPLAY_LENGTH
130      * to get the value.
131      */
132     /**
133      * A possible setting for DISPLAY_LENGTH:
134      * use full names when generating a locale name,
135      * e.g. "United States" for US.
136      * @stable ICU 54
137      */
138     UDISPCTX_LENGTH_FULL = (UDISPCTX_TYPE_DISPLAY_LENGTH<<8) + 0,
139     /**
140      * A possible setting for DISPLAY_LENGTH:
141      * use short names when generating a locale name,
142      * e.g. "U.S." for US.
143      * @stable ICU 54
144      */
145     UDISPCTX_LENGTH_SHORT = (UDISPCTX_TYPE_DISPLAY_LENGTH<<8) + 1,
146 #ifndef U_HIDE_DRAFT_API
147     /**
148      * ================================
149      * SUBSTITUTE_HANDLING can be set to one of UDISPCTX_SUBSTITUTE or
150      * UDISPCTX_NO_SUBSTITUTE. Use UDisplayContextType UDISPCTX_TYPE_SUBSTITUTE_HANDLING
151      * to get the value.
152      */
153     /**
154      * A possible setting for SUBSTITUTE_HANDLING:
155      * Returns a fallback value (e.g., the input code) when no data is available.
156      * This is the default value.
157      * @draft ICU 58
158      */
159     UDISPCTX_SUBSTITUTE = (UDISPCTX_TYPE_SUBSTITUTE_HANDLING<<8) + 0,
160     /**
161      * A possible setting for SUBSTITUTE_HANDLING:
162      * Returns a null value when no data is available.
163      * @draft ICU 58
164      */
165     UDISPCTX_NO_SUBSTITUTE = (UDISPCTX_TYPE_SUBSTITUTE_HANDLING<<8) + 1
166 #endif /* U_HIDE_DRAFT_API */
167 
168 };
169 /**
170 *  @stable ICU 51
171 */
172 typedef enum UDisplayContext UDisplayContext;
173 
174 #endif /* #if !UCONFIG_NO_FORMATTING */
175 
176 #endif
177