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.

Indicates whether or not two paragraphs have been merged as a result of the delete, so that the resulting paragraph needs to be reformatted. This value is only relevant to rich text, so for plain and global text implementations, the function always returns EFalse.

Parameters

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

DeleteWithoutDestroyingFormatL(TInt, TInt)

TBool DeleteWithoutDestroyingFormatL(TIntaPos,
TIntaLength
)[private]

Parameters

TInt aPos
TInt aLength

DocumentLength()

TInt DocumentLength()const [pure virtual]

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

The number of characters in the document.

ExtendedInterface(TAny *&, TUid)

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

Parameters

TAny *& aInterface
TUid aInterfaceId

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().

ETrue if a change has occurred to the text object. EFalse if there has been no change.

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.

The number of paragraphs in the document. Notes: The end-of-text paragraph delimiter at the end of every document means this function always returns a count of at least one.

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.

The number of characters pasted.

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.

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.

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
)

Parameters

const CStreamStore & aStore
TStreamId aStreamId

ScanParas(TInt &, TUint &)

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

Parameters

TInt & aPos
TUint & aScanMask

ScanWords(TInt &, TUint &)

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

Parameters

TInt & aPos
TUint & aScanMask

SetAndTransferOwnershipOfInlineEditDataL(CInlineEditData *)

voidSetAndTransferOwnershipOfInlineEditDataL(CInlineEditData *aInlineEditData)[private]

Parameters

CInlineEditData * aInlineEditData

SetHasChanged(TBool)

IMPORT_C voidSetHasChanged(TBoolaHasChanged)[virtual]

Parameters

TBool aHasChanged

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

Parameters

CStreamStore & aStore

ToParagraphStart(TInt &)

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

Updates a document position to the start of the paragraph.

The number of characters skipped in scanning 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.

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]