#include <notificationmanager.h>
List of all members.
Public Slots |
uint | addNotification (uint notificationUserId, const NotificationParameters ¶meters=NotificationParameters(), uint groupId=0) |
|
|
bool | updateNotification (uint notificationUserId, uint notificationId, const NotificationParameters ¶meters=NotificationParameters()) |
bool | removeNotification (uint notificationUserId, uint notificationId) |
uint | addGroup (uint notificationUserId, const NotificationParameters ¶meters=NotificationParameters()) |
bool | updateGroup (uint notificationUserId, uint groupId, const NotificationParameters ¶meters=NotificationParameters()) |
bool | removeGroup (uint notificationUserId, uint groupId) |
uint | notificationUserId () |
QList< uint > | notificationIdList (uint notificationUserId) |
QList< Notification > | notificationList (uint notificationUserId) |
QList< Notification > | notificationListWithIdentifiers (uint notificationUserId) |
QList< NotificationGroup > | notificationGroupList (uint notificationUserId) |
QList< NotificationGroup > | notificationGroupListWithIdentifiers (uint notificationUserId) |
uint | notificationCountInGroup (uint notificationUserId, uint groupId) |
bool | removeNotification (uint notificationId) |
|
|
bool | removeNotificationsInGroup (uint groupId) |
void | removeNotificationsAndGroupsWithEventType (const QString &eventType) |
void | updateNotificationsWithEventType (const QString &eventType) |
| Update event type data of all notifications with the specified event type.
|
Signals |
void | notificationUpdated (const Notification ¬ification) |
void | notificationRemoved (uint notificationId) |
void | groupUpdated (uint groupId, const NotificationParameters ¶meters) |
void | groupRemoved (uint groupId) |
void | notificationRestored (const Notification ¬ification) |
void | queuedGroupRemove (uint groupId) |
void | queuedNotificationRemove (uint notificationId) |
Public Member Functions |
| NotificationManager (int relayInterval=3000, uint maxWaitQueueSize=100) |
virtual | ~NotificationManager () |
void | initializeStore () |
void | restoreData () |
QList< Notification > | notifications () const |
| REIMPLEMENTATION
|
QList< NotificationGroup > | groups () const |
| Returns copy of groups known to manager.
|
virtual QObject * | qObject () |
Protected Slots |
void | relayNextNotification () |
void | removeUnseenFlags (bool ignore) |
Detailed Description
The NotificationManager allows a program to display a notification, update the contents of a notification and cancel a notification.
Constructor & Destructor Documentation
NotificationManager::NotificationManager |
( |
int |
relayInterval = 3000 , |
|
|
uint |
maxWaitQueueSize = 100 | |
|
) |
| | |
Creates a new NotificationManager.
- Parameters:
-
| relayInterval | Time interval in milliseconds between relaying submitted notifications from this NotificationManager onwards to entities connected to notificationUpdated() signal. If this timeout is zero this NotificationManager will pass through all notifications sent using displayNotification() immediatelly. If this interval is negative the relay interval is infinite. Its then on the responsibility of a derived class to call relayNextNotification() when next notification should be relayed. |
| maxWaitQueueSize | The maximum amount of notifications that can be store in this NotificationManager's wait queue awaiting their turn to be relayed to entities connected to notificationUpdated(). Any incoming notification sent through addNotification() when wait queue is full is dropped. |
NotificationManager::~NotificationManager |
( |
|
) |
[virtual] |
Member Function Documentation
Adds a new notification group. Later on notifications can be added to this group.
- Parameters:
-
| notificationUserId | the ID of the user of notifications |
| parameters | Parameters for the notification group |
- Returns:
- the new group id.
Implements NotificationManagerInterface.
void NotificationManager::groupRemoved |
( |
uint |
groupId |
) |
[signal] |
A signal for notifying that a notification group has been removed.
- Parameters:
-
| groupId | the ID of the notification group to be removed |
A signal for notifying that the contents of a notification group has changed. The group can be a new group or a pre-existing group.
- Parameters:
-
void NotificationManager::initializeStore |
( |
|
) |
|
Initializes notification store. Store needs to be always initialized before usage and after all the needed signals are connected to notification manager.
Restores notifications, prunes non-persistent notifications when called first time after a boot and saves remaining notifications.
uint NotificationManager::notificationCountInGroup |
( |
uint |
notificationUserId, |
|
|
uint |
groupId | |
|
) |
| | [virtual, slot] |
Returns amount of notifications in a given group
- Parameters:
-
| notificationUserId | the ID of the user of notifications |
| groupId | the group ID |
- Returns:
- amount of notifications in given group
Implements NotificationManagerInterface.
QList< NotificationGroup > NotificationManager::notificationGroupList |
( |
uint |
notificationUserId |
) |
[virtual, slot] |
Returns list of notification groups by user id
- Parameters:
-
| notificationUserId | the ID of the user of notifications |
- Returns:
- list of notification groups that belong to notificationUserId
Implements NotificationManagerInterface.
QList< NotificationGroup > NotificationManager::notificationGroupListWithIdentifiers |
( |
uint |
notificationUserId |
) |
[virtual, slot] |
Returns list of notification groups with identifiers by user id
- Parameters:
-
| notificationUserId | the ID of the user of notifications |
- Returns:
- list of notification groups with identifiers that belong to notificationUserId
Implements NotificationManagerInterface.
QList< uint > NotificationManager::notificationIdList |
( |
uint |
notificationUserId |
) |
[virtual, slot] |
Returns list of notification ids by user id
- Parameters:
-
| notificationUserId | the ID of the user of notifications |
- Returns:
- list of notification ids that belong to notificationUserId
Implements NotificationManagerInterface.
QList< Notification > NotificationManager::notificationList |
( |
uint |
notificationUserId |
) |
[virtual, slot] |
Returns list of notifications by user id
- Parameters:
-
| notificationUserId | the ID of the user of notifications |
- Returns:
- list of notifications that belong to notificationUserId
Implements NotificationManagerInterface.
QList< Notification > NotificationManager::notificationListWithIdentifiers |
( |
uint |
notificationUserId |
) |
[virtual, slot] |
Returns list of notifications with identifiers by user id
- Parameters:
-
| notificationUserId | the ID of the user of notifications |
- Returns:
- list of notifications with identifiers that belong to notificationUserId
Implements NotificationManagerInterface.
void NotificationManager::notificationRemoved |
( |
uint |
notificationId |
) |
[signal] |
A signal for notifying that a certain notification has been removed.
- Parameters:
-
| notificationId | the ID of the notification to be removed |
void NotificationManager::notificationRestored |
( |
const Notification & |
notification |
) |
[signal] |
A signal for notifying that a pre-existing notification has been restored from the persistent storage.
- Parameters:
-
| notification | the data of the notification |
QList< Notification > NotificationManager::notifications |
( |
|
) |
const [virtual] |
void NotificationManager::notificationUpdated |
( |
const Notification & |
notification |
) |
[signal] |
A signal for notifying that the contents of a notification has changed. The notification can be a new notification or a pre-existing notification.
- Parameters:
-
| notification | the data of the notification |
uint NotificationManager::notificationUserId |
( |
|
) |
[virtual, slot] |
Returns a user ID for the notification system. The user ID has to be supplied with every notification system call.
- Returns:
- a user ID for the notification system
Implements NotificationManagerInterface.
QObject * NotificationManager::qObject |
( |
|
) |
[virtual] |
Returns the qObject that implements the manager for signal connections.
- Returns:
- the qObject that implements the manager
Implements NotificationManagerInterface.
void NotificationManager::queuedGroupRemove |
( |
uint |
groupId |
) |
[signal] |
Signal used to queue group removal request
- Parameters:
-
void NotificationManager::queuedNotificationRemove |
( |
uint |
notificationId |
) |
[signal] |
Signal used to queue notification removal request
- Parameters:
-
| notificationId | notificationId to be removed |
void NotificationManager::relayNextNotification |
( |
|
) |
[protected, slot] |
Slot called to relay next notification from the notifications queue of this NotificationManager. This slot is called automatically periodically with the given relay interval if the relay interval is given in the constructor. If negative relay interval was specified in the constructor of this NotificationManager then this slot has to be called manually by an inherited NotificationManager. Every call to this slot will relay the first notification in the notification queue. This will initiate the sequence of emitting the addNotification() signal of this object and invoke any entity connected to this NotificationManager.
bool NotificationManager::removeGroup |
( |
uint |
notificationUserId, |
|
|
uint |
groupId | |
|
) |
| | [virtual, slot] |
Removes a notification group.
- Parameters:
-
| notificationUserId | the ID of the user of notifications |
| groupId | The ID of the notification group to be removed. |
- Returns:
- true if the removal succeeded, false otherwise
Implements NotificationManagerInterface.
bool NotificationManager::removeNotification |
( |
uint |
notificationUserId, |
|
|
uint |
notificationId | |
|
) |
| | [virtual, slot] |
Removes a notification.
- Parameters:
-
| notificationUserId | the ID of the user of notifications |
| notificationId | The ID of the notification to be removed. |
- Returns:
- true if the removal succeeded, false otherwise
Implements NotificationManagerInterface.
bool NotificationManager::removeNotification |
( |
uint |
notificationId |
) |
[slot] |
Removes a notification. This slot is for the sinks so they can remove notifications without needing to know the notification user ID.
- Parameters:
-
| notificationId | The ID of the notification to be removed. |
- Returns:
- true if the removal succeeded, false otherwise
void NotificationManager::removeNotificationsAndGroupsWithEventType |
( |
const QString & |
eventType |
) |
[slot] |
Removes all notifications and groups with the specified event type
- Parameters:
-
| eventType | the event type of the notifications and groups to remove |
bool NotificationManager::removeNotificationsInGroup |
( |
uint |
groupId |
) |
[slot] |
Removes all notifications from a group. This slot is for the sinks so they can remove notifications without needing to know the notification user ID.
- Parameters:
-
| groupId | The ID of the group from which notifications should be removed. |
- Returns:
- true if the removal succeeded, false otherwise
void NotificationManager::removeUnseenFlags |
( |
bool |
ignore |
) |
[protected, slot] |
Slot for setting unseen flags of all notifications to false.
- Parameters:
-
| ignore | true if ignore the call false to remove the flags |
void NotificationManager::restoreData |
( |
|
) |
|
Restores data.
Restores the saved groups and notifications and sends the respective notificationUpdated and groupUpdated signals.
Updates the contents of a notification group.
- Parameters:
-
| notificationUserId | the ID of the user of notifications |
| groupId | The ID of the notification group to be updated |
| parameters | Parameters for the notification group |
- Returns:
- true if the update succeeded, false otherwise
Implements NotificationManagerInterface.
Updates a notification.
- Parameters:
-
| notificationUserId | the ID of the user of notifications |
| notificationId | The ID of the notification to be updated |
| parameters | Parameters for the notification |
- Returns:
- true if the update succeeded, false otherwise
Implements NotificationManagerInterface.
void NotificationManager::updateNotificationsWithEventType |
( |
const QString & |
eventType |
) |
[slot] |
Update event type data of all notifications with the specified event type.
Sends a notificationUpdated(Notification &) signal for all notifications of specified type so that sinks can update the event type data from the event type store
- Parameters:
-
| eventType | the event type of the notifications to update |
The documentation for this class was generated from the following files: