| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 class InputMethodDelegate; | 23 class InputMethodDelegate; |
| 24 } // namespace internal | 24 } // namespace internal |
| 25 | 25 |
| 26 class KeyEvent; | 26 class KeyEvent; |
| 27 class View; | 27 class View; |
| 28 class Widget; | 28 class Widget; |
| 29 | 29 |
| 30 // An interface implemented by an object that encapsulates a native input method | 30 // An interface implemented by an object that encapsulates a native input method |
| 31 // service provided by the underlying operation system. | 31 // service provided by the underlying operation system. |
| 32 // Because on most systems, the system input method service is bound to | 32 // Because on most systems, the system input method service is bound to |
| 33 // individual native window. On Windows, its HWND, on Linux/Gtk, its GdkWindow. | 33 // individual native window. On Windows, its HWND, on Aura, its |
| 34 // And in Views control system, only the top-level NativeWidget has a native | 34 // ui::aura::Window. And in Views control system, only the top-level |
| 35 // window that can get keyboard focus. So this API is designed to be bound to | 35 // NativeWidget has a native window that can get keyboard focus. So this API is |
| 36 // the top-level NativeWidget. | 36 // designed to be bound to the top-level NativeWidget. |
| 37 class VIEWS_EXPORT InputMethod { | 37 class VIEWS_EXPORT InputMethod { |
| 38 public: | 38 public: |
| 39 virtual ~InputMethod() {} | 39 virtual ~InputMethod() {} |
| 40 | 40 |
| 41 // Sets the delegate used by this InputMethod instance. It should only be | 41 // Sets the delegate used by this InputMethod instance. It should only be |
| 42 // called by the internal NativeWidget or testing code. | 42 // called by the internal NativeWidget or testing code. |
| 43 virtual void set_delegate(internal::InputMethodDelegate* delegate) = 0; | 43 virtual void set_delegate(internal::InputMethodDelegate* delegate) = 0; |
| 44 | 44 |
| 45 // Initialize the InputMethod object and attach it to the given |widget|. | 45 // Initialize the InputMethod object and attach it to the given |widget|. |
| 46 // The |widget| must already be initialized. | 46 // The |widget| must already be initialized. |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 107 | 107 |
| 108 // Returns true if the input method is a mock and not real. | 108 // Returns true if the input method is a mock and not real. |
| 109 virtual bool IsMock() const = 0; | 109 virtual bool IsMock() const = 0; |
| 110 | 110 |
| 111 // TODO(suzhe): Support mouse/touch event. | 111 // TODO(suzhe): Support mouse/touch event. |
| 112 }; | 112 }; |
| 113 | 113 |
| 114 } // namespace views | 114 } // namespace views |
| 115 | 115 |
| 116 #endif // UI_VIEWS_IME_INPUT_METHOD_H_ | 116 #endif // UI_VIEWS_IME_INPUT_METHOD_H_ |
| OLD | NEW |