buildverification/autosmoketest/messaging/Inc/TestMessProcessor.h
branchRCL_3
changeset 19 4ca382093dae
parent 5 6beaa9cf4752
child 20 493058e57c8c
equal deleted inserted replaced
5:6beaa9cf4752 19:4ca382093dae
     1 // Copyright (c) 2002-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 // TestMessProcessor.cpp
       
    15 // This contains CTestMessProcessor which an active object utility
       
    16 // used for send/recieving or any time consuming 
       
    17 // 
       
    18 //
       
    19 
       
    20 #if (!defined __TEST_MESS_PROCESSOR_H__)
       
    21 #define __TEST_MESS_PROCESSOR_H__
       
    22 
       
    23 //Epoc Include
       
    24 #include <e32base.h>
       
    25 #include <msvapi.h>
       
    26 #include <miuthdr.h>
       
    27 
       
    28 class CTestStep;
       
    29 
       
    30 class MTestMessProcessorClient
       
    31 	{
       
    32 public:
       
    33 	virtual TBool			MoreOperations() const = 0;
       
    34 	virtual CMsvOperation*	CreateOperationL(TRequestStatus& aStatus) = 0;
       
    35 	virtual TInt			DisplayProgressL(TBool aFinalProgress, CMsvOperation* aMsvOperation) = 0;
       
    36 	};
       
    37 
       
    38 /**
       
    39  This class is an active object utility used for send/recieving
       
    40  or any time consuming
       
    41 */
       
    42 class CTestMessProcessor : public CActive
       
    43 	{
       
    44 public:
       
    45 	virtual ~CTestMessProcessor();
       
    46 	static CTestMessProcessor*	NewL(CTestStep& aTestStep, CMsvSession& aSession);
       
    47 
       
    48 	void	RunL();
       
    49 
       
    50 	void	DisplayProgress();
       
    51 	void	SendEmailMessageL(TMsvId aMsgId, MTestMessProcessorClient* aClient);
       
    52 
       
    53 	//Sends the SMS message
       
    54 	void	SendSmsMessageL(TMsvId aMsgId, MTestMessProcessorClient* aClient, TBool aCancelSms);
       
    55 	void	SendMmsMessageL(TMsvId aMsgId, MTestMessProcessorClient* aClient);
       
    56 	void	MtmRequestL(TMsvId aAccountId, MTestMessProcessorClient* aClient);
       
    57 
       
    58 protected:
       
    59 	CTestMessProcessor(CTestStep& aTestStep, CMsvSession& aSession /*, MTestInstrumentation& aInstrumentation */);
       
    60 	void	ConstructL();
       
    61 	void	DoCancel();
       
    62 
       
    63 private:
       
    64 	enum EState
       
    65 		{
       
    66 		EStatePrepareToSendMsg,
       
    67 		EStateRequest,
       
    68 		};
       
    69 
       
    70 	EState						iState;
       
    71 	CTestStep&					iTestStep;
       
    72 	CMsvSession&				iSession;
       
    73 
       
    74 	//	Send message parameters saved for RunL
       
    75 	CMsvEntry*					iEntry;
       
    76 	TMsvId						iMsgId;
       
    77 	MTestMessProcessorClient*	iClient;
       
    78 	TMsvEntry					iMsgEntry;
       
    79 	CMsvOperation*				iMsvOperation;
       
    80 	/**
       
    81 	 Boolean value for the Cancel sms flag
       
    82 	*/
       
    83 	TBool						iCancelSms;
       
    84 };
       
    85 
       
    86 #endif /* __TEST_MESS_PROCESSOR_H__ */