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

Configures a Search, creates it and registers it in an entity registry. More...

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

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

Public Member Functions

 Builder (ecs::ComponentRegistry &componentRegistry, ecs::EntityRegistry &entityRegistry)
 Create a builder set to the defaults of reset().
std::shared_ptr< Search > buildEntity (void) override
 Build a search field 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 search field is placed.
Builder & withVariant (Variant variant)
 Set the variant.
Builder & withPlaceholder (const std::string &placeholder)
 Set the placeholder: the hint shown while the query is empty.
Builder & withText (const std::string &text)
 Set the initial query.
std::shared_ptr< Search > makeSearch (std::shared_ptr< ecs::Entity > parent, Variant variant, const std::string &placeholder, const std::string &text="")
 Build a search field, register it under parent and reset the builder.
Public Member Functions inherited from guillaume::entities::EntityBuilderBase< Search >
 EntityBuilderBase (ecs::ComponentRegistry &componentRegistry, ecs::EntityRegistry &entityRegistry)
 Construct a builder bound to two registries.
 ~EntityBuilderBase (void) override=default
 Default destructor.
std::shared_ptr< Search > 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 a Search, creates it and registers it in an entity registry.

Definition at line 111 of file search.hpp.

Constructor & Destructor Documentation

◆ Builder()

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

Create a builder set to the defaults of reset().

Parameters
componentRegistryThe registry that stores the components of the search fields built.
entityRegistryThe registry the search fields are added to.

Definition at line 37 of file search.cpp.

Here is the call graph for this function:

Member Function Documentation

◆ buildEntity()

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

Build a search field and its children from the current configuration, without registering it or setting its parent.

Returns
The new search field.

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

Definition at line 44 of file search.cpp.

Here is the call graph for this function:

◆ makeSearch()

std::shared_ptr< Search > guillaume::entities::Search::Builder::makeSearch ( std::shared_ptr< ecs::Entity > parent,
Variant variant,
const std::string & placeholder,
const std::string & text = "" )

Build a search field, register it under parent and reset the builder.

Parameters
parentThe entity the field becomes a child of, or nullptr for a root entity.
variantThe variant of the field.
placeholderThe hint shown while the query is empty.
textThe query the field starts with.
Returns
The new search field.

Definition at line 96 of file search.cpp.

Here is the call graph for this function:

◆ reset()

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

Restore the defaults.

Defaults: SearchBar variant, empty placeholder, empty query, default pose, 360 dp wide (components::Search::DefaultWidth), 56 dp high (components::Search::BarHeight).

Implements guillaume::ecs::EntityBuilder.

Definition at line 51 of file search.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ withPlaceholder()

Search::Builder & guillaume::entities::Search::Builder::withPlaceholder ( const std::string & placeholder)

Set the placeholder: the hint shown while the query is empty.

Parameters
placeholderThe placeholder text; it is also the accessible name of the field. Default: empty.
Returns
This builder, for chaining.

Definition at line 84 of file search.cpp.

◆ withPose()

Search::Builder & guillaume::entities::Search::Builder::withPose ( const utility::graphic::PoseF & pose)

Set where the search field is placed.

Parameters
poseThe pose of the field. Default: a default-constructed pose.
Returns
This builder, for chaining.

Definition at line 71 of file search.cpp.

◆ withText()

Search::Builder & guillaume::entities::Search::Builder::withText ( const std::string & text)

Set the initial query.

Parameters
textThe query the field starts with. Default: empty.
Returns
This builder, for chaining.

Definition at line 90 of file search.cpp.

◆ withVariant()

Search::Builder & guillaume::entities::Search::Builder::withVariant ( Variant variant)

Set the variant.

Parameters
variantSearchBar (the default) for the 56 dp pill, FullScreen for the 72 dp field with a divider.
Returns
This builder, for chaining.

Definition at line 77 of file search.cpp.

Here is the caller graph for this function:

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