Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(153)

Side by Side Diff: ui/views/layout/layout_manager.h

Issue 851853002: It is time. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Trying to reup because the last upload failed. Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « ui/views/layout/layout_constants.h ('k') | ui/views/layout/layout_manager.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef UI_VIEWS_LAYOUT_LAYOUT_MANAGER_H_
6 #define UI_VIEWS_LAYOUT_LAYOUT_MANAGER_H_
7
8 #include "ui/views/views_export.h"
9
10 namespace gfx {
11 class Size;
12 }
13
14 namespace views {
15
16 class View;
17
18 /////////////////////////////////////////////////////////////////////////////
19 //
20 // LayoutManager interface
21 //
22 // The LayoutManager interface provides methods to handle the sizing of
23 // the children of a View according to implementation-specific heuristics.
24 //
25 /////////////////////////////////////////////////////////////////////////////
26 class VIEWS_EXPORT LayoutManager {
27 public:
28 virtual ~LayoutManager();
29
30 // Notification that this LayoutManager has been installed on a particular
31 // host.
32 virtual void Installed(View* host);
33
34 // Notification that this LayoutManager has been uninstalled on a particular
35 // host.
36 virtual void Uninstalled(View* host);
37
38 // Lay out the children of |host| according to implementation-specific
39 // heuristics. The graphics used during painting is provided to allow for
40 // string sizing.
41 virtual void Layout(View* host) = 0;
42
43 // Return the preferred size which is the size required to give each
44 // children their respective preferred size.
45 virtual gfx::Size GetPreferredSize(const View* host) const = 0;
46
47 // Returns the preferred height for the specified width. The default
48 // implementation returns the value from GetPreferredSize.
49 virtual int GetPreferredHeightForWidth(const View* host, int width) const;
50
51 // Notification that a view has been added.
52 virtual void ViewAdded(View* host, View* view);
53
54 // Notification that a view has been removed.
55 virtual void ViewRemoved(View* host, View* view);
56 };
57
58 } // namespace views
59
60 #endif // UI_VIEWS_LAYOUT_LAYOUT_MANAGER_H_
OLDNEW
« no previous file with comments | « ui/views/layout/layout_constants.h ('k') | ui/views/layout/layout_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698