morph 0.1.0
Asynchronous bridge between GUI thread and business models
Loading...
Searching...
No Matches
morph::ui::ScreenHost Class Referenceabstract

What mounts screens for a host that owns its own shell; the workspace shell is one. More...

#include <host.hpp>

Inheritance diagram for morph::ui::ScreenHost:
morph::ui::DocumentScreenHost

Public Member Functions

 ScreenHost (ScreenHost const &)=delete
ScreenHost & operator= (ScreenHost const &)=delete
 ScreenHost (ScreenHost &&)=delete
ScreenHost & operator= (ScreenHost &&)=delete
virtual std::expected< std::unique_ptr< ScreenHandle >, MountError > mount (std::string_view screenId, ParamMap params)=0
 Mounts a screen.
virtual std::optional< std::string > identityOf (std::string_view screenId, ParamMap const &params)=0
 The identity a screen would have with params, without mounting it, so a host can focus an open screen instead of opening a second.
virtual void onNavigate (std::string_view screenId, ParamMap const &params)=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.

Detailed Description

What mounts screens for a host that owns its own shell; the workspace shell is one.

Definition at line 141 of file host.hpp.

Member Function Documentation

◆ mount()

virtual std::expected< std::unique_ptr< ScreenHandle >, MountError > morph::ui::ScreenHost::mount ( std::string_view screenId,
ParamMap params )
nodiscardpure virtual

Mounts a screen.

Parameters
screenIdThe screen id.
paramsIts params.
Returns
Its handle, or why it could not be mounted.

Implemented in morph::ui::DocumentScreenHost.

◆ identityOf()

virtual std::optional< std::string > morph::ui::ScreenHost::identityOf ( std::string_view screenId,
ParamMap const & params )
nodiscardpure virtual

The identity a screen would have with params, without mounting it, so a host can focus an open screen instead of opening a second.

Parameters
screenIdThe screen id.
paramsThe params.
Returns
Its canonical text, or std::nullopt for a screen that declares none or whose identity reads more than its params.

Implemented in morph::ui::DocumentScreenHost.

◆ onNavigate()

virtual void morph::ui::ScreenHost::onNavigate ( std::string_view screenId,
ParamMap const & params )
pure virtual

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.

Parameters
screenIdThe screen id.
paramsIts params.

Implemented in morph::ui::DocumentScreenHost.


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