1 /* 2 * Copyright 2006, Haiku, Inc. All rights reserved. 3 * Distributed under the terms of the MIT License. 4 */ 5 #ifndef _CARD_LAYOUT_H 6 #define _CARD_LAYOUT_H 7 8 #include <Layout.h> 9 10 11 class BCardLayout : public BLayout { 12 public: 13 BCardLayout(); 14 virtual ~BCardLayout(); 15 16 BLayoutItem* VisibleItem() const; 17 int32 VisibleIndex() const; 18 void SetVisibleItem(int32 index); 19 void SetVisibleItem(BLayoutItem* item); 20 21 virtual BSize MinSize(); 22 virtual BSize MaxSize(); 23 virtual BSize PreferredSize(); 24 virtual BAlignment Alignment(); 25 26 virtual bool HasHeightForWidth(); 27 virtual void GetHeightForWidth(float width, float* min, 28 float* max, float* preferred); 29 30 virtual void InvalidateLayout(); 31 virtual void LayoutView(); 32 33 protected: 34 virtual void ItemAdded(BLayoutItem* item); 35 virtual void ItemRemoved(BLayoutItem* item); 36 37 private: 38 BSize fMin; 39 BSize fMax; 40 BSize fPreferred; 41 BLayoutItem* fVisibleItem; 42 bool fMinMaxValid; 43 44 void _ValidateMinMax(); 45 }; 46 47 #endif // _CARD_LAYOUT_H 48