0
|
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 |
//
|
|
15 |
|
|
16 |
#ifndef __SIMULPROCSERVER_H__
|
|
17 |
#define __SIMULPROCSERVER_H__
|
|
18 |
|
|
19 |
#include <e32base.h>
|
|
20 |
#include <testframework.h>
|
|
21 |
|
|
22 |
enum
|
|
23 |
{
|
|
24 |
EMMTSOpenTestStep,
|
|
25 |
EMMTSStartProcessing,
|
|
26 |
EMMTSStopProcessing,
|
|
27 |
EMMTSClose
|
|
28 |
};
|
|
29 |
|
|
30 |
class CSimulProcTestStep
|
|
31 |
{
|
|
32 |
public:
|
|
33 |
virtual void StartProcessing(TRequestStatus& aStatus)= 0;
|
|
34 |
virtual TVerdict EndProcessingAndReturnResult(TDes8& aMessage) = 0;
|
|
35 |
IMPORT_C virtual ~CSimulProcTestStep();
|
|
36 |
protected:
|
|
37 |
IMPORT_C CSimulProcTestStep();
|
|
38 |
};
|
|
39 |
|
|
40 |
|
|
41 |
|
|
42 |
class CSimulProcServer : public CServer2
|
|
43 |
{
|
|
44 |
public:
|
|
45 |
IMPORT_C virtual CSession2* NewSessionL(const TVersion& aVersion,const RMessage2& aMessage) const;
|
|
46 |
// IMPORT_C virtual void ConstructL(const TDesC& aName);
|
|
47 |
|
|
48 |
virtual CSimulProcTestStep* CreateTestStep(const TDesC& aStepName) const = 0;
|
|
49 |
IMPORT_C virtual void SessionClosed();
|
|
50 |
IMPORT_C virtual ~CSimulProcServer();
|
|
51 |
|
|
52 |
protected:
|
|
53 |
IMPORT_C CSimulProcServer();
|
|
54 |
|
|
55 |
private:
|
|
56 |
|
|
57 |
TInt iSessionCount;
|
|
58 |
};
|
|
59 |
|
|
60 |
|
|
61 |
|
|
62 |
|
|
63 |
class CSimulProcSession : public CSession2
|
|
64 |
{
|
|
65 |
public:
|
|
66 |
class CActiveCallback : public CActive
|
|
67 |
{
|
|
68 |
public:
|
|
69 |
CActiveCallback(const RMessage2& aMessage);
|
|
70 |
|
|
71 |
void RunL();
|
|
72 |
|
|
73 |
void DoCancel();
|
|
74 |
|
|
75 |
TRequestStatus& ActiveStatus();
|
|
76 |
|
|
77 |
private:
|
|
78 |
const RMessage2& iMessage;
|
|
79 |
};
|
|
80 |
|
|
81 |
public:
|
|
82 |
IMPORT_C CSimulProcSession();
|
|
83 |
IMPORT_C virtual ~CSimulProcSession();
|
|
84 |
IMPORT_C virtual void ServiceL(const RMessage2& aMessage);
|
|
85 |
private:
|
|
86 |
CSimulProcTestStep* iTestStep;
|
|
87 |
CActiveCallback* iActiveCallback;
|
|
88 |
|
|
89 |
};
|
|
90 |
|
|
91 |
|
|
92 |
#endif
|