stmm-games-doc  0.32.0
Public Member Functions | Protected Member Functions | List of all members
stmg::ThemeContainerWidget Class Reference

ThemeWidget container class. More...

Inheritance diagram for stmg::ThemeContainerWidget:
Inheritance graph
[legend]

Public Member Functions

const std::vector< shared_ptr< ThemeWidget > > & getChildren () const noexcept
 The child ThemeWidget vector of the container. More...
 
void dump (int32_t nIndentSpaces, bool bHeader) const noexcept override
 Writes object contents to std::cout. More...
 
- Public Member Functions inherited from stmg::ThemeWidget
virtual ~ThemeWidget () noexcept=default
 
virtual NSize getSize () const noexcept=0
 The size of the widget. More...
 
virtual NPoint getPos () const noexcept=0
 The position of the widget. More...
 
virtual bool canChange () const noexcept=0
 Whether the widget's appearance (or one of its parents) can change. More...
 
virtual bool drawIfChanged (const Cairo::RefPtr< Cairo::Context > &refCc) noexcept=0
 Deep draws a widget if it changed. More...
 
virtual void draw (const Cairo::RefPtr< Cairo::Context > &refCc) noexcept=0
 Draws a widget. More...
 
virtual void drawDeep (const Cairo::RefPtr< Cairo::Context > &refCc) noexcept
 Deep draws a widget. More...
 
bool isContainer () const noexcept
 Tells Whether the widget is a container. More...
 
const shared_ptr< GameWidget > & getModel () const noexcept
 The game widget used to generate the theme widget. More...
 
ThemeContainerWidgetgetParent () const noexcept
 The parent container of the widget. More...
 
virtual const std::pair< SegmentedFunction, SegmentedFunction > & getSizeFunctions (int32_t nLayoutConfig) const noexcept=0
 Gets the width and height functions that take the tile width as parameter. More...
 
virtual void placeAndMaybeResizeIn (const NRect &oRect) noexcept=0
 Places and possibly resizes the widget within the given area. More...
 
void dump (int32_t nIndentSpaces) const noexcept
 Writes object contents to std::cout (header included). More...
 
void dump () const noexcept
 Writes contents to std::cout without indentation. More...
 

Protected Member Functions

void setChildren (const std::vector< shared_ptr< ThemeWidget > > &aChildren) noexcept
 Sets the children of the container. More...
 
 ThemeContainerWidget (const shared_ptr< GameWidget > &refModel) noexcept
 Constructor. More...
 
void reInit (const shared_ptr< GameWidget > &refModel) noexcept
 Reinitialization. More...
 
virtual ~ThemeContainerWidget () noexcept
 
- Protected Member Functions inherited from stmg::ThemeWidget
ThemeLayoutthemeLayout () noexcept
 The theme layout. More...
 
const ThemeLayoutthemeLayout () const noexcept
 The constant theme layout. More...
 
virtual void onAssignedToLayout () noexcept
 Signal that widget was added to a layout. More...
 
virtual void onRecalcSizeFunctions (ThemeWidget *p0ReferenceThemeWidget) noexcept
 Signal the widget should define its size functions. More...
 
virtual void sizeAndConfig (int32_t nTileW, int32_t nLayoutConfig) noexcept=0
 Sets the tile size of the widget and its configuration. More...
 
 ThemeWidget (const shared_ptr< GameWidget > &refModel) noexcept
 Constructs the theme widget. More...
 
void reInit (const shared_ptr< GameWidget > &refModel) noexcept
 Reinitializes the theme widget. More...
 

Detailed Description

ThemeWidget container class.

Implementations of this class should ensure that the children do not overlap each other in the xy space because ThemeWidget::drawDeep() and ThemeWidget::drawIfChanged() are only required to check and draw their direct ancestors.

Constructor & Destructor Documentation

◆ ThemeContainerWidget()

stmg::ThemeContainerWidget::ThemeContainerWidget ( const shared_ptr< GameWidget > &  refModel)
inlineexplicitprotectednoexcept

Constructor.

Parameters
refModelThe model. Cannot be null.

◆ ~ThemeContainerWidget()

virtual stmg::ThemeContainerWidget::~ThemeContainerWidget ( )
inlineprotectedvirtualnoexcept

Member Function Documentation

◆ dump()

void stmg::ThemeContainerWidget::dump ( int32_t  nIndentSpaces,
bool  bHeader 
) const
overridevirtualnoexcept

Writes object contents to std::cout.

Should only do it in debug mode. The function is also exposed in release mode because it is virtual.

Parameters
nIndentSpacesNumber of spaces put in front of each output line.
bHeaderWhether the header of the object should be displayed.

Reimplemented from stmg::ThemeWidget.

Reimplemented in stmg::BoxThemeWidget< InputBoxThWidgetFactory, InputBoxThWidget, InputBoxWidget >, stmg::BoxThemeWidget< ActionsBoxThWidgetFactory, ActionsBoxThWidget, ActionsBoxWidget >, stmg::BoxThemeWidget< BoxThWidgetFactory, BoxThWidget, BoxWidget >, stmg::InputBoxThWidget, and stmg::ActionsBoxThWidget.

◆ getChildren()

const std::vector< shared_ptr<ThemeWidget> >& stmg::ThemeContainerWidget::getChildren ( ) const
inlinenoexcept

The child ThemeWidget vector of the container.

The container may contain null values if the ThemeWidget couldn't be created for the corresponding GameWidget of the container's model.

Returns
The children of the container.

◆ reInit()

void stmg::ThemeContainerWidget::reInit ( const shared_ptr< GameWidget > &  refModel)
inlineprotectednoexcept

Reinitialization.

See constructor.

◆ setChildren()

void stmg::ThemeContainerWidget::setChildren ( const std::vector< shared_ptr< ThemeWidget > > &  aChildren)
protectednoexcept

Sets the children of the container.

Parameters
aChildrenNon null children of the container.