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.
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 &) |
Public Member Enumerations | |
---|---|
enum | TParaType { ESinglePara, EMultiPara } |
Protected Member Enumerations | |
---|---|
enum | anonymous { EDelimiterCharacterLength = 1 } |
Private Attributes | |
---|---|
__DECLARE_TEST | |
TUint32 | iFlags |
TSwizzle< CRichTextIndex > | iIndex |
CParserData * | iParserData |
MPictureFactory * | iPictureFactory |
void * | iReserved_3 |
MRichTextStoreResolver * | iStoreResolver |
TSwizzle< CStyleList > | iStyleList |
CRichText | ( | const CRichText & | aRichText | ) | [private] |
const CRichText & aRichText |
IMPORT_C | CRichText | ( | const CParaFormatLayer * | aGlobalParaLayer, |
const CCharFormatLayer * | aGlobalCharLayer, | |||
CStyleList * | aStyleList = NULL | |||
) | [protected] |
const CParaFormatLayer * aGlobalParaLayer | |
const CCharFormatLayer * aGlobalCharLayer | |
CStyleList * aStyleList = NULL |
IMPORT_C | ~CRichText | ( | ) | [virtual] |
The destructor frees all resources owned by the rich text object, prior to its destruction.
IMPORT_C void | ActivateParserL | ( | MParser * | aParser | ) | [static] |
MParser * aParser |
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.
const CRichText & aSource | The rich text object to append. |
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.
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. |
void | ApplyExtendedCharFormatL | ( | const TCharFormatX & | aFormat, |
const TCharFormatXMask & | aMask, | |||
TInt | aPos, | |||
TInt | aLength | |||
) |
const TCharFormatX & aFormat | |
const TCharFormatXMask & aMask | |
TInt aPos | |
TInt aLength |
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
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. |
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.
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.
IMPORT_C void | ConstructL | ( | TDocumentStorage | aStorage, |
TInt | aDefaultTextGranularity, | |||
TParaType | aParaType | |||
) | [protected] |
TDocumentStorage aStorage | |
TInt aDefaultTextGranularity | |
TParaType aParaType |
IMPORT_C void | ConstructL | ( | const CStreamStore & | aStore, |
TStreamId | aStreamId, | |||
MPictureFactory * | aFactory, | |||
MRichTextStoreResolver * | aStoreResolver, | |||
MTextFieldFactory * | aFieldFactory = NULL, | |||
TDocumentStorage | aStorage = ESegmentedStorage | |||
) | [protected] |
const CStreamStore & aStore | |
TStreamId aStreamId | |
MPictureFactory * aFactory | |
MRichTextStoreResolver * aStoreResolver | |
MTextFieldFactory * aFieldFactory = NULL | |
TDocumentStorage aStorage = ESegmentedStorage |
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
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. |
IMPORT_C void | CopyToStreamL | ( | RWriteStream & | aStream, |
TInt | aPos, | |||
TInt | aLength, | |||
TStreamId | aGlobalTextId | |||
) | const [protected] |
RWriteStream & aStream | |
TInt aPos | |
TInt aLength | |
TStreamId aGlobalTextId |
IMPORT_C void | CopyToStreamL | ( | RWriteStream & | aStream, |
TInt | aPos, | |||
TInt | aLength | |||
) | const [protected] |
RWriteStream & aStream | |
TInt aPos | |
TInt aLength |
IMPORT_C TBool | CursorOverTag | ( | TInt | aPos, |
MParser *& | aParser, | |||
TInt & | aTagStart, | |||
TInt & | aLength | |||
) | const |
IMPORT_C void | DeactivateParser | ( | MParser * | aParser | ) | [static] |
MParser * aParser |
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
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.
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.
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.
IMPORT_C void | DetachFromStoreL | ( | CPicture::TDetach | aDegree | ) |
CPicture::TDetach aDegree |
void | DoAppendTakingSolePictureOwnershipL | ( | const CRichText & | aSource | ) | [protected] |
const CRichText & aSource |
void | DoApplyExtendedCharFormatL | ( | const TCharFormatX & | aFormat, |
const TCharFormatXMask & | aMask, | |||
TInt | aPos, | |||
TInt | aLength | |||
) | [private] |
const TCharFormatX & aFormat | |
const TCharFormatXMask & aMask | |
TInt aPos | |
TInt aLength |
TStreamId | DoCopyToStoreL | ( | CStreamStore & | aStore, |
TInt | aPos, | |||
TInt | aLength, | |||
TStreamId | aGlobalTextId, | |||
TBool | aCopyStyles | |||
) | const [protected] |
CStreamStore & aStore | |
TInt aPos | |
TInt aLength | |
TStreamId aGlobalTextId | |
TBool aCopyStyles |
TBool | DoCursorOverTag | ( | TInt | aPos, |
MParser *& | aParser, | |||
TInt & | aTagStart, | |||
TInt & | aLength | |||
) | const [private] |
IMPORT_C void | DoInternalizeMarkupDataL | ( | RReadStream & | aStream | ) | [protected] |
RReadStream & aStream |
IMPORT_C void | DoInternalizeStyleDataL | ( | RReadStream & | aStream | ) | [protected] |
RReadStream & aStream |
void | DoInternalizeStyleDataL | ( | RReadStream & | aStream, |
const CStyleList * | aExternalStyleList | |||
) | [protected] |
RReadStream & aStream | |
const CStyleList * aExternalStyleList |
TInt | DoPasteRtFromStoreL | ( | const CStreamStore & | aStore, |
const CStreamDictionary & | aDictionary, | |||
TInt | aPos, | |||
CParagraphStyle::TStylePasteMode | aStylePasteMode | |||
) | [private] |
const CStreamStore & aStore | |
const CStreamDictionary & aDictionary | |
TInt aPos | |
CParagraphStyle::TStylePasteMode aStylePasteMode |
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.
IMPORT_C void | ExternalizeStyleDataL | ( | RWriteStream & | aStream | ) | const |
Externalises the style list owned by the rich text object.
RWriteStream & aStream | Stream to which to write the style list. |
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.
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. |
void | GetExtendedCharFormat | ( | TCharFormatX & | aFormat, |
TCharFormatXMask & | aVaries, | |||
TInt | aPos, | |||
TInt | aLength | |||
) | const |
TCharFormatX & aFormat | |
TCharFormatXMask & aVaries | |
TInt aPos | |
TInt aLength |
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.
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. |
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.
CParaFormat * aFormat | On return, filled with the paragraph's effective paragraph formatting. |
TInt aPos | Any document position within the paragraph of interest. |
IMPORT_C TInt | GetPictureSizeInTwips | ( | TSize & | aSize, |
TInt | aPos | |||
) | const [virtual] |
Gets the size of a picture located at a specified document position.
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.
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. |
void | GetSpecificCharFormatLeftRight | ( | TCharFormat & | aFormat, |
TCharFormatMask & | aMask, | |||
TInt | aPos, | |||
TBool | aLeft | |||
) | const [private] |
TCharFormat & aFormat | |
TCharFormatMask & aMask | |
TInt aPos | |
TBool aLeft |
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.
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. |
IMPORT_C void | GetSpecificParagraphFormatL | ( | CParaFormat * | aFormat, |
TParaFormatMask & | aMask, | |||
TInt | aPos | |||
) | const |
CParaFormat * aFormat | |
TParaFormatMask & aMask | |
TInt aPos |
void | GetTextAndExtendedFormat | ( | TPtrC & | aText, |
TCharFormatX & | aFormat, | |||
TInt | aPos | |||
) | const |
TPtrC & aText | |
TCharFormatX & aFormat | |
TInt aPos |
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.
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.
IMPORT_C void | InsertL | ( | TInt | aPos, |
const TDesC & | aBuf | |||
) | [virtual] |
Inserts the contents of aBuf into the document at position aPos.
IMPORT_C void | InsertL | ( | TInt | aPos, |
const TPictureHeader & | aHeader | |||
) |
TInt aPos | |
const TPictureHeader & aHeader |
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.
RReadStream & aStream | Stream from which to read the rich text object. |
void | InternalizeL | ( | RReadStream & | aStream, |
const CStyleList * | aExternalStyleList | |||
) | [protected] |
RReadStream & aStream | |
const CStyleList * aExternalStyleList |
IMPORT_C void | InternalizeMarkupDataL | ( | RReadStream & | aStream | ) |
Internalises the rich text object's markup (specific formatting, styles and pictures).
RReadStream & aStream | Stream from which to internalise the rich text markup. |
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.
RReadStream & aStream | Stream from which to read the style list. |
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.
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. |
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.
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. |
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.
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. |
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.
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. |
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()).
const CParagraphStyle * aStyle | Pointer to the style to remove from the rich text object. |
void | OverrideFormatForParsersIfApplicable | ( | TPtrC & | aText, |
TCharFormatX & | aFormat, | |||
TInt | aStartPos | |||
) | const [private] |
TPtrC & aText | |
TCharFormatX & aFormat | |
TInt aStartPos |
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.
IMPORT_C TInt | ParagraphNumberForPos | ( | TInt & | aPos | ) | const [virtual] |
Gets the number of the paragraph which contains a document position. Paragraph numbering begins at zero.
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. |
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.
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. |
IMPORT_C TBool | ParseText | ( | TInt & | aStartOfTags, |
TInt & | aLength, | |||
TBool | aForceScanAllText | |||
) |
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.
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. |
IMPORT_C TInt | PasteFromStoreL | ( | const CStreamStore & | aStore, |
const CStreamDictionary & | aDictionary, | |||
TInt | aPos, | |||
CParagraphStyle::TStylePasteMode | aStylePasteMode | |||
) |
const CStreamStore & aStore | |
const CStreamDictionary & aDictionary | |
TInt aPos | |
CParagraphStyle::TStylePasteMode aStylePasteMode |
TInt | PastePlainTextFromStoreL | ( | const CStreamStore & | aStore, |
TStreamId & | anId, | |||
TInt | aPos | |||
) | [protected] |
const CStreamStore & aStore | |
TStreamId & anId | |
TInt aPos |
TInt | PasteRichTextFromStoreL | ( | const CStreamStore & | aStore, |
const CStreamDictionary & | aDictionary, | |||
TStreamId & | anId, | |||
TInt | aPos, | |||
CParagraphStyle::TStylePasteMode | aStylePasteMode | |||
) | [protected] |
const CStreamStore & aStore | |
const CStreamDictionary & aDictionary | |
TStreamId & anId | |
TInt aPos | |
CParagraphStyle::TStylePasteMode aStylePasteMode |
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.
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. |
IMPORT_C TInt | PositionOfNextTag | ( | TInt | aPos, |
const MParser * | aParser | |||
) | const |
IMPORT_C TInt | PositionOfPrevTag | ( | TInt | aPos, |
const MParser * | aParser | |||
) | const |
void | PrepareAppendMarkupL | ( | const CRichText & | aSource | ) | [protected] |
const CRichText & aSource |
IMPORT_C void | RemoveSpecificCharFormatL | ( | TInt | aPos, |
TInt | aLength | |||
) |
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
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.
IMPORT_C void | RestoreComponentsL | ( | const CStreamStore & | aStore | ) | [virtual] |
Restores the plain text object's field set from a stream store.
const CStreamStore & aStore | The stream store from which the field set is restored. |
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.
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. |
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.).
MEditObserver * aEditObserver | Pointer to the edit observer. |
void | SetExtendedInsertCharFormatL | ( | const TCharFormatX & | aFormat, |
const TCharFormatXMask & | aMask, | |||
TInt | aPos | |||
) | [private] |
const TCharFormatX & aFormat | |
const TCharFormatXMask & aMask | |
TInt aPos |
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.
TBool aHasChanged | ETrue if the text object has been changed, EFalse if not. |
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.
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. |
void | SetParaTypeIsSingle | ( | TBool | aBool | ) | [private, inline] |
TBool aBool |
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.
MPictureFactory * aPictureFactory | The picture factory. |
MRichTextStoreResolver * aStoreResolver | The store resolver. This determines which file store the picture is stored in. |
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.
TBool aExternallyOwned | ETrue if the style list should be marked as externally owned, EFalse if not. |
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.
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. |
IMPORT_C void | StoreMarkupComponentsL | ( | CStreamStore & | aStore, |
CStoreMap & | aMap | |||
) | const |
Stores all pictures in the rich text object to a stream store.
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. |
void | StoreMarkupL | ( | CStreamStore & | aStore, |
CStoreMap & | aMap | |||
) | const [protected] |
CStreamStore & aStore | |
CStoreMap & aMap |
MRichTextStoreResolver * | StoreResolver | ( | ) | const [inline] |
Gets the store resolver. A store resolver may be set during construction, or by calling CRichText::SetPictureFactory().
void | StoreStylesL | ( | CStreamStore & | aStore, |
CStoreMap & | aMap | |||
) | const [protected] |
CStreamStore & aStore | |
CStoreMap & aMap |
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().
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.
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
TInt aPos | A document position in the field to be updated. Must be a valid position, or a panic occurs. |
CRichText & | operator= | ( | const CRichText & | aRichText | ) | [private] |
const CRichText & aRichText |
Number of paragraphs in the object.
ESinglePara |
The text object will contain a single paragraph. |
EMultiPara |
The text object will contain multiple paragraphs. |
Copyright ©2010 Nokia Corporation and/or its subsidiary(-ies).
All rights
reserved. Unless otherwise stated, these materials are provided under the terms of the Eclipse Public License
v1.0.