TCoeTextTypeAdaptor Class Reference

#include <mw/coetextdrawer.h>

class TCoeTextTypeAdaptor
Public Member Functions
TCoeTextTypeAdaptor(const TDesC &)
TCoeTextTypeAdaptor(const TBidiText &)
IMPORT_C TBoolHasRightToLeftDirectionality()
IMPORT_C TPtrCLineOfText(TInt, TInt &, const CFont &)
IMPORT_C TIntNumberOfLines()

Detailed Description

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.

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.

Parameters
aTextThe text wrapped by the TCoeTextTypeAdaptor.

TCoeTextTypeAdaptor ( const TBidiText & )

IMPORT_CTCoeTextTypeAdaptor(const TBidiText &aText)

Constructor taking a TBidiText object as parameter.

Parameters
aTextThe text wrapped by the TCoeTextTypeAdaptor.

Member Function Documentation

HasRightToLeftDirectionality ( )

IMPORT_C TBoolHasRightToLeftDirectionality()const

This function checks the directionality of the text.

Return Value
ETrue if the text has right-to-left directionality, EFalse if it has left-to-right directionality.

LineOfText ( TInt, TInt &, const CFont & )

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

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

Parameters
aLineNumberZero-based line number.
aWidthInPixelsThe width of the line of text.
aFontThe font that will be used to draw the text.
Return Value
TPtrC line of text

NumberOfLines ( )

IMPORT_C TIntNumberOfLines()const

Calculates the number of lines in the text.

Return Value
TInt number of lines in the object