49
|
1 |
/*
|
|
2 |
* Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
|
|
3 |
* All rights reserved.
|
|
4 |
* This component and the accompanying materials are made available
|
|
5 |
* under the terms of "Eclipse Public License v1.0"
|
|
6 |
* which accompanies this distribution, and is available
|
|
7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
|
8 |
*
|
|
9 |
* Initial Contributors:
|
|
10 |
* Nokia Corporation - initial contribution.
|
|
11 |
*
|
|
12 |
* Contributors:
|
|
13 |
*
|
|
14 |
* Description:
|
|
15 |
*
|
|
16 |
*/
|
|
17 |
|
|
18 |
#include <e32base.h>
|
|
19 |
#include <e32keys.h>
|
|
20 |
#include "testmanager.h"
|
|
21 |
|
|
22 |
class CTestBase;
|
|
23 |
class CConsoleBase;
|
|
24 |
|
|
25 |
class CActiveConsole : public CActive, public MTestManager
|
|
26 |
/**
|
|
27 |
* Active Object console class. This is the means by which the user interacts
|
|
28 |
* with the program.
|
|
29 |
*/
|
|
30 |
{
|
|
31 |
public:
|
|
32 |
static CActiveConsole* NewLC(CConsoleBase& aConsole);
|
|
33 |
~CActiveConsole();
|
|
34 |
|
|
35 |
public:
|
|
36 |
void RequestCharacter();
|
|
37 |
TKeyCode Getch();
|
|
38 |
|
|
39 |
private:
|
|
40 |
CActiveConsole(CConsoleBase& aConsole);
|
|
41 |
void ConstructL();
|
|
42 |
|
|
43 |
private: // utility
|
|
44 |
void SelectTestL();
|
|
45 |
void StopCurrentTest();
|
|
46 |
void DisplayMainMenu();
|
|
47 |
void DoActionKeyL(TKeyCode aKey);
|
|
48 |
|
|
49 |
private: // from MTestManager
|
|
50 |
void TestFinished();
|
|
51 |
void Write(TRefByValue<const TDesC8> aFmt, ...);
|
|
52 |
void WriteNoReturn(TRefByValue<const TDesC8> aFmt, ...);
|
|
53 |
void GetNumberL(TUint& aNumber);
|
|
54 |
|
|
55 |
private: // from CActive
|
|
56 |
void RunL();
|
|
57 |
void DoCancel();
|
|
58 |
TInt RunError(TInt aError);
|
|
59 |
|
|
60 |
private: // owned
|
|
61 |
CTestBase* iTest;
|
|
62 |
TBuf8<10> iInputBuffer;
|
|
63 |
|
|
64 |
private: // unowned
|
|
65 |
CConsoleBase& iConsole;
|
|
66 |
};
|