#include <mw/cwrt/ovinotificationinterface.h>
class OviNotificationInterface |
Public Member Functions | |
---|---|
pure virtual void | getNotificationInformation(const QString &) |
pure virtual void | getVersion() |
pure virtual bool | isAudioNotification() |
pure virtual bool | isNotificationUi() |
pure virtual bool | isNotificationUiUpdate() |
pure virtual bool | isWakeUp() |
pure virtual void | markConsumed(const QStringList &) |
pure virtual void | registerApplication(const QString &) |
pure virtual void | setAudioNotification(bool) |
pure virtual bool | setNotificationUi(bool, const QString &) |
pure virtual void | setNotificationUiUpdate(bool) |
pure virtual void | setWakeUp(bool) |
pure virtual void | unregisterApplication() |
Main class of the Ovi Notification service provider.
Code example of how Qt applications uses this API.
// OviNotificationSession *iNotificationSession; // Load service object QPluginLoader* loader = new QPluginLoader(ONEPLUGIN); iNotificationSession = static_cast<OviNotificationSession*>(loader->instance()); // Connect signals from session // State enumerations is emitted from stateChanged(QObject*) signal. connect(iNotificationSession,SIGNAL(stateChanged(QObject*)), SLOT(sessionStateChanged(QObject*))); // Incoming notification objects is emitted from received(QObject*) signal. connect(iNotificationSession,SIGNAL(received(QObject)), SLOT(receivedClb(QObject))); // Register application. This is an asynchronous call. // OviNotificationSession::stateChanged signal is emitted with state EStateOnline // when application is successfully registered. iNotificationSession->registerApplication(aApplicationId, aWakeup); } // When message is received , received(QObject) signal is emitted. OviNotificationMessage* message = static_cast<OviNotificationMessage*>(obj); message->from(); message->senderInformation(); message->timestamp(); }
Client application should connect all signals from Ovi Notification service object to receive callbacks. See signals in OviNotificationSession.
void | getNotificationInformation | ( | const QString & | aServiceId = "" | ) | [pure virtual] |
Retrieve user information used by Notifications Enabler. Requested information is returned by emitting OviNotificationSession::notificationInformation(QObject* ) signal. The information contains the user account used by application. This value could be empty in case of the service is not available or the request has timedout. The signal stateChanged(QObject* ) with OviNotificationState::StateError OviNotificationState::EErrorInvalidServiceId is emitted if the passed ServiceId is invalid.
If this function is called in state other than OviNotificationState::EStateOnline.
If the function is trying to call before the previous request has not been processed by the Notifications Enabler.
Parameters | |
---|---|
aServiceId | The identifier of the Notification Service |
void | getVersion | ( | ) | [pure virtual] |
Retrieve version information. Requested version information is returned in OviNotificationSession::version() signal.
bool | isAudioNotification | ( | ) | [pure virtual] |
Getter for the audio notification. This function should be called when session state is OviNotificationState::EStateOnline. If the function is called in any other state then stateChanged signal would be emitted with OviNotificationState::EErrorNotAllowed which indicates the values returned by this function are not valid.
Returns true if the audion notificaiton setting is true otherwise returns false.
bool | isNotificationUi | ( | ) | [pure virtual] |
Getter for the notification UI. This function should be called when session state is OviNotificationState::EStateOnline. If the function is called in any other state then stateChanged signal would be emitted with OviNotificationState::EErrorNotAllowed which indicates the values returned by this function are not valid. Returns true if the NotificationUi setting is true otherwise returns false.
bool | isNotificationUiUpdate | ( | ) | [pure virtual] |
Getter for the Notification Ui update value. This function should be called when session state is OviNotificationState::EStateOnline. If the function is called in any other state then stateChanged signal would be emitted with OviNotificationState::EErrorNotAllowed which indicates the values returned by this function are not valid.
Returns true if the NotificationUi update setting is true otherwise returns false.
bool | isWakeUp | ( | ) | [pure virtual] |
Getter for the wakeup. This function should be called when session state is OviNotificationState::EStateOnline. If the function is called in any other state then stateChanged signal would be emitted with OviNotificationState::EErrorNotAllowed which indicates the values returned by this function are not valid.
Returns true if the wakeup setting is true otherwise returns false.
void | markConsumed | ( | const QStringList & | aMessageIds | ) | [pure virtual] |
If this function is called in state other than OviNotificationState::EStateOnline.
If the function is trying to set value before the previous value has not been saved in the Notifications Enabler.
For application using Notification Ui update flag alongwith Notification Ui flag, they must ensure that once they receive the notification and have processed it, they must call this API and pass the messageIds of the notifications which are processed, those notifications will be removed from the Notification Ui. In case Notification UI update flag is not set then the Notification Ui will remove the message after it has been delivered to the application, this API will have no effect. Stores the notificaiton Ui update settings in the stack.
Parameters | |
---|---|
aMessageIds | List of notification Ids which are processed by the application and wants to remove from NUI. |
void | registerApplication | ( | const QString & | aApplicationId | ) | [pure virtual] |
Registers Notifications Enabler application. This is an asynchronous method. It is mandatory to call this method before Ovi Notifications can be used. If registration is succesfull Notifications Enabler will open connection Notification Service if not open already. OviNotificationSession::stateChanged signal is emitted with EStateConnecting and EStateOnline after succesfull registration. Otherwise one of the OviNotificationState::StateError errors is emited.
Parameters | |
---|---|
aApplicationId | Application's Identifier |
void | setAudioNotification | ( | bool | aAudio | ) | [pure virtual] |
If this function is called in state other than OviNotificationState::EStateOnline.
If the function is trying to set value before the previous value has not been saved in the Notifications Enabler.
If this flag is set and the application receives notifications which has alert flag in it then the user will hear the audio beep for the received notificaiton In case this flag is not set then no audio beep will be played even though the notification might have the audio flag set in it. Simialrly, if this flag is set but the received notification does not have the audio flag in it then also no beep will be played. Stores the audio notificaiton settings in the stack.
Parameters | |
---|---|
aAudio | If true will enable the audio notification feature else will disable this feature. |
bool | setNotificationUi | ( | bool | aUseNotificationUi, |
const QString & | aIcon = "" | |||
) | [pure virtual] |
If this function is called in state other than OviNotificationState::EStateOnline.
If the function is trying to set value before the previous value has not been saved in the Notifications Enabler.
Note: setWakeUp must be set that setNotificationUi would affect
Parameters | |
---|---|
aUseNotificationUi | If set to true then the Notification UI is shown in the events of new messages when the application is not running. |
aIcon | The icon data to be shown for this application in the notification ui. The icon format should be Base64 encoded image data read from the file, supported formats svg, png, img, bmp,jpg Returns true if the NotificationUi setting has been succesful else returns false in cases ofToo large Icon |
void | setNotificationUiUpdate | ( | bool | aNotificationUiUpdate | ) | [pure virtual] |
If this function is called in state other than OviNotificationState::EStateOnline.
If the function is trying to set value before the previous value has not been saved in the Notifications Enabler.
If this flag is set alongwith the Notification Ui flag then the stack will sync the notification status in Notification Ui and the application. For application using this flag alongwith Notification Ui flag, they must ensure that once they receive the notification and have processed it, they must call markConsumed() API and pass the messageIds of the notifications which are processed, those notifications will be removed from the Notification Ui. In case this flag is not set then the Notification Ui will remove the message after it has been delivered to the application, there is no need to call markConsumed(). Stores the notificaiton Ui update settings in the stack.
Parameters | |
---|---|
aNotificationUiUpdate | If true will enable the notification ui update feature else will disable this feature. |
void | setWakeUp | ( | bool | aWakeUp | ) | [pure virtual] |
If this function is called in state other than OviNotificationState::EStateOnline.
If the function is trying to set value before the previous value has not been saved in the Notifications Enabler.
If this flag is set and the applicatin receives notifications while application is not running then -#if notificationUi is true - user will receive notification popup informing that this application has received notification,user needs to select the popup and it will lauch this application. -#if notification Ui is false - Application will directly launch. To receive the notification, application must call registerApplication() after launching. -#In case the application is running and notification arrives for the application it is directly delivered to the application. Stores the wakeup related settings in the stack.
Parameters | |
---|---|
aWakeUp | If true will enable the wakeup feature else will disable wakeup feature. |
void | unregisterApplication | ( | ) | [pure virtual] |
Wakeup
NotificationUi
If application is already unregistered or is not registered at all, OviNotificationState::EErrorNotAllowed is emited in OviNotificationSession::stateChanged() signal.