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" |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
114 // This method is currently used only on Windows. | 114 // This method is currently used only on Windows. |
115 // This method does not take a parameter of TextInputClient for historical | 115 // This method does not take a parameter of TextInputClient for historical |
116 // reasons. | 116 // reasons. |
117 // TODO(ime): Consider to take a parameter of TextInputClient. | 117 // TODO(ime): Consider to take a parameter of TextInputClient. |
118 virtual void OnInputLocaleChanged() = 0; | 118 virtual void OnInputLocaleChanged() = 0; |
119 | 119 |
120 // Returns the locale of current keyboard layout or input method, as a BCP-47 | 120 // Returns the locale of current keyboard layout or input method, as a BCP-47 |
121 // tag, or an empty string if the input method cannot provide it. | 121 // tag, or an empty string if the input method cannot provide it. |
122 virtual std::string GetInputLocale() = 0; | 122 virtual std::string GetInputLocale() = 0; |
123 | 123 |
124 // Checks if the input method is active, i.e. if it's ready for processing | |
125 // keyboard event and generate composition or text result. | |
126 // If the input method is inactive, then it's not necessary to inform it the | |
127 // changes of caret bounds and text input type. | |
128 // Note: character results may still be generated and sent to the text input | |
129 // client by calling TextInputClient::InsertChar(), even if the input method | |
130 // is not active. | |
131 virtual bool IsActive() = 0; | |
132 | |
133 // TODO(yoichio): Following 3 methods(GetTextInputType, GetTextInputMode and | 124 // TODO(yoichio): Following 3 methods(GetTextInputType, GetTextInputMode and |
134 // CanComposeInline) calls client's same method and returns its value. It is | 125 // CanComposeInline) calls client's same method and returns its value. It is |
135 // not InputMethod itself's infomation. So rename these to | 126 // not InputMethod itself's infomation. So rename these to |
136 // GetClientTextInputType and so on. | 127 // GetClientTextInputType and so on. |
137 // Gets the text input type of the focused text input client. Returns | 128 // Gets the text input type of the focused text input client. Returns |
138 // ui::TEXT_INPUT_TYPE_NONE if there is no focused client. | 129 // ui::TEXT_INPUT_TYPE_NONE if there is no focused client. |
139 virtual TextInputType GetTextInputType() const = 0; | 130 virtual TextInputType GetTextInputType() const = 0; |
140 | 131 |
141 // Gets the text input mode of the focused text input client. Returns | 132 // Gets the text input mode of the focused text input client. Returns |
142 // ui::TEXT_INPUT_TYPE_DEFAULT if there is no focused client. | 133 // ui::TEXT_INPUT_TYPE_DEFAULT if there is no focused client. |
(...skipping 15 matching lines...) Expand all Loading... |
158 virtual void ShowImeIfNeeded() = 0; | 149 virtual void ShowImeIfNeeded() = 0; |
159 | 150 |
160 // Management of the observer list. | 151 // Management of the observer list. |
161 virtual void AddObserver(InputMethodObserver* observer) = 0; | 152 virtual void AddObserver(InputMethodObserver* observer) = 0; |
162 virtual void RemoveObserver(InputMethodObserver* observer) = 0; | 153 virtual void RemoveObserver(InputMethodObserver* observer) = 0; |
163 }; | 154 }; |
164 | 155 |
165 } // namespace ui | 156 } // namespace ui |
166 | 157 |
167 #endif // UI_BASE_IME_INPUT_METHOD_H_ | 158 #endif // UI_BASE_IME_INPUT_METHOD_H_ |
OLD | NEW |