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 // The header files provides APIs for monitoring and controlling input | 5 // The header files provides APIs for monitoring and controlling input |
6 // method UI status. The APIs encapsulate the APIs of IBus, the underlying | 6 // method UI status. The APIs encapsulate the APIs of IBus, the underlying |
7 // input method framework. | 7 // input method framework. |
8 // TODO(nona): Remove IBusUiController. | 8 // TODO(nona): Remove IBusUiController. |
9 | 9 |
10 #ifndef CHROME_BROWSER_CHROMEOS_INPUT_METHOD_IBUS_UI_CONTROLLER_H_ | 10 #ifndef CHROME_BROWSER_CHROMEOS_INPUT_METHOD_IBUS_UI_CONTROLLER_H_ |
(...skipping 27 matching lines...) Expand all Loading... |
38 // Called when the auxiliary text becomes hidden. | 38 // Called when the auxiliary text becomes hidden. |
39 virtual void OnHideAuxiliaryText() = 0; | 39 virtual void OnHideAuxiliaryText() = 0; |
40 | 40 |
41 // Called when the lookup table becomes hidden. | 41 // Called when the lookup table becomes hidden. |
42 virtual void OnHideLookupTable() = 0; | 42 virtual void OnHideLookupTable() = 0; |
43 | 43 |
44 // Called when the preedit text becomes hidden. | 44 // Called when the preedit text becomes hidden. |
45 virtual void OnHidePreeditText() = 0; | 45 virtual void OnHidePreeditText() = 0; |
46 | 46 |
47 // Called when the cursor location is set. | 47 // Called when the cursor location is set. |
48 virtual void OnSetCursorLocation(const gfx::Rect& cusor_location, | 48 virtual void OnSetCursorLocation(const ibus::Rect& cusor_location, |
49 const gfx::Rect& composition_head) = 0; | 49 const ibus::Rect& composition_head) = 0; |
50 | 50 |
51 // Called when the auxiliary text is updated. | 51 // Called when the auxiliary text is updated. |
52 virtual void OnUpdateAuxiliaryText(const std::string& text, | 52 virtual void OnUpdateAuxiliaryText(const std::string& text, |
53 bool visible) = 0; | 53 bool visible) = 0; |
54 | 54 |
55 // Called when the lookup table is updated. | 55 // Called when the lookup table is updated. |
56 virtual void OnUpdateLookupTable(const ibus::IBusLookupTable& table, | 56 virtual void OnUpdateLookupTable(const ibus::IBusLookupTable& table, |
57 bool visible) = 0; | 57 bool visible) = 0; |
58 | 58 |
59 // Called when the preedit text is updated. | 59 // Called when the preedit text is updated. |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
92 void NotifyCursorDown(); | 92 void NotifyCursorDown(); |
93 | 93 |
94 // Notifies that the page up button is clicked. |PageUp| signal will be | 94 // Notifies that the page up button is clicked. |PageUp| signal will be |
95 // sent to the ibus-daemon | 95 // sent to the ibus-daemon |
96 void NotifyPageUp(); | 96 void NotifyPageUp(); |
97 | 97 |
98 // Notifies that the page down button is clicked. |PageDown| signal will be | 98 // Notifies that the page down button is clicked. |PageDown| signal will be |
99 // sent to the ibus-daemon | 99 // sent to the ibus-daemon |
100 void NotifyPageDown(); | 100 void NotifyPageDown(); |
101 | 101 |
102 // Handles cursor location update event. This is originate from | |
103 // SetCursorLocation method call, but we can bypass it on Chrome OS because | |
104 // candidate window is integrated with Chrome. | |
105 void SetCursorLocation(const gfx::Rect& cursor_location, | |
106 const gfx::Rect& composition_head); | |
107 | |
108 private: | 102 private: |
109 // IBusPanelHandlerInterface overrides. | 103 // IBusPanelHandlerInterface overrides. |
110 virtual void UpdateLookupTable(const ibus::IBusLookupTable& table, | 104 virtual void UpdateLookupTable(const ibus::IBusLookupTable& table, |
111 bool visible) OVERRIDE; | 105 bool visible) OVERRIDE; |
112 virtual void HideLookupTable() OVERRIDE; | 106 virtual void HideLookupTable() OVERRIDE; |
113 virtual void UpdateAuxiliaryText(const std::string& text, | 107 virtual void UpdateAuxiliaryText(const std::string& text, |
114 bool visible) OVERRIDE; | 108 bool visible) OVERRIDE; |
115 virtual void HideAuxiliaryText() OVERRIDE; | 109 virtual void HideAuxiliaryText() OVERRIDE; |
116 virtual void UpdatePreeditText(const std::string& text, uint32 cursor_pos, | 110 virtual void UpdatePreeditText(const std::string& text, uint32 cursor_pos, |
117 bool visible) OVERRIDE; | 111 bool visible) OVERRIDE; |
118 virtual void HidePreeditText() OVERRIDE; | 112 virtual void HidePreeditText() OVERRIDE; |
| 113 virtual void SetCursorLocation(const ibus::Rect& cursor_location, |
| 114 const ibus::Rect& composition_head) OVERRIDE; |
119 | 115 |
120 ObserverList<Observer> observers_; | 116 ObserverList<Observer> observers_; |
121 | 117 |
122 DISALLOW_COPY_AND_ASSIGN(IBusUiController); | 118 DISALLOW_COPY_AND_ASSIGN(IBusUiController); |
123 }; | 119 }; |
124 | 120 |
125 } // namespace input_method | 121 } // namespace input_method |
126 } // namespace chromeos | 122 } // namespace chromeos |
127 | 123 |
128 #endif // CHROME_BROWSER_CHROMEOS_INPUT_METHOD_IBUS_UI_CONTROLLER_H_ | 124 #endif // CHROME_BROWSER_CHROMEOS_INPUT_METHOD_IBUS_UI_CONTROLLER_H_ |
OLD | NEW |