buildverification/autosmoketest/messaging/Inc/TestMessSharedData.h
branchRCL_3
changeset 19 4ca382093dae
parent 5 6beaa9cf4752
child 20 493058e57c8c
equal deleted inserted replaced
5:6beaa9cf4752 19:4ca382093dae
     1 // Copyright (c) 2003-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 // This contains CTestMessSharedData
       
    15 // 
       
    16 //
       
    17 
       
    18 #if (!defined __TEST_MESS_SHARED_DATA_H__)
       
    19 #define __TEST_MESS_SHARED_DATA_H__
       
    20 
       
    21 #include <msvapi.h>
       
    22 #include <mtclreg.h>
       
    23 #include <imapconnectionobserver.h>
       
    24 #include <test/testexecutestepbase.h>
       
    25 
       
    26 class  CTestMessSharedData : public CBase, private MMsvSessionObserver
       
    27 {
       
    28 public:
       
    29 	static CTestMessSharedData*	NewL();
       
    30 	~CTestMessSharedData();
       
    31 
       
    32 	void	IMAP4ConnectAndSyncCompleteAfterDisconnectL(TUid aMtmId, TMsvId aMsvId, CTestStep& aStep);
       
    33 	TInt	DeleteEntryL(CTestStep& aStep);
       
    34 
       
    35 	void	DoProcessL();
       
    36 
       
    37 protected:
       
    38 	CTestMessSharedData();
       
    39 
       
    40 private:
       
    41 	void	ConstructL();
       
    42 
       
    43 	//	MMsvSessionObserver implementation
       
    44 	virtual void HandleSessionEventL(TMsvSessionEvent, TAny*, TAny*, TAny*) {}
       
    45 
       
    46 private:
       
    47 	class CMsgEntry : public CActive
       
    48 	{
       
    49 	public:
       
    50 		~CMsgEntry();
       
    51 
       
    52 		virtual void	DoCancel();
       
    53 		virtual void	RunL();
       
    54 		virtual void	DoProcessL(CClientMtmRegistry& aMtmRegistry) = 0;
       
    55 		virtual void	DoCancelProcessL() = 0;
       
    56 
       
    57 	protected:
       
    58 		CMsgEntry(CMsgEntry* aList);
       
    59 
       
    60 		void	ConstructL(CTestStep& aStep);
       
    61 
       
    62 	public:
       
    63 		TName		iName;
       
    64 		CMsgEntry*	iNext;
       
    65 		TBool		iReadyToBeDeleted;
       
    66 	};
       
    67 	class CMsgIMAP4ConnectAndSyncComplete : public CMsgEntry, public MMsvImapConnectionObserver
       
    68 	{
       
    69 	public:
       
    70 		static CMsgIMAP4ConnectAndSyncComplete* NewL(TUid aMtmId, TMsvId aMsvId, CTestStep& aStep, CMsgEntry* aList);
       
    71 		~CMsgIMAP4ConnectAndSyncComplete();
       
    72 
       
    73 		virtual void	RunL();
       
    74 		virtual void	DoProcessL(CClientMtmRegistry& aMtmRegistry);
       
    75 		virtual void	DoCancelProcessL();
       
    76 
       
    77 	protected:
       
    78 		CMsgIMAP4ConnectAndSyncComplete(TUid aMtmId, TMsvId aMsvId, CMsgEntry* aList);
       
    79 
       
    80 	private:		
       
    81 		//	MMsvImapConnectionObserver implementation
       
    82 		void	HandleImapConnectionEvent(TImapConnectionEvent aConnectionEvent);
       
    83 
       
    84 	private:
       
    85 		TUid			iMtmId;
       
    86 		TMsvId			iMsvId;
       
    87 		CBaseMtm*		iBaseMtm;
       
    88 		CMsvOperation*	iOperation;
       
    89 		
       
    90 	};
       
    91 
       
    92 public:
       
    93 	CMsvSession*		iSession;
       
    94 	CClientMtmRegistry*	iMtmRegistry;
       
    95 	CMsgEntry*			iList;
       
    96 
       
    97 private:
       
    98 	CMsgEntry*			iAnyPostStepToDo;
       
    99 	TBool				iDeleteTestStep;
       
   100 };
       
   101 
       
   102 #endif /* __TEST_MESS_SHARED_DATA_H__ */