CTmText Class Reference

class CTmText : public CBase

A self-contained text object. It owns both layout and content. It is intended for labels and the general display of small-to-medium-sized amounts of text.

Inherits from

Constructor & Destructor Documentation

CTmText()

CTmText ( ) [private]

~CTmText()

IMPORT_C ~CTmText ( )

Destroys a CTmText object.

Member Functions Documentation

ChangeFormatL(const TTmFormatParamBase &)

IMPORT_C void ChangeFormatL ( const TTmFormatParamBase & aFormatParam )

Set the formatting parameters and reformat the text.

Parameters

const TTmFormatParamBase & aFormatParam

Clear()

IMPORT_C void Clear ( )

Deletes all the text.

CustomizeL(const MTmCustom *)

IMPORT_C void CustomizeL ( const MTmCustom * aCustom )

Specifies custom drawing or layout for the object, or if aCustom is NULL, removes any customization. Reformats the object according to the new customized layout. See the MTmCustom class for details. Custom drawing allows background graphics to be drawn, and custom layout allows, among other things, control over the way line height is calculated and special characters are displayed.

Parameters

const MTmCustom * aCustom

Draw(CGraphicsContext &, const TPoint &, const TRect &, const TLogicalRgb *, TBool)

void Draw ( CGraphicsContext & aGc,
const TPoint & aTopLeft,
const TRect & aClipRect,
const TLogicalRgb * aDocBackground,
TBool aDrawParBackground
) [inline]

Draws the formatted text. This inline function just calls CTmText::DrawLayout and is identical to it. It is provided for coding convenience because of the expectation that a drawing function called Draw exists.

Parameters

CGraphicsContext & aGc
const TPoint & aTopLeft
const TRect & aClipRect
const TLogicalRgb * aDocBackground
TBool aDrawParBackground

GetFormat(TTmFormatParamBase &)

IMPORT_C void GetFormat ( TTmFormatParamBase & aFormatParam ) const

Retrieves the current formatting parameters.

Parameters

TTmFormatParamBase & aFormatParam

InsertL(TInt, const TDesC &, const TTmCharFormat *, const RTmParFormat *, TRect *, TInt *)

IMPORT_C void InsertL ( TInt aPos,
const TDesC & aText,
const TTmCharFormat * aCharFormat = NULL,
const RTmParFormat * aParFormat = NULL,
TRect * aRedrawRect = NULL,
TInt * aScroll = NULL
)

Inserts the text aText at the document position aPos. The other arguments are all pointers which have default values of null. The first two, aCharFormat and aParFormat, specify the format for the inserted text. If either is null the format immediately before the insertion point is used.

Put the coordinates of the area that has been reformatted and needs to be redrawn, relative to the origin of the CText object, in aRedrawRect. Put the amount by which the text after the redrawn text needs to be scrolled up or down in aScroll: this is the amount by which the reformatted text has changed in height, and thus is positive if the text after the redrawn text has increased in height, which is usually, but not always, the case.

Parameters

TInt aPos
const TDesC & aText
const TTmCharFormat * aCharFormat = NULL
const RTmParFormat * aParFormat = NULL
TRect * aRedrawRect = NULL
TInt * aScroll = NULL

MemoryUsed()

IMPORT_C TInt MemoryUsed ( ) const

Returns the number of bytes of memory used by a CTmText object, allowing 8 bytes overhead per heap allocation.

NewL(MGraphicsDeviceMap *, const TTmFormatParamBase *)

IMPORT_C CTmText * NewL ( MGraphicsDeviceMap * aDevice = NULL,
const TTmFormatParamBase * aFormatParam = NULL
) [static]

Parameters

MGraphicsDeviceMap * aDevice = NULL
const TTmFormatParamBase * aFormatParam = NULL

NewL(MGraphicsDeviceMap &, const TTmFormatParamBase &)

IMPORT_C CTmText * NewL ( MGraphicsDeviceMap & aDevice,
const TTmFormatParamBase & aFormatParam
) [static]

Creates a CTmText object using the specified device map and formatting parameters.

Parameters

MGraphicsDeviceMap & aDevice
const TTmFormatParamBase & aFormatParam

NewL(MGraphicsDeviceMap &, TInt, TInt)

IMPORT_C CTmText * NewL ( MGraphicsDeviceMap & aDevice,
TInt aWrapWidth,
TInt aFlags
) [static]

Creates a CTmText object using the specified device map and formatting parameters that have default values (as in the default constructor for TTmFormatParamBase ) apart from the wrap width and flags. The values of the flags are those used in for TTmFormatParamBase::iFlags .

Parameters

MGraphicsDeviceMap & aDevice
TInt aWrapWidth
TInt aFlags

SetWrapWidthL(TInt)

IMPORT_C void SetWrapWidthL ( TInt aWrapWidth )

Sets the wrap width and reformat the text.

Parameters

TInt aWrapWidth

Spare1()

IMPORT_C void Spare1 ( ) [private]

TextLayout()

const CTmTextLayout & TextLayout ( ) const [private]

Returns a const reference to the CTmTextLayout object owned by this object. This function implements MTmTextLayoutForwarder::TextLayout .

Member Data Documentation

CTmTextImp * iImp

CTmTextImp * iImp [private]