2008-09-02 00:12:13 +04:00
|
|
|
/*
|
2010-07-20 12:28:55 +04:00
|
|
|
* Copyright 2006-2010, Haiku, Inc. All rights reserved.
|
2008-09-02 00:12:13 +04:00
|
|
|
* Distributed under the terms of the MIT License.
|
|
|
|
*/
|
|
|
|
#ifndef _CARD_LAYOUT_H
|
|
|
|
#define _CARD_LAYOUT_H
|
|
|
|
|
2010-08-17 22:43:41 +04:00
|
|
|
#include <AbstractLayout.h>
|
2008-09-02 00:12:13 +04:00
|
|
|
|
|
|
|
|
2010-08-17 22:43:41 +04:00
|
|
|
class BCardLayout : public BAbstractLayout {
|
2008-09-02 00:12:13 +04:00
|
|
|
public:
|
|
|
|
BCardLayout();
|
2010-07-20 12:28:55 +04:00
|
|
|
BCardLayout(BMessage* from);
|
2008-09-02 00:12:13 +04:00
|
|
|
virtual ~BCardLayout();
|
|
|
|
|
|
|
|
BLayoutItem* VisibleItem() const;
|
|
|
|
int32 VisibleIndex() const;
|
|
|
|
void SetVisibleItem(int32 index);
|
|
|
|
void SetVisibleItem(BLayoutItem* item);
|
|
|
|
|
2010-08-17 22:43:41 +04:00
|
|
|
virtual BSize BaseMinSize();
|
|
|
|
virtual BSize BaseMaxSize();
|
|
|
|
virtual BSize BasePreferredSize();
|
|
|
|
virtual BAlignment BaseAlignment();
|
2008-09-02 00:12:13 +04:00
|
|
|
|
|
|
|
virtual bool HasHeightForWidth();
|
|
|
|
virtual void GetHeightForWidth(float width, float* min,
|
|
|
|
float* max, float* preferred);
|
|
|
|
|
2010-07-20 12:28:55 +04:00
|
|
|
virtual status_t Archive(BMessage* into, bool deep = true) const;
|
|
|
|
static BArchivable* Instantiate(BMessage* from);
|
|
|
|
|
2011-11-01 00:57:30 +04:00
|
|
|
virtual status_t Perform(perform_code d, void* arg);
|
|
|
|
|
2008-09-02 00:12:13 +04:00
|
|
|
protected:
|
2011-12-02 07:45:50 +04:00
|
|
|
virtual status_t AllArchived(BMessage* archive) const;
|
|
|
|
virtual status_t AllUnarchived(const BMessage* from);
|
|
|
|
|
2011-12-02 09:47:46 +04:00
|
|
|
virtual status_t ItemArchived(BMessage* into, BLayoutItem* item,
|
|
|
|
int32 index) const;
|
|
|
|
virtual status_t ItemUnarchived(const BMessage* from,
|
|
|
|
BLayoutItem* item, int32 index);
|
|
|
|
|
2011-10-17 08:48:47 +04:00
|
|
|
virtual void LayoutInvalidated(bool children = false);
|
2011-09-10 01:20:01 +04:00
|
|
|
virtual void DoLayout();
|
2010-07-30 06:28:17 +04:00
|
|
|
virtual bool ItemAdded(BLayoutItem* item, int32 atIndex);
|
|
|
|
virtual void ItemRemoved(BLayoutItem* item, int32 fromIndex);
|
2008-09-02 00:12:13 +04:00
|
|
|
|
|
|
|
private:
|
2011-11-02 10:29:33 +04:00
|
|
|
|
|
|
|
void _ValidateMinMax();
|
|
|
|
|
|
|
|
// FBC padding
|
|
|
|
virtual void _ReservedCardLayout1();
|
|
|
|
virtual void _ReservedCardLayout2();
|
|
|
|
virtual void _ReservedCardLayout3();
|
|
|
|
virtual void _ReservedCardLayout4();
|
|
|
|
virtual void _ReservedCardLayout5();
|
|
|
|
virtual void _ReservedCardLayout6();
|
|
|
|
virtual void _ReservedCardLayout7();
|
|
|
|
virtual void _ReservedCardLayout8();
|
|
|
|
virtual void _ReservedCardLayout9();
|
|
|
|
virtual void _ReservedCardLayout10();
|
|
|
|
|
2011-12-02 09:47:46 +04:00
|
|
|
// forbidden methods
|
|
|
|
BCardLayout(const BCardLayout&);
|
|
|
|
void operator =(const BCardLayout&);
|
|
|
|
|
2008-09-02 00:12:13 +04:00
|
|
|
BSize fMin;
|
|
|
|
BSize fMax;
|
|
|
|
BSize fPreferred;
|
|
|
|
BLayoutItem* fVisibleItem;
|
|
|
|
bool fMinMaxValid;
|
|
|
|
|
2011-11-02 10:29:33 +04:00
|
|
|
uint32 _reserved[5];
|
2008-09-02 00:12:13 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // _CARD_LAYOUT_H
|