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