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

The app explorer, as a host screen (spec 6 §15): a splitter with the list — a search, the catalog's screens, and every model the catalog names with every action of it — and the chosen action's sections: its facts, its fields, the places that use it, and "Try it", the widget the framework builds for it, mounted live. More...

#include <explorer.hpp>

Inheritance diagram for morph::ui::Explorer:
morph::ui::ScreenHandle

Public Member Functions

 Explorer (reactive::Runtime &runtime, IViewBackend &backend, ContainerWidget &page, ExplorerOptions options)
 The explorer, appended to page.
 Explorer (Explorer const &)=delete
Explorer & operator= (Explorer const &)=delete
 Explorer (Explorer &&)=delete
Explorer & operator= (Explorer &&)=delete
 ~Explorer () override
 Unmounts the "Try it" screen first, then the widgets it sits in.
reactive::Computed< std::string > const & title () const override
 The title.
reactive::Computed< bool > const & dirty () const override
 Never dirty.
reactive::Computed< Value > const & identity () const override
 No identity: one explorer per workspace.
void requestClose (std::function< void(bool closed)> done) override
 Closes when asked.
void forceClose () override
 Closes the "Try it" screen.
bool select (std::string const &actionId)
 Shows an action's sections, as choosing it in the list does.
std::string const & selected () const noexcept
 The action shown.
Public Member Functions inherited from morph::ui::ScreenHandle
 ScreenHandle (ScreenHandle const &)=delete
ScreenHandle & operator= (ScreenHandle const &)=delete
 ScreenHandle (ScreenHandle &&)=delete
ScreenHandle & operator= (ScreenHandle &&)=delete
virtual ScreenHead * head () noexcept
 The screen's head beside its title, for a shell to show above it.
virtual bool canSave () const
 Whether the screen can save its changes: a document screen that declares onSave, or a host screen whose handle implements save. A close guard offers save and close only when this is true.
virtual void save (std::function< void(bool clean)> done)
 Saves the screen's changes (spec 6 §15) and answers whether it is then clean.

Detailed Description

The app explorer, as a host screen (spec 6 §15): a splitter with the list — a search, the catalog's screens, and every model the catalog names with every action of it — and the chosen action's sections: its facts, its fields, the places that use it, and "Try it", the widget the framework builds for it, mounted live.

Built from backend widgets, so every frontend shows it. Its title is "Explorer"; it is never dirty, and closes when asked. Neither copyable nor movable; owned by the owner thread of its backend.

Test ids: explorer, explorer_search, explorer_screen_<id>, explorer_model_<type>, explorer_action_<id>, explorer_title, explorer_facts, explorer_fields, explorer_uses, explorer_open_<n>, explorer_tryit, explorer_tryit_status, explorer_schema, and inside "Try it" the generated document's own (tryit, …).

Definition at line 432 of file explorer.hpp.

Constructor & Destructor Documentation

◆ Explorer()

morph::ui::Explorer::Explorer ( reactive::Runtime & runtime,
IViewBackend & backend,
ContainerWidget & page,
ExplorerOptions options )
inline

The explorer, appended to page.

Parameters
runtimeThe reactive runtime its title is computed in. Borrowed.
backendThe backend its widgets are made with. Borrowed.
pageThe container it is appended to; it outlives the explorer.
optionsWhat it shows and reports.

Definition at line 439 of file explorer.hpp.

◆ ~Explorer()

morph::ui::Explorer::~Explorer ( )
inlineoverride

Unmounts the "Try it" screen first, then the widgets it sits in.

Definition at line 481 of file explorer.hpp.

Member Function Documentation

◆ title()

reactive::Computed< std::string > const & morph::ui::Explorer::title ( ) const
inlinenodiscardoverridevirtual

The title.

Returns
"Explorer".

Implements morph::ui::ScreenHandle.

Definition at line 485 of file explorer.hpp.

◆ dirty()

reactive::Computed< bool > const & morph::ui::Explorer::dirty ( ) const
inlinenodiscardoverridevirtual

Never dirty.

Returns
false.

Implements morph::ui::ScreenHandle.

Definition at line 489 of file explorer.hpp.

◆ identity()

reactive::Computed< Value > const & morph::ui::Explorer::identity ( ) const
inlinenodiscardoverridevirtual

No identity: one explorer per workspace.

Returns
null.

Implements morph::ui::ScreenHandle.

Definition at line 493 of file explorer.hpp.

◆ requestClose()

void morph::ui::Explorer::requestClose ( std::function< void(bool closed)> done)
inlineoverridevirtual

Closes when asked.

Parameters
doneCalled with true.

Implements morph::ui::ScreenHandle.

Definition at line 497 of file explorer.hpp.

◆ forceClose()

void morph::ui::Explorer::forceClose ( )
inlineoverridevirtual

Closes the "Try it" screen.

Implements morph::ui::ScreenHandle.

Definition at line 505 of file explorer.hpp.

◆ select()

bool morph::ui::Explorer::select ( std::string const & actionId)
inline

Shows an action's sections, as choosing it in the list does.

Parameters
actionIdThe action id.
Returns
Whether a listed model has the action.

Definition at line 510 of file explorer.hpp.

◆ selected()

std::string const & morph::ui::Explorer::selected ( ) const
inlinenodiscardnoexcept

The action shown.

Returns
Its id; empty with none.

Definition at line 522 of file explorer.hpp.


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