| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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_VIEWS_LAYOUT_MANAGER_H__ | 5 #ifndef CHROME_VIEWS_LAYOUT_MANAGER_H__ |
| 6 #define CHROME_VIEWS_LAYOUT_MANAGER_H__ | 6 #define CHROME_VIEWS_LAYOUT_MANAGER_H__ |
| 7 | 7 |
| 8 #include <atlbase.h> | 8 #include <atlbase.h> |
| 9 #include <atlapp.h> | 9 #include <atlapp.h> |
| 10 #include <atlmisc.h> | 10 #include <atlmisc.h> |
| 11 | 11 |
| 12 namespace gfx { |
| 13 class Size; |
| 14 } |
| 15 |
| 12 namespace ChromeViews { | 16 namespace ChromeViews { |
| 13 | 17 |
| 14 class View; | 18 class View; |
| 15 | 19 |
| 16 ///////////////////////////////////////////////////////////////////////////// | 20 ///////////////////////////////////////////////////////////////////////////// |
| 17 // | 21 // |
| 18 // LayoutManager interface | 22 // LayoutManager interface |
| 19 // | 23 // |
| 20 // The LayoutManager interface provides methods to handle the sizing of | 24 // The LayoutManager interface provides methods to handle the sizing of |
| 21 // the children of a View according to implementation-specific heuristics. | 25 // the children of a View according to implementation-specific heuristics. |
| (...skipping 11 matching lines...) Expand all Loading... |
| 33 // host. | 37 // host. |
| 34 virtual void Uninstalled(View* host) {} | 38 virtual void Uninstalled(View* host) {} |
| 35 | 39 |
| 36 // Lay out the children of |host| according to implementation-specific | 40 // Lay out the children of |host| according to implementation-specific |
| 37 // heuristics. The graphics used during painting is provided to allow for | 41 // heuristics. The graphics used during painting is provided to allow for |
| 38 // string sizing. | 42 // string sizing. |
| 39 virtual void Layout(View* host) = 0; | 43 virtual void Layout(View* host) = 0; |
| 40 | 44 |
| 41 // Return the preferred size which is the size required to give each | 45 // Return the preferred size which is the size required to give each |
| 42 // children their respective preferred size. | 46 // children their respective preferred size. |
| 43 virtual void GetPreferredSize(View* host, CSize* out) = 0; | 47 virtual gfx::Size GetPreferredSize(View* host) = 0; |
| 44 | 48 |
| 45 // Returns the preferred height for the specified width. The default | 49 // Returns the preferred height for the specified width. The default |
| 46 // implementation returns the value from GetPreferredSize. | 50 // implementation returns the value from GetPreferredSize. |
| 47 virtual int GetPreferredHeightForWidth(View* host, int width); | 51 virtual int GetPreferredHeightForWidth(View* host, int width); |
| 48 | 52 |
| 49 // Notification that a view has been added. | 53 // Notification that a view has been added. |
| 50 virtual void ViewAdded(View* host, View* view) {} | 54 virtual void ViewAdded(View* host, View* view) {} |
| 51 | 55 |
| 52 // Notification that a view has been removed. | 56 // Notification that a view has been removed. |
| 53 virtual void ViewRemoved(View* host, View* view) {} | 57 virtual void ViewRemoved(View* host, View* view) {} |
| 54 }; | 58 }; |
| 55 | 59 |
| 56 } | 60 } |
| 57 | 61 |
| 58 #endif // CHROME_VIEWS_LAYOUT_MANAGER_H__ | 62 #endif // CHROME_VIEWS_LAYOUT_MANAGER_H__ |
| 59 | 63 |
| OLD | NEW |