stmm-games-doc  0.32.0
Public Member Functions | Protected Member Functions | List of all members
stmg::XmlBoxWidgetParser Class Reference
Inheritance diagram for stmg::XmlBoxWidgetParser:
Inheritance graph
[legend]

Public Member Functions

 XmlBoxWidgetParser ()
 
shared_ptr< GameWidgetparseGameWidget (LayoutCtx &oCtx, const xmlpp::Element *p0Element) override
 Parses a game widget element. More...
 
- Public Member Functions inherited from stmg::XmlGameWidgetParser
virtual ~XmlGameWidgetParser ()=default
 
 XmlGameWidgetParser (const std::string &sGameWidgetName)
 Constructor. More...
 
const std::string & getGameWidgetName () const
 The game widget name. More...
 

Protected Member Functions

 XmlBoxWidgetParser (const std::string &sGameWidgetName)
 Constructor for subclasses. More...
 
void parseBoxWidget (BoxWidget::Init &oInit, LayoutCtx &oCtx, const xmlpp::Element *p0WidgetElement)
 See parseBoxWidget with additional aSkipChildNames parameter. More...
 
void parseBoxWidget (BoxWidget::Init &oInit, LayoutCtx &oCtx, const xmlpp::Element *p0WidgetElement, const std::vector< std::string const *> &aSkipChildNames)
 Parse box widget for subclasses. More...
 
- Protected Member Functions inherited from stmg::XmlGameWidgetParser
XmlConditionalParsergetXmlConditionalParser ()
 
XmlTraitsParsergetXmlTraitsParser ()
 
XmlImageParsergetXmlImageParser ()
 
void parseGameWidget (GameWidget::Init &oInit, LayoutCtx &oCtx, const xmlpp::Element *p0Element)
 Parse the base class attributes of GameWidget. More...
 
void parseRelSizedGameWidget (RelSizedGameWidget::Init &oInit, LayoutCtx &oCtx, const xmlpp::Element *p0Element)
 Parse the base class attributes of RelSizedGameWidget. More...
 
void parseContainerWidget (ContainerWidget::Init &oInit, LayoutCtx &oCtx, const xmlpp::Element *p0WidgetElement)
 Parse the base class attributes of ContainerWidget. More...
 
void parseContainerWidget (ContainerWidget::Init &oInit, LayoutCtx &oCtx, const xmlpp::Element *p0WidgetElement, const std::vector< std::string const *> &aSkipChildNames)
 Parse the base class attributes of ContainerWidget. More...
 
std::vector< shared_ptr< GameWidget > > parseChildWidgets (LayoutCtx &oCtx, const xmlpp::Element *p0Parent)
 Parse the child game widgets. More...
 
std::vector< shared_ptr< GameWidget > > parseChildWidgets (LayoutCtx &oCtx, const xmlpp::Element *p0Parent, const std::vector< std::string const *> &aSkipChildNames)
 Parse the child game widgets with exceptions. More...
 
std::pair< std::string, int32_t > parseEvIdMessage (ConditionalCtx &oCtx, const xmlpp::Element *p0Element, bool bMandatory, const std::string &sEvIdAttrName, const std::string &sMsgNameAttrName, const std::string &sMsgAttrName)
 Get event and message id for an event, given message name. More...
 
std::pair< int32_t, OwnerTypeparseVariable (LayoutCtx &oCtx, const xmlpp::Element *p0Element, const std::string &sVarNameAttrName, bool bMandatory)
 

Constructor & Destructor Documentation

◆ XmlBoxWidgetParser() [1/2]

stmg::XmlBoxWidgetParser::XmlBoxWidgetParser ( )

◆ XmlBoxWidgetParser() [2/2]

stmg::XmlBoxWidgetParser::XmlBoxWidgetParser ( const std::string &  sGameWidgetName)
explicitprotected

Constructor for subclasses.

Parameters
sGameWidgetNameThe game widget element name. Cannot be empty.

Member Function Documentation

◆ parseBoxWidget() [1/2]

void stmg::XmlBoxWidgetParser::parseBoxWidget ( BoxWidget::Init oInit,
LayoutCtx oCtx,
const xmlpp::Element *  p0WidgetElement 
)
protected

See parseBoxWidget with additional aSkipChildNames parameter.

◆ parseBoxWidget() [2/2]

void stmg::XmlBoxWidgetParser::parseBoxWidget ( BoxWidget::Init oInit,
LayoutCtx oCtx,
const xmlpp::Element *  p0WidgetElement,
const std::vector< std::string const *> &  aSkipChildNames 
)
protected

Parse box widget for subclasses.

Even the child names that are skipped are added as valid child names with oCtx.addValidChildElementName(). There is therefore no need to check the valid names when oCtx.removeChecker() is called.

Parameters
oInitThe parameters to the model to be filled.
oCtxThe context.
p0WidgetElementThe widget element. Cannot be null.
aSkipChildNamesThe child elements that BoxWidget parser has to skip.

◆ parseGameWidget()

shared_ptr<GameWidget> stmg::XmlBoxWidgetParser::parseGameWidget ( LayoutCtx oCtx,
const xmlpp::Element *  p0Element 
)
overridevirtual

Parses a game widget element.

Parameters
oCtxThe context.
p0ElementThe element. Cannot be null.
Returns
The created widget. Is not null.
Exceptions
std::runtime_error.

Implements stmg::XmlGameWidgetParser.

Reimplemented in stmg::XmlInputBoxWidgetParser.