2 * Copyright 2012, Haiku, Inc. All rights reserved.
3 * Distributed under the terms of the MIT License.
5 #ifndef ALM_LAYOUT_BUILDER_H
6 #define ALM_LAYOUT_BUILDER_H
11 #include <ObjectList.h>
22 class BALMLayoutBuilder
{
24 BALMLayoutBuilder(BView
* view
, float hSpacing
,
26 BALMLayout
* friendLayout
= NULL
);
27 BALMLayoutBuilder(BView
* view
,
29 BALMLayoutBuilder(BWindow
* window
,
30 float hSpacing
, float vSpacing
,
31 BALMLayout
* friendLayout
= NULL
);
32 BALMLayoutBuilder(BWindow
* window
,
34 BALMLayoutBuilder(BALMLayout
* layout
);
36 BALMLayoutBuilder
& Add(BView
* view
, XTab
* left
, YTab
* top
,
37 XTab
* right
= NULL
, YTab
* bottom
= NULL
);
38 BALMLayoutBuilder
& Add(BView
* view
, Row
* row
, Column
* column
);
40 BALMLayoutBuilder
& Add(BLayoutItem
* item
, XTab
* left
,
41 YTab
* top
, XTab
* right
= NULL
,
43 BALMLayoutBuilder
& Add(BLayoutItem
* item
, Row
* row
,
46 BALMLayoutBuilder
& SetInsets(float insets
);
47 BALMLayoutBuilder
& SetInsets(float horizontal
, float vertical
);
48 BALMLayoutBuilder
& SetInsets(float left
, float top
, float right
,
51 BALMLayoutBuilder
& SetSpacing(float horizontal
, float vertical
);
53 BALMLayoutBuilder
& AddToLeft(BView
* view
,
54 XTab
* left
= NULL
, YTab
* top
= NULL
,
56 BALMLayoutBuilder
& AddToRight(BView
* view
,
57 XTab
* right
= NULL
, YTab
* top
= NULL
,
59 BALMLayoutBuilder
& AddAbove(BView
* view
,
60 YTab
* top
= NULL
, XTab
* left
= NULL
,
62 BALMLayoutBuilder
& AddBelow(BView
* view
, YTab
* bottom
= NULL
,
63 XTab
* left
= NULL
, XTab
* right
= NULL
);
65 BALMLayoutBuilder
& AddToLeft(BLayoutItem
* item
,
66 XTab
* left
= NULL
, YTab
* top
= NULL
,
68 BALMLayoutBuilder
& AddToRight(BLayoutItem
* item
,
69 XTab
* right
= NULL
, YTab
* top
= NULL
,
71 BALMLayoutBuilder
& AddAbove(BLayoutItem
* item
,
72 YTab
* top
= NULL
, XTab
* left
= NULL
,
74 BALMLayoutBuilder
& AddBelow(BLayoutItem
* item
,
75 YTab
* bottom
= NULL
, XTab
* left
= NULL
,
79 BALMLayoutBuilder
& Push();
80 BALMLayoutBuilder
& Pop();
83 // these methods throw away the stack
84 BALMLayoutBuilder
& StartingAt(BView
* view
);
85 BALMLayoutBuilder
& StartingAt(BLayoutItem
* item
);
89 typedef BObjectList
<Area
> AreaStack
;
94 Area
* _CurrentArea() const;
95 void _SetCurrentArea(Area
*);