Home · All Namespaces · All Classes
Signals | Public Member Functions | Static Public Attributes | Protected Member Functions | Static Protected Member Functions

WidgetNotificationSink Class Reference

#include <widgetnotificationsink.h>

Inheritance diagram for WidgetNotificationSink:
Inheritance graph
[legend]
Collaboration diagram for WidgetNotificationSink:
Collaboration graph
[legend]

List of all members.

Signals

void privacySettingChanged (bool privacyEnabled)

Public Member Functions

 WidgetNotificationSink ()
void setHonorPrivacySetting (bool honor)
void setNotificationsClickable (bool clickable)

Static Public Attributes

static const char * NOTIFICATION_ID_PROPERTY = "notificationId"
 MBanner property to store the notification ID into.
static const char * GROUP_ID_PROPERTY = "groupId"
 MBanner property to store the group ID into.
static const char * USER_REMOVABLE_PROPERTY = "userRemovable"
 MBanner property to store the user removability into.
static const char * TITLE_TEXT_PROPERTY = "titleText"
 MBanner property to store the title text.
static const char * SUBTITLE_TEXT_PROPERTY = "subtitleText"
 MBanner property to store the subtitle text.
static const char * GENERIC_TEXT_PROPERTY = "genericText"
 MBanner property to store the generic text.

Protected Member Functions

MBanner * createInfoBanner (const Notification &notification)
MBanner * createInfoBanner (Notification::NotificationType type, uint groupId, const NotificationParameters &parameters)
bool containsText (const Notification &notification)
void updateTitles (MBanner *infoBanner)
void updateActions (MBanner *infoBanner, const NotificationParameters &parameters)
void updateImage (MBanner *infoBanner, const NotificationParameters &parameters)

Static Protected Member Functions

static bool determineUserRemovability (const NotificationParameters &parameters)
static QString infoBannerTitleText (const NotificationParameters &parameters)
static QString infoBannerSubtitleText (const NotificationParameters &parameters)
static QString infoBannerGenericText (const NotificationParameters &parameters)

Detailed Description

WidgetNotificationSink is a common base class for all notification sinks that trigger visual feedback using a graphics widget.

WidgetNotificationSink creates MBanner widgets for notifications. When MBanner is clicked the action bound to the notification is triggered and notification is removed from the notification system signaling notificationRemovalRequested().

The sink can be configured to always show the given notification text in the banners (the default mode) or to only show a generic text instead of the given notification text if the privacy mode is enabled by setting the value of the /desktop/meego/privacy/private_lockscreen_notifications GConf key to true. This can be accomplished with the setHonorPrivacySetting() call.


Constructor & Destructor Documentation

WidgetNotificationSink::WidgetNotificationSink (  ) 

Constructs a widget notification sink.


Member Function Documentation

bool WidgetNotificationSink::containsText ( const Notification notification  )  [protected]

Check whether the notification contains text.

Parameters:
notification The notification object to represent with the MBanner.
Returns:
true if the notification contains text, false otherwise
MBanner * WidgetNotificationSink::createInfoBanner ( const Notification notification  )  [protected]

Creates a MBanner widget to represent a notification object. Ownership of the constructed object is passed to the caller.

Parameters:
notification The notification object to represent with the MBanner.
Returns:
Constructed MBanner that represents the notification.
MBanner * WidgetNotificationSink::createInfoBanner ( Notification::NotificationType  type,
uint  groupId,
const NotificationParameters parameters 
) [protected]

Creates a MBanner widget from the given notification parameters. Ownership of the constructed object is passed to the caller.

Parameters:
type Notification type on the basis of which info banner type is to be constructed.
groupId The group ID to be associated with the info banner.
params NotificationParameters according to which configure the MBanner.
bool WidgetNotificationSink::determineUserRemovability ( const NotificationParameters parameters  )  [static, protected]

Determines user removability of a notification based on the given notification parameters.

Parameters:
parameters Notification parameters to determine removability from.
Returns:
true if the notification should be user removable, false otherwise
QString WidgetNotificationSink::infoBannerGenericText ( const NotificationParameters parameters  )  [static, protected]

Creates a generic text string from notification parameters.

Parameters:
parameters the NotificationParameters to get the generic text from
Returns:
the generic text
QString WidgetNotificationSink::infoBannerSubtitleText ( const NotificationParameters parameters  )  [static, protected]

Creates a subtitle text string from notification parameters.

Parameters:
parameters the NotificationParameters to get the subtitle text from
Returns:
the subtitle text
QString WidgetNotificationSink::infoBannerTitleText ( const NotificationParameters parameters  )  [static, protected]

Creates a title text string from notification parameters.

Parameters:
parameters the NotificationParameters to get the title text from
Returns:
the title text
void WidgetNotificationSink::privacySettingChanged ( bool  privacyEnabled  )  [signal]

Informs about a change in the privacy setting.

Parameters:
privacyEnabled true if the privacy was enabled, false if disabled
void WidgetNotificationSink::setHonorPrivacySetting ( bool  honor  ) 

Controls whether the notification banners should only show a generic text instead of the full notification text if the /desktop/meego/privacy/private_lockscreen_notifications GConf key is set to true. If the GConf key is not honored the private mode is never used.

Parameters:
honor if true, privacy setting is honored. If false, the privacy setting is ignored.
void WidgetNotificationSink::setNotificationsClickable ( bool  clickable  ) 

Sets if notifications are clickable

Parameters:
clickable true if notifications are clickable. false if notifications are not clickable
void WidgetNotificationSink::updateActions ( MBanner *  infoBanner,
const NotificationParameters parameters 
) [protected]

Removes old actions from the given info banner and adds the action specified in the notification (if any)

Parameters:
infoBanner the MBanner to update
parameters the NotificationParameters to get the action from
void WidgetNotificationSink::updateImage ( MBanner *  infoBanner,
const NotificationParameters parameters 
) [protected]

Updates image for the given info banner Uses primarily imageId parameter, but if not available, then uses iconId parameter. imageId and iconId parameters can be absolute paths to image or logical image id's.

Parameters:
infoBanner the MBanner to update
parameters the NotificationParameters to get the image or icon from
void WidgetNotificationSink::updateTitles ( MBanner *  infoBanner  )  [protected]

Updates the titles in a banner based on the current privacy mode.

Parameters:
infoBanner the MBanner to update

Member Data Documentation

const char * WidgetNotificationSink::GENERIC_TEXT_PROPERTY = "genericText" [static]

MBanner property to store the generic text.

const char * WidgetNotificationSink::GROUP_ID_PROPERTY = "groupId" [static]

MBanner property to store the group ID into.

const char * WidgetNotificationSink::NOTIFICATION_ID_PROPERTY = "notificationId" [static]

MBanner property to store the notification ID into.

const char * WidgetNotificationSink::SUBTITLE_TEXT_PROPERTY = "subtitleText" [static]

MBanner property to store the subtitle text.

const char * WidgetNotificationSink::TITLE_TEXT_PROPERTY = "titleText" [static]

MBanner property to store the title text.

const char * WidgetNotificationSink::USER_REMOVABLE_PROPERTY = "userRemovable" [static]

MBanner property to store the user removability into.


The documentation for this class was generated from the following files:

Copyright © 2011 Nokia Corporation Generated on Tue Aug 30 2011 16:38:13
Doxygen 1.7.1
MeeGo Touch