OLD | NEW |
(Empty) | |
| 1 // Copyright 2016 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 #ifndef CONTENT_COMMON_TEXT_INPUT_STATE_H_ |
| 6 #define CONTENT_COMMON_TEXT_INPUT_STATE_H_ |
| 7 |
| 8 #include <string> |
| 9 |
| 10 #include "content/common/content_export.h" |
| 11 #include "ui/base/ime/text_input_mode.h" |
| 12 #include "ui/base/ime/text_input_type.h" |
| 13 |
| 14 namespace content { |
| 15 |
| 16 // The text input state information for handling IME on the browser side. The |
| 17 // text input state information such as type, mode, etc. are used by the input |
| 18 // method to handle IME (the usage is specific to each platform). |
| 19 struct CONTENT_EXPORT TextInputState { |
| 20 TextInputState(); |
| 21 TextInputState(const TextInputState& other); |
| 22 |
| 23 // Type of the input field. |
| 24 ui::TextInputType type; |
| 25 |
| 26 // The mode of input field. |
| 27 ui::TextInputMode mode; |
| 28 |
| 29 // The flags of input field (autocorrect, autocomplete, etc.) |
| 30 int flags; |
| 31 |
| 32 // The value of input field. |
| 33 std::string value; |
| 34 |
| 35 // The cursor position of the current selection start, or the caret position |
| 36 // if nothing is selected. |
| 37 int selection_start; |
| 38 |
| 39 // The cursor position of the current selection end, or the caret position if |
| 40 // nothing is selected. |
| 41 int selection_end; |
| 42 |
| 43 // The start position of the current composition, or -1 if there is none. |
| 44 int composition_start; |
| 45 |
| 46 // The end position of the current composition, or -1 if there is none. |
| 47 int composition_end; |
| 48 |
| 49 // Whether or not inline composition can be performed for the current input. |
| 50 bool can_compose_inline; |
| 51 |
| 52 // Whether or not the IME should be shown as a result of this update. Even if |
| 53 // true, the IME will only be shown if the input is appropriate (e.g. not |
| 54 // TEXT_INPUT_TYPE_NONE). |
| 55 bool show_ime_if_needed; |
| 56 |
| 57 // Whether this change is originated from non-IME (e.g., Javascript, |
| 58 // Autofill). |
| 59 bool is_non_ime_change; |
| 60 }; |
| 61 |
| 62 } // namespace content |
| 63 |
| 64 #endif // CONTENT_COMMON_TEXT_INPUT_STATE_H_ |
OLD | NEW |