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 * @addtogroup icu4c ICU4C 19 * @{ 20 * \file 21 * \brief C API: Display context types (enum values) 22 */ 23 24 /** 25 * Display context types, for getting values of a particular setting. 26 * Note, the specific numeric values are internal and may change. 27 * \xrefitem stable "Stable" "Stable List" ICU 51 28 */ 29 enum UDisplayContextType { 30 /** 31 * Type to retrieve the dialect handling setting, e.g. 32 * UDISPCTX_STANDARD_NAMES or UDISPCTX_DIALECT_NAMES. 33 * \xrefitem stable "Stable" "Stable List" ICU 51 34 */ 35 UDISPCTX_TYPE_DIALECT_HANDLING = 0, 36 /** 37 * Type to retrieve the capitalization context setting, e.g. 38 * UDISPCTX_CAPITALIZATION_NONE, UDISPCTX_CAPITALIZATION_FOR_MIDDLE_OF_SENTENCE, 39 * UDISPCTX_CAPITALIZATION_FOR_BEGINNING_OF_SENTENCE, etc. 40 * \xrefitem stable "Stable" "Stable List" ICU 51 41 */ 42 UDISPCTX_TYPE_CAPITALIZATION = 1, 43 /** 44 * Type to retrieve the display length setting, e.g. 45 * UDISPCTX_LENGTH_FULL, UDISPCTX_LENGTH_SHORT. 46 * \xrefitem stable "Stable" "Stable List" ICU 54 47 */ 48 UDISPCTX_TYPE_DISPLAY_LENGTH = 2, 49 /** 50 * Type to retrieve the substitute handling setting, e.g. 51 * UDISPCTX_SUBSTITUTE, UDISPCTX_NO_SUBSTITUTE. 52 * \xrefitem stable "Stable" "Stable List" ICU 58 53 */ 54 UDISPCTX_TYPE_SUBSTITUTE_HANDLING = 3 55 }; 56 /** 57 * \xrefitem stable "Stable" "Stable List" 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 * \xrefitem stable "Stable" "Stable List" 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 * \xrefitem stable "Stable" "Stable List" 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 * \xrefitem stable "Stable" "Stable List" 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 * \xrefitem stable "Stable" "Stable List" 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 * \xrefitem stable "Stable" "Stable List" 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 * \xrefitem stable "Stable" "Stable List" 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 * \xrefitem stable "Stable" "Stable List" 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 * \xrefitem stable "Stable" "Stable List" 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 * \xrefitem stable "Stable" "Stable List" 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 * \xrefitem stable "Stable" "Stable List" ICU 54 144 */ 145 UDISPCTX_LENGTH_SHORT = (UDISPCTX_TYPE_DISPLAY_LENGTH<<8) + 1, 146 /** 147 * ================================ 148 * SUBSTITUTE_HANDLING can be set to one of UDISPCTX_SUBSTITUTE or 149 * UDISPCTX_NO_SUBSTITUTE. Use UDisplayContextType UDISPCTX_TYPE_SUBSTITUTE_HANDLING 150 * to get the value. 151 */ 152 /** 153 * A possible setting for SUBSTITUTE_HANDLING: 154 * Returns a fallback value (e.g., the input code) when no data is available. 155 * This is the default value. 156 * \xrefitem stable "Stable" "Stable List" ICU 58 157 */ 158 UDISPCTX_SUBSTITUTE = (UDISPCTX_TYPE_SUBSTITUTE_HANDLING<<8) + 0, 159 /** 160 * A possible setting for SUBSTITUTE_HANDLING: 161 * Returns a null value with error code set to U_ILLEGAL_ARGUMENT_ERROR when no 162 * data is available. 163 * \xrefitem stable "Stable" "Stable List" ICU 58 164 */ 165 UDISPCTX_NO_SUBSTITUTE = (UDISPCTX_TYPE_SUBSTITUTE_HANDLING<<8) + 1 166 167 }; 168 /** 169 * \xrefitem stable "Stable" "Stable List" ICU 51 170 */ 171 typedef enum UDisplayContext UDisplayContext; 172 173 #endif /* #if !UCONFIG_NO_FORMATTING */ 174 175 #endif 176 177 /** @} */ // addtogroup 178