OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 module mojo; | 5 module mojo; |
6 | 6 |
7 // Text input type which is based on blink::WebTextInputType. | 7 // Text input type which is based on blink::WebTextInputType. |
8 enum TextInputType { | 8 enum TextInputType { |
9 NONE, | 9 NONE, |
10 TEXT, | 10 TEXT, |
11 PASSWORD, | 11 PASSWORD, |
12 SEARCH, | 12 SEARCH, |
13 EMAIL, | 13 EMAIL, |
14 NUMBER, | 14 NUMBER, |
15 TELEPHONE, | 15 TELEPHONE, |
16 URL, | 16 URL, |
17 DATE, | 17 DATE, |
18 DATE_TIME, | 18 DATE_TIME, |
19 DATE_TIME_LOCAL, | 19 DATE_TIME_LOCAL, |
20 MONTH, | 20 MONTH, |
21 TIME, | 21 TIME, |
22 WEEK, | 22 WEEK, |
23 TEXT_AREA, | 23 TEXT_AREA, |
24 LAST = TEXT_AREA, | 24 LAST = TEXT_AREA, |
25 }; | 25 }; |
26 | 26 |
27 // Text input flag which is based on blink::WebTextInputFlags. | 27 // Text input flag which is based on blink::WebTextInputFlags. |
28 enum TextInputFlag { | 28 enum TextInputFlag { |
29 NONE, | 29 NONE, |
30 AUTO_COMPLETE_ON = 0x001, | 30 AUTOCOMPLETE_ON = 0x001, |
31 AUTO_COMPLETE_OFF = 0x002, | 31 AUTOCOMPLETE_OFF = 0x002, |
32 AUTO_CORRECT_ON = 0x004, | 32 AUTOCORRECT_ON = 0x004, |
33 AUTO_CORRECT_OFF = 0x008, | 33 AUTOCORRECT_OFF = 0x008, |
34 SPELL_CHECK_ON = 0x010, | 34 SPELLCHECK_ON = 0x010, |
35 SPELL_CHECK_OFF = 0x020, | 35 SPELLCHECK_OFF = 0x020, |
36 AUTO_CAPITALIZE_NONE = 0x040, | 36 AUTOCAPITALIZE_NONE = 0x040, |
37 AUTO_CAPITALIZE_CHARACTERS = 0x080, | 37 AUTOCAPITALIZE_CHARACTERS = 0x080, |
38 AUTO_CAPITALIZE_WORDS = 0x100, | 38 AUTOCAPITALIZE_WORDS = 0x100, |
39 AUTO_CAPITALIZE_SENTENCES = 0x200, | 39 AUTOCAPITALIZE_SENTENCES = 0x200, |
40 ALL = 0x3FF, | 40 ALL = 0x3FF, |
41 }; | 41 }; |
42 | 42 |
43 // Text input info which is based on blink::WebTextInputInfo. | 43 // Text input info which is based on blink::WebTextInputInfo. |
44 struct TextInputState { | 44 struct TextInputState { |
45 // The type of input field. | 45 // The type of input field. |
46 TextInputType type; | 46 TextInputType type; |
47 | 47 |
48 // The flags of the input field (autocorrect, autocomplete, etc.). | 48 // The flags of the input field (autocorrect, autocomplete, etc.). |
49 int32 flags; | 49 int32 flags; |
50 | 50 |
51 // The value of the input field. | 51 // The value of the input field. |
52 string text; | 52 string? text; |
53 | 53 |
54 // The cursor position of the current selection start, or the caret position | 54 // The cursor position of the current selection start, or the caret position |
55 // if nothing is selected. | 55 // if nothing is selected. |
56 int32 selection_start; | 56 int32 selection_start; |
57 | 57 |
58 // The cursor position of the current selection end, or the caret position | 58 // The cursor position of the current selection end, or the caret position |
59 // if nothing is selected. | 59 // if nothing is selected. |
60 int32 selection_end; | 60 int32 selection_end; |
61 | 61 |
62 // The start position of the current composition, or -1 if there is none. | 62 // The start position of the current composition, or -1 if there is none. |
63 int32 composition_start; | 63 int32 composition_start; |
64 | 64 |
65 // The end position of the current composition, or -1 if there is none. | 65 // The end position of the current composition, or -1 if there is none. |
66 int32 composition_end; | 66 int32 composition_end; |
67 | 67 |
68 // Whether or not inline composition can be performed for the current input. | 68 // Whether or not inline composition can be performed for the current input. |
69 bool can_compose_inline; | 69 bool can_compose_inline; |
70 }; | 70 }; |
OLD | NEW |