MTmTextLayoutForwarder Class Reference

class MTmTextLayoutForwarder

A mixin class to make it easy for higher-level classes that own a CTmTextLayout object to have enquiry functions without it being necessary to implement them all as forwarding functions. The owner class just implements TextLayout and overrides GetOrigin if necessary.

Non-const CTmTextLayout functions like Clear are not included because allowing them to be called on owner classes would probably put the owner class into an inconsistent state.

The word Layout is prefixed, suffixed or infixed to functions with names that would usually conflict with owner class names. For example, we have DrawLayout, not Draw, and GetMinimumLayoutSizeL, not GetMinimumSizeL.

The class should only be used internally by FORM component.

Public Member Functions
IMPORT_C TBool DocPosToLine (const TTmDocPosSpec &, TTmLineInfo &)
IMPORT_C TBool DocPosToLine (const TTmDocPos &, TTmLineInfo &)
IMPORT_C void DrawBackground ( CGraphicsContext &, const TPoint &, const TRect &, const TLogicalRgb &)
IMPORT_C void DrawLayout ( CGraphicsContext &, const TPoint &, const TRect &, const TLogicalRgb *, TBool )
IMPORT_C TInt EndChar ()
IMPORT_C TBool FindDocPos (const TTmDocPosSpec &, TTmPosInfo2 &, TTmLineInfo &)
IMPORT_C TBool FindDocPos (const TTmDocPos &, TTmPosInfo &, TTmLineInfo &)
IMPORT_C TBool FindXyPos (const TPoint &, TTmPosInfo2 &, TTmLineInfo &)
IMPORT_C TBool FindXyPos (const TPoint &, TTmPosInfo &, TTmLineInfo &)
IMPORT_C TBool FindXyPosWithDisambiguation (const TPoint &, TTmPosInfo2 &, TTmPosInfo2 &, TTmLineInfo &)
IMPORT_C TBool GetCursor (const TTmDocPosSpec &, TTmCursorPlacement , TTmLineInfo &, TPoint &, TInt &, TInt &, TInt &)
IMPORT_C TBool GetCursor (const TTmDocPos &, TTmCursorPlacement , TTmLineInfo &, TPoint &, TInt &, TInt &, TInt &)
IMPORT_C TBool GetDisplayedText ( TInt , TDes &, TInt &)
IMPORT_C void GetMinimumLayoutSizeL ( TInt , TSize &)
IMPORT_C void GetMinimumLayoutSizeL ( TInt , TBool , TSize &)
IMPORT_C TBool GetNextPosLeftWithDisambiguation (const TTmDocPosSpec &, TTmPosInfo2 &, TTmPosInfo2 &)
IMPORT_C TBool GetNextPosRightWithDisambiguation (const TTmDocPosSpec &, TTmPosInfo2 &, TTmPosInfo2 &)
IMPORT_C TBool GetNextVisualCursorPos (const TTmDocPosSpec &, TTmPosInfo2 &, TBool )
IMPORT_C TBool GetNextVisualCursorPos (const TTmDocPos &, TTmPosInfo &, TBool )
IMPORT_C void HorizontalExtremes ( TInt &, TInt &, TInt , TInt )
IMPORT_C void InvertLayout ( CGraphicsContext &, const TPoint &, TInt , TInt )
IMPORT_C TInt LayoutHeight ()
IMPORT_C TInt LayoutWidth ()
IMPORT_C TBool LineNumberToLine ( TInt , TTmLineInfo &)
IMPORT_C TInt Lines ()
IMPORT_C TBool ParNumberToLine ( TInt , TInt , TTmLineInfo &)
IMPORT_C TInt Paragraphs ()
IMPORT_C TInt StartChar ()
IMPORT_C TInt WidthOfWidestLine ( TInt , TInt )
IMPORT_C TBool YPosToLine ( TInt , TTmLineInfo &)
Private Member Functions
void FixUpLineInfo ( TTmLineInfo &, const TPoint *)
IMPORT_C void GetOrigin ( TPoint &)
const CTmTextLayout & TextLayout ()

Member Functions Documentation

DocPosToLine(const TTmDocPosSpec &, TTmLineInfo &)

IMPORT_C TBool DocPosToLine ( const TTmDocPosSpec & aDocPos,
TTmLineInfo & aLineInfo
) const

Parameters

const TTmDocPosSpec & aDocPos
TTmLineInfo & aLineInfo

DocPosToLine(const TTmDocPos &, TTmLineInfo &)

IMPORT_C TBool DocPosToLine ( const TTmDocPos & aDocPos,
TTmLineInfo & aLineInfo
) const

Parameters

const TTmDocPos & aDocPos
TTmLineInfo & aLineInfo

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

IMPORT_C void DrawBackground ( CGraphicsContext & aGc,
const TPoint & aTopLeft,
const TRect & aClipRect,
const TLogicalRgb & aBackground
) const

Parameters

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

DrawLayout(CGraphicsContext &, const TPoint &, const TRect &, const TLogicalRgb *, TBool)

IMPORT_C void DrawLayout ( CGraphicsContext & aGc,
const TPoint & aTopLeft,
const TRect & aClipRect,
const TLogicalRgb * aDocBackground,
TBool aDrawParBackground
) const

Parameters

CGraphicsContext & aGc
const TPoint & aTopLeft
const TRect & aClipRect
const TLogicalRgb * aDocBackground
TBool aDrawParBackground

EndChar()

IMPORT_C TInt EndChar ( ) const

FindDocPos(const TTmDocPosSpec &, TTmPosInfo2 &, TTmLineInfo &)

IMPORT_C TBool FindDocPos ( const TTmDocPosSpec & aDocPos,
TTmPosInfo2 & aPosInfo,
TTmLineInfo & aLineInfo
) const

Parameters

const TTmDocPosSpec & aDocPos
TTmPosInfo2 & aPosInfo
TTmLineInfo & aLineInfo

FindDocPos(const TTmDocPos &, TTmPosInfo &, TTmLineInfo &)

IMPORT_C TBool FindDocPos ( const TTmDocPos & aDocPos,
TTmPosInfo & aPosInfo,
TTmLineInfo & aLineInfo
) const

Parameters

const TTmDocPos & aDocPos
TTmPosInfo & aPosInfo
TTmLineInfo & aLineInfo

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

IMPORT_C TBool FindXyPos ( const TPoint & aXyPos,
TTmPosInfo2 & aPosInfo,
TTmLineInfo & aLineInfo
) const

Parameters

const TPoint & aXyPos
TTmPosInfo2 & aPosInfo
TTmLineInfo & aLineInfo

FindXyPos(const TPoint &, TTmPosInfo &, TTmLineInfo &)

IMPORT_C TBool FindXyPos ( const TPoint & aXyPos,
TTmPosInfo & aPosInfo,
TTmLineInfo & aLineInfo
) const

Parameters

const TPoint & aXyPos
TTmPosInfo & aPosInfo
TTmLineInfo & aLineInfo

FindXyPosWithDisambiguation(const TPoint &, TTmPosInfo2 &, TTmPosInfo2 &, TTmLineInfo &)

IMPORT_C TBool FindXyPosWithDisambiguation ( const TPoint & aXyPos,
TTmPosInfo2 & aPosLeft,
TTmPosInfo2 & aPosRight,
TTmLineInfo & aLineInfo
) const

Parameters

const TPoint & aXyPos
TTmPosInfo2 & aPosLeft
TTmPosInfo2 & aPosRight
TTmLineInfo & aLineInfo

FixUpLineInfo(TTmLineInfo &, const TPoint *)

void FixUpLineInfo ( TTmLineInfo & aInfo,
const TPoint * aOrigin = NULL
) const [private]

Parameters

TTmLineInfo & aInfo
const TPoint * aOrigin = NULL

GetCursor(const TTmDocPosSpec &, TTmCursorPlacement, TTmLineInfo &, TPoint &, TInt &, TInt &, TInt &)

IMPORT_C TBool GetCursor ( const TTmDocPosSpec & aDocPos,
TTmCursorPlacement aPlacement,
TTmLineInfo & aLineInfo,
TPoint & aOrigin,
TInt & aWidth,
TInt & aAscent,
TInt & aDescent
) const

Parameters

const TTmDocPosSpec & aDocPos
TTmCursorPlacement aPlacement
TTmLineInfo & aLineInfo
TPoint & aOrigin
TInt & aWidth
TInt & aAscent
TInt & aDescent

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

IMPORT_C TBool GetCursor ( const TTmDocPos & aDocPos,
TTmCursorPlacement aPlacement,
TTmLineInfo & aLineInfo,
TPoint & aOrigin,
TInt & aWidth,
TInt & aAscent,
TInt & aDescent
) const

Parameters

const TTmDocPos & aDocPos
TTmCursorPlacement aPlacement
TTmLineInfo & aLineInfo
TPoint & aOrigin
TInt & aWidth
TInt & aAscent
TInt & aDescent

GetDisplayedText(TInt, TDes &, TInt &)

IMPORT_C TBool GetDisplayedText ( TInt aLineNumber,
TDes & aText,
TInt & aNeeded
) const

Parameters

TInt aLineNumber
TDes & aText
TInt & aNeeded

GetMinimumLayoutSizeL(TInt, TSize &)

IMPORT_C void GetMinimumLayoutSizeL ( TInt aWrapWidth,
TSize & aSize
) const

Parameters

TInt aWrapWidth
TSize & aSize

GetMinimumLayoutSizeL(TInt, TBool, TSize &)

IMPORT_C void GetMinimumLayoutSizeL ( TInt aWrapWidth,
TBool aAllowLegalLineBreaksOnly,
TSize & aSize
) const

Parameters

TInt aWrapWidth
TBool aAllowLegalLineBreaksOnly
TSize & aSize

GetNextPosLeftWithDisambiguation(const TTmDocPosSpec &, TTmPosInfo2 &, TTmPosInfo2 &)

IMPORT_C TBool GetNextPosLeftWithDisambiguation ( const TTmDocPosSpec & aDocPos,
TTmPosInfo2 & aPosLeft,
TTmPosInfo2 & aPosRight
) const

Parameters

const TTmDocPosSpec & aDocPos
TTmPosInfo2 & aPosLeft
TTmPosInfo2 & aPosRight

GetNextPosRightWithDisambiguation(const TTmDocPosSpec &, TTmPosInfo2 &, TTmPosInfo2 &)

IMPORT_C TBool GetNextPosRightWithDisambiguation ( const TTmDocPosSpec & aDocPos,
TTmPosInfo2 & aPosLeft,
TTmPosInfo2 & aPosRight
) const

Parameters

const TTmDocPosSpec & aDocPos
TTmPosInfo2 & aPosLeft
TTmPosInfo2 & aPosRight

GetNextVisualCursorPos(const TTmDocPosSpec &, TTmPosInfo2 &, TBool)

IMPORT_C TBool GetNextVisualCursorPos ( const TTmDocPosSpec & aDocPos,
TTmPosInfo2 & aInfo,
TBool aToLeft
) const

Parameters

const TTmDocPosSpec & aDocPos
TTmPosInfo2 & aInfo
TBool aToLeft

GetNextVisualCursorPos(const TTmDocPos &, TTmPosInfo &, TBool)

IMPORT_C TBool GetNextVisualCursorPos ( const TTmDocPos & aDocPos,
TTmPosInfo & aInfo,
TBool aToLeft
) const

Parameters

const TTmDocPos & aDocPos
TTmPosInfo & aInfo
TBool aToLeft

GetOrigin(TPoint &)

IMPORT_C void GetOrigin ( TPoint & aPoint ) const [private, virtual]

The origin is subtracted from coordinates passed in and added to those passed out.

Parameters

TPoint & aPoint

HorizontalExtremes(TInt &, TInt &, TInt, TInt)

IMPORT_C void HorizontalExtremes ( TInt & aLeft,
TInt & aRight,
TInt aTopY = 0,
TInt aBottomY =  KMaxTInt
) const

Parameters

TInt & aLeft
TInt & aRight
TInt aTopY = 0
TInt aBottomY =  KMaxTInt

InvertLayout(CGraphicsContext &, const TPoint &, TInt, TInt)

IMPORT_C void InvertLayout ( CGraphicsContext & aGc,
const TPoint & aTopLeft,
TInt aStartDocPos,
TInt aEndDocPos
)

Parameters

CGraphicsContext & aGc
const TPoint & aTopLeft
TInt aStartDocPos
TInt aEndDocPos

LayoutHeight()

IMPORT_C TInt LayoutHeight ( ) const

LayoutWidth()

IMPORT_C TInt LayoutWidth ( ) const

LineNumberToLine(TInt, TTmLineInfo &)

IMPORT_C TBool LineNumberToLine ( TInt aLineNumber,
TTmLineInfo & aLineInfo
) const

Parameters

TInt aLineNumber
TTmLineInfo & aLineInfo

Lines()

IMPORT_C TInt Lines ( ) const

ParNumberToLine(TInt, TInt, TTmLineInfo &)

IMPORT_C TBool ParNumberToLine ( TInt aParNumber,
TInt aLineInPar,
TTmLineInfo & aLineInfo
) const

Parameters

TInt aParNumber
TInt aLineInPar
TTmLineInfo & aLineInfo

Paragraphs()

IMPORT_C TInt Paragraphs ( ) const

StartChar()

IMPORT_C TInt StartChar ( ) const

TextLayout()

const CTmTextLayout & TextLayout ( ) const [private, pure virtual]

Returns a reference to the CTmTextLayoutObject this MTmTextLayoutForwarder forwards inquiries to.

WidthOfWidestLine(TInt, TInt)

IMPORT_C TInt WidthOfWidestLine ( TInt aTop = 0,
TInt aBottom =  KMaxTInt
) const

Parameters

TInt aTop = 0
TInt aBottom =  KMaxTInt

YPosToLine(TInt, TTmLineInfo &)

IMPORT_C TBool YPosToLine ( TInt aYPos,
TTmLineInfo & aLineInfo
) const

Parameters

TInt aYPos
TTmLineInfo & aLineInfo