email/imap4mtm/imapprotocolcontroller/inc/cimapcompoundsyncfolder.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 __CIMAPCOMPOUNDSYNCFOLDER_H__
       
    17 #define __CIMAPCOMPOUNDSYNCFOLDER_H__
       
    18 
       
    19 #include "cimapcompoundbase.h"
       
    20 
       
    21 // Forward declarations
       
    22 class CImapFolder;
       
    23 class CImapSession;
       
    24 class CImapMailStore;
       
    25 
       
    26 /**
       
    27 Compound operation object for synchronising a folder.
       
    28 What is synchronised is controlled at contruction, identifying the folder
       
    29 that is to be synchronised and whether only new or all messages should
       
    30 be synchronised.
       
    31 
       
    32 @internalTechnology
       
    33 @prototype
       
    34 */
       
    35 class CImapCompoundSyncFolder : public CImapCompoundBase
       
    36 	{
       
    37 public:
       
    38 	~CImapCompoundSyncFolder();
       
    39 	
       
    40 	static CImapCompoundSyncFolder* NewL(CImapSyncManager& aSyncManager, CMsvServerEntry& aServerEntry, CImapSettings& aImapSettings, CImapMailStore& aImapMailStore, TBool aNewOnly, TMsvId aFolderId = KMsvNullIndexEntryId);
       
    41 
       
    42 	virtual void StartOperation(TRequestStatus& aStatus, CImapSession& aSession);
       
    43 	virtual void Progress(TImap4CompoundProgress& aCompoundProgress);
       
    44 	
       
    45 	// Support for Bearer Mobility
       
    46 	virtual void ResumeOperationL(TRequestStatus& aStatus, CImapSession& aSession);
       
    47 	virtual void StopForMigrate();
       
    48 
       
    49 private:
       
    50 	CImapCompoundSyncFolder(CImapSyncManager& aSyncManager, CMsvServerEntry& aServerEntry, CImapSettings& aImapSettings, CImapMailStore& aImapMailStore, TBool aNewOnly, TMsvId aFolderId);
       
    51 	void ConstructL();
       
    52 
       
    53 	TBool DoRunLoopL();
       
    54 	void DoCancel();
       
    55 
       
    56 	virtual TInt ProcessNegativeServerResponse();
       
    57 	void DoComplete(TInt& aErr);
       
    58 
       
    59 private:
       
    60 	// reference to the imap mail store.
       
    61 	CImapMailStore& iImapMailStore;
       
    62 	
       
    63 	// Synchronise newly received mail only
       
    64 	TBool iNewOnly;
       
    65 		
       
    66 	// ID of folder to synchronise.
       
    67 	TMsvId iFolderId;
       
    68 
       
    69 	// Compound operation, used for second phase synchronisation.
       
    70 	CImapCompoundBase* iImapCompound;
       
    71 
       
    72 	// Folder to synchronise. No ownership.
       
    73 	CImapFolder* iSyncFolder;
       
    74 	};
       
    75 
       
    76 #endif	// __CIMAPCOMPOUNDSYNCFOLDER_H__