25#ifndef _NOTIFICATION_MANAGER_H__
26#define _NOTIFICATION_MANAGER_H__
30#include "observable_evtvar.h"
31#include "comm_appmsg.h"
38 std::shared_ptr<Notification> _notification)
39 :
AppMsg(AppMsg::Type::CustomMsg),
41 notification(_notification) {};
45 const std::string action_verb;
46 std::shared_ptr<Notification> notification;
57 std::string AddNotification(std::shared_ptr<Notification> _notification);
66 std::string AddNotification(NotificationSeverity _severity,
67 const std::string& _message,
68 int timeout_secs = -1);
76 bool AcknowledgeAllNotifications();
83 return active_notifications;
86 size_t GetNotificationCount()
const {
return active_notifications.size(); }
87 void ScrubNotificationDirectory(
int days_to_retain);
94 void PersistNotificationAsFile(
95 const std::shared_ptr<Notification> _notification);
97 void OnTimer(wxTimerEvent& event);
99 std::vector<std::shared_ptr<Notification>> active_notifications;
100 wxTimer m_timeout_timer;
Generic event handling between MVC Model and Controller based on a shared EventVar variable.
The global list of user notifications, a singleton.
const std::vector< std::shared_ptr< Notification > > & GetNotifications() const
Return current active notifications.
bool AcknowledgeNotification(const std::string &guid)
User ack on a notification which eventually will remove it.
EventVar evt_notificationlist_change
Notified without data when a notification is added or removed.
NotificationSeverity GetMaxSeverity()
Return max severity among current active notifications.