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