29#include "guillaume/ecs/component.hpp"
30#include "guillaume/ecs/entity.hpp"
78 static constexpr float Width = 320.0f;
84 Variant _variant { Variant::Alert };
85 std::string _title {};
86 std::string _message {};
87 std::vector<Action> _actions {};
101 std::vector<ecs::Entity::Identifier>
141 const std::string &
getTitle(
void)
const noexcept;
157 const std::string &
getMessage(
void)
const noexcept;
173 const std::vector<Action> &
getActions(
void)
const noexcept;
191 const std::string &
getIcon(
void)
const noexcept;
263 const std::vector<ecs::Entity::Identifier> &
274 const std::vector<ecs::Entity::Identifier> &identifiers);
const std::string & getTitle(void) const noexcept
Get the title (headline) of the dialog.
Dialog & setIcon(const std::string &icon)
Choose the icon shown above the title (the hero icon).
Dialog & setMessageEntity(ecs::Entity::Identifier identifier)
Record the child that draws the message.
Dialog(void)=default
Create the configuration of an empty alert dialog.
Dialog & setTitle(const std::string &title)
Set the title (headline) of the dialog.
const std::vector< ecs::Entity::Identifier > & getActionEntities(void) const noexcept
Get the text buttons built for the actions.
const std::string & getMessage(void) const noexcept
Get the message (supporting text) of the dialog.
ecs::Entity::Identifier getMessageEntity(void) const noexcept
Get the child that draws the message.
Dialog & setVariant(Variant variant)
Set the kind of dialog.
const std::string & getIcon(void) const noexcept
Get the icon chosen for the top of the dialog.
Dialog & setActionRow(ecs::Entity::Identifier identifier)
Record the row that holds the action buttons.
Dialog & setMessage(const std::string &message)
Set the message (supporting text) of the dialog.
static constexpr float FullScreenHeight
Height of a full-screen dialog, in dp.
~Dialog(void)=default
Default destructor.
Variant getVariant(void) const noexcept
Get the kind of dialog.
Dialog & setActions(std::vector< Action > actions)
Replace the actions of the dialog.
ecs::Entity::Identifier getBackdrop(void) const noexcept
Get the child that dims the content behind the dialog.
ecs::Entity::Identifier getIconEntity(void) const noexcept
Get the child that draws the hero icon.
const std::vector< Action > & getActions(void) const noexcept
Get the actions of the dialog.
Dialog & setTitleEntity(ecs::Entity::Identifier identifier)
Record the child that draws the title.
Dialog & setActionEntities(const std::vector< ecs::Entity::Identifier > &identifiers)
Record the text buttons built for the actions.
Dialog & setIconEntity(ecs::Entity::Identifier identifier)
Record the child that draws the hero icon.
Dialog & setBackdrop(ecs::Entity::Identifier identifier)
Record the child that dims the content behind the dialog.
static constexpr float Width
Width of the dialog panel, in dp.
ecs::Entity::Identifier getTitleEntity(void) const noexcept
Get the child that draws the title.
std::string getEffectiveIcon(void) const
Get the icon the dialog actually shows.
ecs::Entity::Identifier getActionRow(void) const noexcept
Get the row that holds the action buttons, at the bottom of the panel.
Base class of every component: a piece of state attached to an entity, plus a "changed" flag.
std::size_t Identifier
The key under which an entity's components are stored. Systems and components refer to entities by th...
static constexpr Identifier InvalidIdentifier
"No entity": never the identifier of a real entity
State. Every class here is plain data attached to an entity.
@ Alert
Live announcement (snackbar).
One action of the dialog, drawn as a text button in the action row.
std::string label
Text of the button.
std::function< void(void)> onPress