sl@0: sl@0:

sl@0: Overview sl@0:

sl@0: The EditableText class hierarchy provides sl@0: instantiable classes for editing and storing text. The choice of which sl@0: class to use depends on your requirements of text editing. sl@0:

sl@0: Usage sl@0:

sl@0: sl@0: Two instantiable editable text classes are supplied: sl@0:

sl@0: GlobalText sl@0:

sl@0: RichText sl@0:

sl@0: and each case, there is a choice of physical implementation: sl@0:

Flat storage sl@0:

Segemented storage. sl@0:

Flat storage is most efficient when there is little text to be stored, or in the case where little or no editing will take place on the stored text. sl@0:

Segmented storage is most efficient where large quantities of text are to be stored, or where the text has a large dynamic content. sl@0:

The rich text class supports: sl@0:

paragraph styles sl@0:

character styles sl@0:

explicit paragraph & character formatting sl@0:

embedded pictures etc... (See the spec). sl@0:

In contrast, global text applies a single paragraph/character style to the entire contents of the document. sl@0:

Global text is best used for edit boxes, whereas rich text applications include the word processor and agenda entries, to name but two. sl@0:

sl@0: CEditableText Methods sl@0:

sl@0: ConstructL Phase2 construction sl@0:

sl@0: void ConstructL(TDocumentStorage aStorage); sl@0:

sl@0: All calls to a document constructor must be followed by an explicit call to the ConstructL method. This method completes the 2 phase object construction favoured by Epoc. The parameter aStorage defines which implementation to use. The type TDocumentStorage is defined in EDITTEXT.H as follows: sl@0:

sl@0: enum TDocumentStorage {EFlat,ESegmented}; sl@0:

sl@0: This method may leave. A complete example of document construction is provided below: sl@0:

sl@0: CEditableText* document=new(ELeave) CGlobalText; sl@0:

sl@0: document->ConstructL(ESegmented); // Leaves if construction fails. sl@0:

sl@0: A mandatory part of the ConstructL method inserts an end-of-document character into the document. This character is not included in the DocumentLength method.