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".
Private Member Functions | |
---|---|
CTextLayout() | |
TBool | AddFormattingAtEndL(TTmFormatParamBase &, TInt &, TInt &) |
TInt | BandHeightInPixels() |
IMPORT_C void | ConstructL(MLayDoc *, TInt) |
void | FormatBandL(TInt, TInt) |
void | InitFormatParam(TTmFormatParamBase &) |
void | PruneFormatL(TBool) |
void | ResetOpaque(void *) |
TInt | ScrollL(TInt, TAllowDisallow, TBool, TBool) |
TInt | SetBandTop() |
TInt | SuggestCursorPos(TInt) |
TInt | VisibleHeightInPixels() |
TBool | AddFormattingAtEndL | ( | TTmFormatParamBase & | aFormatParam, |
TInt & | aHeightIncrease, | |||
TInt & | aParagraphsIncrease | |||
) | [private] |
TTmFormatParamBase & aFormatParam | |
TInt & aHeightIncrease | |
TInt & aParagraphsIncrease |
IMPORT_C void | AdjustVerticalAlignment | ( | CParaFormat::TAlignment | aVerticalAlignment | ) |
CParaFormat::TAlignment aVerticalAlignment |
TBool | CalculateHorizontalExtremes | ( | TInt & | aLeftX, |
TInt & | aRightX, | |||
TBool | aOnlyVisibleLines | |||
) | const |
IMPORT_C TBool | CalculateHorizontalExtremesL | ( | TInt & | aLeftX, |
TInt & | aRightX, | |||
TBool | aOnlyVisibleLines, | |||
TBool | aIgnoreWrapCharacters = FALSE | |||
) | const |
IMPORT_C TInt | ChangeBandTopL | ( | TInt & | aPixels, |
TAllowDisallow | aScrollBlankSpace = EFDisallowScrollingBlankSpace | |||
) |
TInt & aPixels | |
TAllowDisallow aScrollBlankSpace = EFDisallowScrollingBlankSpace |
IMPORT_C void | ChangeBandTopNoLimitBorderL | ( | TInt | aPixels | ) |
TInt aPixels |
IMPORT_C void | ConstructL | ( | MLayDoc * | aDoc, |
TInt | aWrapWidth | |||
) | [private] |
MLayDoc * aDoc | |
TInt aWrapWidth |
IMPORT_C TBool | DocPosToXyPosL | ( | TInt | aDocPos, |
TPoint & | aPos, | |||
TUint | aFlags = 0 | |||
) | const |
void | DrawBackground | ( | CGraphicsContext & | aGc, |
const TPoint & | aTopLeft, | |||
const TRect & | aClipRect, | |||
const TLogicalRgb & | aBackground | |||
) | const |
CGraphicsContext & aGc | |
const TPoint & aTopLeft | |
const TRect & aClipRect | |
const TLogicalRgb & aBackground |
IMPORT_C void | DrawBorders | ( | const MGraphicsDeviceMap * | aGd, |
CGraphicsContext & | aGc, | |||
const TRect & | aRect, | |||
const TParaBorderArray & | aBorder, | |||
const TRgb * | aBackground = NULL, | |||
TRegion * | aClipRegion = NULL, | |||
const TRect * | aDrawRect = NULL | |||
) | [static] |
const MGraphicsDeviceMap * aGd | |
CGraphicsContext & aGc | |
const TRect & aRect | |
const TParaBorderArray & aBorder | |
const TRgb * aBackground = NULL | |
TRegion * aClipRegion = NULL | |
const TRect * aDrawRect = NULL |
IMPORT_C void | DrawL | ( | const TRect & | aDrawRect, |
const TDrawTextLayoutContext * | aDrawTextLayoutContext, | |||
const TCursorSelection * | aHighlight = NULL | |||
) |
const TRect & aDrawRect | |
const TDrawTextLayoutContext * aDrawTextLayoutContext | |
const TCursorSelection * aHighlight = NULL |
IMPORT_C void | ExtendFormattingToCoverPosL | ( | TInt | aDocPos | ) |
TInt aDocPos |
IMPORT_C void | ExtendFormattingToCoverYL | ( | TInt | aYPos | ) |
TInt aYPos |
IMPORT_C TBool | FindDocPos | ( | const TTmDocPosSpec & | aDocPos, |
TTmPosInfo2 & | aPosInfo, | |||
TTmLineInfo * | aLineInfo = NULL | |||
) | const |
const TTmDocPosSpec & aDocPos | |
TTmPosInfo2 & aPosInfo | |
TTmLineInfo * aLineInfo = NULL |
IMPORT_C TBool | FindXyPos | ( | const TPoint & | aXyPos, |
TTmPosInfo2 & | aPosInfo, | |||
TTmLineInfo * | aLineInfo = NULL | |||
) | const |
const TPoint & aXyPos | |
TTmPosInfo2 & aPosInfo | |
TTmLineInfo * aLineInfo = NULL |
IMPORT_C void | ForceNoWrapping | ( | TBool | aNoWrapping = EFAllParagraphsNotWrapped | ) |
TBool aNoWrapping = EFAllParagraphsNotWrapped |
void | FormatCharRangeL | ( | TInt | aStartDocPos, |
TInt | aEndDocPos, | |||
TInt | aPixelOffset | |||
) |
IMPORT_C TBool | FormatLineL | ( | CParaFormat * | aParaFormat, |
TInt & | aDocPos, | |||
TInt & | aHeight, | |||
TBool & | aPageBreak | |||
) |
CParaFormat * aParaFormat | |
TInt & aDocPos | |
TInt & aHeight | |
TBool & aPageBreak |
IMPORT_C void | GetCharacterHeightAndAscentL | ( | TInt | aDocPos, |
TInt & | aHeight, | |||
TInt & | aAscent | |||
) | const |
TBool | GetCursor | ( | const TTmDocPos & | aDocPos, |
TTmCursorPlacement | aPlacement, | |||
TRect & | aLineRect, | |||
TPoint & | aOrigin, | |||
TInt & | aWidth, | |||
TInt & | aAscent, | |||
TInt & | aDescent | |||
) | const |
IMPORT_C MFormCustomInvisibleCharacterRemapper * | GetCustomInvisibleCharacterRemapper | ( | ) |
IMPORT_C void | GetFontHeightAndAscentL | ( | const TFontSpec & | aFontSpec, |
TInt & | aHeight, | |||
TInt & | aAscent | |||
) | const |
void | GetHighlightRemnants | ( | const TRect & | aRect, |
const TDrawTextLayoutContext & | aDrawTextLayoutContext, | |||
TRect * | aRemainderRects | |||
) | const |
const TRect & aRect | |
const TDrawTextLayoutContext & aDrawTextLayoutContext | |
TRect * aRemainderRects |
IMPORT_C void | GetMinimumSizeL | ( | TInt | aWrapWidth, |
TBool | aAllowLegalLineBreaksOnly, | |||
TSize & | aSize | |||
) |
IMPORT_C TBool | GetNextVisualCursorPos | ( | const TTmDocPosSpec & | aDocPos, |
TTmPosInfo2 & | aPosInfo, | |||
TBool | aToLeft | |||
) | const |
const TTmDocPosSpec & aDocPos | |
TTmPosInfo2 & aPosInfo | |
TBool aToLeft |
void | GetParagraphRect | ( | const TTmDocPos & | aDocPos, |
TRect & | aRect | |||
) | const |
IMPORT_C void | HandleAdditionalCharactersAtEndL | ( | TInt & | aFirstPixel, |
TInt & | aLastPixel | |||
) |
IMPORT_C void | HandleBlockChangeL | ( | TCursorSelection | aSelection, |
TInt | aOldCharsChanged, | |||
TViewRectChanges & | aViewChanges, | |||
TBool | aFormatChanged | |||
) |
TCursorSelection aSelection | |
TInt aOldCharsChanged | |
TViewRectChanges & aViewChanges | |
TBool aFormatChanged |
IMPORT_C TBool | HandleCharEditL | ( | TUint | aType, |
TInt & | aCursorPos, | |||
TInt & | aGood, | |||
TInt & | aFormattedUpTo, | |||
TInt & | aFormattedFrom, | |||
TInt & | aScroll, | |||
TBool | aFormatChanged | |||
) |
IMPORT_C void | Highlight | ( | const TRangeChange & | aHighlight, |
const TRect & | aDrawRect, | |||
const TDrawTextLayoutContext * | aDrawTextLayoutContext | |||
) |
const TRangeChange & aHighlight | |
const TRect & aDrawRect | |
const TDrawTextLayoutContext * aDrawTextLayoutContext |
void | HighlightUsingExtensions | ( | const CTextLayout::TRangeChange & | aChangeHighlight, |
const TRangeChange & | aFullHighlight, | |||
const TRect & | aDrawRect, | |||
const TDrawTextLayoutContext * | aDrawTextLayoutContext | |||
) |
const CTextLayout::TRangeChange & aChangeHighlight | |
const TRangeChange & aFullHighlight | |
const TRect & aDrawRect | |
const TDrawTextLayoutContext * aDrawTextLayoutContext |
void | InitFormatParam | ( | TTmFormatParamBase & | aParam | ) | [private] |
TTmFormatParamBase & aParam |
IMPORT_C void | InvertRangeL | ( | const TCursorSelection & | aHighlight, |
const TRect & | aDrawRect, | |||
const TDrawTextLayoutContext * | aDrawTextLayoutContext | |||
) |
const TCursorSelection & aHighlight | |
const TRect & aDrawRect | |
const TDrawTextLayoutContext * aDrawTextLayoutContext |
IMPORT_C CTextLayout * | NewL | ( | MLayDoc * | aDoc, |
TInt | aWrapWidth | |||
) | [static] |
MLayDoc * aDoc | |
TInt aWrapWidth |
TInt | PictureRectangleAndPosL | ( | const TPoint & | aXyPos, |
TRect & | aPictureRect, | |||
TBool * | aCanScaleOrCrop = 0 | |||
) | const |
IMPORT_C TBool | PictureRectangleL | ( | TInt | aDocPos, |
TRect & | aPictureRect, | |||
TBool * | aCanScaleOrCrop = NULL | |||
) | const |
IMPORT_C TBool | PictureRectangleL | ( | const TPoint & | aXyPos, |
TRect & | aPictureRect, | |||
TBool * | aCanScaleOrCrop = NULL | |||
) | const |
IMPORT_C TBool | PosInBand | ( | const TTmDocPos & | aDocPos, |
TTmLineInfo * | aLineInfo = NULL | |||
) | const |
const TTmDocPos & aDocPos | |
TTmLineInfo * aLineInfo = NULL |
void | RestrictScrollToTopsOfLines | ( | TBool | aRestrict | ) | [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.
TBool aRestrict |
TInt | ScrollDocPosIntoViewL | ( | const TTmDocPos & | aDocPos | ) |
const TTmDocPos & aDocPos |
TInt | ScrollL | ( | TInt | aDy, |
TAllowDisallow | aScrollBlankSpace, | |||
TBool | aTopNoLimitBorder = EFalse, | |||
TBool | aBottomNoLimitBorder = EFalse | |||
) | [private] |
TInt aDy | |
TAllowDisallow aScrollBlankSpace | |
TBool aTopNoLimitBorder = EFalse | |
TBool aBottomNoLimitBorder = EFalse |
IMPORT_C TInt | ScrollLinesL | ( | TInt & | aNumLines, |
TAllowDisallow | aScrollBlankSpace = EFDisallowScrollingBlankSpace | |||
) |
TInt & aNumLines | |
TAllowDisallow aScrollBlankSpace = EFDisallowScrollingBlankSpace |
IMPORT_C TInt | ScrollParagraphsL | ( | TInt & | aNumParas, |
TAllowDisallow | aScrollBlankSpace | |||
) |
TInt & aNumParas | |
TAllowDisallow aScrollBlankSpace |
IMPORT_C void | SetAmountToFormat | ( | TAmountFormatted | aAmountOfFormat = EFFormatBand | ) |
TAmountFormatted aAmountOfFormat = EFFormatBand |
IMPORT_C void | SetCustomDraw | ( | const MFormCustomDraw * | aCustomDraw | ) |
const MFormCustomDraw * aCustomDraw |
IMPORT_C void | SetCustomInvisibleCharacterRemapper | ( | MFormCustomInvisibleCharacterRemapper * | aInvisibleCharacterRemapper | ) |
MFormCustomInvisibleCharacterRemapper * aInvisibleCharacterRemapper |
IMPORT_C void | SetCustomWrap | ( | const MFormCustomWrap * | aCustomWrap | ) |
const MFormCustomWrap * aCustomWrap |
void | SetExcessHeightRequired | ( | TInt | aExcessHeightRequired | ) |
TInt aExcessHeightRequired |
IMPORT_C void | SetExcludePartialLines | ( | TBool | aExcludePartialLines = TRUE | ) |
TBool aExcludePartialLines = TRUE |
void | SetExternalDraw | ( | const TRect & | aRect | ) |
const TRect & aRect |
IMPORT_C void | SetFontHeightIncreaseFactor | ( | TInt | aPercentage | ) |
TInt aPercentage |
IMPORT_C void | SetFormatMode | ( | CLayoutData::TFormatMode | aFormatMode, |
TInt | aWrapWidth, | |||
MGraphicsDeviceMap * | aFormatDevice | |||
) |
CLayoutData::TFormatMode aFormatMode | |
TInt aWrapWidth | |
MGraphicsDeviceMap * aFormatDevice |
IMPORT_C void | SetHighlightExtensions | ( | TInt | aLeftExtension, |
TInt | aRightExtension, | |||
TInt | aTopExtension, | |||
TInt | aBottomExtension | |||
) |
IMPORT_C void | SetImageDeviceMap | ( | MGraphicsDeviceMap * | aGd | ) |
MGraphicsDeviceMap * aGd |
IMPORT_C void | SetInterfaceProvider | ( | MFormCustomInterfaceProvider * | aProvider | ) |
MFormCustomInterfaceProvider * aProvider |
IMPORT_C void | SetLabelsDeviceMap | ( | MGraphicsDeviceMap * | aDeviceMap | ) |
MGraphicsDeviceMap * aDeviceMap |
IMPORT_C void | SetNonPrintingCharsVisibility | ( | TNonPrintingCharVisibility | aVisibility | ) |
TNonPrintingCharVisibility aVisibility |
void | SetTextViewCursorPos | ( | TCursorPosition * | aPos | ) |
TCursorPosition * aPos |
IMPORT_C void | SetTruncatingEllipsis | ( | TChar | aEllipsis | ) |
TChar aEllipsis |
IMPORT_C TInt | SetViewL | ( | const TTmDocPos & | aDocPos, |
TInt & | aYPos, | |||
TViewYPosQualifier | aYPosQualifier, | |||
TDiscard | aDiscardFormat = EFViewDontDiscardFormat | |||
) |
const TTmDocPos & aDocPos | |
TInt & aYPos | |
TViewYPosQualifier aYPosQualifier | |
TDiscard aDiscardFormat = EFViewDontDiscardFormat |
IMPORT_C TInt | SetViewL | ( | TInt | aDocPos, |
TInt & | aYPos, | |||
TViewYPosQualifier | aYPosQualifier, | |||
TDiscard | aDiscardFormat = EFViewDontDiscardFormat | |||
) |
TInt aDocPos | |
TInt & aYPos | |
TViewYPosQualifier aYPosQualifier | |
TDiscard aDiscardFormat = EFViewDontDiscardFormat |
TInt | SuggestCursorPos | ( | TInt | aCurrentCursorPos | ) | const [private] |
TInt aCurrentCursorPos |
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. |
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. |
EFAllParagraphsNotWrapped = TRUE |
Wrapping off; overrides the paragraph format. |
EFParagraphsWrappedByDefault = FALSE |
Wrapping on, unless CParaFormat::iWrap is false. |
Indicates whether blank space should scroll. Used by several CTextView and CTextLayout scrolling functions.
EFAllowScrollingBlankSpace = TRUE |
Allow blank space to scroll. |
EFDisallowScrollingBlankSpace = FALSE |
Disallow blank space from scrolling. |
Amount to format. Used by CTextLayout::SetAmountToFormat().
EFFormatAllText = FALSE |
Format the whole document. |
EFFormatBand = TRUE |
Format the visible band only. |
Formatting information.
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. |
Flags used by CTextLayout::SetViewL(). Whether to reformat and redraw.
EFViewDiscardAllFormat = TRUE |
Discard all formatting; redraw. |
EFViewDontDiscardFormat = FALSE |
Do not discard all formatting; redraw. |
EUnimplemented | |
ENoMemory | |
EDrawingBorderError | |
EFormatDeviceNotSet | |
EImageDeviceNotSet | |
EPixelNotInFormattedLine | |
EInvalidDocPos | |
ENoCharRangeToFormat | |
ECharacterNotFormatted | |
EPrintPreviewModeError | |
EBadCharacterEditType | |
EInvalidLineNumber | |
EPosNotFormatted | |
EMustFormatAllText | |
EPageScrollError | |
EInvalidRedraw |