EditorInfo.java revision c1a11f17a2de18911317d235ff75fa17e098a962
115a4d2ffd04dc6c70f2cd17dae12ac6bc14c69abKenny Root/* 215a4d2ffd04dc6c70f2cd17dae12ac6bc14c69abKenny Root * Copyright (C) 2008 The Android Open Source Project 315a4d2ffd04dc6c70f2cd17dae12ac6bc14c69abKenny Root * 415a4d2ffd04dc6c70f2cd17dae12ac6bc14c69abKenny Root * Licensed under the Apache License, Version 2.0 (the "License"); 515a4d2ffd04dc6c70f2cd17dae12ac6bc14c69abKenny Root * you may not use this file except in compliance with the License. 615a4d2ffd04dc6c70f2cd17dae12ac6bc14c69abKenny Root * You may obtain a copy of the License at 715a4d2ffd04dc6c70f2cd17dae12ac6bc14c69abKenny Root * 815a4d2ffd04dc6c70f2cd17dae12ac6bc14c69abKenny Root * http://www.apache.org/licenses/LICENSE-2.0 915a4d2ffd04dc6c70f2cd17dae12ac6bc14c69abKenny Root * 1015a4d2ffd04dc6c70f2cd17dae12ac6bc14c69abKenny Root * Unless required by applicable law or agreed to in writing, software 1115a4d2ffd04dc6c70f2cd17dae12ac6bc14c69abKenny Root * distributed under the License is distributed on an "AS IS" BASIS, 1215a4d2ffd04dc6c70f2cd17dae12ac6bc14c69abKenny Root * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1315a4d2ffd04dc6c70f2cd17dae12ac6bc14c69abKenny Root * See the License for the specific language governing permissions and 1415a4d2ffd04dc6c70f2cd17dae12ac6bc14c69abKenny Root * limitations under the License. 1515a4d2ffd04dc6c70f2cd17dae12ac6bc14c69abKenny Root */ 1615a4d2ffd04dc6c70f2cd17dae12ac6bc14c69abKenny Root 179066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Projectpackage android.view.inputmethod; 189066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project 199066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Projectimport android.os.Bundle; 209066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Projectimport android.os.Parcel; 219066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Projectimport android.os.Parcelable; 229066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Projectimport android.text.InputType; 239066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Projectimport android.text.TextUtils; 249066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Projectimport android.util.Printer; 259066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project 269066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project/** 279066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * An EditorInfo describes several attributes of a text editing object 289066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * that an input method is communicating with (typically an EditText), most 299066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * importantly the type of text content it contains. 309066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project */ 319066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Projectpublic class EditorInfo implements InputType, Parcelable { 329066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project /** 339066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * The content type of the text box, whose bits are defined by 349066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * {@link InputType}. 359066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * 369066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * @see InputType 379066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * @see #TYPE_MASK_CLASS 389066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * @see #TYPE_MASK_VARIATION 399066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * @see #TYPE_MASK_FLAGS 409066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project */ 419066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project public int inputType = TYPE_NULL; 429066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project 439066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project /** 449066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * Set of bits in {@link #imeOptions} that provide alternative actions 459066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * associated with the "enter" key. This both helps the IME provide 469066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * better feedback about what the enter key will do, and also allows it 479066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * to provide alternative mechanisms for providing that command. 489066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project */ 499066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project public static final int IME_MASK_ACTION = 0x000000ff; 509066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project 519066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project /** 52b2a3dd88a53cc8c6d19f6dc8ec4f3d6c4abd9b54The Android Open Source Project * Bits of {@link #IME_MASK_ACTION}: no specific action has been 53b2a3dd88a53cc8c6d19f6dc8ec4f3d6c4abd9b54The Android Open Source Project * associated with this editor, let the editor come up with its own if 54b2a3dd88a53cc8c6d19f6dc8ec4f3d6c4abd9b54The Android Open Source Project * it can. 559066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project */ 56b2a3dd88a53cc8c6d19f6dc8ec4f3d6c4abd9b54The Android Open Source Project public static final int IME_ACTION_UNSPECIFIED = 0x00000000; 57b2a3dd88a53cc8c6d19f6dc8ec4f3d6c4abd9b54The Android Open Source Project 58b2a3dd88a53cc8c6d19f6dc8ec4f3d6c4abd9b54The Android Open Source Project /** 59b2a3dd88a53cc8c6d19f6dc8ec4f3d6c4abd9b54The Android Open Source Project * Bits of {@link #IME_MASK_ACTION}: there is no available action. 60b2a3dd88a53cc8c6d19f6dc8ec4f3d6c4abd9b54The Android Open Source Project */ 61b2a3dd88a53cc8c6d19f6dc8ec4f3d6c4abd9b54The Android Open Source Project public static final int IME_ACTION_NONE = 0x00000001; 629066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project 639066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project /** 649066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * Bits of {@link #IME_MASK_ACTION}: the action key performs a "go" 659066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * operation to take the user to the target of the text they typed. 669066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * Typically used, for example, when entering a URL. 679066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project */ 68b2a3dd88a53cc8c6d19f6dc8ec4f3d6c4abd9b54The Android Open Source Project public static final int IME_ACTION_GO = 0x00000002; 699066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project 709066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project /** 719066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * Bits of {@link #IME_MASK_ACTION}: the action key performs a "search" 729066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * operation, taking the user to the results of searching for the text 73c1a11f17a2de18911317d235ff75fa17e098a962Jean Chalard * they have typed (in whatever context is appropriate). 749066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project */ 75b2a3dd88a53cc8c6d19f6dc8ec4f3d6c4abd9b54The Android Open Source Project public static final int IME_ACTION_SEARCH = 0x00000003; 769066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project 779066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project /** 789066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * Bits of {@link #IME_MASK_ACTION}: the action key performs a "send" 799066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * operation, delivering the text to its target. This is typically used 80c1a11f17a2de18911317d235ff75fa17e098a962Jean Chalard * when composing a message in IM or SMS where sending is immediate. 819066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project */ 82b2a3dd88a53cc8c6d19f6dc8ec4f3d6c4abd9b54The Android Open Source Project public static final int IME_ACTION_SEND = 0x00000004; 839066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project 849066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project /** 859066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * Bits of {@link #IME_MASK_ACTION}: the action key performs a "next" 869066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * operation, taking the user to the next field that will accept text. 879066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project */ 88b2a3dd88a53cc8c6d19f6dc8ec4f3d6c4abd9b54The Android Open Source Project public static final int IME_ACTION_NEXT = 0x00000005; 899066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project 909066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project /** 914df2423a947bcd3f024cc3d3a1a315a8dc428598The Android Open Source Project * Bits of {@link #IME_MASK_ACTION}: the action key performs a "done" 92c1a11f17a2de18911317d235ff75fa17e098a962Jean Chalard * operation, typically meaning there is nothing more to input and the 93c1a11f17a2de18911317d235ff75fa17e098a962Jean Chalard * IME will be closed. 944df2423a947bcd3f024cc3d3a1a315a8dc428598The Android Open Source Project */ 95b2a3dd88a53cc8c6d19f6dc8ec4f3d6c4abd9b54The Android Open Source Project public static final int IME_ACTION_DONE = 0x00000006; 964df2423a947bcd3f024cc3d3a1a315a8dc428598The Android Open Source Project 974df2423a947bcd3f024cc3d3a1a315a8dc428598The Android Open Source Project /** 98dea3ef7967228f0ddcc03f2455a4f1254758e584Dianne Hackborn * Bits of {@link #IME_MASK_ACTION}: Like {@link #IME_ACTION_NEXT}, but 99dea3ef7967228f0ddcc03f2455a4f1254758e584Dianne Hackborn * for moving to the previous field. This will normally not be used to 100c1a11f17a2de18911317d235ff75fa17e098a962Jean Chalard * specify an action (since it precludes {@link #IME_ACTION_NEXT}), but 101dea3ef7967228f0ddcc03f2455a4f1254758e584Dianne Hackborn * can be returned to the app if it sets {@link #IME_FLAG_NAVIGATE_PREVIOUS}. 102dea3ef7967228f0ddcc03f2455a4f1254758e584Dianne Hackborn */ 103dea3ef7967228f0ddcc03f2455a4f1254758e584Dianne Hackborn public static final int IME_ACTION_PREVIOUS = 0x00000007; 104dea3ef7967228f0ddcc03f2455a4f1254758e584Dianne Hackborn 105dea3ef7967228f0ddcc03f2455a4f1254758e584Dianne Hackborn /** 106dea3ef7967228f0ddcc03f2455a4f1254758e584Dianne Hackborn * Flag of {@link #imeOptions}: used to request that the IME never go 107c1a11f17a2de18911317d235ff75fa17e098a962Jean Chalard * into fullscreen mode. 108c1a11f17a2de18911317d235ff75fa17e098a962Jean Chalard * By default, IMEs may go into full screen mode when they think 109c1a11f17a2de18911317d235ff75fa17e098a962Jean Chalard * it's appropriate, for example on small screens in landscape 110c1a11f17a2de18911317d235ff75fa17e098a962Jean Chalard * orientation where displaying a software keyboard may occlude 111c1a11f17a2de18911317d235ff75fa17e098a962Jean Chalard * such a large portion of the screen that the remaining part is 112c1a11f17a2de18911317d235ff75fa17e098a962Jean Chalard * too small to meaningfully display the application UI. 113c1a11f17a2de18911317d235ff75fa17e098a962Jean Chalard * If this flag is set, compliant IMEs will never go into full screen mode, 114c1a11f17a2de18911317d235ff75fa17e098a962Jean Chalard * and always leave some space to display the application UI. 115c1a11f17a2de18911317d235ff75fa17e098a962Jean Chalard * Applications need to be aware that the flag is not a guarantee, and 116c1a11f17a2de18911317d235ff75fa17e098a962Jean Chalard * some IMEs may ignore it. 117dea3ef7967228f0ddcc03f2455a4f1254758e584Dianne Hackborn */ 118dea3ef7967228f0ddcc03f2455a4f1254758e584Dianne Hackborn public static final int IME_FLAG_NO_FULLSCREEN = 0x2000000; 119dea3ef7967228f0ddcc03f2455a4f1254758e584Dianne Hackborn 120dea3ef7967228f0ddcc03f2455a4f1254758e584Dianne Hackborn /** 121dea3ef7967228f0ddcc03f2455a4f1254758e584Dianne Hackborn * Flag of {@link #imeOptions}: like {@link #IME_FLAG_NAVIGATE_NEXT}, but 122dea3ef7967228f0ddcc03f2455a4f1254758e584Dianne Hackborn * specifies there is something interesting that a backward navigation 123dea3ef7967228f0ddcc03f2455a4f1254758e584Dianne Hackborn * can focus on. If the user selects the IME's facility to backward 124dea3ef7967228f0ddcc03f2455a4f1254758e584Dianne Hackborn * navigate, this will show up in the application as an {@link #IME_ACTION_PREVIOUS} 125dea3ef7967228f0ddcc03f2455a4f1254758e584Dianne Hackborn * at {@link InputConnection#performEditorAction(int) 126dea3ef7967228f0ddcc03f2455a4f1254758e584Dianne Hackborn * InputConnection.performEditorAction(int)}. 127dea3ef7967228f0ddcc03f2455a4f1254758e584Dianne Hackborn */ 128dea3ef7967228f0ddcc03f2455a4f1254758e584Dianne Hackborn public static final int IME_FLAG_NAVIGATE_PREVIOUS = 0x4000000; 129dea3ef7967228f0ddcc03f2455a4f1254758e584Dianne Hackborn 130dea3ef7967228f0ddcc03f2455a4f1254758e584Dianne Hackborn /** 131dea3ef7967228f0ddcc03f2455a4f1254758e584Dianne Hackborn * Flag of {@link #imeOptions}: used to specify that there is something 132dea3ef7967228f0ddcc03f2455a4f1254758e584Dianne Hackborn * interesting that a forward navigation can focus on. This is like using 133dea3ef7967228f0ddcc03f2455a4f1254758e584Dianne Hackborn * {@link #IME_ACTION_NEXT}, except allows the IME to be multiline (with 134dea3ef7967228f0ddcc03f2455a4f1254758e584Dianne Hackborn * an enter key) as well as provide forward navigation. Note that some 135dea3ef7967228f0ddcc03f2455a4f1254758e584Dianne Hackborn * IMEs may not be able to do this, especially when running on a small 136dea3ef7967228f0ddcc03f2455a4f1254758e584Dianne Hackborn * screen where there is little space. In that case it does not need to 137dea3ef7967228f0ddcc03f2455a4f1254758e584Dianne Hackborn * present a UI for this option. Like {@link #IME_ACTION_NEXT}, if the 138dea3ef7967228f0ddcc03f2455a4f1254758e584Dianne Hackborn * user selects the IME's facility to forward navigate, this will show up 139dea3ef7967228f0ddcc03f2455a4f1254758e584Dianne Hackborn * in the application at {@link InputConnection#performEditorAction(int) 140dea3ef7967228f0ddcc03f2455a4f1254758e584Dianne Hackborn * InputConnection.performEditorAction(int)}. 141dea3ef7967228f0ddcc03f2455a4f1254758e584Dianne Hackborn */ 142dea3ef7967228f0ddcc03f2455a4f1254758e584Dianne Hackborn public static final int IME_FLAG_NAVIGATE_NEXT = 0x8000000; 143dea3ef7967228f0ddcc03f2455a4f1254758e584Dianne Hackborn 144dea3ef7967228f0ddcc03f2455a4f1254758e584Dianne Hackborn /** 145105925376f8d0f6b318c9938c7b83ef7fef094daThe Android Open Source Project * Flag of {@link #imeOptions}: used to specify that the IME does not need 146105925376f8d0f6b318c9938c7b83ef7fef094daThe Android Open Source Project * to show its extracted text UI. For input methods that may be fullscreen, 147105925376f8d0f6b318c9938c7b83ef7fef094daThe Android Open Source Project * often when in landscape mode, this allows them to be smaller and let part 148c1a11f17a2de18911317d235ff75fa17e098a962Jean Chalard * of the application be shown behind, through transparent UI parts in the 149c1a11f17a2de18911317d235ff75fa17e098a962Jean Chalard * fullscreen IME. The part of the UI visible to the user may not be responsive 150c1a11f17a2de18911317d235ff75fa17e098a962Jean Chalard * to touch because the IME will receive touch events, which may confuse the 151c1a11f17a2de18911317d235ff75fa17e098a962Jean Chalard * user; use {@link IME_FLAG_NO_FULLSCREEN} instead for a better experience. 152c1a11f17a2de18911317d235ff75fa17e098a962Jean Chalard * Using this flag is discouraged and it may become deprecated in the future. 153c1a11f17a2de18911317d235ff75fa17e098a962Jean Chalard * Its meaning is unclear in some situations and it may not work appropriately 154c1a11f17a2de18911317d235ff75fa17e098a962Jean Chalard * on older versions of the platform. 155105925376f8d0f6b318c9938c7b83ef7fef094daThe Android Open Source Project */ 156105925376f8d0f6b318c9938c7b83ef7fef094daThe Android Open Source Project public static final int IME_FLAG_NO_EXTRACT_UI = 0x10000000; 157105925376f8d0f6b318c9938c7b83ef7fef094daThe Android Open Source Project 158105925376f8d0f6b318c9938c7b83ef7fef094daThe Android Open Source Project /** 159c1a11f17a2de18911317d235ff75fa17e098a962Jean Chalard * Flag of {@link #imeOptions}: used in conjunction with one of the actions 160c1a11f17a2de18911317d235ff75fa17e098a962Jean Chalard * masked by {@link #IME_MASK_ACTION}, this indicates that the action 161c1a11f17a2de18911317d235ff75fa17e098a962Jean Chalard * should not be available as an accessory button on the right of the extracted 162c1a11f17a2de18911317d235ff75fa17e098a962Jean Chalard * text when the input method is full-screen. Note that by setting this flag, 163c1a11f17a2de18911317d235ff75fa17e098a962Jean Chalard * there can be cases where the action is simply never available to the 164c1a11f17a2de18911317d235ff75fa17e098a962Jean Chalard * user. Setting this generally means that you think that in fullscreen mode, 165c1a11f17a2de18911317d235ff75fa17e098a962Jean Chalard * where there is little space to show the text, it's not worth taking some 166c1a11f17a2de18911317d235ff75fa17e098a962Jean Chalard * screen real estate to display the action and it should be used instead 167c1a11f17a2de18911317d235ff75fa17e098a962Jean Chalard * to show more text. 168105925376f8d0f6b318c9938c7b83ef7fef094daThe Android Open Source Project */ 169105925376f8d0f6b318c9938c7b83ef7fef094daThe Android Open Source Project public static final int IME_FLAG_NO_ACCESSORY_ACTION = 0x20000000; 170105925376f8d0f6b318c9938c7b83ef7fef094daThe Android Open Source Project 171105925376f8d0f6b318c9938c7b83ef7fef094daThe Android Open Source Project /** 172c1a11f17a2de18911317d235ff75fa17e098a962Jean Chalard * Flag of {@link #imeOptions}: used in conjunction with one of the actions 173c1a11f17a2de18911317d235ff75fa17e098a962Jean Chalard * masked by {@link #IME_MASK_ACTION}. If this flag is not set, IMEs will 174c1a11f17a2de18911317d235ff75fa17e098a962Jean Chalard * normally replace the "enter" key with the action supplied. This flag 175c1a11f17a2de18911317d235ff75fa17e098a962Jean Chalard * indicates that the action should not be available in-line as a replacement 176c1a11f17a2de18911317d235ff75fa17e098a962Jean Chalard * for the "enter" key. Typically this is because the action has such a 177c1a11f17a2de18911317d235ff75fa17e098a962Jean Chalard * significant impact or is not recoverable enough that accidentally hitting 178c1a11f17a2de18911317d235ff75fa17e098a962Jean Chalard * it should be avoided, such as sending a message. Note that 179c1a11f17a2de18911317d235ff75fa17e098a962Jean Chalard * {@link android.widget.TextView} will automatically set this flag for you 180c1a11f17a2de18911317d235ff75fa17e098a962Jean Chalard * on multi-line text views. 1819066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project */ 1829066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project public static final int IME_FLAG_NO_ENTER_ACTION = 0x40000000; 1832edd68260f26cbd6eddd0df16404bb6bcb22b3b6Leon Scroggins 1842edd68260f26cbd6eddd0df16404bb6bcb22b3b6Leon Scroggins /** 185c1a11f17a2de18911317d235ff75fa17e098a962Jean Chalard * Flag of {@link #imeOptions}: used to request an IME that is capable of 186c8f4183669c7cf166ced70bf60ad056482f3390bKen Wakasa * inputting ASCII characters. The intention of this flag is to ensure that 187c1a11f17a2de18911317d235ff75fa17e098a962Jean Chalard * the user can type Roman alphabet characters in a {@link android.widget.TextView}. 188c1a11f17a2de18911317d235ff75fa17e098a962Jean Chalard * It is typically used for an account ID or password input. A lot of the time, 189c1a11f17a2de18911317d235ff75fa17e098a962Jean Chalard * IMEs are already able to input ASCII even without being told so (such IMEs 190c1a11f17a2de18911317d235ff75fa17e098a962Jean Chalard * already respect this flag in a sense), but there are cases when this is not 191c1a11f17a2de18911317d235ff75fa17e098a962Jean Chalard * the default. For instance, users of languages using a different script like 192c1a11f17a2de18911317d235ff75fa17e098a962Jean Chalard * Arabic, Greek, Hebrew or Russian typically have a keyboard that can't 193c1a11f17a2de18911317d235ff75fa17e098a962Jean Chalard * input ASCII characters by default. Applications need to be 194c1a11f17a2de18911317d235ff75fa17e098a962Jean Chalard * aware that the flag is not a guarantee, and some IMEs may not respect it. 195c8f4183669c7cf166ced70bf60ad056482f3390bKen Wakasa * However, it is strongly recommended for IME authors to respect this flag 196c1a11f17a2de18911317d235ff75fa17e098a962Jean Chalard * especially when their IME could end up with a state where only languages 197c1a11f17a2de18911317d235ff75fa17e098a962Jean Chalard * using non-ASCII are enabled. 198c8f4183669c7cf166ced70bf60ad056482f3390bKen Wakasa */ 199c8f4183669c7cf166ced70bf60ad056482f3390bKen Wakasa public static final int IME_FLAG_FORCE_ASCII = 0x80000000; 200c8f4183669c7cf166ced70bf60ad056482f3390bKen Wakasa 201c8f4183669c7cf166ced70bf60ad056482f3390bKen Wakasa /** 202b2a3dd88a53cc8c6d19f6dc8ec4f3d6c4abd9b54The Android Open Source Project * Generic unspecified type for {@link #imeOptions}. 2039066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project */ 204b2a3dd88a53cc8c6d19f6dc8ec4f3d6c4abd9b54The Android Open Source Project public static final int IME_NULL = 0x00000000; 2059066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project 2069066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project /** 2079066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * Extended type information for the editor, to help the IME better 2089066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * integrate with it. 2099066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project */ 210b2a3dd88a53cc8c6d19f6dc8ec4f3d6c4abd9b54The Android Open Source Project public int imeOptions = IME_NULL; 2119066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project 2129066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project /** 2139066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * A string supplying additional information options that are 2149066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * private to a particular IME implementation. The string must be 2159066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * scoped to a package owned by the implementation, to ensure there are 2169066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * no conflicts between implementations, but other than that you can put 2179066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * whatever you want in it to communicate with the IME. For example, 2189066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * you could have a string that supplies an argument like 2199066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * <code>"com.example.myapp.SpecialMode=3"</code>. This field is can be 2209066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * filled in from the {@link android.R.attr#privateImeOptions} 2219066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * attribute of a TextView. 2229066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project */ 2239066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project public String privateImeOptions = null; 2249066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project 2259066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project /** 2269066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * In some cases an IME may be able to display an arbitrary label for 227c1a11f17a2de18911317d235ff75fa17e098a962Jean Chalard * a command the user can perform, which you can specify here. This is 228c1a11f17a2de18911317d235ff75fa17e098a962Jean Chalard * typically used as the label for the action to use in-line as a replacement 229c1a11f17a2de18911317d235ff75fa17e098a962Jean Chalard * for the "enter" key (see {@link #actionId}). Remember the key where 230c1a11f17a2de18911317d235ff75fa17e098a962Jean Chalard * this will be displayed is typically very small, and there are significant 231c1a11f17a2de18911317d235ff75fa17e098a962Jean Chalard * localization challenges to make this fit in all supported languages. Also 232c1a11f17a2de18911317d235ff75fa17e098a962Jean Chalard * you can not count absolutely on this being used, as some IMEs may 233c1a11f17a2de18911317d235ff75fa17e098a962Jean Chalard * ignore this. 2349066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project */ 2359066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project public CharSequence actionLabel = null; 2369066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project 2379066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project /** 2389066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * If {@link #actionLabel} has been given, this is the id for that command 2399066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * when the user presses its button that is delivered back with 2409066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * {@link InputConnection#performEditorAction(int) 2419066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * InputConnection.performEditorAction()}. 2429066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project */ 2439066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project public int actionId = 0; 2449066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project 2459066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project /** 2469066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * The text offset of the start of the selection at the time editing 247c1a11f17a2de18911317d235ff75fa17e098a962Jean Chalard * began; -1 if not known. Keep in mind some IMEs may not be able 248c1a11f17a2de18911317d235ff75fa17e098a962Jean Chalard * to give their full feature set without knowing the cursor position; 249c1a11f17a2de18911317d235ff75fa17e098a962Jean Chalard * avoid passing -1 here if you can. 2509066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project */ 2519066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project public int initialSelStart = -1; 2529066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project 2539066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project /** 2549066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * The text offset of the end of the selection at the time editing 255c1a11f17a2de18911317d235ff75fa17e098a962Jean Chalard * began; -1 if not known. Keep in mind some IMEs may not be able 256c1a11f17a2de18911317d235ff75fa17e098a962Jean Chalard * to give their full feature set without knowing the cursor position; 257c1a11f17a2de18911317d235ff75fa17e098a962Jean Chalard * avoid passing -1 here if you can. 2589066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project */ 2599066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project public int initialSelEnd = -1; 2609066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project 2619066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project /** 2629066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * The capitalization mode of the first character being edited in the 2639066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * text. Values may be any combination of 2649066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * {@link TextUtils#CAP_MODE_CHARACTERS TextUtils.CAP_MODE_CHARACTERS}, 2659066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * {@link TextUtils#CAP_MODE_WORDS TextUtils.CAP_MODE_WORDS}, and 2669066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * {@link TextUtils#CAP_MODE_SENTENCES TextUtils.CAP_MODE_SENTENCES}, though 2679066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * you should generally just take a non-zero value to mean start out in 2689066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * caps mode. 2699066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project */ 2709066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project public int initialCapsMode = 0; 2719066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project 2729066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project /** 2739066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * The "hint" text of the text view, typically shown in-line when the 2749066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * text is empty to tell the user what to enter. 2759066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project */ 2769066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project public CharSequence hintText; 2779066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project 2789066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project /** 2799066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * A label to show to the user describing the text they are writing. 2809066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project */ 2819066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project public CharSequence label; 2829066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project 2839066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project /** 2849066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * Name of the package that owns this editor. 2859066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project */ 2869066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project public String packageName; 2879066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project 2889066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project /** 2899066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * Identifier for the editor's field. This is optional, and may be 2909066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * 0. By default it is filled in with the result of 2919066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * {@link android.view.View#getId() View.getId()} on the View that 2929066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * is being edited. 2939066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project */ 2949066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project public int fieldId; 2959066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project 2969066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project /** 2979066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * Additional name for the editor's field. This can supply additional 2989066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * name information for the field. By default it is null. The actual 2999066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * contents have no meaning. 3009066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project */ 3019066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project public String fieldName; 3029066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project 3039066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project /** 3049066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * Any extra data to supply to the input method. This is for extended 3059066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * communication with specific input methods; the name fields in the 3069066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * bundle should be scoped (such as "com.mydomain.im.SOME_FIELD") so 307c1a11f17a2de18911317d235ff75fa17e098a962Jean Chalard * that they don't conflict with others. This field can be 3089066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * filled in from the {@link android.R.attr#editorExtras} 3099066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * attribute of a TextView. 3109066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project */ 3119066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project public Bundle extras; 3129066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project 3139066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project /** 314dea3ef7967228f0ddcc03f2455a4f1254758e584Dianne Hackborn * Ensure that the data in this EditorInfo is compatible with an application 315dea3ef7967228f0ddcc03f2455a4f1254758e584Dianne Hackborn * that was developed against the given target API version. This can 316dea3ef7967228f0ddcc03f2455a4f1254758e584Dianne Hackborn * impact the following input types: 317dea3ef7967228f0ddcc03f2455a4f1254758e584Dianne Hackborn * {@link InputType#TYPE_TEXT_VARIATION_WEB_EMAIL_ADDRESS}, 31882d731ac5d28fb54c49948116786813a62b07b8bKen Wakasa * {@link InputType#TYPE_TEXT_VARIATION_WEB_PASSWORD}, 31982d731ac5d28fb54c49948116786813a62b07b8bKen Wakasa * {@link InputType#TYPE_NUMBER_VARIATION_NORMAL}, 32082d731ac5d28fb54c49948116786813a62b07b8bKen Wakasa * {@link InputType#TYPE_NUMBER_VARIATION_PASSWORD}. 321dea3ef7967228f0ddcc03f2455a4f1254758e584Dianne Hackborn * 322dea3ef7967228f0ddcc03f2455a4f1254758e584Dianne Hackborn * <p>This is called by the framework for input method implementations; 323dea3ef7967228f0ddcc03f2455a4f1254758e584Dianne Hackborn * you should not generally need to call it yourself. 324dea3ef7967228f0ddcc03f2455a4f1254758e584Dianne Hackborn * 325dea3ef7967228f0ddcc03f2455a4f1254758e584Dianne Hackborn * @param targetSdkVersion The API version number that the compatible 326dea3ef7967228f0ddcc03f2455a4f1254758e584Dianne Hackborn * application was developed against. 327dea3ef7967228f0ddcc03f2455a4f1254758e584Dianne Hackborn */ 328dea3ef7967228f0ddcc03f2455a4f1254758e584Dianne Hackborn public final void makeCompatible(int targetSdkVersion) { 329dea3ef7967228f0ddcc03f2455a4f1254758e584Dianne Hackborn if (targetSdkVersion < android.os.Build.VERSION_CODES.HONEYCOMB) { 330dea3ef7967228f0ddcc03f2455a4f1254758e584Dianne Hackborn switch (inputType&(TYPE_MASK_CLASS|TYPE_MASK_VARIATION)) { 331dea3ef7967228f0ddcc03f2455a4f1254758e584Dianne Hackborn case TYPE_CLASS_TEXT|TYPE_TEXT_VARIATION_WEB_EMAIL_ADDRESS: 332dea3ef7967228f0ddcc03f2455a4f1254758e584Dianne Hackborn inputType = TYPE_CLASS_TEXT|TYPE_TEXT_VARIATION_EMAIL_ADDRESS 33382d731ac5d28fb54c49948116786813a62b07b8bKen Wakasa | (inputType&TYPE_MASK_FLAGS); 334dea3ef7967228f0ddcc03f2455a4f1254758e584Dianne Hackborn break; 335dea3ef7967228f0ddcc03f2455a4f1254758e584Dianne Hackborn case TYPE_CLASS_TEXT|TYPE_TEXT_VARIATION_WEB_PASSWORD: 336dea3ef7967228f0ddcc03f2455a4f1254758e584Dianne Hackborn inputType = TYPE_CLASS_TEXT|TYPE_TEXT_VARIATION_PASSWORD 33782d731ac5d28fb54c49948116786813a62b07b8bKen Wakasa | (inputType&TYPE_MASK_FLAGS); 33882d731ac5d28fb54c49948116786813a62b07b8bKen Wakasa break; 33982d731ac5d28fb54c49948116786813a62b07b8bKen Wakasa case TYPE_CLASS_NUMBER|TYPE_NUMBER_VARIATION_NORMAL: 34082d731ac5d28fb54c49948116786813a62b07b8bKen Wakasa case TYPE_CLASS_NUMBER|TYPE_NUMBER_VARIATION_PASSWORD: 34182d731ac5d28fb54c49948116786813a62b07b8bKen Wakasa inputType = TYPE_CLASS_NUMBER 34282d731ac5d28fb54c49948116786813a62b07b8bKen Wakasa | (inputType&TYPE_MASK_FLAGS); 343dea3ef7967228f0ddcc03f2455a4f1254758e584Dianne Hackborn break; 344dea3ef7967228f0ddcc03f2455a4f1254758e584Dianne Hackborn } 345dea3ef7967228f0ddcc03f2455a4f1254758e584Dianne Hackborn } 346dea3ef7967228f0ddcc03f2455a4f1254758e584Dianne Hackborn } 347dea3ef7967228f0ddcc03f2455a4f1254758e584Dianne Hackborn 348dea3ef7967228f0ddcc03f2455a4f1254758e584Dianne Hackborn /** 3499066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * Write debug output of this object. 3509066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project */ 3519066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project public void dump(Printer pw, String prefix) { 3529066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project pw.println(prefix + "inputType=0x" + Integer.toHexString(inputType) 3539066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project + " imeOptions=0x" + Integer.toHexString(imeOptions) 3549066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project + " privateImeOptions=" + privateImeOptions); 3559066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project pw.println(prefix + "actionLabel=" + actionLabel 3569066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project + " actionId=" + actionId); 3579066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project pw.println(prefix + "initialSelStart=" + initialSelStart 3589066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project + " initialSelEnd=" + initialSelEnd 3599066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project + " initialCapsMode=0x" 3609066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project + Integer.toHexString(initialCapsMode)); 3619066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project pw.println(prefix + "hintText=" + hintText 3629066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project + " label=" + label); 3639066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project pw.println(prefix + "packageName=" + packageName 3649066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project + " fieldId=" + fieldId 3659066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project + " fieldName=" + fieldName); 3669066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project pw.println(prefix + "extras=" + extras); 3679066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project } 3689066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project 3699066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project /** 3709066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * Used to package this object into a {@link Parcel}. 3719066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * 3729066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * @param dest The {@link Parcel} to be written. 3739066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * @param flags The flags used for parceling. 3749066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project */ 3759066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project public void writeToParcel(Parcel dest, int flags) { 3769066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project dest.writeInt(inputType); 3779066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project dest.writeInt(imeOptions); 3789066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project dest.writeString(privateImeOptions); 3799066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project TextUtils.writeToParcel(actionLabel, dest, flags); 3809066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project dest.writeInt(actionId); 3819066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project dest.writeInt(initialSelStart); 3829066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project dest.writeInt(initialSelEnd); 3839066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project dest.writeInt(initialCapsMode); 3849066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project TextUtils.writeToParcel(hintText, dest, flags); 3859066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project TextUtils.writeToParcel(label, dest, flags); 3869066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project dest.writeString(packageName); 3879066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project dest.writeInt(fieldId); 3889066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project dest.writeString(fieldName); 3899066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project dest.writeBundle(extras); 3909066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project } 3919066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project 3929066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project /** 3939066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * Used to make this class parcelable. 3949066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project */ 3959066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project public static final Parcelable.Creator<EditorInfo> CREATOR = new Parcelable.Creator<EditorInfo>() { 3969066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project public EditorInfo createFromParcel(Parcel source) { 3979066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project EditorInfo res = new EditorInfo(); 3989066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project res.inputType = source.readInt(); 3999066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project res.imeOptions = source.readInt(); 4009066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project res.privateImeOptions = source.readString(); 4019066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project res.actionLabel = TextUtils.CHAR_SEQUENCE_CREATOR.createFromParcel(source); 4029066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project res.actionId = source.readInt(); 4039066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project res.initialSelStart = source.readInt(); 4049066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project res.initialSelEnd = source.readInt(); 4059066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project res.initialCapsMode = source.readInt(); 4069066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project res.hintText = TextUtils.CHAR_SEQUENCE_CREATOR.createFromParcel(source); 4079066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project res.label = TextUtils.CHAR_SEQUENCE_CREATOR.createFromParcel(source); 4089066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project res.packageName = source.readString(); 4099066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project res.fieldId = source.readInt(); 4109066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project res.fieldName = source.readString(); 4119066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project res.extras = source.readBundle(); 4129066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project return res; 4139066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project } 4149066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project 4159066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project public EditorInfo[] newArray(int size) { 4169066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project return new EditorInfo[size]; 4179066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project } 4189066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project }; 4199066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project 4209066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project public int describeContents() { 4219066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project return 0; 4229066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project } 4239066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project 4249066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project} 425