Symbian Developer Library

SYMBIAN OS V6.1 EDITION FOR C++

[Index] [Glossary] [Previous] [Next]



Location: eikconso.h
Link against: eikcoctl.lib

Class CEikConsoleScreen

CEikConsoleScreen

Support

Supported from 6.1

Description

Provides functions to enable construction and manipulation of a console screen.

Derivation

CConsoleBase 
CEikConsoleScreenProvides functions to enable construction and manipulation of a console screen

Defined in CEikConsoleScreen:
Att(), CEikConsoleScreen(), ClearChars(), ClearScreen(), ClearToEndOfLine(), ConsoleControl(), ConstructL(), Create(), CursorPos(), Down(), DrawCursor(), DrawCursorInSight(), DrawInSight(), EEikConsWinInChars, EEikConsWinInPixels, ENoInitialCursor, EUseBackedUpWindow, FlushChars(), Font(), HideCursor(), HistorySize(), Left(), Lf(), MoveTopLeft(), Redraw(), RetrieveL(), Right(), ScreenSize(), ScrollChars(), SelectCursor(), Selection(), SetAllPrintable(), SetAtt(), SetConsWin(), SetCursorHeight(), SetCursorPosAbs(), SetCursorPosRel(), SetFontL(), SetHistorySizeL(), SetKeepCursorInSight(), SetPureCRLF(), SetScrollBarVisibilityL(), SetScrollLock(), SetSelection(), SetTitle(), SetTitleL(), TEikConsWinUnits, TEikConsoleFlags, Title(), Up(), UpdateScrollBars(), Write(), ~CEikConsoleScreen()


Construction and destruction


CEikConsoleScreen()

CEikConsoleScreen();

Description

Constructor.


ConstructL()

void ConstructL(const TDesC &aTitle,TInt aFlags);

Description

Completes construction specifying the title and whether to use a backed up window and initial cursor. This version of ConstructL() places the top left corner of the console window at position 0,0 and uses the whole screen area.

Parameters

const TDesC &aTitle

The console screen's title.

TInt aFlags

Specify whether to use a backed up window and whether to draw an initial cursor.


ConstructL()

void ConstructL(const TDesC &aTitle,const TSize &aSize,TInt aFlags,TEikConsWinUnits aUnit);

Description

Completes construction specifying the title, window size, whether to use a backed up window and initial cursor and the console window's units. This version of ConstructL() places the top left corner of the console window at position 0,0 and uses the specified screen area.

Parameters

const TDesC &aTitle

The console screen's title.

const TSize &aSize

The size of the console window.

TInt aFlags

Whether to use a backed up window and whether to draw an initial cursor.

TEikConsWinUnits aUnit

Whether to use pixels or characters as the units for the console window.


ConstructL()

void ConstructL(const TDesC &aTitle,TPoint aTopLeft,const TSize &aSize,TInt aFlags,TEikConsWinUnits aUnit);

Description

Completes construction specifying the title, window position and size, whether to use a backed up window and initial cursor and the console window's units. This version of ConstructL() places the top left corner of the console window at the specified position and uses the specified screen area.

Parameters

const TDesC &aTitle

The console screen's title.

TPoint aTopLeft

The position of the top left corner of the console window.

const TSize &aSize

The size of the console window.

TInt aFlags

Whether to use a backed up window and whether to draw an initial cursor.

TEikConsWinUnits aUnit

Whether to use pixels or characters as the units for the console window.


Create()

TInt Create(const TDesC& aTitle,TSize aSize);

Description

Creates a console window with the specified title and size using a backed up window.

Parameters

const TDesC& aTitle

The console window's title.

TSize aSize

The console window's size.

Return value

TInt

Returns an error code if the console window is not created successfully.


~CEikConsoleScreen()

~CEikConsoleScreen();

Description

Destructor. Deletes the associated console control and frees memory used by the character buffer, attribute buffer and console title.

[Top]


Member functions


Att()

TUint Att() const;

Description

Gets console screen character attributes.

Return value

TUint

Console screen character attributes.


ClearChars()

void ClearChars(const TRect &aRect,TUint aCharacterAttributes);

Description

Clears the specified console screen area and specified character attributes.

Parameters

const TRect &aRect

The console screen area to clear.

TUint aCharacterAttributes

The character attributes to clear.


ClearScreen()

void ClearScreen();

Description

Clears the entire console screen.


ClearToEndOfLine()

void ClearToEndOfLine();

Description

Clears the console screen line on which the cursor is placed.


ConsoleControl()

CEikConsoleControl* ConsoleControl() const;

Description

Gets the console control that is set for the console screen.

Return value

CEikConsoleControl*

The console control for the console screen.


CursorPos()

TPoint CursorPos() const;

Description

Gets the cursor's position.

Return value

TPoint

The cursor's position.


DrawCursor()

void DrawCursor();

Description

Draws the cursor. If the console window has focus, this function scrolls to the cursor position then draws the cursor blinking. If the console window does not have focus, clears the ENoInitialCursor flag if it is set so that the cursor is drawn when the console window next gains focus.


DrawInSight()

void DrawInSight(TPoint aPosition);

Description

Draws the cursor at the specified position.

Parameters

TPoint aPosition

The position in which to draw the cursor.


DrawCursorInSight()

void DrawCursorInSight();

Description

Draws the cursor. This function calls the DrawInSight() then DrawCursor() functions.


FlushChars()

void FlushChars();

Description

Flushes the write buffer.


Font()

const TFontSpec& Font() const;

Description

Gets the current font's specifications.

Return value

TFontSpec&

The current font's specifications.


HideCursor()

TInt HideCursor();

Description

Hides the cursor.

Return value

TInt

Non-zero if the cursor was already hidden.


HistorySize()

TUint HistorySize() const;

Description

Gets the number of extra lines of characters stored.

Return value

TUint

The number of extra lines of characters stored.


Left()

void Left(TUint aCount=1);

Description

Moves the cursor to the left by the specified number of characters.

Parameters

TUint aCount=1

The number of characters by which to move. The default is one character.


Right()

void Right(TUint aCount=1);

Description

Moves the cursor to the right by the specified number of characters.

Parameters

TUint aCount=1

The number of characters by which to move. The default is one character.


Lf()

void Lf();

Description

Scrolls the display down one line.


MoveTopLeft()

void MoveTopLeft(TPoint aVector);

Description

Sets the specified point as the visible top left position. This function is called by CEikConsoleControl.

Parameters

TPoint aVector

The point to set as the top left visible position.


Redraw()

void Redraw(const TRect &aRect);

Description

Redraws the specified rectangle. This function is called by CEikConsoleControl.

Parameters

const TRect &aRect

The coordinates of the rectangle to draw.


RetrieveL()

HBufC* RetrieveL(const TRect &aRange);

Description

Gets the specified selection in a newly allocated buffer.

Parameters

const TRect &aRange

The selection to retrieve and place in the newly allocated buffer.

Return value

HBufC

The newly allocated buffer.


ScreenSize()

TSize ScreenSize() const;

Description

Gets the console screen's size.

Return value

TSize

The console screen's size.


ScrollChars()

void ScrollChars(const TRect &anArea,const TPoint &aVector);

Description

Scrolls the specified area by a specified amount.

Parameters

const TRect &anArea

The area to scroll.

const TPoint &aVector

The amount by which to scroll.


SelectCursor()

void SelectCursor();

Description

Selects the cursor position. This is an empty selection starting and ending at the cursor's position.


Selection()

TRect Selection();

Description

Gets the cursor selection.

Return value

TRect

The selection.


SetAllPrintable()

void SetAllPrintable(TUint aFlag);

Description

Sets the AllPrintable flag. If set to ETrue all characters are printed, even UNICODE characters 0 to 31.

Parameters

TUint aFlag

The value of the AllPrintable flag.


SetAtt()

void SetAtt(TUint aCharacterAttributes);

Description

Sets the specified character attributes.

Parameters

TUint aCharacterAttributes

The character attributes to set.


SetAtt()

void SetAtt(TUint aForegroundGray16,TUint aBackgroundGray16);

Description

Sets the foreground and background colour mask.

Parameters

TUint aForegroundGray16

Foreground colour.

TUint aBackgroundGray16

Background colour.


SetConsWin()

void SetConsWin(CEikConsoleControl* aConsWin);

Description

Sets the specified console control as a window. Use this function if you do not want to use the whole screen.

This function should be called to update the CEikConsoleScreen with a new CEikConsoleControl, which may be a different size.

Parameters

CEikConsoleControl* aConsWin

The console control to set as a window.


SetCursorHeight()

void SetCursorHeight(TInt aPercentage);

Description

Sets the cursor height to a percentage of the font height.

Parameters

TInt aPercentage

The percentage of the font height to which the cursor height will be set.


SetCursorPosAbs()

void SetCursorPosAbs(const TPoint &aPoint);

Description

Sets the cursor's position to the specified screen position.

Parameters

const TPoint &aPoint

The screen coordinates for the cursor's position.


SetCursorPosRel()

void SetCursorPosRel(const TPoint &aPoint);

Description

Sets the cursor's position relative to the current position.

Parameters

const TPoint &aPoint

The amount by which to move the cursor.


SetFontL()

void SetFontL(const TFontSpec &aFontDesc);

Description

Sets the screen font.

Parameters

const TFontSpec &aFontDesc

The screen font.


SetHistorySizeL()

void SetHistorySizeL(TUint aMaxChrExtra,TUint aMaxAttExtra);

Description

Sets the number of lines of back-scroll history and coresponding attributes that are stored in memory.

Parameters

TUint aMaxChrExtra

The maximum number of lines to be stored.

TUint aMaxAttExtra

The maximum number of attributes to be stored.


SetKeepCursorInSight()

void SetKeepCursorInSight(TUint aFlag);

Description

Sets the KeepCursorInSight flag.

Parameters

TUint aFlag

ETrue by default. If EFalse the cursor may be off screen following a Write().


SetPureCRLF()

void SetPureCRLF(TUint aFlag);

Description

Sets the PureCRLF flag.

Parameters

TUint aFlag

EFalse by default. If ETrue, carriage return (CR) and line feed (LF) characters result in a movement to the left margin and a line feed respectively.


SetScrollBarVisibilityL()

TInt SetScrollBarVisibilityL(CEikScrollBarFrame::TScrollBarVisibility aHBarVisibility, CEikScrollBarFrame::TScrollBarVisibility aVBarVisibility);

Description

Sets visibility of the horizontal and vertical scrollbars.

Parameters

CEikScrollBarFrame::TScrollBarVisibility aHBarVisibility

The required visibility of the horizontal scrollbar.

CEikScrollBarFrame::TScrollBarVisibility aVBarVisibility

The required visibility of the vertical scrollbar.

Return value

TInt

ETrue if a change in the visible area occurs as a result of setting scrollbar visibility, EFalse otherwise.


SetScrollLock()

void SetScrollLock(TUint aFlag);

Description

Sets the scroll lock flag.

Parameters

TUint aFlag

EFalse by default. If ETrue, window will not scroll when the bottom line is reached.


SetSelection()

void SetSelection(const TRect &aRange);

Description

Sets the cursor selection to the specified area.

Parameters

const TRect &aRange

The area to set as selected.


SetTitle()

void SetTitle(const TDesC &aTitle);

Description

Sets the console window title.

Parameters

const TDesC &aTitle

The console window's title.


SetTitleL()

void SetTitleL(const TDesC &aTitle);

Description

Replaces the console window title, deleting the old title.

Parameters

const TDesC &aTitle

The console window's title.


Title()

HBufC* Title() const;

Description

Gets the console window title.

Return value

HBufC

The console window's title.


Up()

void Up(TUint aCount);

Description

Moves the cursor up by the specified number of lines.

Parameters

TUint aCount

The number of lines to move the cursor.


Down()

void Down(TUint aCount);

Description

Moves the cursor down by the specified number of lines.

Parameters

TUint aCount

The number of lines to move the cursor.


UpdateScrollBars()

TBool UpdateScrollBars();

Description

Updates the scroll bars. This function should be called whenever the data size or top left position changes.

Return value

TBool

ETrue if the visible window has changed as a result of the scroll bar update, EFalse otherwise.


Write()

void Write(const TDesC &aText);

Description

Writes the specified text to the write buffer.

Parameters

const TDesC &aText

The text to write to the write buffer.

[Top]


Enumerations


Enum TEikConsoleFlags

TEikConsoleFlags

Description

Used to set whether the console screen uses a backed up window and whether a cursor is displayed when the window is first drawn.

EUseBackedUpWindow

Specifies that the console uses a backed up window.

ENoInitialCursor

Specifies that a cursor is displayed when the console window is first drawn.


Enum TEikConsWinUnits

TEikConsWinUnits

Description

Used to set the units used for the console window.

EEikConsWinInPixels

Console window units are pixels.

EEikConsWinInChars

Console window units are characters.