Home · All Classes · Main Classes · Deprecated |
The MeeGo Touch environment offers a notification system framework. Applications and other processes can use the notification system to inform the user about specific events such as:
The notification system should not be used for temporary situations like various error cases. A simple MBanner
is more suitable for situations, such as:
A notification is usually represented to the user, for example, with graphical, aural or tactile feedback - or a combination of these. The MeeGo Touch notification API hides these details under the unified API. The system determines what kind of feedback is used to present the notifications to the user. This means that the user of the notification system cannot directly control how the notification is actually presented to the user.
The notifications can be grouped. It is up to the underlying system how grouped notifications are shown. It is common that, for example, a group of notifications is displayed with one visual banner. A notification group can have almost the same parameters - including, for instance, visualisation - as single notifications.
The relevant classes to developers are MNotification
and MNotificationGroup
. A notification can be created by constructing an object of type MNotification
and a notification group can be created by constructing an object of type MNotificationGroup
. After the relevant parameters have been set the notifications and the notification groups must be published before they appear by calling the publish() function. The notification group must be published before a notification can be placed into it.
This section describes some of the parameters associated with the MNotification
and MNotificationGroup
classes. There are similar parameters related to both classes.
This parameter determines how the notification is presented to the user. For example, a specific sound can be played when a new e-mail arrives. The e-mail application only sets the correct event type for the notification and the notification system takes care of the rest. Similarly, other parameters, such as icons and images, can be selected according to the event type.
Users of the notification system must always set the event type correctly. They should not set an incorrect event type to get a specific feedback (for example, sound). To get a specific feedback, you can provide your own event type configuration as the event type system supports 3rd party event types. The event type naming follows the Category naming in the Desktop Notifications Specification.
The predefined event types that are guaranteed to exist in the system are defined in the MNotification
documentation under Static Public Attributes.
This parameter specifies an action related to the notification. The action is usually triggered by something the user does. The action is returned to the application that sent the notification.
For example, an e-mail application receives a new e-mail and sends a notification about this. The user sees a graphical notification on the screen and taps it. The notification-related action is triggered and it causes the e-mail application to show the recently received e-mail.
As illustrated in the above example, notification actions are application-specific.
This parameter specifies an image related to the notification. Usually this means that the image is shown in a graphical representation of the notification. The image parameter can be a logical name (such as 'Icon-messages') or an absolute path to an image file (such as /usr/share/pixmaps/foo.png).
The identifier is a string that the application can use to identify a particular notification or a notification group. It can be any string, and is by default empty.
This parameter specifies that the notification system stores the notifications and they are restored after a reboot. The user can get a list of stored notifications with a call to the static function MNotification::notifications()
and the list of groups with MNotificationGroup::notificationGroups()
.
Copyright © 2010 Nokia Corporation | MeeGo Touch |