1/*
2 * Copyright 2012, Haiku, Inc. All rights reserved.
3 * Copyright 2010, Clemens Zeidler <haiku@clemens-zeidler.de>
4 * Distributed under the terms of the MIT License.
5 */
6#ifndef	ALMGROUP_H
7#define ALMGROUP_H
8
9
10#include <vector>
11
12#include <InterfaceDefs.h> // for enum orientation
13#include <Referenceable.h>
14
15#include "Tab.h"
16
17
18class BLayoutItem;
19class BView;
20
21
22namespace BALM {
23
24class BALMLayout;
25
26
27class ALMGroup {
28public:
29								ALMGroup(BLayoutItem* item);
30								ALMGroup(BView* view);
31
32			BLayoutItem*		LayoutItem() const;
33			BView*				View() const;
34
35			const std::vector<ALMGroup>& Groups() const;
36			enum orientation	Orientation() const;
37
38			ALMGroup& 			operator|(const ALMGroup& right);
39			ALMGroup& 			operator/(const ALMGroup& bottom);
40
41			void				BuildLayout(BALMLayout* layout,
42									XTab* left = NULL, YTab* top = NULL,
43									XTab* right = NULL, YTab* bottom = NULL);
44
45private:
46								ALMGroup();
47
48			void				_Init(BLayoutItem* item, BView* view,
49									  enum orientation orien = B_HORIZONTAL);
50			ALMGroup& 			_AddItem(const ALMGroup& item,
51									enum orientation orien);
52
53			void				_Build(BALMLayout* layout,
54									BReference<XTab> left, BReference<YTab> top,
55									BReference<XTab> right,
56									BReference<YTab> bottom) const;
57
58
59			BLayoutItem*		fLayoutItem;
60			BView*				fView;
61
62			std::vector<ALMGroup> fGroups;
63			enum orientation	fOrientation;
64
65			uint32				_reserved[4];
66};
67
68
69};
70
71
72using BALM::ALMGroup;
73
74#endif
75