sl@0: // Copyright (c) 1995-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 the License "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: // e32\include\e32twin.h sl@0: // sl@0: // WARNING: This file contains some APIs which are internal and are subject sl@0: // to change without notice. Such APIs should therefore not be used sl@0: // outside the Kernel and Hardware Services package. sl@0: // sl@0: sl@0: #ifndef __E32TWIN_H__ sl@0: #define __E32TWIN_H__ sl@0: #include sl@0: // sl@0: sl@0: /** @internalComponent */ sl@0: _LIT(KE32WindowServer,"!E32WindowServer"); sl@0: sl@0: /** @internalTechnology */ sl@0: enum TEventType sl@0: { sl@0: EKeyPress, sl@0: EMouseClick sl@0: }; sl@0: sl@0: /** sl@0: @publishedPartner sl@0: @released sl@0: */ sl@0: enum TVideoMode sl@0: { sl@0: EMono=1, sl@0: EGray4=2, sl@0: EGray16=4, sl@0: EColor256=8, sl@0: EColor4K=12, sl@0: EColor64K=16, sl@0: EColor16M=24 sl@0: sl@0: }; sl@0: sl@0: /** @internalTechnology */ sl@0: struct SConsoleKey sl@0: { sl@0: TKeyCode iCode; sl@0: TUint iModifiers; sl@0: TPoint iMousePos; sl@0: TInt iType; sl@0: }; sl@0: sl@0: /** @internalTechnology */ sl@0: class TConsoleKey : public TPckgBuf sl@0: { sl@0: public: sl@0: IMPORT_C TKeyCode Code() const; sl@0: IMPORT_C TInt Modifiers() const; sl@0: IMPORT_C TInt Type() const; sl@0: IMPORT_C TPoint MousePos() const; sl@0: }; sl@0: sl@0: /** @internalTechnology */ sl@0: class RConsole : public RSessionBase sl@0: { sl@0: public: sl@0: IMPORT_C TVersion Version(); sl@0: TInt Connect(); sl@0: IMPORT_C TInt Create(); sl@0: IMPORT_C TInt Init(const TDesC &aName,const TSize &aSize); sl@0: IMPORT_C TInt Write(const TDesC &aDes); sl@0: IMPORT_C TInt ClearScreen(); sl@0: IMPORT_C TInt ClearToEndOfLine(); sl@0: IMPORT_C TInt Destroy(); sl@0: IMPORT_C TInt SetTitle(const TDesC &aName); sl@0: IMPORT_C TInt SetSize(const TSize &aSize); sl@0: IMPORT_C TInt SetWindowPosAbs(const TPoint &aPosition); sl@0: IMPORT_C TInt SetCursorHeight(TInt aPercentage); sl@0: IMPORT_C TInt SetCursorPosAbs(const TPoint &aPosition); sl@0: IMPORT_C TInt SetCursorPosRel(const TPoint &aVector); sl@0: IMPORT_C TInt Size(TSize &aSize) const; sl@0: IMPORT_C TInt ScreenSize(TSize &aSize) const; sl@0: IMPORT_C TInt CursorPos(TPoint &aPosition) const; sl@0: IMPORT_C TInt Control(const TDesC &aDes); sl@0: IMPORT_C TInt Read(TConsoleKey &aKeystroke); sl@0: IMPORT_C void Read(TConsoleKey &aKeystroke,TRequestStatus &aStatus); sl@0: IMPORT_C TInt ReadCancel(); sl@0: IMPORT_C TInt SetMode(TVideoMode aMode); sl@0: IMPORT_C void SetPaletteEntry(TUint anIndex,TUint8 aRed,TUint8 aGreen,TUint8 aBlue); sl@0: IMPORT_C void GetPaletteEntry(TUint anIndex,TUint8 &aRed,TUint8 &aGreen,TUint8 &aBlue); sl@0: IMPORT_C void SetTextColors(TUint anFgColor,TUint aBgColor); sl@0: IMPORT_C void SetUIColors(TUint aWindowBgColor,TUint aBorderColor,TUint aScreenColor); sl@0: IMPORT_C void SetTextAttribute(TTextAttribute anAttribute); sl@0: }; sl@0: sl@0: /** @internalComponent */ sl@0: NONSHARABLE_CLASS(CConsoleTextWin) : public CConsoleBase sl@0: { sl@0: public: sl@0: static CConsoleTextWin *NewL(const TDesC &aTitle,TSize aSize); sl@0: CConsoleTextWin(); sl@0: virtual ~CConsoleTextWin(); sl@0: virtual TInt Create(const TDesC &aTitle,TSize aSize); sl@0: virtual void Read(TRequestStatus &aStatus); sl@0: virtual void ReadCancel(); sl@0: virtual void Write(const TDesC &aDes); sl@0: virtual TPoint CursorPos() const; sl@0: virtual void SetCursorPosAbs(const TPoint &aPoint); sl@0: virtual void SetCursorPosRel(const TPoint &aPoint); sl@0: virtual void SetCursorHeight(TInt aPercentage); sl@0: virtual void SetTitle(const TDesC &aTitle); sl@0: virtual void ClearScreen(); sl@0: virtual void ClearToEndOfLine(); sl@0: virtual TSize ScreenSize() const; sl@0: virtual TKeyCode KeyCode() const; sl@0: virtual TUint KeyModifiers() const; sl@0: virtual void SetTextAttribute(TTextAttribute anAttribute); sl@0: RConsole &Console(); sl@0: private: sl@0: TConsoleKey iKey; sl@0: RConsole iConsole; sl@0: }; sl@0: #endif sl@0: