OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_LAYOUT_MANAGER_H_ | 5 #ifndef UI_VIEWS_LAYOUT_LAYOUT_MANAGER_H_ |
6 #define UI_VIEWS_LAYOUT_LAYOUT_MANAGER_H_ | 6 #define UI_VIEWS_LAYOUT_LAYOUT_MANAGER_H_ |
7 | 7 |
8 #include "ui/views/views_export.h" | 8 #include "ui/views/views_export.h" |
9 | 9 |
10 namespace gfx { | 10 namespace gfx { |
(...skipping 24 matching lines...) Expand all Loading... |
35 // host. | 35 // host. |
36 virtual void Uninstalled(View* host); | 36 virtual void Uninstalled(View* host); |
37 | 37 |
38 // Lay out the children of |host| according to implementation-specific | 38 // Lay out the children of |host| according to implementation-specific |
39 // heuristics. The graphics used during painting is provided to allow for | 39 // heuristics. The graphics used during painting is provided to allow for |
40 // string sizing. | 40 // string sizing. |
41 virtual void Layout(View* host) = 0; | 41 virtual void Layout(View* host) = 0; |
42 | 42 |
43 // Return the preferred size which is the size required to give each | 43 // Return the preferred size which is the size required to give each |
44 // children their respective preferred size. | 44 // children their respective preferred size. |
45 virtual gfx::Size GetPreferredSize(View* host) = 0; | 45 virtual gfx::Size GetPreferredSize(const View* host) const = 0; |
46 | 46 |
47 // Returns the preferred height for the specified width. The default | 47 // Returns the preferred height for the specified width. The default |
48 // implementation returns the value from GetPreferredSize. | 48 // implementation returns the value from GetPreferredSize. |
49 virtual int GetPreferredHeightForWidth(View* host, int width); | 49 virtual int GetPreferredHeightForWidth(const View* host, int width) const; |
50 | 50 |
51 // Notification that a view has been added. | 51 // Notification that a view has been added. |
52 virtual void ViewAdded(View* host, View* view); | 52 virtual void ViewAdded(View* host, View* view); |
53 | 53 |
54 // Notification that a view has been removed. | 54 // Notification that a view has been removed. |
55 virtual void ViewRemoved(View* host, View* view); | 55 virtual void ViewRemoved(View* host, View* view); |
56 }; | 56 }; |
57 | 57 |
58 } // namespace views | 58 } // namespace views |
59 | 59 |
60 #endif // UI_VIEWS_LAYOUT_LAYOUT_MANAGER_H_ | 60 #endif // UI_VIEWS_LAYOUT_LAYOUT_MANAGER_H_ |
OLD | NEW |