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_LAYOUT_GRID_LAYOUT_H_ | 5 #ifndef UI_VIEWS_LAYOUT_GRID_LAYOUT_H_ |
6 #define UI_VIEWS_LAYOUT_GRID_LAYOUT_H_ | 6 #define UI_VIEWS_LAYOUT_GRID_LAYOUT_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
155 // pref_width/pref_height is > 0 then the preferred width/height of the view | 155 // pref_width/pref_height is > 0 then the preferred width/height of the view |
156 // is fixed to the specified value. | 156 // is fixed to the specified value. |
157 // As a convenience this adds the view to the host. The view becomes owned | 157 // As a convenience this adds the view to the host. The view becomes owned |
158 // by the host, and NOT this GridLayout. | 158 // by the host, and NOT this GridLayout. |
159 void AddView(View* view, int col_span, int row_span, | 159 void AddView(View* view, int col_span, int row_span, |
160 Alignment h_align, Alignment v_align, | 160 Alignment h_align, Alignment v_align, |
161 int pref_width, int pref_height); | 161 int pref_width, int pref_height); |
162 | 162 |
163 // Notification we've been installed on a particular host. Checks that host | 163 // Notification we've been installed on a particular host. Checks that host |
164 // is the same as the View supplied in the constructor. | 164 // is the same as the View supplied in the constructor. |
165 virtual void Installed(View* host) OVERRIDE; | 165 virtual void Installed(View* host) override; |
166 | 166 |
167 // Notification we've been uninstalled on a particular host. Checks that host | 167 // Notification we've been uninstalled on a particular host. Checks that host |
168 // is the same as the View supplied in the constructor. | 168 // is the same as the View supplied in the constructor. |
169 virtual void Uninstalled(View* host) OVERRIDE; | 169 virtual void Uninstalled(View* host) override; |
170 | 170 |
171 // Notification that a view has been added. | 171 // Notification that a view has been added. |
172 virtual void ViewAdded(View* host, View* view) OVERRIDE; | 172 virtual void ViewAdded(View* host, View* view) override; |
173 | 173 |
174 // Notification that a view has been removed. | 174 // Notification that a view has been removed. |
175 virtual void ViewRemoved(View* host, View* view) OVERRIDE; | 175 virtual void ViewRemoved(View* host, View* view) override; |
176 | 176 |
177 // Layouts out the components. | 177 // Layouts out the components. |
178 virtual void Layout(View* host) OVERRIDE; | 178 virtual void Layout(View* host) override; |
179 | 179 |
180 // Returns the preferred size for the GridLayout. | 180 // Returns the preferred size for the GridLayout. |
181 virtual gfx::Size GetPreferredSize(const View* host) const OVERRIDE; | 181 virtual gfx::Size GetPreferredSize(const View* host) const override; |
182 | 182 |
183 virtual int GetPreferredHeightForWidth(const View* host, | 183 virtual int GetPreferredHeightForWidth(const View* host, |
184 int width) const OVERRIDE; | 184 int width) const override; |
185 | 185 |
186 void set_minimum_size(const gfx::Size& size) { minimum_size_ = size; } | 186 void set_minimum_size(const gfx::Size& size) { minimum_size_ = size; } |
187 | 187 |
188 private: | 188 private: |
189 // As both Layout and GetPreferredSize need to do nearly the same thing, | 189 // As both Layout and GetPreferredSize need to do nearly the same thing, |
190 // they both call into this method. This sizes the Columns/Rows as | 190 // they both call into this method. This sizes the Columns/Rows as |
191 // appropriate. If layout is true, width/height give the width/height the | 191 // appropriate. If layout is true, width/height give the width/height the |
192 // of the host, otherwise they are ignored. | 192 // of the host, otherwise they are ignored. |
193 void SizeRowsAndColumns(bool layout, | 193 void SizeRowsAndColumns(bool layout, |
194 int width, | 194 int width, |
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
367 // The master column of those columns that are linked. See Column | 367 // The master column of those columns that are linked. See Column |
368 // for a description of what the master column is. | 368 // for a description of what the master column is. |
369 std::vector<Column*> master_columns_; | 369 std::vector<Column*> master_columns_; |
370 | 370 |
371 DISALLOW_COPY_AND_ASSIGN(ColumnSet); | 371 DISALLOW_COPY_AND_ASSIGN(ColumnSet); |
372 }; | 372 }; |
373 | 373 |
374 } // namespace views | 374 } // namespace views |
375 | 375 |
376 #endif // UI_VIEWS_LAYOUT_GRID_LAYOUT_H_ | 376 #endif // UI_VIEWS_LAYOUT_GRID_LAYOUT_H_ |
OLD | NEW |