CTextView Class Reference

class CTextView : public CBase

Lays out formatted text for display.

The class provides functions to:

convert between document positions and x,y coordinates

set the dimensions of the rectangle in which text can be viewed (the view rectangle)

set margin widths

do horizontal and vertical scrolling

do text selection

set the cursor position and appearance

After a change has been made to the text layout, a reformat and redraw should normally take place. CTextView provides functions which are optimised to reformat the minimum amount necessary. For example, when a global formatting parameter is changed (e.g. the wrap width), the whole document's layout needs to be recalculated, so HandleGlobalChangeL() should be called. If the change involves the insertion or deletion of a single character, only a single line may be affected; for this, HandleCharEditL() is appropriate. Most CTextView reformatting functions do scrolling (using block transfer), if necessary, and a redraw.

For maximum responsiveness, CTextView uses an active object to carry out reformatting as a background task, so that the application can continue to receive user input. Many CTextView functions force background formatting to complete before they take effect.

When scrolling vertically, positive numbers of pixels, lines, paragraphs, pages, etc., mean that the text moves down, and vice versa. When scrolling horizontally, positive numbers of pixels mean that the text moves left and vice versa.

A text view can display up to two cursors and up to three margins. The cursors are the text cursor and the line cursor. The purpose of the line cursor is to make it easier to see which line the text cursor (or the selection extension point) is on. The three margins are the label margin (for paragraph labels), the line cursor margin (for the line cursor) and the left text margin (the gap between the edge of the page and the text). All are optional, but if present, they appear in that order, starting at the left edge of the view rectangle.

An object of class CTextLayout is used by the text view to calculate changes to the layout. This object must be specified when constructing the text view. It is also used to set layout attributes, including the wrap width, the height of the visible portion of the document (the "band"), whether formatting is set to the band or to the whole document and the text object which is the source of the text and formatting information.

The x-y pixel coordinates used by CTextView are called window coordinates. Window coordinates have their origin at the top left corner of the view window (unlike class CTextLayout whose coordinates have their origin at the top left corner of the area within the view rectangle in which text can appear). As in most bitmap graphics systems, x coordinates increase rightwards and y coordinates increase downwards.

Inherits from

Public Member Functions
~CTextView()
IMPORT_C voidAlterViewRect(const TRect &)
IMPORT_C const TRect &AlteredViewRect()
IMPORT_C CBitmapContext *BitmapContext()
IMPORT_C voidCalculateHorizontalExtremesL(TInt &, TInt &, TBool)
IMPORT_C voidCancelSelectionL()
IMPORT_C voidClearSelectionL()
voidDisableFlickerFreeRedraw()
IMPORT_C TBoolDocPosToXyPosL(TInt, TPoint &)
IMPORT_C voidDrawL(TRect)
IMPORT_C voidDrawL(TRect, CBitmapContext &)
voidEnableFlickerFreeRedraw()
IMPORT_C voidEnablePictureFrameL(TBool)
IMPORT_C TBoolFindDocPosL(const TTmDocPosSpec &, TTmPosInfo2 &, TTmLineInfo *)
IMPORT_C TBoolFindXyPosL(const TPoint &, TTmPosInfo2 &, TTmLineInfo *)
IMPORT_C voidFinishBackgroundFormattingL()
TBool FlickerFreeRedraw()
IMPORT_C voidFormatTextL()
IMPORT_C TCursorSelectionGetBackwardDeletePositionL()
IMPORT_C voidGetCursorPos(TTmDocPos &)
IMPORT_C TCursorSelectionGetForwardDeletePositionL()
voidGetOrigin(TPoint &)
IMPORT_C TBoolGetPictureRectangleL(TInt, TRect &, TBool *)
IMPORT_C TBoolGetPictureRectangleL(TPoint, TRect &, TBool *)
IMPORT_C voidHandleAdditionalCharactersAtEndL()
IMPORT_C TIntHandleCharEditL(TUint, TBool)
IMPORT_C voidHandleGlobalChangeL(TViewYPosQualifier)
IMPORT_C voidHandleGlobalChangeNoRedrawL(TViewYPosQualifier)
IMPORT_C TPointHandleInsertDeleteL(TCursorSelection, TInt, TBool)
IMPORT_C TPointHandleRangeFormatChangeL(TCursorSelection, TBool)
IMPORT_C TIntHorizontalScrollJump()
IMPORT_C TBoolIsPictureFrameSelected(TRect &, TInt &)
const CTextLayout *Layout()
IMPORT_C TIntLeftTextMargin()
IMPORT_C voidMakeVisible(TBool)
IMPORT_C voidMarginWidths(TInt &, TInt &)
IMPORT_C voidMatchCursorHeightL(const TFontSpec &)
IMPORT_C voidMatchCursorHeightToAdjacentChar(TBeforeAfter)
IMPORT_C TPointMoveCursorL(TCursorPosition::TMovementType &, TBool)
IMPORT_C CTextView *NewL(CTextLayout *, const TRect &, CBitmapDevice *, MGraphicsDeviceMap *, RWindow *, RWindowGroup *, RWsSession *)
IMPORT_C TRectParagraphRectL(TInt)
IMPORT_C TIntScrollDisplayL(TCursorPosition::TMovementType, CTextLayout::TAllowDisallow)
IMPORT_C TIntScrollDisplayLinesL(TInt &, CTextLayout::TAllowDisallow)
IMPORT_C TIntScrollDisplayParagraphsL(TInt &, CTextLayout::TAllowDisallow)
IMPORT_C voidScrollDisplayPixelsL(TInt &)
IMPORT_C voidScrollDisplayPixelsNoLimitBorderL(TInt)
IMPORT_C TCursorSelectionSelection()
IMPORT_C TBoolSelectionVisible()
IMPORT_C voidSetBackgroundColor(TRgb)
IMPORT_C voidSetCursorExtensions(TInt, TInt)
IMPORT_C voidSetCursorFlash(TBool)
IMPORT_C voidSetCursorPlacement(TTmCursorPlacement)
IMPORT_C voidSetCursorPositioningHintL(TCursorPosition::TPosHint)
IMPORT_C voidSetCursorVisibilityL(TUint, TUint)
IMPORT_C voidSetCursorWeight(TInt)
IMPORT_C voidSetCursorWidthTypeL(TTextCursor::EType, TInt)
IMPORT_C voidSetCursorXorColor(TRgb)
IMPORT_C voidSetDisplayContextL(CBitmapDevice *, RWindow *, RWindowGroup *, RWsSession *)
IMPORT_C TPointSetDocPosL(const TTmDocPosSpec &, TBool)
IMPORT_C TPointSetDocPosL(TInt, TBool)
IMPORT_C TPointSetDocPosL(const TTmDocPos &, TBool)
IMPORT_C voidSetExcessHeightRequired(TInt)
IMPORT_C voidSetHighlightExtensions(TInt, TInt, TInt, TInt)
IMPORT_C voidSetHorizontalScrollJump(TInt)
IMPORT_C voidSetLatentXPosition(TInt)
IMPORT_C voidSetLayout(CTextLayout *)
IMPORT_C voidSetLeftTextMargin(TInt)
IMPORT_C voidSetLineCursorBitmap(const CFbsBitmap *)
IMPORT_C voidSetMarginWidths(TInt, TInt)
voidSetObserver(MObserver *)
IMPORT_C voidSetOpaque(TBool)
IMPORT_C voidSetParagraphFillTextOnly(TBool)
IMPORT_C voidSetPendingSelection(const TCursorSelection &)
IMPORT_C TPointSetSelectionL(const TCursorSelection &)
IMPORT_C voidSetSelectionVisibilityL(TBool)
IMPORT_C voidSetTextColorOverride(const TRgb *)
IMPORT_C TPointSetViewL(TInt, TInt &, TViewYPosQualifier, TDiscard, TDoHorizontalScroll)
IMPORT_C TPointSetViewLineAtTopL(TInt)
IMPORT_C voidSetViewRect(const TRect &)
IMPORT_C TPointSetXyPosL(TPoint, TBool, TRect *&, TInt &)
IMPORT_C const TRect &ViewRect()
IMPORT_C const TTmDocPos &VisualEndOfRunL(const TTmDocPos &, const TTmDocPos &, TCursorPosition::TVisualEnd)
IMPORT_C TIntXyPosToDocPosL(TPoint &)
Private Member Functions
CTextView()
voidAdjustRectForScrolling(TRect &, TInt, TInt)
TInt CalculateBaseLinePos(TTmDocPos &)
voidCalculateHorizontalExtremes(TInt &, TInt &, TBool)
TInt CheckHorizontalScroll(const TTmDocPos &)
voidCheckScrollUpL()
voidClearRectAtBottom(TInt)
IMPORT_C voidConstructL(CTextLayout *, const TRect &, CBitmapDevice *, MGraphicsDeviceMap *, RWindow *, RWindowGroup *, RWsSession *)
voidDestroyWindowServerObjects()
voidDisplayLineRangeL(TInt, TInt)
voidDisplayNewLinesL(TInt, TInt)
voidDoClearSelectionL(const TCursorSelection &, TBool)
voidDoDrawTextSupportL(const TRect &, const TCursorSelection *)
voidDoDrawTextSupportOpaqueL(const TRect &, const TCursorSelection *)
TPoint DoHandleGlobalChangeL(TViewYPosQualifier, CTextView::TDiscard)
TInt DoHorizontalScrollDisplayL(TCursorPosition::TMovementType, CTextLayout::TAllowDisallow)
TPoint DoMoveCursorL(TBool, TCursorPosition::TMovementType &, TBool)
TInt DoScrollDisplayL(TCursorPosition::TMovementType, CTextLayout::TAllowDisallow)
TInt DrawAfterCursorMoveL(TInt)
voidDrawCursor(TUint)
voidDrawPictureFrameL(TRect &)
voidDrawTextL(TInt, TInt)
voidDrawTextSupportL(const TRect &, const TCursorSelection *)
voidDrawWithCurrentHighlight()
voidDrawWithPreviousHighlight()
TBool ExtendedHighlightExists()
TPoint HandleBlockChangeL(TCursorSelection, TInt, TBool)
voidHighlightUsingExtensions(CTextLayout::TRangeChange, CTextLayout::TRangeChange)
IMPORT_C TIntIdleL(TAny *)
TBool IsFormatting()
TBool NextLineL()
TBool NoMemoryCheckL()
voidNoMemoryL(TInt)
voidNotifyReformatL()
voidRecoverNoMemoryL()
voidRecreateWindowServerObjectsL()
voidRedrawPictureFrameRectL(TInt)
voidResetExternalDraw(TAny *)
voidResetOffScreenBitmapContext(TAny *)
voidScrollDisplayL()
voidScrollRect(TRect &, TInt, TInt, TInt, TBool)
voidScrollRect(TInt, TInt &, TInt &)
voidScrollTextL(TInt, TInt, TInt, TBool)
voidStartIdleObject()
TInt TopViewRect()
voidUpdateHighlightL()
voidUpdatePictureFrameL()
TPoint ViewL(const TTmDocPos &, TInt &, TViewYPosQualifier, CTextView::TDiscard, TDoHorizontalScroll)
TPoint ViewTopOfLineL(const TTmDocPos &, TInt &, CTextView::TDiscard, TDoHorizontalScroll)
Inherited Functions
CBase::CBase()
CBase::Delete(CBase *)
CBase::Extension_(TUint,TAny *&,TAny *)
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()
Public Member Enumerations
enumanonymous { EFFirstCharOnLine = -1000000, EFLastCharOnLine = 1000000 }
enumTBeforeAfter { EFCharacterBefore = ETrue, EFCharacterAfter = EFalse }
enumTDiscard { EFViewDiscardAllFormat, EFViewDontDiscardFormat, EFViewDiscardAllNoRedraw, EFViewDontDiscardFullRedraw }
enumTDoHorizontalScroll { EFNoHorizontalScroll = EFalse, EFCheckForHorizontalScroll = ETrue }
enumTPriorities { EFBackgroundFormattingPriority = (CActive::EPriorityIdle + CActive::EPriorityLow) / 2 }
Private Member Enumerations
enumanonymous { EFSelectionVisible = 1, EFPictureFrameEnabled = 2, EFEverythingVisible = 3, EFFlickerFreeRedraw = 4, EFTextVisible = 8 }
enumTDrawParameters { EFDrawAllWindow = CLayoutData::EFLargeNumber }
enumTExtendedHighlightRedraw { EFTopEdge = 0x0001, EFBottomEdge = 0x0002 }
enumTHorizontalScroll { EFNoPreviousHorizontalScroll = 0, EFPreviousHorizontalScroll }
enumTHorizontalScrollJump { EFDefaultHorizontalScrollJump = 20 }
enumTMemoryStatus { EFMemoryOK, EFOutOfMemory, EFRecovering }
enumTPictureFrameBlobWidths { EFFrameVisibleBlobWidth = 10, EFFrameActiveBlobWidth = 20 }
Private Attributes
TBool iContextIsNavigation
TCursor iCursor
TCursorPosition iCursorPos
RScreenDisplay iDisplay
TBool iDrawOpaque
TDrawTextLayoutContext iDrawTextLayoutContext
TUint iDummy
TUint iFlags
TInt iFormattedUpTo
TInt iGood
TInt iHeightNotDrawn
TUint iHorizontalScroll
TInt iHorizontalScrollJump
CTextLayout *iLayout
TMemoryStatus iNoMemory
MObserver *iObserver
CBitmapContext *iOffScreenContext
TFrameOverlay *iPictureFrame
TRect iReducedDrawingAreaRect
CIdle *iWrap

Constructor & Destructor Documentation

CTextView()

IMPORT_CCTextView()[private]

~CTextView()

IMPORT_C~CTextView()

Member Functions Documentation

AdjustRectForScrolling(TRect &, TInt, TInt)

voidAdjustRectForScrolling(TRect &aRect,
TIntaScrollY,
TIntaScrollX
)const [private]

Parameters

TRect & aRect
TInt aScrollY
TInt aScrollX

AlterViewRect(const TRect &)

IMPORT_C voidAlterViewRect(const TRect &aViewRect)

Parameters

const TRect & aViewRect

AlteredViewRect()

IMPORT_C const TRect &AlteredViewRect()const

BitmapContext()

IMPORT_C CBitmapContext *BitmapContext()

This function should not be used. This function is used in TTextView to test a fix for a defect.

CalculateBaseLinePos(TTmDocPos &)

TInt CalculateBaseLinePos(TTmDocPos &aDocPos)[private]

Finds the base line height of the cursor pos

Parameters

TTmDocPos & aDocPos

CalculateHorizontalExtremes(TInt &, TInt &, TBool)

voidCalculateHorizontalExtremes(TInt &aLeftX,
TInt &aRightX,
TBoolaOnlyVisibleLines
)[private]

Parameters

TInt & aLeftX
TInt & aRightX
TBool aOnlyVisibleLines

CalculateHorizontalExtremesL(TInt &, TInt &, TBool)

IMPORT_C voidCalculateHorizontalExtremesL(TInt &aLeftX,
TInt &aRightX,
TBoolaOnlyVisibleLines
)

Returns the left and right extremes, in window coordinates, of the formatted text.

Parameters

TInt & aLeftXOn return, contains the x coordinate of the leftmost point of the formatted text.
TInt & aRightXOn return, contains the x coordinate of the rightmost point of the formatted text.
TBool aOnlyVisibleLinesIf ETrue, only scans partially or fully visible lines. If EFalse, scans all the formatted text.

CancelSelectionL()

IMPORT_C voidCancelSelectionL()

Removes a selection, and redraws the affected part of the screen.

Any background formatting is forced to complete first.

CheckHorizontalScroll(const TTmDocPos &)

TInt CheckHorizontalScroll(const TTmDocPos &aDocPos)[private]

CheckHorizontalScroll's job is to take the cursor position in aDocPos and ensure it is visible in the view. It does this by calculating the horizontal scroll neccessary and adjusts the iTextStartX (left text margin) attribute of the view member iDrawTextLayoutContext. This change (if any) would be reflected in the next re-draw.

This functionality is required when the layout is in non-screen/window wrapped mode (ie. wysiwyg mode) and the cursor is out of view to the left or the right (say if the user has horizontally scrolled) and either a cursor movement happens or a char is inserted or deleted by the user. The end result is the view jumps back to the cursor so the user can see when change/movement was made.

When the layout format is set to screen mode this functionality may still be required as paragraphs with wrapping turned off can break the margins. Even with wrapping turned on, spaces and hanging characters can break margins; however it is usually considered ugly to allow the screen to scroll to follow the cursor in these situations.

Post-condition
Drawing layout context updated with new horizontal scroll position

Parameters

const TTmDocPos & aDocPosCusror position to base calculations on

CheckScrollUpL()

voidCheckScrollUpL()[private]

Scrolls the screen up if necessary following background formatting. Enters OOM state before leaving

ClearRectAtBottom(TInt)

voidClearRectAtBottom(TIntaHeight)[private]

Clears the specified number of pixels from the bottom of the screen. Enters OOM state before leaving.

Parameters

TInt aHeight

ClearSelectionL()

IMPORT_C voidClearSelectionL()

Un-draws a selection, redraws the affected part of the screen. The cursor selection remains as before. Analogous to CancelSelectionL(), but leaves the cursor selection untouched. This function should be called before calling CTextView::SetPendingSelection() _and_ SetHighlightExtensions has been used to extend the size of the highlight. Any background formatting is forced to complete first.

ConstructL(CTextLayout *, const TRect &, CBitmapDevice *, MGraphicsDeviceMap *, RWindow *, RWindowGroup *, RWsSession *)

IMPORT_C voidConstructL(CTextLayout *aLayout,
const TRect &aDisplay,
CBitmapDevice *aGd,
MGraphicsDeviceMap *aDeviceMap,
RWindow *aWin,
RWindowGroup *aGroupWin,
RWsSession *aSession
)[private]

Parameters

CTextLayout * aLayout
const TRect & aDisplay
CBitmapDevice * aGd
MGraphicsDeviceMap * aDeviceMap
RWindow * aWin
RWindowGroup * aGroupWin
RWsSession * aSession

DestroyWindowServerObjects()

voidDestroyWindowServerObjects()[private]

DisableFlickerFreeRedraw()

voidDisableFlickerFreeRedraw()[inline]

DisplayLineRangeL(TInt, TInt)

voidDisplayLineRangeL(TIntaFrom,
TIntaTo
)[private]

Draws text from aFrom to aTo.

Enters OOM state before leaving.

Parameters

TInt aFromTop screen Y co-ordinate to draw (inclusive of aFrom)
TInt aToBottom screen Y co-ordinate to draw (exclusive of aTo)

DisplayNewLinesL(TInt, TInt)

voidDisplayNewLinesL(TIntaFrom,
TIntaTo
)[private]

Draws good parts of the screen that have recently been formatted by background formatting. Enters OOM before leaving.

Parameters

TInt aFrom
TInt aTo

DoClearSelectionL(const TCursorSelection &, TBool)

voidDoClearSelectionL(const TCursorSelection &aSelection,
TBoolaIsPictureFrame
)[private]

Parameters

const TCursorSelection & aSelection
TBool aIsPictureFrame

DoDrawTextSupportL(const TRect &, const TCursorSelection *)

voidDoDrawTextSupportL(const TRect &aRect,
const TCursorSelection *aHighlight
)[private]

Draws the text, using an offscreen bitmap to avoid flicker if possible. All text drawing is done by this function except in printing.

Does not enter OOM state.

Parameters

const TRect & aRect
const TCursorSelection * aHighlight

DoDrawTextSupportOpaqueL(const TRect &, const TCursorSelection *)

voidDoDrawTextSupportOpaqueL(const TRect &aRect,
const TCursorSelection *aHighlight
)[private]

Parameters

const TRect & aRect
const TCursorSelection * aHighlight

DoHandleGlobalChangeL(TViewYPosQualifier, CTextView::TDiscard)

TPoint DoHandleGlobalChangeL(TViewYPosQualifieraYPosQualifier,
CTextView::TDiscardaDiscard
)[private]

Discards and reformats keeping the cursor at the same height on the screen if possible. Enters OOM state before leaving

Parameters

TViewYPosQualifier aYPosQualifier
CTextView::TDiscard aDiscard

DoHorizontalScrollDisplayL(TCursorPosition::TMovementType, CTextLayout::TAllowDisallow)

TInt DoHorizontalScrollDisplayL(TCursorPosition::TMovementTypeaMovement,
CTextLayout::TAllowDisallowaScrollBlankSpace
)[private]

Parameters

TCursorPosition::TMovementType aMovement
CTextLayout::TAllowDisallow aScrollBlankSpace

DoMoveCursorL(TBool, TCursorPosition::TMovementType &, TBool)

TPoint DoMoveCursorL(TBoolaDragSelectOn,
TCursorPosition::TMovementType &aMovement,
TBoolaAllowPictureFrame
)[private]

Parameters

TBool aDragSelectOn
TCursorPosition::TMovementType & aMovement
TBool aAllowPictureFrame

DoScrollDisplayL(TCursorPosition::TMovementType, CTextLayout::TAllowDisallow)

TInt DoScrollDisplayL(TCursorPosition::TMovementTypeaMovement,
CTextLayout::TAllowDisallowaScrollBlankSpace
)[private]

Parameters

TCursorPosition::TMovementType aMovement
CTextLayout::TAllowDisallow aScrollBlankSpace

DocPosToXyPosL(TInt, TPoint &)

IMPORT_C TBoolDocPosToXyPosL(TIntaDocPos,
TPoint &aPoint
)

Gets the window coordinates of the character located at the specified document position. If the document position specified has not been formatted, the function returns a value of false.

Parameters

TInt aDocPosThe document position.
TPoint & aPointOn return, contains the window coordinates of aDocPos. This value is undefined if the position has not been formatted.

DrawAfterCursorMoveL(TInt)

TInt DrawAfterCursorMoveL(TIntaVerticalScrollBy)[private]

Used to correct the display after a cursor move type call Enters OOM before leaving

Parameters

TInt aVerticalScrollBy

DrawCursor(TUint)

voidDrawCursor(TUintaCursors = TCursor::EFBothCursors)[private]

Parameters

TUint aCursors = TCursor::EFBothCursors

DrawL(TRect)

IMPORT_C voidDrawL(TRectaRect)

Draws the text to a rectangle. Enters OOM state before leaving. RWindow::BeginRedraw() should always be called before calling this function, for the window that the textview draws to.

Parameters

TRect aRectRectangle to which the text is drawn, normally the view rectangle.

DrawL(TRect, CBitmapContext &)

IMPORT_C voidDrawL(TRectaRect,
CBitmapContext &aGc
)

Draws the text to a rectangle.

Draw to a specific GC rather than the stored one. This is essential when drawing CTextView objects that are embedded inside others, as happens for editable text controls in WEB (the outermost WEB object is a CTextView, which has embedded controls that own CEikEdwins, and these own CTextView objects).

Parameters

TRect aRectRectangle to which the text is drawn, normally the view rectangle.
CBitmapContext & aGcGraphics context to be drawn to. Flicker-free redrawing will not be applied, so this parameter should not be a window gc if flickering is to be avoided. Notice that the fonts drawn to this context will be taken from the graphics device map given to the constructor of this object or in subsequent calls to CTextLayout::SetImageDeviceMap. If such fonts cannot be used with this bitmap context, the behaviour is undefined.

DrawPictureFrameL(TRect &)

voidDrawPictureFrameL(TRect &aClipRect)[private]

Parameters

TRect & aClipRect

DrawTextL(TInt, TInt)

voidDrawTextL(TIntaFromHeight = 0,
TIntaToHeight = EFDrawAllWindow
)[private]

Parameters

TInt aFromHeight = 0
TInt aToHeight = EFDrawAllWindow

DrawTextSupportL(const TRect &, const TCursorSelection *)

voidDrawTextSupportL(const TRect &aRect,
const TCursorSelection *aHighlight
)[private]

Draws the text. Depending on the opaque mode ("iDrawOpaque" value) and graphics context type, the method calls either DoDrawTextSupportL() or DoDrawTextSupportOpaqueL(). The additional graphics context type check has to be done, because currently only CWindowGc graphics context implementation supports opaque drawing.

Does not enter OOM state.

Parameters

const TRect & aRect
const TCursorSelection * aHighlight

DrawWithCurrentHighlight()

voidDrawWithCurrentHighlight()[private, inline]

DrawWithPreviousHighlight()

voidDrawWithPreviousHighlight()[private, inline]

EnableFlickerFreeRedraw()

voidEnableFlickerFreeRedraw()[inline]

EnablePictureFrameL(TBool)

IMPORT_C voidEnablePictureFrameL(TBoolaEnabled)

Sets whether a picture frame should be displayed when the text cursor is located at a picture character.

Note:

If a picture frame is currently displayed, and aEnabled is EFalse, a redraw takes place, so that the frame is removed.

Parameters

TBool aEnabledTrue to enable picture frames, false to disable them.

ExtendedHighlightExists()

TBool ExtendedHighlightExists()const [private]

FindDocPosL(const TTmDocPosSpec &, TTmPosInfo2 &, TTmLineInfo *)

IMPORT_C TBoolFindDocPosL(const TTmDocPosSpec &aDocPos,
TTmPosInfo2 &aPosInfo,
TTmLineInfo *aLineInfo = NULL
)

Finds the x-y position of the document position aDocPos.

If aDocPos is formatted, TRUE is returned and aPosInfo returns information about the document position and aLineInfo returns information about the line containing the document position, if it is non-null.

Parameters

const TTmDocPosSpec & aDocPosThe document position to investigate.
TTmPosInfo2 & aPosInfoIf non-null, on return, contains information about the document position.
TTmLineInfo * aLineInfo = NULLIf non-null, on return, contains information on the line that the position is in.

FindXyPosL(const TPoint &, TTmPosInfo2 &, TTmLineInfo *)

IMPORT_C TBoolFindXyPosL(const TPoint &aXyPos,
TTmPosInfo2 &aPosInfo,
TTmLineInfo *aLineInfo = NULL
)

Gets the document position of of the nearest character edge to the window coordinates specified.

Parameters

const TPoint & aXyPosThe window coordinates to investigate.
TTmPosInfo2 & aPosInfoIf non-null, on return contains information about the position located in the text.
TTmLineInfo * aLineInfo = NULLIf non-null, on return contains information on the line that the position is in.

FinishBackgroundFormattingL()

IMPORT_C voidFinishBackgroundFormattingL()

Forces completion of background formatting.

This is called automatically by all CTextView functions which depend on the formatting being up to date.

FlickerFreeRedraw()

TBool FlickerFreeRedraw()const [inline]

FormatTextL()

IMPORT_C voidFormatTextL()

Reformats the whole document, or just the visible text, if formatting is set to the band only (see CTextLayout::SetAmountToFormat()).

Notes:

Reformatting the entire document may be time consuming, so only use this function if necessary.

This function does not redraw the reformatted text.

GetBackwardDeletePositionL()

IMPORT_C TCursorSelectionGetBackwardDeletePositionL()

Returns a selection for which characters should be deleted in a backwards delete.

GetCursorPos(TTmDocPos &)

IMPORT_C voidGetCursorPos(TTmDocPos &aPos)const

Gets the cursor position as a TTmDocPos.

Parameters

TTmDocPos & aPosOn return, the cursor position.

GetForwardDeletePositionL()

IMPORT_C TCursorSelectionGetForwardDeletePositionL()

Returns a selection for which characters should be deleted in a forwards delete.

GetOrigin(TPoint &)

voidGetOrigin(TPoint &aPoint)const [inline]

Gets the origin of the cursor.

Parameters

TPoint & aPointOn return, the cursor origin.

GetPictureRectangleL(TInt, TRect &, TBool *)

IMPORT_C TBoolGetPictureRectangleL(TIntaDocPos,
TRect &aPictureRect,
TBool *aCanScaleOrCrop = NULL
)const

Gets the bounding rectangle of the picture, if any, located at the document position or x,y coordinates specified, and returns it in aPictureRect.

If aCanScaleOrCrop is non-null, sets aCanScaleOrCrop to indicate whether the picture can be scaled or cropped. Returns true if the operation was successful. Returns false otherwise; that is, if there is no picture at the position, or if the position is unformatted.

Parameters

TInt aDocPosThe document position of interest.
TRect & aPictureRectOn return, contains the rectangle which encloses the picture located at the position specified.
TBool * aCanScaleOrCrop = NULLIf non null and the function returns true, indicates whether the picture can be scaled or cropped. By default, null.

GetPictureRectangleL(TPoint, TRect &, TBool *)

IMPORT_C TBoolGetPictureRectangleL(TPointaXyPos,
TRect &aPictureRect,
TBool *aCanScaleOrCrop = NULL
)

Returns EFalse if the specified position is not contained within a formatted picture.

Parameters

TPoint aXyPos
TRect & aPictureRect
TBool * aCanScaleOrCrop = NULL

HandleAdditionalCharactersAtEndL()

IMPORT_C voidHandleAdditionalCharactersAtEndL()

Reformats and redraws to reflect the addition of one or more complete paragraphs at the end of the text. For instance, it may be used where information is being found by an active object and appended to a document.

Note:

This function should not be used to handle the situation where text is added to the final paragraph. In this case, use HandleInsertDeleteL() or HandleCharEditL() instead.

HandleBlockChangeL(TCursorSelection, TInt, TBool)

TPoint HandleBlockChangeL(TCursorSelectionaSelection,
TIntaOldCharsChanged,
TBoolaFormatChanged
)[private]

Reformats after a change to part of the text contents. Enters OOM state before leaving.

Parameters

TCursorSelection aSelection
TInt aOldCharsChanged
TBool aFormatChanged

HandleCharEditL(TUint, TBool)

IMPORT_C TIntHandleCharEditL(TUintaType = CTextLayout::EFCharacterInsert,
TBoolaFormatChanged = EFalse
)

Reformats and redraws the view in response to a single key press. The precise amount of text to be reformatted is controlled by the second parameter.

Parameters

TUint aType = CTextLayout::EFCharacterInsertIndicates the type of edit which has taken place. CTextLayout::EFCharacterInsert (the default) for a character insertion, CTextLayout::EFParagraphDelimiter for a paragraph delimiter insertion, CTextLayout::EFLeftDelete or CTextLayout::EFRightDelete for a character or paragraph delimiter deletion to the left or right of the cursor position.
TBool aFormatChanged = EFalseETrue if text is to be reformatted from the start of the paragraph the cursor was on before the edit, EFalse if from the start of the line the cursor was on before the edit.

HandleGlobalChangeL(TViewYPosQualifier)

IMPORT_C voidHandleGlobalChangeL(TViewYPosQualifieraYPosQualifier =  TViewYPosQualifier())

Reformats and redraws the view after a global change has been made to the layout. Examples of global layout changes include changing the format mode, the wrap width, or the visibility of nonprinting characters.

Forces any background formatting to complete.

Parameters

TViewYPosQualifier aYPosQualifier =  TViewYPosQualifier()Specifies whether the visible area is to be filled and whether the top line should be made fully visible if possible.

HandleGlobalChangeNoRedrawL(TViewYPosQualifier)

IMPORT_C voidHandleGlobalChangeNoRedrawL(TViewYPosQualifieraYPosQualifier =  TViewYPosQualifier())

Reformats the view after a global change has been made to the layout, but without causing a redraw. Examples of global layout changes include changing the format mode, the wrap width, or the visibility of nonprinting characters.

Forces any background formatting to complete.

Parameters

TViewYPosQualifier aYPosQualifier =  TViewYPosQualifier()Specifies whether the visible area is to be filled and whether the top line should be made fully visible if possible.

HandleInsertDeleteL(TCursorSelection, TInt, TBool)

IMPORT_C TPointHandleInsertDeleteL(TCursorSelectionaSelection,
TIntaDeletedChars,
TBoolaFormatChanged = EFalse
)

Reformats and redraws the view after inserting, deleting or replacing a block of text.

Can be used in combination with SetPendingSelection() to set a selection which should remain after the function has returned.

Notes:

If inserting or deleting a single character, use CTextView::HandleCharEditL() instead.

A panic occurs if partial lines are excluded from the view (see CTextLayout::ExcludingPartialLines()).

Parameters

TCursorSelection aSelectionThe start and new length of the changed block. If this function is being used to handle deletion only, this argument should be of length zero and its start position should be the beginning of the deletion.
TInt aDeletedCharsThe number of deleted characters. Specify zero if this function is being used to handle insertion only.
TBool aFormatChanged = EFalseETrue if text is to be reformatted from the start of the paragraph the cursor was on before the edit, EFalse if from the start of the line the cursor was on before the edit.

HandleRangeFormatChangeL(TCursorSelection, TBool)

IMPORT_C TPointHandleRangeFormatChangeL(TCursorSelectionaSelection,
TBoolaFormatChanged = EFalse
)

Reformats and redraws the view after changes to the character or paragraph formatting of a block of text. Reformatting can take place either from the start of the line or the start of the paragraph containing the cursor position, depending on aFormatChanged.

Can be used in combination with SetPendingSelection() to set a selection which should remain after the function has returned.

Note:

A panic occurs if partial lines are excluded from the view (see CTextLayout::ExcludingPartialLines()).

Any background formatting is forced to complete first.

Parameters

TCursorSelection aSelectionIndicates the text range which has been reformatted.
TBool aFormatChanged = EFalseETrue if text is to be reformatted from the start of the paragraph the cursor was on before the edit, EFalse if from the start of the line the cursor was on before the edit.

HighlightUsingExtensions(CTextLayout::TRangeChange, CTextLayout::TRangeChange)

voidHighlightUsingExtensions(CTextLayout::TRangeChangeaOptimizedRange,
CTextLayout::TRangeChangeaOriginalRange
)[private]

Parameters

CTextLayout::TRangeChange aOptimizedRange
CTextLayout::TRangeChange aOriginalRange

HorizontalScrollJump()

IMPORT_C TIntHorizontalScrollJump()const

Gets the number of pixels by which a horizontal scroll jump will cause the view to scroll. On construction, the default horizontal scroll jump value is set to 20 pixels.

IdleL(TAny *)

IMPORT_C TIntIdleL(TAny *aSelf)[private, static]

Called when system is idle. Use to do background formatting. Enters OOM state before leaving

Parameters

TAny * aSelf

IsFormatting()

TBool IsFormatting()const [private, inline]

IsPictureFrameSelected(TRect &, TInt &)

IMPORT_C TBoolIsPictureFrameSelected(TRect &aPictureFrameRect,
TInt &aDocPos
)const

Tests whether there is a picture with a picture frame at the current cursor position. If there is, the aPictureFrameRect and aDocPos arguments are set to contain the picture frame rectangle and the document position of the picture, respectively.

Parameters

TRect & aPictureFrameRectIf the function returns true, on return contains the picture frame rectangle.
TInt & aDocPosIf the function returns true, on return contains the document position of the picture.

Layout()

const CTextLayout *Layout()const [inline]

Returns a pointer to the text layout object used by the text view.

LeftTextMargin()

IMPORT_C TIntLeftTextMargin()const

Gets the left text margin width in pixels.

MakeVisible(TBool)

IMPORT_C voidMakeVisible(TBoolaVisible)

Stops or allows text to be drawn. Included to allow users to control visibility if text is part of an invisible control.

CCoeControl::MakeVisible()

Parameters

TBool aVisibleETrue to make the text visible, EFalse to make it invisible.

MarginWidths(TInt &, TInt &)

IMPORT_C voidMarginWidths(TInt &aLabels,
TInt &aLineCursor
)const

Gets the label and line cursor margin widths in pixels.

Parameters

TInt & aLabelsOn return contains the width in pixels of the label margin.
TInt & aLineCursorOn return contains the width in pixels of the line cursor margin.

MatchCursorHeightL(const TFontSpec &)

IMPORT_C voidMatchCursorHeightL(const TFontSpec &aFontSpec)

Sets the height and ascent of the text cursor to the values contained in aFontSpec and redraws it.

Note:

The values set by this function are temporary. If the cursor is subsequently moved, it reverts to being based on the preceding character (unless at the start of a paragraph, in which case, it is based on the following character).

Parameters

const TFontSpec & aFontSpecSpecifies a height and ascent to which to set the text cursor.

MatchCursorHeightToAdjacentChar(TBeforeAfter)

IMPORT_C voidMatchCursorHeightToAdjacentChar(TBeforeAfteraBasedOn = EFCharacterBefore)

Sets the height and ascent of the text cursor to be the same as an adjacent character and redraws it. By default, the values are set to be based on the preceding character.

Parameters

TBeforeAfter aBasedOn = EFCharacterBeforeEFCharacterBefore to base the height and ascent of the text cursor on the preceding character. EFCharacterAfter to base them on the following character.

MoveCursorL(TCursorPosition::TMovementType &, TBool)

IMPORT_C TPointMoveCursorL(TCursorPosition::TMovementType &aMovement,
TBoolaDragSelectOn
)

Moves the text cursor in the direction and manner specified. If necessary, the view is scrolled so that the line containing the new cursor position is visible.

Any background formatting is forced to complete first.

Parameters

TCursorPosition::TMovementType & aMovementThe direction and manner in which to move the cursor. On return set to the actual cursor movement. The actual cursor movement may be different from the one requested if for example the desired cursor movement is upwards and the cursor is already on the top line. In this case, this argument will return TCursorPosition::EFLineBeg. A return value of TCursorPosition::EFNoMovement indicates that no cursor movement took place.
TBool aDragSelectOnETrue if the region between the old and new cursor positions should be selected, EFalse if not. If ETrue, any existing selection remains selected, so that this function can be used to extend or shorten a selected region. EFalse cancels any existing selection.

NewL(CTextLayout *, const TRect &, CBitmapDevice *, MGraphicsDeviceMap *, RWindow *, RWindowGroup *, RWsSession *)

IMPORT_C CTextView *NewL(CTextLayout *aLayout,
const TRect &aDisplay,
CBitmapDevice *aGd,
MGraphicsDeviceMap *aDeviceMap,
RWindow *aWin,
RWindowGroup *aGroupWin,
RWsSession *aSession
)[static]

Allocates and constructs a CTextView object.

Parameters

CTextLayout * aLayoutPointer to the layout object referenced by the text view. Must not be NULL or a panic occurs.
const TRect & aDisplayThe rectangle in which text is displayed (the "view rectangle").
CBitmapDevice * aGdBitmapped graphics device to draw to, e.g. the screen.
MGraphicsDeviceMap * aDeviceMapThe device map used for drawing and formatting.
RWindow * aWinThe window to draw to. Should not be NULL.
RWindowGroup * aGroupWinWindow group. Must be provided if a text cursor is to be displayed. It can be NULL if you don't need a text cursor.
RWsSession * aSessionPointer to the window server session.

NextLineL()

TBool NextLineL()[private]

Formats the next line for background formatting, returns True if more to do Enters OOM state before leaving

NoMemoryCheckL()

TBool NoMemoryCheckL()[private]

Return True if successfully recovered from being out of memory Enters OOM before leaving

NoMemoryL(TInt)

voidNoMemoryL(TIntaErr)[private]

Enters the OOM state.

Parameters

TInt aErr

NotifyReformatL()

voidNotifyReformatL()[private, inline]

ParagraphRectL(TInt)

IMPORT_C TRectParagraphRectL(TIntaDocPos)const

Returns the rectangle enclosing the paragraph containing aDocPos. If the paragraph is not formatted, returns an empty rectangle. If the paragraph is partially formatted, returns the rectangle enclosing the formatted part.

Parameters

TInt aDocPosA document position within the paragraph.

RecoverNoMemoryL()

voidRecoverNoMemoryL()[private]

Make an attempt to recover from no system memory Enters OOM before leaving

RecreateWindowServerObjectsL()

voidRecreateWindowServerObjectsL()[private]

RedrawPictureFrameRectL(TInt)

voidRedrawPictureFrameRectL(TIntaPos)[private]

Shows or hides the picture frame at specified location, redrawing the picture frame rect. It assumes that: 1)iCursorPos.iFlags has been correctly updated to specify the visibility of the picture frame. 2)the picture frame object has been created and initialised. 3)Gc has already been activated. Enters OOM before leaving.

Parameters

TInt aPos

ResetExternalDraw(TAny *)

voidResetExternalDraw(TAny *aTextView)[private, static]

Parameters

TAny * aTextView

ResetOffScreenBitmapContext(TAny *)

voidResetOffScreenBitmapContext(TAny *aTextView)[private, static]

Parameters

TAny * aTextView

ScrollDisplayL(TCursorPosition::TMovementType, CTextLayout::TAllowDisallow)

IMPORT_C TIntScrollDisplayL(TCursorPosition::TMovementTypeaMovement,
CTextLayout::TAllowDisallowaScrollBlankSpace = CTextLayout::EFDisallowScrollingBlankSpace
)

Scrolls the view either horizontally or vertically and does a redraw.

Any background formatting is forced to complete first.

Pre-condition
aMovement must not scroll the display beyond the formatted range. If aMovement scrolls beyond the formatted range, this method will leave with the error code CTextLayout::EPosNotFormatted

Parameters

TCursorPosition::TMovementType aMovementControls the direction and the amount of scroll.
CTextLayout::TAllowDisallow aScrollBlankSpace = CTextLayout::EFDisallowScrollingBlankSpaceCTextLayout::EFAllowScrollingBlankSpace allows blank space to scroll into the visible area (applies when scrolling horizontally as well as vertically), CTextLayout::EFDisallowScrollingBlankSpace prevents blank space from scrolling into the visible area.

ScrollDisplayL()

voidScrollDisplayL()[private]

Scroll the display and redraw the missing lines.

ScrollDisplayLinesL(TInt &, CTextLayout::TAllowDisallow)

IMPORT_C TIntScrollDisplayLinesL(TInt &aDeltaLines,
CTextLayout::TAllowDisallowaScrollBlankSpace = CTextLayout::EFDisallowScrollingBlankSpace
)

Scrolls the view vertically by a number of wholly or partially visible lines, disallowing blank space at the bottom of the visible area if aScrollBlankSpace is CTextLayout::EFDisallowScrollingBlankSpace. Redraws the newly visible lines.

Any background formatting is forced to complete first.

Pre-condition
aDeltaLines must not scroll the display beyond the formatted range. If aDeltaLines scrolls beyond the formatted range, this method will leave with the error code CTextLayout::EPosNotFormatted

Parameters

TInt & aDeltaLinesThe number of lines to scroll; may be a positive or negative value. Positive values move the text down, negative move it up. On return, contains the number of lines not scrolled; that is, the requested number, minus the number actually scrolled.
CTextLayout::TAllowDisallow aScrollBlankSpace = CTextLayout::EFDisallowScrollingBlankSpaceOnly relevant when scrolling downwards. CTextLayout::EFAllowScrollingBlankSpace allows blank space to scroll into the visible area. CTextLayout::EFDisallowScrollingBlankSpace prevents blank space from scrolling into the visible area.

ScrollDisplayParagraphsL(TInt &, CTextLayout::TAllowDisallow)

IMPORT_C TIntScrollDisplayParagraphsL(TInt &aDeltaParas,
CTextLayout::TAllowDisallowaScrollBlankSpace = CTextLayout::EFDisallowScrollingBlankSpace
)

Scrolls the view by a number of wholly or partially visible paragraphs disallowing blank space at the bottom of the visible area if aScrollBlankSpace is CTextLayout::EFDisallowScrollingBlankSpace. Redraws the newly visible paragraphs.

Any background formatting is forced to complete first.

Pre-condition
aDeltaParas must not scroll the display beyond the formatted range. If aDeltaParas scrolls beyond the formatted range, this method will leave with the error code CTextLayout::EPosNotFormatted

Parameters

TInt & aDeltaParasThe number of paragraphs to scroll; may be a positive or negative value; positive values move the text down, negative move it up. On return, contains the number of paragraphs not scrolled; that is the difference between the requested number and the number of paragraphs actually scrolled.
CTextLayout::TAllowDisallow aScrollBlankSpace = CTextLayout::EFDisallowScrollingBlankSpaceOnly relevant when scrolling downwards. CTextLayout::EFAllowScrollingBlankSpace allows blank space to scroll into the visible area. CTextLayout::EFDisallowScrollingBlankSpace prevents blank space from scrolling into the visible area.

ScrollDisplayPixelsL(TInt &)

IMPORT_C voidScrollDisplayPixelsL(TInt &aDeltaY)

Scrolls the view vertically by a number of pixels, disallowing blank space from scrolling into the bottom of the visible area. Redraws the newly visible lines.

Any background formatting is forced to complete first.

Parameters

TInt & aDeltaYThe number of pixels to scroll; may be a positive or negative value. On return, contains the number of pixels actually scrolled. Positive values move the text down, negative move it up.

ScrollDisplayPixelsNoLimitBorderL(TInt)

IMPORT_C voidScrollDisplayPixelsNoLimitBorderL(TIntaDeltaY)

Scrolls the view vertically by a number of pixels, allowing blank space from scrolling into both top and bottom of the visible area, which means the scrolling can go beyond the top or bottom border. Redraws the newly visible lines.

Any background formatting is forced to complete first.

Parameters

TInt aDeltaYThe number of pixels to scroll; may be a positive or negative value. On return, contains the number of pixels actually scrolled. Positive values move the text down, negative move it up.

ScrollRect(TRect &, TInt, TInt, TInt, TBool)

voidScrollRect(TRect &aRect,
TIntaScrollY,
TIntaFrom,
TIntaScrollX,
TBoolaScrollBackground
)[private]

Scroll part of the view rect

Parameters

TRect & aRect
TInt aScrollY
TInt aFrom
TInt aScrollX
TBool aScrollBackground

ScrollRect(TInt, TInt &, TInt &)

voidScrollRect(TIntaScrollY,
TInt &aFrom,
TInt &aTo
)[private]

Scroll part of the view rect.

Parameters

TInt aScrollYNumber of pixels downwards to scroll
TInt & aFromFirst line visible after the scroll.
TInt & aToLast line visible after the scroll.

ScrollTextL(TInt, TInt, TInt, TBool)

voidScrollTextL(TIntaScrollY,
TIntaFrom,
TIntaScrollX,
TBoolaScrollBackground
)[private]

Scroll the display below point aFrom by aScrollX.

aScrollY>0 ==> text moves down.

aScrollX>0 ==> text moves right.

aFrom is relative to the text area of the window.

aScrollBackground determines whether the background can scroll along with the text.

Enters OOM before leaving

Parameters

TInt aScrollY
TInt aFrom
TInt aScrollX
TBool aScrollBackground

Selection()

IMPORT_C TCursorSelectionSelection()const

Gets the current selection.

SelectionVisible()

IMPORT_C TBoolSelectionVisible()const

Returns if the selection is currently visible.

In particular, the selection is invisible if the text color has been overridden.

SetBackgroundColor(TRgb)

IMPORT_C voidSetBackgroundColor(TRgbaColor)

Sets the background colour for the view rectangle.

Does not redraw.

Parameters

TRgb aColorThe background colour.

SetCursorExtensions(TInt, TInt)

IMPORT_C voidSetCursorExtensions(TIntaFirstExtension,
TIntaSecondExtension
)

Parameters

TInt aFirstExtension
TInt aSecondExtension

SetCursorFlash(TBool)

IMPORT_C voidSetCursorFlash(TBoolaEnabled)

Sets the flashing state of the text cursor and redraws it.

Parameters

TBool aEnabledETrue for a flashing cursor, EFalse for a non-flashing cursor.

SetCursorPlacement(TTmCursorPlacement)

IMPORT_C voidSetCursorPlacement(TTmCursorPlacementaPlacement)

Sets the text cursor's placement (its shape and position relative to the insertion position) and redraws it.

Parameters

TTmCursorPlacement aPlacementThe text cursor's placement

SetCursorPositioningHintL(TCursorPosition::TPosHint)

IMPORT_C voidSetCursorPositioningHintL(TCursorPosition::TPosHintaHint)

This method allows clients of CTextView to provided a cursor positioning hint (as defined in TCursorPosition::TPosHint) to the Cursor Navigation Policy object currently in use in this view.

This information can be used by the CNP object to resolve problems such as visual cursor positioning ambiguity in bidirectional text.
Post-condition
The hint is stored for use in subsequent cursor movement.

Parameters

TCursorPosition::TPosHint aHintCursor position hint provided by client of CTextView.

SetCursorVisibilityL(TUint, TUint)

IMPORT_C voidSetCursorVisibilityL(TUintaLineCursor,
TUintaTextCursor
)

Sets the visibility of the line and text cursors.

Notes:

A group window must have been provided before a text cursor can be drawn.

Before making the line cursor visible, a line cursor bitmap must have been provided (see SetLineCursorBitmap()).

Parameters

TUint aLineCursorSets whether the line cursor should be displayed. For possible values, see the TCursor::TVisibility enumeration.
TUint aTextCursorSets whether the text cursor should be displayed and if so, whether it should flash. For possible values, see the TCursor::TVisibility enumeration.

SetCursorWeight(TInt)

IMPORT_C voidSetCursorWeight(TIntaWeight)

Sets the weight of the text cursor and redraws it.

If the cursor's placement is vertical (ECursorVertical), the weight is the width of the cursor. If the placement is horizontal, the weight is the height of the cursor. Has no effect if the weight value specified is zero or less.

Parameters

TInt aWeightThe weight in pixels of the text cursor.

SetCursorWidthTypeL(TTextCursor::EType, TInt)

IMPORT_C voidSetCursorWidthTypeL(TTextCursor::ETypeaType,
TIntaWidth = 0
)

Sets the text cursor's type and weight and redraws it. If the cursor's placement is vertical (ECursorVertical), the weight is the width of the cursor. If the placement is horizontal, the weight is the height of the cursor.

Parameters

TTextCursor::EType aTypeThe text cursor type.
TInt aWidth = 0The weight in pixels of the text cursor. Specify zero (the default) to leave the current weight unchanged.

SetCursorXorColor(TRgb)

IMPORT_C voidSetCursorXorColor(TRgbaColor)

Sets the text cursor's colour and redraws it. The cursor is drawn using an Exclusive OR draw mode which ensures that the cursor's colour is different from the background colour.

Parameters

TRgb aColorThe text cursor's colour.

SetDisplayContextL(CBitmapDevice *, RWindow *, RWindowGroup *, RWsSession *)

IMPORT_C voidSetDisplayContextL(CBitmapDevice *aGd,
RWindow *aWin,
RWindowGroup *aGroupWin,
RWsSession *aSession
)

Changes the window server handles which the display uses. Any of the parameters can be NULL in which case they are not changed.

Parameters

CBitmapDevice * aGdPointer to the bitmapped graphics device to draw to.
RWindow * aWinPointer to the view window.
RWindowGroup * aGroupWinPointer to the window group.
RWsSession * aSessionPointer to the window server session.

SetDocPosL(const TTmDocPosSpec &, TBool)

IMPORT_C TPointSetDocPosL(const TTmDocPosSpec &aDocPos,
TBoolaDragSelectOn = EFalse
)

Moves the text cursor to a new document position. The view is scrolled so that the line containing the new cursor position is at the top, or the bottom, if the scroll direction was downwards.

Any background formatting is forced to complete first.

Parameters

const TTmDocPosSpec & aDocPosThe new document position of the text cursor.
TBool aDragSelectOn = EFalseETrue if the region between the old and new cursor positions should be selected, EFalse if not. If ETrue, any existing selection remains selected, so that this function can be used to extend or shorten a selected region. EFalse cancels any existing selection.

SetDocPosL(TInt, TBool)

IMPORT_C TPointSetDocPosL(TIntaDocPos,
TBoolaDragSelectOn = EFalse
)

Moves the text cursor to a new document position. The view is scrolled so that the line containing the new cursor position is at the top, or the bottom, if the scroll direction was downwards.

Any background formatting is forced to complete first.

Parameters

TInt aDocPosThe new document position of the text cursor.
TBool aDragSelectOn = EFalseETrue if the region between the old and new cursor positions should be selected, EFalse if not. If ETrue, any existing selection remains selected, so that this function can be used to extend or shorten a selected region. EFalse cancels any existing selection.

SetDocPosL(const TTmDocPos &, TBool)

IMPORT_C TPointSetDocPosL(const TTmDocPos &aDocPos,
TBoolaDragSelectOn = EFalse
)

Moves the text cursor to a new document position. The view is scrolled so that the line containing the new cursor position is at the top, or the bottom, if the scroll direction was downwards.

Any background formatting is forced to complete first.

Parameters

const TTmDocPos & aDocPosThe new document position of the text cursor.
TBool aDragSelectOn = EFalseETrue if the region between the old and new cursor positions should be selected, EFalse if not. If ETrue, any existing selection remains selected, so that this function can be used to extend or shorten a selected region. EFalse cancels any existing selection.

SetExcessHeightRequired(TInt)

IMPORT_C voidSetExcessHeightRequired(TIntaExcessHeightRequired)

Set the delta required to position the baseline so there is enough space for the highset glyph in pixels. This is the height of the highest glyph - CFont::AscentInPixels(). Only used when using TLineSpacingControl::EAttLineSpacingControl. By default zero.

Parameters

TInt aExcessHeightRequiredExtra height above CFont::AscentInPixels() required for the highest glyph in pixels.

SetHighlightExtensions(TInt, TInt, TInt, TInt)

IMPORT_C voidSetHighlightExtensions(TIntaLeftExtension,
TIntaRightExtension,
TIntaTopExtension,
TIntaBottomExtension
)

Sets the selection highlight to have its edges moved by the specified number of pixels. Problems with highlights appearing in the wrong place may be due to incorrect font metrics, and would not be fixed in general with a call to this function.

Parameters

TInt aLeftExtensionNumber of pixels to the left to move the left of the highlight.
TInt aRightExtensionNumber of pixels to the right to move the right of the highlight.
TInt aTopExtensionNumber of pixels to the up to move the top of the highlight.
TInt aBottomExtensionNumber of pixels to the down to move the bottom of the highlight.

SetHorizontalScrollJump(TInt)

IMPORT_C voidSetHorizontalScrollJump(TIntaScrollJump)

Sets the number of pixels by which a horizontal scroll jump will cause the view to scroll. To carry out a horizontal scroll, use ScrollDisplayL().

Parameters

TInt aScrollJumpThe number of pixels by which a horizontal scroll jump will cause the view to scroll. Must be a positive value or a panic occurs.

SetLatentXPosition(TInt)

IMPORT_C voidSetLatentXPosition(TIntaLatentX)

Sets the pending horizontal text cursor position. This is the horizontal coordinate to which the text cursor is moved after a scroll up or down by a line or a page.

Parameters

TInt aLatentXThe horizontal coordinate to which the text cursor should be moved after a line or page scroll.

SetLayout(CTextLayout *)

IMPORT_C voidSetLayout(CTextLayout *aLayout)

Changes the text layout object used by the text view.

Parameters

CTextLayout * aLayoutPointer to the text layout object used by the text view. Must not be NULL or a panic occurs.

SetLeftTextMargin(TInt)

IMPORT_C voidSetLeftTextMargin(TIntaLeftMargin)

Sets the left text margin width in pixels.

The left text margin width is the distance between the text and the left edge of the page. Increasing the left text margin width causes text to move leftwards and decreasing the left text margin width causes text to move rightwards.

Does not redraw.

Parameters

TInt aLeftMarginThe left text margin width in pixels.

SetLineCursorBitmap(const CFbsBitmap *)

IMPORT_C voidSetLineCursorBitmap(const CFbsBitmap *aLineCursorBitmap)

Sets the bitmap to be used as a line cursor. This function must be called before attempting to draw the line cursor. Use SetCursorVisibilityL() to make the line cursor visible.

Parameters

const CFbsBitmap * aLineCursorBitmapThe bitmap which represents the line cursor.

SetMarginWidths(TInt, TInt)

IMPORT_C voidSetMarginWidths(TIntaLabels,
TIntaLineCursor
)

Sets the label and line cursor margin widths.

Does not redraw.

Parameters

TInt aLabelsThe width in pixels of the label margin.
TInt aLineCursorThe width in pixels of the line cursor margin.

SetObserver(MObserver *)

voidSetObserver(MObserver *aObserver)[inline]

Sets a text view observer. This provides notification to the owner of the text view object of changes to the formatting. Its OnReformatL() function is called after reformatting but before redisplay, so that edit windows etc. can be resized.

Parameters

MObserver * aObserverPointer to text view observer object.

SetOpaque(TBool)

IMPORT_C voidSetOpaque(TBoolaDrawOpaque)

Sets and unsets an opaque flag on the text view's window.

Parameters

TBool aDrawOpaqueIf true, opaque drawing mode is switched on. If false, normal drawing will be used.

SetParagraphFillTextOnly(TBool)

IMPORT_C voidSetParagraphFillTextOnly(TBoolaFillTextOnly)

Sets the horizontal extent of the view rectangle to fill with paragraph fill colour (CParaFormat::iFillColor).

Does not redraw.

Parameters

TBool aFillTextOnlyIf true, the region filled with paragraph fill colour is the area within the paragraph's bounding rectangle only (see ParagraphRectL()). If false, the filled region includes the left text margin, if one has been set. By default, false.

SetPendingSelection(const TCursorSelection &)

IMPORT_C voidSetPendingSelection(const TCursorSelection &aSelection)

Makes a selection, but without updating the view.

This function would only be used before calling CTextView::HandleRangeFormatChangeL() or HandleInsertDeleteL() to make a selection which will become visible (if selection visibility is on) after the change handling function has returned.

Parameters

const TCursorSelection & aSelectionThe range to be selected after calling CTextView::HandleRangeFormatChangeL() or HandleInsertDeleteL().

SetSelectionL(const TCursorSelection &)

IMPORT_C TPointSetSelectionL(const TCursorSelection &aSelection)

Sets a selection. The selection is highlighted unless selection visibility has been unset. Any existing selection is cancelled. If necessary, the view is scrolled and redrawn.

Any background formatting is forced to complete first.

Parameters

const TCursorSelection & aSelectionSpecifies the start and end positions of the selection.

SetSelectionVisibilityL(TBool)

IMPORT_C voidSetSelectionVisibilityL(TBoolaSelectionVisible)

Sets whether the text and pictures within a selection should be highlighted. If necessary, the view is redrawn.

An example of when this function may need to be used is when a control loses or gains focus.

Parameters

TBool aSelectionVisibleETrue for highlighted selection. EFalse for unhighlighted selection.

SetTextColorOverride(const TRgb *)

IMPORT_C voidSetTextColorOverride(const TRgb *aOverrideColor = NULL)

Overrides the text colour, so that when redrawn, all text has the colour specified, rather than the colour which is set in the text object. When text is in this overridden state, no highlighting is visible. To return the text colour to its original state, call this function again with an argument of NULL. This also has the effect that if selection visibility is set, any highlighting will be made visible again.

Does not do a redraw.

Parameters

const TRgb * aOverrideColor = NULLIf not NULL, overrides the text colour.

SetViewL(TInt, TInt &, TViewYPosQualifier, TDiscard, TDoHorizontalScroll)

IMPORT_C TPointSetViewL(TIntaDocPos,
TInt &aYPos,
TViewYPosQualifieraYPosQualifier =  TViewYPosQualifier(),
TDiscardaDiscardFormat = EFViewDontDiscardFormat,
TDoHorizontalScrollaDoHorizontalScroll = EFCheckForHorizontalScroll
)

Sets the vertical position of the view, so that the line containing aDocPos is located as close as possible to the vertical window coordinate aYPos.

Which part of the line is set to appear at aYPos (top, baseline, or bottom) is controlled by aYPosQualifier, which also specifies whether the visible area is to be filled and whether the line should be made fully visible if possible.

Parameters

TInt aDocPosThe document position. Must be valid or a panic occurs.
TInt & aYPosThe y coordinate at which to position the character at aDocPos. On return, contains the actual vertical window coordinate at which the document position has been set.
TViewYPosQualifier aYPosQualifier =  TViewYPosQualifier()Controls which part of the line should appear at aYPos.
TDiscard aDiscardFormat = EFViewDontDiscardFormatIf EFViewDiscardAllFormat or EFViewDiscardAllNoRedraw the text is reformatted to include aDocPos, otherwise text is formatted only as necessary when bringing new lines into the visible area. If EFViewDiscardAllNoRedraw, no redraw takes place.
TDoHorizontalScroll aDoHorizontalScroll = EFCheckForHorizontalScroll

SetViewLineAtTopL(TInt)

IMPORT_C TPointSetViewLineAtTopL(TIntaLineNo)

Moves the view vertically and redraws, so that the top of the specified line is located flush with the top of the view rectangle.

Note:

Line numbering is relative to formatted text only and the first formatted line is numbered one.

Parameters

TInt aLineNoThe number of the line to be displayed at the top of the view rectangle.

SetViewRect(const TRect &)

IMPORT_C voidSetViewRect(const TRect &aDisplay)

Sets the rectangle in which the text is displayed.

Note:

A valid band height (>0) must be supplied(i.e. aViewRect.Tl.iY coordinate must be lower than the aViewRect.Br.iY coordinate) or the expected amount of formatting will not take place. This could lead to panics when trying to retrieve formatting information that does not exist.

Parameters

const TRect & aDisplayThe view rectangle.

SetXyPosL(TPoint, TBool, TRect *&, TInt &)

IMPORT_C TPointSetXyPosL(TPointaPos,
TBoolaDragSelectOn,
TRect *&aPictureRect,
TInt &aPictureFrameEdges
)

Moves the text cursor to the nearest point on the screen to the x,y coordinates specified.

Any background formatting is forced to complete first.

Parameters

TPoint aPosThe window coordinates to which to move the text cursor.
TBool aDragSelectOnETrue if the region between the old and new cursor positions should be selected, EFalse if not. If ETrue, any existing selection remains selected, so that this function can be used to extend or shorten a selected region.EFalse cancels any existing selection.
TRect *& aPictureRectOn return, a pointer to the rectangle enclosing the picture at position aPos. If there is no picture at this position, returns NULL.
TInt & aPictureFrameEdgesOn return, indicates whether aPos is located within the active region around a picture edge. The active region is the region inside which the cursor can be used to resize the picture. A value of zero indicates that aPos is not within this region. Otherwise, this value indicates which active region aPos is located in. For more information, see TFrameOverlay::TEdges.

StartIdleObject()

voidStartIdleObject()[private]

Starts the Idle Object if not in the middle of drawing para borders.

TopViewRect()

TInt TopViewRect()const [private, inline]

UpdateHighlightL()

voidUpdateHighlightL()[private]

UpdatePictureFrameL()

voidUpdatePictureFrameL()[private]

Gets called after the cursor moved to a picture, creates the picture frame if it has not been created and updates its state.

ViewL(const TTmDocPos &, TInt &, TViewYPosQualifier, CTextView::TDiscard, TDoHorizontalScroll)

TPoint ViewL(const TTmDocPos &aDocPos,
TInt &aYPos,
TViewYPosQualifieraYPosQualifier =  TViewYPosQualifier(),
CTextView::TDiscardaDiscardFormat = EFViewDontDiscardFormat,
TDoHorizontalScrollaHorizontalScroll = EFCheckForHorizontalScroll
)[private]

Parameters

const TTmDocPos & aDocPos
TInt & aYPos
TViewYPosQualifier aYPosQualifier =  TViewYPosQualifier()
CTextView::TDiscard aDiscardFormat = EFViewDontDiscardFormat
TDoHorizontalScroll aHorizontalScroll = EFCheckForHorizontalScroll

ViewRect()

IMPORT_C const TRect &ViewRect()const

Gets the rectangle in which the text is displayed.

ViewTopOfLineL(const TTmDocPos &, TInt &, CTextView::TDiscard, TDoHorizontalScroll)

TPoint ViewTopOfLineL(const TTmDocPos &aDocPos,
TInt &aYPos,
CTextView::TDiscardaDiscardFormat = EFViewDontDiscardFormat,
TDoHorizontalScrollaHorizontalScroll = EFCheckForHorizontalScroll
)[private]

Parameters

const TTmDocPos & aDocPos
TInt & aYPos
CTextView::TDiscard aDiscardFormat = EFViewDontDiscardFormat
TDoHorizontalScroll aHorizontalScroll = EFCheckForHorizontalScroll

VisualEndOfRunL(const TTmDocPos &, const TTmDocPos &, TCursorPosition::TVisualEnd)

IMPORT_C const TTmDocPos &VisualEndOfRunL(const TTmDocPos &aStart,
const TTmDocPos &aEnd,
TCursorPosition::TVisualEndaDirection
)

Calculates which of two document positions would be considered more left or more right, depending on the value of aDirection.

Parameters

const TTmDocPos & aStartFirst document position to compare.
const TTmDocPos & aEndSecond document position to compare.
TCursorPosition::TVisualEnd aDirectionIf EVisualLeft, the function returns the left-most of aStart and aEnd. If EVisualRight, the function returns the right-most.

XyPosToDocPosL(TPoint &)

IMPORT_C TIntXyPosToDocPosL(TPoint &aPoint)

Gets the index of the nearest character in the document to the window coordinates specified. The function first identifies the line which contains, or is nearest to, the vertical coordinate. Then it identifies the character in that line closest to the horizontal coordinate.

Parameters

TPoint & aPointWindow coordinates. On return, contains the window coordinates of the nearest character to the point.

Member Enumerations Documentation

Enum anonymous

deprecated 8.0

Enumerators

EFFirstCharOnLine = -1000000
EFLastCharOnLine = 1000000

Enum anonymous

Enumerators

EFSelectionVisible = 1
EFPictureFrameEnabled = 2
EFEverythingVisible = 3
EFFlickerFreeRedraw = 4
EFTextVisible = 8

Enum TBeforeAfter

Cursor height matching.

Passed as an argument to MatchCursorHeightToAdjacentChar().

Enumerators

EFCharacterBefore = ETrue

Text cursor height is matched to preceding character.

EFCharacterAfter = EFalse

Text cursor height is matched to following character.

Enum TDiscard

Whether to reformat and redraw. Argument to SetViewL().

Enumerators

EFViewDiscardAllFormat

Discard all formatting; redraw.

EFViewDontDiscardFormat

Do not discard all formatting; redraw.

EFViewDiscardAllNoRedraw

Discard all formatting; no redraw.

EFViewDontDiscardFullRedraw

Do not discard all formatting; redraw.

Enum TDoHorizontalScroll

Enumerators

EFNoHorizontalScroll = EFalse
EFCheckForHorizontalScroll = ETrue

Enum TDrawParameters

Enumerators

EFDrawAllWindow = CLayoutData::EFLargeNumber

Enum TExtendedHighlightRedraw

Enumerators

EFTopEdge = 0x0001
EFBottomEdge = 0x0002

Enum THorizontalScroll

Enumerators

EFNoPreviousHorizontalScroll = 0
EFPreviousHorizontalScroll

Enum THorizontalScrollJump

Enumerators

EFDefaultHorizontalScrollJump = 20

Enum TMemoryStatus

Enumerators

EFMemoryOK
EFOutOfMemory
EFRecovering

Enum TPictureFrameBlobWidths

Enumerators

EFFrameVisibleBlobWidth = 10
EFFrameActiveBlobWidth = 20

Enum TPriorities

Enumerators

EFBackgroundFormattingPriority = (CActive::EPriorityIdle + CActive::EPriorityLow) / 2

Member Data Documentation

TBool iContextIsNavigation

TBool iContextIsNavigation[private]

TCursor iCursor

TCursor iCursor[private]

TCursorPosition iCursorPos

TCursorPosition iCursorPos[private]

RScreenDisplay iDisplay

RScreenDisplay iDisplay[private]

TBool iDrawOpaque

TBool iDrawOpaque[private]

TDrawTextLayoutContext iDrawTextLayoutContext

TDrawTextLayoutContext iDrawTextLayoutContext[private]

TUint iDummy

TUint iDummy[private]

TUint iFlags

TUint iFlags[private]

TInt iFormattedUpTo

TInt iFormattedUpTo[private]

TInt iGood

TInt iGood[private]

TInt iHeightNotDrawn

TInt iHeightNotDrawn[private]

TUint iHorizontalScroll

TUint iHorizontalScroll[private]

TInt iHorizontalScrollJump

TInt iHorizontalScrollJump[private]

CTextLayout * iLayout

CTextLayout *iLayout[private]

TMemoryStatus iNoMemory

TMemoryStatus iNoMemory[private]

MObserver * iObserver

MObserver *iObserver[private]

CBitmapContext * iOffScreenContext

CBitmapContext *iOffScreenContext[private]

TFrameOverlay * iPictureFrame

TFrameOverlay *iPictureFrame[private]

TRect iReducedDrawingAreaRect

TRect iReducedDrawingAreaRect[private]

CIdle * iWrap

CIdle *iWrap[private]