MFormatText Class Reference

#include <txtmfmtx.h>

class MFormatText
Public Member Functions
pure virtual voidApplyCharFormatL(const TCharFormat &, const TCharFormatMask &, TInt, TInt)
pure virtual voidApplyParaFormatL(const CParaFormat *, const TParaFormatMask &, TInt, TInt)
pure virtual voidGetCharFormat(TCharFormat &, TCharFormatMask &, TInt, TInt)
pure virtual voidGetParaFormatL(CParaFormat *, TParaFormatMask &, TInt, TInt, CParaFormat::TParaFormatGetMode)

Detailed Description

Specifies the mixin protocol for getting and setting character and paragraph format attributes.

It is inherited by classes which support character and paragraph formatting, e.g. CRichText and CGlobalText. Its purpose is to allow developers to apply and retrieve formatting without needing to know which type of editable text is involved.

All functions defined in this class use a document position and a length. These values are only relevant to rich text. In general, they must be valid (i.e. the range must not extend beyond the bounds of the document), or a panic occurs. In global text, formatting is applied globally, so that the length and position values are ignored.

Member Function Documentation

ApplyCharFormatL ( const TCharFormat &, const TCharFormatMask &, TInt, TInt )

voidApplyCharFormatL(const TCharFormat &aFormat,
const TCharFormatMask &aMask,
TIntaPos,
TIntaLength
)[pure virtual]

Applies character formatting to a range of characters. The attributes which are set in the mask are taken from aFormat and applied. The attributes which are not set in the mask are not applied.

Parameters
aFormatContains the character format attribute values to apply.
aMaskBitmask specifying which character format attributes should be applied.
aPosDocument position from which to apply the new character formatting.
aLengthThe number of characters to which the new formatting should be applied.

ApplyParaFormatL ( const CParaFormat *, const TParaFormatMask &, TInt, TInt )

voidApplyParaFormatL(const CParaFormat *aFormat,
const TParaFormatMask &aMask,
TIntaPos,
TIntaLength
)[pure virtual]

Applies paragraph formatting to a range of paragraphs. The attributes which are set in the mask are taken from aFormat and applied. The attributes which are not set in the mask are not applied.

Parameters
aFormatContains the paragraph format attribute values to apply.
aMaskSpecifies which paragraph format attributes should be applied.
aPosThe document position of the start of the range.
aLengthThe number of characters in the range.

GetCharFormat ( TCharFormat &, TCharFormatMask &, TInt, TInt )

voidGetCharFormat(TCharFormat &aFormat,
TCharFormatMask &aVaries,
TIntaPos,
TIntaLength
)const [pure virtual]

Gets the effective character formatting which applies to a range of characters. Also gets a bit mask which indicates which values change over the region, and whose value is therefore indeterminate.

Parameters
aFormatOn return, contains the character format values for the range of characters. For global text, this is the character formatting of the entire text object.
aVariesOn return, indicates which character format attributes vary over the range and whose values are therefore indeterminate. For global text, this mask contains a value of zero for every attribute because formatting is applied globally.
aPosThe document position of the start of the range.
aLengthThe number of characters in the range.

GetParaFormatL ( CParaFormat *, TParaFormatMask &, TInt, TInt, CParaFormat::TParaFormatGetMode )

voidGetParaFormatL(CParaFormat *aFormat,
TParaFormatMask &aVaries,
TIntaPos,
TIntaLength,
CParaFormat::TParaFormatGetModeaMode = CParaFormat::EAllAttributes
)const [pure virtual]

Gets the effective paragraph formatting which applies to a range of paragraphs. Also gets a bit mask which indicates which values change over the region, and whose value is therefore indeterminate.

Parameters
aFormatOn return, contains the effective paragraph formatting for the range of paragraphs. For global text, this is the paragraph formatting of the entire text object.
aVariesOn return, a bitmask indicating which paragraph format attributes vary over the range of characters selected. For global text, this mask contains a value of zero for every attribute because formatting is applied globally.
aPosThe document position of the start of the range.
aLengthThe number of characters in the range.
aModeThe default, EAllAttributes means that values for all paragraph format attributes are written to aFormat. EFixedAttributes means that tabs, bullets and borders are not written to aFormat.