2 * Copyright 2006-2010, Haiku Inc.
3 * Distributed under the terms of the MIT License.
5 #ifndef _VIEW_LAYOUT_ITEM_H
6 #define _VIEW_LAYOUT_ITEM_H
8 #include <LayoutItem.h>
11 class BViewLayoutItem
: public BLayoutItem
{
13 BViewLayoutItem(BView
* view
);
14 BViewLayoutItem(BMessage
* from
);
15 virtual ~BViewLayoutItem();
17 virtual BSize
MinSize();
18 virtual BSize
MaxSize();
19 virtual BSize
PreferredSize();
20 virtual BAlignment
Alignment();
22 virtual void SetExplicitMinSize(BSize size
);
23 virtual void SetExplicitMaxSize(BSize size
);
24 virtual void SetExplicitPreferredSize(BSize size
);
25 virtual void SetExplicitAlignment(BAlignment alignment
);
27 virtual bool IsVisible();
28 virtual void SetVisible(bool visible
);
30 virtual BRect
Frame();
31 virtual void SetFrame(BRect frame
);
33 virtual bool HasHeightForWidth();
34 virtual void GetHeightForWidth(float width
, float* min
,
35 float* max
, float* preferred
);
37 virtual BView
* View();
39 virtual void Relayout(bool immediate
= false);
41 virtual status_t
Archive(BMessage
* into
, bool deep
= true) const;
42 virtual status_t
AllArchived(BMessage
* into
) const;
43 virtual status_t
AllUnarchived(const BMessage
* from
);
44 static BArchivable
* Instantiate(BMessage
* from
);
47 virtual void LayoutInvalidated(bool children
);
48 virtual void AncestorVisibilityChanged(bool shown
);
52 int32 fAncestorsVisible
;
55 #endif // _VIEW_LAYOUT_ITEM_H