|
morph 0.1.0
Asynchronous bridge between GUI thread and business models
|
Keeps the route of the screen a shell shows in a history, and opens the route of an entry the user moves to (spec 3 §10). More...
#include <route_history.hpp>
Public Member Functions | |
| RouteHistory (IHistory &history, std::function< void(std::string const &route)> open) | |
A history over history, which it keeps and follows from now on. | |
| RouteHistory (RouteHistory const &)=delete | |
| RouteHistory & | operator= (RouteHistory const &)=delete |
| RouteHistory (RouteHistory &&)=delete | |
| RouteHistory & | operator= (RouteHistory &&)=delete |
| std::string const & | initial () const noexcept |
| The route the history held when this was made: a reloaded page's, or a shared link's. | |
| void | shown (std::string const &route) |
The shell now shows a screen whose route is route. | |
Keeps the route of the screen a shell shows in a history, and opens the route of an entry the user moves to (spec 3 §10).
The shell opens initial() first, when it can, and calls shown after it mounts each screen. The first shown replaces the entry the history started on, so opening the first screen does not add a step back to an empty page; each later call adds an entry, unless the route is already the current entry's. Moving back or forward calls open, which shows the route's screen, or the start screen when the route cannot be opened, before it returns. The first screen it shows replaces the entry instead of adding one, so a refused route is not left in the history; a screen shown after that, such as a redirect, adds an entry as it would anywhere else.
Definition at line 72 of file route_history.hpp.
|
inline |
A history over history, which it keeps and follows from now on.
| history | The history. Borrowed: it outlives this. |
| open | Shows the screen of a route the user moved to, calling shown before it returns. It may destroy this. |
Definition at line 78 of file route_history.hpp.
|
inlinenodiscardnoexcept |
The route the history held when this was made: a reloaded page's, or a shared link's.
Definition at line 111 of file route_history.hpp.
|
inline |
The shell now shows a screen whose route is route.
| route | The route; empty, for a screen with none, leaves the history as it is, so after a move back or forward the next screen with a route replaces the moved-to entry. |
Definition at line 116 of file route_history.hpp.