RTmTextCache Class Reference

class RTmTextCache

A class for caching text and formats extracted from a text source. That it is an R class shows that it must be closed after use; call Close() .

Constructor & Destructor Documentation

RTmTextCache(MTmSource &, MGraphicsDeviceMap &)

RTmTextCache ( MTmSource & aSource,
MGraphicsDeviceMap & aDevice
) [inline]

Parameters

MTmSource & aSource
MGraphicsDeviceMap & aDevice

Member Functions Documentation

AdvanceWidthL(TInt, TInt, TBool, TInt, CFbsFont::TMeasureTextOutput *, TInt)

TInt AdvanceWidthL ( TInt aStart,
TInt aEnd,
TBool aRightToLeft,
TInt aMaxWidth =  KMaxTInt ,
CFbsFont::TMeasureTextOutput * aOutput = 0,
TInt aExtraChar = 0
)

Measure the width of some text, substituting glyphs where necessary.

Parameters

TInt aStart Start position of text in document
TInt aEnd (Exclusive) end position of text in document
TBool aRightToLeft True if the text is right-to-left
TInt aMaxWidth =  KMaxTInt Measurement will stop if this advance is exceeded
CFbsFont::TMeasureTextOutput * aOutput = 0 Output form text measurement function
TInt aExtraChar = 0 Fetch this much context beyond aEnd. This helps when the text is to be truncated, and aEnd is not certain to be at a cluster boundary.

Char(TInt)

TUint Char ( TInt aPos )

Parameters

TInt aPos

Close()

void Close ( ) [inline]

Device()

MGraphicsDeviceMap & Device ( ) [inline]

Format()

const TTmCharFormat & Format ( ) const [inline]

GetContextChar()

TUint GetContextChar ( ) const [inline]

GetContextForByteCode()

TUint GetContextForByteCode ( ) const [inline]

GetDisplayedText(TInt, TInt, TDisplayedTextDirectionality, TText *, TUint, TTmCharFormat *, CTmTextFontCache **)

TInt GetDisplayedText ( TInt aStart,
TInt aEnd,
TDisplayedTextDirectionality aDirectionality,
TText * aBuffer,
TUint aContextChar,
TTmCharFormat * aFormat = 0,
CTmTextFontCache ** aFont = NULL
)

Gets all the displayed text in the range aStart...aEnd and puts it into a buffer that must be at least aEnd - aStart + 2 characters in length. If aFormat is non-null gets the format of the first section of text. If aFont is non-null gets the font for the first section of text. If aDirectionality is EVisualRightToLeft reverses the text and mirrors appropriate characters. Adds a zero-width joiner to the start and/or end of the text returned if these are necessary for the correct contextual glyph choice. Adds a 0xFFFF to each end if this is not required.

Parameters

TInt aStart
TInt aEnd
TDisplayedTextDirectionality aDirectionality
TText * aBuffer
TUint aContextChar
TTmCharFormat * aFormat = 0
CTmTextFontCache ** aFont = NULL If aFont is not null, on return contains a pointer to an opened CTmTextFontCache* The caller must call Close on aFont when finished with the font.

GetText(TInt, TInt, TPtrC &, TTmCharFormat *, CTmTextFontCache **)

TInt GetText ( TInt aPos,
TInt aMaxEndChar,
TPtrC & aText,
TTmCharFormat * aFormat = NULL,
CTmTextFontCache ** aFont = NULL
)

Parameters

TInt aPos
TInt aMaxEndChar
TPtrC & aText
TTmCharFormat * aFormat = NULL
CTmTextFontCache ** aFont = NULL

GetTextL(TInt, TInt, TPtrC &, TTmCharFormat *, CTmTextFontCache **)

TInt GetTextL ( TInt aPos,
TInt aMaxEndChar,
TPtrC & aText,
TTmCharFormat * aFormat = 0,
CTmTextFontCache ** aFont = 0
)

Same as GetText but will join text together if it has the same format.

Parameters

TInt aPos
TInt aMaxEndChar
TPtrC & aText the text returned. Is valid until the next call of GetText, GetTextL or Close.
TTmCharFormat * aFormat = 0
CTmTextFontCache ** aFont = 0 If aFont is not null, on return contains a pointer to an opened CTmTextFontCache* The caller must call Close on aFont when finished with the font.

IsArabicPoint(TInt)

TBool IsArabicPoint ( TInt aChar ) [static]

Parameters

TInt aChar

ReleaseFont()

void ReleaseFont ( ) [inline]

SetContextChar(TUint)

void SetContextChar ( TUint aContextChar )

Parameters

TUint aContextChar

Source()

MTmSource & Source ( ) [inline]

TotalWidthL(TInt, TInt, TBool)

TInt TotalWidthL ( TInt aStart,
TInt aEnd,
TBool aRightToLeft
)

Measure the width of some text, substituting glyphs where necessary.

Parameters

TInt aStart Start position of text in document
TInt aEnd (Exclusive) end position of text in document
TBool aRightToLeft True if the text is right-to-left

Member Enumerations Documentation

Enum TDisplayedTextDirectionality

Enumerators

ELeftToRight = 0
EVisualRightToLeft = 1
ELogicalRightToLeft = 2

Member Data Documentation

TUint iContextCharInByteCode

TUint iContextCharInByteCode [private]

TUint iContextCharPerChunk

TUint iContextCharPerChunk [private]

MGraphicsDeviceMap & iDevice

MGraphicsDeviceMap & iDevice [private]

TInt iDocumentLength

TInt iDocumentLength [private]

CTmTextFontCache * iFont

CTmTextFontCache * iFont [private]

TTmCharFormat iFormat

TTmCharFormat iFormat [private]

MTmSource & iSource

MTmSource & iSource [private]

const TText * iText

const TText * iText [private]

RBuf iTextBuffer

RBuf iTextBuffer [private]

TBool iTextBufferEndsInFormatChange

TBool iTextBufferEndsInFormatChange [private]

TInt iTextBufferStart

TInt iTextBufferStart [private]

TInt iTextLength

TInt iTextLength [private]

TInt iTextStart

TInt iTextStart [private]