sl@0: // Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies). sl@0: // All rights reserved. sl@0: // This component and the accompanying materials are made available sl@0: // under the terms of "Eclipse Public License v1.0" sl@0: // which accompanies this distribution, and is available sl@0: // at the URL "http://www.eclipse.org/legal/epl-v10.html". sl@0: // sl@0: // Initial Contributors: sl@0: // Nokia Corporation - initial contribution. sl@0: // sl@0: // Contributors: sl@0: // sl@0: // Description: sl@0: // sl@0: sl@0: #ifndef __SIMULPROCSERVER_H__ sl@0: #define __SIMULPROCSERVER_H__ sl@0: sl@0: #include <e32base.h> sl@0: #include <testframework.h> sl@0: sl@0: enum sl@0: { sl@0: EMMTSOpenTestStep, sl@0: EMMTSStartProcessing, sl@0: EMMTSStopProcessing, sl@0: EMMTSClose sl@0: }; sl@0: sl@0: class CSimulProcTestStep sl@0: { sl@0: public: sl@0: virtual void StartProcessing(TRequestStatus& aStatus)= 0; sl@0: virtual TVerdict EndProcessingAndReturnResult(TDes8& aMessage) = 0; sl@0: IMPORT_C virtual ~CSimulProcTestStep(); sl@0: protected: sl@0: IMPORT_C CSimulProcTestStep(); sl@0: }; sl@0: sl@0: sl@0: sl@0: class CSimulProcServer : public CServer2 sl@0: { sl@0: public: sl@0: IMPORT_C virtual CSession2* NewSessionL(const TVersion& aVersion,const RMessage2& aMessage) const; sl@0: // IMPORT_C virtual void ConstructL(const TDesC& aName); sl@0: sl@0: virtual CSimulProcTestStep* CreateTestStep(const TDesC& aStepName) const = 0; sl@0: IMPORT_C virtual void SessionClosed(); sl@0: IMPORT_C virtual ~CSimulProcServer(); sl@0: sl@0: protected: sl@0: IMPORT_C CSimulProcServer(); sl@0: sl@0: private: sl@0: sl@0: TInt iSessionCount; sl@0: }; sl@0: sl@0: sl@0: sl@0: sl@0: class CSimulProcSession : public CSession2 sl@0: { sl@0: public: sl@0: class CActiveCallback : public CActive sl@0: { sl@0: public: sl@0: CActiveCallback(const RMessage2& aMessage); sl@0: sl@0: void RunL(); sl@0: sl@0: void DoCancel(); sl@0: sl@0: TRequestStatus& ActiveStatus(); sl@0: sl@0: private: sl@0: const RMessage2& iMessage; sl@0: }; sl@0: sl@0: public: sl@0: IMPORT_C CSimulProcSession(); sl@0: IMPORT_C virtual ~CSimulProcSession(); sl@0: IMPORT_C virtual void ServiceL(const RMessage2& aMessage); sl@0: private: sl@0: CSimulProcTestStep* iTestStep; sl@0: CActiveCallback* iActiveCallback; sl@0: sl@0: }; sl@0: sl@0: sl@0: #endif