]> git.saurik.com Git - apple/icu.git/blame - icuSources/common/unicode/udisplaycontext.h
ICU-59173.0.1.tar.gz
[apple/icu.git] / icuSources / common / unicode / udisplaycontext.h
CommitLineData
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 */
27enum 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
A
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 */
57a6839d 55#ifndef U_HIDE_INTERNAL_API
b331163b 56 ,
57a6839d 57 /**
b331163b
A
58 * Apple-specific type to retrieve the display length setting, e.g.
59 * UADISPCTX_LENGTH_STANDARD, UADISPCTX_LENGTH_SHORT
57a6839d 60 * @internal ICU 54
51004dcb 61 */
57a6839d
A
62 UADISPCTX_TYPE_LENGTH = 32,
63#endif /* U_HIDE_INTERNAL_API */
51004dcb
A
64};
65/**
57a6839d 66* @stable ICU 51
51004dcb
A
67*/
68typedef enum UDisplayContextType UDisplayContextType;
69
51004dcb
A
70/**
71 * Display context settings.
72 * Note, the specific numeric values are internal and may change.
57a6839d 73 * @stable ICU 51
51004dcb
A
74 */
75enum UDisplayContext {
51004dcb
A
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)'.
57a6839d 86 * @stable ICU 51
51004dcb
A
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'.
57a6839d 93 * @stable ICU 51
51004dcb
A
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).
57a6839d 107 * @stable ICU 51
51004dcb
A
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.
57a6839d 113 * @stable ICU 51
51004dcb
A
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.
57a6839d 119 * @stable ICU 51
51004dcb
A
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.
57a6839d 125 * @stable ICU 51
51004dcb
A
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.
57a6839d
A
132 * @stable ICU 51
133 */
2ca993e8 134 UDISPCTX_CAPITALIZATION_FOR_STANDALONE = (UDISPCTX_TYPE_CAPITALIZATION<<8) + 4,
b331163b
A
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.
2ca993e8 145 * @stable ICU 54
b331163b
A
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.
2ca993e8 152 * @stable ICU 54
b331163b 153 */
f3c0d7a5
A
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 */
57a6839d 176#ifndef U_HIDE_INTERNAL_API
b331163b 177 ,
57a6839d
A
178 /**
179 * ================================
b331163b 180 * Apple-specific LENGTH can be set to one of UADISPCTX_LENGTH_STANDARD or
57a6839d
A
181 * UADISPCTX_LENGTH_SHORT. Use UDisplayContextType UADISPCTX_TYPE_LENGTH
182 * to get the value.
183 */
184 /**
b331163b 185 * A possible Apple-specific setting for LENGTH:
57a6839d
A
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 /**
b331163b 191 * A possible Apple-specific setting for LENGTH:
57a6839d
A
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
51004dcb 196 */
57a6839d
A
197 UADISPCTX_LENGTH_SHORT = (UADISPCTX_TYPE_LENGTH<<8) + 1,
198#endif /* U_HIDE_INTERNAL_API */
f3c0d7a5 199
51004dcb
A
200};
201/**
57a6839d 202* @stable ICU 51
51004dcb
A
203*/
204typedef enum UDisplayContext UDisplayContext;
205
206#endif /* #if !UCONFIG_NO_FORMATTING */
207
208#endif