xref: /haiku/headers/os/interface/AbstractLayout.h (revision e01de52283efe0bd8fa107bd493df302c070204e)
1 /*
2  * Copyright 2010, Haiku, Inc. All rights reserved.
3  * Distributed under the terms of the MIT License.
4  */
5 #ifndef	_ABSTRACT_LAYOUT_H
6 #define	_ABSTRACT_LAYOUT_H
7 
8 #include <Alignment.h>
9 #include <Layout.h>
10 #include <Size.h>
11 
12 class BAbstractLayout : public BLayout {
13 public:
14 								BAbstractLayout();
15 								BAbstractLayout(BMessage* from);
16 	virtual						~BAbstractLayout();
17 
18 	virtual	BSize				MinSize();
19 	virtual	BSize				MaxSize();
20 	virtual	BSize				PreferredSize();
21 	virtual	BAlignment			Alignment();
22 
23 	virtual	void				SetExplicitMinSize(BSize size);
24 	virtual	void				SetExplicitMaxSize(BSize size);
25 	virtual	void				SetExplicitPreferredSize(BSize size);
26 	virtual	void				SetExplicitAlignment(BAlignment alignment);
27 
28 	virtual	BSize				BaseMinSize();
29 	virtual	BSize				BaseMaxSize();
30 	virtual	BSize				BasePreferredSize();
31 	virtual	BAlignment			BaseAlignment();
32 
33 	virtual BRect				Frame();
34 	virtual	void				SetFrame(BRect frame);
35 
36 	virtual	bool				IsVisible();
37 	virtual	void				SetVisible(bool visible);
38 
39 	virtual status_t			Archive(BMessage* into, bool deep = true) const;
40 
41 	virtual	status_t			Perform(perform_code d, void* arg);
42 
43 protected:
44 	// Archiving hook methods
45 	virtual	status_t			AllArchived(BMessage* archive) const;
46 	virtual	status_t			AllUnarchived(const BMessage* from);
47 
48 	virtual status_t			ItemArchived(BMessage* into, BLayoutItem* item,
49 									int32 index) const;
50 	virtual	status_t			ItemUnarchived(const BMessage* from,
51 									BLayoutItem* item, int32 index);
52 
53 	virtual	bool				ItemAdded(BLayoutItem* item, int32 atIndex);
54 	virtual	void				ItemRemoved(BLayoutItem* item, int32 fromIndex);
55 	virtual	void				LayoutInvalidated(bool children);
56 	virtual	void				OwnerChanged(BView* was);
57 
58 	// BLayoutItem hook methods
59 	virtual	void				AttachedToLayout();
60 	virtual void				DetachedFromLayout(BLayout* layout);
61 	virtual	void				AncestorVisibilityChanged(bool shown);
62 
63 private:
64 	virtual	void				_ReservedAbstractLayout1();
65 	virtual	void				_ReservedAbstractLayout2();
66 	virtual	void				_ReservedAbstractLayout3();
67 	virtual	void				_ReservedAbstractLayout4();
68 	virtual	void				_ReservedAbstractLayout5();
69 	virtual	void				_ReservedAbstractLayout6();
70 	virtual	void				_ReservedAbstractLayout7();
71 	virtual	void				_ReservedAbstractLayout8();
72 	virtual	void				_ReservedAbstractLayout9();
73 	virtual	void				_ReservedAbstractLayout10();
74 
75 	// forbidden methods
76 								BAbstractLayout(const BAbstractLayout&);
77 			void				operator =(const BAbstractLayout&);
78 
79 			struct	Proxy;
80 			struct	ViewProxy;
81 			struct	DataProxy;
82 
83 			Proxy*				fExplicitData;
84 			uint32				_reserved[4];
85 };
86 
87 #endif	//	_ABSTRACT_LAYOUT_ITEM_H
88