xref: /haiku/headers/libs/alm/Column.h (revision 9503cf19be94b5a8297ecd73ab50e7acd92a98f6)
103069455SIngo Weinhold /*
28d9b6ef4SClemens Zeidler  * Copyright 2006 - 2010, Haiku, Inc. All rights reserved.
303069455SIngo Weinhold  * Distributed under the terms of the MIT License.
403069455SIngo Weinhold  */
5a101e99aSIngo Weinhold #ifndef	COLUMN_H
6a101e99aSIngo Weinhold #define	COLUMN_H
7a101e99aSIngo Weinhold 
8*9503cf19SClemens Zeidler 
9a101e99aSIngo Weinhold #include <List.h>
10a101e99aSIngo Weinhold 
11b3b7b663SClemens Zeidler #include "Constraint.h"
12b3b7b663SClemens Zeidler #include "LinearSpec.h"
13b3b7b663SClemens Zeidler 
14a101e99aSIngo Weinhold 
15a101e99aSIngo Weinhold namespace BALM {
16a101e99aSIngo Weinhold 
17a101e99aSIngo Weinhold class BALMLayout;
18a101e99aSIngo Weinhold class XTab;
19a101e99aSIngo Weinhold 
20a101e99aSIngo Weinhold /**
21a101e99aSIngo Weinhold  * Represents a column defined by two x-tabs.
22a101e99aSIngo Weinhold  */
23a101e99aSIngo Weinhold class Column {
24a101e99aSIngo Weinhold public:
25a101e99aSIngo Weinhold 			XTab*				Left() const;
26a101e99aSIngo Weinhold 			XTab*				Right() const;
27a101e99aSIngo Weinhold 			Column*				Previous() const;
28a101e99aSIngo Weinhold 			void					SetPrevious(Column* value);
29a101e99aSIngo Weinhold 			Column*				Next() const;
30a101e99aSIngo Weinhold 			void					SetNext(Column* value);
31a101e99aSIngo Weinhold 			//~ string				ToString();
32a101e99aSIngo Weinhold 			void					InsertBefore(Column* column);
33a101e99aSIngo Weinhold 			void					InsertAfter(Column* column);
34a101e99aSIngo Weinhold 			Constraint*			HasSameWidthAs(Column* column);
35a101e99aSIngo Weinhold 			BList*				Constraints() const;
36a101e99aSIngo Weinhold 			void					SetConstraints(BList* constraints);
37a101e99aSIngo Weinhold 								~Column();
38a101e99aSIngo Weinhold 
39a101e99aSIngo Weinhold protected:
40b3b7b663SClemens Zeidler 								Column(LinearSpec* ls);
41a101e99aSIngo Weinhold 
42a101e99aSIngo Weinhold protected:
43b3b7b663SClemens Zeidler 			LinearSpec*			fLS;
44a101e99aSIngo Weinhold 			XTab*				fLeft;
45a101e99aSIngo Weinhold 			XTab*				fRight;
46a101e99aSIngo Weinhold 
47a101e99aSIngo Weinhold private:
48a101e99aSIngo Weinhold 			Column*				fPrevious;
49a101e99aSIngo Weinhold 			Column*				fNext;
50a101e99aSIngo Weinhold 			Constraint*			fPreviousGlue;
51a101e99aSIngo Weinhold 			Constraint*			fNextGlue;
52a101e99aSIngo Weinhold 			BList*				fConstraints;
53a101e99aSIngo Weinhold 
54a101e99aSIngo Weinhold public:
55a101e99aSIngo Weinhold 	friend class			BALMLayout;
56a101e99aSIngo Weinhold 
57a101e99aSIngo Weinhold };
58a101e99aSIngo Weinhold 
59a101e99aSIngo Weinhold }	// namespace BALM
60a101e99aSIngo Weinhold 
61a101e99aSIngo Weinhold using BALM::Column;
62a101e99aSIngo Weinhold 
63a101e99aSIngo Weinhold #endif	// COLUMN_H
64