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_WIN_H_ | 5 #ifndef UI_VIEWS_IME_INPUT_METHOD_WIN_H_ |
6 #define UI_VIEWS_IME_INPUT_METHOD_WIN_H_ | 6 #define UI_VIEWS_IME_INPUT_METHOD_WIN_H_ |
7 | 7 |
8 #include <windows.h> | 8 #include <windows.h> |
9 | 9 |
10 #include <string> | 10 #include <string> |
(...skipping 26 matching lines...) Expand all Loading... |
37 virtual bool OnUntranslatedIMEMessage(const base::NativeEvent& event, | 37 virtual bool OnUntranslatedIMEMessage(const base::NativeEvent& event, |
38 NativeEventResult* result) OVERRIDE; | 38 NativeEventResult* result) OVERRIDE; |
39 virtual void DispatchKeyEvent(const ui::KeyEvent& key) OVERRIDE; | 39 virtual void DispatchKeyEvent(const ui::KeyEvent& key) OVERRIDE; |
40 virtual void OnTextInputTypeChanged(View* view) OVERRIDE; | 40 virtual void OnTextInputTypeChanged(View* view) OVERRIDE; |
41 virtual void OnCaretBoundsChanged(View* view) OVERRIDE; | 41 virtual void OnCaretBoundsChanged(View* view) OVERRIDE; |
42 virtual void CancelComposition(View* view) OVERRIDE; | 42 virtual void CancelComposition(View* view) OVERRIDE; |
43 virtual void OnInputLocaleChanged() OVERRIDE; | 43 virtual void OnInputLocaleChanged() OVERRIDE; |
44 virtual std::string GetInputLocale() OVERRIDE; | 44 virtual std::string GetInputLocale() OVERRIDE; |
45 virtual base::i18n::TextDirection GetInputTextDirection() OVERRIDE; | 45 virtual base::i18n::TextDirection GetInputTextDirection() OVERRIDE; |
46 virtual bool IsActive() OVERRIDE; | 46 virtual bool IsActive() OVERRIDE; |
| 47 virtual bool IsPopupOpen() const OVERRIDE; |
47 | 48 |
48 // Overridden from InputMethodBase. | 49 // Overridden from InputMethodBase. |
49 virtual ui::TextInputClient* GetTextInputClient() const OVERRIDE; | 50 virtual ui::TextInputClient* GetTextInputClient() const OVERRIDE; |
50 | 51 |
51 private: | 52 private: |
52 LRESULT OnImeSetContext( | 53 LRESULT OnImeSetContext( |
53 UINT message, WPARAM wparam, LPARAM lparam, BOOL* handled); | 54 UINT message, WPARAM wparam, LPARAM lparam, BOOL* handled); |
54 LRESULT OnImeStartComposition( | 55 LRESULT OnImeStartComposition( |
55 UINT message, WPARAM wparam, LPARAM lparam, BOOL* handled); | 56 UINT message, WPARAM wparam, LPARAM lparam, BOOL* handled); |
56 LRESULT OnImeComposition( | 57 LRESULT OnImeComposition( |
57 UINT message, WPARAM wparam, LPARAM lparam, BOOL* handled); | 58 UINT message, WPARAM wparam, LPARAM lparam, BOOL* handled); |
58 LRESULT OnImeEndComposition( | 59 LRESULT OnImeEndComposition( |
59 UINT message, WPARAM wparam, LPARAM lparam, BOOL* handled); | 60 UINT message, WPARAM wparam, LPARAM lparam, BOOL* handled); |
60 LRESULT OnImeRequest( | 61 LRESULT OnImeRequest( |
61 UINT message, WPARAM wparam, LPARAM lparam, BOOL* handled); | 62 UINT message, WPARAM wparam, LPARAM lparam, BOOL* handled); |
| 63 LRESULT OnImeNotify( |
| 64 UINT message, WPARAM wparam, LPARAM lparam, BOOL* handled); |
62 // For both WM_CHAR and WM_SYSCHAR | 65 // For both WM_CHAR and WM_SYSCHAR |
63 LRESULT OnChar( | 66 LRESULT OnChar( |
64 UINT message, WPARAM wparam, LPARAM lparam, BOOL* handled); | 67 UINT message, WPARAM wparam, LPARAM lparam, BOOL* handled); |
65 // For both WM_DEADCHAR and WM_SYSDEADCHAR | 68 // For both WM_DEADCHAR and WM_SYSDEADCHAR |
66 LRESULT OnDeadChar( | 69 LRESULT OnDeadChar( |
67 UINT message, WPARAM wparam, LPARAM lparam, BOOL* handled); | 70 UINT message, WPARAM wparam, LPARAM lparam, BOOL* handled); |
68 | 71 |
69 LRESULT OnDocumentFeed(RECONVERTSTRING *reconv); | 72 LRESULT OnDocumentFeed(RECONVERTSTRING *reconv); |
70 LRESULT OnReconvertString(RECONVERTSTRING *reconv); | 73 LRESULT OnReconvertString(RECONVERTSTRING *reconv); |
71 LRESULT OnQueryCharPosition(IMECHARPOSITION *char_positon); | 74 LRESULT OnQueryCharPosition(IMECHARPOSITION *char_positon); |
72 | 75 |
73 // Overridden from InputMethodBase. | 76 // Overridden from InputMethodBase. |
74 virtual void OnWillChangeFocus(View* focused_before, View* focused) OVERRIDE; | 77 virtual void OnWillChangeFocus(View* focused_before, View* focused) OVERRIDE; |
75 virtual void OnDidChangeFocus(View* focused_before, View* focused) OVERRIDE; | 78 virtual void OnDidChangeFocus(View* focused_before, View* focused) OVERRIDE; |
76 | 79 |
77 // Asks the client to confirm current composition text. | 80 // Asks the client to confirm current composition text. |
78 void ConfirmCompositionText(); | 81 void ConfirmCompositionText(); |
79 | 82 |
80 // Enables or disables the IME according to the current text input type. | 83 // Enables or disables the IME according to the current text input type. |
81 void UpdateIMEState(); | 84 void UpdateIMEState(); |
82 | 85 |
83 // The HWND this InputMethod is bound to. | 86 // The HWND this InputMethod is bound to. |
84 HWND hwnd_; | 87 HWND hwnd_; |
85 | 88 |
86 // Indicates if the current input locale has an IME. | 89 // Indicates if the current input locale has an IME. |
87 bool active_; | 90 bool active_; |
88 | 91 |
| 92 // True if a candidate window (or IME suggest, etc.) is open. |
| 93 // False if not or unsure. |
| 94 bool is_popup_open_; |
| 95 |
89 // Name of the current input locale. | 96 // Name of the current input locale. |
90 std::string locale_; | 97 std::string locale_; |
91 | 98 |
92 // The current input text direction. | 99 // The current input text direction. |
93 base::i18n::TextDirection direction_; | 100 base::i18n::TextDirection direction_; |
94 | 101 |
95 // The new text direction and layout alignment requested by the user by | 102 // The new text direction and layout alignment requested by the user by |
96 // pressing ctrl-shift. It'll be sent to the text input client when the key | 103 // pressing ctrl-shift. It'll be sent to the text input client when the key |
97 // is released. | 104 // is released. |
98 base::i18n::TextDirection pending_requested_direction_; | 105 base::i18n::TextDirection pending_requested_direction_; |
99 | 106 |
100 // Windows IMM32 wrapper. | 107 // Windows IMM32 wrapper. |
101 // (See "ui/base/win/ime_input.h" for its details.) | 108 // (See "ui/base/win/ime_input.h" for its details.) |
102 ui::ImeInput ime_input_; | 109 ui::ImeInput ime_input_; |
103 | 110 |
104 ui::InputMethod* const host_; | 111 ui::InputMethod* const host_; |
105 | 112 |
106 DISALLOW_COPY_AND_ASSIGN(InputMethodWin); | 113 DISALLOW_COPY_AND_ASSIGN(InputMethodWin); |
107 }; | 114 }; |
108 | 115 |
109 } // namespace views | 116 } // namespace views |
110 | 117 |
111 #endif // UI_VIEWS_IME_INPUT_METHOD_WIN_H_ | 118 #endif // UI_VIEWS_IME_INPUT_METHOD_WIN_H_ |
OLD | NEW |