ipsservices/ipssosplugin/src/ipsplgcreateforwardmessageoperation.cpp
branchRCL_3
changeset 63 d189ee25cf9d
equal deleted inserted replaced
61:dcf0eedfc1a3 63:d189ee25cf9d
       
     1 /*
       
     2 * Copyright (c) 2006-2008 Nokia Corporation and/or its subsidiary(-ies). 
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description: This file implements class CIpsPlgCreateForwardMessageOperation.
       
    15 *
       
    16 */
       
    17 
       
    18 // <qmail>
       
    19 
       
    20 // INCLUDE FILES
       
    21 #include "emailtrace.h"
       
    22 #include "ipsplgheaders.h"
       
    23 
       
    24 // <qmail> removed comment
       
    25 
       
    26 // ================= MEMBER FUNCTIONS =======================
       
    27 
       
    28 // ----------------------------------------------------------------------------
       
    29 // CIpsPlgCreateForwardMessageOperation::CIpsPlgCreateForwardMessageOperation
       
    30 // ----------------------------------------------------------------------------
       
    31 //
       
    32 //<qmail> aSmtpService changed to reference
       
    33 //<qmail> KMsvNullIndexEntry para removed
       
    34 CIpsPlgCreateForwardMessageOperation::CIpsPlgCreateForwardMessageOperation(
       
    35     CIpsPlgSmtpService& aSmtpService,
       
    36     CMsvSession& aMsvSession,
       
    37     TRequestStatus& aObserverRequestStatus,
       
    38     TMsvPartList aPartList,
       
    39     TFSMailMsgId aMailBoxId,
       
    40     TMsvId aOriginalMessageId, 
       
    41     MFSMailRequestObserver& aOperationObserver,
       
    42     TInt aRequestId ) 
       
    43     :
       
    44     CIpsPlgCreateMessageOperation(
       
    45         aSmtpService,
       
    46         aMsvSession,
       
    47         aObserverRequestStatus,
       
    48         aPartList,
       
    49         aMailBoxId,
       
    50         aOperationObserver,
       
    51         aRequestId),
       
    52     iOriginalMessageId(aOriginalMessageId)
       
    53     {
       
    54     FUNC_LOG;
       
    55     }
       
    56 //</qmail>	
       
    57 
       
    58 
       
    59 // ----------------------------------------------------------------------------
       
    60 // CIpsPlgCreateForwardMessageOperation::NewL
       
    61 // ----------------------------------------------------------------------------
       
    62 //
       
    63 //<qmail> aSmtpService changed to reference
       
    64 CIpsPlgCreateForwardMessageOperation* CIpsPlgCreateForwardMessageOperation::NewL(
       
    65     CIpsPlgSmtpService& aSmtpService,
       
    66     CMsvSession& aMsvSession,
       
    67     TRequestStatus& aObserverRequestStatus,
       
    68     TMsvPartList aPartList,
       
    69     TFSMailMsgId aMailBoxId,
       
    70     TMsvId aOriginalMessageId, 
       
    71     MFSMailRequestObserver& aOperationObserver,
       
    72     TInt aRequestId )
       
    73 //</qmail>	
       
    74     {
       
    75     FUNC_LOG;
       
    76     CIpsPlgCreateForwardMessageOperation* self =
       
    77         new (ELeave) CIpsPlgCreateForwardMessageOperation(
       
    78             aSmtpService, 
       
    79             aMsvSession, 
       
    80             aObserverRequestStatus,
       
    81             aPartList, 
       
    82             aMailBoxId, 
       
    83             aOriginalMessageId, 
       
    84             aOperationObserver, 
       
    85             aRequestId );
       
    86     CleanupStack::PushL( self );
       
    87     // <qmail>
       
    88     self->ConstructL(); // Use base class constructor
       
    89     // </qmail>
       
    90     CleanupStack::Pop( self ); 
       
    91     return self;
       
    92     }
       
    93 
       
    94 // ----------------------------------------------------------------------------
       
    95 // CIpsPlgCreateForwardMessageOperation::~CIpsPlgCreateForwardMessageOperation
       
    96 // ----------------------------------------------------------------------------
       
    97 //
       
    98 CIpsPlgCreateForwardMessageOperation::~CIpsPlgCreateForwardMessageOperation()
       
    99     {
       
   100     }
       
   101 
       
   102 // ----------------------------------------------------------------------------
       
   103 // CIpsPlgCreateForwardMessageOperation::RunL
       
   104 // ----------------------------------------------------------------------------
       
   105 //
       
   106 void CIpsPlgCreateForwardMessageOperation::RunL()
       
   107     {
       
   108     FUNC_LOG;
       
   109 
       
   110     if( iStatus.Int() == KErrNone )
       
   111         {
       
   112         // new message creation has finished so make an FS type message
       
   113         CFSMailMessage* newMessage = NULL;
       
   114         //<qmail> TRAP removed
       
   115         TMsvId msgId;
       
   116         
       
   117         msgId = GetIdFromProgressL( iOperation->FinalProgress() );
       
   118             
       
   119         newMessage = iSmtpService.CreateFSMessageAndSetFlagsL( 
       
   120                 msgId, iOriginalMessageId, iFSMailboxId.Id(), ETrue );
       
   121         //</qmail>
       
   122         // relay the created message (observer takes ownership)
       
   123         SignalFSObserver( iStatus.Int(), newMessage );        
       
   124         }
       
   125     
       
   126     // nothing left to process, so complete the observer
       
   127     TRequestStatus* status = &iObserverRequestStatus;
       
   128     User::RequestComplete( status, iStatus.Int() );
       
   129     }
       
   130 
       
   131 // ----------------------------------------------------------------------------
       
   132 // CIpsPlgCreateForwardMessageOperation::StartMessageCreationL
       
   133 // ----------------------------------------------------------------------------
       
   134 //
       
   135 void CIpsPlgCreateForwardMessageOperation::StartMessageCreationL()
       
   136     {
       
   137     FUNC_LOG;
       
   138     delete iOperation;
       
   139     iOperation = NULL;
       
   140     //<qmail> commented parameter removed
       
   141     // Start a new operation, execution continues in RunL 
       
   142     // once the operation has finished.
       
   143     iOperation = CImEmailOperation::CreateForwardL(
       
   144             iStatus, 
       
   145             iMsvSession,
       
   146             iOriginalMessageId,
       
   147             KMsvDraftEntryId,
       
   148             iPartList, 
       
   149             KIpsPlgForwardSubjectFormat,
       
   150             KMsvEmailTypeListMHTMLMessage,
       
   151             KUidMsgTypeSMTP);
       
   152     //</qmail>
       
   153     }
       
   154 
       
   155 //  End of File
       
   156 
       
   157 // </qmail>