|
guillaume 2026.6.1
A C++ UI framework designed for modern desktop and extended reality (XR) applications.
|
Configures an AppBar, creates it and registers it in an entity registry. More...
#include <headers/guillaume/entities/app_bar.hpp>


Public Member Functions | |
| Builder (ecs::ComponentRegistry &componentRegistry, ecs::EntityRegistry &entityRegistry) | |
| Create a builder set to the defaults of reset(). | |
| std::shared_ptr< AppBar > | buildEntity (void) override |
| Build an app bar and its children from the current configuration, without registering it or setting its parent. | |
| void | reset (void) override |
| Restore the defaults. | |
| Builder & | withPose (const utility::graphic::PoseF &pose) |
| Set where the app bar is placed. | |
| Builder & | withVariant (Variant variant) |
| Set the variant. | |
| Builder & | withTitle (const std::string &title) |
| Set the title text. | |
| Builder & | withNavigationIcon (const std::string &iconGlyphName) |
| Set the icon of the leading navigation button. | |
| Builder & | addAction (const std::string &iconGlyphName) |
| Append a trailing action button without press handler. | |
| Builder & | addAction (const std::string &iconGlyphName, std::function< void(void)> onPress, const std::string &accessibilityLabel="") |
| Append a trailing action button with a press handler (Paper Appbar.Action). | |
| Builder & | withOnNavigation (std::function< void(void)> onPress, const std::string &accessibilityLabel="Navigate up") |
| Set the press handler of the navigation button (Paper Appbar.BackAction). | |
| Builder & | withElevated (bool elevated) |
| Choose the elevated look (Paper elevated). | |
| Builder & | withFixedWidth (float width) |
| Set the width of the app bar. | |
| std::shared_ptr< AppBar > | makeAppBar (std::shared_ptr< ecs::Entity > parent, Variant variant) |
| Build an app bar, register it under parent and reset the builder. | |
| Public Member Functions inherited from guillaume::entities::EntityBuilderBase< AppBar > | |
| EntityBuilderBase (ecs::ComponentRegistry &componentRegistry, ecs::EntityRegistry &entityRegistry) | |
| Construct a builder bound to two registries. | |
| ~EntityBuilderBase (void) override=default | |
| Default destructor. | |
| std::shared_ptr< AppBar > | 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. | |
Configures an AppBar, creates it and registers it in an entity registry.
Definition at line 106 of file app_bar.hpp.
| guillaume::entities::AppBar::Builder::Builder | ( | ecs::ComponentRegistry & | componentRegistry, |
| ecs::EntityRegistry & | entityRegistry ) |
Create a builder set to the defaults of reset().
| componentRegistry | The registry that stores the components of the app bars built. |
| entityRegistry | The registry the app bars are added to. |
Definition at line 36 of file app_bar.cpp.

| AppBar::Builder & guillaume::entities::AppBar::Builder::addAction | ( | const std::string & | iconGlyphName | ) |
Append a trailing action button without press handler.
The glyph name is also used as the accessible name.
| iconGlyphName | The glyph name of the icon. |
Definition at line 98 of file app_bar.cpp.
| AppBar::Builder & guillaume::entities::AppBar::Builder::addAction | ( | const std::string & | iconGlyphName, |
| std::function< void(void)> | onPress, | ||
| const std::string & | accessibilityLabel = "" ) |
Append a trailing action button with a press handler (Paper Appbar.Action).
| iconGlyphName | The glyph name of the icon. |
| onPress | Called when the user presses the button. |
| accessibilityLabel | The accessible name of the button; the glyph name is used when empty. |
Definition at line 105 of file app_bar.cpp.
|
overridevirtual |
Build an app bar and its children from the current configuration, without registering it or setting its parent.
Implements guillaume::entities::EntityBuilderBase< AppBar >.
Definition at line 43 of file app_bar.cpp.

| std::shared_ptr< AppBar > guillaume::entities::AppBar::Builder::makeAppBar | ( | std::shared_ptr< ecs::Entity > | parent, |
| Variant | variant ) |
Build an app bar, register it under parent and reset the builder.
Uses the title, navigation, actions and other options set on the builder so far.
| parent | The entity the app bar becomes a child of, or nullptr for a root entity. |
| variant | The variant of the app bar. |
Definition at line 139 of file app_bar.cpp.

|
overridevirtual |
Restore the defaults.
Defaults: Small variant, no title, no navigation icon, no action, not elevated, default pose, 360 dp wide.
Implements guillaume::ecs::EntityBuilder.
Definition at line 51 of file app_bar.cpp.

| AppBar::Builder & guillaume::entities::AppBar::Builder::withElevated | ( | bool | elevated | ) |
Choose the elevated look (Paper elevated).
| elevated | True for the level-2 elevation and its tinted surface color, false (the default) for a flat bar. |
Definition at line 125 of file app_bar.cpp.
| AppBar::Builder & guillaume::entities::AppBar::Builder::withFixedWidth | ( | float | width | ) |
Set the width of the app bar.
| width | The width, in dp. Default: 360. |
Definition at line 131 of file app_bar.cpp.
| AppBar::Builder & guillaume::entities::AppBar::Builder::withNavigationIcon | ( | const std::string & | iconGlyphName | ) |
Set the icon of the leading navigation button.
The glyph name also becomes the button's accessible name when none has been set with withOnNavigation().
| iconGlyphName | The glyph name of the icon, such as "menu". An empty name (the default) builds no navigation button. |
Definition at line 88 of file app_bar.cpp.
| AppBar::Builder & guillaume::entities::AppBar::Builder::withOnNavigation | ( | std::function< void(void)> | onPress, |
| const std::string & | accessibilityLabel = "Navigate up" ) |
Set the press handler of the navigation button (Paper Appbar.BackAction).
The button is built only when withNavigationIcon() gave it an icon.
| onPress | Called when the user presses the navigation button. |
| accessibilityLabel | The accessible name of the button. |
Definition at line 117 of file app_bar.cpp.
| AppBar::Builder & guillaume::entities::AppBar::Builder::withPose | ( | const utility::graphic::PoseF & | pose | ) |
Set where the app bar is placed.
| pose | The pose of the bar. Default: a default-constructed pose. |
Definition at line 69 of file app_bar.cpp.
| AppBar::Builder & guillaume::entities::AppBar::Builder::withTitle | ( | const std::string & | title | ) |
Set the title text.
| title | The title; an empty string (the default) builds no title child. |
Definition at line 81 of file app_bar.cpp.
| AppBar::Builder & guillaume::entities::AppBar::Builder::withVariant | ( | Variant | variant | ) |
Set the variant.
| variant | The variant; it sets the height and the title typescale role. Default: Small. |
Definition at line 75 of file app_bar.cpp.
