OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_BASE_IME_INPUT_METHOD_H_ | 5 #ifndef UI_BASE_IME_INPUT_METHOD_H_ |
6 #define UI_BASE_IME_INPUT_METHOD_H_ | 6 #define UI_BASE_IME_INPUT_METHOD_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
11 #include "base/event_types.h" | 11 #include "base/event_types.h" |
12 #include "base/i18n/rtl.h" | 12 #include "base/i18n/rtl.h" |
| 13 #include "ui/base/ime/text_input_mode.h" |
13 #include "ui/base/ime/text_input_type.h" | 14 #include "ui/base/ime/text_input_type.h" |
14 #include "ui/base/keycodes/keyboard_codes.h" | 15 #include "ui/base/keycodes/keyboard_codes.h" |
15 #include "ui/base/ui_export.h" | 16 #include "ui/base/ui_export.h" |
16 | 17 |
17 namespace ui { | 18 namespace ui { |
18 | 19 |
19 namespace internal { | 20 namespace internal { |
20 class InputMethodDelegate; | 21 class InputMethodDelegate; |
21 } // namespace internal | 22 } // namespace internal |
22 | 23 |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
133 | 134 |
134 // Checks if the input method is active, i.e. if it's ready for processing | 135 // Checks if the input method is active, i.e. if it's ready for processing |
135 // keyboard event and generate composition or text result. | 136 // keyboard event and generate composition or text result. |
136 // If the input method is inactive, then it's not necessary to inform it the | 137 // If the input method is inactive, then it's not necessary to inform it the |
137 // changes of caret bounds and text input type. | 138 // changes of caret bounds and text input type. |
138 // Note: character results may still be generated and sent to the text input | 139 // Note: character results may still be generated and sent to the text input |
139 // client by calling TextInputClient::InsertChar(), even if the input method | 140 // client by calling TextInputClient::InsertChar(), even if the input method |
140 // is not active. | 141 // is not active. |
141 virtual bool IsActive() = 0; | 142 virtual bool IsActive() = 0; |
142 | 143 |
| 144 // TODO(yoichio): Following 3 methods(GetTextInputType, GetTextInputMode and |
| 145 // CanComposeInline) calls client's same method and returns its value. It is |
| 146 // not InputMethod itself's infomation. So rename these to |
| 147 // GetClientTextInputType and so on. |
143 // Gets the text input type of the focused text input client. Returns | 148 // Gets the text input type of the focused text input client. Returns |
144 // ui::TEXT_INPUT_TYPE_NONE if there is no focused client. | 149 // ui::TEXT_INPUT_TYPE_NONE if there is no focused client. |
145 virtual TextInputType GetTextInputType() const = 0; | 150 virtual TextInputType GetTextInputType() const = 0; |
146 | 151 |
| 152 // Gets the text input mode of the focused text input client. Returns |
| 153 // ui::TEXT_INPUT_TYPE_DEFAULT if there is no focused client. |
| 154 virtual TextInputMode GetTextInputMode() const = 0; |
| 155 |
147 // Checks if the focused text input client supports inline composition. | 156 // Checks if the focused text input client supports inline composition. |
148 virtual bool CanComposeInline() const = 0; | 157 virtual bool CanComposeInline() const = 0; |
149 | 158 |
150 // Returns true if we know for sure that a candidate window (or IME suggest, | 159 // Returns true if we know for sure that a candidate window (or IME suggest, |
151 // etc.) is open. Returns false if no popup window is open or the detection | 160 // etc.) is open. Returns false if no popup window is open or the detection |
152 // of IME popups is not supported. | 161 // of IME popups is not supported. |
153 virtual bool IsCandidatePopupOpen() const = 0; | 162 virtual bool IsCandidatePopupOpen() const = 0; |
154 | 163 |
155 // Management of the observer list. | 164 // Management of the observer list. |
156 virtual void AddObserver(InputMethodObserver* observer) = 0; | 165 virtual void AddObserver(InputMethodObserver* observer) = 0; |
157 virtual void RemoveObserver(InputMethodObserver* observer) = 0; | 166 virtual void RemoveObserver(InputMethodObserver* observer) = 0; |
158 }; | 167 }; |
159 | 168 |
160 } // namespace ui | 169 } // namespace ui |
161 | 170 |
162 #endif // UI_BASE_IME_INPUT_METHOD_H_ | 171 #endif // UI_BASE_IME_INPUT_METHOD_H_ |
OLD | NEW |