email/pop3andsmtpmtm/imapservermtm/inc/IMAPCOMP.H
changeset 25 84d9eb65b26f
equal deleted inserted replaced
23:238255e8b033 25:84d9eb65b26f
       
     1 // Copyright (c) 1998-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 // CImImap4Compound header
       
    15 // 
       
    16 //
       
    17 
       
    18 #if !defined(__IMAPCOMP_H__)
       
    19 #define __IMAPCOMP_H__
       
    20 
       
    21 #include <mentact.h>
       
    22 #include <msventry.h>
       
    23 #include <imapset.h>
       
    24 
       
    25 // Forward declarations
       
    26 class CImImap4Session;
       
    27 
       
    28 class CImImap4Compound : public CMsgActive
       
    29 /**
       
    30 @internalComponent
       
    31 @released
       
    32 */
       
    33 	{
       
    34 public:
       
    35 	~CImImap4Compound();
       
    36 	static CImImap4Compound* NewL(CImImap4Session* aSession);
       
    37 	void ConstructL(CImImap4Session* aSession);
       
    38 	void SetSession(CImImap4Session* aSession);
       
    39 	void SetEntry(CMsvServerEntry* aEntry);
       
    40 
       
    41 	// The compound operations we provide
       
    42 	void CopyToLocalL(TRequestStatus& aStatus, const TMsvId aSource, const TMsvId aDestination);
       
    43 	void MoveToLocalL(TRequestStatus& aStatus, const TMsvId aSource, const TMsvId aDestination);
       
    44 	void CopyWithinServiceL(TRequestStatus& aStatus, const TMsvId aSource, const TMsvId aDestination);
       
    45 	void CopyWithinServiceL(TRequestStatus& aStatus, const CMsvEntrySelection& aSourceSel, const TMsvId aDestination);
       
    46 	void MoveWithinServiceL(TRequestStatus& aStatus, const TMsvId aSource, const TMsvId aDestination);
       
    47 	void MoveWithinServiceL(TRequestStatus& aStatus, const CMsvEntrySelection& aSourceSel, const TMsvId aDestination);
       
    48 	void CopyFromLocalL(TRequestStatus& aStatus, const TMsvId aSource, const TMsvId aDestination);
       
    49 	void MoveFromLocalL(TRequestStatus& aStatus, const TMsvId aSource, const TMsvId aDestination);
       
    50 	void DeleteL(TRequestStatus& aStatus, const TMsvId aSource);
       
    51 	void DeleteL(TRequestStatus& aStatus, const CMsvEntrySelection& aSourceSel);
       
    52 	void DeleteFolderL(TRequestStatus& aStatus, const TMsvId aSource);
       
    53 	void NewOnlySyncL(TRequestStatus& aStatus, const TMsvId aFolder);
       
    54 	void FullSyncL(TRequestStatus& aStatus, const TMsvId aFolder);
       
    55 	void SelectL(TRequestStatus& aStatus, const TMsvId aFolder);
       
    56 	void SynchroniseL(TRequestStatus& aStatus);
       
    57 	void CreateL(TRequestStatus& aStatus, const TMsvId aParent, const TDesC& aLeafName, const TBool aFolder);
       
    58 	void RenameL(TRequestStatus& aStatus, const TMsvId aTarget, const TDesC& aNewName);
       
    59 	void PopulateL(TRequestStatus& aStatus, const TMsvId aSource, TImImap4GetPartialMailInfo aGetPartialMailInfo);
       
    60 	void SetMessageCount(const TInt aCount);
       
    61 	// Compound operations for when called from the Synchronise task
       
    62 	void SyncCopyToLocalL(TRequestStatus& aStatus, const TMsvId aSource, const TMsvId aDestination);
       
    63 
       
    64 	void UpdatePartialMailInfoToDefaults(TMsvId aDestination);
       
    65 	// Progress reporting
       
    66 	TImap4GenericProgress Progress();
       
    67 
       
    68 private:
       
    69 	CImImap4Compound();
       
    70 	void DoRunL();
       
    71 	TBool DoRunLoopL();
       
    72 	void DoCancel();
       
    73 
       
    74 	TMsvId FindFolderL(const TMsvId aMessage);
       
    75 	void GenericCopyL(TRequestStatus& aStatus, const TMsvId aSource, const TMsvId aDestination, TInt* aSequence);
       
    76 	void GenericCopyL(TRequestStatus& aStatus, const CMsvEntrySelection& aSourceSel, const TMsvId aDestination, TInt* aSequence);
       
    77 	void SetEntryL(const TMsvId aId);
       
    78 
       
    79 	// Sequences of operations
       
    80 	TInt SeqPopulateAttachment[3];
       
    81 	TInt SeqCopyToLocal[7];
       
    82 	TInt SeqMoveToLocal[8];
       
    83 	TInt SeqCopyWithinService[8];
       
    84 	TInt SeqMoveWithinService[9];
       
    85 	TInt SeqCopyFromLocal[4];
       
    86 	TInt SeqMoveFromLocal[8];
       
    87 	TInt SeqDelete[6];
       
    88 	TInt SeqDeleteFolder[8];
       
    89 	TInt SeqNewSync[6];
       
    90 	TInt SeqFullSync[6];
       
    91 	TInt SeqSelect[3];
       
    92 	TInt SeqSynchronise[5];
       
    93 	TInt SeqCreate[5];
       
    94 	TInt SeqRename[5];
       
    95 	TInt SeqSyncCopyToLocal[3];
       
    96 
       
    97 private:
       
    98 	// IMAP4 session to use
       
    99 	CImImap4Session*		iSession;
       
   100 
       
   101 	// Internal state
       
   102 	TInt					iStep;
       
   103 	TInt*					iSequence;
       
   104 	TMsvId					iSource;
       
   105 	TInt					iSelectionStillToCopy;
       
   106  	TInt					iSelectionStillToDelete;
       
   107  	TInt					iMessageSelection;
       
   108  	CMsvEntrySelection*		iSourceSel;	
       
   109 	TMsvId					iSourceFolder;
       
   110 	TMsvId					iDestinationFolder;
       
   111 	TFileName				iLeafName;
       
   112 	TBool					iFolder;
       
   113 	TBool					iIdleBeforeCommand;
       
   114 	TBool					iPopulateCommand;
       
   115 	TBool 					iIdleBeforeFirstPopulate;
       
   116 	TInt 					iMsgCount;
       
   117 		
       
   118 	// Access to message database
       
   119 	CMsvServerEntry*		iEntry;
       
   120 
       
   121 	// saved partial populate info
       
   122 	TImImap4GetPartialMailInfo	iGetPartialMailInfo;
       
   123 	};
       
   124 
       
   125 #endif