1 /* 2 * Copyright 2006, Haiku, Inc. All rights reserved. 3 * Distributed under the terms of the MIT License. 4 */ 5 #ifndef _GRID_LAYOUT_BUILDER_H 6 #define _GRID_LAYOUT_BUILDER_H 7 8 #include <GridView.h> 9 10 class BGridLayoutBuilder { 11 public: 12 BGridLayoutBuilder(float horizontal 13 = B_USE_DEFAULT_SPACING, 14 float vertical = B_USE_DEFAULT_SPACING); 15 BGridLayoutBuilder(BGridLayout* layout); 16 BGridLayoutBuilder(BGridView* view); 17 18 BGridLayout* GridLayout() const; 19 BGridLayoutBuilder& GetGridLayout(BGridLayout** _layout); 20 BView* View() const; 21 BGridLayoutBuilder& GetView(BView** _view); 22 23 BGridLayoutBuilder& Add(BView* view, int32 column, int32 row, 24 int32 columnCount = 1, int32 rowCount = 1); 25 BGridLayoutBuilder& Add(BLayoutItem* item, int32 column, int32 row, 26 int32 columnCount = 1, int32 rowCount = 1); 27 28 BGridLayoutBuilder& SetColumnWeight(int32 column, float weight); 29 BGridLayoutBuilder& SetRowWeight(int32 row, float weight); 30 31 BGridLayoutBuilder& SetInsets(float left, float top, float right, 32 float bottom); 33 34 operator BGridLayout*(); 35 36 private: 37 BGridLayout* fLayout; 38 }; 39 40 #endif // _GRID_LAYOUT_BUILDER_H 41