xref: /haiku/headers/libs/alm/Column.h (revision 893988af824e65e49e55f517b157db8386e8002b)
1 /*
2  * Copyright 2007-2008, Christof Lutteroth, lutteroth@cs.auckland.ac.nz
3  * Copyright 2007-2008, James Kim, jkim202@ec.auckland.ac.nz
4  * Distributed under the terms of the MIT License.
5  */
6 
7 #ifndef	COLUMN_H
8 #define	COLUMN_H
9 
10 #include "Constraint.h"
11 
12 #include <List.h>
13 
14 
15 namespace BALM {
16 
17 class BALMLayout;
18 class XTab;
19 
20 /**
21  * Represents a column defined by two x-tabs.
22  */
23 class Column {
24 
25 public:
26 	XTab*				Left() const;
27 	XTab*				Right() const;
28 	Column*				Previous() const;
29 	void					SetPrevious(Column* value);
30 	Column*				Next() const;
31 	void					SetNext(Column* value);
32 	//~ string				ToString();
33 	void					InsertBefore(Column* column);
34 	void					InsertAfter(Column* column);
35 	Constraint*			HasSameWidthAs(Column* column);
36 	BList*				Constraints() const;
37 	void					SetConstraints(BList* constraints);
38 						~Column();
39 
40 protected:
41 						Column(BALMLayout* ls);
42 
43 protected:
44 	BALMLayout*			fLS;
45 	XTab*				fLeft;
46 	XTab*				fRight;
47 
48 private:
49 	Column*				fPrevious;
50 	Column*				fNext;
51 	Constraint*			fPreviousGlue;
52 	Constraint*			fNextGlue;
53 	BList*				fConstraints;
54 
55 public:
56 	friend class			BALMLayout;
57 
58 };
59 
60 }	// namespace BALM
61 
62 using BALM::Column;
63 
64 #endif	// COLUMN_H
65