xref: /haiku/src/kits/interface/layouter/OneElementLayouter.h (revision 1deede7388b04dbeec5af85cae7164735ea9e70d)
1 /*
2  * Copyright 2006, Haiku Inc.
3  * Distributed under the terms of the MIT License.
4  */
5 #ifndef	ONE_ELEMENT_LAYOUTER_H
6 #define	ONE_ELEMENT_LAYOUTER_H
7 
8 #include "Layouter.h"
9 
10 namespace BPrivate {
11 namespace Layout {
12 
13 class OneElementLayouter : public Layouter {
14 public:
15 								OneElementLayouter();
16 	virtual						~OneElementLayouter();
17 
18 	virtual	void				AddConstraints(int32 element, int32 length,
19 									float min, float max, float preferred);
20 	virtual	void				SetWeight(int32 element, float weight);
21 
22 	virtual	float				MinSize();
23 	virtual	float				MaxSize();
24 	virtual	float				PreferredSize();
25 
26 	virtual	LayoutInfo*			CreateLayoutInfo();
27 
28 	virtual	void				Layout(LayoutInfo* layoutInfo, float size);
29 
30 	virtual	Layouter*			CloneLayouter();
31 
32 private:
33 			class MyLayoutInfo;
34 
35 			float				fMin;
36 			float				fMax;
37 			float				fPreferred;
38 };
39 
40 }	// namespace Layout
41 }	// namespace BPrivate
42 
43 using BPrivate::Layout::OneElementLayouter;
44 
45 #endif	// ONE_ELEMENT_LAYOUTER_H
46