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