CTextLayout Class Reference

class CTextLayout : public CBase

Text layout.

CTextLayout is the lowest-level text formatting class in the Text Views API. It obtains text and formatting attributes via the MLayDoc interface class and formats the text to a certain width.

It has functions for drawing the text and performing hit-detection that is, converting x-y coordinates to document positions, and vice versa. It defines many public functions that are not generally useful, but are called by the higher-level CTextView class, or exist only for the convenience of closely associated classes like the printing and pagination systems. These are identified in the documentation by the text "not generally useful".

When using the CTextLayout class, you must be aware of what functions have previously been called. For example:

1) Formatting and scrolling functions must not be called if a CTextView object owns the CTextLayout object, because the CTextView object may be reformatting the CTextLayout object asynchronously by means of an active object, or may hold some state information about the CTextLayout object that would be invalidated by reformatting. These functions are identified in the documentation by the text "Do not use if a CTextView object owns this CTextLayout object.".

2) Functions that raise out of memory exceptions can leave the object in an inconsistent state; these functions can be identified as usual by their trailing L. When this occurs, it is necessary to discard the formatting information by calling DiscardFormat().

3) Some functions change formatting parameters like the wrap width or band height, but do not reformat to reflect the change. These functions are identified in the documentation by the text "Reformat needed".

Inherits from

Public Member Functions
~CTextLayout()
IMPORT_C voidAdjustVerticalAlignment(CParaFormat::TAlignment)
TBool CalculateHorizontalExtremes(TInt &, TInt &, TBool)
IMPORT_C TBoolCalculateHorizontalExtremesL(TInt &, TInt &, TBool, TBool)
IMPORT_C voidChangeBandTopNoLimitBorderL(TInt)
IMPORT_C const MFormCustomWrap *CustomWrap()
voidDrawBackground(CGraphicsContext &, const TPoint &, const TRect &, const TLogicalRgb &)
IMPORT_C voidDrawBorders(const MGraphicsDeviceMap *, CGraphicsContext &, const TRect &, const TParaBorderArray &, const TRgb *, TRegion *, const TRect *)
IMPORT_C voidDrawL(const TRect &, const TDrawTextLayoutContext *, const TCursorSelection *)
voidEndRedraw()
IMPORT_C TBoolExcludingPartialLines()
IMPORT_C voidExtendFormattingToCoverPosL(TInt)
IMPORT_C voidExtendFormattingToCoverYL(TInt)
IMPORT_C TBoolFindXyPos(const TPoint &, TTmPosInfo2 &, TTmLineInfo *)
IMPORT_C voidFormatCharRangeL(TInt, TInt)
IMPORT_C TBoolFormatNextLineL(TInt &)
IMPORT_C TIntFormattedLength()
IMPORT_C voidGetCharacterHeightAndAscentL(TInt, TInt &, TInt &)
TBool GetCursor(const TTmDocPos &, TTmCursorPlacement, TRect &, TPoint &, TInt &, TInt &, TInt &)
IMPORT_C voidGetFontHeightAndAscentL(const TFontSpec &, TInt &, TInt &)
IMPORT_C TIntGetLineNumber(TInt)
IMPORT_C TIntGetLineRect(TInt, TRect &)
IMPORT_C TRectGetLineRectL(TInt, TInt)
IMPORT_C voidGetMinimumSizeL(TInt, TSize &)
IMPORT_C TBoolGetNextVisualCursorPos(const TTmDocPosSpec &, TTmPosInfo2 &, TBool)
voidGetOrigin(TPoint &)
voidGetParagraphRect(const TTmDocPos &, TRect &)
IMPORT_C voidHandleAdditionalCharactersAtEndL(TInt &, TInt &)
IMPORT_C voidHandleBlockChangeL(TCursorSelection, TInt, TViewRectChanges &, TBool)
IMPORT_C TBoolHandleCharEditL(TUint, TInt &, TInt &, TInt &, TInt &, TInt &, TBool)
IMPORT_C voidHighlight(const TRangeChange &, const TRect &, const TDrawTextLayoutContext *)
const TTmHighlightExtensions &HighlightExtensions()
voidHighlightUsingExtensions(const CTextLayout::TRangeChange &, const TRangeChange &, const TRect &, const TDrawTextLayoutContext *)
IMPORT_C voidInvertRangeL(const TCursorSelection &, const TRect &, const TDrawTextLayoutContext *)
IMPORT_C TBoolIsWrapping()
IMPORT_C TIntMajorVersion()
IMPORT_C voidMakeVisible(TBool)
IMPORT_C TIntMinimumLineDescent()
IMPORT_C CTextLayout *NewL(MLayDoc *, TInt)
IMPORT_C TNonPrintingCharVisibilityNonPrintingCharsVisibility()
IMPORT_C voidNotifyTerminateBackgroundFormatting()
IMPORT_C TIntNumFormattedLines()
IMPORT_C voidPageDownL(TInt &, TInt &)
IMPORT_C voidPageUpL(TInt &, TInt &)
voidPanic(TPanicNumber)
IMPORT_C TIntParagraphHeight(TInt)
IMPORT_C TRectParagraphRectL(TInt)
TInt PictureRectangleAndPosL(const TPoint &, TRect &, TBool *)
IMPORT_C TBoolPictureRectangleL(TInt, TRect &, TBool *)
IMPORT_C TBoolPictureRectangleL(const TPoint &, TRect &, TBool *)
IMPORT_C TBoolPosInBand(const TTmDocPos &, TTmLineInfo *)
IMPORT_C TBoolPosInBand(TTmDocPos, TPoint &)
IMPORT_C TBoolPosIsFormatted(TInt)
IMPORT_C TIntPosRangeInBand(TInt &)
IMPORT_C voidReformatVerticalSpaceL()
voidResetExternalDraw()
voidRestrictScrollToTopsOfLines(TBool)
TInt ScrollDocPosIntoViewL(const TTmDocPos &)
IMPORT_C TIntScrollLinesL(TInt &, TAllowDisallow)
IMPORT_C TIntScrollParagraphsL(TInt &, TAllowDisallow)
IMPORT_C voidSetAmountToFormat(TAmountFormatted)
IMPORT_C voidSetBandHeight(TInt)
IMPORT_C voidSetCustomDraw(const MFormCustomDraw *)
IMPORT_C voidSetCustomInvisibleCharacterRemapper(MFormCustomInvisibleCharacterRemapper *)
IMPORT_C voidSetCustomWrap(const MFormCustomWrap *)
IMPORT_C voidSetExcludePartialLines(TBool)
voidSetExternalDraw(const TRect &)
IMPORT_C voidSetFontHeightIncreaseFactor(TInt)
IMPORT_C voidSetFormatMode(CLayoutData::TFormatMode, TInt, MGraphicsDeviceMap *)
IMPORT_C voidSetHighlightExtensions(TInt, TInt, TInt, TInt)
IMPORT_C voidSetImageDeviceMap(MGraphicsDeviceMap *)
IMPORT_C voidSetInterfaceProvider(MFormCustomInterfaceProvider *)
IMPORT_C voidSetLabelsDeviceMap(MGraphicsDeviceMap *)
IMPORT_C voidSetLayDoc(MLayDoc *)
IMPORT_C voidSetMinimumLineDescent(TInt)
IMPORT_C voidSetNonPrintingCharsVisibility(TNonPrintingCharVisibility)
voidSetOpaqueLC()
voidSetReadyToRedraw()
voidSetTextViewCursorPos(TCursorPosition *)
IMPORT_C voidSetTruncating(TBool)
IMPORT_C TIntSetViewL(const TTmDocPos &, TInt &, TViewYPosQualifier, TDiscard)
IMPORT_C TIntSetViewL(TInt, TInt &, TViewYPosQualifier, TDiscard)
voidSetWindow(RWindow *)
IMPORT_C voidSetWrapWidth(TInt)
const CTmTextLayout &TagmaTextLayout()
IMPORT_C TIntToParagraphStart(TInt &)
IMPORT_C TBoolTruncating()
IMPORT_C TCharTruncatingEllipsis()
TInt WrapWidth()
IMPORT_C TIntXyPosToDocPosL(TPoint &, TUint)
IMPORT_C TIntYBottomLastFormattedLine()
Private Member Functions
CTextLayout()
TBool AddFormattingAtEndL(TTmFormatParamBase &, TInt &, TInt &)
voidInitFormatParam(TTmFormatParamBase &)
voidPruneFormatL(TBool)
voidResetOpaque(void *)
TInt ScrollL(TInt, TAllowDisallow, TBool, TBool)
TInt SetBandTop()
TInt SuggestCursorPos(TInt)
TInt VisibleHeightInPixels()
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 { EFCharacterInsert, EFParagraphDelimiter, EFLeftDelete, EFRightDelete }
enumanonymous { EFScrollRedrawWholeScreen = CLayoutData::EFLargeNumber, EFMaximumLineWidth = CLayoutData::EFBodyWidthForNoWrapping }
enumanonymous { EFAllParagraphsNotWrapped = TRUE, EFParagraphsWrappedByDefault = FALSE }
enumanonymous { }
enumanonymous { }
enumanonymous { }
enumTAllowDisallow { EFAllowScrollingBlankSpace = TRUE, EFDisallowScrollingBlankSpace = FALSE }
enumTAmountFormatted { EFFormatAllText = FALSE, EFFormatBand = TRUE }
enumTCurrentFormat { EFNoCurrentFormat = -1, EFNotInCurrentFormat = 0 }
enumTDiscard { EFViewDiscardAllFormat = TRUE, EFViewDontDiscardFormat = FALSE }
enumTPanicNumber {
EUnimplemented, ENoMemory, EDrawingBorderError, EFormatDeviceNotSet, EImageDeviceNotSet, EPixelNotInFormattedLine, EInvalidDocPos, ENoCharRangeToFormat, ECharacterNotFormatted, EPrintPreviewModeError, EBadCharacterEditType, EInvalidLineNumber, EPosNotFormatted, EMustFormatAllText, EPageScrollError, EInvalidRedraw
}
enumTScrollFlags { EFScrollOnlyToTopsOfLines = 1 }
Private Attributes
TInt iBandHeight
TInt iBandTop
TBool iBeginRedrawCount
TInt iDmmyForIHighlightExtensions
TInt iDmmyForISource
TInt iDummy
TInt iDummyForIText
TInt iExcessHeightRequired
TTmHighlightExtensions *iHighlightExtensions
TBool iIsWndInExternalRedraw
TBool iParInvalid
TBool iReadyToRedraw
TRect iRedrawRect
TInt iScrollFlags
TLayDocTextSource *iSource
CTmTextLayout *iText
TCursorPosition *iTextViewCursorPos
TInt iUnformattedStart
TInt iVisibleHeight
RWindow *iWnd

Constructor & Destructor Documentation

CTextLayout()

IMPORT_CCTextLayout()[private]

~CTextLayout()

IMPORT_C~CTextLayout()

Member Functions Documentation

AddFormattingAtEndL(TTmFormatParamBase &, TInt &, TInt &)

TBool AddFormattingAtEndL(TTmFormatParamBase &aFormatParam,
TInt &aHeightIncrease,
TInt &aParagraphsIncrease
)[private]

Parameters

TTmFormatParamBase & aFormatParam
TInt & aHeightIncrease
TInt & aParagraphsIncrease

AdjustVerticalAlignment(CParaFormat::TAlignment)

IMPORT_C voidAdjustVerticalAlignment(CParaFormat::TAlignmentaVerticalAlignment)

Parameters

CParaFormat::TAlignment aVerticalAlignment

CalculateHorizontalExtremes(TInt &, TInt &, TBool)

TBool CalculateHorizontalExtremes(TInt &aLeftX,
TInt &aRightX,
TBoolaOnlyVisibleLines
)const

Parameters

TInt & aLeftX
TInt & aRightX
TBool aOnlyVisibleLines

CalculateHorizontalExtremesL(TInt &, TInt &, TBool, TBool)

IMPORT_C TBoolCalculateHorizontalExtremesL(TInt &aLeftX,
TInt &aRightX,
TBoolaOnlyVisibleLines,
TBoolaIgnoreWrapCharacters = FALSE
)const

Returns the left and right extremes, in layout 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.
TBool aIgnoreWrapCharacters = FALSEIf ETrue, does not include wrap characters in the measurement (paragraph delimiters, forced line breaks, etc.). If EFalse, includes them.

ChangeBandTopNoLimitBorderL(TInt)

IMPORT_C voidChangeBandTopNoLimitBorderL(TIntaPixels)

Scrolls the text up or down by aPixels pixels, allowing blank space at top and bottom of the visible area, which means the scrolling can go beyond the top or bottom border.

Do not use if a CTextView object owns this CTextLayout object.

Parameters

TInt aPixelsThe number of pixels to scroll; may be a positive or negative value. The actual scrolled pixel number is always identical to aPixels

CustomWrap()

IMPORT_C const MFormCustomWrap *CustomWrap()const

DrawBackground(CGraphicsContext &, const TPoint &, const TRect &, const TLogicalRgb &)

voidDrawBackground(CGraphicsContext &aGc,
const TPoint &aTopLeft,
const TRect &aClipRect,
const TLogicalRgb &aBackground
)const

Parameters

CGraphicsContext & aGc
const TPoint & aTopLeft
const TRect & aClipRect
const TLogicalRgb & aBackground

DrawBorders(const MGraphicsDeviceMap *, CGraphicsContext &, const TRect &, const TParaBorderArray &, const TRgb *, TRegion *, const TRect *)

IMPORT_C voidDrawBorders(const MGraphicsDeviceMap *aGd,
CGraphicsContext &aGc,
const TRect &aRect,
const TParaBorderArray &aBorder,
const TRgb *aBackground = NULL,
TRegion *aClipRegion = NULL,
const TRect *aDrawRect = NULL
)[static]

Draws paragraph borders, optionally with a background colour for the border and a clip region. Provided for applications that display a menu of border styles, like a wordprocessor.

Parameters

const MGraphicsDeviceMap * aGdProvides twip-to-pixel conversion.
CGraphicsContext & aGcGraphics context to which to draw the border. Its pen settings are overridden by the values specified by aBorder and its draw mode is set to CGraphicsContext::EDrawModePEN.
const TRect & aRectThe outer bounds of the border.
const TParaBorderArray & aBorderSpecifies the four sides of the border.
const TRgb * aBackground = NULLIf not null, the background colour, (used between double border lines, or between dots or dashes).
TRegion * aClipRegion = NULLIf non-null, specifies a clip region.
const TRect * aDrawRect = NULLIf non-null, and if aClipRegion is non-null, specifies a rectangle to be subtracted from the clip region.

DrawL(const TRect &, const TDrawTextLayoutContext *, const TCursorSelection *)

IMPORT_C voidDrawL(const TRect &aDrawRect,
const TDrawTextLayoutContext *aDrawTextLayoutContext,
const TCursorSelection *aHighlight = NULL
)

Draws the text. Draws any lines that intersect aDrawRect, which is specified in window coordinates. The drawing parameters, including the graphics context, are given in aDrawTextLayoutContext. If aHighlight is non-null, highlights (by exclusive-ORing) the specified range of text.

Parameters

const TRect & aDrawRectThe function draw the lines within the visible area, which intersect this rectangle (which is specified in window coordinates).
const TDrawTextLayoutContext * aDrawTextLayoutContextProvides a graphics context and other parameters for the function.
const TCursorSelection * aHighlight = NULLIf not NULL, this range of text is drawn highlighted.

EndRedraw()

voidEndRedraw()

ExcludingPartialLines()

IMPORT_C TBoolExcludingPartialLines()const

Tests whether partial lines at the top and bottom of the view are currently excluded.

7.0

ExtendFormattingToCoverPosL(TInt)

IMPORT_C voidExtendFormattingToCoverPosL(TIntaDocPos)

Parameters

TInt aDocPos

ExtendFormattingToCoverYL(TInt)

IMPORT_C voidExtendFormattingToCoverYL(TIntaYPos)

Makes sure the line that aYPos is in (if it exists) is covered by the formatting.

Parameters

TInt aYPosY pixel position in window-relative co-ordinates.

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

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

Finds the document position nearest to aXyPos. If aXyPos is in the formatted text returns ETrue, otherwise returns EFalse. If ETrue is returned, places information about the document position in aPosInfo and information about the line containing the document position in aLineInfo if it is non-NULL.

Parameters

const TPoint & aXyPosContains coordinates to convert to a document position.
TTmPosInfo2 & aPosInfoBuffer to store information about the document position if the specified coordinates are located in the formatted text.
TTmLineInfo * aLineInfo = NULLBuffer to store information about the line if the specified coordinates are located in the formatted text.

FormatCharRangeL(TInt, TInt)

IMPORT_C voidFormatCharRangeL(TIntaStartDocPos,
TIntaEndDocPos
)

Sets the formatted text to begin at the start of the paragraph including aStartPos and end at aEndPos. Moves the line containing aStartDocPos to the top of the visible area.

Notes:

This function is not generally useful; it exists for the convenience of the printing system.

Do not use if a CTextView object owns this CTextLayout object.

Parameters

TInt aStartDocPosA document position within the paragraph from which to begin formatting.
TInt aEndDocPosDocument position at which to end formatting.

FormatNextLineL(TInt &)

IMPORT_C TBoolFormatNextLineL(TInt &aBotPixel)

A special function to support background formatting by the higher level CTextView class. It formats the next pending line. The return value is ETrue if there is more formatting to do. On entry, aBotPixel contains the y coordinate of the bottom of the formatted text; this is updated by the function.

Notes:

Not generally useful.

Do not use if a CTextView object owns this CTextLayout object.

Parameters

TInt & aBotPixelOn entry, contains the y coordinate of the bottom of the formatted text; this is updated by the function.

FormattedLength()

IMPORT_C TIntFormattedLength()const

Returns the number of formatted characters. This will be one more than expected if the formatted text runs to the end of the document, because it will include the end-of-text character.

GetCharacterHeightAndAscentL(TInt, TInt &, TInt &)

IMPORT_C voidGetCharacterHeightAndAscentL(TIntaDocPos,
TInt &aHeight,
TInt &aAscent
)const

Gets the height (ascent + descent) and ascent of the font of the character at aDocPos, as created using the graphics device map used for drawing (the "image device") and returns them in aHeight and aAscent, after increasing aHeight by the font height increase factor (see SetFontHeightIncreaseFactor()).

Parameters

TInt aDocPosA document position.
TInt & aHeightOn return contains the height in pixels of the character at aDocPos.
TInt & aAscentOn return, contains the ascent in pixels of the character at aDocPos.

GetCursor(const TTmDocPos &, TTmCursorPlacement, TRect &, TPoint &, TInt &, TInt &, TInt &)

TBool GetCursor(const TTmDocPos &aDocPos,
TTmCursorPlacementaPlacement,
TRect &aLineRect,
TPoint &aOrigin,
TInt &aWidth,
TInt &aAscent,
TInt &aDescent
)const

Parameters

const TTmDocPos & aDocPos
TTmCursorPlacement aPlacement
TRect & aLineRect
TPoint & aOrigin
TInt & aWidth
TInt & aAscent
TInt & aDescent

GetFontHeightAndAscentL(const TFontSpec &, TInt &, TInt &)

IMPORT_C voidGetFontHeightAndAscentL(const TFontSpec &aFontSpec,
TInt &aHeight,
TInt &aAscent
)const

Gets the height (ascent + descent) and ascent of the font specified by aFontSpec, as created using the graphics device map used for drawing (the "image device") and puts them into aHeight and aAscent, after increasing aHeight by the font height increase factor (see SetFontHeightIncreaseFactor()).

Parameters

const TFontSpec & aFontSpecFont specification.
TInt & aHeightOn return, contains the height in pixels of the font.
TInt & aAscentOn return, contains the ascent in pixels of the font.

GetLineNumber(TInt)

IMPORT_C TIntGetLineNumber(TIntaDocPos)

Parameters

TInt aDocPos

GetLineRect(TInt, TRect &)

IMPORT_C TIntGetLineRect(TIntaYPos,
TRect &aLine
)const

Gets the rectangle enclosing the formatted line that contains or is closest to y coordinate aYPos. If aYPos is above the first formatted line, the rectangle returned is that of the first formatted line. If aYPos is below the last formatted line the rectangle returned is that of the last formatted line. If there is no formatted text, returns CTextLayout::EFNoCurrentFormat.

Parameters

TInt aYPosThe y coordinate of the line of interest.
TRect & aLineOn return, contains the rectangle which encloses the line at aYPos.

GetLineRectL(TInt, TInt)

IMPORT_C TRectGetLineRectL(TIntaDocPos1,
TIntaDocPos2
)const

Gets a rectangle enclosing two formatted document positions on the same line. If the second position is less than the first, or on a different line, it is taken to indicate the end of the line. This function panics if either position is unformatted.

Note:

CTextLayout must have been set with a valid wrap width and band height before calling this function, otherwise no formatting will take place and the function will panic. Wrap width and band height values must be > 0 to be valid.

SetBandHeight SetWrapWidth

Parameters

TInt aDocPos1The first document position on the line.
TInt aDocPos2The second document position on the line.

GetMinimumSizeL(TInt, TSize &)

IMPORT_C voidGetMinimumSizeL(TIntaWrapWidth,
TSize &aSize
)

Gets the width and height of the bounding box of the text, including indents and margins, when formatted to the specified wrap width.

This is useful for applications like a web browser that need to determine the minimum width for a piece of text: if you specify zero as the wrap width, the returned aSize.iWidth contains the minimum width that could be used for the text without illegal line breaks, and if you specify KMaxTInt for aWrapWidth, the returned aSize.iHeight contains the minimum height: the height when each paragraph is a single line of unlimited length.
Since
6.0

Parameters

TInt aWrapWidthThe wrap width for the bounding box.
TSize & aSizeOn return, contains the width and height of the bounding box.

GetNextVisualCursorPos(const TTmDocPosSpec &, TTmPosInfo2 &, TBool)

IMPORT_C TBoolGetNextVisualCursorPos(const TTmDocPosSpec &aDocPos,
TTmPosInfo2 &aPosInfo,
TBoolaToLeft
)const

Finds the next cursor position to aDocPos in the visually ordered line.

Parameters

const TTmDocPosSpec & aDocPosContains the document position to check.
TTmPosInfo2 & aPosInfoOn return, stores information about the document position of the next cursor position, if ETrue is returned.
TBool aToLeftETrue if the position to the left is to be found, or EFalse if the position to the right is to be found.

GetOrigin(TPoint &)

voidGetOrigin(TPoint &aPoint)const [inline]

Parameters

TPoint & aPoint

GetParagraphRect(const TTmDocPos &, TRect &)

voidGetParagraphRect(const TTmDocPos &aDocPos,
TRect &aRect
)const

Parameters

const TTmDocPos & aDocPos
TRect & aRect

HandleAdditionalCharactersAtEndL(TInt &, TInt &)

IMPORT_C voidHandleAdditionalCharactersAtEndL(TInt &aFirstPixel,
TInt &aLastPixel
)

Parameters

TInt & aFirstPixel
TInt & aLastPixel

HandleBlockChangeL(TCursorSelection, TInt, TViewRectChanges &, TBool)

IMPORT_C voidHandleBlockChangeL(TCursorSelectionaSelection,
TIntaOldCharsChanged,
TViewRectChanges &aViewChanges,
TBoolaFormatChanged
)

Reformats to reflect changes to a block of text.

Do not use if a CTextView object owns this CTextLayout object.

Parameters

TCursorSelection aSelectionThe start and new length of the changed block. When inserting, specify the insertion position. When deleting, specify the position of the start of the deletion. When reformatting, specify the start and length of the reformatted block.
TInt aOldCharsChangedThe old length of the changed block. When inserting, specify zero. When deleting, specify the number of deleted characters. When reformatting, specify the number of reformatted characters.
TViewRectChanges & aViewChangesOn return, contains the top of the reformatted text (iFormattedFrom), the bottom of the reformatted text (iFormattedTo), the amount by which the text above the reformatted text has scrolled (iScrollAtTop) and the amount by which the text below the reformatted text has scrolled (iScrollAtBottom) (positive values mean the text moves down).
TBool aFormatChangedIndicates whether the paragraph format for the first or last affected paragraph has changed, meaning that the text to be reformatted must extend out to paragraph boundaries and cannot be restricted to only some lines.

HandleCharEditL(TUint, TInt &, TInt &, TInt &, TInt &, TInt &, TBool)

IMPORT_C TBoolHandleCharEditL(TUintaType,
TInt &aCursorPos,
TInt &aGood,
TInt &aFormattedUpTo,
TInt &aFormattedFrom,
TInt &aScroll,
TBoolaFormatChanged
)

Reformats to reflect a single character edit.

Do not use if a CTextView object owns this CTextLayout object.

Parameters

TUint aTypeIndicates 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 document position.
TInt & aCursorPosThe document position at which the edit took place, before the edit. If this position is not formatted, a panic occurs; it is modified in accordance with the edit.
TInt & aGoodOn return, the y coordinate of the top of the paragraph following the paragraph which has been edited, before the edit.
TInt & aFormattedUpToOn return, the y coordinate of the bottom of the reformatted line or lines, after the edit.
TInt & aFormattedFromOn return, the vertical layout coordinate of the top of the reformatted line or lines, after the edit.
TInt & aScrollThe number of pixels by which the text had to be scrolled (positive means text moved down).
TBool aFormatChangedETrue 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.

Highlight(const TRangeChange &, const TRect &, const TDrawTextLayoutContext *)

IMPORT_C voidHighlight(const TRangeChange &aHighlight,
const TRect &aDrawRect,
const TDrawTextLayoutContext *aDrawTextLayoutContext
)

Sets or clears a highlight.

If the range of characters to highlight is of zero length, the function has no effect.

The function affects only those lines that intersect aDrawRect, which is specified in window coordinates. The drawing parameters, including the graphics context, are given in aDrawTextLayoutContext.

From v7.0, this function replaces InvertRangeL().

This function is not intended to be used to set any part of a highlight already set, nor to clear any piece of text not highlighted. It is intended to do either or both of: clear an existing selection, set a new selection. See the class description for TRangeChange for a code fragment showing how this function should be used.

Parameters

const TRangeChange & aHighlightSpecifies the range of characters to highlight or from which to remove the highlight.
const TRect & aDrawRectOnly lines which intersect this rectangle are affected (specified in window coordinates).
const TDrawTextLayoutContext * aDrawTextLayoutContextProvides a graphics context and other drawing parameters, e.g. the text and background colours for the highlighted region.

HighlightExtensions()

const TTmHighlightExtensions &HighlightExtensions()const [inline]

HighlightUsingExtensions(const CTextLayout::TRangeChange &, const TRangeChange &, const TRect &, const TDrawTextLayoutContext *)

voidHighlightUsingExtensions(const CTextLayout::TRangeChange &aChangeHighlight,
const TRangeChange &aFullHighlight,
const TRect &aDrawRect,
const TDrawTextLayoutContext *aDrawTextLayoutContext
)

Parameters

const CTextLayout::TRangeChange & aChangeHighlight
const TRangeChange & aFullHighlight
const TRect & aDrawRect
const TDrawTextLayoutContext * aDrawTextLayoutContext

InitFormatParam(TTmFormatParamBase &)

voidInitFormatParam(TTmFormatParamBase &aParam)[private]

Parameters

TTmFormatParamBase & aParam

InvertRangeL(const TCursorSelection &, const TRect &, const TDrawTextLayoutContext *)

IMPORT_C voidInvertRangeL(const TCursorSelection &aHighlight,
const TRect &aDrawRect,
const TDrawTextLayoutContext *aDrawTextLayoutContext
)

Toggles the selection highlight for the range of text in aHighlight.

Highlights only those lines that intersect aDrawRect, which is specified in window coordinates. The drawing parameters, including the graphics context, are given in aDrawTextLayoutContext.

In v7.0 and onwards, this function is deprecated -Highlight() should be used instead.

Parameters

const TCursorSelection & aHighlightThe range of characters for which to invert the highlighting.
const TRect & aDrawRectOnly lines which intersect this rectangle are affected; specified in window coordinates.
const TDrawTextLayoutContext * aDrawTextLayoutContextProvides a graphics context and other drawing parameters.

IsWrapping()

IMPORT_C TBoolIsWrapping()const

Tests whether wrapping is on or off.

MajorVersion()

IMPORT_C TIntMajorVersion()const

Return the FORM major version number. This function is not generally useful. It is used in test code and was used while making a transition between this and the former version of FORM. The return value is always 2.

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.

MinimumLineDescent()

IMPORT_C TIntMinimumLineDescent()const

NewL(MLayDoc *, TInt)

IMPORT_C CTextLayout *NewL(MLayDoc *aDoc,
TIntaWrapWidth
)[static]

Allocates and constructs a CTextLayout object. By default, the formatting is set to the entire document (EFFormatAllText).

The text needs to be reformatted after a call to this function.

Parameters

MLayDoc * aDocPointer to the MLayDoc implementation that is the source of the text and formatting information. Must not be NULL or a panic occurs.
TInt aWrapWidthThe wrapping width in pixels.

NonPrintingCharsVisibility()

IMPORT_C TNonPrintingCharVisibilityNonPrintingCharsVisibility()const

NotifyTerminateBackgroundFormatting()

IMPORT_C voidNotifyTerminateBackgroundFormatting()

CTextView calls this function when background formatting has ended. It allows the CTextLayout object to discard information used only during background formatting.

Not generally useful.

NumFormattedLines()

IMPORT_C TIntNumFormattedLines()const

Gets the number of formatted lines.

PageDownL(TInt &, TInt &)

IMPORT_C voidPageDownL(TInt &aYCursorPos,
TInt &aPixelsScrolled
)

Parameters

TInt & aYCursorPos
TInt & aPixelsScrolled

PageUpL(TInt &, TInt &)

IMPORT_C voidPageUpL(TInt &aYCursorPos,
TInt &aPixelsScrolled
)

Scrolls up by a page (that is the band height as set by SetBandHeight(), or half that amount if scrolling over lines taller than this), moving the text downwards. The current desired vertical cursor position is passed in aYCursorPos and updated to a new suggested position as near as possible to it, but within the visible text and on a baseline.

Do not use if a CTextView object owns this CTextLayout object.

Parameters

TInt & aYCursorPosThe current desired vertical cursor position. On return, updated to a new suggested position as near as possible to it.
TInt & aPixelsScrolledOn return, contains the number of pixels scrolled.

Panic(TPanicNumber)

voidPanic(TPanicNumberaNumber)[static]

Parameters

TPanicNumber aNumber

ParagraphHeight(TInt)

IMPORT_C TIntParagraphHeight(TIntaDocPos)const

Returns the height of the paragraph containing aDocPos. If the paragraph is not formatted, returns zero. If the paragraph is partially formatted, returns the height of the formatted part.

Parameters

TInt aDocPosA document position within the paragraph of interest.

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.

PictureRectangleAndPosL(const TPoint &, TRect &, TBool *)

TInt PictureRectangleAndPosL(const TPoint &aXyPos,
TRect &aPictureRect,
TBool *aCanScaleOrCrop = 0
)const

Finds if there is a picture at the position under the point aXyPos. If there is, returns the document position of it, sets the rectangle occupied in aPictureRect, and whether the picture allows scaling in aCanScaleOrCrop, if non-null. Note that aXyPos may be outside the picture found.

Parameters

const TPoint & aXyPos
TRect & aPictureRect
TBool * aCanScaleOrCrop = 0

PictureRectangleL(TInt, TRect &, TBool *)

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

Gets the bounding rectangle of the picture, if any, located at the document position or 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 ETrue if the operation was successful. Returns EFalse 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 ETrue, on return, indicates whether the picture can be scaled or cropped. By default, NULL.

PictureRectangleL(const TPoint &, TRect &, TBool *)

IMPORT_C TBoolPictureRectangleL(const TPoint &aXyPos,
TRect &aPictureRect,
TBool *aCanScaleOrCrop = NULL
)const

Parameters

const TPoint & aXyPos
TRect & aPictureRect
TBool * aCanScaleOrCrop = NULL

PosInBand(const TTmDocPos &, TTmLineInfo *)

IMPORT_C TBoolPosInBand(const TTmDocPos &aDocPos,
TTmLineInfo *aLineInfo = NULL
)const

Parameters

const TTmDocPos & aDocPos
TTmLineInfo * aLineInfo = NULL

PosInBand(TTmDocPos, TPoint &)

IMPORT_C TBoolPosInBand(TTmDocPosaDocPos,
TPoint &aXyPos
)const

Parameters

TTmDocPos aDocPos
TPoint & aXyPos

PosIsFormatted(TInt)

IMPORT_C TBoolPosIsFormatted(TIntaDocPos)const

Tests whether the character aDocPos is formatted.

Note:

If a section of text contains characters p to q, it contains document positions p to q + 1; but this function returns ETrue for positions p to q only, so it refers to characters, not positions. However, it will return ETrue for q if q is the end of the document.

Parameters

TInt aDocPosThe document position of interest.

PosRangeInBand(TInt &)

IMPORT_C TIntPosRangeInBand(TInt &aDocPos)const

Returns the number of fully or partially visible characters in the visible band.

Parameters

TInt & aDocPosOn return, contains the document position of the first fully or partially visible character in the band.

PruneFormatL(TBool)

voidPruneFormatL(TBoolaFromStart)[private]

Parameters

TBool aFromStart

ReformatVerticalSpaceL()

IMPORT_C voidReformatVerticalSpaceL()

Reformats to reflect changes to the space above and below paragraphs (CParaFormat::iSpaceBeforeInTwips and iSpaceAfterInTwips).

Do not use if a CTextView object owns this CTextLayout object. 6.1 Use FormatBandL()

ResetExternalDraw()

voidResetExternalDraw()

ResetOpaque(void *)

voidResetOpaque(void *aThis)[private, static]

Cleanup method for the opaque flag.

Parameters

void * aThis

RestrictScrollToTopsOfLines(TBool)

voidRestrictScrollToTopsOfLines(TBoolaRestrict)[inline]

Dangerous function. Makes scroll operations set the top of the screen flush to the top of a line. In general this might scroll the cursor off the screen.

Parameters

TBool aRestrict

ScrollDocPosIntoViewL(const TTmDocPos &)

TInt ScrollDocPosIntoViewL(const TTmDocPos &aDocPos)

Parameters

const TTmDocPos & aDocPos

ScrollL(TInt, TAllowDisallow, TBool, TBool)

TInt ScrollL(TIntaDy,
TAllowDisallowaScrollBlankSpace,
TBoolaTopNoLimitBorder = EFalse,
TBoolaBottomNoLimitBorder = EFalse
)[private]

Scroll aDy pixels (positive = text moves down); return number of pixels actually scrolled. Create a new formatted band if necessary.

Parameters

TInt aDy
TAllowDisallow aScrollBlankSpace
TBool aTopNoLimitBorder = EFalse
TBool aBottomNoLimitBorder = EFalse

ScrollLinesL(TInt &, TAllowDisallow)

IMPORT_C TIntScrollLinesL(TInt &aNumLines,
TAllowDisallowaScrollBlankSpace = EFDisallowScrollingBlankSpace
)

Parameters

TInt & aNumLines
TAllowDisallow aScrollBlankSpace = EFDisallowScrollingBlankSpace

ScrollParagraphsL(TInt &, TAllowDisallow)

IMPORT_C TIntScrollParagraphsL(TInt &aNumParas,
TAllowDisallowaScrollBlankSpace
)

Scrolls the text up or down by aNumParas paragraphs, disallowing blank space at the bottom of the visible area if aScrollBlankSpace is CTextLayout::EFDisallowScrollingBlankSpace.

Do not use if a CTextView object owns this CTextLayout object.

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

Parameters

TInt & aNumParasThe number of paragraphs to scroll; may be a positive or negative value. On return, contains the number of paragraphs not scrolled; that is the difference between the requested number and the number of paragraphs actually scrolled.
TAllowDisallow aScrollBlankSpaceOnly 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.

SetAmountToFormat(TAmountFormatted)

IMPORT_C voidSetAmountToFormat(TAmountFormattedaAmountOfFormat = EFFormatBand)

Parameters

TAmountFormatted aAmountOfFormat = EFFormatBand

SetBandHeight(TInt)

IMPORT_C voidSetBandHeight(TIntaHeight)

Parameters

TInt aHeight

SetBandTop()

TInt SetBandTop()[private]

SetCustomDraw(const MFormCustomDraw *)

IMPORT_C voidSetCustomDraw(const MFormCustomDraw *aCustomDraw)
Sets the custom drawing object, for customising the way text and its background are drawn.
Since
6.0

Parameters

const MFormCustomDraw * aCustomDrawPointer to a custom drawing object.

SetCustomInvisibleCharacterRemapper(MFormCustomInvisibleCharacterRemapper *)

IMPORT_C voidSetCustomInvisibleCharacterRemapper(MFormCustomInvisibleCharacterRemapper *aInvisibleCharacterRemapper)

Allows Form clients to register an invisible character remapper object to customize the visible display of invisible characters such as paragraph marks.

Parameters

MFormCustomInvisibleCharacterRemapper * aInvisibleCharacterRemapperPointer to custom invisible character remapper to use

SetCustomWrap(const MFormCustomWrap *)

IMPORT_C voidSetCustomWrap(const MFormCustomWrap *aCustomWrap)

Sets custom line breaking.

If this function is not called, default line breaking behaviour is used.

Ownership of the custom line breaking object is not transferred to this object.

Parameters

const MFormCustomWrap * aCustomWrapA pointer to an object that implements the custom line breaking interface. Specify NULL to disable custom line breaking.

SetExcludePartialLines(TBool)

IMPORT_C voidSetExcludePartialLines(TBoolaExcludePartialLines = TRUE)

Specifies whether partially displayed lines (at the top and bottom of the view) are to be prevented from being drawn, and whether the top of the display is to be aligned to the nearest line.

This function takes effect only when the text is next formatted or scrolled.Note:This function was designed for non-editable text in the Agenda application, and there is an important restriction: CTextView functions that reformat the text after editing must not be used while partial lines are excluded; these functions are CTextView::HandleCharEditL(), CTextView::HandleInsertDeleteL() and CTextView::HandleRangeFormatChangeL().

7.0

Parameters

TBool aExcludePartialLines = TRUEETrue (the default) to exclude partially displayed lines from the view. EFalse to include them.

SetExternalDraw(const TRect &)

voidSetExternalDraw(const TRect &aRect)

Parameters

const TRect & aRect

SetFontHeightIncreaseFactor(TInt)

IMPORT_C voidSetFontHeightIncreaseFactor(TIntaPercentage)

Sets the percentage by which font heights are increased in order to provide automatic extra spacing (leading) between lines. This amount is set to CLayoutData::EFFontHeightIncreaseFactor, which is 7, when a CTextLayout object is created.

The text needs to be reformatted after a call to this function.

Parameters

TInt aPercentageFactor by which to increase font heights.

SetFormatMode(CLayoutData::TFormatMode, TInt, MGraphicsDeviceMap *)

IMPORT_C voidSetFormatMode(CLayoutData::TFormatModeaFormatMode,
TIntaWrapWidth,
MGraphicsDeviceMap *aFormatDevice
)

Sets the format mode and wrap width and (for certain format modes only) sets the formatting device.

The text needs to be reformatted after a call to this function.

Notes:

If aFormatMode is CLayoutData::EFWysiwygMode or CLayoutData::EFPrintPreviewMode, the format device is set to aFormatDevice, which must not be NULL.

If aFormatMode is CLayoutData::EFScreenMode or CLayoutData::EFPrintMode, aFormatDevice is ignored and should be NULL; the format device is set to the image device.

The wrap width is set in either twips or pixels using the same rule as for SetWrapWidth().

Parameters

CLayoutData::TFormatMode aFormatModeThe format mode.
TInt aWrapWidthThe wrap width in pixels or twips.
MGraphicsDeviceMap * aFormatDeviceThe formatting device or NULL, depending on the format mode.

SetHighlightExtensions(TInt, TInt, TInt, TInt)

IMPORT_C voidSetHighlightExtensions(TIntaLeftExtension,
TIntaRightExtension,
TIntaTopExtension,
TIntaBottomExtension
)

Sets offsets for the edges of the selection highlight.

Parameters

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

SetImageDeviceMap(MGraphicsDeviceMap *)

IMPORT_C voidSetImageDeviceMap(MGraphicsDeviceMap *aGd)

Sets the device map used for drawing and formatting. This device map is also used for formatting and drawing paragraph labels unless a separate label device map has been set (see SetLabelsDeviceMap()).

The text needs to be reformatted after a call to this function.

Note:

Although the name of the function suggests that only the image device is set, the formatting device is also set.

Parameters

MGraphicsDeviceMap * aGdThe device map used for drawing and formatting.

SetInterfaceProvider(MFormCustomInterfaceProvider *)

IMPORT_C voidSetInterfaceProvider(MFormCustomInterfaceProvider *aProvider)

This method allows Form clients to register an object able to create or return references to customisation objects used within Form for various tasks e.g. inline text.

Parameters

MFormCustomInterfaceProvider * aProviderReference to interface provider object to register with Formm.

SetLabelsDeviceMap(MGraphicsDeviceMap *)

IMPORT_C voidSetLabelsDeviceMap(MGraphicsDeviceMap *aDeviceMap)

Sets the device map used for formatting and drawing paragraph labels. If not set, the device map used for labels will be the same as that used for the text.

The text needs to be reformatted after a call to this function.

Parameters

MGraphicsDeviceMap * aDeviceMapThe device map used for formatting and drawing paragraph labels.

SetLayDoc(MLayDoc *)

IMPORT_C voidSetLayDoc(MLayDoc *aDoc)

Sets the layout object's source text to aDoc.

The text needs to be reformatted after a call to this function.

Parameters

MLayDoc * aDocPointer to the MLayDoc implementation that is the source of the text and formatting information. Must not be NULL or a panic occurs.

SetMinimumLineDescent(TInt)

IMPORT_C voidSetMinimumLineDescent(TIntaPixels)

Sets the minimum line descent in pixels. This amount is set to CLayoutData::EFMinimumLineDescent, which is 3, when a CTextLayout object is created.

The text needs to be reformatted after a call to this function.

Parameters

TInt aPixelsThe minimum line descent in pixels.

SetNonPrintingCharsVisibility(TNonPrintingCharVisibility)

IMPORT_C voidSetNonPrintingCharsVisibility(TNonPrintingCharVisibilityaVisibility)

Specifies which non-printing characters (e.g. space, paragraph break, etc.) are to be drawn using symbols.

The text needs to be reformatted after a call to this function.(because non-printing characters may differ in width from their visible representations).

Parameters

TNonPrintingCharVisibility aVisibilityIndicates which non-printing characters are drawn using symbols.

SetOpaqueLC()

voidSetOpaqueLC()

Sets opaque drawing flag for CTextLayout object. It will used later when the content/background has to be drawn. Until the flag is not reseted, the opaque drawing will be used for all the content except the background - the flag has an useful meaning only for transparent editors. A TCleanupItem object will be pushed into the Cleanup Stack, which will reset the opaque flag durring its destruction.

SetReadyToRedraw()

voidSetReadyToRedraw()

SetTextViewCursorPos(TCursorPosition *)

voidSetTextViewCursorPos(TCursorPosition *aPos)

INC092568: CTextView::SetPendingSelection is not honoured Sets the cursor position member added for this fix that allows the text layout object to access any pending selection made by the owning text view object

Parameters

TCursorPosition * aPos

SetTruncating(TBool)

IMPORT_C voidSetTruncating(TBoolaOn)

Sets the truncation mode. If truncation is on, lines that exceed the wrap width, either because they have no legal line break, or because wrapping is off, are truncated, and an ellipsis is inserted.

Parameters

TBool aOnIf ETrue, lines which extend beyond the wrap width are truncated with an ellipsis character. If EFalse, no ellipsis is used.

SetViewL(const TTmDocPos &, TInt &, TViewYPosQualifier, TDiscard)

IMPORT_C TIntSetViewL(const TTmDocPos &aDocPos,
TInt &aYPos,
TViewYPosQualifieraYPosQualifier,
TDiscardaDiscardFormat = EFViewDontDiscardFormat
)

Changes the top of the visible area so that the line containing aDocPos is vertically positioned at aYPos. Which part of the line is set to appear at aYPos (top, baseline, or bottom) is controlled by the TViewYPosQualifier argument, which also specifies whether the visible area is to be filled and whether the line should be made fully visible if possible.

Do not use if a CTextView object owns this CTextLayout object.

Parameters

const TTmDocPos & aDocPosA valid document position.
TInt & aYPosThe y coordinate at which to display the character at aDocPos. On return, contains the actual vertical position of the specified part of the line.
TViewYPosQualifier aYPosQualifierControls which part of the line is set to appear at aYPos.
TDiscard aDiscardFormat = EFViewDontDiscardFormatIf ETrue (EFViewDiscardAllFormat), the text is reformatted to include aDocPos, otherwise text is formatted only as necessary when bringing new lines into the visible area.

SetViewL(TInt, TInt &, TViewYPosQualifier, TDiscard)

IMPORT_C TIntSetViewL(TIntaDocPos,
TInt &aYPos,
TViewYPosQualifieraYPosQualifier,
TDiscardaDiscardFormat = EFViewDontDiscardFormat
)

This interface is deprecated, and is made available in version 7.0s solely to provide binary compatibility with Symbian OS v6.1. Developers are strongly advised not to make use of this API in new applications. In particular, use the other overload of this function if you need to distinguish between leading and trailing edge positions.

Do not use if a CTextView object owns this CTextLayout object.

Parameters

TInt aDocPosA valid document position.
TInt & aYPosThe y coordinate at which to display the character at aDocPos. On return, contains the actual vertical position of the specified part of the line.
TViewYPosQualifier aYPosQualifierControls which part of the line is set to appear at aYPos.
TDiscard aDiscardFormat = EFViewDontDiscardFormatIf ETrue (EFViewDiscardAllFormat), the text is reformatted to include aDocPos, otherwise text is formatted only as necessary when bringing new lines into the visible area.

SetWindow(RWindow *)

voidSetWindow(RWindow *aWnd)

Parameters

RWindow * aWnd

SetWrapWidth(TInt)

IMPORT_C voidSetWrapWidth(TIntaWrapWidth)

Sets the wrap width. If the current format mode is screen mode (CLayoutData::EFScreenMode) aWrapWidth is in pixels, otherwise it is in twips.

The text needs to be reformatted after a call to this function.

Note:

A valid wrap width (>0) must be supplied 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

TInt aWrapWidthThe wrap width in pixels or twips.

SuggestCursorPos(TInt)

TInt SuggestCursorPos(TIntaCurrentCursorPos)const [private]

Finds a position (in pixels, from the top of the window) where the cursor can be such that its line will be fully visible. If this is not possible, then return one with its baseline visible. If this is not possible, we don't care what the answer is.

Parameters

TInt aCurrentCursorPos

TagmaTextLayout()

const CTmTextLayout &TagmaTextLayout()const [inline]

ToParagraphStart(TInt &)

IMPORT_C TIntToParagraphStart(TInt &aDocPos)const

Sets aDocPos to the paragraph start and returns the amount by which aDocPos has changed, as a non-negative number.

Parameters

TInt & aDocPosA document position. On return, contains the document position of the first character in the paragraph.

Truncating()

IMPORT_C TBoolTruncating()const

Tests whether truncation is on (as set by SetTruncating()).

TruncatingEllipsis()

IMPORT_C TCharTruncatingEllipsis()const

Returns the ellipsis character used when truncation is on. The value 0xFFFF (the illegal Unicode character) means that no ellipsis character is appended to truncated text.

VisibleHeightInPixels()

TInt VisibleHeightInPixels()const [private]

WrapWidth()

TInt WrapWidth()const

XyPosToDocPosL(TPoint &, TUint)

IMPORT_C TIntXyPosToDocPosL(TPoint &aPos,
TUintaFlags = 0
)const

Returns the index of the nearest character in the document to the window coordinates specified. Sets aPos to the actual position of the intersection of the line's baseline with the character's edge. If aPos is before the start of the formatted area, returns the first formatted character; if it is after the end of the formatted area, returns the position after the last formatted character, or the end of the document, whichever is less.

This function is deprecated in v7.0s. Use the more powerful FindXYPos() instead.

Parameters

TPoint & aPosContains coordinates to convert to a document position. On return, contains the exact coordinates of the intersection of the line's baseline with the character edge at the document position.
TUint aFlags = 0Three possible values: 0 is the default, and performs the task at full accuracy (the function returns the document position of the character edge nearest to the coordinates). CLayoutData::EFWholeLinesOnly examines lines only and returns the position at the right end of the line if aPos.iX > 0, otherwise the position at the left end.

YBottomLastFormattedLine()

IMPORT_C TIntYBottomLastFormattedLine()const

Returns the y coordinate of the bottom of the last formatted line, relative to the top of the visible region.

Member Enumerations Documentation

Enum anonymous

Enumerators

EFCharacterInsert

Insert a character, (not a paragraph delimiter).

EFParagraphDelimiter

Insert a paragraph delimiter.

EFLeftDelete

Delete single character to the left.

EFRightDelete

Delete single character to the right.

Enum anonymous

Enumerators

EFScrollRedrawWholeScreen = CLayoutData::EFLargeNumber

A value greater than any possible display height indicates that the entire visible area, at least, was scrolled, and so there is no point in blitting text; a full redraw is needed.

EFMaximumLineWidth = CLayoutData::EFBodyWidthForNoWrapping

The maximum line width when wrapping is unset.

Enum anonymous

Enumerators

EFAllParagraphsNotWrapped = TRUE

Wrapping off; overrides the paragraph format.

EFParagraphsWrappedByDefault = FALSE

Wrapping on, unless CParaFormat::iWrap is false.

Enum anonymous

Enumerators

Enum anonymous

Enumerators

Enum anonymous

Enumerators

Enum TAllowDisallow

Indicates whether blank space should scroll. Used by several CTextView and CTextLayout scrolling functions.

Enumerators

EFAllowScrollingBlankSpace = TRUE

Allow blank space to scroll.

EFDisallowScrollingBlankSpace = FALSE

Disallow blank space from scrolling.

Enum TAmountFormatted

Amount to format. Used by CTextLayout::SetAmountToFormat().

Enumerators

EFFormatAllText = FALSE

Format the whole document.

EFFormatBand = TRUE

Format the visible band only.

Enum TCurrentFormat

Formatting information.

Enumerators

EFNoCurrentFormat = -1

Returned by some CTextLayout enquiry functions to indicate that no formatting has taken place so that the requested value cannot be calculated.

EFNotInCurrentFormat = 0

Returned by CTextLayout::ParagraphHeight() when the paragraph is not formatted.

Enum TDiscard

Flags used by CTextLayout::SetViewL(). Whether to reformat and redraw.

Enumerators

EFViewDiscardAllFormat = TRUE

Discard all formatting; redraw.

EFViewDontDiscardFormat = FALSE

Do not discard all formatting; redraw.

Enum TPanicNumber

Enumerators

EUnimplemented
ENoMemory
EDrawingBorderError
EFormatDeviceNotSet
EImageDeviceNotSet
EPixelNotInFormattedLine
EInvalidDocPos
ENoCharRangeToFormat
ECharacterNotFormatted
EPrintPreviewModeError
EBadCharacterEditType
EInvalidLineNumber
EPosNotFormatted
EMustFormatAllText
EPageScrollError
EInvalidRedraw

Enum TScrollFlags

Enumerators

EFScrollOnlyToTopsOfLines = 1

Member Data Documentation

TInt iBandHeight

TInt iBandHeight[private]

TInt iBandTop

TInt iBandTop[private]

TBool iBeginRedrawCount

TBool iBeginRedrawCount[private]

TInt iDmmyForIHighlightExtensions

TInt iDmmyForIHighlightExtensions[private]

TInt iDmmyForISource

TInt iDmmyForISource[private]

TInt iDummy

TInt iDummy[private]

TInt iDummyForIText

TInt iDummyForIText[private]

TInt iExcessHeightRequired

TInt iExcessHeightRequired[private]

TTmHighlightExtensions * iHighlightExtensions

TTmHighlightExtensions *iHighlightExtensions[private]

TBool iIsWndInExternalRedraw

TBool iIsWndInExternalRedraw[private]

TBool iParInvalid

TBool iParInvalid[private]

TBool iReadyToRedraw

TBool iReadyToRedraw[private]

TRect iRedrawRect

TRect iRedrawRect[private]

TInt iScrollFlags

TInt iScrollFlags[private]

TLayDocTextSource * iSource

TLayDocTextSource *iSource[private]

CTmTextLayout * iText

CTmTextLayout *iText[private]

TCursorPosition * iTextViewCursorPos

TCursorPosition *iTextViewCursorPos[private]

TInt iUnformattedStart

TInt iUnformattedStart[private]

TInt iVisibleHeight

TInt iVisibleHeight[private]

RWindow * iWnd

RWindow *iWnd[private]