diff -r 238255e8b033 -r 84d9eb65b26f email/pop3andsmtpmtm/imapservermtm/test/inc/DecodeIMapClient.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/email/pop3andsmtpmtm/imapservermtm/test/inc/DecodeIMapClient.h Mon May 03 12:29:07 2010 +0300 @@ -0,0 +1,91 @@ +// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). +// All rights reserved. +// This component and the accompanying materials are made available +// under the terms of "Eclipse Public License v1.0" +// which accompanies this distribution, and is available +// at the URL "http://www.eclipse.org/legal/epl-v10.html". +// +// Initial Contributors: +// Nokia Corporation - initial contribution. +// +// Contributors: +// +// Description: +// imapclient.h +// +// + +#ifndef __IMAPCLIENT_H__ +#define __IMAPCLIENT_H__ + +#include +#include +#include +#include +#include "emailtestutils.h" +#include +#include +#include "impsmtm.h" +#include +#include "cspoofserver.h" + +// For loading the serial comms device drivers +#if defined (__WINS__) + #define PDD_NAME _L("ECDRV") + #define LDD_NAME _L("ECOMM") +#else + #define PDD_NAME _L("EUART1") + #define LDD_NAME _L("ECOMM") +#endif + +class TDummySessionObserver : public CBase , public MMsvSessionObserver + { +public: + void HandleSessionEventL(TMsvSessionEvent aEvent, TAny* aArg1, TAny* aArg2, TAny* aArg3); + }; + +class CActiveImapClient : public CActive , public MMsvImapConnectionObserver + { + +public: + + IMPORT_C static CActiveImapClient* NewL(MImapTestEventHandler* aOwner,TBool aFetchWholeMessage); + IMPORT_C static CActiveImapClient* NewLC(MImapTestEventHandler* aOwner,TBool aFetchWholeMessage); + void StartL(); + void CreateImapAccountL(); + ~CActiveImapClient(); + TImapAccount GetAccount(); + +private: + CActiveImapClient(); + IMPORT_C void ConstructL(MImapTestEventHandler* aOwner,TBool aFetchWholeMessage); + virtual void DoCancel(); + virtual void RunL(); + virtual TInt RunError(TInt aError); + + //implementation of pure virtual inherited from MMsvImapConnectionObserver + virtual void HandleImapConnectionEvent(TImapConnectionEvent aConnectionState); +private: + + enum TIMAPClientState + { + EFetch=0, + EDisconnect, + EComplete + }; + + CEmailAccounts* iAccounts; + TImapAccount iImapAccount; + CImap4ServerMtm* iImapServerMtm; + CMsvSession* iSession; + CBaseMtm* iClientMtm; + CClientMtmRegistry* iClientRegistry; + TDummySessionObserver* iSessionObserver; + CMsvOperation* iMsvOperation; + TIMAPClientState iNextStep; + CMsvEntrySelection* iSelection; + TBool iFetchWholeMessage; + MImapTestEventHandler* iOwner; + }; + +#endif //__IMAPCLIENT_H__