TCoeTextTypeAdaptor Class Reference

class TCoeTextTypeAdaptor

This class allows the XCoeTextDrawer to draw text that is in the form of a TBidiText object as well as pre-reordered new-line separated plain text descriptors. (The descriptor text is especially useful when using the XCoeTextDrawer together with the FORM component).

This removes the need to implement two versions of the DrawText() method.

Public Member Functions
TCoeTextTypeAdaptor(const TDesC &)
TCoeTextTypeAdaptor(const TBidiText &)
IMPORT_C TBoolHasRightToLeftDirectionality()
IMPORT_C TPtrCLineOfText(TInt, TInt &, const CFont &)
IMPORT_C TIntNumberOfLines()
Private Member Enumerations
enumTTextType { ENewlineSeparated, EBidiText }
Private Attributes
const TAny *iText
TTextType iTextType

Constructor & Destructor Documentation

TCoeTextTypeAdaptor(const TDesC &)

IMPORT_CTCoeTextTypeAdaptor(const TDesC &aText)

Constructor taking a plain descriptor as parameter. The directionality of the text separated with '' must always be left-to-right display order.


const TDesC & aTextThe text wrapped by the TCoeTextTypeAdaptor.

TCoeTextTypeAdaptor(const TBidiText &)

IMPORT_CTCoeTextTypeAdaptor(const TBidiText &aText)

Constructor taking a TBidiText object as parameter.


const TBidiText & aTextThe text wrapped by the TCoeTextTypeAdaptor.

Member Functions Documentation


IMPORT_C TBoolHasRightToLeftDirectionality()const

This function checks the directionality of the text.

LineOfText(TInt, TInt &, const CFont &)

IMPORT_C TPtrCLineOfText(TIntaLineNumber,
TInt &aWidthInPixels,
const CFont &aFont

Extracts a line of text. The width (in pixels) of the line is returned in aWidthInPixels.


TInt aLineNumberZero-based line number.
TInt & aWidthInPixelsThe width of the line of text.
const CFont & aFontThe font that will be used to draw the text.


IMPORT_C TIntNumberOfLines()const

Calculates the number of lines in the text.

Member Enumerations Documentation

Enum TTextType



Member Data Documentation

const TAny * iText

const TAny *iText[private]

TTextType iTextType

TTextType iTextType[private]