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

A history of routes: a browser's session history, or a test's. More...

#include <route_history.hpp>

Inheritance diagram for morph::ui::IHistory:
morph::ui::testing::MemoryHistory

Public Member Functions

 IHistory (IHistory const &)=delete
IHistory & operator= (IHistory const &)=delete
 IHistory (IHistory &&)=delete
IHistory & operator= (IHistory &&)=delete
virtual std::string current () const =0
 The route the current entry holds.
virtual void push (std::string const &route)=0
 Adds an entry after the current one, dropping any entries forward of it, and makes it current.
virtual void replace (std::string const &route)=0
 Replaces the route the current entry holds.
virtual void onPop (std::function< void(std::string const &route)> popped)=0
 Sets what is called when the current entry changes from outside: back, forward, or an address the user edited. Replaces the previous callback; an empty one stops the calls.

Detailed Description

A history of routes: a browser's session history, or a test's.

Definition at line 19 of file route_history.hpp.

Member Function Documentation

◆ current()

virtual std::string morph::ui::IHistory::current ( ) const
nodiscardpure virtual

The route the current entry holds.

Returns
It, or empty when the entry holds none.

Implemented in morph::ui::testing::MemoryHistory.

◆ push()

virtual void morph::ui::IHistory::push ( std::string const & route)
pure virtual

Adds an entry after the current one, dropping any entries forward of it, and makes it current.

Parameters
routeThe route it holds.

Implemented in morph::ui::testing::MemoryHistory.

◆ replace()

virtual void morph::ui::IHistory::replace ( std::string const & route)
pure virtual

Replaces the route the current entry holds.

Parameters
routeThe route.

Implemented in morph::ui::testing::MemoryHistory.

◆ onPop()

virtual void morph::ui::IHistory::onPop ( std::function< void(std::string const &route)> popped)
pure virtual

Sets what is called when the current entry changes from outside: back, forward, or an address the user edited. Replaces the previous callback; an empty one stops the calls.

Parameters
poppedCalled with the new current entry's route, empty when it holds none.

Implemented in morph::ui::testing::MemoryHistory.


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