OpenCPN Partial API docs
|
The global list of user notifications, a singleton. More...
#include <notification_manager.h>
Public Member Functions | |
NotificationManager (const NotificationManager &)=delete | |
NotificationManager & | operator= (const NotificationManager &)=delete |
std::string | AddNotification (std::shared_ptr< Notification > _notification) |
std::string | AddNotification (NotificationSeverity _severity, const std::string &_message, int timeout_secs=-1) |
Add a new notification. | |
bool | AcknowledgeNotification (const std::string &guid) |
User ack on a notification which eventually will remove it. | |
bool | AcknowledgeAllNotifications () |
NotificationSeverity | GetMaxSeverity () |
Return max severity among current active notifications. | |
const std::vector< std::shared_ptr< Notification > > & | GetNotifications () const |
Return current active notifications. | |
size_t | GetNotificationCount () const |
void | ScrubNotificationDirectory (int days_to_retain) |
Static Public Member Functions | |
static NotificationManager & | GetInstance () |
Public Attributes | |
EventVar | evt_notificationlist_change |
Notified without data when a notification is added or removed. | |
The global list of user notifications, a singleton.
Definition at line 50 of file notification_manager.h.
bool NotificationManager::AcknowledgeAllNotifications | ( | ) |
Definition at line 193 of file notification_manager.cpp.
bool NotificationManager::AcknowledgeNotification | ( | const std::string & | guid | ) |
User ack on a notification which eventually will remove it.
guid | Guid obtained from AddNotification() or GetUUID(). |
Definition at line 150 of file notification_manager.cpp.
std::string NotificationManager::AddNotification | ( | NotificationSeverity | _severity, |
const std::string & | _message, | ||
int | timeout_secs = -1 |
||
) |
Add a new notification.
severity | Notification type. |
message | string, possibly multiline. @oaram timeout_secs If given, the notifications is automatically removed after timeout_secs seconds if still existing. |
Definition at line 142 of file notification_manager.cpp.
std::string NotificationManager::AddNotification | ( | std::shared_ptr< Notification > | _notification | ) |
Definition at line 129 of file notification_manager.cpp.
|
static |
Definition at line 43 of file notification_manager.cpp.
NotificationSeverity NotificationManager::GetMaxSeverity | ( | ) |
Return max severity among current active notifications.
Definition at line 120 of file notification_manager.cpp.
|
inline |
Definition at line 86 of file notification_manager.h.
|
inline |
Return current active notifications.
Definition at line 82 of file notification_manager.h.
void NotificationManager::ScrubNotificationDirectory | ( | int | days_to_retain | ) |
Definition at line 69 of file notification_manager.cpp.
EventVar NotificationManager::evt_notificationlist_change |
Notified without data when a notification is added or removed.
Definition at line 90 of file notification_manager.h.