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. | |
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 |
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 33 of file notification_manager.h.
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 85 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 75 of file notification_manager.cpp.
std::string NotificationManager::AddNotification | ( | std::shared_ptr< Notification > | _notification | ) |
Definition at line 68 of file notification_manager.cpp.
|
static |
Definition at line 33 of file notification_manager.cpp.
NotificationSeverity NotificationManager::GetMaxSeverity | ( | ) |
Return max severity among current active notifications.
Definition at line 59 of file notification_manager.cpp.
|
inline |
Definition at line 67 of file notification_manager.h.
|
inline |
Return current active notifications.
Definition at line 63 of file notification_manager.h.
EventVar NotificationManager::evt_notificationlist_change |
Notified without data when a notification is added or removed.
Definition at line 70 of file notification_manager.h.