#include <app/MNcnNotification.h>
class MNcnNotification |
Public Member Enumerations | |
---|---|
enum | TIndicationType { EIndicationIcon, EIndicationNormal, EIndicationToneAndIcon } |
Public Member Functions | |
---|---|
virtual | ~MNcnNotification() |
MNcnNotification * | CreateMNcnNotificationL() |
pure virtual TInt | MarkUnread(const TMsvId &) |
pure virtual TInt | NewMessages(const TMsvId &, TIndicationType, const MDesCArray &) |
Public ECom notification API. This API allows the notification of new message(s) to the NcnList. It's main purpose is to provide a mechanism for an email MTM to broadcast the arrival of new messages and give the user an opportunity to navigate to the email folder
Example usage
#include <badesca.h> // CDesCArray #include <mncnnotification.h> // ECOM interface to notification system // Get an instance of the ECOM interface to the notification system. MNcnNotification* notifyNewMessageEcom = 0; TRAP(err, notifyNewMessageEcom = MNcnNotification::CreateMNcnNotificationL()); // Check for errors if(notifyNewMessageEcom && err == KErrNone) { // The interface is supported on this phone. CleanupDeletePushL(notifyNewMessageEcom); // Now notify the framework that new messages have been received // First create a descriptor array for aInfo - even though it isn't used presently. CDesCArray* tempArray = new (ELeave) CDesCArrayFlat(3); CleanupStack::PushL(tempArray); // Notify the framework that there are new messages. // This can return an error value. err = notifyNewMessageEcom->NewMessages(aServiceId, MNcnNotification::EIndicationNormal, *tempArray); // Cleanup the descriptor array. CleanupStack::PopAndDestroy(tempArray); // Clean up the ECOM interface now. CleanupStack::PopAndDestroy(notifyNewMessageEcom); }
The example above shows the interface object being created and then destroyed immediately after use. However, it is not necessary to create a new interface object for every function call. It is done here to demonstrate correct useage of the CleanupStack
MNcnNotification * | CreateMNcnNotificationL | ( | ) | [static, inline] |
ECom implementation class factory method. Caller takes the ownership of the created object. If interface needs to be pushed into CleanupStack, remember to use the CleanupDeletePushL() function! DO NOT USE CleanupStack::PushL()!!
Returns: ECom implementation instance
Called by Messaging Server -compatible 3rd party Email plugins wanting to make a request to mark certain new messages as unread. Essentially, it sets the new message counter to zero for the given mailbox The new messages become 'old' messages but they remain marked as 'unread'.
Parameter | Description |
---|---|
aMailBox | The id identifying the mailbox or mail folder containing the message(s) to be marked as unread. |
Returns: KErrNone for success, or some error code
TInt | NewMessages | ( | const TMsvId & | aMailBox, |
TIndicationType | aIndicationType, | |||
const MDesCArray & | aInfo | |||
) | [pure virtual] |
Called by Messaging Server -compatible 3rd party Email plugins to inform NcnList that there is a new message (or more than one message). It should not (necessarily) be called for each new message but, say, at the end of synchronisation when one or more new messages have been received. It displays a 'New email' message with softkeys allowing direct navigation to the email folder Parameter aInfo is reserved for future use and is not handled in any way currently. Implementation of aIndicationType may vary between devices
Parameter | Description |
---|---|
aMailBox | The service id of the email MTM |
aIndicationType | Indication type for new messages. May be any combination of enumeration TIndicationType values. |
aInfo | Optional info about message (subject, sender etc.). Not supported |
Returns: KErrNone for success, or system error code