Public Slots |
|
void | registerApplication (const QString &aApplicationId) |
void | setWakeUp (bool aWakeUp) |
bool | setNotificationUi (bool aUseNotificationUi, const QString &aIcon="") |
bool | isWakeUp () |
bool | isNotificationUi () |
void | unregisterApplication () |
void | getNotificationInformation (const QString &aServiceId="") |
void | getVersion () |
Signals |
|
void | received (QObject *aNotification) const |
void | stateChanged (QObject *aState) |
void | notificationInformation (QObject *aData) |
void | version (QString aVersion) |
Public Member Functions |
|
OviNotificationSession () | |
~OviNotificationSession () |
OviNotificationSession::OviNotificationSession | ( | ) |
Constructor. Creates the OviNotificationSession object.
OviNotificationSession::~OviNotificationSession | ( | ) |
Destructor. Destroys the OviNotificationSession object and frees all allocated resources.
void OviNotificationSession::getNotificationInformation | ( | const QString & | aServiceId = "" |
) | [virtual, slot] |
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.
This function should be called when session state is OviNotificationState::EStateOnline. The stateChanged(QObject* ) signal would be emitted with OviNotificationState::StateError OviNotificationState::EErrorNotAllowed in the following cases
aServiceId | If wakeup is true then the application is woken up in the event of ovi notifications. |
Implements OviNotificationInterface.
void OviNotificationSession::getVersion | ( | ) | [virtual, slot] |
Retrieve version information. Requested version information is returned in OviNotificationSession::version() signal.
Implements OviNotificationInterface.
bool OviNotificationSession::isNotificationUi | ( | ) | [virtual, slot] |
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.
Implements OviNotificationInterface.
bool OviNotificationSession::isWakeUp | ( | ) | [virtual, slot] |
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.
Implements OviNotificationInterface.
void OviNotificationSession::notificationInformation | ( | QObject * | aData | ) | [signal] |
NotificationInfo signal.
Signal emitted when NotificationInfo message has been received.
// Load the service and get the service object connect(serviceObject,SIGNAL(notificationInfo(QObject*)), SLOT(notificationInfoResponse(QObject*))); // Signal handling OviNotificationInfo* notificationInfo = static_cast<OviNotificationInfo*>(object);
aData | OviNotificationInfo Object |
void OviNotificationSession::received | ( | QObject * | aNotification | ) | const [signal] |
Signal is emitted when application receives notification
// Load the service and get the service object connect(serviceObject,SIGNAL(received(QObject)), SLOT(receivedClb(QObject))); // Signal handling OviNotificationMessage* notification = static_cast<OviNotificationMessage*>(object);
aNotification | OviNotificationMessage containing the Ownership is passed. |
void OviNotificationSession::registerApplication | ( | const QString & | aApplicationId | ) | [virtual, slot] |
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 successful Notifications Enabler will open a network connection if not open already. OviNotificationSession::stateChanged signal is emitted with EStateConnecting and EStateOnline after successful registration. Otherwise one of the OviNotificationState::StateError errors is emited.
aApplicationId | Application's Identifier |
Implements OviNotificationInterface.
bool OviNotificationSession::setNotificationUi | ( | bool | aUseNotificationUi, | |
const QString & | aIcon = "" |
|||
) | [virtual, slot] |
Setter for the Notification Ui This function should be called when session state is OviNotificationState::EStateOnline. The stateChanged(QObject* ) signal would be emitted with OviNotificationState::StateError OviNotificationState::EErrorNotAllowed in the following cases
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 size limitation is 128*128 pixels. The icon format should be Base64 encoded image data read from the file.
|
Implements OviNotificationInterface.
void OviNotificationSession::setWakeUp | ( | bool | aWakeUp | ) | [virtual, slot] |
Setter for the wakeup of the application. This is an asynchronous method. This function should be called when session state is OviNotificationState::EStateOnline. The stateChanged(QObject* ) signal would be emitted with OviNotificationState::StateError OviNotificationState::EErrorNotAllowed in the following cases
If this flag is set and the application receives notifications while application is not running then
aWakeUp | If wakeup is true then the application is woken up in the event of ovi notifications. |
Implements OviNotificationInterface.
void OviNotificationSession::stateChanged | ( | QObject * | aState | ) | [signal] |
Session status change signal.
Signal emitted when a OviNotification session state has changed. Indicates Notifications Enabler states. In the normal cases the the state changes would be OviNotificationState::EStateOffline to OviNotificationState::EStateConnecting to OviNotificationState::EStateOnline, with OviNotificationState::EErrorNone. In case of error OviNotificationState::StateError would be other than OviNotificationState::EErrorNone. For example, client has connected to Notifications Enabler.
// Load the service and get the service object connect(serviceObject,SIGNAL(stateChanged(QObject*)), SLOT(sessionStateChanged(QObject*)));
aState | OviNotificationState Object |
void OviNotificationSession::unregisterApplication | ( | ) | [virtual, slot] |
Asynchronous call used to unregister application.
Should be called when application wants to close and unregister from Ovi Notification service, for example when uninstalling the application. Removes all application related information and stored settings. Like
If application is already unregistered or is not registered at all, OviNotificationState::EErrorNotAllowed is emited in OviNotificationSession::stateChanged() signal.
Implements OviNotificationInterface.
void OviNotificationSession::version | ( | QString | aVersion | ) | [signal] |
Version info signal.
Signal is emitted when version information has been received.
// Load the service and get the service object connect(serviceObject,SIGNAL(version(QString)), SLOT(versionResponse(QString)));
aVersion | returned version information |
Copyright (C) 2010-2011 Nokia Corporation and/or its subsidiary(-ies). All rights reserved. Contact: notifications.support@nokia.com This software, including documentation, is protected by copyright controlled by Nokia Corporation. All rights reserved. You may use this file only in accordance with the Nokia Developer Software Agreement version 2.0 and accompanying Ovi any additional terms. This material also contains confidential information which may not be disclosed to others without the prior written consent of Nokia. Nokia Developer Software Agreement version 2.0 and accompanying Ovi any additional terms |
MeeGo 1.2 Harmattan API
|