kernel/eka/include/e32twin.h
changeset 0 a41df078684a
child 62 4a8fed1c0ef6
equal deleted inserted replaced
-1:000000000000 0:a41df078684a
       
     1 // Copyright (c) 1995-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 the License "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 // e32\include\e32twin.h
       
    15 // 
       
    16 // WARNING: This file contains some APIs which are internal and are subject
       
    17 //          to change without notice. Such APIs should therefore not be used
       
    18 //          outside the Kernel and Hardware Services package.
       
    19 //
       
    20 
       
    21 #ifndef __E32TWIN_H__
       
    22 #define __E32TWIN_H__
       
    23 #include <e32cons.h>
       
    24 //
       
    25 
       
    26 /** @internalComponent */
       
    27 _LIT(KE32WindowServer,"!E32WindowServer");
       
    28 
       
    29 /** @internalTechnology */
       
    30 enum TEventType
       
    31     {
       
    32     EKeyPress,
       
    33     EMouseClick
       
    34     };
       
    35 
       
    36 /**
       
    37 @publishedPartner
       
    38 @released
       
    39 */
       
    40 enum TVideoMode
       
    41 	{
       
    42 	EMono=1,
       
    43 	EGray4=2,
       
    44 	EGray16=4,
       
    45 	EColor256=8,
       
    46 	EColor4K=12,
       
    47 	EColor64K=16,
       
    48 	EColor16M=24
       
    49 
       
    50 	};
       
    51 
       
    52 /** @internalTechnology */
       
    53 struct SConsoleKey
       
    54 	{
       
    55  	TKeyCode iCode;
       
    56 	TUint iModifiers;
       
    57     TPoint iMousePos;
       
    58     TInt iType;
       
    59 	};
       
    60 
       
    61 /** @internalTechnology */
       
    62 class TConsoleKey : public TPckgBuf<SConsoleKey>
       
    63 	{
       
    64 public:
       
    65 	IMPORT_C TKeyCode Code() const;
       
    66 	IMPORT_C TInt Modifiers() const;
       
    67     IMPORT_C TInt Type() const;
       
    68     IMPORT_C TPoint MousePos() const;
       
    69 	};
       
    70 
       
    71 /** @internalTechnology */
       
    72 class RConsole : public RSessionBase
       
    73 	{
       
    74 public:
       
    75 	IMPORT_C TVersion Version();
       
    76 	TInt Connect();
       
    77 	IMPORT_C TInt Create();
       
    78 	IMPORT_C TInt Init(const TDesC &aName,const TSize &aSize);
       
    79 	IMPORT_C TInt Write(const TDesC &aDes);
       
    80 	IMPORT_C TInt ClearScreen();
       
    81 	IMPORT_C TInt ClearToEndOfLine();
       
    82 	IMPORT_C TInt Destroy();
       
    83 	IMPORT_C TInt SetTitle(const TDesC &aName);
       
    84 	IMPORT_C TInt SetSize(const TSize &aSize);
       
    85 	IMPORT_C TInt SetWindowPosAbs(const TPoint &aPosition);
       
    86 	IMPORT_C TInt SetCursorHeight(TInt aPercentage);
       
    87 	IMPORT_C TInt SetCursorPosAbs(const TPoint &aPosition);
       
    88 	IMPORT_C TInt SetCursorPosRel(const TPoint &aVector);
       
    89 	IMPORT_C TInt Size(TSize &aSize) const;
       
    90 	IMPORT_C TInt ScreenSize(TSize &aSize) const;
       
    91 	IMPORT_C TInt CursorPos(TPoint &aPosition) const;
       
    92 	IMPORT_C TInt Control(const TDesC &aDes);
       
    93 	IMPORT_C TInt Read(TConsoleKey &aKeystroke);
       
    94 	IMPORT_C void Read(TConsoleKey &aKeystroke,TRequestStatus &aStatus);
       
    95 	IMPORT_C TInt ReadCancel();
       
    96 	IMPORT_C TInt SetMode(TVideoMode aMode);
       
    97 	IMPORT_C void SetPaletteEntry(TUint anIndex,TUint8 aRed,TUint8 aGreen,TUint8 aBlue);
       
    98 	IMPORT_C void GetPaletteEntry(TUint anIndex,TUint8 &aRed,TUint8 &aGreen,TUint8 &aBlue);
       
    99 	IMPORT_C void SetTextColors(TUint anFgColor,TUint aBgColor);
       
   100 	IMPORT_C void SetUIColors(TUint aWindowBgColor,TUint aBorderColor,TUint aScreenColor);
       
   101 	IMPORT_C void SetTextAttribute(TTextAttribute anAttribute);
       
   102 	};
       
   103 
       
   104 /** @internalComponent */
       
   105 NONSHARABLE_CLASS(CConsoleTextWin) : public CConsoleBase
       
   106 	{
       
   107 public:
       
   108 	static CConsoleTextWin *NewL(const TDesC &aTitle,TSize aSize);
       
   109 	CConsoleTextWin();
       
   110 	virtual ~CConsoleTextWin();
       
   111 	virtual TInt Create(const TDesC &aTitle,TSize aSize);
       
   112 	virtual void Read(TRequestStatus &aStatus);
       
   113 	virtual void ReadCancel();
       
   114 	virtual void Write(const TDesC &aDes);
       
   115 	virtual TPoint CursorPos() const;
       
   116 	virtual void SetCursorPosAbs(const TPoint &aPoint);
       
   117 	virtual void SetCursorPosRel(const TPoint &aPoint);
       
   118 	virtual void SetCursorHeight(TInt aPercentage);
       
   119 	virtual void SetTitle(const TDesC &aTitle);
       
   120 	virtual void ClearScreen();
       
   121 	virtual void ClearToEndOfLine();
       
   122 	virtual TSize ScreenSize() const;
       
   123 	virtual TKeyCode KeyCode() const;
       
   124 	virtual TUint KeyModifiers() const;
       
   125 	virtual void SetTextAttribute(TTextAttribute anAttribute);
       
   126 	RConsole &Console();
       
   127 private:
       
   128 	TConsoleKey iKey;
       
   129 	RConsole iConsole;
       
   130 	};
       
   131 #endif
       
   132