guillaume 2026.6.1
A C++ UI framework designed for modern desktop and extended reality (XR) applications.
Loading...
Searching...
No Matches
guillaume::entities::FloatingActionButtonMenu::Builder Class Reference

Configures, creates and registers FloatingActionButtonMenu widgets. More...

#include <headers/guillaume/entities/floating_action_button_menu.hpp>

Inheritance diagram for guillaume::entities::FloatingActionButtonMenu::Builder:
Collaboration diagram for guillaume::entities::FloatingActionButtonMenu::Builder:

Public Member Functions

 Builder (ecs::ComponentRegistry &componentRegistry, ecs::EntityRegistry &entityRegistry)
 Construct a builder with the default configuration (see reset()).
std::shared_ptr< FloatingActionButtonMenu > buildEntity (void) override
 Build a FloatingActionButtonMenu, with its trigger and action buttons, from the current configuration, without registering it.
void reset (void) override
 Restore the default configuration.
Builder & withIcon (const std::string &iconGlyphName)
 Set the icon of the trigger while the menu is closed.
Builder & addAction (const std::string &iconGlyphName, std::function< void(void)> onClick)
 Add an action shown as a small icon-only FAB.
Builder & addAction (const std::string &iconGlyphName, const std::string &label, std::function< void(void)> onClick)
 Add an action shown with a label next to its icon (Paper FAB.Group label).
Builder & withAccessibilityLabel (const std::string &accessibilityLabel)
 Set the label of the trigger read by assistive technology.
std::shared_ptr< FloatingActionButtonMenu > makeFloatingActionButtonMenu (std::shared_ptr< Entity > parent, const std::string &iconGlyphName)
 Build a menu with the actions added so far, register it under parent and reset the builder.
Public Member Functions inherited from guillaume::entities::EntityBuilderBase< FloatingActionButtonMenu >
 EntityBuilderBase (ecs::ComponentRegistry &componentRegistry, ecs::EntityRegistry &entityRegistry)
 Construct a builder bound to two registries.
 ~EntityBuilderBase (void) override=default
 Default destructor.
std::shared_ptr< FloatingActionButtonMenu > registerEntity (std::shared_ptr< ecs::Entity > parent)
 Build the widget, attach it to its parent, hand it to the entity registry, then reset the builder to its defaults.
Public Member Functions inherited from guillaume::ecs::EntityBuilder
 EntityBuilder (ecs::ComponentRegistry &componentRegistry, ecs::EntityRegistry &entityRegistry)
 Create a builder working on a pair of registries, normally those of one scene.
virtual ~EntityBuilder (void)=default
 Virtual destructor.

Additional Inherited Members

Protected Member Functions inherited from guillaume::ecs::EntityBuilder
ComponentRegistry & getComponentRegistry (void)
 Get the registry in which the builder creates components.
EntityRegistry & getEntityRegistry (void)
 Get the registry in which the builder registers the entities it creates.

Detailed Description

Configures, creates and registers FloatingActionButtonMenu widgets.

Add the actions with addAction(), then call makeFloatingActionButtonMenu() or registerEntity().

Definition at line 105 of file floating_action_button_menu.hpp.

Constructor & Destructor Documentation

◆ Builder()

guillaume::entities::FloatingActionButtonMenu::Builder::Builder ( ecs::ComponentRegistry & componentRegistry,
ecs::EntityRegistry & entityRegistry )

Construct a builder with the default configuration (see reset()).

Parameters
componentRegistryThe registry that stores the components of the menus to build.
entityRegistryThe registry the built menus are added to (usually the scene's).

Definition at line 34 of file floating_action_button_menu.cpp.

Here is the call graph for this function:

Member Function Documentation

◆ addAction() [1/2]

FloatingActionButtonMenu::Builder & guillaume::entities::FloatingActionButtonMenu::Builder::addAction ( const std::string & iconGlyphName,
const std::string & label,
std::function< void(void)> onClick )

Add an action shown with a label next to its icon (Paper FAB.Group label).

Parameters
iconGlyphNameThe glyph name of the action icon.
labelThe text shown next to the icon, also used as the accessibility label. When empty, the action is icon-only.
onClickThe function called when the user clicks the action (may be empty).
Returns
Reference to the builder for chaining.

Definition at line 76 of file floating_action_button_menu.cpp.

◆ addAction() [2/2]

FloatingActionButtonMenu::Builder & guillaume::entities::FloatingActionButtonMenu::Builder::addAction ( const std::string & iconGlyphName,
std::function< void(void)> onClick )

Add an action shown as a small icon-only FAB.

Parameters
iconGlyphNameThe glyph name of the action icon.
onClickThe function called when the user clicks the action (may be empty).
Returns
Reference to the builder for chaining.

Definition at line 68 of file floating_action_button_menu.cpp.

◆ buildEntity()

std::shared_ptr< FloatingActionButtonMenu > guillaume::entities::FloatingActionButtonMenu::Builder::buildEntity ( void )
overridevirtual

Build a FloatingActionButtonMenu, with its trigger and action buttons, from the current configuration, without registering it.

registerEntity() calls it, then sets the parent, registers the menu and resets the builder.

Returns
The new menu.

Implements guillaume::entities::EntityBuilderBase< FloatingActionButtonMenu >.

Definition at line 44 of file floating_action_button_menu.cpp.

Here is the call graph for this function:

◆ makeFloatingActionButtonMenu()

std::shared_ptr< FloatingActionButtonMenu > guillaume::entities::FloatingActionButtonMenu::Builder::makeFloatingActionButtonMenu ( std::shared_ptr< Entity > parent,
const std::string & iconGlyphName )

Build a menu with the actions added so far, register it under parent and reset the builder.

Parameters
parentThe entity the menu becomes a child of.
iconGlyphNameThe glyph name of the trigger icon while the menu is closed.
Returns
The new menu, closed and registered in the entity registry.

Definition at line 93 of file floating_action_button_menu.cpp.

Here is the call graph for this function:

◆ reset()

void guillaume::entities::FloatingActionButtonMenu::Builder::reset ( void )
overridevirtual

Restore the default configuration.

Defaults: empty trigger icon, no action, empty accessibility label.

Implements guillaume::ecs::EntityBuilder.

Definition at line 52 of file floating_action_button_menu.cpp.

Here is the caller graph for this function:

◆ withAccessibilityLabel()

FloatingActionButtonMenu::Builder & guillaume::entities::FloatingActionButtonMenu::Builder::withAccessibilityLabel ( const std::string & accessibilityLabel)

Set the label of the trigger read by assistive technology.

Parameters
accessibilityLabelThe accessibility label of the trigger. Default: empty.
Returns
Reference to the builder for chaining.

Definition at line 85 of file floating_action_button_menu.cpp.

◆ withIcon()

FloatingActionButtonMenu::Builder & guillaume::entities::FloatingActionButtonMenu::Builder::withIcon ( const std::string & iconGlyphName)

Set the icon of the trigger while the menu is closed.

Parameters
iconGlyphNameThe glyph name of the trigger icon (for example "add"). Default: empty.
Returns
Reference to the builder for chaining.

Definition at line 60 of file floating_action_button_menu.cpp.

Here is the caller graph for this function:

The documentation for this class was generated from the following files: