epoc32/include/e32twin.h
author William Roberts <williamr@symbian.org>
Tue, 16 Mar 2010 16:12:26 +0000
branchSymbian2
changeset 2 2fe1408b6811
permissions -rw-r--r--
Final list of Symbian^2 public API header files
     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 "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members
     5 // which accompanies this distribution, and is available
     6 // at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
     7 //
     8 // Initial Contributors:
     9 // Nokia Corporation - initial contribution.
    10 //
    11 // Contributors:
    12 //
    13 // Description:
    14 // e32\include\e32twin.h
    15 // 
    16 //
    17 
    18 #ifndef __E32TWIN_H__
    19 #define __E32TWIN_H__
    20 #include <e32cons.h>
    21 //
    22 
    23 /** @internalComponent */
    24 _LIT(KE32WindowServer,"!E32WindowServer");
    25 
    26 /** @internalTechnology */
    27 enum TEventType
    28     {
    29     EKeyPress,
    30     EMouseClick
    31     };
    32 
    33 /**
    34 @publishedPartner
    35 @released
    36 */
    37 enum TVideoMode
    38 	{
    39 	EMono=1,
    40 	EGray4=2,
    41 	EGray16=4,
    42 	EColor256=8,
    43 	EColor4K=12,
    44 	EColor64K=16,
    45 	EColor16M=24
    46 
    47 	};
    48 
    49 /** @internalTechnology */
    50 struct SConsoleKey
    51 	{
    52  	TKeyCode iCode;
    53 	TUint iModifiers;
    54     TPoint iMousePos;
    55     TInt iType;
    56 	};
    57 
    58 /** @internalTechnology */
    59 class TConsoleKey : public TPckgBuf<SConsoleKey>
    60 	{
    61 public:
    62 	IMPORT_C TKeyCode Code() const;
    63 	IMPORT_C TInt Modifiers() const;
    64     IMPORT_C TInt Type() const;
    65     IMPORT_C TPoint MousePos() const;
    66 	};
    67 
    68 /** @internalTechnology */
    69 class RConsole : public RSessionBase
    70 	{
    71 public:
    72 	IMPORT_C TVersion Version();
    73 	TInt Connect();
    74 	IMPORT_C TInt Create();
    75 	IMPORT_C TInt Init(const TDesC &aName,const TSize &aSize);
    76 	IMPORT_C TInt Write(const TDesC &aDes);
    77 	IMPORT_C TInt ClearScreen();
    78 	IMPORT_C TInt ClearToEndOfLine();
    79 	IMPORT_C TInt Destroy();
    80 	IMPORT_C TInt SetTitle(const TDesC &aName);
    81 	IMPORT_C TInt SetSize(const TSize &aSize);
    82 	IMPORT_C TInt SetWindowPosAbs(const TPoint &aPosition);
    83 	IMPORT_C TInt SetCursorHeight(TInt aPercentage);
    84 	IMPORT_C TInt SetCursorPosAbs(const TPoint &aPosition);
    85 	IMPORT_C TInt SetCursorPosRel(const TPoint &aVector);
    86 	IMPORT_C TInt Size(TSize &aSize) const;
    87 	IMPORT_C TInt ScreenSize(TSize &aSize) const;
    88 	IMPORT_C TInt CursorPos(TPoint &aPosition) const;
    89 	IMPORT_C TInt Control(const TDesC &aDes);
    90 	IMPORT_C TInt Read(TConsoleKey &aKeystroke);
    91 	IMPORT_C void Read(TConsoleKey &aKeystroke,TRequestStatus &aStatus);
    92 	IMPORT_C TInt ReadCancel();
    93 	IMPORT_C TInt SetMode(TVideoMode aMode);
    94 	IMPORT_C void SetPaletteEntry(TUint anIndex,TUint8 aRed,TUint8 aGreen,TUint8 aBlue);
    95 	IMPORT_C void GetPaletteEntry(TUint anIndex,TUint8 &aRed,TUint8 &aGreen,TUint8 &aBlue);
    96 	IMPORT_C void SetTextColors(TUint anFgColor,TUint aBgColor);
    97 	IMPORT_C void SetUIColors(TUint aWindowBgColor,TUint aBorderColor,TUint aScreenColor);
    98 	IMPORT_C void SetTextAttribute(TTextAttribute anAttribute);
    99 	};
   100 
   101 /** @internalComponent */
   102 NONSHARABLE_CLASS(CConsoleTextWin) : public CConsoleBase
   103 	{
   104 public:
   105 	static CConsoleTextWin *NewL(const TDesC &aTitle,TSize aSize);
   106 	CConsoleTextWin();
   107 	virtual ~CConsoleTextWin();
   108 	virtual TInt Create(const TDesC &aTitle,TSize aSize);
   109 	virtual void Read(TRequestStatus &aStatus);
   110 	virtual void ReadCancel();
   111 	virtual void Write(const TDesC &aDes);
   112 	virtual TPoint CursorPos() const;
   113 	virtual void SetCursorPosAbs(const TPoint &aPoint);
   114 	virtual void SetCursorPosRel(const TPoint &aPoint);
   115 	virtual void SetCursorHeight(TInt aPercentage);
   116 	virtual void SetTitle(const TDesC &aTitle);
   117 	virtual void ClearScreen();
   118 	virtual void ClearToEndOfLine();
   119 	virtual TSize ScreenSize() const;
   120 	virtual TKeyCode KeyCode() const;
   121 	virtual TUint KeyModifiers() const;
   122 	virtual void SetTextAttribute(TTextAttribute anAttribute);
   123 	RConsole &Console();
   124 private:
   125 	TConsoleKey iKey;
   126 	RConsole iConsole;
   127 	};
   128 #endif