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 void ActivateParserL ( MParser *)
IMPORT_C void AppendTakingSolePictureOwnershipL (const CRichText &)
IMPORT_C void ApplyCharFormatL (const TCharFormat &, const TCharFormatMask &, TInt , TInt )
void ApplyExtendedCharFormatL (const TCharFormatX &, const TCharFormatXMask &, TInt , TInt )
IMPORT_C void ApplyParagraphStyleL (const CParagraphStyle &, TInt , TInt , CParagraphStyle::TApplyParaStyleMode )
IMPORT_C void CancelInsertCharFormat ()
IMPORT_C TEtextComponentInfo ComponentInfo ()
IMPORT_C void CopyToStoreL ( CStreamStore &, CStreamDictionary &, TInt , TInt )
IMPORT_C TBool CursorOverTag ( TInt , MParser *&, TInt &, TInt &)
IMPORT_C void DeactivateParser ( MParser *)
IMPORT_C void DeactivateParserDefaults ()
IMPORT_C TBool DelSetInsertCharFormatL ( TInt , TInt )
IMPORT_C void DeleteFromParagraph ( TInt , TInt )
IMPORT_C TBool DeleteL ( TInt , TInt )
IMPORT_C void DeleteParagraph ( TInt , TInt )
IMPORT_C void DetachFromStoreL ( CPicture::TDetach )
IMPORT_C void DropPictureOwnership ( TInt )
IMPORT_C void ExtendedInterface ( TAny *&, TUid )
IMPORT_C void ExternalizeStyleDataL ( RWriteStream &)
IMPORT_C void GetCharFormat ( TCharFormat &, TCharFormatMask &, TInt , TInt )
void GetExtendedCharFormat ( TCharFormatX &, TCharFormatXMask &, TInt , TInt )
IMPORT_C void GetParaFormatL ( CParaFormat *, TParaFormatMask &, TInt , TInt , CParaFormat::TParaFormatGetMode )
IMPORT_C void GetParagraphFormatL ( CParaFormat *, TInt )
IMPORT_C TInt GetPictureSizeInTwips ( TSize &, TInt )
IMPORT_C void GetSpecificCharFormat ( TCharFormat &, TCharFormatMask &, TInt )
IMPORT_C void GetSpecificCharFormatRight ( TCharFormat &, TCharFormatMask &, TInt )
IMPORT_C void GetSpecificParagraphFormatL ( CParaFormat *, TParaFormatMask &, TInt )
void GetTextAndExtendedFormat ( TPtrC &, TCharFormatX &, TInt )
IMPORT_C TBool HasMarkupData ()
IMPORT_C void InsertL ( TInt , const TChar &)
IMPORT_C void InsertL ( TInt , const TDesC &)
IMPORT_C void InsertL ( TInt , const TPictureHeader &)
IMPORT_C void InternalizeL ( RReadStream &)
IMPORT_C void InternalizeMarkupDataL ( RReadStream &)
IMPORT_C void InternalizeStyleDataL ( 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 )
void NotifyStyleDeletedL (const CParagraphStyle *)
IMPORT_C TInt ParagraphCount ()
IMPORT_C TInt ParagraphNumberForPos ( TInt &)
IMPORT_C const CParaFormatLayer * ParagraphStyle ( TBool &, TInt , TInt )
IMPORT_C TBool ParseText ( TInt &, TInt &, TBool )
IMPORT_C TInt PasteFromStoreL (const CStreamStore &, const CStreamDictionary &, TInt )
IMPORT_C TInt PasteFromStoreL (const CStreamStore &, const CStreamDictionary &, TInt , CParagraphStyle::TStylePasteMode )
IMPORT_C TInt PictureCount ()
IMPORT_C CPicture * PictureHandleL ( TInt , MLayDoc::TForcePictureLoad )
IMPORT_C TPictureHeader PictureHeader ( TInt )
IMPORT_C TInt PositionOfNextTag ( TInt )
IMPORT_C TInt PositionOfNextTag ( TInt , const MParser *)
IMPORT_C TInt PositionOfPrevTag ( TInt )
IMPORT_C TInt PositionOfPrevTag ( TInt , const MParser *)
IMPORT_C void RemoveSpecificCharFormatL ( TInt , TInt )
IMPORT_C void RemoveSpecificParaFormatL ( TInt , TInt )
IMPORT_C void Reset ()
IMPORT_C void RestoreComponentsL (const CStreamStore &)
IMPORT_C void RestoreWithStyleListL (const CStreamStore &, TStreamId , const CStyleList &)
IMPORT_C void SetEditObserver ( MEditObserver *)
IMPORT_C void SetHasChanged ( TBool )
IMPORT_C void SetInsertCharFormatL (const TCharFormat &, const TCharFormatMask &, TInt )
IMPORT_C void SetPictureFactory ( MPictureFactory *, MRichTextStoreResolver *)
void SetStyleListExternallyOwned ( TBool )
IMPORT_C void StoreComponentsL ( CStreamStore &, CStoreMap &)
IMPORT_C void StoreMarkupComponentsL ( CStreamStore &, CStoreMap &)
MRichTextStoreResolver * StoreResolver ()
TInt StyleCount ()
CStyleList * StyleList ()
TBool StyleListExternallyOwned ()
TBool StyleListPresent ()
IMPORT_C void UpdateFieldL ( TInt )
Protected Member Functions
CRichText (const CParaFormatLayer *, const CCharFormatLayer *, CStyleList *)
IMPORT_C void ConstructL ( TDocumentStorage , TInt , TParaType )
IMPORT_C void ConstructL (const CStreamStore &, TStreamId , MPictureFactory *, MRichTextStoreResolver *, MTextFieldFactory *, TDocumentStorage )
IMPORT_C void CopyToStreamL ( RWriteStream &, TInt , TInt , TStreamId )
IMPORT_C void CopyToStreamL ( RWriteStream &, TInt , TInt )
void DoAppendTakingSolePictureOwnershipL (const CRichText &)
TStreamId DoCopyToStoreL ( CStreamStore &, TInt , TInt , TStreamId , TBool )
IMPORT_C void DoInternalizeMarkupDataL ( RReadStream &)
IMPORT_C void DoInternalizeStyleDataL ( RReadStream &)
void DoInternalizeStyleDataL ( RReadStream &, const CStyleList *)
void InternalizeL ( RReadStream &, const CStyleList *)
TInt PastePlainTextFromStoreL (const CStreamStore &, TStreamId &, TInt )
TInt PasteRichTextFromStoreL (const CStreamStore &, const CStreamDictionary &, TStreamId &, TInt , CParagraphStyle::TStylePasteMode )
void PrepareAppendMarkupL (const CRichText &)
IMPORT_C void RtInsertL ( TInt , const TDesC &)
void StoreMarkupL ( CStreamStore &, CStoreMap &)
void StoreStylesL ( CStreamStore &, CStoreMap &)
Private Member Functions
CRichText (const CRichText &)
void CallEditObserver ( TInt , TInt )
TBool CreateEmptyMarkupComponentL ()
void CreateParserETextTLSL ()
void DoApplyExtendedCharFormatL (const TCharFormatX &, const TCharFormatXMask &, TInt , TInt )
TBool DoCursorOverTag ( TInt , MParser *&, TInt &, TInt &)
TInt DoPasteRtFromStoreL (const CStreamStore &, const CStreamDictionary &, TInt , CParagraphStyle::TStylePasteMode )
void GenerateMarkupL ()
void GetSpecificCharFormatLeftRight ( TCharFormat &, TCharFormatMask &, TInt , TBool )
TBool IndexPresent ()
void KillIndex ()
void KillStyleList ()
void OverrideFormatForParsersIfApplicable ( TPtrC &, TCharFormatX &, TInt )
void SetExtendedInsertCharFormatL (const TCharFormatX &, const TCharFormatXMask &, TInt )
void SetParaTypeIsSingle ( 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
enum TParaType { ESinglePara , EMultiPara }
Protected Member Enumerations
enum anonymous { 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_C CRichText ( 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 void ActivateParserL ( MParser * aParser ) [static]

Parameters

MParser * aParser

AppendTakingSolePictureOwnershipL(const CRichText &)

IMPORT_C void AppendTakingSolePictureOwnershipL ( 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 & aSource The rich text object to append.

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

IMPORT_C void ApplyCharFormatL ( const TCharFormat & aFormat,
const TCharFormatMask & aMask,
TInt aPos,
TInt aLength
) [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 & aFormat Contains the character format attribute values to apply.
const TCharFormatMask & aMask Bitmask specifying the character format attributes to change.
TInt aPos This argument is not used for global text.
TInt aLength This argument is not used for global text.

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

void ApplyExtendedCharFormatL ( const TCharFormatX & aFormat,
const TCharFormatXMask & aMask,
TInt aPos,
TInt aLength
)

Parameters

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

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

IMPORT_C void ApplyParagraphStyleL ( const CParagraphStyle & aStyle,
TInt aPos,
TInt aLength,
CParagraphStyle::TApplyParaStyleMode aMode
)

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 & aStyle The style to apply.
TInt aPos The document position of the start of the range.
TInt aLength The number of characters in the range.
CParagraphStyle::TApplyParaStyleMode aMode Controls what specific formatting, if any, should be preserved when the style is applied.

CallEditObserver(TInt, TInt)

void CallEditObserver ( TInt aStart,
TInt aExtent
) const [private]

Parameters

TInt aStart
TInt aExtent

CancelInsertCharFormat()

IMPORT_C void CancelInsertCharFormat ( )

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 TEtextComponentInfo ComponentInfo ( ) 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 void ConstructL ( TDocumentStorage aStorage,
TInt aDefaultTextGranularity,
TParaType aParaType
) [protected]

Parameters

TDocumentStorage aStorage
TInt aDefaultTextGranularity
TParaType aParaType

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

IMPORT_C void ConstructL ( const CStreamStore & aStore,
TStreamId aStreamId,
MPictureFactory * aFactory,
MRichTextStoreResolver * aStoreResolver,
MTextFieldFactory * aFieldFactory = NULL,
TDocumentStorage aStorage = 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 void CopyToStoreL ( CStreamStore & aStore,
CStreamDictionary & aDictionary,
TInt aPos,
TInt aLength
) 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 & aStore Stream store to which the rich text is written.
CStreamDictionary & aDictionary The stream dictionary.
TInt aPos The document position from which to begin copying.
TInt aLength The number of characters to copy.

CopyToStreamL(RWriteStream &, TInt, TInt, TStreamId)

IMPORT_C void CopyToStreamL ( RWriteStream & aStream,
TInt aPos,
TInt aLength,
TStreamId aGlobalTextId
) const [protected]

Parameters

RWriteStream & aStream
TInt aPos
TInt aLength
TStreamId aGlobalTextId

CopyToStreamL(RWriteStream &, TInt, TInt)

IMPORT_C void CopyToStreamL ( RWriteStream & aStream,
TInt aPos,
TInt aLength
) const [protected]

Parameters

RWriteStream & aStream
TInt aPos
TInt aLength

CreateEmptyMarkupComponentL()

TBool CreateEmptyMarkupComponentL ( ) [private]

CreateParserETextTLSL()

void CreateParserETextTLSL ( ) [private, static]

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

IMPORT_C TBool CursorOverTag ( TInt aPos,
MParser *& aParser,
TInt & aTagStart,
TInt & aLength
) const

Parameters

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

DeactivateParser(MParser *)

IMPORT_C void DeactivateParser ( MParser * aParser ) [static]

Parameters

MParser * aParser

DeactivateParserDefaults()

IMPORT_C void DeactivateParserDefaults ( ) [static]

DelSetInsertCharFormatL(TInt, TInt)

IMPORT_C TBool DelSetInsertCharFormatL ( TInt aPos,
TInt aLength
)

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 aPos The document position of the first character to delete.
TInt aLength The number of characters to delete.

DeleteFromParagraph(TInt, TInt)

IMPORT_C void DeleteFromParagraph ( TInt aPos,
TInt aLength
)

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 aPos The document position of the start of the range of characters to delete. Must be a valid document position, or a panic occurs.
TInt aLength The 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 TBool DeleteL ( TInt aPos,
TInt aLength
) [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 aPos The start of the range of characters to delete. Must be valid or a panic occurs.
TInt aLength The 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 void DeleteParagraph ( TInt aPos,
TInt aLength
)

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 aPos The document position of the start of the first paragraph to delete. Must be a valid position or a panic occurs.
TInt aLength The number of characters to delete.

DetachFromStoreL(CPicture::TDetach)

IMPORT_C void DetachFromStoreL ( CPicture::TDetach aDegree )

Parameters

CPicture::TDetach aDegree

DoAppendTakingSolePictureOwnershipL(const CRichText &)

void DoAppendTakingSolePictureOwnershipL ( const CRichText & aSource ) [protected]

Parameters

const CRichText & aSource

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

void DoApplyExtendedCharFormatL ( const TCharFormatX & aFormat,
const TCharFormatXMask & aMask,
TInt aPos,
TInt aLength
) [private]

Parameters

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

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

TStreamId DoCopyToStoreL ( CStreamStore & aStore,
TInt aPos,
TInt aLength,
TStreamId aGlobalTextId,
TBool aCopyStyles
) const [protected]

Parameters

CStreamStore & aStore
TInt aPos
TInt aLength
TStreamId aGlobalTextId
TBool aCopyStyles

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

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

Parameters

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

DoInternalizeMarkupDataL(RReadStream &)

IMPORT_C void DoInternalizeMarkupDataL ( RReadStream & aStream ) [protected]

Parameters

RReadStream & aStream

DoInternalizeStyleDataL(RReadStream &)

IMPORT_C void DoInternalizeStyleDataL ( RReadStream & aStream ) [protected]

Parameters

RReadStream & aStream

DoInternalizeStyleDataL(RReadStream &, const CStyleList *)

void DoInternalizeStyleDataL ( 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,
TInt aPos,
CParagraphStyle::TStylePasteMode aStylePasteMode
) [private]

Parameters

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

DropPictureOwnership(TInt)

IMPORT_C void DropPictureOwnership ( TInt aPos )

Parameters

TInt aPos

ExtendedInterface(TAny *&, TUid)

IMPORT_C void ExtendedInterface ( TAny *& aInterface,
TUid aInterfaceId
) [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 *& aInterface The interface corresponding to aInterfaceId if it is supported, or 0 if it is not
TUid aInterfaceId The UID indicating the interface to return

ExternalizeStyleDataL(RWriteStream &)

IMPORT_C void ExternalizeStyleDataL ( RWriteStream & aStream ) const

Externalises the style list owned by the rich text object.

Parameters

RWriteStream & aStream Stream to which to write the style list.

GenerateMarkupL()

void GenerateMarkupL ( ) [private]

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

IMPORT_C void GetCharFormat ( TCharFormat & aFormat,
TCharFormatMask & aVaries,
TInt aPos,
TInt aLength
) 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 & aFormat On return, contains the character format values for the range of characters.
TCharFormatMask & aVaries On return, indicates which character format attributes vary over the range.
TInt aPos Document position of the start of the range. Must be valid or a panic occurs.
TInt aLength Number of characters in the range. Must be greater than or equal to zero, or a panic occurs.

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

void GetExtendedCharFormat ( TCharFormatX & aFormat,
TCharFormatXMask & aVaries,
TInt aPos,
TInt aLength
) const

Parameters

TCharFormatX & aFormat
TCharFormatXMask & aVaries
TInt aPos
TInt aLength

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

IMPORT_C void GetParaFormatL ( CParaFormat * aFormat,
TParaFormatMask & aVaries,
TInt aPos,
TInt aLength,
CParaFormat::TParaFormatGetMode aMode = 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 * aFormat Must not be NULL or a panic occurs. On return, contains the effective paragraph formatting for the range of paragraphs.
TParaFormatMask & aVaries On return, a bitmask indicating which paragraph format attributes vary over the range of characters selected.
TInt aPos The document position of the start of the range.
TInt aLength The number of characters in the range.
CParaFormat::TParaFormatGetMode aMode = CParaFormat::EAllAttributes The 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 void GetParagraphFormatL ( CParaFormat * aFormat,
TInt aPos
) 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 * aFormat On return, filled with the paragraph's effective paragraph formatting.
TInt aPos Any document position within the paragraph of interest.

GetPictureSizeInTwips(TSize &, TInt)

IMPORT_C TInt GetPictureSizeInTwips ( TSize & aSize,
TInt aPos
) const [virtual]

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

Parameters

TSize & aSize On return, contains the size of the picture located at aPos.
TInt aPos Document position of the picture. Must be a valid position.

GetSpecificCharFormat(TCharFormat &, TCharFormatMask &, TInt)

IMPORT_C void GetSpecificCharFormat ( TCharFormat & aFormat,
TCharFormatMask & aMask,
TInt aPos
) 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 & aFormat On return contains the specific character formatting which applies to the character to the left of the document position.
TCharFormatMask & aMask On return, indicates which character format attributes have been applied specifically, (not taken from the global layers).
TInt aPos The document position. Must be valid or a panic occurs.

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

void GetSpecificCharFormatLeftRight ( TCharFormat & aFormat,
TCharFormatMask & aMask,
TInt aPos,
TBool aLeft
) const [private]

Parameters

TCharFormat & aFormat
TCharFormatMask & aMask
TInt aPos
TBool aLeft

GetSpecificCharFormatRight(TCharFormat &, TCharFormatMask &, TInt)

IMPORT_C void GetSpecificCharFormatRight ( TCharFormat & aFormat,
TCharFormatMask & aMask,
TInt aPos
) 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 & aFormat On return, contains the specific character formatting which applies to the character logically after the document position.
TCharFormatMask & aMask On return, indicates which character format attributes have been applied specifically, (not taken from the global layers).
TInt aPos The document position. Must be valid or a panic occurs.

GetSpecificParagraphFormatL(CParaFormat *, TParaFormatMask &, TInt)

IMPORT_C void GetSpecificParagraphFormatL ( CParaFormat * aFormat,
TParaFormatMask & aMask,
TInt aPos
) const

Parameters

CParaFormat * aFormat
TParaFormatMask & aMask
TInt aPos

GetTextAndExtendedFormat(TPtrC &, TCharFormatX &, TInt)

void GetTextAndExtendedFormat ( TPtrC & aText,
TCharFormatX & aFormat,
TInt aPos
) const

Parameters

TPtrC & aText
TCharFormatX & aFormat
TInt aPos

HasMarkupData()

IMPORT_C TBool HasMarkupData ( ) 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 void InsertL ( TInt aPos,
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 aPos The document position at which to insert the character/descriptor. Must be valid, or a panic occurs.
const TChar & aChar The character to insert.

InsertL(TInt, const TDesC &)

IMPORT_C void InsertL ( TInt aPos,
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 void InsertL ( TInt aPos,
const TPictureHeader & aHeader
)

Parameters

TInt aPos
const TPictureHeader & aHeader

InternalizeL(RReadStream &)

IMPORT_C void InternalizeL ( 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 & aStream Stream from which to read the rich text object.

InternalizeL(RReadStream &, const CStyleList *)

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

Parameters

RReadStream & aStream
const CStyleList * aExternalStyleList

InternalizeMarkupDataL(RReadStream &)

IMPORT_C void InternalizeMarkupDataL ( RReadStream & aStream )

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

Parameters

RReadStream & aStream Stream from which to internalise the rich text markup.

InternalizeStyleDataL(RReadStream &)

IMPORT_C void InternalizeStyleDataL ( 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 & aStream Stream from which to read the style list.

KillIndex()

void KillIndex ( ) [private]

KillStyleList()

void KillStyleList ( ) [private]

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

IMPORT_C CRichText * NewL ( const CParaFormatLayer * aGlobalParaLayer,
const CCharFormatLayer * aGlobalCharLayer,
TDocumentStorage aStorage = ESegmentedStorage,
TInt aDefaultTextGranularity = EDefaultTextGranularity,
TParaType aParaType = 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 * aGlobalParaLayer Pointer to the paragraph format layer referenced by the rich text object. Must not be NULL, or a panic occurs.
const CCharFormatLayer * aGlobalCharLayer Pointer to the character format layer referenced by the rich text object. Must not be NULL, or a panic occurs.
TDocumentStorage aStorage = ESegmentedStorage The type of in-memory buffer to use. Defaults to ESegmentedStorage which should rarely need to be changed.
TInt aDefaultTextGranularity = EDefaultTextGranularity Specifies the granularity of the in-memory buffer. Default is EDefaultTextGranularity bytes (=256), and this should rarely need to be changed.
TParaType aParaType = EMultiPara This 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,
TDocumentStorage aStorage = ESegmentedStorage,
TInt aDefaultTextGranularity = EDefaultTextGranularity,
TParaType aParaType = 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 * aGlobalParaLayer Pointer to the paragraph format layer referenced by the rich text object. Must not be NULL, or a panic occurs.
const CCharFormatLayer * aGlobalCharLayer Pointer to the character format layer referenced by the rich text object. Must not be NULL, or a panic occurs.
const CStyleList & aStyleList Style list. Holds the set of paragraph styles which can be used in the rich text object.
TDocumentStorage aStorage = ESegmentedStorage The type of in-memory buffer to use. Defaults to ESegmentedStorage which should rarely need to be changed.
TInt aDefaultTextGranularity = EDefaultTextGranularity Specifies the granularity of the in-memory buffer. Default is EDefaultTextGranularity bytes (=256), and this should rarely need to be changed.
TParaType aParaType = EMultiPara This 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,
TStreamId aStreamId,
const CParaFormatLayer * aGlobalParaLayer,
const CCharFormatLayer * aGlobalCharLayer,
MTextFieldFactory * aFieldFactory = NULL,
TDocumentStorage aStorage = 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 & aStore Stream store from which the object is restored.
TStreamId aStreamId ID of the stream store.
const CParaFormatLayer * aGlobalParaLayer Pointer to the paragraph format layer referenced by the rich text object. Must not be NULL, or a panic occurs.
const CCharFormatLayer * aGlobalCharLayer Pointer to the character format layer referenced by the rich text object. Must not be NULL, or a panic occurs.
MTextFieldFactory * aFieldFactory = NULL Pointer to a field factory. A field factory must be provided if the text object supports fields.
TDocumentStorage aStorage = ESegmentedStorage The 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,
TStreamId aStreamId,
const CParaFormatLayer * aGlobalParaLayer,
const CCharFormatLayer * aGlobalCharLayer,
MPictureFactory * aPictureFactory,
MRichTextStoreResolver * aStoreResolver,
MTextFieldFactory * aFieldFactory = NULL,
TDocumentStorage aStorage = 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 & aStore Stream store from which the object is restored.
TStreamId aStreamId ID of the stream store.
const CParaFormatLayer * aGlobalParaLayer Pointer to the paragraph format layer referenced by the rich text object. Must not be NULL, or a panic occurs.
const CCharFormatLayer * aGlobalCharLayer Pointer to the character format layer referenced by the rich text object. Must not be NULL, or a panic occurs.
MPictureFactory * aPictureFactory The 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 * aStoreResolver A 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 = NULL Pointer to a field factory. A field factory must be provided if the text object supports fields.
TDocumentStorage aStorage = ESegmentedStorage The type of in-memory buffer to use. Defaults to ESegmentedStorage which should rarely need to be changed.

NotifyStyleDeletedL(const CParagraphStyle *)

void NotifyStyleDeletedL ( 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 * aStyle Pointer to the style to remove from the rich text object.

OverrideFormatForParsersIfApplicable(TPtrC &, TCharFormatX &, TInt)

void OverrideFormatForParsersIfApplicable ( TPtrC & aText,
TCharFormatX & aFormat,
TInt aStartPos
) const [private]

Parameters

TPtrC & aText
TCharFormatX & aFormat
TInt aStartPos

ParagraphCount()

IMPORT_C TInt ParagraphCount ( ) 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 TInt ParagraphNumberForPos ( TInt & aPos ) const [virtual]

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

Parameters

TInt & aPos A 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,
TInt aPos,
TInt aLength
) const

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

Parameters

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

ParseText(TInt &, TInt &, TBool)

IMPORT_C TBool ParseText ( TInt & aStartOfTags,
TInt & aLength,
TBool aForceScanAllText
)

Parameters

TInt & aStartOfTags
TInt & aLength
TBool aForceScanAllText

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

IMPORT_C TInt PasteFromStoreL ( const CStreamStore & aStore,
const CStreamDictionary & aDictionary,
TInt aPos
) [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 & aStore The steam store from which to paste the text.
const CStreamDictionary & aDictionary The stream dictionary.
TInt aPos Document position at which to paste. Must be valid or the function raises a panic.

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

IMPORT_C TInt PasteFromStoreL ( const CStreamStore & aStore,
const CStreamDictionary & aDictionary,
TInt aPos,
CParagraphStyle::TStylePasteMode aStylePasteMode
)

Parameters

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

PastePlainTextFromStoreL(const CStreamStore &, TStreamId &, TInt)

TInt PastePlainTextFromStoreL ( const CStreamStore & aStore,
TStreamId & anId,
TInt aPos
) [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,
TInt aPos,
CParagraphStyle::TStylePasteMode aStylePasteMode
) [protected]

Parameters

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

PictureCount()

IMPORT_C TInt PictureCount ( ) const

PictureHandleL(TInt, MLayDoc::TForcePictureLoad)

IMPORT_C CPicture * PictureHandleL ( TInt aPos,
MLayDoc::TForcePictureLoad aForceLoad = 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 aPos Document position of the picture character. Must be a valid position.
MLayDoc::TForcePictureLoad aForceLoad = MLayDoc::EForceLoadTrue If 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 TPictureHeader PictureHeader ( TInt aPos ) const

Parameters

TInt aPos

PositionOfNextTag(TInt)

IMPORT_C TInt PositionOfNextTag ( TInt aPos ) const

Parameters

TInt aPos

PositionOfNextTag(TInt, const MParser *)

IMPORT_C TInt PositionOfNextTag ( TInt aPos,
const MParser * aParser
) const

Parameters

TInt aPos
const MParser * aParser

PositionOfPrevTag(TInt)

IMPORT_C TInt PositionOfPrevTag ( TInt aPos ) const

Parameters

TInt aPos

PositionOfPrevTag(TInt, const MParser *)

IMPORT_C TInt PositionOfPrevTag ( TInt aPos,
const MParser * aParser
) const

Parameters

TInt aPos
const MParser * aParser

PrepareAppendMarkupL(const CRichText &)

void PrepareAppendMarkupL ( const CRichText & aSource ) [protected]

Parameters

const CRichText & aSource

RemoveSpecificCharFormatL(TInt, TInt)

IMPORT_C void RemoveSpecificCharFormatL ( TInt aPos,
TInt aLength
)

Parameters

TInt aPos
TInt aLength

RemoveSpecificParaFormatL(TInt, TInt)

IMPORT_C void RemoveSpecificParaFormatL ( TInt aPos,
TInt aLength
)

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 aPos The document position of the start of the range.
TInt aLength The number of characters in the range.

Reset()

IMPORT_C void Reset ( ) [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 void RestoreComponentsL ( const CStreamStore & aStore ) [virtual]

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

Parameters

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

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

IMPORT_C void RestoreWithStyleListL ( const CStreamStore & aStore,
TStreamId aStreamId,
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 & aStore Stream store from which the object is restored.
TStreamId aStreamId ID of the stream store.
const CStyleList & aExternalStyleList An externally owned style list.

RtInsertL(TInt, const TDesC &)

IMPORT_C void RtInsertL ( TInt aPos,
const TDesC & aBuf
) [protected]

Parameters

TInt aPos
const TDesC & aBuf

SetEditObserver(MEditObserver *)

IMPORT_C void SetEditObserver ( 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 * aEditObserver Pointer to the edit observer.

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

void SetExtendedInsertCharFormatL ( const TCharFormatX & aFormat,
const TCharFormatXMask & aMask,
TInt aPos
) [private]

Parameters

const TCharFormatX & aFormat
const TCharFormatXMask & aMask
TInt aPos

SetHasChanged(TBool)

IMPORT_C void SetHasChanged ( TBool aHasChanged ) [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 aHasChanged ETrue if the text object has been changed, EFalse if not.

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

IMPORT_C void SetInsertCharFormatL ( const TCharFormat & aFormat,
const TCharFormatMask & aMask,
TInt aPos
)

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 & aFormat The character format values to apply.
const TCharFormatMask & aMask Character format mask specifying the attributes affected.
TInt aPos The document position at which to insert the character format.

SetParaTypeIsSingle(TBool)

void SetParaTypeIsSingle ( TBool aBool ) [private, inline]

Parameters

TBool aBool

SetPictureFactory(MPictureFactory *, MRichTextStoreResolver *)

IMPORT_C void SetPictureFactory ( 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 * aPictureFactory The picture factory.
MRichTextStoreResolver * aStoreResolver The store resolver. This determines which file store the picture is stored in.

SetStyleListExternallyOwned(TBool)

void SetStyleListExternallyOwned ( TBool aExternallyOwned ) [inline]

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

Parameters

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

StoreComponentsL(CStreamStore &, CStoreMap &)

IMPORT_C void StoreComponentsL ( 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 & aStore Stream store to which the text components are written.
CStoreMap & aMap A 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 void StoreMarkupComponentsL ( CStreamStore & aStore,
CStoreMap & aMap
) const

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

Parameters

CStreamStore & aStore Stream store to which the pictures are to be stored.
CStoreMap & aMap A 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 &)

void StoreMarkupL ( 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 &)

void StoreStylesL ( 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 void UpdateFieldL ( TInt aPos ) [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 aPos A 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]