email/pop3andsmtpmtm/imapservermtm/test/inc/DecodeIMapClient.h
branchRCL_3
changeset 57 ebe688cedc25
equal deleted inserted replaced
54:fa1df4b99609 57:ebe688cedc25
       
     1 // Copyright (c) 2005-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 // imapclient.h
       
    15 // 
       
    16 //
       
    17 
       
    18 #ifndef __IMAPCLIENT_H__
       
    19 #define __IMAPCLIENT_H__
       
    20 
       
    21 #include <e32cons.h>
       
    22 #include <e32const.h>
       
    23 #include <in_sock.h>
       
    24 #include <nifman.h>
       
    25 #include "emailtestutils.h"
       
    26 #include <iapprefs.h>
       
    27 #include <cemailaccounts.h>
       
    28 #include "impsmtm.h"
       
    29 #include <imapconnectionobserver.h>
       
    30 #include "cspoofserver.h"
       
    31 
       
    32 // For loading the serial comms device drivers 
       
    33 #if defined (__WINS__)
       
    34 	#define PDD_NAME		_L("ECDRV")
       
    35 	#define LDD_NAME		_L("ECOMM")
       
    36 #else
       
    37 	#define PDD_NAME		_L("EUART1")
       
    38 	#define LDD_NAME		_L("ECOMM")
       
    39 #endif
       
    40 
       
    41 class TDummySessionObserver : public CBase , public MMsvSessionObserver
       
    42 	{
       
    43 public:
       
    44 	void HandleSessionEventL(TMsvSessionEvent aEvent, TAny* aArg1, TAny* aArg2, TAny* aArg3);
       
    45 	};
       
    46 
       
    47 class CActiveImapClient : public CActive , public MMsvImapConnectionObserver
       
    48 	{
       
    49 
       
    50 public:
       
    51 	
       
    52 	IMPORT_C static CActiveImapClient* NewL(MImapTestEventHandler* aOwner,TBool aFetchWholeMessage);
       
    53 	IMPORT_C static CActiveImapClient* NewLC(MImapTestEventHandler* aOwner,TBool aFetchWholeMessage);
       
    54 	void StartL();
       
    55 	void CreateImapAccountL();
       
    56 	~CActiveImapClient();
       
    57 	TImapAccount GetAccount();
       
    58 
       
    59 private:
       
    60 	CActiveImapClient();
       
    61 	IMPORT_C void ConstructL(MImapTestEventHandler* aOwner,TBool aFetchWholeMessage);
       
    62 	virtual void DoCancel();
       
    63 	virtual void RunL();
       
    64 	virtual TInt RunError(TInt aError);
       
    65 	
       
    66 	//implementation of pure virtual inherited from MMsvImapConnectionObserver 
       
    67 	virtual void HandleImapConnectionEvent(TImapConnectionEvent aConnectionState);
       
    68 private:
       
    69 
       
    70 	enum TIMAPClientState 
       
    71 		{
       
    72 		EFetch=0,	
       
    73 		EDisconnect, 
       
    74 		EComplete
       
    75 		};
       
    76 		
       
    77 	CEmailAccounts* iAccounts;
       
    78 	TImapAccount iImapAccount;
       
    79 	CImap4ServerMtm* iImapServerMtm;
       
    80 	CMsvSession* iSession;
       
    81 	CBaseMtm* iClientMtm;
       
    82 	CClientMtmRegistry*	iClientRegistry;
       
    83 	TDummySessionObserver*	iSessionObserver;
       
    84 	CMsvOperation* iMsvOperation;
       
    85 	TIMAPClientState iNextStep;
       
    86 	CMsvEntrySelection* iSelection;
       
    87 	TBool iFetchWholeMessage;
       
    88 	MImapTestEventHandler* iOwner;
       
    89 	};
       
    90 
       
    91 #endif  //__IMAPCLIENT_H__