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/basictypes.h" | 12 #include "base/basictypes.h" |
13 #include "base/compiler_specific.h" | 13 #include "base/compiler_specific.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_EXPORT InputMethodWin : public InputMethodBase { | 20 class UI_BASE_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 | 24 |
25 // Overridden from InputMethod: | 25 // Overridden from InputMethod: |
26 virtual void Init(bool focused) OVERRIDE; | 26 virtual void Init(bool focused) override; |
27 virtual void OnFocus() OVERRIDE; | 27 virtual void OnFocus() override; |
28 virtual void OnBlur() OVERRIDE; | 28 virtual void OnBlur() override; |
29 virtual bool OnUntranslatedIMEMessage(const base::NativeEvent& event, | 29 virtual bool OnUntranslatedIMEMessage(const base::NativeEvent& event, |
30 NativeEventResult* result) OVERRIDE; | 30 NativeEventResult* result) override; |
31 virtual bool DispatchKeyEvent(const ui::KeyEvent& event) OVERRIDE; | 31 virtual bool DispatchKeyEvent(const ui::KeyEvent& event) override; |
32 virtual void OnTextInputTypeChanged(const TextInputClient* client) OVERRIDE; | 32 virtual void OnTextInputTypeChanged(const TextInputClient* client) override; |
33 virtual void OnCaretBoundsChanged(const TextInputClient* client) OVERRIDE; | 33 virtual void OnCaretBoundsChanged(const TextInputClient* client) override; |
34 virtual void CancelComposition(const TextInputClient* client) OVERRIDE; | 34 virtual void CancelComposition(const TextInputClient* client) override; |
35 virtual void OnInputLocaleChanged() OVERRIDE; | 35 virtual void OnInputLocaleChanged() override; |
36 virtual std::string GetInputLocale() OVERRIDE; | 36 virtual std::string GetInputLocale() override; |
37 virtual bool IsActive() OVERRIDE; | 37 virtual bool IsActive() override; |
38 virtual bool IsCandidatePopupOpen() const OVERRIDE; | 38 virtual bool IsCandidatePopupOpen() const override; |
39 | 39 |
40 protected: | 40 protected: |
41 // Overridden from InputMethodBase: | 41 // Overridden from InputMethodBase: |
42 // If a derived class overrides this method, it should call parent's | 42 // If a derived class overrides this method, it should call parent's |
43 // implementation. | 43 // implementation. |
44 virtual void OnWillChangeFocusedClient(TextInputClient* focused_before, | 44 virtual void OnWillChangeFocusedClient(TextInputClient* focused_before, |
45 TextInputClient* focused) OVERRIDE; | 45 TextInputClient* focused) override; |
46 virtual void OnDidChangeFocusedClient(TextInputClient* focused_before, | 46 virtual void OnDidChangeFocusedClient(TextInputClient* focused_before, |
47 TextInputClient* focused) OVERRIDE; | 47 TextInputClient* focused) override; |
48 | 48 |
49 private: | 49 private: |
50 // For both WM_CHAR and WM_SYSCHAR | 50 // For both WM_CHAR and WM_SYSCHAR |
51 LRESULT OnChar(HWND window_handle, | 51 LRESULT OnChar(HWND window_handle, |
52 UINT message, | 52 UINT message, |
53 WPARAM wparam, | 53 WPARAM wparam, |
54 LPARAM lparam, | 54 LPARAM lparam, |
55 BOOL* handled); | 55 BOOL* handled); |
56 | 56 |
57 LRESULT OnImeSetContext(HWND window_handle, | 57 LRESULT OnImeSetContext(HWND window_handle, |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
140 // Window handle where composition is on-going. NULL when there is no | 140 // Window handle where composition is on-going. NULL when there is no |
141 // composition. | 141 // composition. |
142 HWND composing_window_handle_; | 142 HWND composing_window_handle_; |
143 | 143 |
144 DISALLOW_COPY_AND_ASSIGN(InputMethodWin); | 144 DISALLOW_COPY_AND_ASSIGN(InputMethodWin); |
145 }; | 145 }; |
146 | 146 |
147 } // namespace ui | 147 } // namespace ui |
148 | 148 |
149 #endif // UI_BASE_IME_INPUT_METHOD_WIN_H_ | 149 #endif // UI_BASE_IME_INPUT_METHOD_WIN_H_ |
OLD | NEW |