1 /* 2 * Copyright 2006 - 2010, Haiku, Inc. All rights reserved. 3 * Distributed under the terms of the MIT License. 4 */ 5 #ifndef X_TAB_H 6 #define X_TAB_H 7 8 9 #include <Archivable.h> 10 #include <Referenceable.h> 11 12 #include "Variable.h" 13 14 15 namespace BALM { 16 17 18 class BALMLayout; 19 20 21 class TabBase : public BArchivable { 22 private: 23 TabBase(); 24 TabBase(BMessage* archive); 25 virtual ~TabBase(); 26 27 friend class BALMLayout; 28 friend class XTab; 29 friend class YTab; 30 struct BALMLayoutList; 31 32 bool IsInLayout(BALMLayout* layout); 33 bool AddedToLayout(BALMLayout* layout); 34 void LayoutLeaving(BALMLayout* layout); 35 bool IsSuitableFor(BALMLayout* layout); 36 37 BALMLayoutList* fLayouts; 38 }; 39 40 41 /** 42 * Vertical grid line (x-tab). 43 */ 44 class XTab : public Variable, public TabBase, public BReferenceable { 45 public: 46 virtual ~XTab(); 47 48 static BArchivable* Instantiate(BMessage* archive); 49 protected: 50 friend class BALMLayout; 51 XTab(BALMLayout* layout); 52 53 private: 54 XTab(BMessage* archive); 55 uint32 _reserved[2]; 56 }; 57 58 59 class YTab : public Variable, public TabBase, public BReferenceable { 60 public: 61 virtual ~YTab(); 62 63 static BArchivable* Instantiate(BMessage* archive); 64 protected: 65 friend class BALMLayout; 66 YTab(BALMLayout* layout); 67 private: 68 YTab(BMessage* archive); 69 uint32 _reserved[2]; 70 }; 71 72 73 } // namespace BALM 74 75 76 using BALM::XTab; 77 using BALM::YTab; 78 79 typedef BObjectList<XTab> XTabList; 80 typedef BObjectList<YTab> YTabList; 81 82 83 #endif // X_TAB_H 84