Symbian
Symbian OS Library

SYMBIAN OS V9.3

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



Location: TXTFMLYR.H
Link against: etext.lib

Class CCharFormatLayer

class CCharFormatLayer : public CFormatLayer;

Description

Character format layer.

Uses a pointer (stored in its base class CFormatLayer) to another character format layer which may be NULL. This pointer is referred to as the based-on link. A character format layer is owned by an instance of the CGlobalText class and stores the object's global character formatting. Implements persistence and allows attributes to be set and sensed.

Derivation

Members

Defined in CCharFormatLayer:
CloneL(), DoCloneL(), ExternalizeL(), FillCharFormat(), InternalizeL(), IsIdentical(), IsIdentical(), NewL(), NewL(), NewL(), Ptr(), RestoreNewL(), Sense(), SenseEffective(), SetL()

Inherited from CBase:
Delete(), Extension_(), operator new()

Inherited from CFormatLayer:
ChainCount(), ExternalizeChainL(), InternalizeChainL(), IsEmpty(), Reset(), SenseBase(), SetBase(), iBasedOn, iStore


Construction and destruction


NewL()

static IMPORT_C CCharFormatLayer *NewL();

Description

Allocates and constructs an empty CCharFormatLayer. Its based-on link is NULL.

Note: Use SetL() to set format attributes in the layer. Use SetBase(), defined in the base class CFormatLayer, to set the layers based on link.

Return value

CCharFormatLayer *

Pointer to the new character format layer.


NewL()

static IMPORT_C CCharFormatLayer *NewL(const TCharFormat &aFormat, const TCharFormatMask &aMask);

Description

Returns a handle to a new charFormatLayer, after constructing it and setting it with the specified format and format mask.

Parameters

const TCharFormat &aFormat

const TCharFormatMask &aMask

Return value

CCharFormatLayer *


NewL()

static IMPORT_C CCharFormatLayer *NewL(RReadStream &aStream);

Description

Allocates and constructs a CCharFormatLayer, restoring its format attributes from a stream. The layer's based-on link is set to NULL.

Parameters

RReadStream &aStream

Stream from which the layer is restored.

Return value

CCharFormatLayer *

Pointer to the new character format layer.

[Top]


Member functions


InternalizeL()

virtual IMPORT_C void InternalizeL(RReadStream &aStream, const CFormatLayer *aBase=0);

Description

Internalises the character 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 this class. The internalised layer is set to be based on the layer specified.

Parameters

RReadStream &aStream

Stream from which the format layer should be internalised.

const CFormatLayer *aBase

The based-on link to assign to the layer. By default NULL.


ExternalizeL()

virtual IMPORT_C void ExternalizeL(RWriteStream &aStream) const;

Description

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

Parameters

RWriteStream &aStream

Stream to which the format layer should be externalised.


SetL()

IMPORT_C void SetL(const TCharFormat &aCharFormat, const TCharFormatMask &aMask);

Description

Sets the layer's format attributes. The attributes which are set in the mask are set in the layer to the values specified in the format container aCharFormat. The attributes which are not set in the mask are not changed.

Parameters

const TCharFormat &aCharFormat

Contains the attribute values to assign to the format layer.

const TCharFormatMask &aMask

Mask specifying which attributes should be set from aCharFormat.


SenseEffective()

IMPORT_C void SenseEffective(TCharFormat &aCharFormat) const;

Description

Senses the layer's effective format, searching all based-on links. The resulting aCharFormat is fully populated.

Parameters

TCharFormat &aCharFormat

On return, contains the layer's effective formatting.


Sense()

IMPORT_C void Sense(TCharFormat &aCharFormat, TCharFormatMask &aMask) const;

Description

Senses the formatting which has been applied to the current layer only. No based-on links are searched. This function does not get the layer's effective formatting, but the resulting aCharFormat is fully populated, even if not all attributes are flagged for sensing in aMask because any attribute values not sensed from the current layer are set to default values.

Parameters

TCharFormat &aCharFormat

On return, contains the formatting which has been applied to the current layer only. Any attributes not explicitly set in the current layer are set to the default values for a TCharFormat. Any attributes specified in aMask are not sensed from this layer. The values for these attributes are also initialised to the default settings.

TCharFormatMask &aMask

A bitmask. Any attributes which are set in the mask as passed into the function are not sensed from the current layer. On return, indicates the attributes which were sensed from this layer. So, normally, when passed to the function, all attributes in the mask should be unset.


CloneL()

inline CCharFormatLayer *CloneL() const;

Description

Constructs and returns a new CCharFormatLayer with identical formatting to the current layer. Note that the function does not copy the original layer's based-on link - the new layer's based-on link is set to NULL, so that the two layers may not have the same effective formatting.

Return value

CCharFormatLayer *

A new character format layer cloned from the current layer.


IsIdentical()

virtual IMPORT_C TBool IsIdentical(CFormatLayer *aLayer, TBool aCheckBasedOnLink=ETrue) const;

Description

Compares another character format layer with the current layer. 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.

Parameters

CFormatLayer *aLayer

The character format layer to compare to this format layer.

TBool aCheckBasedOnLink

If 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.

Return value

TBool

ETrue if the two layers are identical, otherwise EFalse.


IsIdentical()

IMPORT_C TBool IsIdentical(const TCharFormat &aCharFormat, const TCharFormatMask &aMask) const;

Description

Compares a format attribute container with the current layer. For the two objects to be identical, the current layer must contain only the attributes specified in the argument aMask, and these attributes must have the same values as those in aCharFormat. None of the current layer's based-on links are searched.

Parameters

const TCharFormat &aCharFormat

Contains the attribute values used in the comparison.

const TCharFormatMask &aMask

A bitmask specifying which attributes are relevant to the function.

Return value

TBool

ETrue if the formatting of the current layer exactly matches that contained in aCharFormat, otherwise EFalse.


Ptr()

IMPORT_C const TUint8 *Ptr(TInt &aSize) const;

Description

Gets a pointer to the start of the buffer containing the layer's format attribute values.

Parameters

TInt &aSize

On return, set to the size of the buffer.

Return value

const TUint8 *

Pointer to the buffer which contains the layer's format attribute values.


RestoreNewL()

private: virtual CFormatLayer *RestoreNewL(RReadStream &aStream);

Description

Return a new CCharFormatLayer, having restored it from aStream. Overrides the base class method, to provide a new format layer of the correct type.

Parameters

RReadStream &aStream

Return value

CFormatLayer *


FillCharFormat()

private: virtual void FillCharFormat(TCharFormatX &aCharFormat, TCharFormatXMask &aMask) const;

Description

Fills aCharFormat by dumping the current format layer into it, then follows each 'BasedOn' link in turn if it is not null. It is assumed that all based on links eventually terminate with nulls.

Parameters

TCharFormatX &aCharFormat

TCharFormatXMask &aMask


DoCloneL()

private: virtual IMPORT_C CFormatLayer *DoCloneL() const;

Description

Return value

CFormatLayer *