TAknLayoutText Class Reference

class TAknLayoutText

Low level drawing based on European LAF document (can be used by application's custom controls)

This class reads AVKON_LAYOUT_TEXT resources

Public Member Functions
TAknLayoutText()
CGraphicsContext::TTextAlign Align()
TInt BaselineOffset()
TRgb Color()
IMPORT_C voidDrawText(CGraphicsContext &, const TDesC &)
IMPORT_C voidDrawText(CGraphicsContext &, const TDesC &, TBool)
IMPORT_C voidDrawText(CGraphicsContext &, const TDesC &, TBool, const TRgb &)
const CFont *Font()
IMPORT_C voidLayoutText(const TRect &, TInt, const CFont *)
IMPORT_C voidLayoutText(const TRect &, TResourceReader &, const CFont *)
IMPORT_C voidLayoutText(const TRect &, const AknLayoutUtils::SAknLayoutText &, const CFont *)
IMPORT_C voidLayoutText(const TRect &, const TAknTextLineLayout &, const CFont *)
IMPORT_C voidLayoutText(const TRect &, TInt, TInt, TInt, TInt, TInt, TInt, TInt, const CFont *)
IMPORT_C TRectTextRect()
Private Attributes
CGraphicsContext::TTextAlign iAlign
TInt iColor
const CFont *iFont
TInt iOffset
TRect iTextRect

Constructor & Destructor Documentation

TAknLayoutText()

IMPORT_CTAknLayoutText()

Member Functions Documentation

Align()

CGraphicsContext::TTextAlign Align()const [inline]

BaselineOffset()

TInt BaselineOffset()const

Returns the baseline position for the font set in this object. This value, together with TextRect(), are the metrics that are used to parametrise a call to DrawText, for example: void CGraphicsContext::DrawText( const TDesC& aText, const TRect& aBox, TInt aBaselineOffset, TTextAlign aAlignment = ELeft, TInt aLeftMargin = 0);

TAknLayoutText's own DrawText methods are recommended, however.

Notice that this value is relative to the top of the TextRect() rectangle, which is generally made to bound all accents. Thus this offset value is usually larger than the CFont::AscentInPixels value.

Since
3.1

Color()

TRgb Color()const [inline]

DrawText(CGraphicsContext &, const TDesC &)

IMPORT_C voidDrawText(CGraphicsContext &aGc,
const TDesC &aText
)const

Do the actual drawing, should be placed to control's Draw() method.

Parameters

CGraphicsContext & aGc
const TDesC & aText

DrawText(CGraphicsContext &, const TDesC &, TBool)

IMPORT_C voidDrawText(CGraphicsContext &aGc,
const TDesC &aText,
TBoolaUseLogicalToVisualConversion
)const

In case of bidirectional text, which is already converted from logical to visual order, use this method with parameter aUseLogicalToVisualConversion EFalse.

Parameters

CGraphicsContext & aGc
const TDesC & aText
TBool aUseLogicalToVisualConversion

DrawText(CGraphicsContext &, const TDesC &, TBool, const TRgb &)

IMPORT_C voidDrawText(CGraphicsContext &aGc,
const TDesC &aText,
TBoolaUseLogicalToVisualConversion,
const TRgb &aColor
)const

Parameters

CGraphicsContext & aGc
const TDesC & aText
TBool aUseLogicalToVisualConversion
const TRgb & aColor

Font()

const CFont *Font()const [inline]

LayoutText(const TRect &, TInt, const CFont *)

IMPORT_C voidLayoutText(const TRect &aParent,
TIntaResourceId,
const CFont *aCustomFont = 0
)

Read resources and calculate information needed to draw text.

LayoutText() call should be placed to control's SizeChanged() method.

Parameters

const TRect & aParent
TInt aResourceId
const CFont * aCustomFont = 0

LayoutText(const TRect &, TResourceReader &, const CFont *)

IMPORT_C voidLayoutText(const TRect &aParent,
TResourceReader &aReader,
const CFont *aCustomFont = 0
)

Parameters

const TRect & aParent
TResourceReader & aReader
const CFont * aCustomFont = 0

LayoutText(const TRect &, const AknLayoutUtils::SAknLayoutText &, const CFont *)

IMPORT_C voidLayoutText(const TRect &aParent,
const AknLayoutUtils::SAknLayoutText &aLayout,
const CFont *aCustomFont = 0
)

Parameters

const TRect & aParent
const AknLayoutUtils::SAknLayoutText & aLayout
const CFont * aCustomFont = 0

LayoutText(const TRect &, const TAknTextLineLayout &, const CFont *)

IMPORT_C voidLayoutText(const TRect &aParent,
const TAknTextLineLayout &aLayout,
const CFont *aCustomFont = 0
)

Parameters

const TRect & aParent
const TAknTextLineLayout & aLayout
const CFont * aCustomFont = 0

LayoutText(const TRect &, TInt, TInt, TInt, TInt, TInt, TInt, TInt, const CFont *)

IMPORT_C voidLayoutText(const TRect &aParent,
TIntfontid,
TIntC,
TIntl,
TIntr,
TIntB,
TIntW,
TIntJ,
const CFont *aCustomFont = 0
)

Parameters

const TRect & aParent
TInt fontid
TInt C
TInt l
TInt r
TInt B
TInt W
TInt J
const CFont * aCustomFont = 0

TextRect()

IMPORT_C TRectTextRect()const

This returns rectangle that is used to draw the text.

This allows you to divide screen space for egul's TextUtils::ClearBetweenRect() without knowing exact coordinates => when coordinates change, your code does not need to change.

Member Data Documentation

CGraphicsContext::TTextAlign iAlign

CGraphicsContext::TTextAlign iAlign[private]

TInt iColor

TInt iColor[private]

const CFont * iFont

const CFont *iFont[private]

TInt iOffset

TInt iOffset[private]

TRect iTextRect

TRect iTextRect[private]