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 void CancelFepInlineEdit ( TBool &, TInt &, TInt &, TInt &, TInt )
IMPORT_C void CommitFepInlineEditL ( TBool &, TInt &, TInt &, TInt &, TInt )
void CopyToStoreL ( CStreamStore &, CStreamDictionary &, TInt , TInt )
TBool DeleteL ( TInt , TInt )
TInt DocumentLength ()
IMPORT_C void ExtendedInterface ( TAny *&, TUid )
void ExternalizeL ( RWriteStream &)
void Extract ( TDes &, TInt )
void Extract ( TDes &, TInt , TInt )
IMPORT_C TInt GetLengthOfInlineText ()
IMPORT_C TInt GetPositionOfInlineTextInDocument ()
void GetWordInfo ( TInt , TInt &, TInt &, TBool , TBool )
TBool HasChanged ()
void InsertL ( TInt , const TChar &)
void InsertL ( TInt , const TDesC &)
void InternalizeL ( RReadStream &)
TInt ParagraphCount ()
TInt PasteFromStoreL (const CStreamStore &, const CStreamDictionary &, TInt )
TPtrC Read ( TInt )
TPtrC Read ( TInt , TInt )
void Reset ()
void RestoreComponentsL (const CStreamStore &)
IMPORT_C void RestoreL (const CStreamStore &, TStreamId )
IMPORT_C TInt ScanParas ( TInt &, TUint &)
IMPORT_C TInt ScanWords ( TInt &, TUint &)
IMPORT_C void SetHasChanged ( TBool )
IMPORT_C void StartFepInlineEditL ( TBool &, TInt &, TInt &, TInt &, TInt , const TDesC &, TInt , TInt , MFepInlineTextFormatRetriever &)
void StoreComponentsL ( CStreamStore &, CStoreMap &)
IMPORT_C TStreamId StoreL ( CStreamStore &)
TInt ToParagraphStart ( TInt &)
IMPORT_C void UpdateFepInlineTextL ( TBool &, TInt &, TInt &, TInt &, TInt , const TDesC &)
TInt WordCount ()
Protected Member Functions
IMPORT_C void OverrideFormatOfInlineTextIfApplicable ( TPtrC &, TCharFormat &, TInt )
Private Member Functions
void DeleteInlineEditDataAndSetToNull ()
TBool DeleteWithoutDestroyingFormatL ( TInt , TInt )
CInlineEditData * InlineEditData ()
void SetAndTransferOwnershipOfInlineEditDataL ( 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
enum anonymous { EDefaultTextGranularity  = 256 }
enum anonymous {
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
}
enum TDocumentStorage { 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 void CancelFepInlineEdit ( TBool & aParagraphContainingStartPositionOfInlineTextHasChangedFormat,
TInt & aNumberOfCharactersSuccessfullyDeleted,
TInt & aNumberOfCharactersSuccessfullyInserted,
TInt & aPositionOfInsertionPointInDocument,
TInt aNewPositionOfInsertionPointInDocument
)

Parameters

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

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

IMPORT_C void CommitFepInlineEditL ( TBool & aParagraphContainingStartPositionOfInlineTextHasChangedFormat,
TInt & aNumberOfCharactersSuccessfullyDeleted,
TInt & aNumberOfCharactersSuccessfullyInserted,
TInt & aPositionOfInsertionPointInDocument,
TInt aNewPositionOfInsertionPointInDocument
)

Parameters

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

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

void CopyToStoreL ( CStreamStore & aStore,
CStreamDictionary & aDictionary,
TInt aPos,
TInt aLength
) const [pure virtual]

Copies a portion of the text to the clipboard.

Parameters

CStreamStore & aStore The clipboard's store (see class CClipboard).
CStreamDictionary & aDictionary The clipboard's stream dictionary (see class CClipboard).
TInt aPos A valid document position from which to begin copying.
TInt aLength The number of characters to copy.

DeleteInlineEditDataAndSetToNull()

void DeleteInlineEditDataAndSetToNull ( ) [private]

DeleteL(TInt, TInt)

TBool DeleteL ( TInt aPos,
TInt aLength
) [pure virtual]

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

Parameters

TInt aPos The document position from which to delete.
TInt aLength The number of characters to delete.

DeleteWithoutDestroyingFormatL(TInt, TInt)

TBool DeleteWithoutDestroyingFormatL ( TInt aPos,
TInt aLength
) [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 aPos The document position from which to begin deleting including aPos.
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.

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

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

ExternalizeL(RWriteStream &)

void ExternalizeL ( RWriteStream & aStream ) const [virtual]

Parameters

RWriteStream & aStream

Extract(TDes &, TInt)

void Extract ( TDes & aBuf,
TInt aPos = 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 & aBuf Buffer which on return contains the extracted text.
TInt aPos = 0 The document position from which to copy. Must be a valid position, or a panic occurs.

Extract(TDes &, TInt, TInt)

void Extract ( TDes & aBuf,
TInt aPos,
TInt aLength
) 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 & aBuf Buffer which on return contains the extracted text.
TInt aPos The document position from which to copy. Must be a valid position, or a panic occurs.
TInt aLength If specified, the number of characters to copy.

GetLengthOfInlineText()

IMPORT_C TInt GetLengthOfInlineText ( ) const

GetPositionOfInlineTextInDocument()

IMPORT_C TInt GetPositionOfInlineTextInDocument ( ) const

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

void GetWordInfo ( TInt aCurrentPos,
TInt & aStartPos,
TInt & aLength,
TBool aPictureIsDelimiter,
TBool aPunctuationIsDelimiter
) const [pure virtual]

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

Parameters

TInt aCurrentPos A valid document position.
TInt & aStartPos On return, the document position of the first character in the word containing document position aCurrentPos.
TInt & aLength On return, the length of the word containing document position aCurrentPos. Does not include the trailing word delimiter character.
TBool aPictureIsDelimiter Specifies 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 aPunctuationIsDelimiter Specifies 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 &)

void InsertL ( TInt aInsertPos,
const TChar & aChar
) [pure virtual]

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

Parameters

TInt aInsertPos A valid document position at which to insert the character or descriptor.
const TChar & aChar The character to insert.

InsertL(TInt, const TDesC &)

void InsertL ( TInt aInsertPos,
const TDesC & aBuf
) [pure virtual]

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

Parameters

TInt aInsertPos A valid document position at which to insert the character or descriptor.
const TDesC & aBuf The descriptor to insert.

InternalizeL(RReadStream &)

void InternalizeL ( RReadStream & aStream ) [virtual]

Parameters

RReadStream & aStream

OverrideFormatOfInlineTextIfApplicable(TPtrC &, TCharFormat &, TInt)

IMPORT_C void OverrideFormatOfInlineTextIfApplicable ( TPtrC & aView,
TCharFormat & aFormat,
TInt aStartPos
) 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,
TInt aPos
) [pure virtual]

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

Parameters

const CStreamStore & aStore The clipboard's store (see class CClipboard).
const CStreamDictionary & aDictionary The clipboard's stream dictionary (see class CClipboard).
TInt aPos A valid document position at which to paste the text.

Read(TInt)

TPtrC Read ( TInt aStartPos ) const [pure virtual]

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

Parameters

TInt aStartPos A valid document position from which to read.

Read(TInt, TInt)

TPtrC Read ( TInt aStartPos,
TInt aLength
) const [pure virtual]

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

Parameters

TInt aStartPos A valid document position from which to read.
TInt aLength If 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()

void Reset ( ) [pure virtual]

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

RestoreComponentsL(const CStreamStore &)

void RestoreComponentsL ( 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 & aStore The stream store from which the text components are restored.

RestoreL(const CStreamStore &, TStreamId)

IMPORT_C void RestoreL ( const CStreamStore & aStore,
TStreamId aStreamId
)

Restores the text and its components from a stream store.

Parameters

const CStreamStore & aStore Stream store containing the text and its components.
TStreamId aStreamId The ID of the stream store in which the text was previously stored.

ScanParas(TInt &, TUint &)

IMPORT_C TInt ScanParas ( 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 & aPos A valid document position from which to scan. On return, contains the new document position.
TUint & aScanMask The scan mask to use. See the scanning enumeration defined in class CPlainText.

ScanWords(TInt &, TUint &)

IMPORT_C TInt ScanWords ( 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 & aPos A valid document position from which to scan. On return, contains the new document position.
TUint & aScanMask The scan mask to use. See the scanning enumeration defined in class CPlainText.

SetAndTransferOwnershipOfInlineEditDataL(CInlineEditData *)

void SetAndTransferOwnershipOfInlineEditDataL ( CInlineEditData * aInlineEditData ) [private]

Parameters

CInlineEditData * aInlineEditData

SetHasChanged(TBool)

IMPORT_C void SetHasChanged ( TBool aHasChanged ) [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 aHasChanged ETrue 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 void StartFepInlineEditL ( TBool & aParagraphContainingStartPositionOfInlineTextHasChangedFormat,
TInt & aNumberOfCharactersSuccessfullyDeleted,
TInt & aNumberOfCharactersSuccessfullyInserted,
TInt & aPositionOfInsertionPointInDocument,
TInt aNewPositionOfInsertionPointInDocument,
const TDesC & aInitialInlineText,
TInt aPositionOfInlineTextInDocument,
TInt aNumberOfCharactersToHide,
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 &)

void StoreComponentsL ( 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 & 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 deferred loading of pictures in rich text.

StoreL(CStreamStore &)

IMPORT_C TStreamId StoreL ( 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 & aStore Stream 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 & aPos Initially 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 void UpdateFepInlineTextL ( TBool & aParagraphContainingStartPositionOfInlineTextHasChangedFormat,
TInt & aNumberOfCharactersSuccessfullyDeleted,
TInt & aNumberOfCharactersSuccessfullyInserted,
TInt & aPositionOfInsertionPointInDocument,
TInt aNewPositionOfInsertionPointInDocument,
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]