diff -r 000000000000 -r 7f656887cf89 core/src/console.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/core/src/console.h Wed Jun 23 15:52:26 2010 +0100 @@ -0,0 +1,48 @@ +// console.h +// +// Copyright (c) 2006 - 2010 Accenture. All rights reserved. +// This component and the accompanying materials are made available +// under the terms of the "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: +// Accenture - Initial contribution +// + + +#ifndef __CONSOLE_H__ +#define __CONSOLE_H__ + +#include +#include + + +class MConsoleObserver + { +public: + virtual void CoHandleKey(TUint aKeyCode, TUint aModifiers) = 0; + virtual void CoHandleError(TInt aError) = 0; + }; + + +class CConsoleReader : public CActive + { +public: + static CConsoleReader* NewL(RIoConsoleReadHandle& aStdin, MConsoleObserver& aObserver); + ~CConsoleReader(); +private: + CConsoleReader(RIoConsoleReadHandle& aStdin, MConsoleObserver& aObserver); + void Queue(); +private: // From CActive. + virtual void RunL(); + virtual void DoCancel(); +private: + RIoConsoleReadHandle& iStdin; + MConsoleObserver& iObserver; + TBool iRawRead; + TBuf<1> iRawReadBuf; + }; + + +#endif // __CONSOLE_H__