Public Member Functions | List of all members
LayoutItem Class Referenceabstract

The LayoutItem class provides an abstract item that a LayoutManager manipulates. More...

#include <LayoutItem.h>

Inheritance diagram for LayoutItem:
RefCounted< IRefCounted > IRefCounted LayoutManager DockLayout FlowLayout GridLayout SplitterLayout StackLayout HSplitterLayout VSplitterLayout HStackLayout VStackLayout

Public Member Functions

virtual BSize GetDesiredSize () const =0
 Returns the desired size for this layout item. More...
 
virtual BSize GetMinimumSize () const =0
 Returns the minimum size for this layout item. More...
 
virtual BSize GetMaximumSize () const =0
 Returns the maximum size for this layout item. More...
 
virtual LayoutOrientations GetExpandingOrientations () const =0
 Returns whether this layout item can make use of more space than GetDesiredSize(). More...
 
virtual void SetGeometry (const BRect &rect)=0
 Sets the geometry for this layout item to the given rectangle. More...
 
virtual BRect GetGeometry () const =0
 Returns the geometry for this layout item. More...
 
virtual bool IsEmpty () const =0
 Returns whether the layout item is empty. More...
 
virtual bool IsVisible () const =0
 Returns whether the layout item is visible. More...
 
virtual BSize GetSize () const
 Returns the geometry's size for this layout item. More...
 
virtual bool HasHeightForWidth () const
 Returns whether this layout's preferred height depends on its width. More...
 
virtual int GetHeightForWidth (int width) const
 Returns the preferred height for this layout item, given the width. More...
 
virtual int GetMinimumHeightForWidth (int width) const
 Returns the minimum height for this layout item, given the width. More...
 
virtual void Invalidate ()
 Invalidates the layout item then updates it. More...
 
virtual void SetDirty ()
 Invalidates the layout item without updating it. More...
 
virtual LayoutControlGetControl ()
 If the concrete item is a LayoutControl, it can be retrieved using GetControl(). More...
 
virtual LayoutManagerGetLayout ()
 If the concrete item is a LayoutManager, it can be retrieved using GetLayout(). More...
 
LayoutAlignment GetAlignment () const
 Returns the alignment within the layout for this layout item. More...
 
void SetAlignment (LayoutAlignment alignment)
 Sets the alignment within the layout for this layout item. More...
 
- Public Member Functions inherited from RefCounted< IRefCounted >
void * operator new (size_t size)
 
void operator delete (void *rawMemory, size_t size)
 
UInt32 AddRef () const
 
UInt32 Release () const
 
 RefCounted ()
 
 RefCounted (RefCounted const &rhs)
 
RefCountedoperator= (RefCounted const &rhs)
 
UInt32 GetRefCount () const
 

Additional Inherited Members

- Protected Member Functions inherited from RefCounted< IRefCounted >
virtual ~RefCounted ()
 
- Protected Member Functions inherited from IRefCounted
virtual ~IRefCounted ()
 
void * operator new (size_t size)
 
void operator delete (void *rawMemory, size_t size)
 

Detailed Description

The LayoutItem class provides an abstract item that a LayoutManager manipulates.

Pure virtual functions are provided to return information about the layout, including GetDesiredSize(), GetMinimumSize(), GetMaximumSize() and GetExpandingOrientations().

The layout's geometry can be set and retrieved with SetGeometry() and GetGeometry(), and its alignment with SetAlignment() and GetAlignment().

IsEmpty() returns whether the layout item is empty. If the concrete item is a LayoutControl, it can be retrieved using GetControl(). Similarly, if the item is a LayoutManager, GetLayout() retrieves it.

Some layouts have width and height interdependencies. These can be expressed using HasHeightForWidth(), GetHeightForWidth() and GetMinimumHeightForWidth().

Member Function Documentation

LayoutAlignment GetAlignment ( ) const

Returns the alignment within the layout for this layout item.

virtual LayoutControl* GetControl ( )
virtual

If the concrete item is a LayoutControl, it can be retrieved using GetControl().

virtual BSize GetDesiredSize ( ) const
pure virtual

Returns the desired size for this layout item.

Implemented in GridLayout, StackLayout, SplitterLayout, FlowLayout, and DockLayout.

virtual LayoutOrientations GetExpandingOrientations ( ) const
pure virtual

Returns whether this layout item can make use of more space than GetDesiredSize().

A value of LO_Vertical or LO_Horizontal means that it wants to grow in only one dimension, whereas LO_Vertical | LO_Horizontal means that it wants to grow in both dimensions.

Implemented in LayoutManager, GridLayout, StackLayout, FlowLayout, and DockLayout.

virtual BRect GetGeometry ( ) const
pure virtual

Returns the geometry for this layout item.

Implemented in LayoutManager.

virtual int GetHeightForWidth ( int  width) const
virtual

Returns the preferred height for this layout item, given the width.

Parameters
[in]widthThe width for which to retrieve the preferred height.

Reimplemented in GridLayout, StackLayout, FlowLayout, and DockLayout.

virtual LayoutManager* GetLayout ( )
virtual

If the concrete item is a LayoutManager, it can be retrieved using GetLayout().

Reimplemented in LayoutManager.

virtual BSize GetMaximumSize ( ) const
pure virtual

Returns the maximum size for this layout item.

Implemented in LayoutManager, GridLayout, StackLayout, and SplitterLayout.

virtual int GetMinimumHeightForWidth ( int  width) const
virtual

Returns the minimum height for this layout item, given the width.

Parameters
[in]widthThe width for which to retrieve the minimum height.

Reimplemented in GridLayout, and StackLayout.

virtual BSize GetMinimumSize ( ) const
pure virtual

Returns the minimum size for this layout item.

Implemented in LayoutManager, GridLayout, StackLayout, SplitterLayout, FlowLayout, and DockLayout.

virtual BSize GetSize ( ) const
virtual

Returns the geometry's size for this layout item.

virtual bool HasHeightForWidth ( ) const
virtual

Returns whether this layout's preferred height depends on its width.

Reimplemented in GridLayout, StackLayout, FlowLayout, and DockLayout.

virtual void Invalidate ( )
virtual

Invalidates the layout item then updates it.

Reimplemented in GridLayout, StackLayout, SplitterLayout, and LayoutManager.

virtual bool IsEmpty ( ) const
pure virtual

Returns whether the layout item is empty.

Implemented in LayoutManager.

virtual bool IsVisible ( ) const
pure virtual

Returns whether the layout item is visible.

Implemented in LayoutManager.

void SetAlignment ( LayoutAlignment  alignment)

Sets the alignment within the layout for this layout item.

Parameters
[in]alignmentThe new alignment for the layout item.
virtual void SetDirty ( )
virtual

Invalidates the layout item without updating it.

Reimplemented in GridLayout, StackLayout, SplitterLayout, and LayoutManager.

virtual void SetGeometry ( const BRect rect)
pure virtual

Sets the geometry for this layout item to the given rectangle.

Parameters
[in]rectThe rectangle of the new geometry for the layout item.

Implemented in LayoutManager, GridLayout, StackLayout, SplitterLayout, FlowLayout, and DockLayout.


The documentation for this class was generated from the following file:

Copyright © 2017 Bentley Systems, Incorporated. All rights reserved.