MTmSource Class Reference

class MTmSource : public MTmCustom

WARNING: this Class is for internal use ONLY. Compatibility is not guaranteed in future releases. MTmSource is an interface class that must be implemented by users of CTmTextLayout to provide text content and attributes. MTmSource is derived from MTmCustom, which contains the functions to customise the layout and display, so that this can be done in CTmText without affecting the content.

Inherits from

Public Member Functions
TInt DocumentLength()
MGraphicsDeviceMap &FormatDevice()
IMPORT_C TAny *GetExtendedInterface(const TUid &)
IMPORT_C TBoolGetLineBreakL(const TDesC &, TInt, TInt, TInt, TBool, TInt &, TInt &, TInt &)
voidGetParagraphFormatL(TInt, RTmParFormat &)
IMPORT_C TIntGetPictureSizeInTwipsL(TInt, TSize &)
IMPORT_C voidGetStandardLineBreak(const TDesC &, TInt, TInt, TInt &, TInt &)
voidGetText(TInt, TPtrC &, TTmCharFormat &)
MGraphicsDeviceMap &InterpretDevice()
IMPORT_C voidMTmSource_Reserved_1()
IMPORT_C voidMTmSource_Reserved_2()
IMPORT_C TBoolPageBreakInRange(TInt, TInt)
IMPORT_C TIntParagraphEnd(TInt)
TInt ParagraphStart(TInt)
IMPORT_C CPicture *PictureL(TInt)
Inherited Functions
MLineBreaker::ExtendedInterface(TUid &)const
MLineBreaker::GetLineBreak(const TDesC16 &,TInt,TInt,TBool,MContingentLineBreaker *,TInt &,TInt &)const
MLineBreaker::GetLineBreakL(const TDesC16 &,TInt,TInt,TBool,MContingentLineBreakerL *,TInt &,TInt &)const
MTmCustom::DrawBackground(CGraphicsContext &,const TPoint &,const TRect &,const TLogicalRgb &,TRect &)const
MTmCustom::DrawLineGraphics(CGraphicsContext &,const TPoint &,const TRect &,const TTmLineInfo &)const
MTmCustom::DrawPicture(CGraphicsContext &,const TPoint &,const TRect &,MGraphicsDeviceMap &,const CPicture &)const
MTmCustom::DrawText(CGraphicsContext &,const TPoint &,const TRect &,const TTmLineInfo &,const TTmCharFormat &,const TDesC &,const TPoint &,TInt)const
MTmCustom::GetLineBreakInContext(const TDesC &,TInt,TInt,TBool,TInt &)const
MTmCustom::IsHangingCharacter(TUint)const
MTmCustom::LineBreakClass(TUint,TUint &,TUint &)const
MTmCustom::LineBreakPossible(TUint,TUint,TBool)const
MTmCustom::Map(TUint)const
MTmCustom::SetBrushColor(CGraphicsContext &,TLogicalRgb)const
MTmCustom::SetLineHeight(const TLineHeightParam &,TInt &,TInt &)const
MTmCustom::SetPenColor(CGraphicsContext &,TLogicalRgb)const
MTmCustom::Stretch(TUint)const
MTmCustom::SystemColor(TLogicalRgb)const
MTmCustom::SystemColor(TUint,TRgb)const
Public Member Enumerations
enumanonymous { ELineBreakContext = 32 }
enumTLabelType { ENoLabel, EParLabel }
Inherited Enumerations
MLineBreaker:@53
MTmCustom:@55
MTmCustom:@76

Member Functions Documentation

DocumentLength()

TInt DocumentLength()const [pure virtual]

Return the length of the document in characters.

FormatDevice()

MGraphicsDeviceMap &FormatDevice()const [pure virtual]

Return the device used to format the text.

GetExtendedInterface(const TUid &)

IMPORT_C TAny *GetExtendedInterface(const TUid &aInterfaceId)[virtual]

Parameters

const TUid & aInterfaceId

GetLineBreakL(const TDesC &, TInt, TInt, TInt, TBool, TInt &, TInt &, TInt &)

IMPORT_C TBoolGetLineBreakL(const TDesC &aText,
TIntaDocPos,
TIntaMinBreakPos,
TIntaMaxBreakPos,
TBoolaForwards,
TInt &aBreakPos,
TInt &aHangingChars,
TInt &aBreakPosAfterSpaces
)const

Parameters

const TDesC & aText
TInt aDocPos
TInt aMinBreakPos
TInt aMaxBreakPos
TBool aForwards
TInt & aBreakPos
TInt & aHangingChars
TInt & aBreakPosAfterSpaces

GetParagraphFormatL(TInt, RTmParFormat &)

voidGetParagraphFormatL(TIntaPos,
RTmParFormat &aFormat
)const [pure virtual]

Return the paragraph format of the paragraph containing aPos. End-of-paragraph characters belong to the preceding paragraph.

Parameters

TInt aPos
RTmParFormat & aFormat

GetPictureSizeInTwipsL(TInt, TSize &)

IMPORT_C TIntGetPictureSizeInTwipsL(TIntaPos,
TSize &aSize
)const [virtual]

Parameters

TInt aPos
TSize & aSize

GetStandardLineBreak(const TDesC &, TInt, TInt, TInt &, TInt &)

IMPORT_C voidGetStandardLineBreak(const TDesC &aText,
TIntaMinBreakPos,
TIntaMaxBreakPos,
TInt &aBreakPos,
TInt &aNextLineStart
)[static]

A static function to expose the standard line breaking system for use on plain text, mainly so that UIKON can use it for messages.

It finds the last feasible line break in the range aMinBreakPos...aMaxBreakPos within aText, and the start of the next line, which may be after aMaxBreakPos (because aMaxBreakPos may be in a run of spaces or before a line or paragraph separator).

The text passed in is the maximum that will fit the required line width; in other words, it has already been measured. The best way to do this is to use CFont::MeasureText and specify a TMeasureTextInput parameter with TMeasureTextInput::iMaxAdvance to the line width; TMeasureTextOutput::iChars gives the maximum length that will fit the line.

Bidirectional reformatting should be done after the break position is found.

Limitations:

Forced line breaks, which may be caused by CR, LF, FF, combinations of these, U+2028, and U+2029, are ignored, the purpose of the function being to break some text that is already known to be too wide for a certain measure. Dictionary-based line breaking for Thai is not available. Use zero-width spaces to allow line breaks in Thai.

This function cannot leave because MTmSource::GetLineBreakL cannot leave unless the implementation of PictureL can leave, and here the default MTmSource::PictureL, which does not leave, is called.

Parameters

const TDesC & aText
TInt aMinBreakPos
TInt aMaxBreakPos
TInt & aBreakPos
TInt & aNextLineStart

GetText(TInt, TPtrC &, TTmCharFormat &)

voidGetText(TIntaPos,
TPtrC &aText,
TTmCharFormat &aFormat
)const [pure virtual]

Return at least one character of text, but preferably as many as possible, starting at aPos. Put its character format in aFormat. The text must be a run of characters sharing the same character format.

Parameters

TInt aPos
TPtrC & aText
TTmCharFormat & aFormat

InterpretDevice()

MGraphicsDeviceMap &InterpretDevice()const [pure virtual]

Return the device used to draw the text and when converting between x-y coordinates and document positions. If the formatting and interpreting devices are different, text is scaled appropriately when it is drawn; this allows text to be formatted for printer fonts and displayed on the screen, giving a wysiwyg print preview.

MTmSource_Reserved_1()

IMPORT_C voidMTmSource_Reserved_1()[virtual]

MTmSource_Reserved_2()

IMPORT_C voidMTmSource_Reserved_2()[virtual]

PageBreakInRange(TInt, TInt)

IMPORT_C TBoolPageBreakInRange(TIntaStartPos,
TIntaEndPos
)const [virtual]

Parameters

TInt aStartPos
TInt aEndPos

ParagraphEnd(TInt)

IMPORT_C TIntParagraphEnd(TIntaPos)const

Return the end of the paragraph - after the paragraph separator if any.

Parameters

TInt aPos

ParagraphStart(TInt)

TInt ParagraphStart(TIntaPos)const [pure virtual]

Return the document position of the start of the paragraph containing aPos. End-of-paragraph characters belong to the preceding paragraph.

Parameters

TInt aPos

PictureL(TInt)

IMPORT_C CPicture *PictureL(TIntaPos)const [virtual]

The default function to get a picture; override this if there are pictures in the document.

Parameters

TInt aPos

Member Enumerations Documentation

Enum anonymous

Enumerators

ELineBreakContext = 32

The maximum number of characters supplied to GetLineBreak, after aMaxBreakPos, and after trailing whitespace, to provide context for line breaking decisions.

Enum TLabelType

Label type used in LabelModeSelect

Enumerators

ENoLabel

Not a label; used for TLabelTypes not yet assigned.

EParLabel

Paragraph label of the type supported by FORM.