CStyleList Class Reference

class CStyleList : public CBase

A container of paragraph styles.

It is implemented as a fixed length array of pointers to RParagraphStyleInfos. The array's granularity is specified on construction. The list takes ownership of all paragraph styles appended to it. When the list is deleted, all styles it owns are also deleted.

After the style list has been set up, it should normally be passed to a CRichText object, either in the rich text object's constructor, or by calling CRichText::SetStyleListExternallyOwned(). The rich text object takes ownership of the style list (unless SetStyleListExternallyOwned() is used). Styles can be modified, added to and removed from the style list after ownership of the list has been passed to the rich text object.

If CRichText::SetStyleListExternallyOwned() is used, the style list is not owned by the rich text object, and it must be stored and restored separately from the rich text object.

Inherits from

Constructor & Destructor Documentation

CStyleList()

IMPORT_CCStyleList()[protected]

~CStyleList()

IMPORT_C~CStyleList()

Member Functions Documentation

AppendL(RParagraphStyleInfo *)

IMPORT_C TIntAppendL(RParagraphStyleInfo *aStyleSet)

Parameters

RParagraphStyleInfo * aStyleSet

At(TInt)

IMPORT_C const RParagraphStyleInfo &At(TIntaIndex)const

Parameters

TInt aIndex

At(TInt)

IMPORT_C RParagraphStyleInfo &At(TIntaIndex)

Parameters

TInt aIndex

ConstructL(TInt)

IMPORT_C voidConstructL(TIntaGranularity)[protected]

Parameters

TInt aGranularity

Count()

TInt Count()const [inline]

Gets the number of styles in the style list.

The number of styles in the style list

DeepCloneL()

IMPORT_C CStyleList *DeepCloneL()const

ExternalizeL(RWriteStream &)

IMPORT_C voidExternalizeL(RWriteStream &aStream)const

Parameters

RWriteStream & aStream

IndexByName(const TDesC &)

IMPORT_C TIntIndexByName(const TDesC &aName)const

Parameters

const TDesC & aName

IndexByPtr(const CParaFormatLayer *)

IMPORT_C TIntIndexByPtr(const CParaFormatLayer *aPtr)const

Parameters

const CParaFormatLayer * aPtr

InternalizeL(RReadStream &, const CParaFormatLayer *, const CCharFormatLayer *)

IMPORT_C voidInternalizeL(RReadStream &aStream,
const CParaFormatLayer *aGlobalParaFormatLayer,
const CCharFormatLayer *aGlobalCharFormatLayer
)

Parameters

RReadStream & aStream
const CParaFormatLayer * aGlobalParaFormatLayer
const CCharFormatLayer * aGlobalCharFormatLayer

KillStyleList()

voidKillStyleList()[private]

NewL(TInt)

IMPORT_C CStyleList *NewL(TIntaCapacity =  KMaxStyleListGranularity )[static]

Parameters

TInt aCapacity =  KMaxStyleListGranularity

NewL(RReadStream &, const CParaFormatLayer *, const CCharFormatLayer *)

IMPORT_C CStyleList *NewL(RReadStream &aStream,
const CParaFormatLayer *aGlobalParaFormatLayer,
const CCharFormatLayer *aGlobalCharFormatLayer
)[static]

Parameters

RReadStream & aStream
const CParaFormatLayer * aGlobalParaFormatLayer
const CCharFormatLayer * aGlobalCharFormatLayer

PtrByName(const TParagraphStyleName &)

IMPORT_C RParagraphStyleInfo *PtrByName(const TParagraphStyleName &aName)const

Parameters

const TParagraphStyleName & aName

PtrByType(const TUid)

IMPORT_C RParagraphStyleInfo *PtrByType(const TUidaType)const

Parameters

const TUid aType

Remove(CParagraphStyle *)

IMPORT_C voidRemove(CParagraphStyle *aStyle)

Parameters

CParagraphStyle * aStyle

Reset()

IMPORT_C voidReset()

SetStyleToFollow(const RParagraphStyleInfo &)

IMPORT_C TIntSetStyleToFollow(const RParagraphStyleInfo &aStyleSet)

Parameters

const RParagraphStyleInfo & aStyleSet

StoreL(CStreamStore &)

IMPORT_C TStreamIdStoreL(CStreamStore &aStore)const

Parameters

CStreamStore & aStore

operator[](TInt)

const RParagraphStyleInfo &operator[](TIntaIndex)const [inline]

Gets a style from the style list, from its index into the array. Two versions are supplied. The compiler chooses the appropriate version based on the use made of the returned reference. If it is used in an expression where the reference can be modified, then the non-const version is chosen.

A const reference to the style at position aIndex in the array.

A non-const reference to the style at position aIndex in the array. Gets a style from the style list, from its index into the array. Two versions are supplied. The compiler chooses the appropriate version based on the use made of the returned reference. If it is used in an expression where the reference can be modified, then the non-const version is chosen.

A const reference to the style at position aIndex in the array.

A non-const reference to the style at position aIndex in the array.

Parameters

TInt aIndexThe index of the style into the list. The first style is at position zero. Must be within the bounds of the array or a panic occurs.

operator[](TInt)

RParagraphStyleInfo &operator[](TIntaIndex)[inline]

Parameters

TInt aIndex

Member Data Documentation

__DECLARE_TEST

__DECLARE_TEST[private]

CArrayFixFlat< RParagraphStyleInfo > * iList

CArrayFixFlat< RParagraphStyleInfo > *iList[private]