emailuis/nmframeworkadapter/src/nmfwamessagefetchingoperation.cpp
changeset 43 99bcbff212ad
parent 40 2c62ef3caffd
child 62 a8c646b56683
equal deleted inserted replaced
42:139d4b7b2938 43:99bcbff212ad
    27         mMessageId(messageId),
    27         mMessageId(messageId),
    28         mMailClient(mailClient),
    28         mMailClient(mailClient),
    29         mRequestId(0)
    29         mRequestId(0)
    30 
    30 
    31 {
    31 {
       
    32     NM_FUNCTION;
    32 }
    33 }
    33 
    34 
    34 NmFwaMessageFetchingOperation::~NmFwaMessageFetchingOperation()
    35 NmFwaMessageFetchingOperation::~NmFwaMessageFetchingOperation()
    35 {
    36 {
       
    37     NM_FUNCTION;
       
    38     
    36     doCancelOperation();
    39     doCancelOperation();
    37     NMLOG("NmFwaMessageFetchingOperation::~NmFwaMessageFetchingOperation --->");
       
    38 }
    40 }
    39 
    41 
    40 void NmFwaMessageFetchingOperation::doRunAsyncOperation()
    42 void NmFwaMessageFetchingOperation::doRunAsyncOperation()
    41 {
    43 {
       
    44     NM_FUNCTION;
       
    45     
    42     const TFSMailMsgId mailboxId(mMailboxId.pluginId32(), mMailboxId.id32());
    46     const TFSMailMsgId mailboxId(mMailboxId.pluginId32(), mMailboxId.id32());
    43     const TFSMailMsgId folderId(mFolderId.pluginId32(), mFolderId.id32());
    47     const TFSMailMsgId folderId(mFolderId.pluginId32(), mFolderId.id32());
    44     const TFSMailMsgId messageId(mMessageId.pluginId32(), mMessageId.id32());
    48     const TFSMailMsgId messageId(mMessageId.pluginId32(), mMessageId.id32());
    45 
    49 
    46     CFSMailFolder *folder( NULL );
    50     CFSMailFolder *folder( NULL );
    65 /*!
    69 /*!
    66  * Complete the operation
    70  * Complete the operation
    67  */
    71  */
    68 void NmFwaMessageFetchingOperation::doCompleteOperation()
    72 void NmFwaMessageFetchingOperation::doCompleteOperation()
    69 {
    73 {
       
    74     NM_FUNCTION;
       
    75     
    70     mRequestId = NmNotFoundError;
    76     mRequestId = NmNotFoundError;
    71 }
    77 }
    72 
    78 
    73 /*!
    79 /*!
    74     Cancels the async operation. \sa NmOperation
    80     Cancels the async operation. \sa NmOperation
    75  */
    81  */
    76 void NmFwaMessageFetchingOperation::doCancelOperation()
    82 void NmFwaMessageFetchingOperation::doCancelOperation()
    77 {
    83 {
       
    84     NM_FUNCTION;
       
    85     
    78     if (mRequestId >= 0) {
    86     if (mRequestId >= 0) {
    79         TRAP_IGNORE(mMailClient.CancelL(mRequestId));
    87         TRAP_IGNORE(mMailClient.CancelL(mRequestId));
    80         mRequestId = NmNotFoundError;
    88         mRequestId = NmNotFoundError;
    81     }
    89     }
    82 }
    90 }
    87  \param aEvent plugin event description
    95  \param aEvent plugin event description
    88  \param mailClient Reference to mail client object
    96  \param mailClient Reference to mail client object
    89  */
    97  */
    90 void NmFwaMessageFetchingOperation::RequestResponseL(TFSProgress aEvent, TInt aRequestId)
    98 void NmFwaMessageFetchingOperation::RequestResponseL(TFSProgress aEvent, TInt aRequestId)
    91 {
    99 {
       
   100     NM_FUNCTION;
       
   101     
    92     if (aRequestId == mRequestId) {
   102     if (aRequestId == mRequestId) {
    93         if (aEvent.iProgressStatus == TFSProgress::EFSStatus_RequestComplete ) {
   103         if (aEvent.iProgressStatus == TFSProgress::EFSStatus_RequestComplete ) {
    94             completeOperation(NmNoError);
   104             completeOperation(NmNoError);
    95         }
   105         }
    96         else if (aEvent.iProgressStatus == TFSProgress::EFSStatus_RequestCancelled) {
   106         else if (aEvent.iProgressStatus == TFSProgress::EFSStatus_RequestCancelled) {