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