1 /* GENERATED SOURCE. DO NOT MODIFY. */ 2 // 2016 and later: Unicode, Inc. and others. 3 // License & terms of use: http://www.unicode.org/copyright.html#License 4 /* 5 ******************************************************************************* 6 * Copyright (C) 2012-2015, International Business Machines Corporation and * 7 * others. All Rights Reserved. * 8 ******************************************************************************* 9 */ 10 package android.icu.text; 11 12 /** 13 * Display context settings. 14 * Note, the specific numeric values are internal and may change. 15 */ 16 public enum DisplayContext { 17 /** 18 * ================================ 19 * Settings for DIALECT_HANDLING (use one) 20 */ 21 /** 22 * A possible setting for DIALECT_HANDLING: 23 * use standard names when generating a locale name, 24 * e.g. en_GB displays as 'English (United Kingdom)'. 25 */ 26 STANDARD_NAMES(Type.DIALECT_HANDLING, 0), 27 /** 28 * A possible setting for DIALECT_HANDLING: 29 * use dialect names, when generating a locale name, 30 * e.g. en_GB displays as 'British English'. 31 */ 32 DIALECT_NAMES(Type.DIALECT_HANDLING, 1), 33 /** 34 * ================================ 35 * Settings for CAPITALIZATION (use one) 36 */ 37 /** 38 * A possible setting for CAPITALIZATION: 39 * The capitalization context to be used is unknown (this is the default value). 40 */ 41 CAPITALIZATION_NONE(Type.CAPITALIZATION, 0), 42 /** 43 * A possible setting for CAPITALIZATION: 44 * The capitalization context if a date, date symbol or display name is to be 45 * formatted with capitalization appropriate for the middle of a sentence. 46 */ 47 CAPITALIZATION_FOR_MIDDLE_OF_SENTENCE(Type.CAPITALIZATION, 1), 48 /** 49 * A possible setting for CAPITALIZATION: 50 * The capitalization context if a date, date symbol or display name is to be 51 * formatted with capitalization appropriate for the beginning of a sentence. 52 */ 53 CAPITALIZATION_FOR_BEGINNING_OF_SENTENCE(Type.CAPITALIZATION, 2), 54 /** 55 * A possible setting for CAPITALIZATION: 56 * The capitalization context if a date, date symbol or display name is to be 57 * formatted with capitalization appropriate for a user-interface list or menu item. 58 */ 59 CAPITALIZATION_FOR_UI_LIST_OR_MENU(Type.CAPITALIZATION, 3), 60 /** 61 * A possible setting for CAPITALIZATION: 62 * The capitalization context if a date, date symbol or display name is to be 63 * formatted with capitalization appropriate for stand-alone usage such as an 64 * isolated name on a calendar page. 65 */ 66 CAPITALIZATION_FOR_STANDALONE(Type.CAPITALIZATION, 4), 67 /** 68 * ================================ 69 * Settings for DISPLAY_LENGTH (use one) 70 */ 71 /** 72 * A possible setting for DISPLAY_LENGTH: 73 * use full names when generating a locale name, 74 * e.g. "United States" for US. 75 */ 76 LENGTH_FULL(Type.DISPLAY_LENGTH, 0), 77 /** 78 * A possible setting for DISPLAY_LENGTH: 79 * use short names when generating a locale name, 80 * e.g. "U.S." for US. 81 */ 82 LENGTH_SHORT(Type.DISPLAY_LENGTH, 1), 83 /** 84 * ================================ 85 * Settings for SUBSTITUTE_HANDLING (choose one) 86 */ 87 /** 88 * A possible setting for SUBSTITUTE_HANDLING: 89 * Returns a fallback value (e.g., the input code) when no data is available. 90 * This is the default behavior. 91 * @hide draft / provisional / internal are hidden on Android 92 */ 93 SUBSTITUTE(Type.SUBSTITUTE_HANDLING, 0), 94 /** 95 * A possible setting for SUBSTITUTE_HANDLING: 96 * Returns a null value when no data is available. 97 * @hide draft / provisional / internal are hidden on Android 98 */ 99 NO_SUBSTITUTE(Type.SUBSTITUTE_HANDLING, 1); 100 101 /** 102 * Type values for DisplayContext 103 */ 104 public enum Type { 105 /** 106 * DIALECT_HANDLING can be set to STANDARD_NAMES or DIALECT_NAMES. 107 */ 108 DIALECT_HANDLING, 109 /** 110 * CAPITALIZATION can be set to one of CAPITALIZATION_NONE through 111 * CAPITALIZATION_FOR_STANDALONE. 112 */ 113 CAPITALIZATION, 114 /** 115 * DISPLAY_LENGTH can be set to LENGTH_FULL or LENGTH_SHORT. 116 */ 117 DISPLAY_LENGTH, 118 /** 119 * SUBSTITUTE_HANDLING can be set to SUBSTITUTE or NO_SUBSTITUTE. 120 * @hide draft / provisional / internal are hidden on Android 121 */ 122 SUBSTITUTE_HANDLING 123 } 124 125 private final Type type; 126 private final int value; 127 private DisplayContext(Type type, int value) { 128 this.type = type; 129 this.value = value; 130 } 131 /** 132 * Get the Type part of the enum item 133 * (e.g. CAPITALIZATION) 134 */ 135 public Type type() { 136 return type; 137 } 138 /** 139 * Get the value part of the enum item 140 * (e.g. CAPITALIZATION_FOR_STANDALONE) 141 */ 142 public int value() { 143 return value; 144 } 145 } 146