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 #ifndef UI_PLATFORM_WINDOW_TEXT_INPUT_STATE_H_ | 5 #ifndef UI_PLATFORM_WINDOW_TEXT_INPUT_STATE_H_ |
6 #define UI_PLATFORM_WINDOW_TEXT_INPUT_STATE_H_ | 6 #define UI_PLATFORM_WINDOW_TEXT_INPUT_STATE_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
| 10 #include "ui/base/ime/text_input_flags.h" |
| 11 #include "ui/base/ime/text_input_type.h" |
| 12 |
10 namespace ui { | 13 namespace ui { |
11 | 14 |
12 // Text input type which is based on blink::WebTextInputType. | |
13 enum TextInputType { | |
14 TEXT_INPUT_TYPE_NONE, | |
15 TEXT_INPUT_TYPE_TEXT, | |
16 TEXT_INPUT_TYPE_PASSWORD, | |
17 TEXT_INPUT_TYPE_SEARCH, | |
18 TEXT_INPUT_TYPE_EMAIL, | |
19 TEXT_INPUT_TYPE_NUMBER, | |
20 TEXT_INPUT_TYPE_TELEPHONE, | |
21 TEXT_INPUT_TYPE_URL, | |
22 TEXT_INPUT_TYPE_DATE, | |
23 TEXT_INPUT_TYPE_DATE_TIME, | |
24 TEXT_INPUT_TYPE_DATE_TIME_LOCAL, | |
25 TEXT_INPUT_TYPE_MONTH, | |
26 TEXT_INPUT_TYPE_TIME, | |
27 TEXT_INPUT_TYPE_WEEK, | |
28 TEXT_INPUT_TYPE_TEXT_AREA, | |
29 TEXT_INPUT_TYPE_LAST = TEXT_INPUT_TYPE_TEXT_AREA, | |
30 }; | |
31 | |
32 // Text input flag which is based on blink::WebTextInputFlags. | |
33 enum TextInputFlag { | |
34 TEXT_INPUT_FLAG_NONE, | |
35 TEXT_INPUT_FLAG_AUTO_COMPLETE_ON = 1 << 0, | |
36 TEXT_INPUT_FLAG_AUTO_COMPLETE_OFF = 1 << 1, | |
37 TEXT_INPUT_FLAG_AUTO_CORRECT_ON = 1 << 2, | |
38 TEXT_INPUT_FLAG_AUTO_CORRECT_OFF = 1 << 3, | |
39 TEXT_INPUT_FLAG_SPELL_CHECK_ON = 1 << 4, | |
40 TEXT_INPUT_FLAG_SPELL_CHECK_OFF = 1 << 5, | |
41 TEXT_INPUT_FLAG_AUTO_CAPITALIZE_NONE = 1 << 6, | |
42 TEXT_INPUT_FLAG_AUTO_CAPITALIZE_CHARACTERS = 1 << 7, | |
43 TEXT_INPUT_FLAG_AUTO_CAPITALIZE_WORDS = 1 << 8, | |
44 TEXT_INPUT_FLAG_AUTO_CAPITALIZE_SENTENCES = 1 << 9, | |
45 TEXT_INPUT_FLAG_ALL = (TEXT_INPUT_FLAG_AUTO_CAPITALIZE_SENTENCES << 1) - 1, | |
46 }; | |
47 | |
48 // Text input info which is based on blink::WebTextInputInfo. | 15 // Text input info which is based on blink::WebTextInputInfo. |
49 struct TextInputState { | 16 struct TextInputState { |
50 TextInputState(); | 17 TextInputState(); |
51 TextInputState(TextInputType type, | 18 TextInputState(TextInputType type, |
52 int flags, | 19 int flags, |
53 const std::string& text, | 20 const std::string& text, |
54 int selection_start, | 21 int selection_start, |
55 int selection_end, | 22 int selection_end, |
56 int composition_start, | 23 int composition_start, |
57 int composition_end, | 24 int composition_end, |
(...skipping 23 matching lines...) Expand all Loading... |
81 // The end position of the current composition, or -1 if there is none. | 48 // The end position of the current composition, or -1 if there is none. |
82 int composition_end; | 49 int composition_end; |
83 | 50 |
84 // Whether or not inline composition can be performed for the current input. | 51 // Whether or not inline composition can be performed for the current input. |
85 bool can_compose_inline; | 52 bool can_compose_inline; |
86 }; | 53 }; |
87 | 54 |
88 } // namespace ui | 55 } // namespace ui |
89 | 56 |
90 #endif // UI_PLATFORM_WINDOW_TEXT_INPUT_STATE_H_ | 57 #endif // UI_PLATFORM_WINDOW_TEXT_INPUT_STATE_H_ |
OLD | NEW |