CRichText Class Reference

class CRichText : public CGlobalText

Text with rich formatting.

In rich text, each paragraph can have a different paragraph format, and each character can have a different character format.

All formatting in a rich text object is based on a global character and paragraph format layer, and a chain of layers on which they may be based. In case of conflict, upper layers override lower layers. These two format layers are specified on construction, and are not owned by the text object. Additional formatting may then be added to any portion of the text. This is called specific formatting and in case of conflict, it overrides the formatting in the global layers. Specific formatting is owned by the text object. So, the effective formatting of a rich text object may be composed of specific formatting and formatting specified in a chain of format layers.

Rich text supports styles. A style is a named set of paragraph and character format attributes. Styles are stored in a list which is passed to the rich text object on construction, or which is assigned to the object after construction. Styles can be appended to and removed from the list and existing styles can be modified. Only paragraph styles are supported. This means that styles are applied to entire paragraphs, although both character and paragraph format attributes may be set in the style.

Rich text also supports object embedding. Embedded objects are represented in rich text by CPicture-derived objects. A rich text object which supports the display of pictures needs to be supplied with a picture factory.

CParagraphStyle

Public Member Functions
~CRichText()
IMPORT_C voidActivateParserL(MParser *)
IMPORT_C voidAppendTakingSolePictureOwnershipL(const CRichText &)
IMPORT_C voidApplyCharFormatL(const TCharFormat &, const TCharFormatMask &, TInt, TInt)
voidApplyExtendedCharFormatL(const TCharFormatX &, const TCharFormatXMask &, TInt, TInt)
IMPORT_C voidApplyParagraphStyleL(const CParagraphStyle &, TInt, TInt, CParagraphStyle::TApplyParaStyleMode)
IMPORT_C voidCancelInsertCharFormat()
IMPORT_C TEtextComponentInfoComponentInfo()
IMPORT_C voidCopyToStoreL(CStreamStore &, CStreamDictionary &, TInt, TInt)
IMPORT_C TBoolCursorOverTag(TInt, MParser *&, TInt &, TInt &)
IMPORT_C voidDeactivateParser(MParser *)
IMPORT_C voidDeactivateParserDefaults()
IMPORT_C TBoolDelSetInsertCharFormatL(TInt, TInt)
IMPORT_C voidDeleteFromParagraph(TInt, TInt)
IMPORT_C TBoolDeleteL(TInt, TInt)
IMPORT_C voidDeleteParagraph(TInt, TInt)
IMPORT_C voidDetachFromStoreL(CPicture::TDetach)
IMPORT_C voidDropPictureOwnership(TInt)
IMPORT_C voidExtendedInterface(TAny *&, TUid)
IMPORT_C voidExternalizeStyleDataL(RWriteStream &)
IMPORT_C voidGetCharFormat(TCharFormat &, TCharFormatMask &, TInt, TInt)
voidGetExtendedCharFormat(TCharFormatX &, TCharFormatXMask &, TInt, TInt)
IMPORT_C voidGetParaFormatL(CParaFormat *, TParaFormatMask &, TInt, TInt, CParaFormat::TParaFormatGetMode)
IMPORT_C voidGetParagraphFormatL(CParaFormat *, TInt)
IMPORT_C TIntGetPictureSizeInTwips(TSize &, TInt)
IMPORT_C voidGetSpecificCharFormat(TCharFormat &, TCharFormatMask &, TInt)
IMPORT_C voidGetSpecificCharFormatRight(TCharFormat &, TCharFormatMask &, TInt)
IMPORT_C voidGetSpecificParagraphFormatL(CParaFormat *, TParaFormatMask &, TInt)
voidGetTextAndExtendedFormat(TPtrC &, TCharFormatX &, TInt)
IMPORT_C TBoolHasMarkupData()
IMPORT_C voidInsertL(TInt, const TChar &)
IMPORT_C voidInsertL(TInt, const TDesC &)
IMPORT_C voidInsertL(TInt, const TPictureHeader &)
IMPORT_C voidInternalizeL(RReadStream &)
IMPORT_C voidInternalizeMarkupDataL(RReadStream &)
IMPORT_C voidInternalizeStyleDataL(RReadStream &)
IMPORT_C CRichText *NewL(const CParaFormatLayer *, const CCharFormatLayer *, TDocumentStorage, TInt, TParaType)
IMPORT_C CRichText *NewL(const CParaFormatLayer *, const CCharFormatLayer *, const CStyleList &, TDocumentStorage, TInt, TParaType)
IMPORT_C CRichText *NewL(const CStreamStore &, TStreamId, const CParaFormatLayer *, const CCharFormatLayer *, MTextFieldFactory *, TDocumentStorage)
IMPORT_C CRichText *NewL(const CStreamStore &, TStreamId, const CParaFormatLayer *, const CCharFormatLayer *, MPictureFactory *, MRichTextStoreResolver *, MTextFieldFactory *, TDocumentStorage)
voidNotifyStyleDeletedL(const CParagraphStyle *)
IMPORT_C TIntParagraphCount()
IMPORT_C TIntParagraphNumberForPos(TInt &)
IMPORT_C const CParaFormatLayer *ParagraphStyle(TBool &, TInt, TInt)
IMPORT_C TBoolParseText(TInt &, TInt &, TBool)
IMPORT_C TIntPasteFromStoreL(const CStreamStore &, const CStreamDictionary &, TInt)
IMPORT_C TIntPasteFromStoreL(const CStreamStore &, const CStreamDictionary &, TInt, CParagraphStyle::TStylePasteMode)
IMPORT_C TIntPictureCount()
IMPORT_C CPicture *PictureHandleL(TInt, MLayDoc::TForcePictureLoad)
IMPORT_C TPictureHeaderPictureHeader(TInt)
IMPORT_C TIntPositionOfNextTag(TInt)
IMPORT_C TIntPositionOfNextTag(TInt, const MParser *)
IMPORT_C TIntPositionOfPrevTag(TInt)
IMPORT_C TIntPositionOfPrevTag(TInt, const MParser *)
IMPORT_C voidRemoveSpecificCharFormatL(TInt, TInt)
IMPORT_C voidRemoveSpecificParaFormatL(TInt, TInt)
IMPORT_C voidReset()
IMPORT_C voidRestoreComponentsL(const CStreamStore &)
IMPORT_C voidRestoreWithStyleListL(const CStreamStore &, TStreamId, const CStyleList &)
IMPORT_C voidSetEditObserver(MEditObserver *)
IMPORT_C voidSetHasChanged(TBool)
IMPORT_C voidSetInsertCharFormatL(const TCharFormat &, const TCharFormatMask &, TInt)
IMPORT_C voidSetPictureFactory(MPictureFactory *, MRichTextStoreResolver *)
voidSetStyleListExternallyOwned(TBool)
IMPORT_C voidStoreComponentsL(CStreamStore &, CStoreMap &)
IMPORT_C voidStoreMarkupComponentsL(CStreamStore &, CStoreMap &)
MRichTextStoreResolver *StoreResolver()
TInt StyleCount()
CStyleList *StyleList()
TBool StyleListExternallyOwned()
TBool StyleListPresent()
IMPORT_C voidUpdateFieldL(TInt)
Protected Member Functions
CRichText(const CParaFormatLayer *, const CCharFormatLayer *, CStyleList *)
IMPORT_C voidConstructL(TDocumentStorage, TInt, TParaType)
IMPORT_C voidConstructL(const CStreamStore &, TStreamId, MPictureFactory *, MRichTextStoreResolver *, MTextFieldFactory *, TDocumentStorage)
IMPORT_C voidCopyToStreamL(RWriteStream &, TInt, TInt, TStreamId)
IMPORT_C voidCopyToStreamL(RWriteStream &, TInt, TInt)
voidDoAppendTakingSolePictureOwnershipL(const CRichText &)
TStreamId DoCopyToStoreL(CStreamStore &, TInt, TInt, TStreamId, TBool)
IMPORT_C voidDoInternalizeMarkupDataL(RReadStream &)
IMPORT_C voidDoInternalizeStyleDataL(RReadStream &)
voidDoInternalizeStyleDataL(RReadStream &, const CStyleList *)
voidInternalizeL(RReadStream &, const CStyleList *)
TInt PastePlainTextFromStoreL(const CStreamStore &, TStreamId &, TInt)
TInt PasteRichTextFromStoreL(const CStreamStore &, const CStreamDictionary &, TStreamId &, TInt, CParagraphStyle::TStylePasteMode)
voidPrepareAppendMarkupL(const CRichText &)
IMPORT_C voidRtInsertL(TInt, const TDesC &)
voidStoreMarkupL(CStreamStore &, CStoreMap &)
voidStoreStylesL(CStreamStore &, CStoreMap &)
Private Member Functions
CRichText(const CRichText &)
voidCallEditObserver(TInt, TInt)
TBool CreateEmptyMarkupComponentL()
voidCreateParserETextTLSL()
voidDoApplyExtendedCharFormatL(const TCharFormatX &, const TCharFormatXMask &, TInt, TInt)
TBool DoCursorOverTag(TInt, MParser *&, TInt &, TInt &)
TInt DoPasteRtFromStoreL(const CStreamStore &, const CStreamDictionary &, TInt, CParagraphStyle::TStylePasteMode)
voidGenerateMarkupL()
voidGetSpecificCharFormatLeftRight(TCharFormat &, TCharFormatMask &, TInt, TBool)
TBool IndexPresent()
voidKillIndex()
voidKillStyleList()
voidOverrideFormatForParsersIfApplicable(TPtrC &, TCharFormatX &, TInt)
voidSetExtendedInsertCharFormatL(const TCharFormatX &, const TCharFormatXMask &, TInt)
voidSetParaTypeIsSingle(TBool)
CRichText &operator=(const CRichText &)
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()
CEditableText::CancelFepInlineEdit(TBool &,TInt &,TInt &,TInt &,TInt)
CEditableText::CommitFepInlineEditL(TBool &,TInt &,TInt &,TInt &,TInt)
CEditableText::GetLengthOfInlineText()const
CEditableText::GetPositionOfInlineTextInDocument()const
CEditableText::HasChanged()const
CEditableText::OverrideFormatOfInlineTextIfApplicable(TPtrC &,TCharFormat &,TInt)const
CEditableText::RestoreL(const CStreamStore &,TStreamId)
CEditableText::StartFepInlineEditL(TBool &,TInt &,TInt &,TInt &,TInt,const TDesC &,TInt,TInt,MFepInlineTextFormatRetriever &)
CEditableText::StoreL(CStreamStore &)const
CEditableText::UpdateFepInlineTextL(TBool &,TInt &,TInt &,TInt &,TInt,const TDesC &)
CEditableText::~CEditableText()
CGlobalText::CGlobalText()
CGlobalText::CGlobalText(const CParaFormatLayer *,const CCharFormatLayer *)
CGlobalText::CancelSelectLabel()
CGlobalText::EnquirePageBreak(TInt,TInt)const
CGlobalText::GlobalCharFormatLayer()const
CGlobalText::GlobalParaFormatLayer()const
CGlobalText::LdDocumentLength()const
CGlobalText::LdToParagraphStart(TInt &)const
CGlobalText::NewL(const CParaFormatLayer *,const CCharFormatLayer *,TDocumentStorage,TInt)
CGlobalText::SelectParagraphLabel(TInt)
CGlobalText::SetGlobalCharFormat(const CCharFormatLayer *)
CGlobalText::SetGlobalParaFormat(const CParaFormatLayer *)
CGlobalText::~CGlobalText()
CPlainText::CPlainText()
CPlainText::ConstructL(TDocumentStorage,TInt)
CPlainText::ConstructL(const CStreamStore &,TStreamId,MTextFieldFactory *,TDocumentStorage)
CPlainText::ConsumeAdornmentL(RReadStream &)
CPlainText::ConvertAllFieldsToText()
CPlainText::ConvertFieldToText(TInt)
CPlainText::CopyComponentsL(CStreamStore &,CStoreMap &,TInt,TInt)const
CPlainText::Delete(TInt,TInt)
CPlainText::DoConstructL(TDocumentStorage,TInt,MTextFieldFactory *)
CPlainText::DoCopyToStoreL(CStreamStore &,CStreamDictionary &,TInt,TInt)const
CPlainText::DoExternalizeFieldDataL(RWriteStream &)const
CPlainText::DoExternalizePlainTextL(RWriteStream &)const
CPlainText::DoExtract(TDes &,TInt,TInt,TUint)const
CPlainText::DoInternalizeFieldDataL(RReadStream &)
CPlainText::DoInternalizePlainTextL(RReadStream &)
CPlainText::DoPasteFromStoreL(const CStreamStore &,TStreamId,TInt)
CPlainText::DoPtDelete(TInt,TInt)
CPlainText::DoPtInsertL(TInt,const TDesC &)
CPlainText::DocumentLength()const
CPlainText::ExportAsTextL(const TDes &,TTextOrganisation,TInt)const
CPlainText::ExportTextL(TInt,RWriteStream &,TTextOrganisation,TInt,TInt,TInt,TInt *,TInt *)const
CPlainText::ExportTextL(TInt,RWriteStream &,const TImportExportParam &,TImportExportResult &)const
CPlainText::ExternalizeFieldDataL(RWriteStream &)const
CPlainText::ExternalizePlainTextL(RWriteStream &)const
CPlainText::ExternalizePlainTextNoLengthCountL(RWriteStream &)const
CPlainText::Extract(TDes &,TInt)const
CPlainText::Extract(TDes &,TInt,TInt)const
CPlainText::ExtractSelectively(TDes &,TInt,TInt,TUint)
CPlainText::FieldCount()const
CPlainText::FieldFactory()const
CPlainText::FindFields(TFindFieldInfo &,TInt,TInt)const
CPlainText::FindFields(TInt)const
CPlainText::GetWordInfo(TInt,TInt &,TInt &,TBool,TBool)const
CPlainText::ImportTextFileL(TInt,const TDes &,TTextOrganisation)
CPlainText::ImportTextL(TInt,RReadStream &,TTextOrganisation,TInt,TInt,TInt *,TInt *)
CPlainText::ImportTextL(TInt,RReadStream &,const TImportExportParam &,TImportExportResult &)
CPlainText::InsertFieldL(TInt,CTextField *,TUid)
CPlainText::InsertL(TInt,const CPlainText *)
CPlainText::InternalizeFieldDataL(RReadStream &)
CPlainText::InternalizePlainTextL(RReadStream &)
CPlainText::InternalizePlainTextL(RReadStream &,TInt)
CPlainText::NewL(TDocumentStorage,TInt)
CPlainText::NewL(const CStreamStore &,TStreamId,MTextFieldFactory *,TDocumentStorage)
CPlainText::NewTextFieldL(TUid)const
CPlainText::PageContainingPos(TInt)const
CPlainText::PasteComponentsL(const CStreamStore &,TInt)
CPlainText::PtInsertL(TInt,const TDesC &)
CPlainText::Read(TInt)const
CPlainText::Read(TInt,TInt)const
CPlainText::RemoveField(TInt)
CPlainText::RestoreFieldComponentsL(const CStreamStore &)
CPlainText::ScanParas(TInt &,TUint &)const
CPlainText::ScanWords(TInt &,TUint &)const
CPlainText::SetFieldFactory(MTextFieldFactory *)
CPlainText::SetPageTable(TPageTable *)
CPlainText::StoreFieldComponentsL(CStreamStore &,CStoreMap &)const
CPlainText::TextField(TInt)const
CPlainText::ToParagraphStart(TInt &)const
CPlainText::UidFromStreamL(RReadStream &)
CPlainText::UpdateAllFieldsL()
CPlainText::WordCount()const
CPlainText::~CPlainText()
Public Member Enumerations
enumTParaType { ESinglePara, EMultiPara }
Protected Member Enumerations
enumanonymous { EDelimiterCharacterLength = 1 }
Inherited Enumerations
CEditableText:@49
CEditableText:@50
CEditableText:TDocumentStorage
CPlainText:@51
CPlainText:@52
CPlainText:@53
CPlainText:TScanDataEnd
CPlainText:TTextOrganisation
CPlainText:TUnitOfText
Private Attributes
__DECLARE_TEST
TUint32 iFlags
TSwizzle< CRichTextIndex >iIndex
CParserData *iParserData
MPictureFactory *iPictureFactory
void *iReserved_3
MRichTextStoreResolver *iStoreResolver
TSwizzle< CStyleList >iStyleList
Inherited Attributes
CEditableText::iHasChanged
CGlobalText::iGlobalCharFormatLayer
CGlobalText::iGlobalParaFormatLayer
CPlainText::iByteStore
CPlainText::iFieldFactory
CPlainText::iFieldSet
CPlainText::iPageTable

Constructor & Destructor Documentation

CRichText(const CRichText &)

CRichText(const CRichText &aRichText)[private]

Parameters

const CRichText & aRichText

CRichText(const CParaFormatLayer *, const CCharFormatLayer *, CStyleList *)

IMPORT_CCRichText(const CParaFormatLayer *aGlobalParaLayer,
const CCharFormatLayer *aGlobalCharLayer,
CStyleList *aStyleList = NULL
)[protected]

Parameters

const CParaFormatLayer * aGlobalParaLayer
const CCharFormatLayer * aGlobalCharLayer
CStyleList * aStyleList = NULL

~CRichText()

IMPORT_C~CRichText()[virtual]

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

Member Functions Documentation

ActivateParserL(MParser *)

IMPORT_C voidActivateParserL(MParser *aParser)[static]

Parameters

MParser * aParser

AppendTakingSolePictureOwnershipL(const CRichText &)

IMPORT_C voidAppendTakingSolePictureOwnershipL(const CRichText &aSource)

Appends a rich text object to this one. The text is appended immediately after the end-of-text paragraph delimiter. The incoming text's formatting is set to be based on the global formatting of this rich text object.

Notes:

If this rich text object is empty (e.g. because it is newly initialised, or has been reset), then the end-of-text delimiter of the incoming rich text is not appended. This avoids the possibility of having a trailing paragraph delimiter, giving one more empty line than would typically be desired.

If the incoming rich text contains pictures which have been loaded into memory, their sole ownership is transferred to the current rich text object. In aSource, these picture handles are set to NULL.

Parameters

const CRichText & aSourceThe rich text object to append.

ApplyCharFormatL(const TCharFormat &, const TCharFormatMask &, TInt, TInt)

IMPORT_C voidApplyCharFormatL(const TCharFormat &aFormat,
const TCharFormatMask &aMask,
TIntaPos,
TIntaLength
)[virtual]

Changes the text object's character formatting. The attributes which are set in the mask are read from aFormat into the text object's character format layer. The attributes which are not set in the mask are not changed. Note that the position and length arguments are only used in the rich text implementation of this function.

Parameters

const TCharFormat & aFormatContains the character format attribute values to apply.
const TCharFormatMask & aMaskBitmask specifying the character format attributes to change.
TInt aPosThis argument is not used for global text.
TInt aLengthThis argument is not used for global text.

ApplyExtendedCharFormatL(const TCharFormatX &, const TCharFormatXMask &, TInt, TInt)

voidApplyExtendedCharFormatL(const TCharFormatX &aFormat,
const TCharFormatXMask &aMask,
TIntaPos,
TIntaLength
)

Parameters

const TCharFormatX & aFormat
const TCharFormatXMask & aMask
TInt aPos
TInt aLength

ApplyParagraphStyleL(const CParagraphStyle &, TInt, TInt, CParagraphStyle::TApplyParaStyleMode)

IMPORT_C voidApplyParagraphStyleL(const CParagraphStyle &aStyle,
TIntaPos,
TIntaLength,
CParagraphStyle::TApplyParaStyleModeaMode
)

Applies a specified paragraph style to a range of paragraphs. The region affected consists of every paragraph containing one or more characters in the range aPos to aPos+(aLength-1).

A panic occurs if:

aPos is invalid, or

aLength is negative, or

the range goes beyond the end of the document, or

the rich text object has no style list

Parameters

const CParagraphStyle & aStyleThe style to apply.
TInt aPosThe document position of the start of the range.
TInt aLengthThe number of characters in the range.
CParagraphStyle::TApplyParaStyleMode aModeControls what specific formatting, if any, should be preserved when the style is applied.

CallEditObserver(TInt, TInt)

voidCallEditObserver(TIntaStart,
TIntaExtent
)const [private]

Parameters

TInt aStart
TInt aExtent

CancelInsertCharFormat()

IMPORT_C voidCancelInsertCharFormat()

Cancels the "insert pending" state set by a call to SetInsertCharFormatL() or DelSetInsertCharFormatL().

This function removes the restriction on the text insertion position imposed by these two functions. It is recommended that it is called before every cursor movement, scroll, paste, etc. This call is a small overhead, and has no effect if not applicable.

ComponentInfo()

IMPORT_C TEtextComponentInfoComponentInfo()const [virtual]

Gets information about the number of components contained in the text object. For plain text, only the field count has relevance.

ConstructL(TDocumentStorage, TInt, TParaType)

IMPORT_C voidConstructL(TDocumentStorageaStorage,
TIntaDefaultTextGranularity,
TParaTypeaParaType
)[protected]

Parameters

TDocumentStorage aStorage
TInt aDefaultTextGranularity
TParaType aParaType

ConstructL(const CStreamStore &, TStreamId, MPictureFactory *, MRichTextStoreResolver *, MTextFieldFactory *, TDocumentStorage)

IMPORT_C voidConstructL(const CStreamStore &aStore,
TStreamIdaStreamId,
MPictureFactory *aFactory,
MRichTextStoreResolver *aStoreResolver,
MTextFieldFactory *aFieldFactory = NULL,
TDocumentStorageaStorage = ESegmentedStorage
)[protected]

Parameters

const CStreamStore & aStore
TStreamId aStreamId
MPictureFactory * aFactory
MRichTextStoreResolver * aStoreResolver
MTextFieldFactory * aFieldFactory = NULL
TDocumentStorage aStorage = ESegmentedStorage

CopyToStoreL(CStreamStore &, CStreamDictionary &, TInt, TInt)

IMPORT_C voidCopyToStoreL(CStreamStore &aStore,
CStreamDictionary &aDictionary,
TIntaPos,
TIntaLength
)const [virtual]

Copies a portion of the rich text object, with components to the clipboard.

A panic occurs in the following circumstances:

aPos is an invalid document position

aLength is invalid (zero or less)

the sum of aPos and aLength is greater than or equal to the number of characters in the document

Parameters

CStreamStore & aStoreStream store to which the rich text is written.
CStreamDictionary & aDictionaryThe stream dictionary.
TInt aPosThe document position from which to begin copying.
TInt aLengthThe number of characters to copy.

CopyToStreamL(RWriteStream &, TInt, TInt, TStreamId)

IMPORT_C voidCopyToStreamL(RWriteStream &aStream,
TIntaPos,
TIntaLength,
TStreamIdaGlobalTextId
)const [protected]

Parameters

RWriteStream & aStream
TInt aPos
TInt aLength
TStreamId aGlobalTextId

CopyToStreamL(RWriteStream &, TInt, TInt)

IMPORT_C voidCopyToStreamL(RWriteStream &aStream,
TIntaPos,
TIntaLength
)const [protected]

Parameters

RWriteStream & aStream
TInt aPos
TInt aLength

CreateEmptyMarkupComponentL()

TBool CreateEmptyMarkupComponentL()[private]

CreateParserETextTLSL()

voidCreateParserETextTLSL()[private, static]

CursorOverTag(TInt, MParser *&, TInt &, TInt &)

IMPORT_C TBoolCursorOverTag(TIntaPos,
MParser *&aParser,
TInt &aTagStart,
TInt &aLength
)const

Parameters

TInt aPos
MParser *& aParser
TInt & aTagStart
TInt & aLength

DeactivateParser(MParser *)

IMPORT_C voidDeactivateParser(MParser *aParser)[static]

Parameters

MParser * aParser

DeactivateParserDefaults()

IMPORT_C voidDeactivateParserDefaults()[static]

DelSetInsertCharFormatL(TInt, TInt)

IMPORT_C TBoolDelSetInsertCharFormatL(TIntaPos,
TIntaLength
)

Deletes a range of characters. The range affected is from aPos to aPos+(aLength-1) inclusive. It differs from DeleteL() in that this function preserves the formatting of the deleted character at position aPos, so that any text subsequently inserted at aPos will have that formatting applied to it.

A panic occurs if:

after calling this function, text is inserted at a different position to aPos, without calling CancelInsertCharFormat() before the insertion

aPos is invalid

aLength is negative

the range goes beyond the end of the document

Parameters

TInt aPosThe document position of the first character to delete.
TInt aLengthThe number of characters to delete.

DeleteFromParagraph(TInt, TInt)

IMPORT_C voidDeleteFromParagraph(TIntaPos,
TIntaLength
)

Removes a range of characters from within a single paragraph only. Should not be used for deleting an entire paragraph or paragraphs because this may cause it to leave. Otherwise, it is guaranteed not to leave.

Parameters

TInt aPosThe document position of the start of the range of characters to delete. Must be a valid document position, or a panic occurs.
TInt aLengthThe number of characters to delete. The sum of aPos and aLength must be less than the document length, or a panic occurs.

DeleteL(TInt, TInt)

IMPORT_C TBoolDeleteL(TIntaPos,
TIntaLength
)[virtual]

Deletes one or more characters beginning at, and including, the character at a specified document position. Can leave because paragraphs may be merged and reformatted by the function.

Parameters

TInt aPosThe start of the range of characters to delete. Must be valid or a panic occurs.
TInt aLengthThe number of characters to delete. Must be positive or a panic occurs. The sum of aPos and aLength must be less than the document length, or a panic occurs.

DeleteParagraph(TInt, TInt)

IMPORT_C voidDeleteParagraph(TIntaPos,
TIntaLength
)

Deletes one or more whole paragraphs of text. No paragraphs can be merged together by this function, so it cannot leave it must only be used to delete entire paragraphs.

Parameters

TInt aPosThe document position of the start of the first paragraph to delete. Must be a valid position or a panic occurs.
TInt aLengthThe number of characters to delete.

DetachFromStoreL(CPicture::TDetach)

IMPORT_C voidDetachFromStoreL(CPicture::TDetachaDegree)

Parameters

CPicture::TDetach aDegree

DoAppendTakingSolePictureOwnershipL(const CRichText &)

voidDoAppendTakingSolePictureOwnershipL(const CRichText &aSource)[protected]

Parameters

const CRichText & aSource

DoApplyExtendedCharFormatL(const TCharFormatX &, const TCharFormatXMask &, TInt, TInt)

voidDoApplyExtendedCharFormatL(const TCharFormatX &aFormat,
const TCharFormatXMask &aMask,
TIntaPos,
TIntaLength
)[private]

Parameters

const TCharFormatX & aFormat
const TCharFormatXMask & aMask
TInt aPos
TInt aLength

DoCopyToStoreL(CStreamStore &, TInt, TInt, TStreamId, TBool)

TStreamId DoCopyToStoreL(CStreamStore &aStore,
TIntaPos,
TIntaLength,
TStreamIdaGlobalTextId,
TBoolaCopyStyles
)const [protected]

Parameters

CStreamStore & aStore
TInt aPos
TInt aLength
TStreamId aGlobalTextId
TBool aCopyStyles

DoCursorOverTag(TInt, MParser *&, TInt &, TInt &)

TBool DoCursorOverTag(TIntaPos,
MParser *&aParser,
TInt &aTagStart,
TInt &aLength
)const [private]

Parameters

TInt aPos
MParser *& aParser
TInt & aTagStart
TInt & aLength

DoInternalizeMarkupDataL(RReadStream &)

IMPORT_C voidDoInternalizeMarkupDataL(RReadStream &aStream)[protected]

Parameters

RReadStream & aStream

DoInternalizeStyleDataL(RReadStream &)

IMPORT_C voidDoInternalizeStyleDataL(RReadStream &aStream)[protected]

Parameters

RReadStream & aStream

DoInternalizeStyleDataL(RReadStream &, const CStyleList *)

voidDoInternalizeStyleDataL(RReadStream &aStream,
const CStyleList *aExternalStyleList
)[protected]

Parameters

RReadStream & aStream
const CStyleList * aExternalStyleList

DoPasteRtFromStoreL(const CStreamStore &, const CStreamDictionary &, TInt, CParagraphStyle::TStylePasteMode)

TInt DoPasteRtFromStoreL(const CStreamStore &aStore,
const CStreamDictionary &aDictionary,
TIntaPos,
CParagraphStyle::TStylePasteModeaStylePasteMode
)[private]

Parameters

const CStreamStore & aStore
const CStreamDictionary & aDictionary
TInt aPos
CParagraphStyle::TStylePasteMode aStylePasteMode

DropPictureOwnership(TInt)

IMPORT_C voidDropPictureOwnership(TIntaPos)

Parameters

TInt aPos

ExtendedInterface(TAny *&, TUid)

IMPORT_C voidExtendedInterface(TAny *&aInterface,
TUidaInterfaceId
)[virtual]

Returns the interface corresponding to the specified UID if it exists, or 0 if not. Overridden versions should base call rather than returning 0. For KUidRichText, CRichText will be returned if rich text is supported.

Parameters

TAny *& aInterfaceThe interface corresponding to aInterfaceId if it is supported, or 0 if it is not
TUid aInterfaceIdThe UID indicating the interface to return

ExternalizeStyleDataL(RWriteStream &)

IMPORT_C voidExternalizeStyleDataL(RWriteStream &aStream)const

Externalises the style list owned by the rich text object.

Parameters

RWriteStream & aStreamStream to which to write the style list.

GenerateMarkupL()

voidGenerateMarkupL()[private]

GetCharFormat(TCharFormat &, TCharFormatMask &, TInt, TInt)

IMPORT_C voidGetCharFormat(TCharFormat &aFormat,
TCharFormatMask &aVaries,
TIntaPos,
TIntaLength
)const [virtual]

Gets the effective character formatting which applies to a range of characters. The range of characters involved is from aPos to aPos+(aLength-1) inclusive. On return, aFormat is filled with values for all character format attributes, and on return, the mask indicates the values that change over the region, and whose value is therefore indeterminate.

The length value can be zero. In this case, the character formatting sensed is that of the character immediately to the left of the position specified.

Parameters

TCharFormat & aFormatOn return, contains the character format values for the range of characters.
TCharFormatMask & aVariesOn return, indicates which character format attributes vary over the range.
TInt aPosDocument position of the start of the range. Must be valid or a panic occurs.
TInt aLengthNumber of characters in the range. Must be greater than or equal to zero, or a panic occurs.

GetExtendedCharFormat(TCharFormatX &, TCharFormatXMask &, TInt, TInt)

voidGetExtendedCharFormat(TCharFormatX &aFormat,
TCharFormatXMask &aVaries,
TIntaPos,
TIntaLength
)const

Parameters

TCharFormatX & aFormat
TCharFormatXMask & aVaries
TInt aPos
TInt aLength

GetParaFormatL(CParaFormat *, TParaFormatMask &, TInt, TInt, CParaFormat::TParaFormatGetMode)

IMPORT_C voidGetParaFormatL(CParaFormat *aFormat,
TParaFormatMask &aVaries,
TIntaPos,
TIntaLength,
CParaFormat::TParaFormatGetModeaMode = CParaFormat::EAllAttributes
)const [virtual]

Gets the effective paragraph formatting which applies to a range of paragraphs. The region involved is every paragraph containing one or more characters in the range aPos to aPos+(aLength-1) inclusive. On return, aFormat is filled with values for all paragraph format attributes and the mask indicates the values that change over the region, and whose value is therefore indeterminate.

Note:

If aMode has a value of EFixedAttributes, the function cannot leave.

Parameters

CParaFormat * aFormatMust not be NULL or a panic occurs. On return, contains the effective paragraph formatting for the range of paragraphs.
TParaFormatMask & aVariesOn return, a bitmask indicating which paragraph format attributes vary over the range of characters selected.
TInt aPosThe document position of the start of the range.
TInt aLengthThe number of characters in the range.
CParaFormat::TParaFormatGetMode aMode = CParaFormat::EAllAttributesThe default, EAllAttributes means that values for all paragraph format attributes are written to aFormat. EFixedAttributes means that tabs, bullets and borders are not written to aFormat.

GetParagraphFormatL(CParaFormat *, TInt)

IMPORT_C voidGetParagraphFormatL(CParaFormat *aFormat,
TIntaPos
)const [virtual]

Gets the effective paragraph formatting which applies to the paragraph which contains a specified document position. On return, aFormat is filled with values for all paragraph format attributes.

Parameters

CParaFormat * aFormatOn return, filled with the paragraph's effective paragraph formatting.
TInt aPosAny document position within the paragraph of interest.

GetPictureSizeInTwips(TSize &, TInt)

IMPORT_C TIntGetPictureSizeInTwips(TSize &aSize,
TIntaPos
)const [virtual]

Gets the size of a picture located at a specified document position.

Parameters

TSize & aSizeOn return, contains the size of the picture located at aPos.
TInt aPosDocument position of the picture. Must be a valid position.

GetSpecificCharFormat(TCharFormat &, TCharFormatMask &, TInt)

IMPORT_C voidGetSpecificCharFormat(TCharFormat &aFormat,
TCharFormatMask &aMask,
TIntaPos
)const

Gets the specific character formatting which applies to the character to the left of a document position. Specific formatting is just the formatting which has been applied over the object's global format layers - it is not the same as the effective formatting.

Parameters

TCharFormat & aFormatOn return contains the specific character formatting which applies to the character to the left of the document position.
TCharFormatMask & aMaskOn return, indicates which character format attributes have been applied specifically, (not taken from the global layers).
TInt aPosThe document position. Must be valid or a panic occurs.

GetSpecificCharFormatLeftRight(TCharFormat &, TCharFormatMask &, TInt, TBool)

voidGetSpecificCharFormatLeftRight(TCharFormat &aFormat,
TCharFormatMask &aMask,
TIntaPos,
TBoolaLeft
)const [private]

Parameters

TCharFormat & aFormat
TCharFormatMask & aMask
TInt aPos
TBool aLeft

GetSpecificCharFormatRight(TCharFormat &, TCharFormatMask &, TInt)

IMPORT_C voidGetSpecificCharFormatRight(TCharFormat &aFormat,
TCharFormatMask &aMask,
TIntaPos
)const

Gets the specific character formatting which applies to the character logically after a document position. Note that this is not necessarily the character to the right of the document position, because right to left text is supported.

Specific formatting is just the formatting which has been applied over the object's global format layers it is not the same as the effective formatting.

Parameters

TCharFormat & aFormatOn return, contains the specific character formatting which applies to the character logically after the document position.
TCharFormatMask & aMaskOn return, indicates which character format attributes have been applied specifically, (not taken from the global layers).
TInt aPosThe document position. Must be valid or a panic occurs.

GetSpecificParagraphFormatL(CParaFormat *, TParaFormatMask &, TInt)

IMPORT_C voidGetSpecificParagraphFormatL(CParaFormat *aFormat,
TParaFormatMask &aMask,
TIntaPos
)const

Parameters

CParaFormat * aFormat
TParaFormatMask & aMask
TInt aPos

GetTextAndExtendedFormat(TPtrC &, TCharFormatX &, TInt)

voidGetTextAndExtendedFormat(TPtrC &aText,
TCharFormatX &aFormat,
TIntaPos
)const

Parameters

TPtrC & aText
TCharFormatX & aFormat
TInt aPos

HasMarkupData()

IMPORT_C TBoolHasMarkupData()const

Tests whether the rich text object has any markup, or owns a style list.

Markup is rich text-specific information, for instance specific formatting, styles and pictures. It may be stored in a separate stream from the text.

IndexPresent()

TBool IndexPresent()const [private]

InsertL(TInt, const TChar &)

IMPORT_C voidInsertL(TIntaPos,
const TChar &aChar
)[virtual]

Inserts either a single character or a descriptor into the text object at a specified document position.

Updates the page table.

Parameters

TInt aPosThe document position at which to insert the character/descriptor. Must be valid, or a panic occurs.
const TChar & aCharThe character to insert.

InsertL(TInt, const TDesC &)

IMPORT_C voidInsertL(TIntaPos,
const TDesC &aBuf
)[virtual]

Inserts the contents of aBuf into the document at position aPos.

Parameters

TInt aPos
const TDesC & aBuf

InsertL(TInt, const TPictureHeader &)

IMPORT_C voidInsertL(TIntaPos,
const TPictureHeader &aHeader
)

Parameters

TInt aPos
const TPictureHeader & aHeader

InternalizeL(RReadStream &)

IMPORT_C voidInternalizeL(RReadStream &aStream)[virtual]

Internalises the rich text object and all of its components (field set, style list, rich text formatting and pictures) 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.

Note: The global format layers are not owned by the object; they are supplied by the owner of the object and not saved when the object is externalised or loaded when it is internalized.

Parameters

RReadStream & aStreamStream from which to read the rich text object.

InternalizeL(RReadStream &, const CStyleList *)

voidInternalizeL(RReadStream &aStream,
const CStyleList *aExternalStyleList
)[protected]

Parameters

RReadStream & aStream
const CStyleList * aExternalStyleList

InternalizeMarkupDataL(RReadStream &)

IMPORT_C voidInternalizeMarkupDataL(RReadStream &aStream)

Internalises the rich text object's markup (specific formatting, styles and pictures).

Parameters

RReadStream & aStreamStream from which to internalise the rich text markup.

InternalizeStyleDataL(RReadStream &)

IMPORT_C voidInternalizeStyleDataL(RReadStream &aStream)

Internalises the style list owned by the rich text object from a read stream, if one is present in the stream.

Parameters

RReadStream & aStreamStream from which to read the style list.

KillIndex()

voidKillIndex()[private]

KillStyleList()

voidKillStyleList()[private]

NewL(const CParaFormatLayer *, const CCharFormatLayer *, TDocumentStorage, TInt, TParaType)

IMPORT_C CRichText *NewL(const CParaFormatLayer *aGlobalParaLayer,
const CCharFormatLayer *aGlobalCharLayer,
TDocumentStorageaStorage = ESegmentedStorage,
TIntaDefaultTextGranularity = EDefaultTextGranularity,
TParaTypeaParaType = EMultiPara
)[static]

Allocates and constructs an empty rich text object, with a global character and paragraph format layer. A single end-of-document delimiter is inserted. No style list is allocated.

Parameters

const CParaFormatLayer * aGlobalParaLayerPointer to the paragraph format layer referenced by the rich text object. Must not be NULL, or a panic occurs.
const CCharFormatLayer * aGlobalCharLayerPointer to the character format layer referenced by the rich text object. Must not be NULL, or a panic occurs.
TDocumentStorage aStorage = ESegmentedStorageThe type of in-memory buffer to use. Defaults to ESegmentedStorage which should rarely need to be changed.
TInt aDefaultTextGranularity = EDefaultTextGranularitySpecifies the granularity of the in-memory buffer. Default is EDefaultTextGranularity bytes (=256), and this should rarely need to be changed.
TParaType aParaType = EMultiParaThis argument indicates whether you are using a single paragraph or multiple paragraphs, and thus affects the granularity of aggregate objects used internally for storing paragraph attributes. Default = EMultiPara.

NewL(const CParaFormatLayer *, const CCharFormatLayer *, const CStyleList &, TDocumentStorage, TInt, TParaType)

IMPORT_C CRichText *NewL(const CParaFormatLayer *aGlobalParaLayer,
const CCharFormatLayer *aGlobalCharLayer,
const CStyleList &aStyleList,
TDocumentStorageaStorage = ESegmentedStorage,
TIntaDefaultTextGranularity = EDefaultTextGranularity,
TParaTypeaParaType = EMultiPara
)[static]

Allocates and constructs an empty rich text object which supports styles. It is constructed with a global character and paragraph format layer and a style list. A single end-of-document delimiter is inserted. The rich text object takes ownership of the style list.

Note:

A rich text object not constructed with a style list may still use styles, by calling SetStyleListExternallyOwned() at any time after construction. In this case, the rich text object does not own the style list.

Parameters

const CParaFormatLayer * aGlobalParaLayerPointer to the paragraph format layer referenced by the rich text object. Must not be NULL, or a panic occurs.
const CCharFormatLayer * aGlobalCharLayerPointer to the character format layer referenced by the rich text object. Must not be NULL, or a panic occurs.
const CStyleList & aStyleListStyle list. Holds the set of paragraph styles which can be used in the rich text object.
TDocumentStorage aStorage = ESegmentedStorageThe type of in-memory buffer to use. Defaults to ESegmentedStorage which should rarely need to be changed.
TInt aDefaultTextGranularity = EDefaultTextGranularitySpecifies the granularity of the in-memory buffer. Default is EDefaultTextGranularity bytes (=256), and this should rarely need to be changed.
TParaType aParaType = EMultiParaThis argument indicates whether you are using a single paragraph or multiple paragraphs, and thus affects the granularity of aggregate objects used internally for storing paragraph attributes. Default = EMultiPara.

NewL(const CStreamStore &, TStreamId, const CParaFormatLayer *, const CCharFormatLayer *, MTextFieldFactory *, TDocumentStorage)

IMPORT_C CRichText *NewL(const CStreamStore &aStore,
TStreamIdaStreamId,
const CParaFormatLayer *aGlobalParaLayer,
const CCharFormatLayer *aGlobalCharLayer,
MTextFieldFactory *aFieldFactory = NULL,
TDocumentStorageaStorage = ESegmentedStorage
)[static]

Allocates and constructs a rich text object with a field factory. Its text content is internalized from a stream store.

Note:

A rich text object not constructed with a field factory may still support the addition of fields, by calling SetFieldFactory(), defined in the base class CPlainText.

Parameters

const CStreamStore & aStoreStream store from which the object is restored.
TStreamId aStreamIdID of the stream store.
const CParaFormatLayer * aGlobalParaLayerPointer to the paragraph format layer referenced by the rich text object. Must not be NULL, or a panic occurs.
const CCharFormatLayer * aGlobalCharLayerPointer to the character format layer referenced by the rich text object. Must not be NULL, or a panic occurs.
MTextFieldFactory * aFieldFactory = NULLPointer to a field factory. A field factory must be provided if the text object supports fields.
TDocumentStorage aStorage = ESegmentedStorageThe type of in-memory buffer to use. Defaults to ESegmentedStorage which should rarely need to be changed.

NewL(const CStreamStore &, TStreamId, const CParaFormatLayer *, const CCharFormatLayer *, MPictureFactory *, MRichTextStoreResolver *, MTextFieldFactory *, TDocumentStorage)

IMPORT_C CRichText *NewL(const CStreamStore &aStore,
TStreamIdaStreamId,
const CParaFormatLayer *aGlobalParaLayer,
const CCharFormatLayer *aGlobalCharLayer,
MPictureFactory *aPictureFactory,
MRichTextStoreResolver *aStoreResolver,
MTextFieldFactory *aFieldFactory = NULL,
TDocumentStorageaStorage = ESegmentedStorage
)[static]

Allocates and constructs a rich text object with a field factory and a picture factory. Its text content is internalized from a stream store.

Note:

A rich text object not constructed with a field factory may still support the addition of fields, by calling SetFieldFactory(), defined in the base class CPlainText.

Parameters

const CStreamStore & aStoreStream store from which the object is restored.
TStreamId aStreamIdID of the stream store.
const CParaFormatLayer * aGlobalParaLayerPointer to the paragraph format layer referenced by the rich text object. Must not be NULL, or a panic occurs.
const CCharFormatLayer * aGlobalCharLayerPointer to the character format layer referenced by the rich text object. Must not be NULL, or a panic occurs.
MPictureFactory * aPictureFactoryThe picture factory. This is needed to load pictures into memory, (see PictureHandleL()). If a store resolver is specified (not NULL), then a factory must also be specified, or a panic occurs.
MRichTextStoreResolver * aStoreResolverA store resolver. This determines which file store the picture is stored in. It is used to get from a reference to an embedded picture within a CRichText object to the actual picture itself. Picture loading is done by the picture factory.
MTextFieldFactory * aFieldFactory = NULLPointer to a field factory. A field factory must be provided if the text object supports fields.
TDocumentStorage aStorage = ESegmentedStorageThe type of in-memory buffer to use. Defaults to ESegmentedStorage which should rarely need to be changed.

NotifyStyleDeletedL(const CParagraphStyle *)

voidNotifyStyleDeletedL(const CParagraphStyle *aStyle)[inline]

Removes a style from all paragraphs to which it applies. The formatting is reset to the global character and paragraph format layers, except that any specific formatting which has been applied to the paragraphs is retained.

Notes:

This function should be called on the text content object after deleting a style in the style list.

A panic occurs if the rich text object does not use a style list (this can be tested for using StyleListPresent()).

Parameters

const CParagraphStyle * aStylePointer to the style to remove from the rich text object.

OverrideFormatForParsersIfApplicable(TPtrC &, TCharFormatX &, TInt)

voidOverrideFormatForParsersIfApplicable(TPtrC &aText,
TCharFormatX &aFormat,
TIntaStartPos
)const [private]

Parameters

TPtrC & aText
TCharFormatX & aFormat
TInt aStartPos

ParagraphCount()

IMPORT_C TIntParagraphCount()const [virtual]

Gets a count of the number of paragraphs in the text object.

Note: the paragraph delimiter which terminates every text object means this function always returns a count of at least one.

ParagraphNumberForPos(TInt &)

IMPORT_C TIntParagraphNumberForPos(TInt &aPos)const [virtual]

Gets the number of the paragraph which contains a document position. Paragraph numbering begins at zero.

Parameters

TInt & aPosA document position. Must be valid or a panic occurs. On return, contains the document position of the first character in the paragraph in which it is located.

ParagraphStyle(TBool &, TInt, TInt)

IMPORT_C const CParaFormatLayer *ParagraphStyle(TBool &aStyleChangesOverRange,
TIntaPos,
TIntaLength
)const

Gets a pointer to the first paragraph style encountered in the specified range.

Parameters

TBool & aStyleChangesOverRangeOn return, set to ETrue if more than one paragraph style is used over the specified range of characters. Otherwise EFalse
TInt aPosThe document position of the start of the range. Must be valid.
TInt aLengthThe number of characters in the range. Must be greater than or equal to zero.

ParseText(TInt &, TInt &, TBool)

IMPORT_C TBoolParseText(TInt &aStartOfTags,
TInt &aLength,
TBoolaForceScanAllText
)

Parameters

TInt & aStartOfTags
TInt & aLength
TBool aForceScanAllText

PasteFromStoreL(const CStreamStore &, const CStreamDictionary &, TInt)

IMPORT_C TIntPasteFromStoreL(const CStreamStore &aStore,
const CStreamDictionary &aDictionary,
TIntaPos
)[virtual]

Pastes plain text and fields, if present, from the clipboard into the current text object at the specified document position. The entire contents of the store are pasted.

Parameters

const CStreamStore & aStoreThe steam store from which to paste the text.
const CStreamDictionary & aDictionaryThe stream dictionary.
TInt aPosDocument position at which to paste. Must be valid or the function raises a panic.

PasteFromStoreL(const CStreamStore &, const CStreamDictionary &, TInt, CParagraphStyle::TStylePasteMode)

IMPORT_C TIntPasteFromStoreL(const CStreamStore &aStore,
const CStreamDictionary &aDictionary,
TIntaPos,
CParagraphStyle::TStylePasteModeaStylePasteMode
)

Parameters

const CStreamStore & aStore
const CStreamDictionary & aDictionary
TInt aPos
CParagraphStyle::TStylePasteMode aStylePasteMode

PastePlainTextFromStoreL(const CStreamStore &, TStreamId &, TInt)

TInt PastePlainTextFromStoreL(const CStreamStore &aStore,
TStreamId &anId,
TIntaPos
)[protected]

Parameters

const CStreamStore & aStore
TStreamId & anId
TInt aPos

PasteRichTextFromStoreL(const CStreamStore &, const CStreamDictionary &, TStreamId &, TInt, CParagraphStyle::TStylePasteMode)

TInt PasteRichTextFromStoreL(const CStreamStore &aStore,
const CStreamDictionary &aDictionary,
TStreamId &anId,
TIntaPos,
CParagraphStyle::TStylePasteModeaStylePasteMode
)[protected]

Parameters

const CStreamStore & aStore
const CStreamDictionary & aDictionary
TStreamId & anId
TInt aPos
CParagraphStyle::TStylePasteMode aStylePasteMode

PictureCount()

IMPORT_C TIntPictureCount()const

PictureHandleL(TInt, MLayDoc::TForcePictureLoad)

IMPORT_C CPicture *PictureHandleL(TIntaPos,
MLayDoc::TForcePictureLoadaForceLoad = MLayDoc::EForceLoadTrue
)const [virtual]

Gets a pointer to the picture located at a specified document position, if one exists. If the picture is not in memory, the function loads it (if the second argument has a value of MLayDoc::EForceLoadTrue).

Note:

In order to load the picture, a picture factory and a store resolver must have been set.

Parameters

TInt aPosDocument position of the picture character. Must be a valid position.
MLayDoc::TForcePictureLoad aForceLoad = MLayDoc::EForceLoadTrueIf the picture is not loaded into memory, MLayDoc::EForceLoadTrue loads it using the picture factory; MLayDoc::EForceLoadFalse does not, and in this case, the function returns NULL.

PictureHeader(TInt)

IMPORT_C TPictureHeaderPictureHeader(TIntaPos)const

Parameters

TInt aPos

PositionOfNextTag(TInt)

IMPORT_C TIntPositionOfNextTag(TIntaPos)const

Parameters

TInt aPos

PositionOfNextTag(TInt, const MParser *)

IMPORT_C TIntPositionOfNextTag(TIntaPos,
const MParser *aParser
)const

Parameters

TInt aPos
const MParser * aParser

PositionOfPrevTag(TInt)

IMPORT_C TIntPositionOfPrevTag(TIntaPos)const

Parameters

TInt aPos

PositionOfPrevTag(TInt, const MParser *)

IMPORT_C TIntPositionOfPrevTag(TIntaPos,
const MParser *aParser
)const

Parameters

TInt aPos
const MParser * aParser

PrepareAppendMarkupL(const CRichText &)

voidPrepareAppendMarkupL(const CRichText &aSource)[protected]

Parameters

const CRichText & aSource

RemoveSpecificCharFormatL(TInt, TInt)

IMPORT_C voidRemoveSpecificCharFormatL(TIntaPos,
TIntaLength
)

Parameters

TInt aPos
TInt aLength

RemoveSpecificParaFormatL(TInt, TInt)

IMPORT_C voidRemoveSpecificParaFormatL(TIntaPos,
TIntaLength
)

Removes all specific paragraph formatting from a range of paragraphs. This does not remove formatting from the object's global paragraph format layer. The region affected consists of every paragraph containing one or more characters in the range covered by document position aPos to aPos+(aLength-1) inclusive.

A panic occurs in the following situations:

the position is negative,

the length is negative,

the range goes beyond the end of the document

Parameters

TInt aPosThe document position of the start of the range.
TInt aLengthThe number of characters in the range.

Reset()

IMPORT_C voidReset()[virtual]

Resets the document's contents to a single end-of-document delimiter. Also deletes the style list if owned by the object.

RestoreComponentsL(const CStreamStore &)

IMPORT_C voidRestoreComponentsL(const CStreamStore &aStore)[virtual]

Restores the plain text object's field set from a stream store.

Parameters

const CStreamStore & aStoreThe stream store from which the field set is restored.

RestoreWithStyleListL(const CStreamStore &, TStreamId, const CStyleList &)

IMPORT_C voidRestoreWithStyleListL(const CStreamStore &aStore,
TStreamIdaStreamId,
const CStyleList &aExternalStyleList
)

Restores a rich text object, including all of its components and an externally owned style list, from a stream store.

Parameters

const CStreamStore & aStoreStream store from which the object is restored.
TStreamId aStreamIdID of the stream store.
const CStyleList & aExternalStyleListAn externally owned style list.

RtInsertL(TInt, const TDesC &)

IMPORT_C voidRtInsertL(TIntaPos,
const TDesC &aBuf
)[protected]

Parameters

TInt aPos
const TDesC & aBuf

SetEditObserver(MEditObserver *)

IMPORT_C voidSetEditObserver(MEditObserver *aEditObserver)

Sets the rich text object's edit observer. The observer's EditObserver() function is called by the rich text object each time the object's text content is edited (e.g. after a paste, insert, delete, reset etc.).

Parameters

MEditObserver * aEditObserverPointer to the edit observer.

SetExtendedInsertCharFormatL(const TCharFormatX &, const TCharFormatXMask &, TInt)

voidSetExtendedInsertCharFormatL(const TCharFormatX &aFormat,
const TCharFormatXMask &aMask,
TIntaPos
)[private]

Parameters

const TCharFormatX & aFormat
const TCharFormatXMask & aMask
TInt aPos

SetHasChanged(TBool)

IMPORT_C voidSetHasChanged(TBoolaHasChanged)[virtual]

Sets whether the document's content or formatting has changed. This function is called with an value of ETrue by all functions which modify the text content or formatting. Use CEditableText::HasChanged() to test whether the document has changed.

Parameters

TBool aHasChangedETrue if the text object has been changed, EFalse if not.

SetInsertCharFormatL(const TCharFormat &, const TCharFormatMask &, TInt)

IMPORT_C voidSetInsertCharFormatL(const TCharFormat &aFormat,
const TCharFormatMask &aMask,
TIntaPos
)

Applies character formatting to a zero length selection, for example turning bold on. This has the effect that the formatting will be applied to text subsequently inserted at the position. This "insert pending" state is cancelled by calling CancelInsertCharFormat().

Note 1: After calling this function, if text is inserted at a different position to aPos, a panic will occur, unless CancelInsertCharFormat() has been called before the insertion to cancel the "insert pending" state.

Note 2: If the insert character format is being set for the end of the paragraph, the paragraph delimiter is set to that format as well. This helps end-of-paragraph behaviour be more similar to other places.

Pre-condition
aPos must be a valid position, or a panic will occur.

Parameters

const TCharFormat & aFormatThe character format values to apply.
const TCharFormatMask & aMaskCharacter format mask specifying the attributes affected.
TInt aPosThe document position at which to insert the character format.

SetParaTypeIsSingle(TBool)

voidSetParaTypeIsSingle(TBoolaBool)[private, inline]

Parameters

TBool aBool

SetPictureFactory(MPictureFactory *, MRichTextStoreResolver *)

IMPORT_C voidSetPictureFactory(MPictureFactory *aPictureFactory,
MRichTextStoreResolver *aStoreResolver
)

Sets the picture factory.

Pictures in a rich text object may be represented as picture headers, or by the picture data itself. CRichText supports the deferred loading of picture data, so that it is only loaded when it is needed to be displayed, thus economising on memory use. A rich text object which supports the deferred loading of pictures needs to be supplied with a picture factory. It can either be set using this function, or during construction.

Note: A panic occurs if the factory is NULL, but the store resolver is not NULL.

Parameters

MPictureFactory * aPictureFactoryThe picture factory.
MRichTextStoreResolver * aStoreResolverThe store resolver. This determines which file store the picture is stored in.

SetStyleListExternallyOwned(TBool)

voidSetStyleListExternallyOwned(TBoolaExternallyOwned)[inline]

Sets whether the style list used by this rich text object is owned by the object itself, or is externally owned.

Parameters

TBool aExternallyOwnedETrue if the style list should be marked as externally owned, EFalse if not.

StoreComponentsL(CStreamStore &, CStoreMap &)

IMPORT_C voidStoreComponentsL(CStreamStore &aStore,
CStoreMap &aMap
)const [virtual]

Stores the rich text object's components (field set, style list, formatting and pictures) to the stream store specified.

Parameters

CStreamStore & aStoreStream store to which the text components are written.
CStoreMap & aMapA store map. This binds the address of text components to the stream ID of aStore. This is needed to support the deferred loading of pictures in rich text.

StoreMarkupComponentsL(CStreamStore &, CStoreMap &)

IMPORT_C voidStoreMarkupComponentsL(CStreamStore &aStore,
CStoreMap &aMap
)const

Stores all pictures in the rich text object to a stream store.

Parameters

CStreamStore & aStoreStream store to which the pictures are to be stored.
CStoreMap & aMapA store map. This binds the address of pictures to the stream ID of aStore. This is needed to support the deferred loading of pictures.

StoreMarkupL(CStreamStore &, CStoreMap &)

voidStoreMarkupL(CStreamStore &aStore,
CStoreMap &aMap
)const [protected]

Parameters

CStreamStore & aStore
CStoreMap & aMap

StoreResolver()

MRichTextStoreResolver *StoreResolver()const [inline]

Gets the store resolver. A store resolver may be set during construction, or by calling CRichText::SetPictureFactory().

StoreStylesL(CStreamStore &, CStoreMap &)

voidStoreStylesL(CStreamStore &aStore,
CStoreMap &aMap
)const [protected]

Parameters

CStreamStore & aStore
CStoreMap & aMap

StyleCount()

TInt StyleCount()const [inline]

StyleList()

CStyleList *StyleList()const [inline]

StyleListExternallyOwned()

TBool StyleListExternallyOwned()const [inline]

Tests whether the style list used by this rich text object is owned by the object itself, or is externally owned. This value is set using SetStyleListExternallyOwned().

StyleListPresent()

TBool StyleListPresent()const [inline]

Tests whether the rich text object uses a style list. The style list may be owned by the object itself, or may be externally owned.

UpdateFieldL(TInt)

IMPORT_C voidUpdateFieldL(TIntaPos)[virtual]

Re-evaluates the field which covers the document position specified. Re-evaluating a field means calculating the field's new value, then inserting that value into the text object, replacing the previous value.

Notes:

fields have a maximum length of 20 characters

the first time a field is updated, the position specified should be the position at which the field was inserted

Parameters

TInt aPosA document position in the field to be updated. Must be a valid position, or a panic occurs.

operator=(const CRichText &)

CRichText &operator=(const CRichText &aRichText)[private]

Parameters

const CRichText & aRichText

Member Enumerations Documentation

Enum anonymous

Enumerators

EDelimiterCharacterLength = 1

Enum TParaType

Number of paragraphs in the object.

Enumerators

ESinglePara

The text object will contain a single paragraph.

EMultiPara

The text object will contain multiple paragraphs.

Member Data Documentation

__DECLARE_TEST

__DECLARE_TEST[private]

TUint32 iFlags

TUint32 iFlags[private]

TSwizzle< CRichTextIndex > iIndex

TSwizzle< CRichTextIndex >iIndex[private]

CParserData * iParserData

CParserData *iParserData[private]

MPictureFactory * iPictureFactory

MPictureFactory *iPictureFactory[private]

void * iReserved_3

void *iReserved_3[private]

MRichTextStoreResolver * iStoreResolver

MRichTextStoreResolver *iStoreResolver[private]

TSwizzle< CStyleList > iStyleList

TSwizzle< CStyleList >iStyleList[private]