OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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_BASE_IME_INPUT_METHOD_IMM32_H_ | 5 #ifndef UI_BASE_IME_INPUT_METHOD_IMM32_H_ |
6 #define UI_BASE_IME_INPUT_METHOD_IMM32_H_ | 6 #define UI_BASE_IME_INPUT_METHOD_IMM32_H_ |
7 | 7 |
8 #include <windows.h> | 8 #include <windows.h> |
9 | 9 |
10 #include <string> | 10 #include <string> |
(...skipping 12 matching lines...) Expand all Loading... |
23 | 23 |
24 // Overridden from InputMethod: | 24 // Overridden from InputMethod: |
25 virtual void OnFocus() OVERRIDE; | 25 virtual void OnFocus() OVERRIDE; |
26 virtual void OnBlur() OVERRIDE; | 26 virtual void OnBlur() OVERRIDE; |
27 virtual bool OnUntranslatedIMEMessage(const base::NativeEvent& event, | 27 virtual bool OnUntranslatedIMEMessage(const base::NativeEvent& event, |
28 NativeEventResult* result) OVERRIDE; | 28 NativeEventResult* result) OVERRIDE; |
29 virtual void OnTextInputTypeChanged(const TextInputClient* client) OVERRIDE; | 29 virtual void OnTextInputTypeChanged(const TextInputClient* client) OVERRIDE; |
30 virtual void OnCaretBoundsChanged(const TextInputClient* client) OVERRIDE; | 30 virtual void OnCaretBoundsChanged(const TextInputClient* client) OVERRIDE; |
31 virtual void CancelComposition(const TextInputClient* client) OVERRIDE; | 31 virtual void CancelComposition(const TextInputClient* client) OVERRIDE; |
32 virtual void SetFocusedTextInputClient(TextInputClient* client) OVERRIDE; | 32 virtual void SetFocusedTextInputClient(TextInputClient* client) OVERRIDE; |
| 33 virtual bool IsCandidatePopupOpen() const OVERRIDE; |
33 | 34 |
34 protected: | 35 protected: |
35 // Overridden from InputMethodBase: | 36 // Overridden from InputMethodBase: |
36 virtual void OnWillChangeFocusedClient(TextInputClient* focused_before, | 37 virtual void OnWillChangeFocusedClient(TextInputClient* focused_before, |
37 TextInputClient* focused) OVERRIDE; | 38 TextInputClient* focused) OVERRIDE; |
38 virtual void OnDidChangeFocusedClient(TextInputClient* focused_before, | 39 virtual void OnDidChangeFocusedClient(TextInputClient* focused_before, |
39 TextInputClient* focused) OVERRIDE; | 40 TextInputClient* focused) OVERRIDE; |
40 | 41 |
41 private: | 42 private: |
42 LRESULT OnImeSetContext(HWND window_handle, | 43 LRESULT OnImeSetContext(HWND window_handle, |
43 UINT message, | 44 UINT message, |
44 WPARAM wparam, | 45 WPARAM wparam, |
45 LPARAM lparam, | 46 LPARAM lparam, |
46 BOOL* handled); | 47 BOOL* handled); |
47 LRESULT OnImeStartComposition(HWND window_handle, | 48 LRESULT OnImeStartComposition(HWND window_handle, |
48 UINT message, | 49 UINT message, |
49 WPARAM wparam, | 50 WPARAM wparam, |
50 LPARAM lparam, | 51 LPARAM lparam, |
51 BOOL* handled); | 52 BOOL* handled); |
52 LRESULT OnImeComposition(HWND window_handle, | 53 LRESULT OnImeComposition(HWND window_handle, |
53 UINT message, | 54 UINT message, |
54 WPARAM wparam, | 55 WPARAM wparam, |
55 LPARAM lparam, | 56 LPARAM lparam, |
56 BOOL* handled); | 57 BOOL* handled); |
57 LRESULT OnImeEndComposition(HWND window_handle, | 58 LRESULT OnImeEndComposition(HWND window_handle, |
58 UINT message, | 59 UINT message, |
59 WPARAM wparam, | 60 WPARAM wparam, |
60 LPARAM lparam, | 61 LPARAM lparam, |
61 BOOL* handled); | 62 BOOL* handled); |
| 63 LRESULT OnImeNotify(UINT message, |
| 64 WPARAM wparam, |
| 65 LPARAM lparam, |
| 66 BOOL* handled); |
62 | 67 |
63 // Asks the client to confirm current composition text. | 68 // Asks the client to confirm current composition text. |
64 void ConfirmCompositionText(); | 69 void ConfirmCompositionText(); |
65 | 70 |
66 // Enables or disables the IME according to the current text input type. | 71 // Enables or disables the IME according to the current text input type. |
67 void UpdateIMEState(); | 72 void UpdateIMEState(); |
68 | 73 |
69 // Returns true if the Win32 native window bound to |client| has Win32 input | 74 // Returns true if the Win32 native window bound to |client| has Win32 input |
70 // focus. | 75 // focus. |
71 bool IsWindowFocused(const TextInputClient* client) const; | 76 bool IsWindowFocused(const TextInputClient* client) const; |
72 | 77 |
73 bool enabled_; | 78 bool enabled_; |
74 | 79 |
| 80 // True if we know for sure that a candidate window is open. |
| 81 bool is_candidate_popup_open_; |
| 82 |
75 // Window handle where composition is on-going. NULL when there is no | 83 // Window handle where composition is on-going. NULL when there is no |
76 // composition. | 84 // composition. |
77 HWND composing_window_handle_; | 85 HWND composing_window_handle_; |
78 | 86 |
79 DISALLOW_COPY_AND_ASSIGN(InputMethodIMM32); | 87 DISALLOW_COPY_AND_ASSIGN(InputMethodIMM32); |
80 }; | 88 }; |
81 | 89 |
82 } // namespace ui | 90 } // namespace ui |
83 | 91 |
84 #endif // UI_BASE_IME_INPUT_METHOD_IMM32_H_ | 92 #endif // UI_BASE_IME_INPUT_METHOD_IMM32_H_ |
OLD | NEW |