#include <mw/eikrted.h>
class CEikRichTextEditor : public CEikGlobalTextEditor |
Protected Attributes | |
---|---|
TSize | iDefaultIconicDoorSize |
Public Member Enumerations | |
---|---|
enum | anonymous { EShowAllPicturesAsIconic, ENoTextParsers, EPasteAsPlainText } |
enum | TObjectFormat { EAlwaysIconic, EGlassIfPossible } |
Protected Member Enumerations | |
---|---|
enum | anonymous { ECropFromLeft, ECropFromRight, ECropFromTop, ECropFromBottom, EReEditingObject } |
Protected Member Functions | |
---|---|
IMPORT_C void | EditObserver(TInt, TInt) |
virtual IMPORT_C void | WriteInternalStateL(RWriteStream &) |
Rich text editor.
This is an edit window that supports rich text, including embedded objects represented either by icons or glass doors.
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.
IMPORT_C | CEikRichTextEditor | ( | const TGulBorder & | aBorder | ) |
C++ constructor.
Parameter | Description |
---|---|
aBorder | Border for the rich text editor. |
IMPORT_C void | ActivateL | ( | ) | [virtual] |
Reimplemented from CEikGlobalTextEditor::ActivateL()
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).
Returns: ETrue if there is an embedded object at the cursor position and it could be opened. EFalse if there is no embedded object at the cursor position, or if the object has a NULL UID.
IMPORT_C void | ConstructFromResourceL | ( | TResourceReader & | aReader | ) | [virtual] |
Reimplemented from CEikGlobalTextEditor::ConstructFromResourceL(TResourceReader &)
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.
Parameter | Description |
---|---|
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.
Parameter | Description |
---|---|
aParent | If not NULL, the editor's parent control. If NULL, the editor has no parent. |
aNumberOfLines | The number of lines visible in the editor. This controls the editor's height. |
aTextLimit | The maximum number of characters that can be entered into the editor. |
aEdwinFlags | Edit window attribute flags. See CEikEdwin::TFlags(). |
aFontControlFlags | = 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. |
aFontNameFlags | = 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] |
Reimplemented from CEikEdwin::CopyDocumentContentL(CGlobalText &,CGlobalText &)
From CEikEdwin.
Copies the contents of one text object into another.
Parameter | Description |
---|---|
aInText | The rich text object to copy. |
aOutText | On return, contains a copy of aInText. |
IMPORT_C const TSize & | DefaultIconicDoorSize | ( | ) | const |
Gets the size of iconic doors.
Returns: The size of iconic doors.
Reimplemented from CEikEdwin::EditObserver(TInt,TInt)
From MEditObserver.
This member is internal an not meant to be used.
Parameter | Description |
---|---|
aStartEdit | Start position for editing. |
aEditLength | The length of the edited object. |
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 | 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.
Parameter | Description |
---|---|
aDoor | On return, the embedded document's wrapper object (icon or glass door). |
aDoc | On return, the embedded document. |
aDocPos | The document position in the editor at which the embedded object is located. |
IMPORT_C void | HandlePointerEventL | ( | const TPointerEvent & | aPointerEvent | ) | [virtual] |
Reimplemented from CEikGlobalTextEditor::HandlePointerEventL(const TPointerEvent &)
From CCoeControl.
Handles pointer events inside the editor.
Has no effect if the CEikEdwin::EDisplayOnly attribute flag was specified on construction.
Parameter | Description |
---|---|
aPointerEvent | The pointer event to be handled. |
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.
Parameter | Description |
---|---|
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.
Parameter | Description |
---|---|
aAppDllName | Filename of the application DLL. |
aAppDllUid | UID of the application. The default is KNullUid. |
aFormat | Specifies whether the embedded document should be displayed as an icon or as a glass door. |
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.
Parameter | Description |
---|---|
aPictureType | The picture type. |
aData | The base address of the data. |
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.
Returns: The document position of the embedded object, or KErrNotFound if there is no embedded object at the cursor position, or if there is a selection
IMPORT_C TKeyResponse | OfferKeyEventL | ( | const TKeyEvent & | aKeyEvent, |
TEventCode | aType | |||
) | [virtual] |
Reimplemented from CEikGlobalTextEditor::OfferKeyEventL(const TKeyEvent &,TEventCode)
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().
Parameter | Description |
---|---|
aKeyEvent | The key event. |
aType | The type of the event. The editor only consumes events of type EEventKey. |
Returns: Indicates whether or not the editor consumed the key event.
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.
Returns: Pointer to the rich text object.
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().
Parameter | Description |
---|---|
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.
Parameter | Description |
---|---|
aObserver | The parser observer. |
IMPORT_C void | SetPhoneNumberGrouping | ( | TBool | aEnable | ) |
Activate/Disable phone number grouping.
Parameter | Description |
---|---|
aEnable | ETrue if phone number grouping is to be activated, EFalse otherwise. |
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.
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.
Parameter | Description |
---|---|
aStartPos | The start position. |
aLength | The number of characters, beginning at aStartPos over which the function operates. |
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.
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.
Parameter | Description |
---|---|
aStartPos | The start position. |
aLength | The number of characters, beginning at aStartPos over which the function operates. |
IMPORT_C void | WriteInternalStateL | ( | RWriteStream & | aWriteStream | ) | const [protected, virtual] |
Reimplemented from CEikGlobalTextEditor::WriteInternalStateL(RWriteStream &)const
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.
Parameter | Description |
---|---|
aWriteStream | Target stream. |