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

Public Member Functions

const shared_ptr< ThemeWidget > & getRoot () const noexcept
 Get the root theme widget. More...
 
virtual void dump (int32_t nIndentSpaces) const noexcept
 
void dump () const noexcept
 
const shared_ptr< ThemeWidget > & getWidgetNamed (const std::string &sName, int32_t nTeam, int32_t nMate) const noexcept
 Find theme widget with a model with a certain name. More...
 

Protected Member Functions

 ThemeLayout (const shared_ptr< ThemeWidget > &refRootTW) noexcept
 Creates a layout. More...
 
virtual ~ThemeLayout () noexcept
 
void reInit (const shared_ptr< ThemeWidget > &refRootTW) noexcept
 Reinitializes a layout. More...
 
void recalcSizeFunctions (ThemeWidget *p0ReferenceThemeWidget) noexcept
 Signals widgets in the layout to recalculate their size functions. More...
 
void sizeAndConfig (ThemeWidget *p0TW, int32_t nTileW, int32_t nLayoutConfig) noexcept
 Sets the tile size of the widget and its configuration. More...
 

Constructor & Destructor Documentation

◆ ThemeLayout()

stmg::ThemeLayout::ThemeLayout ( const shared_ptr< ThemeWidget > &  refRootTW)
inlineprotectednoexcept

Creates a layout.

Calls onAssignedToLayout() of each theme widget reachable from the root widget.

Parameters
refRootTWThe root widget. Cannot be null.

◆ ~ThemeLayout()

virtual stmg::ThemeLayout::~ThemeLayout ( )
inlineprotectedvirtualnoexcept

Member Function Documentation

◆ dump() [1/2]

virtual void stmg::ThemeLayout::dump ( int32_t  nIndentSpaces) const
virtualnoexcept

◆ dump() [2/2]

void stmg::ThemeLayout::dump ( ) const
inlinenoexcept

◆ getRoot()

const shared_ptr<ThemeWidget>& stmg::ThemeLayout::getRoot ( ) const
inlinenoexcept

Get the root theme widget.

Returns
The root widget as passed to the constructor.

◆ getWidgetNamed()

const shared_ptr<ThemeWidget>& stmg::ThemeLayout::getWidgetNamed ( const std::string &  sName,
int32_t  nTeam,
int32_t  nMate 
) const
noexcept

Find theme widget with a model with a certain name.

Parameters
sNameThe name of the widget.
nTeamThe team of the widget. Is -1 if game widget.
nMateThe mate of the widget. Is -1 if game or team widget.
Returns
The widget. Null if none defined with given name.

◆ recalcSizeFunctions()

void stmg::ThemeLayout::recalcSizeFunctions ( ThemeWidget p0ReferenceThemeWidget)
protectednoexcept

Signals widgets in the layout to recalculate their size functions.

The reference widget, who's size functions are already valid, can be used if the widget's size is relative to it. Calls onRecalcSizeFunctions() of each theme widget reachable from the root. ThemeWidget::getSizeFunctions() of the layout widgets might be invalid before this function is called by subclasses of ThemeLayout.

Parameters
p0ReferenceThemeWidgetThe reference theme widget. Cannot be null.

◆ reInit()

void stmg::ThemeLayout::reInit ( const shared_ptr< ThemeWidget > &  refRootTW)
inlineprotectednoexcept

Reinitializes a layout.

Calls onAssignedToLayout() of each theme widget reachable from the root widget. The old root is dropped.

Parameters
refRootTWThe root widget. Cannot be null.

◆ sizeAndConfig()

void stmg::ThemeLayout::sizeAndConfig ( ThemeWidget p0TW,
int32_t  nTileW,
int32_t  nLayoutConfig 
)
inlineprotectednoexcept

Sets the tile size of the widget and its configuration.

Parameters
p0TWThe widget. Cannot be null.
nTileWThe tile size. Must be >0.
nLayoutConfigThe layout config.