1/*
2 * Copyright 2006 - 2010, Haiku, Inc. All rights reserved.
3 * Distributed under the terms of the MIT License.
4 */
5#ifndef	X_TAB_H
6#define	X_TAB_H
7
8
9#include <Archivable.h>
10#include <Referenceable.h>
11
12#include "Variable.h"
13
14
15namespace BALM {
16
17
18class BALMLayout;
19
20
21class TabBase : public BArchivable {
22private:
23								TabBase();
24								TabBase(BMessage* archive);
25	virtual						~TabBase();
26
27			friend class BALMLayout;
28			friend class XTab;
29			friend class YTab;
30			struct BALMLayoutList;
31
32			bool				IsInLayout(BALMLayout* layout);
33			bool				AddedToLayout(BALMLayout* layout);
34			void				LayoutLeaving(BALMLayout* layout);
35			bool				IsSuitableFor(BALMLayout* layout);
36
37			BALMLayoutList*		fLayouts;
38};
39
40
41/**
42 * Vertical grid line (x-tab).
43 */
44class XTab : public Variable, public TabBase, public BReferenceable {
45public:
46	virtual						~XTab();
47
48	static 	BArchivable*		Instantiate(BMessage* archive);
49protected:
50	friend	class				BALMLayout;
51								XTab(BALMLayout* layout);
52
53private:
54								XTab(BMessage* archive);
55			uint32				_reserved[2];
56};
57
58
59class YTab : public Variable, public TabBase, public BReferenceable {
60public:
61	virtual						~YTab();
62
63	static 	BArchivable*		Instantiate(BMessage* archive);
64protected:
65	friend	class				BALMLayout;
66								YTab(BALMLayout* layout);
67private:
68								YTab(BMessage* archive);
69			uint32				_reserved[2];
70};
71
72
73}	// namespace BALM
74
75
76using BALM::XTab;
77using BALM::YTab;
78
79typedef BObjectList<XTab> XTabList;
80typedef BObjectList<YTab> YTabList;
81
82
83#endif	// X_TAB_H
84