| 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_WIN_H_ | 5 #ifndef VIEWS_IME_INPUT_METHOD_WIN_H_ |
| 6 #define VIEWS_IME_INPUT_METHOD_WIN_H_ | 6 #define VIEWS_IME_INPUT_METHOD_WIN_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <windows.h> | 9 #include <windows.h> |
| 10 | 10 |
| 11 #include <string> | 11 #include <string> |
| 12 | 12 |
| 13 #include "base/basictypes.h" | 13 #include "base/basictypes.h" |
| 14 #include "base/compiler_specific.h" | 14 #include "base/compiler_specific.h" |
| 15 #include "ui/base/win/ime_input.h" | 15 #include "ui/base/win/ime_input.h" |
| 16 #include "views/ime/input_method_base.h" | 16 #include "views/ime/input_method_base.h" |
| 17 #include "views/view.h" | 17 #include "views/view.h" |
| 18 #include "views/widget/widget.h" | 18 #include "views/widget/widget.h" |
| 19 | 19 |
| 20 namespace views { | 20 namespace views { |
| 21 | 21 |
| 22 // An InputMethod implementation based on Windows IMM32 API. | 22 // An InputMethod implementation based on Windows IMM32 API. |
| 23 class InputMethodWin : public InputMethodBase { | 23 class InputMethodWin : public InputMethodBase { |
| 24 public: | 24 public: |
| 25 explicit InputMethodWin(internal::InputMethodDelegate* delegate); | 25 InputMethodWin(); |
| 26 virtual ~InputMethodWin(); | 26 virtual ~InputMethodWin(); |
| 27 | 27 |
| 28 // Overridden from InputMethod: | 28 // Overridden from InputMethod: |
| 29 virtual void Init(Widget* widget) OVERRIDE; | 29 virtual void Init(Widget* widget) OVERRIDE; |
| 30 virtual void OnFocus() OVERRIDE; | 30 virtual void OnFocus() OVERRIDE; |
| 31 virtual void OnBlur() OVERRIDE; | 31 virtual void OnBlur() OVERRIDE; |
| 32 virtual void DispatchKeyEvent(const KeyEvent& key) OVERRIDE; | 32 virtual bool OnKeyEvent(const KeyEvent& key) OVERRIDE; |
| 33 virtual void OnTextInputTypeChanged(View* view) OVERRIDE; | 33 virtual void OnTextInputTypeChanged(View* view) OVERRIDE; |
| 34 virtual void OnCaretBoundsChanged(View* view) OVERRIDE; | 34 virtual void OnCaretBoundsChanged(View* view) OVERRIDE; |
| 35 virtual void CancelComposition(View* view) OVERRIDE; | 35 virtual void CancelComposition(View* view) OVERRIDE; |
| 36 virtual std::string GetInputLocale() OVERRIDE; | 36 virtual std::string GetInputLocale() OVERRIDE; |
| 37 virtual base::i18n::TextDirection GetInputTextDirection() OVERRIDE; | 37 virtual base::i18n::TextDirection GetInputTextDirection() OVERRIDE; |
| 38 virtual bool IsActive() OVERRIDE; | 38 virtual bool IsActive() OVERRIDE; |
| 39 | 39 |
| 40 // Message handlers. The native widget is responsible for forwarding following | 40 // Message handlers. The native widget is responsible for forwarding following |
| 41 // messages to the input method. | 41 // messages to the input method. |
| 42 void OnInputLangChange(DWORD character_set, HKL input_language_id); | 42 void OnInputLangChange(DWORD character_set, HKL input_language_id); |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 86 // Windows IMM32 wrapper. | 86 // Windows IMM32 wrapper. |
| 87 // (See "ui/base/win/ime_input.h" for its details.) | 87 // (See "ui/base/win/ime_input.h" for its details.) |
| 88 ui::ImeInput ime_input_; | 88 ui::ImeInput ime_input_; |
| 89 | 89 |
| 90 DISALLOW_COPY_AND_ASSIGN(InputMethodWin); | 90 DISALLOW_COPY_AND_ASSIGN(InputMethodWin); |
| 91 }; | 91 }; |
| 92 | 92 |
| 93 } // namespace views | 93 } // namespace views |
| 94 | 94 |
| 95 #endif // VIEWS_IME_INPUT_METHOD_WIN_H_ | 95 #endif // VIEWS_IME_INPUT_METHOD_WIN_H_ |
| OLD | NEW |