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

Base class for implementations of LevelShowWidget view. More...

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

Public Member Functions

virtual NPoint getCanvasPixPos () noexcept=0
 The origin of the canvas relative to the upper left corner of the widget. More...
 
LevelShowWidgetgetLevelShowWidget () noexcept
 Returns a pointer to the model. More...
 
const LevelShowWidgetgetLevelShowWidget () const noexcept
 Returns a pointer to the model. 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...
 
- Public Member Functions inherited from stmg::ThemeWidgetInteractive
virtual ~ThemeWidgetInteractive () noexcept=default
 
virtual bool handleXYInput (const shared_ptr< stmi::Event > &refXYEvent, int32_t nTeam, int32_t nMate) noexcept=0
 Handles the XYEvent input. More...
 
bool isInteractive () const noexcept
 Tells whether the widget should really be interactive. More...
 
ThemeWidgetgetThemeWidget () noexcept
 The pointer to the interface's theme widget. More...
 
void dump (int32_t nIndentSpaces) const noexcept
 

Protected Member Functions

 LevelShowThemeWidget (const shared_ptr< GameWidget > &refModel) noexcept
 Constructor. More...
 
void reInit (const shared_ptr< GameWidget > &refModel) noexcept
 See constructor. More...
 
- 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...
 
- Protected Member Functions inherited from stmg::ThemeWidgetInteractive
 ThemeWidgetInteractive (ThemeWidget *p0TW, bool bInteractive) noexcept
 Constructor. More...
 
void reInit (ThemeWidget *p0TW, bool bInteractive) noexcept
 Reinitialization. More...
 

Detailed Description

Base class for implementations of LevelShowWidget view.

Constructor & Destructor Documentation

◆ LevelShowThemeWidget()

stmg::LevelShowThemeWidget::LevelShowThemeWidget ( const shared_ptr< GameWidget > &  refModel)
protectednoexcept

Constructor.

Parameters
refModelThe model. Cannot be null.

Member Function Documentation

◆ dump()

void stmg::LevelShowThemeWidget::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.

◆ getCanvasPixPos()

virtual NPoint stmg::LevelShowThemeWidget::getCanvasPixPos ( )
pure virtualnoexcept

The origin of the canvas relative to the upper left corner of the widget.

The canvas is where the widget draws the level's board tiles. The widget's frame is not considered part of the canvas.

Returns
The position in pixels.

◆ getLevelShowWidget() [1/2]

LevelShowWidget* stmg::LevelShowThemeWidget::getLevelShowWidget ( )
inlinenoexcept

Returns a pointer to the model.

Returns
The pointer to the model or null if not set yet.

◆ getLevelShowWidget() [2/2]

const LevelShowWidget* stmg::LevelShowThemeWidget::getLevelShowWidget ( ) const
inlinenoexcept

Returns a pointer to the model.

Returns
The pointer to the model or null if not set yet.

◆ reInit()

void stmg::LevelShowThemeWidget::reInit ( const shared_ptr< GameWidget > &  refModel)
protectednoexcept

See constructor.