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 VIEWS_IME_INPUT_METHOD_H_ | 5 #ifndef VIEWS_IME_INPUT_METHOD_H_ |
6 #define VIEWS_IME_INPUT_METHOD_H_ | 6 #define VIEWS_IME_INPUT_METHOD_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 | 10 |
11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
12 #include "base/i18n/rtl.h" | 12 #include "base/i18n/rtl.h" |
13 #include "ui/base/ime/text_input_type.h" | 13 #include "ui/base/ime/text_input_type.h" |
14 #include "views/views_export.h" | 14 #include "views/views_export.h" |
15 | 15 |
16 namespace ui { | |
17 class TextInputClient; | |
18 } // namespace ui | |
19 | |
20 namespace views { | 16 namespace views { |
21 | 17 |
22 namespace internal { | 18 namespace internal { |
23 class InputMethodDelegate; | 19 class InputMethodDelegate; |
24 } // namespace internal | 20 } // namespace internal |
25 | 21 |
26 class KeyEvent; | 22 class KeyEvent; |
| 23 class TextInputClient; |
27 class View; | 24 class View; |
28 class Widget; | 25 class Widget; |
29 | 26 |
30 // An interface implemented by an object that encapsulates a native input method | 27 // An interface implemented by an object that encapsulates a native input method |
31 // service provided by the underlying operation system. | 28 // service provided by the underlying operation system. |
32 // Because on most systems, the system input method service is bound to | 29 // 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. | 30 // individual native window. On Windows, its HWND, on Linux/Gtk, its GdkWindow. |
34 // And in Views control system, only the top-level NativeWidget has a native | 31 // And in Views control system, only the top-level NativeWidget has a native |
35 // window that can get keyboard focus. So this API is designed to be bound to | 32 // window that can get keyboard focus. So this API is designed to be bound to |
36 // the top-level NativeWidget. | 33 // the top-level NativeWidget. |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
92 // If the input method is inactive, then it's not necessary to inform it the | 89 // If the input method is inactive, then it's not necessary to inform it the |
93 // changes of caret bounds and text input type. | 90 // changes of caret bounds and text input type. |
94 // Note: character results may still be generated and sent to the text input | 91 // Note: character results may still be generated and sent to the text input |
95 // client by calling TextInputClient::InsertChar(), even if the input method | 92 // client by calling TextInputClient::InsertChar(), even if the input method |
96 // is not active. | 93 // is not active. |
97 virtual bool IsActive() = 0; | 94 virtual bool IsActive() = 0; |
98 | 95 |
99 // Gets the focused text input client. Returns NULL if the Widget is not | 96 // Gets the focused text input client. Returns NULL if the Widget is not |
100 // focused, or there is no focused View or the focused View doesn't support | 97 // focused, or there is no focused View or the focused View doesn't support |
101 // text input. | 98 // text input. |
102 virtual ui::TextInputClient* GetTextInputClient() const = 0; | 99 virtual TextInputClient* GetTextInputClient() const = 0; |
103 | 100 |
104 // Gets the text input type of the focused text input client. Returns | 101 // Gets the text input type of the focused text input client. Returns |
105 // ui::TEXT_INPUT_TYPE_NONE if there is no focused text input client. | 102 // ui::TEXT_INPUT_TYPE_NONE if there is no focused text input client. |
106 virtual ui::TextInputType GetTextInputType() const = 0; | 103 virtual ui::TextInputType GetTextInputType() const = 0; |
107 | 104 |
108 // Returns true if the input method is a mock and not real. | 105 // Returns true if the input method is a mock and not real. |
109 virtual bool IsMock() const = 0; | 106 virtual bool IsMock() const = 0; |
110 | 107 |
111 // TODO(suzhe): Support mouse/touch event. | 108 // TODO(suzhe): Support mouse/touch event. |
112 }; | 109 }; |
113 | 110 |
114 } // namespace views | 111 } // namespace views |
115 | 112 |
116 #endif // VIEWS_IME_INPUT_METHOD_H_ | 113 #endif // VIEWS_IME_INPUT_METHOD_H_ |
OLD | NEW |