email/pop3andsmtpmtm/imapservermtm/test/inc/T_ImapBadlyFormedAddressClient.h
changeset 25 84d9eb65b26f
equal deleted inserted replaced
23:238255e8b033 25:84d9eb65b26f
       
     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 __T_IMAPADLYFORMEDADDRESSCLIENT_H__
       
    17 #define __T_IMAPADLYFORMEDADDRESSCLIENT_H__
       
    18 
       
    19 #include <e32base.h>
       
    20 #include <msvapi.h>
       
    21 #include <imapconnectionobserver.h>
       
    22 #include "cspoofserver.h"
       
    23 #include <cemailaccounts.h>
       
    24 
       
    25 class CClientMtmRegistry;
       
    26 
       
    27 // For loading the serial comms device drivers 
       
    28 #if defined (__WINS__)
       
    29 	#define PDD_NAME		_L("ECDRV")
       
    30 	#define LDD_NAME		_L("ECOMM")
       
    31 #else
       
    32 	#define PDD_NAME		_L("EUART1")
       
    33 	#define LDD_NAME		_L("ECOMM")
       
    34 #endif
       
    35 
       
    36 class TDummySessionObserver : public CBase, public MMsvSessionObserver
       
    37 	{
       
    38 public:
       
    39 	void HandleSessionEventL(TMsvSessionEvent aEvent, TAny* aArg1, TAny* aArg2, TAny* aArg3);
       
    40 	};
       
    41 
       
    42 class CImapBadlyFormedAddressClient : public CActive, public MMsvImapConnectionObserver
       
    43 	{
       
    44 public:
       
    45 	IMPORT_C static CImapBadlyFormedAddressClient* NewL(MImapTestEventHandler* aOwner);
       
    46 	IMPORT_C static CImapBadlyFormedAddressClient* NewLC(MImapTestEventHandler* aOwner);
       
    47 	~CImapBadlyFormedAddressClient();
       
    48 	void StartL();
       
    49 	void CreateImapAccountL();
       
    50 	TImapAccount GetImapAccount();
       
    51 
       
    52 private:
       
    53 	CImapBadlyFormedAddressClient(MImapTestEventHandler* aOwner);
       
    54 	void ConstructL();
       
    55 
       
    56 	// From CActive
       
    57 	virtual void DoCancel();
       
    58 	virtual void RunL();
       
    59 	virtual TInt RunError(TInt aError);
       
    60 	
       
    61 	//implementation of pure virtual inherited from MMsvImapConnectionObserver 
       
    62 	virtual void HandleImapConnectionEvent(TImapConnectionEvent aConnectionState);
       
    63 
       
    64 private:
       
    65 	enum TIMAPClientState 
       
    66 		{
       
    67 		EDisconnect, 
       
    68 		EComplete
       
    69 		};
       
    70 		
       
    71 	CEmailAccounts* iAccounts;
       
    72 	TImapAccount iImapAccount;
       
    73 	CMsvSession* iSession;
       
    74 	CBaseMtm* iClientMtm;
       
    75 	CClientMtmRegistry*	iClientRegistry;
       
    76 	TDummySessionObserver*	iSessionObserver;
       
    77 	CMsvOperation* iMsvOperation;
       
    78 	TIMAPClientState iNextStep;
       
    79 	CMsvEntrySelection* iSelection;
       
    80 	MImapTestEventHandler* iOwner;
       
    81 	};
       
    82 
       
    83 #endif  //__T_IMAPADLYFORMEDADDRESSCLIENT_H__