1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
7 // Text input type which is based on blink::WebTextInputType.
26 // Text input flag which is based on blink::WebTextInputFlags.
29 AUTO_COMPLETE_ON = 0x001,
30 AUTO_COMPLETE_OFF = 0x002,
31 AUTO_CORRECT_ON = 0x004,
32 AUTO_CORRECT_OFF = 0x010,
33 SPELL_CHECK_ON = 0x020,
34 SPELL_CHECK_OFF = 0x040,
35 AUTO_CAPITALIZE_NONE = 0x080,
36 AUTO_CAPITALIZE_CHARACTERS = 0x100,
37 AUTO_CAPITALIZE_WORDS = 0x200,
38 AUTO_CAPITALIZE_SENTENCES = 0x400,
41 // Text input info which is based on blink::WebTextInputInfo.
42 struct TextInputState {
43 // The type of input field.
46 // The flags of the input field (autocorrect, autocomplete, etc.).
49 // The value of the input field.
52 // The cursor position of the current selection start, or the caret position
53 // if nothing is selected.
54 int32 selection_start;
56 // The cursor position of the current selection end, or the caret position
57 // if nothing is selected.
60 // The start position of the current composition, or -1 if there is none.
61 int32 composition_start;
63 // The end position of the current composition, or -1 if there is none.
64 int32 composition_end;
66 // Whether or not inline composition can be performed for the current input.
67 bool can_compose_inline;
69 // Whether or not the IME should be shown as a result of this update. Even if
70 // true, the IME will only be shown if the type is appropriate (e.g. not
71 // TEXT_INPUT_TYPE_NONE).
72 bool show_ime_if_needed;