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" | 10 #include "ui/base/ime/text_input_flags.h" |
11 #include "ui/base/ime/text_input_type.h" | 11 #include "ui/base/ime/text_input_type.h" |
12 | 12 |
13 namespace ui { | 13 namespace ui { |
14 | 14 |
15 // Text input info which is based on blink::WebTextInputInfo. | 15 // Text input info which is based on blink::WebTextInputInfo. |
16 struct TextInputState { | 16 struct TextInputState { |
17 TextInputState(); | 17 TextInputState(); |
18 TextInputState(TextInputType type, | 18 TextInputState(TextInputType type, |
19 int flags, | 19 int flags, |
20 const std::string& text, | 20 const std::string& text, |
21 int selection_start, | 21 int selection_start, |
22 int selection_end, | 22 int selection_end, |
23 int composition_start, | 23 int composition_start, |
24 int composition_end, | 24 int composition_end, |
25 bool can_compose_inline); | 25 bool can_compose_inline); |
| 26 TextInputState(const TextInputState& other); |
26 bool operator==(const TextInputState& other) const; | 27 bool operator==(const TextInputState& other) const; |
27 | 28 |
28 // The type of input field. | 29 // The type of input field. |
29 TextInputType type; | 30 TextInputType type; |
30 | 31 |
31 // The flags of the input field (autocorrect, autocomplete, etc.). | 32 // The flags of the input field (autocorrect, autocomplete, etc.). |
32 int flags; | 33 int flags; |
33 | 34 |
34 // The value of the input field. | 35 // The value of the input field. |
35 std::string text; | 36 std::string text; |
(...skipping 12 matching lines...) Expand all Loading... |
48 // The end position of the current composition, or -1 if there is none. | 49 // The end position of the current composition, or -1 if there is none. |
49 int composition_end; | 50 int composition_end; |
50 | 51 |
51 // Whether or not inline composition can be performed for the current input. | 52 // Whether or not inline composition can be performed for the current input. |
52 bool can_compose_inline; | 53 bool can_compose_inline; |
53 }; | 54 }; |
54 | 55 |
55 } // namespace ui | 56 } // namespace ui |
56 | 57 |
57 #endif // UI_PLATFORM_WINDOW_TEXT_INPUT_STATE_H_ | 58 #endif // UI_PLATFORM_WINDOW_TEXT_INPUT_STATE_H_ |
OLD | NEW |