The LayoutItem class provides an abstract item that a LayoutManager manipulates. More...
#include <LayoutItem.h>
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 LayoutControl * | GetControl () |
If the concrete item is a LayoutControl, it can be retrieved using GetControl(). More... | |
virtual LayoutManager * | GetLayout () |
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... | |
![]() | |
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) | |
RefCounted & | operator= (RefCounted const &rhs) |
UInt32 | GetRefCount () const |
Additional Inherited Members | |
![]() | |
virtual | ~RefCounted () |
![]() | |
virtual | ~IRefCounted () |
void * | operator new (size_t size) |
void | operator delete (void *rawMemory, size_t size) |
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().
LayoutAlignment GetAlignment | ( | ) | const |
Returns the alignment within the layout for this layout item.
|
virtual |
If the concrete item is a LayoutControl, it can be retrieved using GetControl().
|
pure virtual |
Returns the desired size for this layout item.
Implemented in GridLayout, StackLayout, SplitterLayout, FlowLayout, and DockLayout.
|
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.
|
pure virtual |
Returns the geometry for this layout item.
Implemented in LayoutManager.
|
virtual |
Returns the preferred height for this layout item, given the width.
[in] | width | The width for which to retrieve the preferred height. |
Reimplemented in GridLayout, StackLayout, FlowLayout, and DockLayout.
|
virtual |
If the concrete item is a LayoutManager, it can be retrieved using GetLayout().
Reimplemented in LayoutManager.
|
pure virtual |
Returns the maximum size for this layout item.
Implemented in LayoutManager, GridLayout, StackLayout, and SplitterLayout.
|
virtual |
Returns the minimum height for this layout item, given the width.
[in] | width | The width for which to retrieve the minimum height. |
Reimplemented in GridLayout, and StackLayout.
|
pure virtual |
Returns the minimum size for this layout item.
Implemented in LayoutManager, GridLayout, StackLayout, SplitterLayout, FlowLayout, and DockLayout.
|
virtual |
Returns the geometry's size for this layout item.
|
virtual |
Returns whether this layout's preferred height depends on its width.
Reimplemented in GridLayout, StackLayout, FlowLayout, and DockLayout.
|
virtual |
Invalidates the layout item then updates it.
Reimplemented in GridLayout, StackLayout, SplitterLayout, and LayoutManager.
|
pure virtual |
Returns whether the layout item is empty.
Implemented in LayoutManager.
|
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.
[in] | alignment | The new alignment for the layout item. |
|
virtual |
Invalidates the layout item without updating it.
Reimplemented in GridLayout, StackLayout, SplitterLayout, and LayoutManager.
|
pure virtual |
Sets the geometry for this layout item to the given rectangle.
[in] | rect | The rectangle of the new geometry for the layout item. |
Implemented in LayoutManager, GridLayout, StackLayout, SplitterLayout, FlowLayout, and DockLayout.