Symbian
Symbian OS Library

SYMBIAN OS V9.2

[Index] [Spacer] [Previous] [Next]



Location: coetextdrawer.h
Link against: cone.lib

Class XCoeTextDrawer

class XCoeTextDrawer;

Description

XCoeTextDrawer: This class serves as a handle to the class CCoeTextDrawerBase. Specifically it enables access to the CCoeTextDrawerBase's private DrawText() method. The class also manages the life of the heap allocated CCoeTextDrawerBase (deleting it or resetting it depending on whether the object is reusable or not). XCoeTextDrawer shall be allocated on the stack in the control's Draw() method and initialized with a heap allocated CCoeTextDrawerBase object fetched from the control's own skin, or from its parent or background through the CCoeControl::TextDrawer() method.

Note that an overload of the '->' operator is implemented in this class. Invoking -> on an XCoeTextDrawer object will return the iTextDrawer data member which is a pointer to a CCoeTextDrawerBase object. Using this the accessor and set methods in CCoeTextDrawerBase can be invoked. For example issuing xCoeTextDrawerObject -> Margins(); will invoke (iTextDrawer*).Margins();

Members

Defined in XCoeTextDrawer:
ClipRect(), DrawDisplayOrderedText(), DrawText(), SetClipRect(), XCoeTextDrawer(), operator->(), operator=(), ~XCoeTextDrawer()


Construction and destruction


XCoeTextDrawer()

IMPORT_C XCoeTextDrawer(CCoeTextDrawerBase &aTextDrawer);

Description

Constructor

Parameters

CCoeTextDrawerBase &aTextDrawer


~XCoeTextDrawer()

IMPORT_C ~XCoeTextDrawer();

Description

Destructor

[Top]


Member functions


operator=()

IMPORT_C void operator=(CCoeTextDrawerBase &aTextDrawer);

Description

Override of assignment operator Used to set the iTextDrawer data member with a CCoeTextDrawerBase object.

Parameters

CCoeTextDrawerBase &aTextDrawer

A text drawer.


operator->()

IMPORT_C CCoeTextDrawerBase *operator->();

Description

Override of -> operator. This operator is used to access the methods of the iTextDrawer (CCoeTextDrawerBase pointer) data member. Invoking -> on an XCoeTextDrawer object will return the iTextDrawer data member which is a pointer to a CCoeTextDrawerBase object. Using this the accessor and set methods in CCoeTextDrawerBase can be invoked. For example issuing xCoeTextDrawerObject -> Margins(); will invoke (iTextDrawer*).Margins();

Return value

CCoeTextDrawerBase *

A pointer to the CCoeTextDrawerBase object contained by the XCoeTextDrawer.


DrawText()

IMPORT_C void DrawText(CGraphicsContext &aGc, const TBidiText &aText, const TRect &aTextRect, const CFont &aFont) const;

Description

Draw method. Uses its CCoeTextDrawerBase derived data member to draw the text passed as parameter.

Parameters

CGraphicsContext &aGc

The graphics context.

const TBidiText &aText

TBidiText reference containing the text to be drawn.

const TRect &aTextRect

Rectangle text will be drawn in

const CFont &aFont

Font to be used.


DrawDisplayOrderedText()

IMPORT_C void DrawDisplayOrderedText(CGraphicsContext &aGc, const TDesC &aText, const TRect &aTextRect, const CFont &aFont) const;

Description

Draw method. Uses its CCoeTextDrawerBase derived data member to draw the text passed as parameter.

Parameters

CGraphicsContext &aGc

The graphics context.

const TDesC &aText

TDesC reference containing the text to be drawn.

const TRect &aTextRect

Rectangle text will be drawn in

const CFont &aFont

Font to be used.


ClipRect()

IMPORT_C TRect ClipRect() const;

Description

Retrieve the iClipRect value.

Return value

TRect

TRect value of iClipRect data member


SetClipRect()

IMPORT_C void SetClipRect(const TRect &aClipRect);

Description

Sets the iClipRect data member.

Parameters

const TRect &aClipRect

TRect value to set iClipRect to.