| 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_BASE_IME_INPUT_METHOD_WIN_H_ | 5 #ifndef UI_BASE_IME_INPUT_METHOD_WIN_H_ |
| 6 #define UI_BASE_IME_INPUT_METHOD_WIN_H_ | 6 #define UI_BASE_IME_INPUT_METHOD_WIN_H_ |
| 7 | 7 |
| 8 #include <windows.h> | 8 #include <windows.h> |
| 9 | 9 |
| 10 #include <string> | 10 #include <string> |
| 11 | 11 |
| 12 #include "base/compiler_specific.h" | 12 #include "base/compiler_specific.h" |
| 13 #include "base/macros.h" | 13 #include "base/macros.h" |
| 14 #include "ui/base/ime/input_method_base.h" | 14 #include "ui/base/ime/input_method_base.h" |
| 15 #include "ui/base/ime/win/imm32_manager.h" | 15 #include "ui/base/ime/win/imm32_manager.h" |
| 16 | 16 |
| 17 namespace ui { | 17 namespace ui { |
| 18 | 18 |
| 19 // A common InputMethod implementation based on IMM32. | 19 // A common InputMethod implementation based on IMM32. |
| 20 class UI_BASE_IME_EXPORT InputMethodWin : public InputMethodBase { | 20 class UI_BASE_IME_EXPORT InputMethodWin : public InputMethodBase { |
| 21 public: | 21 public: |
| 22 InputMethodWin(internal::InputMethodDelegate* delegate, | 22 InputMethodWin(internal::InputMethodDelegate* delegate, |
| 23 HWND toplevel_window_handle); | 23 HWND toplevel_window_handle); |
| 24 ~InputMethodWin() override; | 24 ~InputMethodWin() override; |
| 25 | 25 |
| 26 // Overridden from InputMethodBase: |
| 27 void OnFocus() override; |
| 28 |
| 26 // Overridden from InputMethod: | 29 // Overridden from InputMethod: |
| 27 bool OnUntranslatedIMEMessage(const base::NativeEvent& event, | 30 bool OnUntranslatedIMEMessage(const base::NativeEvent& event, |
| 28 NativeEventResult* result) override; | 31 NativeEventResult* result) override; |
| 29 void DispatchKeyEvent(ui::KeyEvent* event) override; | 32 void DispatchKeyEvent(ui::KeyEvent* event) override; |
| 30 void OnTextInputTypeChanged(const TextInputClient* client) override; | 33 void OnTextInputTypeChanged(const TextInputClient* client) override; |
| 31 void OnCaretBoundsChanged(const TextInputClient* client) override; | 34 void OnCaretBoundsChanged(const TextInputClient* client) override; |
| 32 void CancelComposition(const TextInputClient* client) override; | 35 void CancelComposition(const TextInputClient* client) override; |
| 33 void OnInputLocaleChanged() override; | 36 void OnInputLocaleChanged() override; |
| 34 bool IsInputLocaleCJK() const override; | 37 bool IsInputLocaleCJK() const override; |
| 35 bool IsCandidatePopupOpen() const override; | 38 bool IsCandidatePopupOpen() const override; |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 81 // OnImeRequest (and its actual implementations as OnDocumentFeed, | 84 // OnImeRequest (and its actual implementations as OnDocumentFeed, |
| 82 // OnReconvertString, and OnQueryCharPosition) are placed in this base class. | 85 // OnReconvertString, and OnQueryCharPosition) are placed in this base class. |
| 83 LRESULT OnImeRequest(UINT message, | 86 LRESULT OnImeRequest(UINT message, |
| 84 WPARAM wparam, | 87 WPARAM wparam, |
| 85 LPARAM lparam, | 88 LPARAM lparam, |
| 86 BOOL* handled); | 89 BOOL* handled); |
| 87 LRESULT OnDocumentFeed(RECONVERTSTRING* reconv); | 90 LRESULT OnDocumentFeed(RECONVERTSTRING* reconv); |
| 88 LRESULT OnReconvertString(RECONVERTSTRING* reconv); | 91 LRESULT OnReconvertString(RECONVERTSTRING* reconv); |
| 89 LRESULT OnQueryCharPosition(IMECHARPOSITION* char_positon); | 92 LRESULT OnQueryCharPosition(IMECHARPOSITION* char_positon); |
| 90 | 93 |
| 94 void RefreshInputLanguage(); |
| 95 |
| 91 // Returns true if the Win32 native window bound to |client| is considered | 96 // Returns true if the Win32 native window bound to |client| is considered |
| 92 // to be ready for receiving keyboard input. | 97 // to be ready for receiving keyboard input. |
| 93 bool IsWindowFocused(const TextInputClient* client) const; | 98 bool IsWindowFocused(const TextInputClient* client) const; |
| 94 | 99 |
| 95 void DispatchFabricatedKeyEvent(ui::KeyEvent* event); | 100 void DispatchFabricatedKeyEvent(ui::KeyEvent* event); |
| 96 | 101 |
| 97 // Asks the client to confirm current composition text. | 102 // Asks the client to confirm current composition text. |
| 98 void ConfirmCompositionText(); | 103 void ConfirmCompositionText(); |
| 99 | 104 |
| 100 // Enables or disables the IME according to the current text input type. | 105 // Enables or disables the IME according to the current text input type. |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 136 | 141 |
| 137 // Used for making callbacks. | 142 // Used for making callbacks. |
| 138 base::WeakPtrFactory<InputMethodWin> weak_ptr_factory_; | 143 base::WeakPtrFactory<InputMethodWin> weak_ptr_factory_; |
| 139 | 144 |
| 140 DISALLOW_COPY_AND_ASSIGN(InputMethodWin); | 145 DISALLOW_COPY_AND_ASSIGN(InputMethodWin); |
| 141 }; | 146 }; |
| 142 | 147 |
| 143 } // namespace ui | 148 } // namespace ui |
| 144 | 149 |
| 145 #endif // UI_BASE_IME_INPUT_METHOD_WIN_H_ | 150 #endif // UI_BASE_IME_INPUT_METHOD_WIN_H_ |
| OLD | NEW |