email/pop3andsmtpmtm/clientmtms/inc/IMPREFR.H
changeset 0 72b543305e3a
equal deleted inserted replaced
-1:000000000000 0:72b543305e3a
       
     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 //
       
    15 
       
    16 #if !defined(__IMPREFR_H__)
       
    17 #define __IMPREFR_H__
       
    18 
       
    19 #if !defined (__IMPCMTM_H__)
       
    20 #include "IMPCMTM.H"
       
    21 #endif
       
    22 
       
    23 #if !defined(__IMAPSET_H__)
       
    24 #include "IMAPSET.H"
       
    25 #endif
       
    26 
       
    27 // package buffer for progress info.
       
    28 /**
       
    29 @internalTechnology
       
    30 @released
       
    31 */
       
    32 typedef TPckgBuf<TImap4CompoundProgress> TImap4ProgressBuf;
       
    33 
       
    34 
       
    35 /**
       
    36 @internalComponent
       
    37 @released
       
    38 */
       
    39 enum EImapOpFlags 
       
    40 	{
       
    41 	KImapOpFlagNone                         = 0x0001,
       
    42    KImapOpFlagStartBatch                   = 0x0002,
       
    43    KImapOpFlagCancelBackgroundSynchronise  = 0x0004,
       
    44    KImapOpFlagConnect                      = 0x0008,
       
    45    KImapOpFlagGenINBOX                     = 0x0010,
       
    46    KImapOpFlagFullSync                     = 0x0020,
       
    47 	KImapOpFlagDisconnect                   = 0x0040,
       
    48    KImapOpFlagMarkAllRead                  = 0x0080,
       
    49    KImapOpFlagMarkAllUnRead                = 0x0100,
       
    50    KImapOpFlagEndBatch                     = 0x0200
       
    51 	};
       
    52 
       
    53 const TInt KImapGeneralFirstCommand = 0x1000;
       
    54 
       
    55 /**
       
    56 @internalComponent
       
    57 @released
       
    58 */
       
    59 enum EGeneralOperations
       
    60     {
       
    61     KImapGeneralConnecting = KImapGeneralFirstCommand,
       
    62     KImapGeneralGettingNewMail,
       
    63     KImapGeneralMarkingFolders,
       
    64     KImapGeneralDisconnecting
       
    65     };
       
    66 
       
    67 // create an active object to send the message
       
    68 class CImap4ClientMtm;
       
    69 
       
    70 class CImap4RefreshMBox : public CMsvOperation
       
    71 /**
       
    72 @internalComponent
       
    73 @released
       
    74 */
       
    75 	{
       
    76 public: // Constructors/destructors
       
    77 	IMPORT_C static CImap4RefreshMBox* NewLC(CImap4ClientMtm* aBaseMtm, TMsvId aServiceId,TRequestStatus& aObserverRequestStatus, TInt aOperations);
       
    78 	IMPORT_C static CImap4RefreshMBox* NewL(CImap4ClientMtm* aBaseMtm, TMsvId aServiceId,TRequestStatus& aObserverRequestStatus, TInt aOperations);
       
    79 	IMPORT_C ~CImap4RefreshMBox();
       
    80 public: // Provide info
       
    81 	IMPORT_C const TDesC8& ProgressL();
       
    82 public: // Do work
       
    83     IMPORT_C void StartL();
       
    84 public: //Derived
       
    85 	void RunL();
       
    86 protected:
       
    87 	void DoCancel();
       
    88 	void ConstructL();
       
    89 protected:
       
    90    void DoStartBatchL();
       
    91    void DoEndBatchL();
       
    92    void DoConnectL();
       
    93 	void DoDisconnectL();
       
    94    void DoGenerateInboxL();
       
    95    void DoFolderSyncL();
       
    96 	void DoCancelBackgroundOperationL();
       
    97 	void DoSubscriptionSyncL();
       
    98 	void DoFullSyncL();
       
    99    void DoMarkAllAsReadL();
       
   100 private:
       
   101    void NewOp();
       
   102    void WaitForOp(CMsvOperation* aNewOperation);
       
   103    CImap4RefreshMBox(CImap4ClientMtm* aBaseMtm, TMsvId aServiceId,TRequestStatus& aObserverRequestStatus, TInt aOperations);
       
   104 protected:
       
   105 	  // Data members defined by this class
       
   106 	CImap4ClientMtm* iBaseMtm;
       
   107 	TMsvId iServiceId;
       
   108 	TInt iOperations;
       
   109 	CMsvEntry* iEntry;
       
   110 	CMsvEntrySelection* iSelection;
       
   111 	TImap4CompoundProgress iProgress;
       
   112 	TImap4ProgressBuf iProgressBuf;
       
   113    TInt iCurrentOperation;
       
   114    TInt iErrorCode;
       
   115 	CMsvOperation* iCurrentOp;
       
   116 	};
       
   117 
       
   118 #endif