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/LayoutBuilder.h rev 49977 10 */ 11 12 13/*! 14 \class BLayoutBuilder::Split<> 15 \ingroup layout 16 \ingroup libbe 17 \brief BLayoutBuilder::Base subclass for building BSplitViews. 18 19 \since Haiku R1 20 21 A BSplitView consists of elements, for which in between there are dividers 22 that the user can manipulate to alter the division of space between each of 23 the element.s 24 25 For a detailed view on the properties, see the \link BSplitView class 26 description\endlink. 27*/ 28 29 30/*! 31 \typedef BLayoutBuilder::Split<ParentBuilder>::ThisBuilder 32 \copydoc BLayoutBuilder::Group<ParentBuilder>::ThisBuilder 33*/ 34 35 36/*! 37 \typedef BLayoutBuilder::Split<ParentBuilder>::GroupBuilder 38 \copydoc BLayoutBuilder::Group<ParentBuilder>::GroupBuilder 39*/ 40 41 42/*! 43 \typedef BLayoutBuilder::Split<ParentBuilder>::GridBuilder 44 \copydoc BLayoutBuilder::Group<ParentBuilder>::GridBuilder 45*/ 46 47 48/*! 49 \typedef BLayoutBuilder::Split<ParentBuilder>::SplitBuilder 50 \copydoc BLayoutBuilder::Group<ParentBuilder>::SplitBuilder 51*/ 52 53 54/*! 55 \typedef BLayoutBuilder::Split<ThisBuilder>::CardBuilder 56 \copydoc BLayoutBuilder::Group<ThisBuilder>::CardBuilder 57*/ 58 59 60/*! 61 \name Constructors 62*/ 63 64 65//! @{ 66 67 68/*! 69 \fn BLayoutBuilder::Split<ParentBuilder>::Split(orientation orientation, 70 float spacing) 71 \brief Creates a builder for a new BSplitView. 72 73 \param orientation The orientation for the new BSplitView. 74 \param spacing The spacing for the new BSplitView. 75 76 \since Haiku R1 77*/ 78 79 80/*! 81 \fn BLayoutBuilder::Split<ParentBuilder>::Split(BSplitView *view) 82 \brief Creates a builder for an existing BSplitView 83 84 \param view The existing view to operate on. 85 86 \since Haiku R1 87*/ 88 89 90//! @} 91 92 93/*! 94 \name Accessors 95*/ 96 97 98//! @{ 99 100 101/*! 102 \fn BSplitView* BLayoutBuilder::Split<ParentBuilder>::View() const 103 \copydoc BLayoutBuilder::Group<ParentBuilder>::View() 104*/ 105 106 107/*! 108 \fn ThisBuilder& BLayoutBuilder::Split<ParentBuilder>::GetView( 109 BView** _view) 110 \copydoc BLayoutBuilder::Group<ParentBuilder>::GetView() 111*/ 112 113 114/*! 115 \fn ThisBuilder& BLayoutBuilder::Split<ParentBuilder>::GetSplitView( 116 BSplitView** _view) 117 \brief Get a pointer to the SplitBView this builder is attached to. 118 119 \param[out] _view The BSplitView this builder' is attached to. 120*/ 121 122 123/*! 124 \fn BLayoutBuilder::Split<ParentBuilder>::operator BSplitView*() 125 \brief Cast this builder into the layout object it represents. 126 127 \since Haiku R1 128*/ 129 130 131//! @} 132 133 134/*! 135 \name Adding BViews and BLayoutItems 136*/ 137 138 139//! @{ 140 141 142/*! 143 \fn ThisBuilder& BLayoutBuilder::Split<ParentBuilder>::Add(BView* view) 144 \brief Add a \a view to the underlying BSplitView. 145 146 The \a view will be added to the right or the bottom of the existing 147 elements. 148 149 \param view The BView to be added. The underlying BSplitView will take 150 ownership of the object. 151 152 \see BSplitView::Add(BView*) 153 154 \since Haiku R1 155*/ 156 157 158/*! 159 \fn ThisBuilder& BLayoutBuilder::Split<ParentBuilder>::Add(BView* view, 160 float weight) 161 \brief Add a \a view with a \a weight to the underlying BSplitView. 162 163 The \a view will be added to the right or the bottom of the existing 164 elements. 165 166 \param view The BView to be added. The underlying BSplitView will take 167 ownership of the object. 168 \param weight The weight of the view. 169 170 \see BSplitView::Add(BView*, float) 171 172 \since Haiku R1 173*/ 174 175 176/*! 177 \fn ThisBuilder& BLayoutBuilder::Split<ParentBuilder>::Add( 178 BLayoutItem* item) 179 \brief Add a \a item to the underlying BSplitView. 180 181 The layout item will be added to the right or the bottom of the existing 182 elements. 183 184 \param item The BLayoutItem to be added. The underlying BSplitView will 185 take ownership of the object. 186 187 \see BSplitView::Add(BLayoutItem*) 188 189 \since Haiku R1 190*/ 191 192 193/*! 194 \fn ThisBuilder& BLayoutBuilder::Split<ParentBuilder>::Add( 195 BLayoutItem* item, float weight) 196 \brief Add an \a item with a \a weight to the underlying BSplitView. 197 198 The layout item will be added to the right or the bottom of the existing 199 elements. 200 201 \param item The BLayoutItem to be added. The underlying BSplitView will 202 take ownership of the object. 203 \param weight The weight of the item. 204 205 \see BSplitView::Add(BLayoutItem*, float) 206 207 \since Haiku R1 208*/ 209 210 211//! @} 212 213 214/*! 215 \name Adding BLayouts and their BView Pairs 216 217 A set of methods that add a BLayout or BView subclass and return a 218 BLayoutBuilder::Base subclass representing the newly added object. These 219 methods push a new builder on top of the stack, you will not be using 220 \c this builder again until you call End(). 221*/ 222 223 224//! @{ 225 226 227/*! 228 \fn GroupBuilder BLayoutBuilder::Split<ParentBuilder>::AddGroup( 229 orientation orientation, float spacing, float weight) 230 \copybrief GroupBuilder BLayoutBuilder::Group<ParentBuilder>::AddGroup( 231 orientation orientation, float spacing, float weight) 232 233 \param orientation The orientation to use for the new BGroupLayout. 234 \param spacing The spacing to use for the new BGroupLayout. 235 \param weight The weight for the new BGroupLayout in the BGroupLayout this 236 builder represents. 237 238 \returns A GroupBuilder representing the newly created BGroupLayout. 239 240 \since Haiku R1 241*/ 242 243 244/*! 245 \fn GroupBuilder BLayoutBuilder::Split<ParentBuilder>::AddGroup(BGroupView* 246 groupView, float weight) 247 \copybrief GroupBuilder BLayoutBuilder::Group<ParentBuilder>::AddGroup(BGroupView* 248 groupView, float weight) 249 250 \param groupView The BGroupView to be added. 251 \param weight The weight for \a groupView in the BGroupLayout this builder 252 represents. 253 254 \returns A GroupBuilder representing the layout of the \a groupView. 255 256 \since Haiku R1 257*/ 258 259 260/*! 261 \fn GroupBuilder BLayoutBuilder::Split<ParentBuilder>::AddGroup( 262 BGroupLayout* groupLayout, float weight) 263 \copybrief GroupBuilder BLayoutBuilder::Group<ParentBuilder>::AddGroup( 264 BGroupLayout* groupLayout, float weight) 265 266 \param groupLayout The BGroupLayout to be added. 267 \param weight The weight for \a groupLayout in the BGroupLayout this builder 268 represents. 269 270 \returns A GroupBuilder representing the \a groupLayout. 271 272 \since Haiku R1 273*/ 274 275 276/*! 277 \fn GridBuilder BLayoutBuilder::Split<ParentBuilder>::AddGrid( 278 float horizontalSpacing = 0.0f, float verticalSpacing = 0.0f, 279 float weight = 1.0f) 280 \copydoc GridBuilder BLayoutBuilder::Group<ParentBuilder>::AddGrid( 281 float horizontalSpacing, float verticalSpacing, float weight) 282 283 \param horizontalSpacing The horizontal spacing for the new BGridLayout. 284 \param verticalSpacing The vertical spacing for the new BGridLayout. 285 \param weight The weight for the new BGridLayout in the BSplitView this 286 builder represents. 287 288 \returns A GridBuilder representing the newly created BGridLayout. 289 290 \since Haiku R1 291*/ 292 293 294/*! 295 \fn GridBuilder BLayoutBuilder::Split<ParentBuilder>::AddGrid( 296 BGridLayout* gridLayout, float weight = 1.0f) 297 \copybrief GridBuilder BLayoutBuilder::Group<ParentBuilder>::AddGrid( 298 BGridLayout* gridLayout, float weight) 299 300 \param gridLayout The BGridLayout to be added and used to construct the 301 returned GridBuilder. 302 \param weight The weight for \a gridLayout in the BSplitView this builder 303 represents. 304 305 \returns A GridBuilder representing the \a gridLayout. 306 307 \since Haiku R1 308*/ 309 310 311/*! 312 \fn GridBuilder BLayoutBuilder::Split<ParentBuilder>::AddGrid( 313 BGridView* gridView, float weight = 1.0f) 314 \copybrief GridBuilder BLayoutBuilder::Group<ParentBuilder>::AddGrid( 315 BGridView* gridView, float weight) 316 317 \param gridView The BGridView to be added and used to construct the 318 returned GridBuilder. 319 \param weight The weight for \a gridView in the BSplitView this builder 320 represents. 321 322 \returns A GridBuilder representing the layout of the \a gridView. 323 324 \since Haiku R1 325*/ 326 327 328/*! 329 \fn SplitBuilder BLayoutBuilder::Split<ParentBuilder>::AddSplit( 330 orientation orientation, float spacing, float weight) 331 \copybrief SplitBuilder BLayoutBuilder::Group<ParentBuilder>::AddSplit( 332 orientation orientation, float spacing, float weight) 333 334 \param orientation The orientation of the new BSplitView. 335 \param spacing The spacing of the new BSplitView. 336 \param weight The weight, in this BSplitView for the new BSplitView. 337 338 \returns A SplitBuilder representing the new BSplitView. 339 340 \since Haiku R1 341*/ 342 343 344/*! 345 \fn SplitBuilder BLayoutBuilder::Split<ParentBuilder>::AddSplit( 346 BSplitView* splitView, float weight = 1.0f) 347 \copybrief SplitBuilder BLayoutBuilder::Group<ParentBuilder>::AddSplit( 348 BSplitView* splitView, float weight) 349 350 \param splitView The BSplitView to be added. 351 \param weight The weight of the BSplitView in the BSplitView this builder 352 represents. 353 354 \returns A SplitBuilder representing the \a splitView. 355 356 \since Haiku R1 357*/ 358 359 360/*! 361 \fn CardBuilder BLayoutBuilder::Split<ParentBuilder>::AddCards( 362 float weight) 363 \copybrief CardBuilder BLayoutBuilder::Group<ParentBuilder>::AddCards( 364 float weight) 365 366 \param weight The weight of the BCardLayout in the BSplitView this builder 367 represents. 368 369 \returns A CardBuilder representing the new BCardLayout. 370 371 \since Haiku R1 372*/ 373 374 375/*! 376 \fn CardBuilder BLayoutBuilder::Split<ParentBuilder>::AddCards( 377 BCardLayout* cardLayout, float weight) 378 \copybrief CardBuilder BLayoutBuilder::Group<ParentBuilder>::AddCards( 379 BCardLayout* cardLayout, float weight) 380 381 \param cardLayout The existing layout that will be added to the underlying 382 BSplitView. 383 \param weight The weight of the BCardLayout in the BSplitView this builder 384 represents. 385 386 \returns A CardBuilder representing the \a cardLayout. 387 388 \since Haiku R1 389*/ 390 391 392/*! 393 \fn CardBuilder BLayoutBuilder::Split<ParentBuilder>::AddCards( 394 BCardView* cardView, float weight) 395 \copybrief CardBuilder BLayoutBuilder::Group<ParentBuilder>::AddCards( 396 BCardView* cardView, float weight) 397 398 \param cardView The existing view that will be added to the underlying 399 BSplitView. 400 \param weight The weight of the BCardLayout in the BSplitView this builder 401 represents. 402 403 \returns A CardBuilder representing the layout of t he \a cardView. 404 405 \since Haiku R1 406*/ 407 408 409//! @} 410 411 412/*! 413 \name Collapsability of elements 414*/ 415 416 417//! @{ 418 419 420/*! 421 \fn ThisBuilder& BLayoutBuilder::Split<ParentBuilder>::SetCollapsible( 422 bool collapsible) 423 \copydoc BSplitView::SetCollapsible(bool) 424 425 \see BSplitView::SetCollapsible(bool) 426*/ 427 428 429/*! 430 \fn ThisBuilder& BLayoutBuilder::Split<ParentBuilder>::SetCollapsible( 431 int32 index, bool collapsible) 432 \copydoc BSplitView::SetCollapsible(int32, bool) 433 434 \see BSplitView::SetCollapsible(int32, bool) 435*/ 436 437 438/*! 439 \fn ThisBuilder& BLayoutBuilder::Split<ParentBuilder>::SetCollapsible( 440 int32 first, int32 last, bool collapsible) 441 \copydoc BSplitView::SetCollapsible(int32, int32, bool) 442 443 \see BSplitView::SetCollapsible(int32, int32, bool) 444*/ 445 446 447//! @} 448 449 450/*! 451 \name Insets 452*/ 453 454 455//! @{ 456 457 458/*! 459 \fn ThisBuilder& BLayoutBuilder::Split<ParentBuilder>::SetInsets( 460 float left, float top, float right, float bottom) 461 \copydoc BSplitView::SetInsets(float, float, float, float) 462 463 \see BSplitView::SetInsets(float, float, float, float) 464*/ 465 466 467/*! 468 \fn ThisBuilder& BLayoutBuilder::Split<ParentBuilder>::SetInsets( 469 float horizontal, float vertical) 470 \copydoc BSplitView::SetInsets(float, float) 471 472 \see BSplitView::SetInsets(float, float) 473*/ 474 475 476/*! 477 \fn ThisBuilder& BLayoutBuilder::Split<ParentBuilder>::SetInsets( 478 float insets) 479 \copydoc BSplitView::SetInsets(float) 480 481 \see BSplitView::SetInsets(float) 482*/ 483 484 485//! @} 486