class CCoeTextDrawerBase : public CBase |
This is the base class for all text drawers implementing different text effects (for example shadow or glowing/outlined text). The object can be created and deleted each time it's used, or Reset() and reused if it IsReusable(). The latter is recommended.
Note that the pure virtual DrawText() method is private. This ensures that the object is used through the XCoeTextDrawer class (which manages its life).
Note also that the accessor and set methods should be used via the owning XCoeTextDrawer object, and that the MObjectProvider mechanism can be used to identify the actual text drawer implementation.
Public Member Functions | |
---|---|
~CCoeTextDrawerBase() | |
IMPORT_C TGulAlignment | Alignment() |
IMPORT_C TMargins8 | EffectMargins() |
IMPORT_C TBool | IsReusable() |
IMPORT_C TInt | LineGapInPixels() |
IMPORT_C TMargins8 | Margins() |
IMPORT_C void | Reset() |
IMPORT_C void | SetAlignment(const TGulAlignment &) |
IMPORT_C void | SetAppLanguage(TLanguage) |
IMPORT_C void | SetLineGapInPixels(TInt) |
IMPORT_C void | SetMargins(const TMargins8 &) |
IMPORT_C void | SetReusable(TBool) |
void | SetTextColor(TRgb) |
TRgb | TextColor() |
Protected Member Functions | |
---|---|
CCoeTextDrawerBase() | |
IMPORT_C TGulHAlignment | ActualHorizontalAlignment(const TCoeTextTypeAdaptor &) |
IMPORT_C TInt | Construct() |
Private Member Functions | |
---|---|
IMPORT_C void | CCoeTextDrawerBase_Reserved10() |
IMPORT_C void | CCoeTextDrawerBase_Reserved3() |
IMPORT_C void | CCoeTextDrawerBase_Reserved4() |
IMPORT_C void | CCoeTextDrawerBase_Reserved5() |
IMPORT_C void | CCoeTextDrawerBase_Reserved6() |
IMPORT_C void | CCoeTextDrawerBase_Reserved7() |
IMPORT_C void | CCoeTextDrawerBase_Reserved8() |
IMPORT_C void | CCoeTextDrawerBase_Reserved9() |
void | DrawText(CGraphicsContext &, const TCoeTextTypeAdaptor &, const CFont &, const TRect &, const TRect &) |
IMPORT_C void | DrawTextVertical(CGraphicsContext &, const TCoeTextTypeAdaptor &, const CFont &, const TRect &, const TRect &, TBool) |
Private Attributes | |
---|---|
TGulAlignment | iAlignment |
CCoeTextDrawerBaseExt * | iExtension |
TBool | iIsReusable |
TInt | iLineGap |
TMargins8 | iMargins |
IMPORT_C TGulHAlignment | ActualHorizontalAlignment | ( | const TCoeTextTypeAdaptor & | aText | ) | const [protected] |
const TCoeTextTypeAdaptor & aText |
void | DrawText | ( | CGraphicsContext & | aGc, |
const TCoeTextTypeAdaptor & | aText, | |||
const CFont & | aFont, | |||
const TRect & | aTextRect, | |||
const TRect & | aClipRect | |||
) | const [private, pure virtual] |
Any actual text drawer must implement this method to draw the text passed as argument. The implementation must draw the text inside the text rectangle, cropped to the clipping rectangle, and with the given margins and alignment taken into account.
Note that the actual horizontal alignment shall depend on the script directionality. Calling ActualHorizontalAlignment() will return the horizontal alignment where left and right has been swapped for right-to-left scripts.
CGraphicsContext & aGc | |
const TCoeTextTypeAdaptor & aText | |
const CFont & aFont | |
const TRect & aTextRect | |
const TRect & aClipRect |
IMPORT_C void | DrawTextVertical | ( | CGraphicsContext & | aGc, |
const TCoeTextTypeAdaptor & | aText, | |||
const CFont & | aFont, | |||
const TRect & | aTextRect, | |||
const TRect & | aClipRect, | |||
TBool | aUp | |||
) | const [private, virtual] |
Draws the text vertically inside the text rectangle, cropped to the clipping rectangle, and with the given margins and alignment taken into account. If aUp is ETrue, text is rotated 90 degrees anti-clockwise; EFalse, text is rotated 90 degrees clockwise.
Note that the actual horizontal alignment shall depend on the script directionality. Calling ActualHorizontalAlignment() will return the horizontal alignment where left and right has been swapped for right-to-left scripts. Also note that the margines are relative to the orientation of the text.
CGraphicsContext & aGc | |
const TCoeTextTypeAdaptor & aText | |
const CFont & aFont | |
const TRect & aTextRect | |
const TRect & aClipRect | |
TBool aUp |
IMPORT_C void | SetAlignment | ( | const TGulAlignment & | aAlignment | ) |
const TGulAlignment & aAlignment |
IMPORT_C void | SetAppLanguage | ( | TLanguage | aAppLang | ) |
TLanguage aAppLang |
IMPORT_C void | SetLineGapInPixels | ( | TInt | aLineGapInPixels | ) |
TInt aLineGapInPixels |
IMPORT_C void | SetMargins | ( | const TMargins8 & | aMargins | ) |
const TMargins8 & aMargins |
void | SetTextColor | ( | TRgb | aColor | ) | [pure virtual] |
This method sets the main color to use to draw text.
TRgb aColor | The color to use to draw text. |
TRgb | TextColor | ( | ) | const [pure virtual] |
This method returns the main color used by the CCoeTextDrawer to draw text. The color used to draw text.