diff -r 000000000000 -r c9bc50fca66e usbmgmt/usbmgr/host/fdf/test/t_fdf/activeconsole.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/usbmgmt/usbmgr/host/fdf/test/t_fdf/activeconsole.h Tue Feb 02 02:02:59 2010 +0200 @@ -0,0 +1,66 @@ +/* +* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +#include +#include +#include "testmanager.h" + +class CTestBase; +class CConsoleBase; + +class CActiveConsole : public CActive, public MTestManager +/** + * Active Object console class. This is the means by which the user interacts + * with the program. + */ + { +public: + static CActiveConsole* NewLC(CConsoleBase& aConsole); + ~CActiveConsole(); + +public: + void RequestCharacter(); + TKeyCode Getch(); + +private: + CActiveConsole(CConsoleBase& aConsole); + void ConstructL(); + +private: // utility + void SelectTestL(); + void StopCurrentTest(); + void DisplayMainMenu(); + void DoActionKeyL(TKeyCode aKey); + +private: // from MTestManager + void TestFinished(); + void Write(TRefByValue aFmt, ...); + void WriteNoReturn(TRefByValue aFmt, ...); + void GetNumberL(TUint& aNumber); + +private: // from CActive + void RunL(); + void DoCancel(); + TInt RunError(TInt aError); + +private: // owned + CTestBase* iTest; + TBuf8<10> iInputBuffer; + +private: // unowned + CConsoleBase& iConsole; + };