CConsoleBase Class Reference

#include <e32cons.h>

class CConsoleBase : public CBase

Inherits from

Public Member Functions
virtual ~CConsoleBase()
pure virtual voidClearScreen()
pure virtual voidClearToEndOfLine()
pure virtual TInt Create(const TDesC &, TSize)
pure virtual TPoint CursorPos()
IMPORT_C TKeyCodeGetch()
pure virtual TKeyCode KeyCode()
pure virtual TUint KeyModifiers()
IMPORT_C voidPrintf(TRefByValue< const TDesC >, ...)
pure virtual voidRead(TRequestStatus &)
pure virtual voidReadCancel()
pure virtual TSize ScreenSize()
pure virtual voidSetCursorHeight(TInt)
pure virtual voidSetCursorPosAbs(const TPoint &)
pure virtual voidSetCursorPosRel(const TPoint &)
IMPORT_C voidSetPos(TInt)
IMPORT_C voidSetPos(TInt, TInt)
pure virtual voidSetTitle(const TDesC &)
IMPORT_C TIntWhereX()
IMPORT_C TIntWhereY()
pure virtual voidWrite(const TDesC &)
Protected Member Functions
CConsoleBase()
virtual IMPORT_C TIntExtension_(TUint, TAny *&, TAny *)
Inherited Functions
CBase::CBase()
CBase::Delete(CBase *)
CBase::operator new(TUint)
CBase::operator new(TUint,TAny *)
CBase::operator new(TUint,TLeave)
CBase::operator new(TUint,TLeave,TUint)
CBase::operator new(TUint,TUint)
CBase::~CBase()

Detailed Description

A base class that defines a console interface.

Constructor & Destructor Documentation

CConsoleBase ( )

IMPORT_CCConsoleBase()[protected]

Default constructor.

~CConsoleBase ( )

IMPORT_C~CConsoleBase()[virtual]

Destructor.

Member Function Documentation

ClearScreen ( )

voidClearScreen()[pure virtual]

Clears the console.

ClearToEndOfLine ( )

voidClearToEndOfLine()[pure virtual]

Clears the console from the current cursor position to the end of the line.

Create ( const TDesC &, TSize )

TInt Create(const TDesC &aTitle,
TSizeaSize
)[pure virtual]

Creates a new console window.

ParameterDescription
aTitleThe title text for the console. This should not be longer than 256 characters.
aSizeThe size of the console window.

Returns: KErrNone, if successful; otherwise one of the other system wide error codes.

CursorPos ( )

TPoint CursorPos()const [pure virtual]

Gets the current cursor position relative to the console window.

Returns: The current cursor position.

Extension_ ( TUint, TAny *&, TAny * )

IMPORT_C TIntExtension_(TUintaExtensionId,
TAny *&a0,
TAny *a1
)[protected, virtual]

Reimplemented from CBase::Extension_(TUint,TAny *&,TAny *)

Extension function

Getch ( )

IMPORT_C TKeyCodeGetch()

Gets a character from the console.

Returns: the key code from the console.

KeyCode ( )

TKeyCode KeyCode()const [pure virtual]

Gets the current key code value.

Returns: The key code value.

KeyModifiers ( )

TUint KeyModifiers()const [pure virtual]

Gets the current key modifiers.

Returns: The key modifiers.

Printf ( TRefByValue< const TDesC >, ... )

IMPORT_C voidPrintf(TRefByValue< const TDesC >aFmt,
...
)

Prints characters to the console window.

ParameterDescription
aFmtThe non-modifiable descriptor containing the format string. The TRefByValue class provides a constructor which takes a TDesC type.

Read ( TRequestStatus & )

voidRead(TRequestStatus &aStatus)[pure virtual]

Gets a keystroke from the console window, asynchronously.

ParameterDescription
aStatusThe request status object.

ReadCancel ( )

voidReadCancel()[pure virtual]

Cancels any outstanding request to get a keystroke from the console window.

ScreenSize ( )

TSize ScreenSize()const [pure virtual]

Gets the size of the console.

SetCursorHeight ( TInt )

voidSetCursorHeight(TIntaPercentage)[pure virtual]

Sets the percentage height of the cursor.

ParameterDescription
aPercentageThe percentage height. This is a value from 0 to 100. If 0 is specified, then no cursor is displayed.

SetCursorPosAbs ( const TPoint & )

voidSetCursorPosAbs(const TPoint &aPoint)[pure virtual]

Puts the cursor at the absolute position in the window.

ParameterDescription
aPointThe cursor position.

SetCursorPosRel ( const TPoint & )

voidSetCursorPosRel(const TPoint &aPoint)[pure virtual]

Puts the cursor at the specified position relative to the current cursor position.

ParameterDescription
aPointThe cursor position.

SetPos ( TInt )

IMPORT_C voidSetPos(TIntaX)

Sets the cursor's x-position.

ParameterDescription
aXThe x-position.

SetPos ( TInt, TInt )

IMPORT_C voidSetPos(TIntaX,
TIntaY
)

Sets the cursor's x-position and y-position.

ParameterDescription
aXThe x-position.
aYThe y-position.

SetTitle ( const TDesC & )

voidSetTitle(const TDesC &aTitle)[pure virtual]

Sets a new console title.

ParameterDescription
aTitleThe title text for the console. This should not be longer than 256 characters.

WhereX ( )

IMPORT_C TIntWhereX()const

Gets the cursor's x-position.

Returns: The cursor's x-position.

WhereY ( )

IMPORT_C TIntWhereY()const

Gets the cursor's y-position.

Returns: The cursor's y-position.

Write ( const TDesC & )

voidWrite(const TDesC &aDes)[pure virtual]

Writes the content of the specified descriptor to the console window.

ParameterDescription
aDesDescriptor containing the characters to be written to the console window.