MNcnNotification Class Reference

class MNcnNotification

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

Public Member Functions
~MNcnNotification()
MNcnNotification *CreateMNcnNotificationL()
TInt MarkUnread(const TMsvId &)
TInt NewMessages(const TMsvId &, TIndicationType, const MDesCArray &)
Public Member Enumerations
enumTIndicationType { EIndicationIcon = EIndicationIconBit, EIndicationNormal = EIndicationIconBit | EIndicationToneBit | EIndicationSoftNoteBit, EIndicationToneAndIcon = EIndicationIconBit | EIndicationToneBit }
Private Member Enumerations
enumTIndicationTypeBits { EIndicationIconBit = 0x1, EIndicationToneBit = 0x2, EIndicationSoftNoteBit = 0x4 }
Private Attributes
TUid iDtor_ID_Key

Constructor & Destructor Documentation

~MNcnNotification()

~MNcnNotification()[inline, virtual]

Destructor.

Member Functions Documentation

CreateMNcnNotificationL()

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()!!

MarkUnread(const TMsvId &)

TInt MarkUnread(const TMsvId &aMailBox)[pure virtual]

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'.

Parameters

const TMsvId & aMailBoxThe id identifying the mailbox or mail folder containing the message(s) to be marked as unread.

NewMessages(const TMsvId &, TIndicationType, const MDesCArray &)

TInt NewMessages(const TMsvId &aMailBox,
TIndicationTypeaIndicationType,
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

Parameters

const TMsvId & aMailBoxThe service id of the email MTM
TIndicationType aIndicationTypeIndication type for new messages. May be any combination of enumeration TIndicationType values.
const MDesCArray & aInfoOptional info about message (subject, sender etc.). Not supported

Member Enumerations Documentation

Enum TIndicationType

Indication type enumeration.

Enumerators

EIndicationIcon = EIndicationIconBit
EIndicationNormal = EIndicationIconBit | EIndicationToneBit | EIndicationSoftNoteBit
EIndicationToneAndIcon = EIndicationIconBit | EIndicationToneBit

Enum TIndicationTypeBits

Indication type bit enumeration.

Enumerators

EIndicationIconBit = 0x1
EIndicationToneBit = 0x2
EIndicationSoftNoteBit = 0x4

Member Data Documentation

TUid iDtor_ID_Key

TUid iDtor_ID_Key[private]