Symbian Developer Library

SYMBIAN OS V6.1 EDITION FOR C++

[Index] [Glossary] [Previous] [Next]



Location: txtstyle.h
Link against: etext.lib

Class CParagraphStyle

CParagraphStyle

Support

Supported from 5.0

Description

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

Derivation

CBaseBase class for all classes to be instantiated on the heap
CFormatLayerAbstract base class for the paragraph and character format layers (CParaFormatLayer and CCharFormatLayer)
CParaFormatLayerA paragraph format layer
CParagraphStyleDefines a paragraph style

Defined in CParagraphStyle:
CharFormatLayer(), CloneL(), EAddNewStyles, EConvertNewStyles, EIgnoreNewStyles, ERetainAllSpecificFormats, ERetainNoSpecificFormats, ERetainSpecificCharFormat, ERetainSpecificParaFormat, NewL(), OutlineLevel(), SetOutlineLevel(), SetType(), TApplyParaStyleMode, TStylePasteMode, Type(), iName, ~CParagraphStyle()

Inherited from CBase:
operator new()

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

Inherited from CParaFormatLayer:
ExternalizeL(), InternalizeL(), IsIdentical(), IsIdenticalL(), Ptr(), SenseEffectiveL(), SenseL(), SetL()


Construction and destruction


NewL()

static CParagraphStyle* NewL(const CParaFormatLayer& aGlobalParaFormatLayer,const CCharFormatLayer& aGlobalCharFormatLayer);

Description

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& aGlobalParaFormatLayer

The paragraph format layer on which the style's paragraph formatting is based.

const CCharFormatLayer& aGlobalCharFormatLayer

The character format layer on which the style's character formatting is based.

Return value

CParagraphStyle*

Pointer to the new CParagraphStyle object.


~CParagraphStyle()

~CParagraphStyle();

Description

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

[Top]


Set style information


SetOutlineLevel()

void SetOutlineLevel(TInt aOutlineLevel);

Description

Sets the style’s outline level.

Parameters

TInt aOutlineLevel

The style’s new outline level.


SetType()

void SetType(TUid aType);

Description

Sets the style’s type UID. On construction, the style’s type UID is initialized to KUserDefinedParagraphStyleUid to distinguish it from ordinary paragraph format layers, which have a type of KNormalParagraphStyleUid. This function can be used to change it to another value.

Parameters

TUid aType

The style’s type UID.


CloneL()

CParagraphStyle* CloneL()const;

Description

Creates and returns a CParagraphStyle object which is a clone of the current style.

Return value

CParagraphStyle*

Pointer to a clone of the current style.

[Top]


Get style information


OutlineLevel()

TInt OutlineLevel()const;

Description

Gets the style’s outline level.

Return value

TInt

The style’s outline level.


Type()

virtual TUid Type()const;

Description

Gets the style’s type UID.

Return value

TUid

The style's type UID.


CharFormatLayer()

CCharFormatLayer* CharFormatLayer()const;

Description

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.

Return value

CCharFormatLayer*

Pointer to the style's global character format layer.

[Top]


Enumerations


Enum TApplyParaStyleMode

TApplyParaStyleMode

Description

Retention of specific formatting

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

TStylePasteMode

Description

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

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.

[Top]


Data member


iName

TParagraphStyleName iName

Description

Unique style name, with a maximum of 32 characters.