Chromium Code Reviews| 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 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 71 | 71 |
| 72 // Called when the focused window receives native IME messages that are not | 72 // Called when the focused window receives native IME messages that are not |
| 73 // translated into other predefined event callbacks. Currently this method is | 73 // translated into other predefined event callbacks. Currently this method is |
| 74 // used only for IME functionalities specific to Windows. | 74 // used only for IME functionalities specific to Windows. |
| 75 // TODO(ime): Break down these messages into platform-neutral methods. | 75 // TODO(ime): Break down these messages into platform-neutral methods. |
| 76 virtual bool OnUntranslatedIMEMessage(const base::NativeEvent& event, | 76 virtual bool OnUntranslatedIMEMessage(const base::NativeEvent& event, |
| 77 NativeEventResult* result) = 0; | 77 NativeEventResult* result) = 0; |
| 78 | 78 |
| 79 // Sets the text input client which receives text input events such as | 79 // Sets the text input client which receives text input events such as |
| 80 // SetCompositionText(). |client| can be NULL. A gfx::NativeWindow which | 80 // SetCompositionText(). |client| can be NULL. A gfx::NativeWindow which |
| 81 // implementes TextInputClient interface, e.g. NWA and RWHVA, should register | 81 // implements TextInputClient interface, e.g. NWA and RWHVA, should register |
| 82 // itself by calling the method when it is focused, and unregister itself by | 82 // itself by calling the method when it is focused, and unregister itself by |
| 83 // calling the method with NULL when it is unfocused. | 83 // calling the method with NULL when it is unfocused. |
| 84 virtual void SetFocusedTextInputClient(TextInputClient* client) = 0; | 84 virtual void SetFocusedTextInputClient(TextInputClient* client) = 0; |
| 85 | 85 |
| 86 // Detaches and forgets the |client| regardless of whether it has the focus or | 86 // Detaches and forgets the |client| regardless of whether it has the focus or |
| 87 // not. This method is meant to be called when the |client| is going to be | 87 // not. This method is meant to be called when the |client| is going to be |
| 88 // destroyed. | 88 // destroyed. |
| 89 virtual void DetachTextInputClient(TextInputClient* client) = 0; | 89 virtual void DetachTextInputClient(TextInputClient* client) = 0; |
| 90 | 90 |
| 91 // Gets the current text input client. Returns NULL when no client is set. | 91 // Gets the current text input client. Returns NULL when no client is set. |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 129 // keyboard event and generate composition or text result. | 129 // keyboard event and generate composition or text result. |
| 130 // If the input method is inactive, then it's not necessary to inform it the | 130 // If the input method is inactive, then it's not necessary to inform it the |
| 131 // changes of caret bounds and text input type. | 131 // changes of caret bounds and text input type. |
| 132 // Note: character results may still be generated and sent to the text input | 132 // Note: character results may still be generated and sent to the text input |
| 133 // client by calling TextInputClient::InsertChar(), even if the input method | 133 // client by calling TextInputClient::InsertChar(), even if the input method |
| 134 // is not active. | 134 // is not active. |
| 135 virtual bool IsActive() = 0; | 135 virtual bool IsActive() = 0; |
| 136 | 136 |
| 137 // TODO(yoichio): Following 3 methods(GetTextInputType, GetTextInputMode and | 137 // TODO(yoichio): Following 3 methods(GetTextInputType, GetTextInputMode and |
| 138 // CanComposeInline) calls client's same method and returns its value. It is | 138 // CanComposeInline) calls client's same method and returns its value. It is |
| 139 // not InputMethod itself's infomation. So rename these to | 139 // not InputMethod itself's information. So rename these to |
| 140 // GetClientTextInputType and so on. | 140 // GetClientTextInputType and so on. |
| 141 // Gets the text input type of the focused text input client. Returns | 141 // Gets the text input type of the focused text input client. Returns |
| 142 // ui::TEXT_INPUT_TYPE_NONE if there is no focused client. | 142 // ui::TEXT_INPUT_TYPE_NONE if there is no focused client. |
| 143 virtual TextInputType GetTextInputType() const = 0; | 143 virtual TextInputType GetTextInputType() const = 0; |
| 144 | 144 |
| 145 // Gets the text input mode of the focused text input client. Returns | 145 // Gets the text input mode of the focused text input client. Returns |
| 146 // ui::TEXT_INPUT_TYPE_DEFAULT if there is no focused client. | 146 // ui::TEXT_INPUT_TYPE_DEFAULT if there is no focused client. |
| 147 virtual TextInputMode GetTextInputMode() const = 0; | 147 virtual TextInputMode GetTextInputMode() const = 0; |
| 148 | 148 |
| 149 // Gets the text input flags of the focused text input client. Returns | 149 // Gets the text input flags of the focused text input client. Returns |
| 150 // 0 if there is no focused client. | 150 // 0 if there is no focused client. |
| 151 virtual int GetTextInputFlags() const = 0; | 151 virtual int GetTextInputFlags() const = 0; |
| 152 | 152 |
| 153 // Checks if the focused text input client supports inline composition. | 153 // Checks if the focused text input client supports inline composition. |
| 154 virtual bool CanComposeInline() const = 0; | 154 virtual bool CanComposeInline() const = 0; |
| 155 | 155 |
| 156 // Returns true if we know for sure that a candidate window (or IME suggest, | 156 // Returns true if we know for sure that a candidate window (or IME suggest, |
| 157 // etc.) is open. Returns false if no popup window is open or the detection | 157 // etc.) is open. Returns false if no popup window is open or the detection |
| 158 // of IME popups is not supported. | 158 // of IME popups is not supported. |
| 159 virtual bool IsCandidatePopupOpen() const = 0; | 159 virtual bool IsCandidatePopupOpen() const = 0; |
| 160 | 160 |
| 161 // Displays an on screen keyboard if enabled. | 161 // Displays an on screen keyboard if enabled. |
| 162 virtual void ShowImeIfNeeded() = 0; | 162 virtual void ShowImeIfNeeded() = 0; |
| 163 | 163 |
| 164 // Called by an on screen keyboard controller to specify whether focusing a | |
| 165 // text input element will show the on screen keyboard. | |
| 166 virtual void SetSupportsOnScreenKeyboard(bool supported) = 0; | |
|
Shu Chen
2015/01/06 02:19:51
As commented by yukawa@, this looks strange.
I sup
Shu Chen
2015/01/06 02:35:25
A solution just came to my mind to leverage ui::in
Shu Chen
2015/01/06 02:38:39
Hold on, there is no platform specific implementat
| |
| 167 | |
| 168 // Returns true if focusing a text input element will show an on screen | |
| 169 // keyboard. | |
| 170 virtual bool SupportsOnScreenKeyboard() const = 0; | |
| 171 | |
| 172 // Called by an on screen keyboard controller when the on screen keyboard was | |
| 173 // requested to be shown, but was already showing. | |
| 174 virtual void OnKeyboardBoundsUnchanged() = 0; | |
|
Shu Chen
2015/01/06 02:19:51
The naming may cause confusion as InputMethodObser
| |
| 175 | |
| 164 // Management of the observer list. | 176 // Management of the observer list. |
| 165 virtual void AddObserver(InputMethodObserver* observer) = 0; | 177 virtual void AddObserver(InputMethodObserver* observer) = 0; |
| 166 virtual void RemoveObserver(InputMethodObserver* observer) = 0; | 178 virtual void RemoveObserver(InputMethodObserver* observer) = 0; |
| 167 }; | 179 }; |
| 168 | 180 |
| 169 } // namespace ui | 181 } // namespace ui |
| 170 | 182 |
| 171 #endif // UI_BASE_IME_INPUT_METHOD_H_ | 183 #endif // UI_BASE_IME_INPUT_METHOD_H_ |
| OLD | NEW |