Nokia N97 SDK Example Applications Guide |
Rich Text Editor Example
1. About this Example
2. Architecture
3. Design and Implementation
Rich Text Editor example demonstrates the usage of Rich Text Editor. Most of the features are handled automatically when the
dialog framework creates the editor. However, some steps, such as inserting an image, setting the text input type, or showing
the scroller require the use of methods or classes.
- CEikRichTextEditor
- CFbsBitmap
- TPictureHeader
- CPicture
Symbian C++ basics
Start the application. An editor opens. Select any part of the text: press and hold the Edit key while moving the scroller
key to left or right. The selected text is highlighted. You can select various formatting options from the Options menu (character
format, color, alignment and font).
RichTextEditor example follows traditional Symbian OS Control-based architecture.
CEikRichTextEditor is the main class used in this example, which is an edit window that supports rich text, including embedded
objects represented either by icons or glass doors. CRTEContainer contains CEikRichTextEditor. The basic features are handled by CEikRichTextEditor API.
Another important class CMyPicture, which is used to insert the picture in the editor window.This class contains the CFbsBitmap class, which is reference to
bitmap data.
The program capabilities are defined in the RichTextEditor_S60_3rd_Ed.mmp file: CAPABILITY NONE
The main features of Rich text editor are as follows
- Character Format
This feature enables the user to select the font style, The APIs which implements the character format are CRTEContainer::SetFont() and CRTEContainer::Strike(). The following options can be selected for character formats.
- Bold
- Italic
- Underline
- Strike-through
- Change Color
This feature allows user to specify the color of the text. The parameter of type Trgb indicates the color id:
- Set Alignment
This feature enables user to select the text alignment in the text editor. The parameter of type CParaFormat::TAlignment indicates the alignment:
- Demo Text
This feature is to Create Demo Text Content, there is also demonstration of picture insertion which is implemented by user
defined class CMyPicture, which handles the picture insertion in the editor.
|
© Nokia 2009
|

|