NotificationApplicationSettings

Since: BlackBerry 10.2.0

#include <bb/platform/NotificationApplicationSettings>

To link against this class, add the following line to your .pro file: LIBS += -lbbplatform

Provides methods to read an application's persistent notification settings.

The NotificationApplicationSettings class provides methods to read an application's notification settings. The settings themselves are set by the end user.

An application's notification settings are represented by a set of policies. These policies determine which effects (such as playing a sound, vibrating the device, flashing the LED, and so on) may be triggered when the Notification system wants to notify the user. Ultimately the Notification system will decide which effects actually get presented to the user based on a combination of an application's notification settings and the global notification settings.

The role of the notification settings are as such:

  • SOUND If the global setting for sound effects is set to "allow", then an application setting may override the global setting to "deny". If the global setting is set to "deny" then the application setting will have no effect.

  • VIBRATE If the global setting for vibration effects is set to "allow", then an application setting may override the global setting to "deny". If the global setting is set to "deny" then the application setting will have no effect.

  • LED If the global setting for LED effects is set to "allow", then an application setting may override the global setting to "deny". If the global setting is set to "deny" then the application setting will have no effect.

  • PREVIEW If the global setting for Instant Preview effects is set to "allow", then an application setting may override the global setting to "deny". The application setting may also be set to "priority only", in which case the Notification system will only display Instant Previews for notifications coming from priority sources. If the application setting is set to "not applicable", then Instant Preview effects are not applicable to the application and the user setting will be hidden in the Application Settings UI. If the global setting is set to "deny" then the application setting will have no effect.

  • ALERTS If alerts are "enabled", then the settings will behave as described above. If alerts are "disabled", then no effects will be triggered, regardless of other notification settings.

An application may use NotificationDefaultApplicationSettings to perform a one time change of its initial settings from the defaults set by the Notification system.


Overview

Signals Index

voidalertsEnabledChanged (bool enabled)
voidledChanged (bb::platform::NotificationPolicy::Type policy)
voidpreviewChanged (bb::platform::NotificationPriorityPolicy::Type policy)
voidsoundChanged (bb::platform::NotificationPolicy::Type policy)
voidtonePathChanged (const QUrl &tonePath)
voidvibrateChanged (bb::platform::NotificationPolicy::Type policy)
voidvibrateCountChanged (int count)

Properties

bool alertsEnabled[read-only]

Defines whether notifications sent by an application will trigger any effects.

Since:

BlackBerry 10.2.0

bb::platform::NotificationPolicy::Type led[read-only]

Defines an application's policy for LED effects.

The LED setting determines if the Notification system may flash the LED when notifying the user.

Since:

BlackBerry 10.2.0

bb::platform::NotificationPriorityPolicy::Type preview[read-only]

Defines an application's policy for Instant Preview effects.

The preview setting determines if the Notification system may display an Instant Preview when notifying the user.

Since:

BlackBerry 10.2.0

bb::platform::NotificationPolicy::Type sound[read-only]

Defines an application's policy for sound effects.

The sound setting determines if the Notification system may play a sound when notifying the user.

Since:

BlackBerry 10.2.0

QUrl tonePath[read-only]

Defines the path to the tone that should be played for sound effects.

Since:

BlackBerry 10.2.0

bb::platform::NotificationPolicy::Type vibrate[read-only]

Defines an application's policy for vibration effects.

The vibrate setting determines if the Notification system may vibrate the device when notifying the user.

Since:

BlackBerry 10.2.0

int vibrateCount[read-only]

Defines the number of times vibration effects will be played.

Since:

BlackBerry 10.2.0

Public Functions

NotificationApplicationSettings (

virtual~NotificationApplicationSettings ()

Destructor.

bool alertsEnabled ()

Returns whether notifications sent by an application may trigger any effects.

Return:

true if effects may be triggered by notifications sent from an application false otherwise.

Since:

BlackBerry 10.2.0

bb::platform::NotificationPolicy::Type led ()

Returns an application's policy for LED effects.

Return:
The policy for LED effects. Possible policies are:
Since:

BlackBerry 10.2.0

bb::platform::NotificationPriorityPolicy::Type preview ()

Returns an application's policy for Instant Preview effects.

Return:
The policy for Instant Preview effects. Possible policies are:
Since:

BlackBerry 10.2.0

bb::platform::NotificationPolicy::Type sound ()

Returns an application's policy for sound effects.

Return:
The policy for sound effects. Possible policies are:
Since:

BlackBerry 10.2.0

QUrl tonePath ()

Returns the path to the tone that will be played for an application's sound notifications.

Return:

A QUrl containing the tone path.

Since:

BlackBerry 10.2.0

bb::platform::NotificationPolicy::Type vibrate ()

Returns an application's policy for vibration effects.

Return:
The policy for vibration effects. Possible policies are:
Since:

BlackBerry 10.2.0

int vibrateCount ()

Returns the number of times a vibration effect will be played.

Return:

The vibrate count is an integer in the set [1, 2, 3, 4, 5].

Since:

BlackBerry 10.2.0

Signals

void alertsEnabledChanged (
  • boolenabled)

Emitted when the state of NotificationApplicationSettings::alertsEnabled changes.

Parameters
state

The new state for the NotificationApplicationSettings::alertsEnabled property.

Since:

BlackBerry 10.2.0

void ledChanged (

Emitted when the policy for the NotificationApplicationSettings::led property changes.

Parameters
policy

The new policy for the NotificationApplicationSettings::led property.

Since:

BlackBerry 10.2.0

void previewChanged (

Emitted when the policy for the NotificationApplicationSettings::preview property changes.

Parameters
policy

The new policy for the NotificationApplicationSettings::preview property.

Since:

BlackBerry 10.2.0

void soundChanged (

Emitted when the policy for the NotificationApplicationSettings::sound property changes.

Parameters
policy

The new policy for the NotificationApplicationSettings::sound property.

Since:

BlackBerry 10.2.0

void tonePathChanged (
  • const QUrl &tonePath)

Emitted when the value for the NotificationApplicationSettings::tonePath property changes.

Parameters
tonePath

The new path for the NotificationApplicationSettings::tonePath property.

Since:

BlackBerry 10.2.0

void vibrateChanged (

Emitted when the policy for the NotificationApplicationSettings::vibrate property changes.

Parameters
policy

The new policy for the NotificationApplicationSettings::vibrate property.

Since:

BlackBerry 10.2.0

void vibrateCountChanged (
  • intcount)

Emitted when the value for the NotificationApplicationSettings::vibrateCount property changes.

Parameters
count

The new value for the NotificationApplicationSettings::vibrateCount property.

Since:

BlackBerry 10.2.0

Last modified: 2014-03-13

comments powered by Disqus