xref: /haiku/headers/libs/alm/Row.h (revision b3b7b663e029d636b6d54977e3459f2315a79329)
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	ROW_H
8 #define	ROW_H
9 
10 #include <List.h>
11 
12 #include "Constraint.h"
13 #include "LinearSpec.h"
14 
15 
16 namespace BALM {
17 
18 class BALMLayout;
19 class YTab;
20 
21 /**
22  * Represents a row defined by two y-tabs.
23  */
24 class Row {
25 public:
26 			YTab*				Top() const;
27 			YTab*				Bottom() const;
28 			Row*				Previous() const;
29 			void					SetPrevious(Row* value);
30 			Row*				Next() const;
31 			void					SetNext(Row* value);
32 			//~ string				ToString();
33 			void					InsertBefore(Row* row);
34 			void					InsertAfter(Row* row);
35 			Constraint*			HasSameHeightAs(Row* row);
36 			BList*				Constraints() const;
37 			void					SetConstraints(BList* constraints);
38 								~Row();
39 
40 protected:
41 								Row(LinearSpec* ls);
42 
43 protected:
44 			LinearSpec*			fLS;
45 			YTab*				fTop;
46 			YTab*				fBottom;
47 
48 private:
49 			Row*				fPrevious;
50 			Row*				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::Row;
63 
64 #endif	// ROW_H
65