CEditableText Class Reference

class CEditableText : public CBase

An abstract base class which defines the behaviour common to all editable text classes.

It provides no storage for text or text formatting, so it is not directly usable. It defines protocols for editing the contents of a text object and for extracting format data from a text object which supports formatting.

Note: when specifying a position in a text object (the document position), zero is before the first character in the document. If the document contains n characters, position n is after the last character. Valid document positions are therefore between zero and the length of the document, inclusive. Many editable text functions raise a panic if a specified document position is invalid.

Note also that the functions which implement support for front-end-processor inline editing are intended for internal use only by Symbian.

Inherits from

Public Member Functions
~CEditableText()
IMPORT_C voidCancelFepInlineEdit(TBool &, TInt &, TInt &, TInt &, TInt)
IMPORT_C voidCommitFepInlineEditL(TBool &, TInt &, TInt &, TInt &, TInt)
voidCopyToStoreL(CStreamStore &, CStreamDictionary &, TInt, TInt)
TBool DeleteL(TInt, TInt)
TInt DocumentLength()
IMPORT_C voidExtendedInterface(TAny *&, TUid)
voidExternalizeL(RWriteStream &)
voidExtract(TDes &, TInt)
voidExtract(TDes &, TInt, TInt)
IMPORT_C TIntGetLengthOfInlineText()
IMPORT_C TIntGetPositionOfInlineTextInDocument()
voidGetWordInfo(TInt, TInt &, TInt &, TBool, TBool)
TBool HasChanged()
voidInsertL(TInt, const TChar &)
voidInsertL(TInt, const TDesC &)
voidInternalizeL(RReadStream &)
TInt ParagraphCount()
TInt PasteFromStoreL(const CStreamStore &, const CStreamDictionary &, TInt)
TPtrC Read(TInt)
TPtrC Read(TInt, TInt)
voidReset()
voidRestoreComponentsL(const CStreamStore &)
IMPORT_C voidRestoreL(const CStreamStore &, TStreamId)
IMPORT_C TIntScanParas(TInt &, TUint &)
IMPORT_C TIntScanWords(TInt &, TUint &)
IMPORT_C voidSetHasChanged(TBool)
IMPORT_C voidStartFepInlineEditL(TBool &, TInt &, TInt &, TInt &, TInt, const TDesC &, TInt, TInt, MFepInlineTextFormatRetriever &)
voidStoreComponentsL(CStreamStore &, CStoreMap &)
IMPORT_C TStreamIdStoreL(CStreamStore &)
TInt ToParagraphStart(TInt &)
IMPORT_C voidUpdateFepInlineTextL(TBool &, TInt &, TInt &, TInt &, TInt, const TDesC &)
TInt WordCount()
Protected Member Functions
IMPORT_C voidOverrideFormatOfInlineTextIfApplicable(TPtrC &, TCharFormat &, TInt)
Private Member Functions
voidDeleteInlineEditDataAndSetToNull()
TBool DeleteWithoutDestroyingFormatL(TInt, TInt)
CInlineEditData *InlineEditData()
voidSetAndTransferOwnershipOfInlineEditDataL(CInlineEditData *)
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()
Public Member Enumerations
enumanonymous { EDefaultTextGranularity = 256 }
enumanonymous {
ETabCharacter = 0x0009, EPageBreak = 0x000C, ESpace = 0x0020, EApostrophe = 0x0027, EHyphenMinus = 0x002D, ENonBreakingSpace = 0x00A0, EPotentialHyphen = 0x00AD, EHyphen = 0x2010, ENonBreakingHyphen = 0x2011, ELeftSingleQuote = 0x2018, ERightSingleQuote = 0x2019, ELeftDoubleQuote = 0x201C, ERightDoubleQuote = 0x201D, EBullet = 0x2022, EEllipsis = 0x2026, ELineBreak = 0x2028, EParagraphDelimiter = 0x2029, EPictureCharacter = 0xFFFC, EZeroWidthNoBreakSpace = 0xFEFF, EByteOrderMark = 0xFEFF, EReversedByteOrderMark = 0xFFFE
}
enumTDocumentStorage { EFlatStorage, ESegmentedStorage }
Protected Attributes
TBool iHasChanged
Private Attributes
CEditableTextOptionalData *iOptionalData

Constructor & Destructor Documentation

~CEditableText()

IMPORT_C~CEditableText()

Member Functions Documentation

CancelFepInlineEdit(TBool &, TInt &, TInt &, TInt &, TInt)

IMPORT_C voidCancelFepInlineEdit(TBool &aParagraphContainingStartPositionOfInlineTextHasChangedFormat,
TInt &aNumberOfCharactersSuccessfullyDeleted,
TInt &aNumberOfCharactersSuccessfullyInserted,
TInt &aPositionOfInsertionPointInDocument,
TIntaNewPositionOfInsertionPointInDocument
)

Parameters

TBool & aParagraphContainingStartPositionOfInlineTextHasChangedFormat
TInt & aNumberOfCharactersSuccessfullyDeleted
TInt & aNumberOfCharactersSuccessfullyInserted
TInt & aPositionOfInsertionPointInDocument
TInt aNewPositionOfInsertionPointInDocument

CommitFepInlineEditL(TBool &, TInt &, TInt &, TInt &, TInt)

IMPORT_C voidCommitFepInlineEditL(TBool &aParagraphContainingStartPositionOfInlineTextHasChangedFormat,
TInt &aNumberOfCharactersSuccessfullyDeleted,
TInt &aNumberOfCharactersSuccessfullyInserted,
TInt &aPositionOfInsertionPointInDocument,
TIntaNewPositionOfInsertionPointInDocument
)

Parameters

TBool & aParagraphContainingStartPositionOfInlineTextHasChangedFormat
TInt & aNumberOfCharactersSuccessfullyDeleted
TInt & aNumberOfCharactersSuccessfullyInserted
TInt & aPositionOfInsertionPointInDocument
TInt aNewPositionOfInsertionPointInDocument

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

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

Copies a portion of the text to the clipboard.

Parameters

CStreamStore & aStoreThe clipboard's store (see class CClipboard).
CStreamDictionary & aDictionaryThe clipboard's stream dictionary (see class CClipboard).
TInt aPosA valid document position from which to begin copying.
TInt aLengthThe number of characters to copy.

DeleteInlineEditDataAndSetToNull()

voidDeleteInlineEditDataAndSetToNull()[private]

DeleteL(TInt, TInt)

TBool DeleteL(TIntaPos,
TIntaLength
)[pure virtual]

Deletes one or more characters beginning at (and including) the character at the specified document position.

Parameters

TInt aPosThe document position from which to delete.
TInt aLengthThe number of characters to delete.

DeleteWithoutDestroyingFormatL(TInt, TInt)

TBool DeleteWithoutDestroyingFormatL(TIntaPos,
TIntaLength
)[private]

Deletes a range of characters. For rich text the format of the deleted character at position aPos is preserved, so that any text subsequently inserted at aPos will have that format applied to it.

Parameters

TInt aPosThe document position from which to begin deleting including aPos.
TInt aLengthThe number of characters to delete. Must be positive or a panic occurs. The sum of aPos and aLength must be less than the document length, or a panic occurs.

DocumentLength()

TInt DocumentLength()const [pure virtual]

Returns a count of the number of characters in the document, excluding the end-of-text paragraph delimiter.

ExtendedInterface(TAny *&, TUid)

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

Returns the interface corresponding to the specified UID if it exists, or 0 if not. Overridden versions should base call rather than returning 0.

Parameters

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

ExternalizeL(RWriteStream &)

voidExternalizeL(RWriteStream &aStream)const [virtual]

Parameters

RWriteStream & aStream

Extract(TDes &, TInt)

voidExtract(TDes &aBuf,
TIntaPos = 0
)const [pure virtual]

Copies a portion of the text into a descriptor.

Starts at the position specified and continues to the end of the document. A length may optionally be specified.

Parameters

TDes & aBufBuffer which on return contains the extracted text.
TInt aPos = 0The document position from which to copy. Must be a valid position, or a panic occurs.

Extract(TDes &, TInt, TInt)

voidExtract(TDes &aBuf,
TIntaPos,
TIntaLength
)const [pure virtual]

Copies a portion of the text into a descriptor. Starts at the position specified and continues to the end of the document. A length may optionally be specified.

Parameters

TDes & aBufBuffer which on return contains the extracted text.
TInt aPosThe document position from which to copy. Must be a valid position, or a panic occurs.
TInt aLengthIf specified, the number of characters to copy.

GetLengthOfInlineText()

IMPORT_C TIntGetLengthOfInlineText()const

GetPositionOfInlineTextInDocument()

IMPORT_C TIntGetPositionOfInlineTextInDocument()const

GetWordInfo(TInt, TInt &, TInt &, TBool, TBool)

voidGetWordInfo(TIntaCurrentPos,
TInt &aStartPos,
TInt &aLength,
TBoolaPictureIsDelimiter,
TBoolaPunctuationIsDelimiter
)const [pure virtual]

Returns the start position and length of the word that contains the specified document position.

Parameters

TInt aCurrentPosA valid document position.
TInt & aStartPosOn return, the document position of the first character in the word containing document position aCurrentPos.
TInt & aLengthOn return, the length of the word containing document position aCurrentPos. Does not include the trailing word delimiter character.
TBool aPictureIsDelimiterSpecifies whether picture characters should be considered to be word delimiters. For example, this value might be EFalse when navigating a document, but ETrue when carrying out spell checking.
TBool aPunctuationIsDelimiterSpecifies whether puncutation characters should be considered to be word delimiters.

HasChanged()

TBool HasChanged()const [inline]

Tests whether the editable text object has been changed by an operation on it, as set by SetHasChanged().

InlineEditData()

CInlineEditData *InlineEditData()const [private]

InsertL(TInt, const TChar &)

voidInsertL(TIntaInsertPos,
const TChar &aChar
)[pure virtual]

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

Parameters

TInt aInsertPosA valid document position at which to insert the character or descriptor.
const TChar & aCharThe character to insert.

InsertL(TInt, const TDesC &)

voidInsertL(TIntaInsertPos,
const TDesC &aBuf
)[pure virtual]

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

Parameters

TInt aInsertPosA valid document position at which to insert the character or descriptor.
const TDesC & aBufThe descriptor to insert.

InternalizeL(RReadStream &)

voidInternalizeL(RReadStream &aStream)[virtual]

Parameters

RReadStream & aStream

OverrideFormatOfInlineTextIfApplicable(TPtrC &, TCharFormat &, TInt)

IMPORT_C voidOverrideFormatOfInlineTextIfApplicable(TPtrC &aView,
TCharFormat &aFormat,
TIntaStartPos
)const [protected]

Parameters

TPtrC & aView
TCharFormat & aFormat
TInt aStartPos

ParagraphCount()

TInt ParagraphCount()const [pure virtual]

Returns a count of the number of paragraphs in the document.

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

TInt PasteFromStoreL(const CStreamStore &aStore,
const CStreamDictionary &aDictionary,
TIntaPos
)[pure virtual]

Pastes the contents of the clipboard into the text object at the specified document position.

Parameters

const CStreamStore & aStoreThe clipboard's store (see class CClipboard).
const CStreamDictionary & aDictionaryThe clipboard's stream dictionary (see class CClipboard).
TInt aPosA valid document position at which to paste the text.

Read(TInt)

TPtrC Read(TIntaStartPos)const [pure virtual]

Gets a read-only pointer descriptor to a portion of the text.

Parameters

TInt aStartPosA valid document position from which to read.

Read(TInt, TInt)

TPtrC Read(TIntaStartPos,
TIntaLength
)const [pure virtual]

Gets a read-only pointer descriptor to a portion of the text.

Parameters

TInt aStartPosA valid document position from which to read.
TInt aLengthIf specified, the number of characters to read, inclusive of the character at position aStartPos. If not specified, the read continues to the end of the document, or the end of the segment if using segmented storage.

Reset()

voidReset()[pure virtual]

Deletes the text content and components from the text object, leaving the single end-of-text paragraph delimiter.

RestoreComponentsL(const CStreamStore &)

voidRestoreComponentsL(const CStreamStore &aStore)[pure virtual]

Restores the text components, e.g. fields, pictures and formatting from the stream store. Does not restore the text content.

Parameters

const CStreamStore & aStoreThe stream store from which the text components are restored.

RestoreL(const CStreamStore &, TStreamId)

IMPORT_C voidRestoreL(const CStreamStore &aStore,
TStreamIdaStreamId
)

Restores the text and its components from a stream store.

Parameters

const CStreamStore & aStoreStream store containing the text and its components.
TStreamId aStreamIdThe ID of the stream store in which the text was previously stored.

ScanParas(TInt &, TUint &)

IMPORT_C TIntScanParas(TInt &aPos,
TUint &aScanMask
)const [virtual]

Scans the text from a specified document position to a location determined by the flags specified in a bitmask. The function can scan forwards or backwards to the beginning or end of a paragraph.

Parameters

TInt & aPosA valid document position from which to scan. On return, contains the new document position.
TUint & aScanMaskThe scan mask to use. See the scanning enumeration defined in class CPlainText.

ScanWords(TInt &, TUint &)

IMPORT_C TIntScanWords(TInt &aPos,
TUint &aScanMask
)const [virtual]

Scans the text from a specified document position to a location determined by the flags specified in a bitmask. The function can scan forwards or backwards to the beginning or end of a word.

Parameters

TInt & aPosA valid document position from which to scan. On return, contains the new document position.
TUint & aScanMaskThe scan mask to use. See the scanning enumeration defined in class CPlainText.

SetAndTransferOwnershipOfInlineEditDataL(CInlineEditData *)

voidSetAndTransferOwnershipOfInlineEditDataL(CInlineEditData *aInlineEditData)[private]

Parameters

CInlineEditData * aInlineEditData

SetHasChanged(TBool)

IMPORT_C voidSetHasChanged(TBoolaHasChanged)[virtual]

Sets whether a change has occurred to the editable text object. This is called by functions which change the text object in some way.

Parameters

TBool aHasChangedETrue if a change has occurred to the text object. EFalse if no change has occurred.

StartFepInlineEditL(TBool &, TInt &, TInt &, TInt &, TInt, const TDesC &, TInt, TInt, MFepInlineTextFormatRetriever &)

IMPORT_C voidStartFepInlineEditL(TBool &aParagraphContainingStartPositionOfInlineTextHasChangedFormat,
TInt &aNumberOfCharactersSuccessfullyDeleted,
TInt &aNumberOfCharactersSuccessfullyInserted,
TInt &aPositionOfInsertionPointInDocument,
TIntaNewPositionOfInsertionPointInDocument,
const TDesC &aInitialInlineText,
TIntaPositionOfInlineTextInDocument,
TIntaNumberOfCharactersToHide,
MFepInlineTextFormatRetriever &aInlineTextFormatRetriever
)

Parameters

TBool & aParagraphContainingStartPositionOfInlineTextHasChangedFormat
TInt & aNumberOfCharactersSuccessfullyDeleted
TInt & aNumberOfCharactersSuccessfullyInserted
TInt & aPositionOfInsertionPointInDocument
TInt aNewPositionOfInsertionPointInDocument
const TDesC & aInitialInlineText
TInt aPositionOfInlineTextInDocument
TInt aNumberOfCharactersToHide
MFepInlineTextFormatRetriever & aInlineTextFormatRetriever

StoreComponentsL(CStreamStore &, CStoreMap &)

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

Stores the text components, e.g. fields, pictures and formatting to the stream store specified. Does not store the text content.

Parameters

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

StoreL(CStreamStore &)

IMPORT_C TStreamIdStoreL(CStreamStore &aStore)const

Stores the text and its components. The components (e.g. fields and pictures) are stored in separate streams within the stream store.

Parameters

CStreamStore & aStoreStream store to which the text and text components are written.

ToParagraphStart(TInt &)

TInt ToParagraphStart(TInt &aPos)const [pure virtual]

Updates a document position to the start of the paragraph.

Parameters

TInt & aPosInitially specifies a valid document position. On return, set to the document position of the first character in the paragraph.

UpdateFepInlineTextL(TBool &, TInt &, TInt &, TInt &, TInt, const TDesC &)

IMPORT_C voidUpdateFepInlineTextL(TBool &aParagraphContainingStartPositionOfInlineTextHasChangedFormat,
TInt &aNumberOfCharactersSuccessfullyDeleted,
TInt &aNumberOfCharactersSuccessfullyInserted,
TInt &aPositionOfInsertionPointInDocument,
TIntaNewPositionOfInsertionPointInDocument,
const TDesC &aNewInlineText
)

Parameters

TBool & aParagraphContainingStartPositionOfInlineTextHasChangedFormat
TInt & aNumberOfCharactersSuccessfullyDeleted
TInt & aNumberOfCharactersSuccessfullyInserted
TInt & aPositionOfInsertionPointInDocument
TInt aNewPositionOfInsertionPointInDocument
const TDesC & aNewInlineText

WordCount()

TInt WordCount()const [pure virtual]

Returns a count of the number of words in the document.

Member Enumerations Documentation

Enum anonymous

Miscellaneous constants.

Enumerators

EDefaultTextGranularity = 256

Granularity of the buffer, default 256 characters.

Enum anonymous

Enumerators

ETabCharacter = 0x0009

Tab stop.

EPageBreak = 0x000C

New page.

ESpace = 0x0020

Visible space character.

EApostrophe = 0x0027
EHyphenMinus = 0x002D
ENonBreakingSpace = 0x00A0

A hard (non-breaking) space.

EPotentialHyphen = 0x00AD

A soft hyphen (ensures that a hyphen followed by a new line will be inserted at that point should a line break be required anywhere within the word).

EHyphen = 0x2010
ENonBreakingHyphen = 0x2011

A hard (non-breaking) hyphen.

ELeftSingleQuote = 0x2018
ERightSingleQuote = 0x2019
ELeftDoubleQuote = 0x201C
ERightDoubleQuote = 0x201D
EBullet = 0x2022
EEllipsis = 0x2026
ELineBreak = 0x2028

Forced line break.

EParagraphDelimiter = 0x2029

Paragraph delimiter.

EPictureCharacter = 0xFFFC

Represents a picture inserted into the text object.

EZeroWidthNoBreakSpace = 0xFEFF
EByteOrderMark = 0xFEFF
EReversedByteOrderMark = 0xFFFE

Enum TDocumentStorage

Storage type

Enumerators

EFlatStorage

Storage uses a flat buffer (CBufFlat).

ESegmentedStorage

Storage uses a segmented buffer (CBufSeg).

Member Data Documentation

TBool iHasChanged

TBool iHasChanged[protected]

CEditableTextOptionalData * iOptionalData

CEditableTextOptionalData *iOptionalData[private]