| 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 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 84 // destroyed. | 84 // destroyed. |
| 85 virtual void DetachTextInputClient(TextInputClient* client) = 0; | 85 virtual void DetachTextInputClient(TextInputClient* client) = 0; |
| 86 | 86 |
| 87 // Gets the current text input client. Returns NULL when no client is set. | 87 // Gets the current text input client. Returns NULL when no client is set. |
| 88 virtual TextInputClient* GetTextInputClient() const = 0; | 88 virtual TextInputClient* GetTextInputClient() const = 0; |
| 89 | 89 |
| 90 // Dispatches a key event to the input method. The key event will be | 90 // Dispatches a key event to the input method. The key event will be |
| 91 // dispatched back to the caller via | 91 // dispatched back to the caller via |
| 92 // ui::InputMethodDelegate::DispatchKeyEventPostIME(), once it's processed by | 92 // ui::InputMethodDelegate::DispatchKeyEventPostIME(), once it's processed by |
| 93 // the input method. It should only be called by a message dispatcher. | 93 // the input method. It should only be called by a message dispatcher. |
| 94 // Returns true if the event was processed. | 94 virtual void DispatchKeyEvent(ui::KeyEvent* event) = 0; |
| 95 virtual bool DispatchKeyEvent(const ui::KeyEvent& event) = 0; | |
| 96 | 95 |
| 97 // Called by the focused client whenever its text input type is changed. | 96 // Called by the focused client whenever its text input type is changed. |
| 98 // Before calling this method, the focused client must confirm or clear | 97 // Before calling this method, the focused client must confirm or clear |
| 99 // existing composition text and call InputMethod::CancelComposition() when | 98 // existing composition text and call InputMethod::CancelComposition() when |
| 100 // necessary. Otherwise unexpected behavior may happen. This method has no | 99 // necessary. Otherwise unexpected behavior may happen. This method has no |
| 101 // effect if the client is not the focused client. | 100 // effect if the client is not the focused client. |
| 102 virtual void OnTextInputTypeChanged(const TextInputClient* client) = 0; | 101 virtual void OnTextInputTypeChanged(const TextInputClient* client) = 0; |
| 103 | 102 |
| 104 // Called by the focused client whenever its caret bounds is changed. | 103 // Called by the focused client whenever its caret bounds is changed. |
| 105 // This method has no effect if the client is not the focused client. | 104 // This method has no effect if the client is not the focused client. |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 149 virtual void ShowImeIfNeeded() = 0; | 148 virtual void ShowImeIfNeeded() = 0; |
| 150 | 149 |
| 151 // Management of the observer list. | 150 // Management of the observer list. |
| 152 virtual void AddObserver(InputMethodObserver* observer) = 0; | 151 virtual void AddObserver(InputMethodObserver* observer) = 0; |
| 153 virtual void RemoveObserver(InputMethodObserver* observer) = 0; | 152 virtual void RemoveObserver(InputMethodObserver* observer) = 0; |
| 154 }; | 153 }; |
| 155 | 154 |
| 156 } // namespace ui | 155 } // namespace ui |
| 157 | 156 |
| 158 #endif // UI_BASE_IME_INPUT_METHOD_H_ | 157 #endif // UI_BASE_IME_INPUT_METHOD_H_ |
| OLD | NEW |