|
morph 0.1.0
Asynchronous bridge between GUI thread and business models
|
A mounted screen: its scopes, its view mounted through Mounted, and what its host asks of it. More...
#include <interpreter.hpp>
Public Member Functions | |
| Screen (Screen const &)=delete | |
| Screen & | operator= (Screen const &)=delete |
| Screen (Screen &&)=delete | |
| Screen & | operator= (Screen &&)=delete |
| ~Screen () | |
| Runs onUnmount, then unmounts. | |
| Widget & | root () const |
| The root widget. | |
| std::string const & | id () const noexcept |
| The document's id. | |
| Value | read (Json const &expression) const |
| Evaluates an expression in the screen's scope: what a host reads (title, identity), and what a test inspects. | |
| Value | title () const |
| Evaluates the document's title. | |
| Value | identity () const |
| Evaluates the document's identity. | |
| Value | subtitle () const |
| Evaluates the document's subtitle, the head's line under the title. | |
| std::vector< HeadBadge > | status () const |
| The head's status badges that are visible now, in order. A tracked read. | |
| std::vector< HeadAction > | actions () const |
| The head's actions that are visible now, in order, each with whether it is enabled. A tracked read. | |
| bool | runAction (std::string_view actionId) |
| Runs a head action's onClick as a user event in the screen scope, in one batch. | |
| bool | dirty () const |
| Evaluates the document's dirty. | |
| bool | pending () const |
| Whether the screen has work a close waits for: an open dialog or drawer, a mutation run, or an upload or download in flight, in any of its scopes (spec 6 §3). A tracked read, so an Effect that reads it runs again when it changes. | |
| reactive::Runtime & | runtime () const noexcept |
| The reactive runtime the screen runs on. | |
| bool | requestClose () |
| Runs onClose, as the host does before it closes the screen. | |
| std::shared_ptr< bool const > | beginClose () |
| Runs onClose, and hands back the flag its cancelClose sets. | |
| bool | declares (std::string_view key) const |
| Whether the document declares a lifecycle command list. | |
| void | runLifecycle (std::string_view key) |
| Runs a lifecycle command list: onSave, onBackendChange, or any other the document declares. | |
| std::vector< Refusal > const & | diagnostics () const noexcept |
| The diagnostics reported so far, each path and reason once. | |
| bool | setPreference (std::string const &point, Value value) |
| Sets the user's choice at a customization point, as the preferences store loaded or the user made it. A choice that does not fit the point is ignored (spec 5 §12b). | |
| Document const & | document () const noexcept |
| The screen's document, whose customize block names the points a preferences store loads. | |
| BorrowedModel | lend (std::string_view alias) const |
| What an alias of this screen lends to a screen it opens that borrows it. | |
A mounted screen: its scopes, its view mounted through Mounted, and what its host asks of it.
Neither copyable nor movable. It belongs to the runtime's owner; the runtime, the session, the dispatcher and the backend outlive it. Destroying it runs onUnmount, unmounts the view and releases every scope.
Definition at line 2696 of file interpreter.hpp.
|
inline |
Runs onUnmount, then unmounts.
Definition at line 2704 of file interpreter.hpp.
|
inlinenodiscard |
The root widget.
Definition at line 2720 of file interpreter.hpp.
|
inlinenodiscardnoexcept |
Evaluates an expression in the screen's scope: what a host reads (title, identity), and what a test inspects.
| expression | The expression's JSON. |
Definition at line 2735 of file interpreter.hpp.
|
inlinenodiscard |
Evaluates the document's title.
Definition at line 2745 of file interpreter.hpp.
|
inlinenodiscard |
Evaluates the document's identity.
Definition at line 2749 of file interpreter.hpp.
|
inlinenodiscard |
Evaluates the document's subtitle, the head's line under the title.
Definition at line 2753 of file interpreter.hpp.
|
inlinenodiscard |
The head's status badges that are visible now, in order. A tracked read.
Definition at line 2757 of file interpreter.hpp.
|
inlinenodiscard |
The head's actions that are visible now, in order, each with whether it is enabled. A tracked read.
Definition at line 2770 of file interpreter.hpp.
|
inline |
Runs a head action's onClick as a user event in the screen scope, in one batch.
| actionId | The action's id. |
Definition at line 2788 of file interpreter.hpp.
|
inlinenodiscard |
Evaluates the document's dirty.
Definition at line 2808 of file interpreter.hpp.
|
inlinenodiscard |
Whether the screen has work a close waits for: an open dialog or drawer, a mutation run, or an upload or download in flight, in any of its scopes (spec 6 §3). A tracked read, so an Effect that reads it runs again when it changes.
Definition at line 2818 of file interpreter.hpp.
|
inlinenodiscardnoexcept |
The reactive runtime the screen runs on.
Definition at line 2822 of file interpreter.hpp.
|
inline |
Runs onClose, as the host does before it closes the screen.
Definition at line 2826 of file interpreter.hpp.
|
inlinenodiscard |
Runs onClose, and hands back the flag its cancelClose sets.
The flag is shared with every command list onClose starts, such as the onResult of a confirm dialog it opens, so it can still be set after this returns; a host reads it once the screen is no longer pending().
Definition at line 2836 of file interpreter.hpp.
|
inlinenodiscard |
Whether the document declares a lifecycle command list.
| key | The key: onClose, onSave, … |
Definition at line 2847 of file interpreter.hpp.
|
inline |
Runs a lifecycle command list: onSave, onBackendChange, or any other the document declares.
| key | The key. |
Definition at line 2851 of file interpreter.hpp.
|
inlinenodiscardnoexcept |
The diagnostics reported so far, each path and reason once.
Definition at line 2859 of file interpreter.hpp.
|
inline |
Sets the user's choice at a customization point, as the preferences store loaded or the user made it. A choice that does not fit the point is ignored (spec 5 §12b).
| point | The point. |
| value | The choice. |
Definition at line 2866 of file interpreter.hpp.
|
inlinenodiscardnoexcept |
The screen's document, whose customize block names the points a preferences store loads.
Definition at line 2879 of file interpreter.hpp.
|
inlinenodiscard |
What an alias of this screen lends to a screen it opens that borrows it.
| alias | The alias. |
Definition at line 7668 of file interpreter.hpp.