CFormatLayer Class Reference

class CFormatLayer : public CBase

Abstract base class for the paragraph and character format layers.

A format layer is a set of character or paragraph format attributes which may own a pointer to another format layer. This pointer is called a based-on link. The effective formatting of a text object may be built up from a chain of format layers - the final layer in the chain has a NULL based-on link. In case of conflict, attribute values set in upper layers (layers furthest from the layer with the NULL based-on link) override those set in lower layers. In rich text, additional formatting may be applied on top of these format layers.

The system of based-on links is implemented by the CFormatLayer class. It also implements persistence for chains of format layers.

When setting or sensing the attributes of a CParaFormatLayer or CCharFormatLayer, a format mask and container are specified as parameters. The container has data members for every format attribute, which may be set independently. When setting the layer, the mask indicates the attributes which will be taken from the container. Any attributes not specified in the mask will be taken from the system-provided default values.

When sensing a layer, on return, the mask indicates which attributes have been explicitly set in the layer, (i.e. not taken from the default values). In addition, a layer's effective format may be sensed. In this case, no mask is used because the format container will, on return, contain a value for every attribute.

Inherits from

Constructor & Destructor Documentation

CFormatLayer(const CFormatLayer &)

CFormatLayer(const CFormatLayer &aFormatLayer)[private]

Parameters

const CFormatLayer & aFormatLayer

CFormatLayer()

CFormatLayer()[protected]

~CFormatLayer()

~CFormatLayer()[protected]

Member Functions Documentation

ChainCount()

IMPORT_C TIntChainCount()const

CloneLayerL(CFormatLayer *)

voidCloneLayerL(CFormatLayer *aClone)const [protected]

Parameters

CFormatLayer * aClone

DoCloneL()

CFormatLayer *DoCloneL()const [private, pure virtual]

ExternalizeChainL(RWriteStream &, TInt)

IMPORT_C voidExternalizeChainL(RWriteStream &aStream,
TIntaExcludeCount = 0
)const

Parameters

RWriteStream & aStream
TInt aExcludeCount = 0

ExternalizeL(RWriteStream &)

voidExternalizeL(RWriteStream &aStream)const [pure virtual]

Implementations of this function externalise the format layer but not its based-on link to a write stream. The presence of this function means that the standard templatedoperator<<() (defined in s32strm.h) is available to externalise objects of the derived class.

Parameters

RWriteStream & aStreamStream to which the format layer should be externalised.

ExternalizeLayersRecurseL(RWriteStream &, TInt)

voidExternalizeLayersRecurseL(RWriteStream &aStream,
TIntaDescendantCount
)const [protected]

Parameters

RWriteStream & aStream
TInt aDescendantCount

InternalizeChainL(RReadStream &, const CFormatLayer *)

IMPORT_C voidInternalizeChainL(RReadStream &aStream,
const CFormatLayer *aBase = NULL
)

Parameters

RReadStream & aStream
const CFormatLayer * aBase = NULL

InternalizeL(RReadStream &, const CFormatLayer *)

voidInternalizeL(RReadStream &aStream,
const CFormatLayer *aBase = NULL
)[pure virtual]

Implementations of this function internalise the format layer but not its based-on link from a read stream. The presence of this function means that the standard templated operator>>() (defined in s32strm.h) is available to internalise objects of the derived class. The internalised layer is set to be based on the layer specified.

Parameters

RReadStream & aStreamStream from which the format layer should be internalised.
const CFormatLayer * aBase = NULLThe based-on link to assign to the layer. By default, NULL.

IsEmpty()

IMPORT_C TBoolIsEmpty()const

IsIdentical(CFormatLayer *, TBool)

TBool IsIdentical(CFormatLayer *aLayer,
TBoolaCheckBasedOnLink = ETrue
)const [pure virtual]

Implementations of this function compare another format layer with the current object. For the two layers to be equal, they must have the same contents and (if the second parameter is ETrue), their based-on links must point to the same format layer.

ETrue if the two layers are identical, otherwise EFalse.

Parameters

CFormatLayer * aLayerThe layer to compare to this format layer.
TBool aCheckBasedOnLink = ETrueIf ETrue, both layers' based-on links must point to the same format layer. If EFalse, the based-on links are not used in the comparison. By default, ETrue.

IsIdentical(const TUint8 *, TInt)

TBool IsIdentical(const TUint8 *aPtr,
TIntaSize
)const [protected]

Parameters

const TUint8 * aPtr
TInt aSize

Ptr(TInt &)

const TUint8 *Ptr(TInt &aSize)const [protected]

Parameters

TInt & aSize

Reset()

IMPORT_C voidReset()

RestoreNewL(RReadStream &)

CFormatLayer *RestoreNewL(RReadStream &aStream)[protected, pure virtual]

Parameters

RReadStream & aStream

SenseBase()

IMPORT_C const CFormatLayer *SenseBase()const

SetBase(const CFormatLayer *)

IMPORT_C voidSetBase(const CFormatLayer *aBaseFormatLayer)

Parameters

const CFormatLayer * aBaseFormatLayer

Swap(CFormatLayer &)

voidSwap(CFormatLayer &aLayer)

Parameters

CFormatLayer & aLayer

operator=(const CFormatLayer &)

CFormatLayer &operator=(const CFormatLayer &aFormatLayer)[private]

Parameters

const CFormatLayer & aFormatLayer

Member Data Documentation

__DECLARE_TEST

__DECLARE_TEST[protected]

const CFormatLayer * iBasedOn

const CFormatLayer *iBasedOn[protected]

RFormatStream iStore

RFormatStream iStore[protected]