morph 0.1.0
Asynchronous bridge between GUI thread and business models
Loading...
Searching...
No Matches
morph::ui::author::Screen Class Reference

A screen definition: an id and the builder that writes the document. More...

#include <author.hpp>

Public Types

using Builder = std::function<Node(Scope&)>
 Declares on the screen's scope and returns the view.

Public Member Functions

 Screen (std::string screenId, Builder builder)
 A screen.
std::string const & id () const noexcept
 The document id.
std::expected< Emitted, Refusal > write () const
 Runs the builder and writes the document.

Detailed Description

A screen definition: an id and the builder that writes the document.

Definition at line 4509 of file author.hpp.

Member Typedef Documentation

◆ Builder

using morph::ui::author::Screen::Builder = std::function<Node(Scope&)>

Declares on the screen's scope and returns the view.

Definition at line 4512 of file author.hpp.

Constructor & Destructor Documentation

◆ Screen()

morph::ui::author::Screen::Screen ( std::string screenId,
Builder builder )
inline

A screen.

Parameters
screenIdThe document id.
builderThe builder.

Definition at line 4517 of file author.hpp.

Member Function Documentation

◆ id()

std::string const & morph::ui::author::Screen::id ( ) const
inlinenodiscardnoexcept

The document id.

Returns
The id.

Definition at line 4521 of file author.hpp.

◆ write()

std::expected< Emitted, Refusal > morph::ui::author::Screen::write ( ) const
inlinenodiscard

Runs the builder and writes the document.

Returns
The document, or a refusal at the root naming what the builder could not write.

Definition at line 4525 of file author.hpp.


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