CParagraphStyle Class Reference

class CParagraphStyle : public CParaFormatLayer

Defines a paragraph style.

A paragraph style is a named paragraph format layer which owns a set of character format attributes, has an outline level and a type UID. The outline level controls which headings should be shown when in document outline view. The type UID is used to differentiate between a word processor's built-in styles, which cannot be deleted, and user-defined styles, which can be deleted.

The style's paragraph format attributes can be set using the functions derived from the base class CParaFormatLayer. Its character format attributes can be set through the owned CCharFormatLayer*. The style's character and paragraph format attributes are based on the global format layers specified on construction.

Inherits from

Public Member Functions
~CParagraphStyle()
CCharFormatLayer *CharFormatLayer()
CParagraphStyle *CloneL()
IMPORT_C CParagraphStyle *NewL(const CParaFormatLayer &, const CCharFormatLayer &)
TInt OutlineLevel()
voidSetOutlineLevel(TInt)
voidSetType(TUid)
IMPORT_C TUidType()
Private Member Functions
CParagraphStyle()
voidConstructL(const CParaFormatLayer &, const CCharFormatLayer &)
IMPORT_C CFormatLayer *DoCloneL()
voidExternalizeL(RWriteStream &)
voidInternalizeL(RReadStream &, const CFormatLayer *, const CFormatLayer *)
CParagraphStyle *NewL(RReadStream &, const CParaFormatLayer &, const CCharFormatLayer &)
Inherited Functions
CBase::CBase()
CBase::Delete(CBase *)
CBase::Extension_(TUint,TAny *&,TAny *)
CBase::operator new(TUint)
CBase::operator new(TUint,TAny *)
CBase::operator new(TUint,TLeave)
CBase::operator new(TUint,TLeave,TUint)
CBase::operator new(TUint,TUint)
CBase::~CBase()
CFormatLayer::CFormatLayer()
CFormatLayer::ChainCount()const
CFormatLayer::CloneLayerL(CFormatLayer *)const
CFormatLayer::ExternalizeChainL(RWriteStream &,TInt)const
CFormatLayer::ExternalizeLayersRecurseL(RWriteStream &,TInt)const
CFormatLayer::InternalizeChainL(RReadStream &,const CFormatLayer *)
CFormatLayer::IsEmpty()const
CFormatLayer::IsIdentical(const TUint8 *,TInt)const
CFormatLayer::Reset()
CFormatLayer::SenseBase()const
CFormatLayer::SetBase(const CFormatLayer *)
CFormatLayer::Swap(CFormatLayer &)
CFormatLayer::~CFormatLayer()
CParaFormatLayer::CParaFormatLayer()
CParaFormatLayer::InternalizeL(RReadStream &,const CFormatLayer *)
CParaFormatLayer::IsIdentical(CFormatLayer *,TBool)const
CParaFormatLayer::IsIdenticalL(const CParaFormat *,const TParaFormatMask &)const
CParaFormatLayer::NewCopyBaseL(const CParaFormatLayer *)
CParaFormatLayer::NewL()
CParaFormatLayer::NewL(RReadStream &)
CParaFormatLayer::NewL(const CParaFormat *,const TParaFormatMask &)
CParaFormatLayer::NewL(const CParaFormatLayer *)
CParaFormatLayer::Ptr(TInt &)const
CParaFormatLayer::RestoreNewL(RReadStream &)
CParaFormatLayer::SenseEffectiveL(CParaFormat *,CParaFormat::TParaFormatGetMode)const
CParaFormatLayer::SenseL(CParaFormat *,TParaFormatMask &,CParaFormat::TParaFormatGetMode)const
CParaFormatLayer::SetL(const CParaFormat *,const TParaFormatMask &)
Public Member Enumerations
enumTApplyParaStyleMode { ERetainAllSpecificFormats, ERetainNoSpecificFormats, ERetainSpecificParaFormat, ERetainSpecificCharFormat }
enumTStylePasteMode { EAddNewStyles, EConvertNewStyles, EIgnoreNewStyles }
Public Attributes
TParagraphStyleName iName
Private Attributes
CCharFormatLayer *iCharFormatLayer
TInt iOutlineLevel
TUid iType
Inherited Attributes
CFormatLayer::__DECLARE_TEST
CFormatLayer::iBasedOn
CFormatLayer::iStore

Constructor & Destructor Documentation

CParagraphStyle()

CParagraphStyle()[private]

~CParagraphStyle()

IMPORT_C~CParagraphStyle()

The destructor frees all resources owned by the object, prior to its destruction.

Member Functions Documentation

CharFormatLayer()

CCharFormatLayer *CharFormatLayer()const [inline]

Gets a pointer to the character format layer owned by the object.

Note

The style's character formatting is set and retrieved using this pointer.

CloneL()

CParagraphStyle *CloneL()const [inline]

Constructs and returns a new CParaFormatLayer 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.

ConstructL(const CParaFormatLayer &, const CCharFormatLayer &)

voidConstructL(const CParaFormatLayer &aGlobalParaFormatLayer,
const CCharFormatLayer &aGlobalCharFormatLayer
)[private]

Parameters

const CParaFormatLayer & aGlobalParaFormatLayer
const CCharFormatLayer & aGlobalCharFormatLayer

DoCloneL()

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

ExternalizeL(RWriteStream &)

voidExternalizeL(RWriteStream &aStream)const [private, virtual]

Externalises the paragraph 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 & aStreamStream to which the format layer should be externalised.

InternalizeL(RReadStream &, const CFormatLayer *, const CFormatLayer *)

voidInternalizeL(RReadStream &aStream,
const CFormatLayer *aParaLayerBase,
const CFormatLayer *aCharLayerBase
)[private, virtual]

Parameters

RReadStream & aStream
const CFormatLayer * aParaLayerBase
const CFormatLayer * aCharLayerBase

NewL(const CParaFormatLayer &, const CCharFormatLayer &)

IMPORT_C CParagraphStyle *NewL(const CParaFormatLayer &aGlobalParaFormatLayer,
const CCharFormatLayer &aGlobalCharFormatLayer
)[static]

Allocates and constructs a CParagraphStyle object whose formatting is based on a global paragraph and character format layer. The type UID is initialised to KUserDefinedParagraphStyleUid. The outline level is not initialised.

Parameters

const CParaFormatLayer & aGlobalParaFormatLayerThe paragraph format layer on which the style's paragraph formatting is based.
const CCharFormatLayer & aGlobalCharFormatLayerThe character format layer on which the style's character formatting is based.

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

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

Parameters

RReadStream & aStream
const CParaFormatLayer & aGlobalParaFormatLayer
const CCharFormatLayer & aGlobalCharFormatLayer

OutlineLevel()

TInt OutlineLevel()const [inline]

Gets the style's outline level.

SetOutlineLevel(TInt)

voidSetOutlineLevel(TIntaOutlineLevel)[inline]

Sets the style's outline level.

Parameters

TInt aOutlineLevelThe style's new outline level.

SetType(TUid)

voidSetType(TUidaType)[inline]

Parameters

TUid aType

Type()

IMPORT_C TUidType()const [virtual]

Gets the style's type UID.

Member Enumerations Documentation

Enum TApplyParaStyleMode

Retention of specific formatting

Enumerators

ERetainAllSpecificFormats

Specific character and paragraph formatting which has been applied to the paragraph is retained when a style is applied. If the style's formatting conflicts with the specific formatting, the specific formatting overrides the style.

ERetainNoSpecificFormats

Specific character and paragraph formatting which has been applied to the paragraph is removed when a style is applied, regardless of whether or not it conflicts with the style.

ERetainSpecificParaFormat

Specific paragraph formatting which has been applied to the paragraph is retained when a style is applied. If the style's formatting conflicts with the specific paragraph formatting, the specific formatting overrides the style.

Specific character formatting which has been applied to the paragraph is removed, regardless of whether or not it conflicts with the style.

ERetainSpecificCharFormat

Specific character formatting which has been applied to the paragraph is retained when a style is applied. If the style's formatting conflicts with the specific character formatting, the specific formatting overrides the style.

Specific paragraph formatting which has been applied to the paragraph is removed, regardless of whether or not it conflicts with the style.

Enum TStylePasteMode

Controls what happens to the styles when styled rich text is pasted into another rich text object.

Enumerators

EAddNewStyles

The pasted rich text retains all formatting and any new style definitions are added to the style list of the rich text object into which it is pasted.

EConvertNewStyles

The pasted rich text retains all formatting, including that specified in the styles, but the new style definitions are not added to the style list of the rich text object into which it is pasted. The formatting specified in the styles becomes specific formatting.

EIgnoreNewStyles

The pasted rich text loses all formatting specified in the styles.

Member Data Documentation

CCharFormatLayer * iCharFormatLayer

CCharFormatLayer *iCharFormatLayer[private]

TParagraphStyleName iName

TParagraphStyleName iName

Unique style name, with a maximum of 32 characters.

TInt iOutlineLevel

TInt iOutlineLevel[private]

TUid iType

TUid iType[private]