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