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_VIEWS_IME_INPUT_METHOD_H_ | 5 #ifndef UI_VIEWS_IME_INPUT_METHOD_H_ |
6 #define UI_VIEWS_IME_INPUT_METHOD_H_ | 6 #define UI_VIEWS_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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 virtual ~InputMethod() {} | 44 virtual ~InputMethod() {} |
45 | 45 |
46 // Sets the delegate used by this InputMethod instance. | 46 // Sets the delegate used by this InputMethod instance. |
47 // This should only be called by the owner Widget or testing code. | 47 // This should only be called by the owner Widget or testing code. |
48 virtual void SetDelegate(internal::InputMethodDelegate* delegate) = 0; | 48 virtual void SetDelegate(internal::InputMethodDelegate* delegate) = 0; |
49 | 49 |
50 // Initialize the InputMethod object and attach it to the given |widget|. | 50 // Initialize the InputMethod object and attach it to the given |widget|. |
51 // The |widget| must already be initialized. | 51 // The |widget| must already be initialized. |
52 virtual void Init(Widget* widget) = 0; | 52 virtual void Init(Widget* widget) = 0; |
53 | 53 |
| 54 // Called when the top-level Widget gains or loses keyboard focus. |
| 55 // These should only be called by the Widget that owns this InputMethod. |
| 56 virtual void OnFocus() = 0; |
| 57 virtual void OnBlur() = 0; |
| 58 |
54 // Called when the focused window receives native IME messages that are not | 59 // Called when the focused window receives native IME messages that are not |
55 // translated into other predefined event callbacks. Currently this method is | 60 // translated into other predefined event callbacks. Currently this method is |
56 // used only for IME functionalities specific to Windows. | 61 // used only for IME functionalities specific to Windows. |
57 // TODO(ime): Break down these messages into platform-neutral methods. | 62 // TODO(ime): Break down these messages into platform-neutral methods. |
58 virtual bool OnUntranslatedIMEMessage(const base::NativeEvent& event, | 63 virtual bool OnUntranslatedIMEMessage(const base::NativeEvent& event, |
59 NativeEventResult* result) = 0; | 64 NativeEventResult* result) = 0; |
60 | 65 |
61 // Dispatch a key event to the input method. The key event will be dispatched | 66 // Dispatch a key event to the input method. The key event will be dispatched |
62 // back to the caller via InputMethodDelegate::DispatchKeyEventPostIME(), once | 67 // back to the caller via InputMethodDelegate::DispatchKeyEventPostIME(), once |
63 // it has been processed by the input method. It should only be called by the | 68 // it has been processed by the input method. It should only be called by the |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
115 | 120 |
116 // Returns true if the input method is a mock instance used for testing. | 121 // Returns true if the input method is a mock instance used for testing. |
117 virtual bool IsMock() const = 0; | 122 virtual bool IsMock() const = 0; |
118 | 123 |
119 // TODO(suzhe): Support mouse/touch event. | 124 // TODO(suzhe): Support mouse/touch event. |
120 }; | 125 }; |
121 | 126 |
122 } // namespace views | 127 } // namespace views |
123 | 128 |
124 #endif // UI_VIEWS_IME_INPUT_METHOD_H_ | 129 #endif // UI_VIEWS_IME_INPUT_METHOD_H_ |
OLD | NEW |