btrfs: [] on the end of a struct field is a variable length array.
[haiku.git] / headers / libs / alm / ALMLayoutBuilder.h
bloba44eff11c22963cd0cbc551f37bfececbaedf402
1 /*
2 * Copyright 2012, Haiku, Inc. All rights reserved.
3 * Distributed under the terms of the MIT License.
4 */
5 #ifndef ALM_LAYOUT_BUILDER_H
6 #define ALM_LAYOUT_BUILDER_H
9 #include "ALMLayout.h"
11 #include <ObjectList.h>
14 class BLayoutItem;
15 class BView;
16 class BWindow;
19 namespace BALM {
22 class BALMLayoutBuilder {
23 public:
24 BALMLayoutBuilder(BView* view, float hSpacing,
25 float vSpacing,
26 BALMLayout* friendLayout = NULL);
27 BALMLayoutBuilder(BView* view,
28 BALMLayout* layout);
29 BALMLayoutBuilder(BWindow* window,
30 float hSpacing, float vSpacing,
31 BALMLayout* friendLayout = NULL);
32 BALMLayoutBuilder(BWindow* window,
33 BALMLayout* layout);
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,
42 YTab* bottom = NULL);
43 BALMLayoutBuilder& Add(BLayoutItem* item, Row* row,
44 Column* column);
46 BALMLayoutBuilder& SetInsets(float insets);
47 BALMLayoutBuilder& SetInsets(float horizontal, float vertical);
48 BALMLayoutBuilder& SetInsets(float left, float top, float right,
49 float bottom);
51 BALMLayoutBuilder& SetSpacing(float horizontal, float vertical);
53 BALMLayoutBuilder& AddToLeft(BView* view,
54 XTab* left = NULL, YTab* top = NULL,
55 YTab* bottom = NULL);
56 BALMLayoutBuilder& AddToRight(BView* view,
57 XTab* right = NULL, YTab* top = NULL,
58 YTab* bottom = NULL);
59 BALMLayoutBuilder& AddAbove(BView* view,
60 YTab* top = NULL, XTab* left = NULL,
61 XTab* right = 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,
67 YTab* bottom = NULL);
68 BALMLayoutBuilder& AddToRight(BLayoutItem* item,
69 XTab* right = NULL, YTab* top = NULL,
70 YTab* bottom = NULL);
71 BALMLayoutBuilder& AddAbove(BLayoutItem* item,
72 YTab* top = NULL, XTab* left = NULL,
73 XTab* right = NULL);
74 BALMLayoutBuilder& AddBelow(BLayoutItem* item,
75 YTab* bottom = NULL, XTab* left = NULL,
76 XTab* right = NULL);
79 BALMLayoutBuilder& Push();
80 BALMLayoutBuilder& Pop();
83 // these methods throw away the stack
84 BALMLayoutBuilder& StartingAt(BView* view);
85 BALMLayoutBuilder& StartingAt(BLayoutItem* item);
88 private:
89 typedef BObjectList<Area> AreaStack;
91 BALMLayout* fLayout;
92 AreaStack fAreaStack;
94 Area* _CurrentArea() const;
95 void _SetCurrentArea(Area*);
102 #endif