|
| | DocumentScreenHost (Session &session, Dispatcher &dispatcher, DocumentScreenHostOptions options) |
| | A host over session and dispatcher.
|
| std::expected< std::unique_ptr< ScreenHandle >, MountError > | mount (std::string_view screenId, ParamMap params) override |
| | Mounts a document screen.
|
| std::expected< std::unique_ptr< ScreenHandle >, MountError > | mountInto (std::string_view screenId, ParamMap const ¶ms, ContainerWidget &parent) |
| | Mounts a screen as mount does, with its root widget appended to parent instead of made a backend root: how a shell puts a screen in its own container, such as a tab's page.
|
| std::optional< std::string > | identityOf (std::string_view screenId, ParamMap const ¶ms) override |
| | The identity a document screen would have with params: its identity evaluated over the params.
|
| void | prefetch (std::string_view screenId, ParamMap const ¶ms) |
| | Starts the requests of a screen's prefetch queries before it mounts (spec 5 §5), so the screen mounts on a warm cache: what a shell does when the pointer rests on an entry for a screen that is not open.
|
| std::expected< std::string, std::string > | routeOf (std::string_view screenId, ParamMap const ¶ms) const |
| | The route of a screen instance (spec 6 §20): routeOf over the screen's declared params.
|
| std::expected< Route, std::string > | parseRoute (std::string_view route) const |
| | Reads a route back against the screen it names (parseRoute over this host's documents).
|
| virtual void | onNavigate (NavigateRequest const &request) |
| | A document asked to open another screen, with how (as). The default hands the screen and its params to onNavigate(screenId, params); a host that shows dialogs, drawers or windows overrides this one.
|
| virtual void | onScreenClosed (ScreenHandle &screen) |
| | A screen this host mounted closed itself, by return or close: self (spec 6 §16). Called after the screen is closed, posted to the owner; the host drops its tab or dialog. The default does nothing.
|
| std::expected< void, MountError > | remount (ScreenHandle &handle, std::shared_ptr< Document const > document) |
| | Mounts a screen this host mounted again, on a changed document (spec 5 §12, development reload).
|
| virtual void | onNavigate (std::string_view screenId, ParamMap const ¶ms)=0 |
| | A document asked to open another screen. The host decides whether that is a new tab, a focus or a dialog. Implemented by the host.
|
|
| ScreenHost (ScreenHost const &)=delete |
|
ScreenHost & | operator= (ScreenHost const &)=delete |
|
| ScreenHost (ScreenHost &&)=delete |
|
ScreenHost & | operator= (ScreenHost &&)=delete |
The framework's ScreenHost over UI documents: it mounts them through an Interpreter, closes them by the protocol of spec 6 §3, and hands a document's navigate to onNavigate, which the deriving host implements.
It is the interpreter's InterpreterHost for navigate; every other command goes to the application's host, if one was given. Everything runs on the runtime's owner.
Definition at line 344 of file host.hpp.
| void morph::ui::DocumentScreenHost::prefetch |
( |
std::string_view | screenId, |
|
|
ParamMap const & | params ) |
|
inline |
Starts the requests of a screen's prefetch queries before it mounts (spec 5 §5), so the screen mounts on a warm cache: what a shell does when the pointer rests on an entry for a screen that is not open.
Each named query's body is evaluated over params alone and its entry warmed through the session's cache, under the token the mounted screen's alias will have. A keyed alias's token follows from its key, and a stateless model's is shared. A private alias gets a fresh token when the screen mounts, so nothing could read what a prefetch warmed: its queries are skipped, as are evaluations, a key or body that reads more than the params, and an entry that is already fresh or in flight.
- Parameters
-
| screenId | The screen id; an unknown one does nothing. |
| params | The params it would mount with. |
Definition at line 412 of file host.hpp.
Mounts a screen this host mounted again, on a changed document (spec 5 §12, development reload).
The new screen is mounted with the same params in the same place, and each state of its own scope starts from the old screen's value of the state of the same name and type; any other state starts from its init. The old screen is then destroyed, which runs its onUnmount, and the handle shows the new one: its title, dirty and identity follow it, and a pending call stays tied to it. A refused mount keeps the old screen.
- Parameters
-
| handle | A handle this host mounted. |
| document | The changed document of the same screen, loaded. |
- Returns
- Nothing, or why the old screen was kept: a foreign or closed handle, a close or save in progress, or the interpreter's refusal of the new document.
Definition at line 486 of file host.hpp.