email/imap4mtm/imapprotocolcontroller/inc/cimapcompounddelete.h
changeset 0 72b543305e3a
equal deleted inserted replaced
-1:000000000000 0:72b543305e3a
       
     1 // Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     2 // All rights reserved.
       
     3 // This component and the accompanying materials are made available
       
     4 // under the terms of "Eclipse Public License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 //
       
    15 
       
    16 #ifndef __CIMAPCOMPOUNDDELETE_H__
       
    17 #define __CIMAPCOMPOUNDDELETE_H__
       
    18 
       
    19 #include "cimapcompoundbase.h"
       
    20 #include "tmessageflaginfo.h"
       
    21 #include <imapset.h>
       
    22 
       
    23 // forward declarations
       
    24 class CImapFolder;
       
    25 
       
    26 /**
       
    27 Compound operation class, performs necessary sequence of commands to delete
       
    28 a message from a remote mailbox. This may involve SELECTing the appropriate
       
    29 mailbox prior to issuing the STORE command to mark the message as \deleted.
       
    30 Note that this sequence of events calls EXPUNGE - the message is deleted
       
    31 immediately and, once completed, cannot be undeleted.
       
    32 
       
    33 Stop For Migrate Policy:
       
    34 	If messages are from multiple folders, the current folder shall be
       
    35 	completed and then the migration shall be allowed to occur. Remaining
       
    36 	messages shall be be deleted after the migration has completed.
       
    37 
       
    38 
       
    39 @internalTechnology
       
    40 @prototype
       
    41 */
       
    42 class CImapCompoundDelete : public CImapCompoundBase
       
    43 	{
       
    44 public:
       
    45 	~CImapCompoundDelete();
       
    46 	
       
    47 	static CImapCompoundDelete* NewL(CImapSyncManager& aSyncManager,
       
    48 						 			 CMsvServerEntry& aServerEntry,
       
    49 						 			 CImapSettings& aImapSettings,
       
    50 						 			 const CMsvEntrySelection& aSourceSel);
       
    51 	
       
    52 	virtual void StartOperation(TRequestStatus& aStatus, CImapSession& aSession);
       
    53 	virtual void Progress(TImap4CompoundProgress& aCompoundProgress);
       
    54 	
       
    55 	// Support for Bearer Mobility
       
    56 	virtual void ResumeOperationL(TRequestStatus& aStatus, CImapSession& aSession);
       
    57 	
       
    58 
       
    59 private:
       
    60 	CImapCompoundDelete(CImapSyncManager& aSyncManager,
       
    61 						CMsvServerEntry& aServerEntry,
       
    62 						CImapSettings& aImapSettings);
       
    63 	void ConstructL(const CMsvEntrySelection& aSourceSel);
       
    64 	
       
    65 	TBool DoRunLoopL();
       
    66 	void DoCancel();
       
    67 
       
    68 	virtual TInt ProcessNegativeServerResponse();
       
    69 
       
    70 	void DeleteLocalMessagesL();
       
    71 	
       
    72 	
       
    73 private:
       
    74 	TBool        iParentFolderId;
       
    75 	CImapFolder* iParentFolder;		// no ownership
       
    76 	
       
    77 	CMsvEntrySelection* iSourceSel;
       
    78 	RArray<TUint> iMessageUids;
       
    79 	RArrayMessageFlagInfo iFlagInfoResponseArray;
       
    80 	
       
    81 	// count of messages marked for delete
       
    82 	TInt iSelectionToDelete;
       
    83 
       
    84 	// progress
       
    85 	TInt iProgressMsgsToDo;
       
    86 	TInt iProgressMsgsDone;
       
    87 	};
       
    88 
       
    89 #endif	// __CIMAPCOMPOUNDDELETE_H__
       
    90