morph 0.1.0
Asynchronous bridge between GUI thread and business models
Loading...
Searching...
No Matches
author_forms.hpp File Reference
#include <string>
#include <tuple>
#include "../forms/flows.hpp"
#include "../forms/views.hpp"
#include "author.hpp"

Go to the source code of this file.

Concepts

concept  morph::ui::author::ViewDescriptor
 A view descriptor: a views:: kind and the registered query action it lists.
concept  morph::ui::author::WizardDescriptor
 A flows::Wizard: a title and its steps.

Typedefs

template<WizardDescriptor W>
using morph::ui::author::FirstStepAction = std::tuple_element_t<0, typename W::steps>::action
 The action of a wizard's first step, which names the wizard in a document.

Functions

template<ViewDescriptor View, typename Model>
requires Runs<Model, typename View::query>
Node morph::ui::author::collection (ModelHandle< Model > const &model, FormPresentation const &presentation={})
 A collection node over a view descriptor: the node names the view's query action, and the view's document travels with the node's catalog facts.
template<WizardDescriptor Wizard, typename Model>
requires Runs<Model, FirstStepAction<Wizard>>
Node morph::ui::author::wizard (ModelHandle< Model > const &model, FormPresentation const &presentation={})
 A wizard node over a flows::Wizard: the node names the first step's action, and the wizard's document travels with the node's catalog facts.

Detailed Description

The collection and wizard builders that carry their forms documents (spec 5 §11): a view descriptor's v-* document and a wizard's w-* document go into the node's catalog facts, so the bundle serves them with the ui-catalog reply and a client builds the node without knowing the types. Separate from author.hpp so the builders that need no forms documents do not pull in the forms headers.

Definition in file author_forms.hpp.

Typedef Documentation

◆ FirstStepAction

template<WizardDescriptor W>
using morph::ui::author::FirstStepAction = std::tuple_element_t<0, typename W::steps>::action

The action of a wizard's first step, which names the wizard in a document.

Template Parameters
WThe wizard.

Definition at line 36 of file author_forms.hpp.

Function Documentation

◆ collection()

template<ViewDescriptor View, typename Model>
requires Runs<Model, typename View::query>
Node morph::ui::author::collection ( ModelHandle< Model > const & model,
FormPresentation const & presentation = {} )
nodiscard

A collection node over a view descriptor: the node names the view's query action, and the view's document travels with the node's catalog facts.

Template Parameters
ViewThe view descriptor.
ModelThe model type of the alias; it must run the view's query.
Parameters
modelThe alias.
presentationThe keys that reach every form the view draws; its title replaces the view's heading.
Returns
The node.

Definition at line 47 of file author_forms.hpp.

◆ wizard()

template<WizardDescriptor Wizard, typename Model>
requires Runs<Model, FirstStepAction<Wizard>>
Node morph::ui::author::wizard ( ModelHandle< Model > const & model,
FormPresentation const & presentation = {} )
nodiscard

A wizard node over a flows::Wizard: the node names the first step's action, and the wizard's document travels with the node's catalog facts.

Template Parameters
WizardThe wizard.
ModelThe model type of the alias; it must run the first step.
Parameters
modelThe alias.
presentationThe keys that reach every step's form; its title replaces the view's heading.
Returns
The node.

Definition at line 68 of file author_forms.hpp.