xref: /haiku/headers/os/interface/AbstractLayoutItem.h (revision 25a7b01d15612846f332751841da3579db313082)
1 /*
2  * Copyright 2006, Haiku, Inc. All rights reserved.
3  * Distributed under the terms of the MIT License.
4  */
5 #ifndef	_ABSTRACT_LAYOUT_ITEM_H
6 #define	_ABSTRACT_LAYOUT_ITEM_H
7 
8 #include <Alignment.h>
9 #include <LayoutItem.h>
10 #include <Size.h>
11 
12 
13 class BAbstractLayoutItem : public BLayoutItem {
14 public:
15 								BAbstractLayoutItem();
16 								BAbstractLayoutItem(BMessage* from);
17 	virtual						~BAbstractLayoutItem();
18 
19 	virtual	BSize				MinSize();
20 	virtual	BSize				MaxSize();
21 	virtual	BSize				PreferredSize();
22 	virtual	BAlignment			Alignment();
23 
24 	virtual	void				SetExplicitMinSize(BSize size);
25 	virtual	void				SetExplicitMaxSize(BSize size);
26 	virtual	void				SetExplicitPreferredSize(BSize size);
27 	virtual	void				SetExplicitAlignment(BAlignment alignment);
28 
29 	virtual	BSize				BaseMinSize();
30 	virtual	BSize				BaseMaxSize();
31 	virtual	BSize				BasePreferredSize();
32 	virtual	BAlignment			BaseAlignment();
33 
34 	virtual status_t			Archive(BMessage* into, bool deep = true) const;
35 
36 	virtual	status_t			Perform(perform_code d, void* arg);
37 
38 protected:
39 	// various hook methods
40 
41 	virtual	status_t 			AllUnarchived(const BMessage* archive);
42 	virtual	status_t 			AllArchived(BMessage* archive) const;
43 
44 	virtual	void				LayoutInvalidated(bool children);
45 
46 	virtual	void				AttachedToLayout();
47 	virtual	void				DetachedFromLayout(BLayout* layout);
48 
49 	virtual void				AncestorVisibilityChanged(bool shown);
50 
51 private:
52 	virtual	void				_ReservedAbstractLayoutItem1();
53 	virtual	void				_ReservedAbstractLayoutItem2();
54 	virtual	void				_ReservedAbstractLayoutItem3();
55 	virtual	void				_ReservedAbstractLayoutItem4();
56 	virtual	void				_ReservedAbstractLayoutItem5();
57 	virtual	void				_ReservedAbstractLayoutItem6();
58 	virtual	void				_ReservedAbstractLayoutItem7();
59 	virtual	void				_ReservedAbstractLayoutItem8();
60 	virtual	void				_ReservedAbstractLayoutItem9();
61 	virtual	void				_ReservedAbstractLayoutItem10();
62 
63 	// forbidden methods
64 								BAbstractLayoutItem(const BAbstractLayoutItem&);
65 			void				operator =(const BAbstractLayoutItem&);
66 
67 			BSize				fMinSize;
68 			BSize				fMaxSize;
69 			BSize				fPreferredSize;
70 			BAlignment			fAlignment;
71 
72 			uint32				_reserved[5];
73 };
74 
75 #endif	//	_ABSTRACT_LAYOUT_ITEM_H
76