class CEikRichTextEditor : public CEikGlobalTextEditor |
Rich text editor.
This is an edit window that supports rich text, including embedded objects represented either by icons or glass doors.
Protected Member Functions | |
---|---|
IMPORT_C void | EditObserver ( TInt , TInt ) |
IMPORT_C void | WriteInternalStateL ( RWriteStream &) |
Private Member Functions | |
---|---|
void | CommonConstructL () |
TInt | DeleteEmbeddedDoc ( TAny *) |
void | DoInsertPictureL ( TBool &, const TPictureHeader &) |
void | DoReEditObjectL ( TInt ) |
void | DoReportEdwinEventL ( MEikEdwinObserver::TEdwinEvent ) |
IMPORT_C void | Draw (const TRect &) |
IMPORT_C void * | ExtensionInterface ( TUid ) |
IMPORT_C void | HandleTextPastedL ( TInt , TInt &) |
TInt | InsertEmbeddedDocL ( TAny *) |
void | InsertObjectL ( CApaDocument *, TObjectFormat ) |
void | InsertPictureL (const TPictureHeader &) |
IMPORT_C void | NewPictureL ( TPictureHeader &, const CStreamStore &) |
IMPORT_C void | NotifyExit (TExitMode) |
IMPORT_C void | Reserved_2 () |
IMPORT_C void | Reserved_3 () |
void | RoomForObjectL () |
void | SetTextObserver ( CRichText &) |
IMPORT_C const CStreamStore & | StreamStoreL ( TInt ) |
TInt | TryDeleteEmbeddedDocL ( TAny *) |
TInt | UpdateEmbeddedDocL ( TAny *) |
Public Member Enumerations | |
---|---|
enum | anonymous { EShowAllPicturesAsIconic = 0x00100000, ENoTextParsers = 0x00200000, EPasteAsPlainText = 0x00400000 } |
enum | TObjectFormat { EAlwaysIconic , EGlassIfPossible } |
Protected Member Enumerations | |
---|---|
enum | anonymous { ECropFromLeft = 0x00010000, ECropFromRight = 0x00020000, ECropFromTop = 0x00040000, ECropFromBottom = 0x00080000, EReEditingObject = 0x00100000 } |
Protected Attributes | |
---|---|
TSize | iDefaultIconicDoorSize |
Private Attributes | |
---|---|
CBufStore * | iBufStore |
TPictureHeader | iEmbeddedDoc |
CIdle * | iEmbeddedDocUpdate |
CEikParserManager * | iParserManager |
IMPORT_C | CEikRichTextEditor | ( | const TGulBorder & | aBorder | ) |
C++ constructor.
const TGulBorder & aBorder | Border for the rich text editor. |
IMPORT_C void | ActivateL | ( | ) | [virtual] |
From CCoeControl .
Activates the editor so that it is ready for use.
For instance, the text view is created, the editor is set to observe its rich text object, the editor's parser manager is set up, which handles the changes that occur when the cursor is moved over tagged text (for instance a URL), and all embedded objects are set to be displayed as icons, of the default size.
IMPORT_C TBool | CheckForObjectL | ( | ) |
Tests whether there is an embedded object at the cursor position.
If there is one, it is opened for editing (or for viewing if the editor is read-only).
IMPORT_C void | ConstructFromResourceL | ( | TResourceReader & | aReader | ) | [virtual] |
From CCoeControl .
Completes the construction of the rich text editor from a resource file.
The editor's paragraph and character formatting are set to default values, unless the CEikEdwin::EUserSuppliedText flag is specified in the resource.
TResourceReader & aReader | A resource reader positioned for reading from an RTXTED resource. |
IMPORT_C void | ConstructL | ( | const CCoeControl * | aParent, |
TInt | aNumberOfLines, | |||
TInt | aTextLimit, | |||
TInt | aEdwinFlags, | |||
TInt | aFontControlFlags = EGulFontControlAll, | |||
TInt | aFontNameFlags = EGulNoSymbolFonts | |||
) |
By default Symbian 2nd phase constructor is private.
Completes construction of the rich text editor.
The editor's paragraph and character formatting are set to default values, unless the CEikEdwin::EUserSuppliedText flag is specified in aEdwinFlags .
const CCoeControl * aParent | If not NULL, the editor's parent control. If NULL, the editor has no parent. |
TInt aNumberOfLines | The number of lines visible in the editor. This controls the editor's height. |
TInt aTextLimit | The maximum number of characters that can be entered into the editor. |
TInt aEdwinFlags | Edit window attribute flags. See CEikEdwin::TFlags(). |
TInt aFontControlFlags = EGulFontControlAll | = EGulFontControlAll Flags that specify which font-related controls should not appear in font dialogs launched from the edit window. For instance EGulFontControlBold removes the bold checkbox control. The default shows all. For possible values, see gulftflg.hrh. |
TInt aFontNameFlags = EGulNoSymbolFonts | = EGulNoSymbolFonts The font flags. These control whether symbol and monospace fonts should be displayed in font dialogs launched from the edit window. For possible values, see gulftflg.hrh. |
IMPORT_C void | CopyDocumentContentL | ( | CGlobalText & | aInText, |
CGlobalText & | aOutText | |||
) | [virtual] |
From CEikEdwin .
Copies the contents of one text object into another.
CGlobalText & aInText | The rich text object to copy. |
CGlobalText & aOutText | On return, contains a copy of aInText. |
IMPORT_C const TSize & | DefaultIconicDoorSize | ( | ) | const |
Gets the size of iconic doors.
TInt | DeleteEmbeddedDoc | ( | TAny * | aThis | ) | [private, static] |
TAny * aThis |
void | DoInsertPictureL | ( | TBool & | aFormatHasChanged, |
const TPictureHeader & | aPictureHeader | |||
) | [private] |
TBool & aFormatHasChanged | |
const TPictureHeader & aPictureHeader |
void | DoReportEdwinEventL | ( | MEikEdwinObserver::TEdwinEvent | aEventType | ) | [private, inline] |
MEikEdwinObserver::TEdwinEvent aEventType |
IMPORT_C void | Draw | ( | const TRect & | aRect | ) | const [private, virtual] |
const TRect & aRect | If supplied, the rectangle in which to draw the Edwin. |
IMPORT_C void | EditObserver | ( | TInt | aStartEdit, |
TInt | aEditLength | |||
) | [protected] |
IMPORT_C void | EditPictureFormatL | ( | ) |
Launches a format object dialog ( CEikFormatObjectDialog ) if there is an embedded object at the cursor position, and the object supports being displayed as a glass door.
If the object does not support being displayed as a glass door, an object information dialog ( CEikObjectInfoDialog ) is launched instead.
If the embedded object's associated application cannot be found, an info message is displayed and the function leaves.
The function has no effect if there is no embedded object at the cursor position.
IMPORT_C void * | ExtensionInterface | ( | TUid | aInterface | ) | [private, virtual] |
From CAknControl .
TUid aInterface |
IMPORT_C void | GetEmbeddedAppL | ( | CApaDoor *& | aDoor, |
CApaDocument *& | aDoc, | |||
TInt | aDocPos | |||
) |
Gets a pointer to the embedded object located at the specified position.
If the object is not in memory, the function loads it.
If the object's associated application cannot be found, an info message is displayed and the function leaves.
CApaDoor *& aDoor | On return, the embedded document's wrapper object (icon or glass door). |
CApaDocument *& aDoc | On return, the embedded document. |
TInt aDocPos | The document position in the editor at which the embedded object is located. |
IMPORT_C void | HandlePointerEventL | ( | const TPointerEvent & | aPointerEvent | ) | [virtual] |
From CCoeControl .
Handles pointer events inside the editor.
Has no effect if the CEikEdwin::EDisplayOnly attribute flag was specified on construction.
const TPointerEvent & aPointerEvent | The pointer event to be handled. |
IMPORT_C void | HandleTextPastedL | ( | TInt | aStartPos, |
TInt & | aLength | |||
) | [private, virtual] |
Not implemented.
TInt | InsertEmbeddedDocL | ( | TAny * | aThis | ) | [private, static] |
TAny * aThis |
IMPORT_C void | InsertObjectL | ( | TObjectFormat | aFormat | ) |
Launches an insert object dialog ( CEikInsertObjectDialog ), and inserts a default document of the application type selected by the user.
The object can be displayed either as a glass door, if supported, or as an icon, and the inserted object is opened for editing.
Displays an info message and leaves if the editor's text limit has been reached.
TObjectFormat aFormat | Specifies whether the embedded document should be displayed as an icon or as a glass door. |
IMPORT_C void | InsertObjectL | ( | ) |
Launches an insert object dialog ( CEikInsertObjectDialog ), and inserts a default document of the application type selected by the user.
The object is displayed as a glass door rather than as an icon, if supported and the inserted object is opened for editing.
Displays an info message and leaves if the editor's text limit has been reached.
Default is EGlassIfPossible .
IMPORT_C void | InsertObjectL | ( | const TDesC & | aAppDllName, |
TUid | aAppDllUid, | |||
TObjectFormat | aFormat | |||
) |
Creates and inserts a default document of the specified application type.
CApaProcess::AddNewDocumentL() is used to create the document.
The object can be displayed either as a glass door, if supported, or as an icon, and the inserted object is opened for editing.
Displays an info message and leaves if no suitable application DLL can be found, or if the editor's text limit has been reached.
const TDesC & aAppDllName | Filename of the application DLL. |
TUid aAppDllUid | UID of the application. The default is KNullUid. |
TObjectFormat aFormat | Specifies whether the embedded document should be displayed as an icon or as a glass door. |
IMPORT_C void | InsertObjectL | ( | TUid | aPictureType, |
CBase * | aData | |||
) |
Creates and inserts a new embedded object of the specified type.
First, an attempt is made to find an extended picture factory that supports the insertion of pictures of the specified type. If one is not found, the function leaves; if one is found, the picture is inserted at the cursor position.
Displays an info message and leaves if the editor's text limit has been reached.
void | InsertObjectL | ( | CApaDocument * | aDoc, |
TObjectFormat | aFormat | |||
) | [private] |
CApaDocument * aDoc | |
TObjectFormat aFormat |
void | InsertPictureL | ( | const TPictureHeader & | aPictureHeader | ) | [private] |
const TPictureHeader & aPictureHeader |
IMPORT_C void | NewPictureL | ( | TPictureHeader & | aHdr, |
const CStreamStore & | aDeferredPictureStore | |||
) | const [private] |
TPictureHeader & aHdr | |
const CStreamStore & aDeferredPictureStore |
IMPORT_C void | NotifyExit | ( | TExitMode | aMode | ) | [private] |
TExitMode aMode |
IMPORT_C TInt | ObjectCursorPos | ( | ) | const |
Gets the document position and checks whether there is an embedded object at the cursor position.
If there is no embedded object at the cursor position, or if there is a selection, an info message is displayed.
IMPORT_C TKeyResponse | OfferKeyEventL | ( | const TKeyEvent & | aKeyEvent, |
TEventCode | aType | |||
) | [virtual] |
From CCoeControl .
Handles key events.
Has no effect (apart from returning EKeyWasConsumed ) if the CEikEdwin::EDisplayOnly attribute flag was specified on construction.
Handles rich text-specific hot keys, for instance to insert an object; otherwise calls CEikGlobalTextEditor::OfferKeyEventL() .
const TKeyEvent & aKeyEvent | The key event. |
TEventCode aType | The type of the event. The editor only consumes events of type EEventKey. |
IMPORT_C void | PictureFormatChangedL | ( | ) |
Handles a change to the format of an embedded object, by updating the view, the scroll bars and reporting the event to its observers.
There is no need to call this function after calling EditPictureFormatL() .
IMPORT_C void | ReEditObjectL | ( | ) |
Re-edits the embedded object at the cursor position.
If there is no embedded object at the cursor position, or if there is a selection, an info message is displayed.
If there is a valid object at the cursor position, it is opened for editing (or for viewing if the editor is read-only).
IMPORT_C CRichText * | RichText | ( | ) | const |
Gets a pointer to the rich text object owned by the editor.
IMPORT_C void | SetDefaultIconicDoorSize | ( | const TSize & | aSize | ) |
Changes the size of the icons used to represent embedded objects.
Any existing iconic doors can be updated to the new size by calling UpdatePictureSizeL() .
const TSize & aSize | The new iconic door size in twips. |
IMPORT_C void | SetParserObserver | ( | MEikRichTextEditorParserObserver * | aObserver | ) |
Sets a parser observer.
If the CEikEdwin::ENoTextParsers attribute flag was specified on construction, this function has no effect.
Its HandleCursorOverParserL() function is called when the cursor is positioned over text that has been tagged by the parser, for instance a URL.
MEikRichTextEditorParserObserver * aObserver | The parser observer. |
IMPORT_C void | SetPhoneNumberGrouping | ( | TBool | aEnable | ) |
Activate/Disable phone number grouping.
TBool aEnable | ETrue if phone number grouping is to be activated, EFalse otherwise. |
void | SetTextObserver | ( | CRichText & | aText | ) | [private] |
CRichText & aText |
IMPORT_C const CStreamStore & | StreamStoreL | ( | TInt | aPos | ) | const [private] |
TInt aPos |
TInt | TryDeleteEmbeddedDocL | ( | TAny * | aThis | ) | [private, static] |
TAny * aThis |
TInt | UpdateEmbeddedDocL | ( | TAny * | aThis | ) | [private, static] |
TAny * aThis |
IMPORT_C void | UpdatePictureFormatL | ( | ) |
Changes all embedded objects displayed as glass doors into temporarily iconic.
The function operates throughout the editor.
Only needed when pictures are temporarily iconic.
Has no effect if there are no embedded objects in the editor or if the EShowAllPicturesAsIconic attribute flag was set during construction.
IMPORT_C void | UpdatePictureFormatL | ( | TInt | aStartPos, |
TInt | aLength | |||
) |
Changes all embedded objects displayed as glass doors into temporarily iconic.
The function operates over a specified range of characters.
Has no effect if there are no embedded objects in the editor or if the EShowAllPicturesAsIconic attribute flag was set during construction.
Only needed when pictures are temporarily iconic.
IMPORT_C void | UpdatePictureSizeL | ( | ) |
Changes the size of all icons representing embedded objects to the default iconic door size.
Also updates any objects currently displayed as glass doors, so that if displayed as icons, they will use the correct size.
The function operates throughout the editor.
IMPORT_C void | UpdatePictureSizeL | ( | TInt | aStartPos, |
TInt | aLength | |||
) |
Changes the size of all icons representing embedded objects to the default iconic door size.
Also updates any objects currently displayed as glass doors, so that if displayed as icons, they will use the correct size.
The function operates over a specified range of characters.
IMPORT_C void | WriteInternalStateL | ( | RWriteStream & | aWriteStream | ) | const [protected, virtual] |
From CCoeControl .
Writes the internal state to the specified stream.
Writes the internal state of the control and its components to aStream. Does nothing in release mode. Designed to be overidden and base called by subclasses.
RWriteStream & aWriteStream | Target stream. |
Edit window attribute flags specific to the rich text editor.
These may be specified during construction in addition to the values contained in the TFlags enum in class CEikEdwin .
EShowAllPicturesAsIconic = 0x00100000 |
All embedded objects are represented by icon rather than glass doors. |
ENoTextParsers = 0x00200000 |
The editor has no text parsers. Text parsers are used to recognise and tag special text strings, e.g. URLs. |
EPasteAsPlainText = 0x00400000 |
When pasting text into the editor, the text is stripped of all formatting.
|
Internal flags used for indicating operations.
ECropFromLeft = 0x00010000 |
Crop from left. |
ECropFromRight = 0x00020000 |
Crop from right. |
ECropFromTop = 0x00040000 |
Crop from top. |
ECropFromBottom = 0x00080000 |
Crop from bottom. |
EReEditingObject = 0x00100000 |
Object is being re-edited. |
Identifies how an embedded object should be represented.
One of these values is specified when the object is inserted.
EAlwaysIconic |
The object is always represented by an icon |
EGlassIfPossible |
The object is represented by a glass door, if possible, or by icon, if not. |
Copyright ©2010 Nokia Corporation and/or its subsidiary(-ies).
All rights
reserved. Unless otherwise stated, these materials are provided under the terms of the Eclipse Public License
v1.0.