1/* 2 * Copyright 2020 Haiku, Inc. All rights reserved. 3 * Distributed under the terms of the MIT License. 4 * 5 * Authors: 6 * Niels Sascha Reedijk, niels.reedijk@gmail.com 7 * 8 * Corresponds to: 9 * headers/os/interface/GridLayoutBuilder.h hrev38512 10 * src/kits/interface/GridLayoutBuilder.cpp hrev45833 11 */ 12 13 14/*! 15 \file GridLayoutBuilder.h 16 \ingroup libbe 17 \brief Provides \b deprecated GridLayoutBuilder class. 18 19 \since Haiku R1 20*/ 21 22 23/*! 24 \class BGridLayoutBuilder 25 \ingroup layout 26 \ingroup libbe 27 \brief \b Deprecated helper class that helps building a \ref BGridLayout. 28 29 The modern builder can be found in \ref BLayoutBuilder::Grid<>. 30 31 \warning This class is deprecated and should not be used in new projects. 32 It may be removed in newer releases. 33 34 \since Haiku R1 35*/ 36 37 38/*! 39 \fn BGridLayoutBuilder::BGridLayoutBuilder(float horizontal=B_USE_DEFAULT_SPACING, float vertical=B_USE_DEFAULT_SPACING) 40 \brief Create a new layout builder with a new underlying \ref BGridLayout. 41 42 \param horizontal Horizontal spacing. 43 \param vertical Vertical Spacing 44 45 \since Haiku R1 46*/ 47 48 49/*! 50 \fn BGridLayoutBuilder::BGridLayoutBuilder(BGridLayout *layout) 51 \brief Create a new layout builder that operates on a \a layout. 52 53 \param layout The existing layout you want the builder to alter. 54 55 \since Haiku R1 56*/ 57 58 59/*! 60 \fn BGridLayoutBuilder::BGridLayoutBuilder(BGridView *view) 61 \brief Create a new layout builder that operates on a \a view. 62 63 \param view The existing grid view you want the builder to alter. 64 65 \since Haiku R1 66*/ 67 68 69/*! 70 \fn BGridLayout* BGridLayoutBuilder::GridLayout() const 71 \brief Get a reference to the underlying \ref BGridLayout. 72 73 \return A borrowed pointer to the current underlaying layout. 74 75 \since Haiku R1 76*/ 77 78 79/*! 80 \fn BGridLayoutBuilder& BGridLayoutBuilder::GetGridLayout(BGridLayout **_layout) 81 \brief Get a reference to the underlying \ref BGridLayout. 82 83 \param[out] _layout The variable to store a borrowed pointer to the 84 underlying layout. 85 86 \return The method returns a self reference, so that calls to the builder 87 may be chained. 88 89 \since Haiku R1 90*/ 91 92 93/*! 94 \fn BView* BGridLayoutBuilder::View() const 95 \brief Get a reference to the owning \ref BView. 96 97 Returns the same BView* as BLayout::Owner(), this method is inherited from 98 BLayoutItem. 99 100 \return A borrowed pointer to the owning \ref BView. 101 102 \since Haiku R1 103*/ 104 105 106/*! 107 \fn BGridLayoutBuilder& BGridLayoutBuilder::GetView(BView **_view) 108 \brief Get a reference to the owning \ref BView. 109 110 \param[out] _view The variable to store the borrowed pointer to the owning 111 \ref BView. 112 113 \return The method returns a self reference, so that calls to the builder 114 may be chained. 115 116 \since Haiku R1 117*/ 118 119 120/*! 121 \fn BGridLayoutBuilder& BGridLayoutBuilder::Add(BView *view, int32 column, int32 row, int32 columnCount=1, int32 rowCount=1) 122 \brief Add a \a view to the underlying \ref BGridLayout. 123 124 \param view The BView to add. 125 \param column The column number (zero-based) to use. 126 \param row The row number (zero-based) to use. 127 \param columnCount The number of columns to span over. 128 \param rowCount The number of rows to span over. 129 130 \return The method returns a self reference, so that calls to the builder 131 may be chained. 132 133 \since Haiku R1 134*/ 135 136 137/*! 138 \fn BGridLayoutBuilder& BGridLayoutBuilder::Add(BLayoutItem *item, int32 column, int32 row, int32 columnCount=1, int32 rowCount=1) 139 \brief Add a \ref BLayoutItem to the underlying \ref BGridLayout. 140 141 \param item The \ref BLayoutItem to add. 142 \param column The column number (zero-index) to use. 143 \param row The row number (zero-index) to use. 144 \param columnCount The number of columns to span over. 145 \param rowCount The number of rows to span over. 146 147 \return The method returns a self reference, so that calls to the builder 148 may be chained. 149 150 \since Haiku R1 151*/ 152 153 154/*! 155 \fn BGridLayoutBuilder& BGridLayoutBuilder::SetColumnWeight(int32 column, float weight) 156 \brief Set the weight for \a column to \a weight. 157 158 \param column The column to set. 159 \param weight The weight to set. 160 161 \return The method returns a self reference, so that calls to the builder 162 may be chained. 163 164 \since Haiku R1 165*/ 166 167 168/*! 169 \fn BGridLayoutBuilder& BGridLayoutBuilder::SetRowWeight(int32 row, float weight) 170 \brief Set the weight of \a row to \a weight. 171 172 \param row The \a row number. 173 \param weight The \a weight to set. 174 175 \return The method returns a self reference, so that calls to the builder 176 may be chained. 177 178 \since Haiku R1 179*/ 180 181 182/*! 183 \fn BGridLayoutBuilder& BGridLayoutBuilder::SetInsets(float left, float top, float right, float bottom) 184 \brief Set the insets for the layout. 185 186 \param left The left inset as a \c float. 187 \param top The top inset as a \c float. 188 \param right The right inset as a \c float. 189 \param bottom The bottom inset as a \c float. 190 191 \return The method returns a self reference, so that calls to the builder 192 may be chained. 193 194 \since Haiku R1 195*/ 196 197 198/*! 199 \fn BGridLayoutBuilder::operator BGridLayout *() 200 \brief Casts the builder to the underlying \ref BGridLayout. 201 202 Convenience method for the \ref GridLayout() method. 203 204 \since Haiku R1 205*/ 206