12e5b6d6dSopenharmony_ci// © 2016 and later: Unicode, Inc. and others. 22e5b6d6dSopenharmony_ci// License & terms of use: http://www.unicode.org/copyright.html 32e5b6d6dSopenharmony_ci/* 42e5b6d6dSopenharmony_ci***************************************************************************************** 52e5b6d6dSopenharmony_ci* Copyright (C) 2014-2016, International Business Machines 62e5b6d6dSopenharmony_ci* Corporation and others. All Rights Reserved. 72e5b6d6dSopenharmony_ci***************************************************************************************** 82e5b6d6dSopenharmony_ci*/ 92e5b6d6dSopenharmony_ci 102e5b6d6dSopenharmony_ci#ifndef UDISPLAYCONTEXT_H 112e5b6d6dSopenharmony_ci#define UDISPLAYCONTEXT_H 122e5b6d6dSopenharmony_ci 132e5b6d6dSopenharmony_ci#include "unicode/utypes.h" 142e5b6d6dSopenharmony_ci 152e5b6d6dSopenharmony_ci#if !UCONFIG_NO_FORMATTING 162e5b6d6dSopenharmony_ci 172e5b6d6dSopenharmony_ci/** 182e5b6d6dSopenharmony_ci * \file 192e5b6d6dSopenharmony_ci * \brief C API: Display context types (enum values) 202e5b6d6dSopenharmony_ci */ 212e5b6d6dSopenharmony_ci 222e5b6d6dSopenharmony_ci/** 232e5b6d6dSopenharmony_ci * Display context types, for getting values of a particular setting. 242e5b6d6dSopenharmony_ci * Note, the specific numeric values are internal and may change. 252e5b6d6dSopenharmony_ci * @stable ICU 51 262e5b6d6dSopenharmony_ci */ 272e5b6d6dSopenharmony_cienum UDisplayContextType { 282e5b6d6dSopenharmony_ci /** 292e5b6d6dSopenharmony_ci * Type to retrieve the dialect handling setting, e.g. 302e5b6d6dSopenharmony_ci * UDISPCTX_STANDARD_NAMES or UDISPCTX_DIALECT_NAMES. 312e5b6d6dSopenharmony_ci * @stable ICU 51 322e5b6d6dSopenharmony_ci */ 332e5b6d6dSopenharmony_ci UDISPCTX_TYPE_DIALECT_HANDLING = 0, 342e5b6d6dSopenharmony_ci /** 352e5b6d6dSopenharmony_ci * Type to retrieve the capitalization context setting, e.g. 362e5b6d6dSopenharmony_ci * UDISPCTX_CAPITALIZATION_NONE, UDISPCTX_CAPITALIZATION_FOR_MIDDLE_OF_SENTENCE, 372e5b6d6dSopenharmony_ci * UDISPCTX_CAPITALIZATION_FOR_BEGINNING_OF_SENTENCE, etc. 382e5b6d6dSopenharmony_ci * @stable ICU 51 392e5b6d6dSopenharmony_ci */ 402e5b6d6dSopenharmony_ci UDISPCTX_TYPE_CAPITALIZATION = 1, 412e5b6d6dSopenharmony_ci /** 422e5b6d6dSopenharmony_ci * Type to retrieve the display length setting, e.g. 432e5b6d6dSopenharmony_ci * UDISPCTX_LENGTH_FULL, UDISPCTX_LENGTH_SHORT. 442e5b6d6dSopenharmony_ci * @stable ICU 54 452e5b6d6dSopenharmony_ci */ 462e5b6d6dSopenharmony_ci UDISPCTX_TYPE_DISPLAY_LENGTH = 2, 472e5b6d6dSopenharmony_ci /** 482e5b6d6dSopenharmony_ci * Type to retrieve the substitute handling setting, e.g. 492e5b6d6dSopenharmony_ci * UDISPCTX_SUBSTITUTE, UDISPCTX_NO_SUBSTITUTE. 502e5b6d6dSopenharmony_ci * @stable ICU 58 512e5b6d6dSopenharmony_ci */ 522e5b6d6dSopenharmony_ci UDISPCTX_TYPE_SUBSTITUTE_HANDLING = 3 532e5b6d6dSopenharmony_ci}; 542e5b6d6dSopenharmony_ci/** 552e5b6d6dSopenharmony_ci* @stable ICU 51 562e5b6d6dSopenharmony_ci*/ 572e5b6d6dSopenharmony_citypedef enum UDisplayContextType UDisplayContextType; 582e5b6d6dSopenharmony_ci 592e5b6d6dSopenharmony_ci/** 602e5b6d6dSopenharmony_ci * Display context settings. 612e5b6d6dSopenharmony_ci * Note, the specific numeric values are internal and may change. 622e5b6d6dSopenharmony_ci * @stable ICU 51 632e5b6d6dSopenharmony_ci */ 642e5b6d6dSopenharmony_cienum UDisplayContext { 652e5b6d6dSopenharmony_ci /** 662e5b6d6dSopenharmony_ci * ================================ 672e5b6d6dSopenharmony_ci * DIALECT_HANDLING can be set to one of UDISPCTX_STANDARD_NAMES or 682e5b6d6dSopenharmony_ci * UDISPCTX_DIALECT_NAMES. Use UDisplayContextType UDISPCTX_TYPE_DIALECT_HANDLING 692e5b6d6dSopenharmony_ci * to get the value. 702e5b6d6dSopenharmony_ci */ 712e5b6d6dSopenharmony_ci /** 722e5b6d6dSopenharmony_ci * A possible setting for DIALECT_HANDLING: 732e5b6d6dSopenharmony_ci * use standard names when generating a locale name, 742e5b6d6dSopenharmony_ci * e.g. en_GB displays as 'English (United Kingdom)'. 752e5b6d6dSopenharmony_ci * @stable ICU 51 762e5b6d6dSopenharmony_ci */ 772e5b6d6dSopenharmony_ci UDISPCTX_STANDARD_NAMES = (UDISPCTX_TYPE_DIALECT_HANDLING<<8) + 0, 782e5b6d6dSopenharmony_ci /** 792e5b6d6dSopenharmony_ci * A possible setting for DIALECT_HANDLING: 802e5b6d6dSopenharmony_ci * use dialect names, when generating a locale name, 812e5b6d6dSopenharmony_ci * e.g. en_GB displays as 'British English'. 822e5b6d6dSopenharmony_ci * @stable ICU 51 832e5b6d6dSopenharmony_ci */ 842e5b6d6dSopenharmony_ci UDISPCTX_DIALECT_NAMES = (UDISPCTX_TYPE_DIALECT_HANDLING<<8) + 1, 852e5b6d6dSopenharmony_ci /** 862e5b6d6dSopenharmony_ci * ================================ 872e5b6d6dSopenharmony_ci * CAPITALIZATION can be set to one of UDISPCTX_CAPITALIZATION_NONE, 882e5b6d6dSopenharmony_ci * UDISPCTX_CAPITALIZATION_FOR_MIDDLE_OF_SENTENCE, 892e5b6d6dSopenharmony_ci * UDISPCTX_CAPITALIZATION_FOR_BEGINNING_OF_SENTENCE, 902e5b6d6dSopenharmony_ci * UDISPCTX_CAPITALIZATION_FOR_UI_LIST_OR_MENU, or 912e5b6d6dSopenharmony_ci * UDISPCTX_CAPITALIZATION_FOR_STANDALONE. 922e5b6d6dSopenharmony_ci * Use UDisplayContextType UDISPCTX_TYPE_CAPITALIZATION to get the value. 932e5b6d6dSopenharmony_ci */ 942e5b6d6dSopenharmony_ci /** 952e5b6d6dSopenharmony_ci * The capitalization context to be used is unknown (this is the default value). 962e5b6d6dSopenharmony_ci * @stable ICU 51 972e5b6d6dSopenharmony_ci */ 982e5b6d6dSopenharmony_ci UDISPCTX_CAPITALIZATION_NONE = (UDISPCTX_TYPE_CAPITALIZATION<<8) + 0, 992e5b6d6dSopenharmony_ci /** 1002e5b6d6dSopenharmony_ci * The capitalization context if a date, date symbol or display name is to be 1012e5b6d6dSopenharmony_ci * formatted with capitalization appropriate for the middle of a sentence. 1022e5b6d6dSopenharmony_ci * @stable ICU 51 1032e5b6d6dSopenharmony_ci */ 1042e5b6d6dSopenharmony_ci UDISPCTX_CAPITALIZATION_FOR_MIDDLE_OF_SENTENCE = (UDISPCTX_TYPE_CAPITALIZATION<<8) + 1, 1052e5b6d6dSopenharmony_ci /** 1062e5b6d6dSopenharmony_ci * The capitalization context if a date, date symbol or display name is to be 1072e5b6d6dSopenharmony_ci * formatted with capitalization appropriate for the beginning of a sentence. 1082e5b6d6dSopenharmony_ci * @stable ICU 51 1092e5b6d6dSopenharmony_ci */ 1102e5b6d6dSopenharmony_ci UDISPCTX_CAPITALIZATION_FOR_BEGINNING_OF_SENTENCE = (UDISPCTX_TYPE_CAPITALIZATION<<8) + 2, 1112e5b6d6dSopenharmony_ci /** 1122e5b6d6dSopenharmony_ci * The capitalization context if a date, date symbol or display name is to be 1132e5b6d6dSopenharmony_ci * formatted with capitalization appropriate for a user-interface list or menu item. 1142e5b6d6dSopenharmony_ci * @stable ICU 51 1152e5b6d6dSopenharmony_ci */ 1162e5b6d6dSopenharmony_ci UDISPCTX_CAPITALIZATION_FOR_UI_LIST_OR_MENU = (UDISPCTX_TYPE_CAPITALIZATION<<8) + 3, 1172e5b6d6dSopenharmony_ci /** 1182e5b6d6dSopenharmony_ci * The capitalization context if a date, date symbol or display name is to be 1192e5b6d6dSopenharmony_ci * formatted with capitalization appropriate for stand-alone usage such as an 1202e5b6d6dSopenharmony_ci * isolated name on a calendar page. 1212e5b6d6dSopenharmony_ci * @stable ICU 51 1222e5b6d6dSopenharmony_ci */ 1232e5b6d6dSopenharmony_ci UDISPCTX_CAPITALIZATION_FOR_STANDALONE = (UDISPCTX_TYPE_CAPITALIZATION<<8) + 4, 1242e5b6d6dSopenharmony_ci /** 1252e5b6d6dSopenharmony_ci * ================================ 1262e5b6d6dSopenharmony_ci * DISPLAY_LENGTH can be set to one of UDISPCTX_LENGTH_FULL or 1272e5b6d6dSopenharmony_ci * UDISPCTX_LENGTH_SHORT. Use UDisplayContextType UDISPCTX_TYPE_DISPLAY_LENGTH 1282e5b6d6dSopenharmony_ci * to get the value. 1292e5b6d6dSopenharmony_ci */ 1302e5b6d6dSopenharmony_ci /** 1312e5b6d6dSopenharmony_ci * A possible setting for DISPLAY_LENGTH: 1322e5b6d6dSopenharmony_ci * use full names when generating a locale name, 1332e5b6d6dSopenharmony_ci * e.g. "United States" for US. 1342e5b6d6dSopenharmony_ci * @stable ICU 54 1352e5b6d6dSopenharmony_ci */ 1362e5b6d6dSopenharmony_ci UDISPCTX_LENGTH_FULL = (UDISPCTX_TYPE_DISPLAY_LENGTH<<8) + 0, 1372e5b6d6dSopenharmony_ci /** 1382e5b6d6dSopenharmony_ci * A possible setting for DISPLAY_LENGTH: 1392e5b6d6dSopenharmony_ci * use short names when generating a locale name, 1402e5b6d6dSopenharmony_ci * e.g. "U.S." for US. 1412e5b6d6dSopenharmony_ci * @stable ICU 54 1422e5b6d6dSopenharmony_ci */ 1432e5b6d6dSopenharmony_ci UDISPCTX_LENGTH_SHORT = (UDISPCTX_TYPE_DISPLAY_LENGTH<<8) + 1, 1442e5b6d6dSopenharmony_ci /** 1452e5b6d6dSopenharmony_ci * ================================ 1462e5b6d6dSopenharmony_ci * SUBSTITUTE_HANDLING can be set to one of UDISPCTX_SUBSTITUTE or 1472e5b6d6dSopenharmony_ci * UDISPCTX_NO_SUBSTITUTE. Use UDisplayContextType UDISPCTX_TYPE_SUBSTITUTE_HANDLING 1482e5b6d6dSopenharmony_ci * to get the value. 1492e5b6d6dSopenharmony_ci */ 1502e5b6d6dSopenharmony_ci /** 1512e5b6d6dSopenharmony_ci * A possible setting for SUBSTITUTE_HANDLING: 1522e5b6d6dSopenharmony_ci * Returns a fallback value (e.g., the input code) when no data is available. 1532e5b6d6dSopenharmony_ci * This is the default value. 1542e5b6d6dSopenharmony_ci * @stable ICU 58 1552e5b6d6dSopenharmony_ci */ 1562e5b6d6dSopenharmony_ci UDISPCTX_SUBSTITUTE = (UDISPCTX_TYPE_SUBSTITUTE_HANDLING<<8) + 0, 1572e5b6d6dSopenharmony_ci /** 1582e5b6d6dSopenharmony_ci * A possible setting for SUBSTITUTE_HANDLING: 1592e5b6d6dSopenharmony_ci * Returns a null value with error code set to U_ILLEGAL_ARGUMENT_ERROR when no 1602e5b6d6dSopenharmony_ci * data is available. 1612e5b6d6dSopenharmony_ci * @stable ICU 58 1622e5b6d6dSopenharmony_ci */ 1632e5b6d6dSopenharmony_ci UDISPCTX_NO_SUBSTITUTE = (UDISPCTX_TYPE_SUBSTITUTE_HANDLING<<8) + 1 1642e5b6d6dSopenharmony_ci 1652e5b6d6dSopenharmony_ci}; 1662e5b6d6dSopenharmony_ci/** 1672e5b6d6dSopenharmony_ci* @stable ICU 51 1682e5b6d6dSopenharmony_ci*/ 1692e5b6d6dSopenharmony_citypedef enum UDisplayContext UDisplayContext; 1702e5b6d6dSopenharmony_ci 1712e5b6d6dSopenharmony_ci#endif /* #if !UCONFIG_NO_FORMATTING */ 1722e5b6d6dSopenharmony_ci 1732e5b6d6dSopenharmony_ci#endif 174