|
1 <G> |
|
2 <P Alignment=center KeepTogether KeepWithNext> |
|
3 <C Bold Underline FontHeight=400>Overview |
|
4 <P Alignment=left SpaceAfter=250 !KeepWithNext> |
|
5 <C FontHeight=200 !Bold !Underline>The EditableText class hierarchy provides |
|
6 instantiable classes for editing and storing text. The choice of which |
|
7 class to use depends on your requirements of text editing. |
|
8 <P SpaceBefore=250 Alignment=Left Indent=1440 KeepWithNext> |
|
9 <C Bold StrikeThrough FontHeight=350>Usage |
|
10 <P Indent=0> |
|
11 <C !Bold !Strikethrough FontHeight=200> |
|
12 Two instantiable editable text classes are supplied: |
|
13 <P Indent=700 SpaceBefore=240 SpaceAfter=240> |
|
14 GlobalText |
|
15 <P> |
|
16 RichText |
|
17 <P Indent=0> |
|
18 and each case, there is a choice of physical implementation: |
|
19 <P Indent=700>Flat storage |
|
20 <P>Segemented storage. |
|
21 <P Indent=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. |
|
22 <P>Segmented storage is most efficient where large quantities of text are to be stored, or where the text has a large dynamic content. |
|
23 <P>The rich text class supports: |
|
24 <P Indent=700>paragraph styles |
|
25 <P>character styles |
|
26 <P>explicit paragraph & character formatting |
|
27 <P>embedded pictures etc... (See the spec). |
|
28 <P Indent=0>In contrast, global text applies a<C Bold Italic> single <C !Bold !Italic>paragraph/character style to the entire contents of the document. |
|
29 <P>Global text is best used for edit boxes, whereas rich text applications include the word processor and agenda entries, to name but two. |
|
30 <P Alignment=right SpaceBefore=1440> |
|
31 <C Bold Underline FontHeight=450>CEditableText Methods<C !Bold !Underline> |
|
32 <P Alignment=justified SpaceBefore=240 SpaceAfter=300> |
|
33 <C Bold>ConstructL Phase2 construction<C !Bold> |
|
34 <P Alignment=left KeepWithNext KeepTogether> |
|
35 <C Bold>void ConstructL(TDocumentStorage aStorage);<C !Bold> |
|
36 <P !KeepWithNext !KeepTogether> |
|
37 All calls to a document constructor must be followed by an explicit call to the<C Underline> ConstructL <C !Underline>method. This method completes the 2 phase object construction favoured by Epoc. The parameter<C Italic Underline> aStorage <C !Ita |
|
38 lic !Underline>defines which implementation to use. The type<C Underline> TDocumentStorage <C !Underline>is defined in<C Underline> EDITTEXT.H <C !Underline>as follows: |
|
39 <P Alignment=center> |
|
40 <C Bold>enum TDocumentStorage {EFlat,ESegmented};<C !Bold> |
|
41 <P Alignment=justified> |
|
42 This method may leave. A complete example of document construction is provided below: |
|
43 <P Indent=1460> |
|
44 <C Bold>CEditableText* document=new(ELeave) CGlobalText; |
|
45 <P> |
|
46 document->ConstructL(ESegmented); // Leaves if construction fails.<C !Bold> |
|
47 <P Indent=0 Alignment=justified> |
|
48 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. |