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.
5 #ifndef UI_PLATFORM_WINDOW_TEXT_INPUT_STATE_H_
6 #define UI_PLATFORM_WINDOW_TEXT_INPUT_STATE_H_
10 #include "ui/base/ime/text_input_flags.h"
11 #include "ui/base/ime/text_input_type.h"
15 // Text input info which is based on blink::WebTextInputInfo.
16 struct TextInputState
{
18 TextInputState(TextInputType type
,
20 const std::string
& text
,
23 int composition_start
,
25 bool can_compose_inline
);
26 bool operator==(const TextInputState
& other
) const;
28 // The type of input field.
31 // The flags of the input field (autocorrect, autocomplete, etc.).
34 // The value of the input field.
37 // The cursor position of the current selection start, or the caret position
38 // if nothing is selected.
41 // The cursor position of the current selection end, or the caret position
42 // if nothing is selected.
45 // The start position of the current composition, or -1 if there is none.
46 int composition_start
;
48 // The end position of the current composition, or -1 if there is none.
51 // Whether or not inline composition can be performed for the current input.
52 bool can_compose_inline
;
57 #endif // UI_PLATFORM_WINDOW_TEXT_INPUT_STATE_H_