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

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

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

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

Public Member Functions

 Builder (ecs::ComponentRegistry &componentRegistry, ecs::EntityRegistry &entityRegistry)
 Construct a builder with the default configuration (see reset()).
std::shared_ptr< ExtendedFloatingActionButton > buildEntity (void) override
 Build an ExtendedFloatingActionButton, with its icon and label children, from the current configuration, without registering it.
void reset (void) override
 Restore the default configuration.
Builder & withIcon (const std::string &iconGlyphName)
 Set the icon shown before the label.
Builder & withIconStyle (const components::Glyph::Style &iconStyle)
 Set the glyph style of the icon.
Builder & withLabel (const std::string &labelContent)
 Set the label text.
Builder & withOnClick (std::function< void(void)> onClick)
 Set the click handler.
Builder & withVariant (const Variant &variant)
 Set the color variant.
Builder & withSize (const Size &size)
 Set the size.
Builder & withLowered (const bool &lowered)
 Choose the lowered style: a weaker shadow (elevation level 1 instead of 3).
Builder & withDisabled (const bool &isDisabled)
 Choose whether the FAB starts disabled.
Builder & withAccessibilityLabel (const std::string &accessibilityLabel)
 Set the label read by assistive technology.
std::shared_ptr< ExtendedFloatingActionButton > makeExtendedFloatingActionButton (std::shared_ptr< Entity > parent, const std::string &labelContent, std::function< void(void)> onClick)
 Build an extended FAB, register it under parent and reset the builder.
Public Member Functions inherited from guillaume::entities::EntityBuilderBase< ExtendedFloatingActionButton >
 EntityBuilderBase (ecs::ComponentRegistry &componentRegistry, ecs::EntityRegistry &entityRegistry)
 Construct a builder bound to two registries.
 ~EntityBuilderBase (void) override=default
 Default destructor.
std::shared_ptr< ExtendedFloatingActionButton > 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 ExtendedFloatingActionButton widgets.

Set options with the with... methods then call registerEntity(), or use makeExtendedFloatingActionButton() to do both in one call.

Definition at line 102 of file extended_floating_action_button.hpp.

Constructor & Destructor Documentation

◆ Builder()

guillaume::entities::ExtendedFloatingActionButton::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 buttons to build.
entityRegistryThe registry the built buttons are added to (usually the scene's).

Definition at line 37 of file extended_floating_action_button.cpp.

Here is the call graph for this function:

Member Function Documentation

◆ buildEntity()

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

Build an ExtendedFloatingActionButton, with its icon and label children, from the current configuration, without registering it.

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

Returns
The new extended FAB.

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

Definition at line 47 of file extended_floating_action_button.cpp.

Here is the call graph for this function:

◆ makeExtendedFloatingActionButton()

std::shared_ptr< ExtendedFloatingActionButton > guillaume::entities::ExtendedFloatingActionButton::Builder::makeExtendedFloatingActionButton ( std::shared_ptr< Entity > parent,
const std::string & labelContent,
std::function< void(void)> onClick )

Build an extended FAB, register it under parent and reset the builder.

The icon, variant, size and other options are the ones set before the call with the with... methods, or the defaults.

Parameters
parentThe entity the FAB becomes a child of.
labelContentThe label text.
onClickThe function called when the user clicks the FAB (may be empty).
Returns
The new extended FAB, registered in the entity registry.

Definition at line 140 of file extended_floating_action_button.cpp.

Here is the call graph for this function:

◆ reset()

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

Restore the default configuration.

Defaults: no icon, Glyph::Style::Outlined, empty label, no click handler, Variant::Primary, Size::Medium, not lowered, enabled, empty accessibility label.

Implements guillaume::ecs::EntityBuilder.

Definition at line 56 of file extended_floating_action_button.cpp.

Here is the caller graph for this function:

◆ withAccessibilityLabel()

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

Set the label read by assistive technology.

Parameters
accessibilityLabelThe accessibility label. Default: empty, in which case the label text is used.
Returns
Reference to the builder for chaining.

Definition at line 132 of file extended_floating_action_button.cpp.

◆ withDisabled()

ExtendedFloatingActionButton::Builder & guillaume::entities::ExtendedFloatingActionButton::Builder::withDisabled ( const bool & isDisabled)

Choose whether the FAB starts disabled.

Parameters
isDisabledTrue for a FAB that ignores input. Default: false.
Returns
Reference to the builder for chaining.

Definition at line 124 of file extended_floating_action_button.cpp.

Here is the call graph for this function:

◆ withIcon()

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

Set the icon shown before the label.

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

Definition at line 70 of file extended_floating_action_button.cpp.

◆ withIconStyle()

ExtendedFloatingActionButton::Builder & guillaume::entities::ExtendedFloatingActionButton::Builder::withIconStyle ( const components::Glyph::Style & iconStyle)

Set the glyph style of the icon.

Parameters
iconStyleThe glyph style. Default: Glyph::Style::Outlined.
Returns
Reference to the builder for chaining.

Definition at line 78 of file extended_floating_action_button.cpp.

◆ withLabel()

ExtendedFloatingActionButton::Builder & guillaume::entities::ExtendedFloatingActionButton::Builder::withLabel ( const std::string & labelContent)

Set the label text.

Parameters
labelContentThe label text. Default: empty. It is also the accessibility label when none is set.
Returns
Reference to the builder for chaining.

Definition at line 86 of file extended_floating_action_button.cpp.

Here is the caller graph for this function:

◆ withLowered()

ExtendedFloatingActionButton::Builder & guillaume::entities::ExtendedFloatingActionButton::Builder::withLowered ( const bool & lowered)

Choose the lowered style: a weaker shadow (elevation level 1 instead of 3).

Parameters
loweredTrue for the lowered style. Default: false.
Returns
Reference to the builder for chaining.

Definition at line 117 of file extended_floating_action_button.cpp.

◆ withOnClick()

ExtendedFloatingActionButton::Builder & guillaume::entities::ExtendedFloatingActionButton::Builder::withOnClick ( std::function< void(void)> onClick)

Set the click handler.

Parameters
onClickThe function called when the user clicks the FAB. Default: empty, nothing is called.
Returns
Reference to the builder for chaining.

Definition at line 94 of file extended_floating_action_button.cpp.

◆ withSize()

ExtendedFloatingActionButton::Builder & guillaume::entities::ExtendedFloatingActionButton::Builder::withSize ( const Size & size)

Set the size.

Parameters
sizeThe size. Default: Size::Medium.
Returns
Reference to the builder for chaining.

Definition at line 110 of file extended_floating_action_button.cpp.

◆ withVariant()

ExtendedFloatingActionButton::Builder & guillaume::entities::ExtendedFloatingActionButton::Builder::withVariant ( const Variant & variant)

Set the color variant.

Parameters
variantThe color variant. Default: Variant::Primary.
Returns
Reference to the builder for chaining.

Definition at line 102 of file extended_floating_action_button.cpp.


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