xref: /haiku/headers/os/interface/SpaceLayoutItem.h (revision 68ea01249e1e2088933cb12f9c28d4e5c5d1c9ef)
1 /*
2  * Copyright 2006, Haiku, Inc. All rights reserved.
3  * Distributed under the terms of the MIT License.
4  */
5 #ifndef	_SPACE_LAYOUT_ITEM_H
6 #define	_SPACE_LAYOUT_ITEM_H
7 
8 #include <LayoutItem.h>
9 
10 
11 class BSpaceLayoutItem : public BLayoutItem {
12 public:
13 								BSpaceLayoutItem(BSize minSize, BSize maxSize,
14 									BSize preferredSize, BAlignment alignment);
15 								BSpaceLayoutItem(BMessage* archive);
16 	virtual						~BSpaceLayoutItem();
17 
18 	static	BSpaceLayoutItem*	CreateGlue();
19 	static	BSpaceLayoutItem*	CreateHorizontalStrut(float width);
20 	static	BSpaceLayoutItem*	CreateVerticalStrut(float height);
21 
22 	virtual	BSize				MinSize();
23 	virtual	BSize				MaxSize();
24 	virtual	BSize				PreferredSize();
25 	virtual	BAlignment			Alignment();
26 
27 	virtual	void				SetExplicitMinSize(BSize size);
28 	virtual	void				SetExplicitMaxSize(BSize size);
29 	virtual	void				SetExplicitPreferredSize(BSize size);
30 	virtual	void				SetExplicitAlignment(BAlignment alignment);
31 
32 	virtual	bool				IsVisible();
33 	virtual	void				SetVisible(bool visible);
34 
35 	virtual	BRect				Frame();
36 	virtual	void				SetFrame(BRect frame);
37 
38 	virtual	status_t			Archive(BMessage* into, bool deep = true) const;
39 	static	BArchivable*		Instantiate(BMessage* from);
40 
41 private:
42 	// FBC padding
43 	virtual	void				_ReservedSpaceLayoutItem1();
44 	virtual	void				_ReservedSpaceLayoutItem2();
45 	virtual	void				_ReservedSpaceLayoutItem3();
46 	virtual	void				_ReservedSpaceLayoutItem4();
47 	virtual	void				_ReservedSpaceLayoutItem5();
48 	virtual	void				_ReservedSpaceLayoutItem6();
49 	virtual	void				_ReservedSpaceLayoutItem7();
50 	virtual	void				_ReservedSpaceLayoutItem8();
51 	virtual	void				_ReservedSpaceLayoutItem9();
52 	virtual	void				_ReservedSpaceLayoutItem10();
53 
54 	// forbidden methods
55 								BSpaceLayoutItem(const BSpaceLayoutItem&);
56 			void				operator =(const BSpaceLayoutItem&);
57 
58 			BRect				fFrame;
59 			BSize				fMinSize;
60 			BSize				fMaxSize;
61 			BSize				fPreferredSize;
62 			BAlignment			fAlignment;
63 			bool				fVisible;
64 
65 			uint32				_reserved[2];
66 };
67 
68 #endif	//	_SPACE_LAYOUT_ITEM_H
69