10da6f2e9SAlex Wilson /* 20da6f2e9SAlex Wilson * Copyright 2012, Haiku, Inc. All rights reserved. 3*f0307e76SAlex Wilson * Copyright 2010, Clemens Zeidler <haiku@clemens-zeidler.de> 40da6f2e9SAlex Wilson * Distributed under the terms of the MIT License. 50da6f2e9SAlex Wilson */ 60da6f2e9SAlex Wilson #ifndef ALMGROUP_H 70da6f2e9SAlex Wilson #define ALMGROUP_H 80da6f2e9SAlex Wilson 90da6f2e9SAlex Wilson 100da6f2e9SAlex Wilson #include <vector> 110da6f2e9SAlex Wilson 120da6f2e9SAlex Wilson #include <InterfaceDefs.h> // for enum orientation 130da6f2e9SAlex Wilson #include <Referenceable.h> 140da6f2e9SAlex Wilson 150da6f2e9SAlex Wilson #include "Tab.h" 160da6f2e9SAlex Wilson 170da6f2e9SAlex Wilson 180da6f2e9SAlex Wilson class BLayoutItem; 190da6f2e9SAlex Wilson class BView; 200da6f2e9SAlex Wilson 210da6f2e9SAlex Wilson 220da6f2e9SAlex Wilson namespace BALM { 230da6f2e9SAlex Wilson 240da6f2e9SAlex Wilson class BALMLayout; 250da6f2e9SAlex Wilson 260da6f2e9SAlex Wilson 270da6f2e9SAlex Wilson class ALMGroup { 280da6f2e9SAlex Wilson public: 290da6f2e9SAlex Wilson ALMGroup(BLayoutItem* item); 300da6f2e9SAlex Wilson ALMGroup(BView* view); 310da6f2e9SAlex Wilson 320da6f2e9SAlex Wilson BLayoutItem* LayoutItem() const; 330da6f2e9SAlex Wilson BView* View() const; 340da6f2e9SAlex Wilson 350da6f2e9SAlex Wilson const std::vector<ALMGroup>& Groups() const; 360da6f2e9SAlex Wilson enum orientation Orientation() const; 370da6f2e9SAlex Wilson 380da6f2e9SAlex Wilson ALMGroup& operator|(const ALMGroup& right); 390da6f2e9SAlex Wilson ALMGroup& operator/(const ALMGroup& bottom); 400da6f2e9SAlex Wilson 410da6f2e9SAlex Wilson void BuildLayout(BALMLayout* layout, 420da6f2e9SAlex Wilson XTab* left = NULL, YTab* top = NULL, 430da6f2e9SAlex Wilson XTab* right = NULL, YTab* bottom = NULL); 440da6f2e9SAlex Wilson 450da6f2e9SAlex Wilson private: 460da6f2e9SAlex Wilson ALMGroup(); 470da6f2e9SAlex Wilson 480da6f2e9SAlex Wilson void _Init(BLayoutItem* item, BView* view, 490da6f2e9SAlex Wilson enum orientation orien = B_HORIZONTAL); 500da6f2e9SAlex Wilson ALMGroup& _AddItem(const ALMGroup& item, 510da6f2e9SAlex Wilson enum orientation orien); 520da6f2e9SAlex Wilson 530da6f2e9SAlex Wilson void _Build(BALMLayout* layout, 540da6f2e9SAlex Wilson BReference<XTab> left, BReference<YTab> top, 550da6f2e9SAlex Wilson BReference<XTab> right, 560da6f2e9SAlex Wilson BReference<YTab> bottom) const; 570da6f2e9SAlex Wilson 580da6f2e9SAlex Wilson 590da6f2e9SAlex Wilson BLayoutItem* fLayoutItem; 600da6f2e9SAlex Wilson BView* fView; 610da6f2e9SAlex Wilson 620da6f2e9SAlex Wilson std::vector<ALMGroup> fGroups; 630da6f2e9SAlex Wilson enum orientation fOrientation; 64324ce285SAlex Wilson 65324ce285SAlex Wilson uint32 _reserved[4]; 660da6f2e9SAlex Wilson }; 670da6f2e9SAlex Wilson 680da6f2e9SAlex Wilson 690da6f2e9SAlex Wilson }; 700da6f2e9SAlex Wilson 710da6f2e9SAlex Wilson 720da6f2e9SAlex Wilson using BALM::ALMGroup; 730da6f2e9SAlex Wilson 740da6f2e9SAlex Wilson #endif 75