Public Types | Public Member Functions
BLayoutBuilder::Group< ParentBuilder > Class Template Reference

BLayoutBuilder::Base subclass for building BGroupLayouts. More...

Inheritance diagram for BLayoutBuilder::Group< ParentBuilder >:
BLayoutBuilder::Base< ParentBuilder >

List of all members.

Public Types

typedef Grid< ThisBuilderGridBuilder
 Shorthand for builders returned by this builder's AddGrid() methods.
typedef Group< ThisBuilderGroupBuilder
 Shorthand for builders returned by this builder's AddGroup() methods.
typedef Split< ThisBuilderSplitBuilder
 Shorthand for builders returned by this builder's AddSplit() methods.
typedef Group< ParentBuilder > ThisBuilder
 Shorthand representing the type of this.

Public Member Functions

ParentBuilder & End ()
 Returns this builder's parent.
ThisBuilderSetInsets (float left, float top, float right, float bottom)
 Call the BTwoDimensionalLayout::SetInsets() method on the BGroupLayout this builder represents.
void SetParent (ParentBuilder *parent)
Constructors
 Group (BGroupLayout *layout)
 Creates a builder targeting a BGroupLayout.
 Group (BGroupView *view)
 Creates a builder targeting a BGroupView.
Accessors
BGroupLayoutLayout () const
 Get the BGroupLayout this builder represents.
BViewView () const
 Get the BView this builder's BGroupLayout is attached to.
ThisBuilderGetLayout (BGroupLayout **_layout)
 Get the BGroupLayout this builder represents.
ThisBuilderGetView (BView **_view)
 Get the BView this builder's BGroupLayout is attached to.
 operator BGroupLayout * ()
 Cast this builder into the BGroupLayout it represents.
Adding BViews and BLayoutItems
ThisBuilderAdd (BView *view)
 Add a BView to the BGroupLayout this builder represents.
ThisBuilderAdd (BView *view, float weight)
 Add BView to the BGroupLayout this builder represents.
ThisBuilderAdd (BLayoutItem *item)
 Add a BLayoutItem to the BGroupLayout this builder represents.
ThisBuilderAdd (BLayoutItem *item, float weight)
 Add a BLayoutItem the BGroupLayout this builder represents.
Adding BLayouts and their BView pairs

A set of methods that add a BLayout or BView subclass and return a BLayoutBuilder::Base subclass representing the newly added object. These methods push a new builder on top of the stack, you will not be using this builder again until you call End().

GroupBuilder AddGroup (BGroupView *groupView, float weight=1.0f)
 Add BGroupView and return a builder representing the newly added BGroupView.
GroupBuilder AddGroup (BGroupLayout *groupLayout, float weight=1.0f)
 Add a BGroupLayout and return a builder representing the newly added BGroupLayout.
GridBuilder AddGrid (float horizontal=B_USE_DEFAULT_SPACING, float vertical=B_USE_DEFAULT_SPACING, float weight=1.0f)
 Create and add a viewless BGridLayout, then return a builder representing the newly created BGridLayout.
GridBuilder AddGrid (BGridLayout *gridLayout, float weight=1.0f)
 Add a BGridLayout, then return a builder the newly added BGridLayout.
GridBuilder AddGrid (BGridView *gridView, float weight=1.0f)
 Add a BGridView, then return a builder the newly added BGridView.
SplitBuilder AddSplit (BSplitView *splitView, float weight=1.0f)
 Add a BSplitView to the BGroupLayout this builder represents and return a SplitBuilder representing the BSplitView.
Adding BSpaceLayoutItems

Some convenience methods for adding special BSpaceLayoutItems.

ThisBuilderAddGlue (float weight=1.0f)
 Add a BSpaceLayoutItem created by BSpaceLayoutItem::CreateGlue() to the BGroupLayout this builder represents.
ThisBuilderAddStrut (float size)
 Add a BSpaceLayoutItem created by BSpaceLayoutItem::CreateHorizontalStrut() or BSpaceLayoutItem::CreateVerticalStrut() to the BGroupLayout this builder represents.

Detailed Description

template<typename ParentBuilder>
class BLayoutBuilder::Group< ParentBuilder >

BLayoutBuilder::Base subclass for building BGroupLayouts.


Constructor & Destructor Documentation

template<typename ParentBuilder >
BLayoutBuilder::Group< ParentBuilder >::Group ( BGroupLayout layout) [inline]

Creates a builder targeting a BGroupLayout.

Methods called on this builder will be directed to layout.

Parameters:
layoutThe BGroupLayout to target with this builder.
template<typename ParentBuilder >
BLayoutBuilder::Group< ParentBuilder >::Group ( BGroupView *  view) [inline]

Creates a builder targeting a BGroupView.

Methods called on this builder will be directed to view->GroupLayout().

Parameters:
viewThe BGroupView this builder will target.

Member Function Documentation

template<typename ParentBuilder >
Group< ParentBuilder >::ThisBuilder & BLayoutBuilder::Group< ParentBuilder >::Add ( BView view) [inline]

Add a BView to the BGroupLayout this builder represents.

Parameters:
viewThe BView to be added.
See also:
BGroupLayout::AddView(BView*)
template<typename ParentBuilder >
Group< ParentBuilder >::ThisBuilder & BLayoutBuilder::Group< ParentBuilder >::Add ( BView view,
float  weight 
) [inline]

Add BView to the BGroupLayout this builder represents.

Parameters:
viewThe BView to be added.
weightThe weight to give view.
See also:
BGroupLayout::AddView(BView* view, float weight)
template<typename ParentBuilder >
Group< ParentBuilder >::ThisBuilder & BLayoutBuilder::Group< ParentBuilder >::Add ( BLayoutItem item) [inline]

Add a BLayoutItem to the BGroupLayout this builder represents.

Parameters:
itemThe BLayoutItem to be added.
See also:
BGroupLayout::AddItem(BLayoutItem*)
template<typename ParentBuilder >
Group< ParentBuilder >::ThisBuilder & BLayoutBuilder::Group< ParentBuilder >::Add ( BLayoutItem item,
float  weight 
) [inline]

Add a BLayoutItem the BGroupLayout this builder represents.

Parameters:
itemThe BLayoutItem to be added.
weightThe weight to give item.
See also:
BGroupLayout::AddItem(BLayoutItem* item, float weight)
template<typename ParentBuilder >
Group< ParentBuilder >::ThisBuilder & BLayoutBuilder::Group< ParentBuilder >::AddGlue ( float  weight = 1.0f) [inline]

Add a BSpaceLayoutItem created by BSpaceLayoutItem::CreateGlue() to the BGroupLayout this builder represents.

Parameters:
weightThe weight of the BSpaceLayoutItem in the BGroupLayout this builder represents
template<typename ParentBuilder >
Group< ParentBuilder >::GridBuilder BLayoutBuilder::Group< ParentBuilder >::AddGrid ( float  horizontalSpacing = B_USE_DEFAULT_SPACING,
float  verticalSpacing = B_USE_DEFAULT_SPACING,
float  weight = 1.0f 
) [inline]

Create and add a viewless BGridLayout, then return a builder representing the newly created BGridLayout.

Parameters:
horizontalSpacingThe horizontal spacing for the new BGridLayout.
verticalSpacingThe vertical spacing for the new BGridLayout.
weightThe weight for the new BGroupLayout in the BGroupLayout this builder represents.
Returns:
A GridBuilder representing the newly created BGridLayout.
template<typename ParentBuilder >
Group< ParentBuilder >::GridBuilder BLayoutBuilder::Group< ParentBuilder >::AddGrid ( BGridLayout gridLayout,
float  weight = 1.0f 
) [inline]

Add a BGridLayout, then return a builder the newly added BGridLayout.

Parameters:
gridLayoutThe BGridLayout to be added and used to construct the returned GridBuilder.
weightThe weight for groupLayout in the BGroupLayout this builder represents.
Returns:
a GridBuilder representing gridLayout.
template<typename ParentBuilder >
Group< ParentBuilder >::GridBuilder BLayoutBuilder::Group< ParentBuilder >::AddGrid ( BGridView *  gridView,
float  weight = 1.0f 
) [inline]

Add a BGridView, then return a builder the newly added BGridView.

Parameters:
gridViewThe BGridView to be added and used to construct the returned GridBuilder.
weightThe weight for groupLayout in the BGroupLayout this builder represents.
Returns:
a GridBuilder representing gridView.
template<typename ParentBuilder >
Group< ParentBuilder >::GroupBuilder BLayoutBuilder::Group< ParentBuilder >::AddGroup ( BGroupView *  groupView,
float  weight = 1.0f 
) [inline]

Add BGroupView and return a builder representing the newly added BGroupView.

Parameters:
groupViewThe BGroupView to be added.
weightThe weight for groupView in the BGroupLayout this builder represents.
Returns:
A GroupBuilder representing groupView.

References BLayoutBuilder::Group< ParentBuilder >::Layout(), and BLayoutBuilder::Base< ParentBuilder >::SetParent().

template<typename ParentBuilder >
Group< ParentBuilder >::GroupBuilder BLayoutBuilder::Group< ParentBuilder >::AddGroup ( BGroupLayout groupLayout,
float  weight = 1.0f 
) [inline]

Add a BGroupLayout and return a builder representing the newly added BGroupLayout.

Parameters:
groupLayoutThe BGroupLayout to be added.
weightThe weight for groupLayout in the BGroupLayout this builder represents.
Returns:
A GroupBuilder representing groupLayout.

References BLayoutBuilder::Group< ParentBuilder >::Layout(), and BLayoutBuilder::Base< ParentBuilder >::SetParent().

template<typename ParentBuilder >
Group< ParentBuilder >::SplitBuilder BLayoutBuilder::Group< ParentBuilder >::AddSplit ( BSplitView *  splitView,
float  weight = 1.0f 
) [inline]

Add a BSplitView to the BGroupLayout this builder represents and return a SplitBuilder representing the BSplitView.

Parameters:
splitViewThe BSplitView to be added.
weightThe weight of the BSplitView in the BGroupLayout this builder represents.
template<typename ParentBuilder >
Group< ParentBuilder >::ThisBuilder & BLayoutBuilder::Group< ParentBuilder >::AddStrut ( float  size) [inline]

Add a BSpaceLayoutItem created by BSpaceLayoutItem::CreateHorizontalStrut() or BSpaceLayoutItem::CreateVerticalStrut() to the BGroupLayout this builder represents.

Parameters:
sizeThe width or height of the strut to be created (depending on the orientation of the BGroupLayout this builder represents).

References B_HORIZONTAL.

template<typename ParentBuilder >
Group< ParentBuilder >::ThisBuilder & BLayoutBuilder::Group< ParentBuilder >::GetLayout ( BGroupLayout **  _layout) [inline]

Get the BGroupLayout this builder represents.

Parameters:
[out]_layoutThe BGroupLayout this builder represents.
template<typename ParentBuilder >
Group< ParentBuilder >::ThisBuilder & BLayoutBuilder::Group< ParentBuilder >::GetView ( BView **  _view) [inline]

Get the BView this builder's BGroupLayout is attached to.

Parameters:
[out]_viewThe BView this builder's BGroupLayout is attached to.
template<typename ParentBuilder >
void BLayoutBuilder::Base< ParentBuilder >::SetParent ( ParentBuilder *  parent) [inline, inherited]

Internal method for use by BLayoutBuilder::Base subclasses, this is essential to the builder stack semantics

Referenced by BLayoutBuilder::Group< ParentBuilder >::AddGroup().


The Haiku Book pre-R1 - BLayoutBuilder::Group< ParentBuilder > Class Template Reference
Generated on Sat May 18 2013 by Doxygen 1.7.5.1