11d6c7b6cSAlex Wilson /* 21d6c7b6cSAlex Wilson * Copyright 2010, Haiku, Inc. All rights reserved. 31d6c7b6cSAlex Wilson * Distributed under the terms of the MIT License. 41d6c7b6cSAlex Wilson */ 51d6c7b6cSAlex Wilson #ifndef _ABSTRACT_LAYOUT_H 61d6c7b6cSAlex Wilson #define _ABSTRACT_LAYOUT_H 71d6c7b6cSAlex Wilson 81d6c7b6cSAlex Wilson #include <Alignment.h> 91d6c7b6cSAlex Wilson #include <Layout.h> 101d6c7b6cSAlex Wilson #include <Size.h> 111d6c7b6cSAlex Wilson 121d6c7b6cSAlex Wilson class BAbstractLayout : public BLayout { 131d6c7b6cSAlex Wilson public: 141d6c7b6cSAlex Wilson BAbstractLayout(); 151d6c7b6cSAlex Wilson BAbstractLayout(BMessage* from); 161d6c7b6cSAlex Wilson virtual ~BAbstractLayout(); 171d6c7b6cSAlex Wilson 181d6c7b6cSAlex Wilson virtual BSize MinSize(); 191d6c7b6cSAlex Wilson virtual BSize MaxSize(); 201d6c7b6cSAlex Wilson virtual BSize PreferredSize(); 211d6c7b6cSAlex Wilson virtual BAlignment Alignment(); 221d6c7b6cSAlex Wilson 231d6c7b6cSAlex Wilson virtual void SetExplicitMinSize(BSize size); 241d6c7b6cSAlex Wilson virtual void SetExplicitMaxSize(BSize size); 251d6c7b6cSAlex Wilson virtual void SetExplicitPreferredSize(BSize size); 261d6c7b6cSAlex Wilson virtual void SetExplicitAlignment(BAlignment alignment); 271d6c7b6cSAlex Wilson 281d6c7b6cSAlex Wilson virtual BSize BaseMinSize(); 291d6c7b6cSAlex Wilson virtual BSize BaseMaxSize(); 301d6c7b6cSAlex Wilson virtual BSize BasePreferredSize(); 311d6c7b6cSAlex Wilson virtual BAlignment BaseAlignment(); 321d6c7b6cSAlex Wilson 331d6c7b6cSAlex Wilson virtual BRect Frame(); 341d6c7b6cSAlex Wilson virtual void SetFrame(BRect frame); 351d6c7b6cSAlex Wilson 361d6c7b6cSAlex Wilson virtual bool IsVisible(); 371d6c7b6cSAlex Wilson virtual void SetVisible(bool visible); 381d6c7b6cSAlex Wilson 391d6c7b6cSAlex Wilson virtual status_t Archive(BMessage* into, bool deep = true) const; 40*d56e7bd6SAlex Wilson 41*d56e7bd6SAlex Wilson virtual status_t Perform(perform_code d, void* arg); 42*d56e7bd6SAlex Wilson 43*d56e7bd6SAlex Wilson protected: 44*d56e7bd6SAlex Wilson // Archiving hook methods 4553617d36SAlex Wilson virtual status_t AllArchived(BMessage* archive) const; 461d6c7b6cSAlex Wilson virtual status_t AllUnarchived(const BMessage* from); 471d6c7b6cSAlex Wilson 4853617d36SAlex Wilson virtual status_t ItemArchived(BMessage* into, BLayoutItem* item, 4953617d36SAlex Wilson int32 index) const; 5053617d36SAlex Wilson virtual status_t ItemUnarchived(const BMessage* from, 5153617d36SAlex Wilson BLayoutItem* item, int32 index); 5253617d36SAlex Wilson 5353617d36SAlex Wilson virtual bool ItemAdded(BLayoutItem* item, int32 atIndex); 5453617d36SAlex Wilson virtual void ItemRemoved(BLayoutItem* item, int32 fromIndex); 5553617d36SAlex Wilson virtual void LayoutInvalidated(bool children); 561d6c7b6cSAlex Wilson virtual void OwnerChanged(BView* was); 5753617d36SAlex Wilson 5853617d36SAlex Wilson // BLayoutItem hook methods 5953617d36SAlex Wilson virtual void AttachedToLayout(); 6053617d36SAlex Wilson virtual void DetachedFromLayout(BLayout* layout); 611d6c7b6cSAlex Wilson virtual void AncestorVisibilityChanged(bool shown); 621d6c7b6cSAlex Wilson 631d6c7b6cSAlex Wilson private: 648151838eSAlex Wilson virtual void _ReservedAbstractLayout1(); 658151838eSAlex Wilson virtual void _ReservedAbstractLayout2(); 668151838eSAlex Wilson virtual void _ReservedAbstractLayout3(); 678151838eSAlex Wilson virtual void _ReservedAbstractLayout4(); 688151838eSAlex Wilson virtual void _ReservedAbstractLayout5(); 698151838eSAlex Wilson virtual void _ReservedAbstractLayout6(); 708151838eSAlex Wilson virtual void _ReservedAbstractLayout7(); 718151838eSAlex Wilson virtual void _ReservedAbstractLayout8(); 728151838eSAlex Wilson virtual void _ReservedAbstractLayout9(); 738151838eSAlex Wilson virtual void _ReservedAbstractLayout10(); 748151838eSAlex Wilson 75e044d51aSAlex Wilson // forbidden methods 76e044d51aSAlex Wilson BAbstractLayout(const BAbstractLayout&); 77e044d51aSAlex Wilson void operator =(const BAbstractLayout&); 78e044d51aSAlex Wilson 791d6c7b6cSAlex Wilson struct Proxy; 801d6c7b6cSAlex Wilson struct ViewProxy; 811d6c7b6cSAlex Wilson struct DataProxy; 821d6c7b6cSAlex Wilson 831d6c7b6cSAlex Wilson Proxy* fExplicitData; 848151838eSAlex Wilson uint32 _reserved[4]; 851d6c7b6cSAlex Wilson }; 861d6c7b6cSAlex Wilson 871d6c7b6cSAlex Wilson #endif // _ABSTRACT_LAYOUT_ITEM_H 88