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 CHROME_BROWSER_CHROMEOS_INPUT_METHOD_CANDIDATE_WINDOW_VIEW_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_INPUT_METHOD_CANDIDATE_WINDOW_VIEW_H_ |
6 #define CHROME_BROWSER_CHROMEOS_INPUT_METHOD_CANDIDATE_WINDOW_VIEW_H_ | 6 #define CHROME_BROWSER_CHROMEOS_INPUT_METHOD_CANDIDATE_WINDOW_VIEW_H_ |
7 | 7 |
8 #include "base/gtest_prod_util.h" | 8 #include "base/gtest_prod_util.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "base/timer.h" | 10 #include "base/timer.h" |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
124 // |2 YYY| | 124 // |2 YYY| |
125 // |3 ZZZ| | 125 // |3 ZZZ| |
126 // | 126 // |
127 // Returns 0 if no candidate is present. | 127 // Returns 0 if no candidate is present. |
128 int GetHorizontalOffset(); | 128 int GetHorizontalOffset(); |
129 | 129 |
130 void set_cursor_location(const gfx::Rect& cursor_location) { | 130 void set_cursor_location(const gfx::Rect& cursor_location) { |
131 cursor_location_ = cursor_location; | 131 cursor_location_ = cursor_location; |
132 } | 132 } |
133 | 133 |
| 134 void set_composition_head_location( |
| 135 const gfx::Rect& composition_head_location) { |
| 136 composition_head_location_ = composition_head_location; |
| 137 } |
| 138 |
134 const gfx::Rect& cursor_location() const { return cursor_location_; } | 139 const gfx::Rect& cursor_location() const { return cursor_location_; } |
| 140 const gfx::Rect& composition_head_location() const { |
| 141 return composition_head_location_; |
| 142 } |
135 | 143 |
136 protected: | 144 protected: |
137 // Override View::VisibilityChanged() | 145 // Override View::VisibilityChanged() |
138 virtual void VisibilityChanged(View* starting_from, bool is_visible) OVERRIDE; | 146 virtual void VisibilityChanged(View* starting_from, bool is_visible) OVERRIDE; |
139 | 147 |
140 // Override View::OnBoundsChanged() | 148 // Override View::OnBoundsChanged() |
141 virtual void OnBoundsChanged(const gfx::Rect& previous_bounds) OVERRIDE; | 149 virtual void OnBoundsChanged(const gfx::Rect& previous_bounds) OVERRIDE; |
142 | 150 |
143 private: | 151 private: |
144 FRIEND_TEST_ALL_PREFIXES(CandidateWindowViewTest, MozcUpdateCandidateTest); | 152 FRIEND_TEST_ALL_PREFIXES(CandidateWindowViewTest, MozcUpdateCandidateTest); |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
194 InformationTextArea* footer_area_; | 202 InformationTextArea* footer_area_; |
195 | 203 |
196 // Current columns size in |candidate_area_|. | 204 // Current columns size in |candidate_area_|. |
197 gfx::Size previous_shortcut_column_size_; | 205 gfx::Size previous_shortcut_column_size_; |
198 gfx::Size previous_candidate_column_size_; | 206 gfx::Size previous_candidate_column_size_; |
199 gfx::Size previous_annotation_column_size_; | 207 gfx::Size previous_annotation_column_size_; |
200 | 208 |
201 // The last cursor location. | 209 // The last cursor location. |
202 gfx::Rect cursor_location_; | 210 gfx::Rect cursor_location_; |
203 | 211 |
204 // This location is used by suggestion window rendering which is mostly used | 212 // The last compostion head location. |
205 // by ibus-mozc. The suggestion window should be aligned with the composition | 213 gfx::Rect composition_head_location_; |
206 // text as opposed to the cursor. In case of ibus-mozc, suggestion window | |
207 // location is calculated by engine and it carried by update_lookup_table | |
208 // signal as additional information. This value is available when | |
209 // is_suggestion_window_available is true. | |
210 gfx::Rect suggestion_window_location_; | |
211 | 214 |
212 bool is_suggestion_window_location_available_; | 215 // True if the candidate window should be shown with aligning with composition |
| 216 // text as opposed to the cursor. |
| 217 bool should_show_at_composition_head_; |
213 | 218 |
214 // True if the candidate window should be shonw on the upper side of | 219 // True if the candidate window should be shonw on the upper side of |
215 // composition text. | 220 // composition text. |
216 bool should_show_upper_side_; | 221 bool should_show_upper_side_; |
217 | 222 |
218 // True if the candidate window was open. This is used to determine when to | 223 // True if the candidate window was open. This is used to determine when to |
219 // send OnCandidateWindowOpened and OnCandidateWindowClosed events. | 224 // send OnCandidateWindowOpened and OnCandidateWindowClosed events. |
220 bool was_candidate_window_open_; | 225 bool was_candidate_window_open_; |
221 | 226 |
222 // This function judge whether the candidate window should be shown or not, | 227 // This function judge whether the candidate window should be shown or not, |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
283 // Information description font | 288 // Information description font |
284 scoped_ptr<gfx::Font> description_font_; | 289 scoped_ptr<gfx::Font> description_font_; |
285 | 290 |
286 DISALLOW_COPY_AND_ASSIGN(InfolistWindowView); | 291 DISALLOW_COPY_AND_ASSIGN(InfolistWindowView); |
287 }; | 292 }; |
288 | 293 |
289 } // namespace input_method | 294 } // namespace input_method |
290 } // namespace chromeos | 295 } // namespace chromeos |
291 | 296 |
292 #endif // CHROME_BROWSER_CHROMEOS_INPUT_METHOD_CANDIDATE_WINDOW_VIEW_H_ | 297 #endif // CHROME_BROWSER_CHROMEOS_INPUT_METHOD_CANDIDATE_WINDOW_VIEW_H_ |
OLD | NEW |