The reactive state of one wizard: its steps' sessions, the position, and what each step resolved.
More...
|
| | WizardSession (reactive::Runtime &runtime, WizardModel model, SchemaLookup const &schemas, Submitter submit, ChoiceFetcher const &choices, FormSessionOptions const &options={}) |
|
| WizardSession (WizardSession const &)=delete |
|
WizardSession & | operator= (WizardSession const &)=delete |
|
| WizardSession (WizardSession &&)=delete |
|
WizardSession & | operator= (WizardSession &&)=delete |
| WizardModel const & | model () const noexcept |
| | The wizard model.
|
| std::size_t | current () const |
| | The current step. Tracked.
|
| std::size_t | stepCount () const noexcept |
| | How many steps there are.
|
| FormSession & | step (std::size_t index) const |
| | A step's form session.
|
| bool | stepDone (std::size_t index) const |
| | Whether a step is done: its current body is the one whose submission last succeeded. Tracked.
|
| bool | canBack () const |
| | Whether Back is possible. Tracked.
|
| bool | canNext () const |
| | Whether Next is possible. Tracked.
|
| bool | onLastStep () const |
| | Whether the current step is the last. Tracked.
|
| void | next () |
| | Moves on: at once from a done step; from a ready step after submitting its body and that submission succeeding. Does nothing while canNext() is false.
|
| void | back () |
| | Returns to the previous step, its values as they were; nothing is submitted.
|
| std::optional< std::string > | resolved (std::string_view path) const |
| | A value an earlier successful submission resolved: its body's member, or its reply's, the reply winning when both have one. Not tracked.
|
| std::string | title () const |
| | The wizard's title, resolved through the translations (<id>.title).
|
| std::string | stepTitle (std::size_t index) const |
| | A step's title, resolved through the translations (<id>.step.<index>.title).
|
The reactive state of one wizard: its steps' sessions, the position, and what each step resolved.
A step is done while its current body is the one whose submission last succeeded: editing a done step makes it not done until that body succeeds. Next moves on from a done step without submitting; from a step that is ready but not done it submits and moves on once that submission succeeds. Back always returns, keeping every step's values. Entering a step applies its prefill from the resolved values as JSON values (programmatic, so it submits nothing by itself); a step left ready and not done by its prefill submits once in automatic mode.
Non-copyable and non-movable: the steps' submitters point into it. Destroy a view of it before the session.
Definition at line 140 of file wizard.hpp.