OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_BRIDGE_H_ | 5 #ifndef UI_VIEWS_IME_INPUT_METHOD_BRIDGE_H_ |
6 #define UI_VIEWS_IME_INPUT_METHOD_BRIDGE_H_ | 6 #define UI_VIEWS_IME_INPUT_METHOD_BRIDGE_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 17 matching lines...) Expand all Loading... |
28 public ui::TextInputClient { | 28 public ui::TextInputClient { |
29 public: | 29 public: |
30 // |shared_input_method| indicates if |host| is shared among other top level | 30 // |shared_input_method| indicates if |host| is shared among other top level |
31 // widgets. | 31 // widgets. |
32 InputMethodBridge(internal::InputMethodDelegate* delegate, | 32 InputMethodBridge(internal::InputMethodDelegate* delegate, |
33 ui::InputMethod* host, | 33 ui::InputMethod* host, |
34 bool shared_input_method); | 34 bool shared_input_method); |
35 virtual ~InputMethodBridge(); | 35 virtual ~InputMethodBridge(); |
36 | 36 |
37 // Overridden from InputMethod: | 37 // Overridden from InputMethod: |
38 virtual void OnFocus() OVERRIDE; | 38 virtual void OnFocus() override; |
39 virtual void OnBlur() OVERRIDE; | 39 virtual void OnBlur() override; |
40 virtual bool OnUntranslatedIMEMessage(const base::NativeEvent& event, | 40 virtual bool OnUntranslatedIMEMessage(const base::NativeEvent& event, |
41 NativeEventResult* result) OVERRIDE; | 41 NativeEventResult* result) override; |
42 virtual void DispatchKeyEvent(const ui::KeyEvent& key) OVERRIDE; | 42 virtual void DispatchKeyEvent(const ui::KeyEvent& key) override; |
43 virtual void OnTextInputTypeChanged(View* view) OVERRIDE; | 43 virtual void OnTextInputTypeChanged(View* view) override; |
44 virtual void OnCaretBoundsChanged(View* view) OVERRIDE; | 44 virtual void OnCaretBoundsChanged(View* view) override; |
45 virtual void CancelComposition(View* view) OVERRIDE; | 45 virtual void CancelComposition(View* view) override; |
46 virtual void OnInputLocaleChanged() OVERRIDE; | 46 virtual void OnInputLocaleChanged() override; |
47 virtual std::string GetInputLocale() OVERRIDE; | 47 virtual std::string GetInputLocale() override; |
48 virtual bool IsActive() OVERRIDE; | 48 virtual bool IsActive() override; |
49 virtual bool IsCandidatePopupOpen() const OVERRIDE; | 49 virtual bool IsCandidatePopupOpen() const override; |
50 virtual void ShowImeIfNeeded() OVERRIDE; | 50 virtual void ShowImeIfNeeded() override; |
51 | 51 |
52 // Overridden from TextInputClient: | 52 // Overridden from TextInputClient: |
53 virtual void SetCompositionText( | 53 virtual void SetCompositionText( |
54 const ui::CompositionText& composition) OVERRIDE; | 54 const ui::CompositionText& composition) override; |
55 virtual void ConfirmCompositionText() OVERRIDE; | 55 virtual void ConfirmCompositionText() override; |
56 virtual void ClearCompositionText() OVERRIDE; | 56 virtual void ClearCompositionText() override; |
57 virtual void InsertText(const base::string16& text) OVERRIDE; | 57 virtual void InsertText(const base::string16& text) override; |
58 virtual void InsertChar(base::char16 ch, int flags) OVERRIDE; | 58 virtual void InsertChar(base::char16 ch, int flags) override; |
59 virtual gfx::NativeWindow GetAttachedWindow() const OVERRIDE; | 59 virtual gfx::NativeWindow GetAttachedWindow() const override; |
60 virtual ui::TextInputType GetTextInputType() const OVERRIDE; | 60 virtual ui::TextInputType GetTextInputType() const override; |
61 virtual ui::TextInputMode GetTextInputMode() const OVERRIDE; | 61 virtual ui::TextInputMode GetTextInputMode() const override; |
62 virtual bool CanComposeInline() const OVERRIDE; | 62 virtual bool CanComposeInline() const override; |
63 virtual gfx::Rect GetCaretBounds() const OVERRIDE; | 63 virtual gfx::Rect GetCaretBounds() const override; |
64 virtual bool GetCompositionCharacterBounds(uint32 index, | 64 virtual bool GetCompositionCharacterBounds(uint32 index, |
65 gfx::Rect* rect) const OVERRIDE; | 65 gfx::Rect* rect) const override; |
66 virtual bool HasCompositionText() const OVERRIDE; | 66 virtual bool HasCompositionText() const override; |
67 virtual bool GetTextRange(gfx::Range* range) const OVERRIDE; | 67 virtual bool GetTextRange(gfx::Range* range) const override; |
68 virtual bool GetCompositionTextRange(gfx::Range* range) const OVERRIDE; | 68 virtual bool GetCompositionTextRange(gfx::Range* range) const override; |
69 virtual bool GetSelectionRange(gfx::Range* range) const OVERRIDE; | 69 virtual bool GetSelectionRange(gfx::Range* range) const override; |
70 virtual bool SetSelectionRange(const gfx::Range& range) OVERRIDE; | 70 virtual bool SetSelectionRange(const gfx::Range& range) override; |
71 virtual bool DeleteRange(const gfx::Range& range) OVERRIDE; | 71 virtual bool DeleteRange(const gfx::Range& range) override; |
72 virtual bool GetTextFromRange(const gfx::Range& range, | 72 virtual bool GetTextFromRange(const gfx::Range& range, |
73 base::string16* text) const OVERRIDE; | 73 base::string16* text) const override; |
74 virtual void OnInputMethodChanged() OVERRIDE; | 74 virtual void OnInputMethodChanged() override; |
75 virtual bool ChangeTextDirectionAndLayoutAlignment( | 75 virtual bool ChangeTextDirectionAndLayoutAlignment( |
76 base::i18n::TextDirection direction) OVERRIDE; | 76 base::i18n::TextDirection direction) override; |
77 virtual void ExtendSelectionAndDelete(size_t before, size_t after) OVERRIDE; | 77 virtual void ExtendSelectionAndDelete(size_t before, size_t after) override; |
78 virtual void EnsureCaretInRect(const gfx::Rect& rect) OVERRIDE; | 78 virtual void EnsureCaretInRect(const gfx::Rect& rect) override; |
79 virtual void OnCandidateWindowShown() OVERRIDE; | 79 virtual void OnCandidateWindowShown() override; |
80 virtual void OnCandidateWindowUpdated() OVERRIDE; | 80 virtual void OnCandidateWindowUpdated() override; |
81 virtual void OnCandidateWindowHidden() OVERRIDE; | 81 virtual void OnCandidateWindowHidden() override; |
82 virtual bool IsEditingCommandEnabled(int command_id) OVERRIDE; | 82 virtual bool IsEditingCommandEnabled(int command_id) override; |
83 virtual void ExecuteEditingCommand(int command_id) OVERRIDE; | 83 virtual void ExecuteEditingCommand(int command_id) override; |
84 | 84 |
85 // Overridden from FocusChangeListener. | 85 // Overridden from FocusChangeListener. |
86 virtual void OnWillChangeFocus(View* focused_before, View* focused) OVERRIDE; | 86 virtual void OnWillChangeFocus(View* focused_before, View* focused) override; |
87 virtual void OnDidChangeFocus(View* focused_before, View* focused) OVERRIDE; | 87 virtual void OnDidChangeFocus(View* focused_before, View* focused) override; |
88 | 88 |
89 ui::InputMethod* GetHostInputMethod() const; | 89 ui::InputMethod* GetHostInputMethod() const; |
90 | 90 |
91 private: | 91 private: |
92 class HostObserver; | 92 class HostObserver; |
93 | 93 |
94 void UpdateViewFocusState(); | 94 void UpdateViewFocusState(); |
95 | 95 |
96 ui::InputMethod* host_; | 96 ui::InputMethod* host_; |
97 | 97 |
98 // An observer observing the host input method for cases that the host input | 98 // An observer observing the host input method for cases that the host input |
99 // method is destroyed before this bridge input method. | 99 // method is destroyed before this bridge input method. |
100 scoped_ptr<HostObserver> host_observer_; | 100 scoped_ptr<HostObserver> host_observer_; |
101 | 101 |
102 const bool shared_input_method_; | 102 const bool shared_input_method_; |
103 | 103 |
104 DISALLOW_COPY_AND_ASSIGN(InputMethodBridge); | 104 DISALLOW_COPY_AND_ASSIGN(InputMethodBridge); |
105 }; | 105 }; |
106 | 106 |
107 } // namespace views | 107 } // namespace views |
108 | 108 |
109 #endif // UI_VIEWS_IME_INPUT_METHOD_BRIDGE_H_ | 109 #endif // UI_VIEWS_IME_INPUT_METHOD_BRIDGE_H_ |
OLD | NEW |