| 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_VIEW_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_INPUT_METHOD_CANDIDATE_VIEW_H_ |
| 6 #define CHROME_BROWSER_CHROMEOS_INPUT_METHOD_CANDIDATE_VIEW_H_ | 6 #define CHROME_BROWSER_CHROMEOS_INPUT_METHOD_CANDIDATE_VIEW_H_ |
| 7 | 7 |
| 8 #include "base/gtest_prod_util.h" | 8 #include "base/gtest_prod_util.h" |
| 9 #include "chrome/browser/chromeos/input_method/ibus_ui_controller.h" | 9 #include "chrome/browser/chromeos/input_method/ibus_ui_controller.h" |
| 10 #include "chromeos/dbus/ibus/ibus_lookup_table.h" |
| 10 #include "ui/views/controls/label.h" | 11 #include "ui/views/controls/label.h" |
| 11 #include "ui/views/view.h" | 12 #include "ui/views/view.h" |
| 12 | 13 |
| 13 namespace chromeos { | 14 namespace chromeos { |
| 14 namespace input_method { | 15 namespace input_method { |
| 15 | 16 |
| 16 class CandidateWindowView; | 17 class CandidateWindowView; |
| 17 | 18 |
| 18 // CandidateView renderes a row of a candidate. | 19 // CandidateView renderes a row of a candidate. |
| 19 class CandidateView : public views::View { | 20 class CandidateView : public views::View { |
| 20 public: | 21 public: |
| 21 CandidateView(CandidateWindowView* parent_candidate_window, | 22 CandidateView(CandidateWindowView* parent_candidate_window, |
| 22 int index_in_page, | 23 int index_in_page, |
| 23 InputMethodLookupTable::Orientation orientation); | 24 ibus::IBusLookupTable::Orientation orientation); |
| 24 virtual ~CandidateView() {} | 25 virtual ~CandidateView() {} |
| 25 // Initializes the candidate view with the given column widths. | 26 // Initializes the candidate view with the given column widths. |
| 26 // A width of 0 means that the column is resizable. | 27 // A width of 0 means that the column is resizable. |
| 27 void Init(int shortcut_column_width, | 28 void Init(int shortcut_column_width, |
| 28 int candidate_column_width, | 29 int candidate_column_width, |
| 29 int annotation_column_width, | 30 int annotation_column_width, |
| 30 int column_height); | 31 int column_height); |
| 31 | 32 |
| 32 // Sets candidate text to the given text. | 33 // Sets candidate text to the given text. |
| 33 void SetCandidateText(const string16& text); | 34 void SetCandidateText(const string16& text); |
| (...skipping 29 matching lines...) Expand all Loading... |
| 63 virtual bool OnMousePressed(const ui::MouseEvent& event) OVERRIDE; | 64 virtual bool OnMousePressed(const ui::MouseEvent& event) OVERRIDE; |
| 64 | 65 |
| 65 // Notifies labels of their new background colors. Called whenever the view's | 66 // Notifies labels of their new background colors. Called whenever the view's |
| 66 // background color changes. | 67 // background color changes. |
| 67 void UpdateLabelBackgroundColors(); | 68 void UpdateLabelBackgroundColors(); |
| 68 | 69 |
| 69 // Zero-origin index in the current page. | 70 // Zero-origin index in the current page. |
| 70 int index_in_page_; | 71 int index_in_page_; |
| 71 | 72 |
| 72 // The orientation of the candidate view. | 73 // The orientation of the candidate view. |
| 73 InputMethodLookupTable::Orientation orientation_; | 74 ibus::IBusLookupTable::Orientation orientation_; |
| 74 | 75 |
| 75 // The parent candidate window that contains this view. | 76 // The parent candidate window that contains this view. |
| 76 CandidateWindowView* parent_candidate_window_; | 77 CandidateWindowView* parent_candidate_window_; |
| 77 | 78 |
| 78 // Views created in the class will be part of tree of |this|, so these | 79 // Views created in the class will be part of tree of |this|, so these |
| 79 // child views will be deleted when |this| is deleted. | 80 // child views will be deleted when |this| is deleted. |
| 80 | 81 |
| 81 // The shortcut label renders shortcut numbers like 1, 2, and 3. | 82 // The shortcut label renders shortcut numbers like 1, 2, and 3. |
| 82 views::Label* shortcut_label_; | 83 views::Label* shortcut_label_; |
| 83 // The candidate label renders candidates. | 84 // The candidate label renders candidates. |
| 84 views::Label* candidate_label_; | 85 views::Label* candidate_label_; |
| 85 // The annotation label renders annotations. | 86 // The annotation label renders annotations. |
| 86 views::Label* annotation_label_; | 87 views::Label* annotation_label_; |
| 87 | 88 |
| 88 // The infolist icon. | 89 // The infolist icon. |
| 89 views::View* infolist_icon_; | 90 views::View* infolist_icon_; |
| 90 bool infolist_icon_enabled_; | 91 bool infolist_icon_enabled_; |
| 91 | 92 |
| 92 DISALLOW_COPY_AND_ASSIGN(CandidateView); | 93 DISALLOW_COPY_AND_ASSIGN(CandidateView); |
| 93 }; | 94 }; |
| 94 | 95 |
| 95 } // namespace input_method | 96 } // namespace input_method |
| 96 } // namespace chromeos | 97 } // namespace chromeos |
| 97 | 98 |
| 98 #endif // CHROME_BROWSER_CHROMEOS_INPUT_METHOD_CANDIDATE_VIEW_H_ | 99 #endif // CHROME_BROWSER_CHROMEOS_INPUT_METHOD_CANDIDATE_VIEW_H_ |
| OLD | NEW |