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 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
76 // translated into other predefined event callbacks. Currently this method is | 76 // translated into other predefined event callbacks. Currently this method is |
77 // used only for IME functionalities specific to Windows. | 77 // used only for IME functionalities specific to Windows. |
78 // TODO(ime): Break down these messages into platform-neutral methods. | 78 // TODO(ime): Break down these messages into platform-neutral methods. |
79 virtual bool OnUntranslatedIMEMessage(const base::NativeEvent& event, | 79 virtual bool OnUntranslatedIMEMessage(const base::NativeEvent& event, |
80 NativeEventResult* result) = 0; | 80 NativeEventResult* result) = 0; |
81 | 81 |
82 // Sets the text input client which receives text input events such as | 82 // Sets the text input client which receives text input events such as |
83 // SetCompositionText(). |client| can be NULL. A gfx::NativeWindow which | 83 // SetCompositionText(). |client| can be NULL. A gfx::NativeWindow which |
84 // implementes TextInputClient interface, e.g. NWA and RWHVA, should register | 84 // implementes TextInputClient interface, e.g. NWA and RWHVA, should register |
85 // itself by calling the method when it is focused, and unregister itself by | 85 // itself by calling the method when it is focused, and unregister itself by |
86 // calling the metho with NULL when it is unfocused. | 86 // calling the method with NULL when it is unfocused. |
87 virtual void SetFocusedTextInputClient(TextInputClient* client) = 0; | 87 virtual void SetFocusedTextInputClient(TextInputClient* client) = 0; |
88 | 88 |
| 89 // Detaches and forgets the |client| regardless of whether it has the focus or |
| 90 // not. This method is meant to be called when the |client| is going to be |
| 91 // destroyed. |
| 92 virtual void DetachTextInputClient(TextInputClient* client) = 0; |
| 93 |
89 // Gets the current text input client. Returns NULL when no client is set. | 94 // Gets the current text input client. Returns NULL when no client is set. |
90 virtual TextInputClient* GetTextInputClient() const = 0; | 95 virtual TextInputClient* GetTextInputClient() const = 0; |
91 | 96 |
92 // Dispatches a key event to the input method. The key event will be | 97 // Dispatches a key event to the input method. The key event will be |
93 // dispatched back to the caller via | 98 // dispatched back to the caller via |
94 // ui::InputMethodDelegate::DispatchKeyEventPostIME(), once it's processed by | 99 // ui::InputMethodDelegate::DispatchKeyEventPostIME(), once it's processed by |
95 // the input method. It should only be called by a message dispatcher. | 100 // the input method. It should only be called by a message dispatcher. |
96 // Returns true if the event was processed. | 101 // Returns true if the event was processed. |
97 virtual bool DispatchKeyEvent(const base::NativeEvent& native_key_event) = 0; | 102 virtual bool DispatchKeyEvent(const base::NativeEvent& native_key_event) = 0; |
98 | 103 |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
162 virtual bool IsCandidatePopupOpen() const = 0; | 167 virtual bool IsCandidatePopupOpen() const = 0; |
163 | 168 |
164 // Management of the observer list. | 169 // Management of the observer list. |
165 virtual void AddObserver(InputMethodObserver* observer) = 0; | 170 virtual void AddObserver(InputMethodObserver* observer) = 0; |
166 virtual void RemoveObserver(InputMethodObserver* observer) = 0; | 171 virtual void RemoveObserver(InputMethodObserver* observer) = 0; |
167 }; | 172 }; |
168 | 173 |
169 } // namespace ui | 174 } // namespace ui |
170 | 175 |
171 #endif // UI_BASE_IME_INPUT_METHOD_H_ | 176 #endif // UI_BASE_IME_INPUT_METHOD_H_ |
OLD | NEW |