Lumiera 0.pre.04
»edit your freedom«
Loading...
Searching...
No Matches
NotificationHub Class Reference

#include "stage/ctrl/notification-hub.hpp"

Description

Service to receive and display error, warning and notification messages.

These are sent over the UI-Bus through the NotificationService; after receiving such a message, this controller ensures to display the message and alert the user, while not blocking the overall UI.

Definition at line 79 of file notification-hub.hpp.

Public Types

using WidgetAllocator = std::function< widget::ErrorLogDisplay &(void)>
 
- Public Types inherited from Tangible
using ID = ctrl::BusTerm::ID
 
using LuidH = lib::hash::LuidH
 

Public Member Functions

 NotificationHub (ID identity, ctrl::BusTerm &nexus, WidgetAllocator wa)
 
 ~NotificationHub ()
 
- Public Member Functions inherited from Controller
 Tangible (ID identity, ctrl::BusTerm &nexus)
 
- Public Member Functions inherited from Tangible
virtual ~Tangible ()
 this is an interface
 
 operator string () const
 diagnostic representation.
 
 operator LuidH () const
 
ID getID () const
 
void reset ()
 invoke the generic reset hook
 
void clearMsg ()
 invoke the hook to clear notification messages
 
void clearErr ()
 invoke the hook to clear error markers
 
template<typename... ARGS>
void invoke (Symbol cmdID, ARGS &&...)
 
void invoke (Symbol cmdID, Rec &&arguments)
 Perform a command or action, once the execution context has been established.
 
void slotExpand ()
 Expand this element and remember the expanded state.
 
void slotCollapse ()
 Collapse or minimise this element and remember the collapsed state.
 
void slotReveal ()
 Cause the element to be brought into sight.
 
void markFlash ()
 highlight the element visually to catch the user's attention
 
void markMsg (string message)
 push a notification (or warning) message to the element.
 
void markErr (string error)
 push an error state tag to the element
 
void mark (GenNode const &)
 generic handler for all incoming "state mark" messages
 
void installExpander (Expander::ProbeFun, Expander::ChangeFun)
 Configure the (optional) functionality to expand or collapse the UI-Element.
 
void installRevealer (Revealer::RevealeItFun)
 Configure the (optional) functionality to bring the UI-Element into sight.
 
template<typename... ARGS>
void invoke (Symbol cmdID, ARGS &&... args)
 convenience shortcut to issue a command with several arguments
 
- Public Member Functions inherited from DiffMutable
virtual ~DiffMutable ()
 this is an interface
 

Private Member Functions

void buildMutator (lib::diff::TreeMutator::Handle buffer) override
 population and manipulation of persistent content via UI-Bus
 
virtual bool doReset () override
 
virtual bool doMsg (string text) override
 
virtual bool doClearMsg () override
 
virtual bool doErr (string text) override
 
virtual bool doClearErr () override
 
virtual void doMark (GenNode const &stateMark) override
 adds special treatment for a state mark tagged as "Warning"
 
virtual void doFlash () override
 
widget::ErrorLogDisplaygetWidget ()
 

Private Attributes

WidgetAllocator allocateWidget_
 external operation to find or allocate an log display widget
 
WLink< widget::ErrorLogDisplaywidget_
 collaboration with a log display allocated elsewhere
 

Additional Inherited Members

- Protected Types inherited from Tangible
using Rec = lib::diff::Rec
 
using GenNode = lib::diff::GenNode
 
- Protected Member Functions inherited from Tangible
 Tangible (ID identity, ctrl::BusTerm &nexus)
 
virtual bool doExpand (bool yes)
 generic default implementation of the expand/collapse functionality.
 
virtual void doReveal ()
 generic default implementation of the "reveal" functionality.
 
- Protected Attributes inherited from Tangible
ctrl::BusTerm uiBus_
 
Expander expand_
 
Revealer reveal_
 

Constructor & Destructor Documentation

◆ NotificationHub()

NotificationHub ( ID  identity,
ctrl::BusTerm nexus,
WidgetAllocator  wa 
)
inline

Definition at line 161 of file notification-hub.hpp.

References ErrorLogDisplay::expand, NotificationHub::getWidget(), Tangible::installExpander(), Tangible::installRevealer(), ErrorLogDisplay::reveal, and NotificationHub::widget_.

+ Here is the call graph for this function:

◆ ~NotificationHub()

~NotificationHub ( )
inline

Definition at line 176 of file notification-hub.hpp.

Member Typedef Documentation

◆ WidgetAllocator

using WidgetAllocator = std::function<widget::ErrorLogDisplay&(void)>

Definition at line 158 of file notification-hub.hpp.

Member Function Documentation

◆ buildMutator()

void buildMutator ( lib::diff::TreeMutator::Handle  buffer)
inlineoverrideprivatevirtual

population and manipulation of persistent content via UI-Bus

Implements Tangible.

Definition at line 86 of file notification-hub.hpp.

References TreeMutator::build(), and PlantingHandle< BA, DEFAULT >::emplace().

+ Here is the call graph for this function:

◆ doReset()

virtual bool doReset ( )
inlineoverrideprivatevirtual

Reimplemented from Controller.

Definition at line 98 of file notification-hub.hpp.

References NotificationHub::widget_.

◆ doMsg()

virtual bool doMsg ( string  text)
inlineoverrideprivatevirtual

Reimplemented from Controller.

Definition at line 108 of file notification-hub.hpp.

References ErrorLogDisplay::addInfo(), and NotificationHub::getWidget().

+ Here is the call graph for this function:

◆ doClearMsg()

virtual bool doClearMsg ( )
inlineoverrideprivatevirtual

Reimplemented from Controller.

Definition at line 115 of file notification-hub.hpp.

References NotificationHub::widget_.

◆ doErr()

virtual bool doErr ( string  text)
inlineoverrideprivatevirtual

Reimplemented from Controller.

Definition at line 123 of file notification-hub.hpp.

References ErrorLogDisplay::addError(), and NotificationHub::getWidget().

+ Here is the call graph for this function:

◆ doClearErr()

virtual bool doClearErr ( )
inlineoverrideprivatevirtual

Reimplemented from Controller.

Definition at line 130 of file notification-hub.hpp.

References NotificationHub::widget_.

◆ doMark()

virtual void doMark ( GenNode const &  stateMark)
inlineoverrideprivatevirtual

adds special treatment for a state mark tagged as "Warning"

Reimplemented from Controller.

Definition at line 139 of file notification-hub.hpp.

References ErrorLogDisplay::addWarn(), GenNode::data, DataCap::get(), BareEntryID::getSym(), NotificationHub::getWidget(), GenNode::idi, and stage::MARK_Warning.

+ Here is the call graph for this function:

◆ doFlash()

virtual void doFlash ( )
inlineoverrideprivatevirtual

Reimplemented from Controller.

Definition at line 149 of file notification-hub.hpp.

References NotificationHub::widget_.

◆ getWidget()

widget::ErrorLogDisplay & getWidget ( )
inlineprivate

Definition at line 188 of file notification-hub.hpp.

References NotificationHub::allocateWidget_, and NotificationHub::widget_.

Referenced by NotificationHub::NotificationHub(), NotificationHub::doErr(), NotificationHub::doMark(), and NotificationHub::doMsg().

+ Here is the caller graph for this function:

Member Data Documentation

◆ allocateWidget_

WidgetAllocator allocateWidget_
private

external operation to find or allocate an log display widget

Definition at line 181 of file notification-hub.hpp.

Referenced by NotificationHub::getWidget().

◆ widget_

+ Inheritance diagram for NotificationHub:
+ Collaboration diagram for NotificationHub:

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