CEikRichTextEditor Class Reference

API published in: S60 1st Ed

Link against: avkon.lib eikctl.lib eikcoctl.lib uiklaf.lib form.lib

Capability Information

Required Capabilities

None


#include <eikrted.h>

Inherits CEikGlobalTextEditor.


Detailed Description

Rich text editor.

This is an edit window that supports rich text, including embedded objects represented either by icons or glass doors.


Public Types

enum   TObjectFormat { EAlwaysIconic, EGlassIfPossible }
  Identifies how an embedded object should be represented. More...
enum   { EShowAllPicturesAsIconic = 0x00100000, ENoTextParsers = 0x00200000, EPasteAsPlainText = 0x00400000 }
  Edit window attribute flags specific to the rich text editor. More...

Public Member Functions

IMPORT_C  CEikRichTextEditor ()
  C++ default constructor.
IMPORT_C  CEikRichTextEditor (const TGulBorder &aBorder)
  C++ constructor.
IMPORT_C  ~CEikRichTextEditor ()
  Destructor.
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.
IMPORT_C CRichText *  RichText () const
  Gets a pointer to the rich text object owned by the editor.
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.
IMPORT_C void  InsertObjectL ()
  Launches an insert object dialog (CEikInsertObjectDialog), and inserts a default document of the application type selected by the user.
IMPORT_C void  InsertObjectL (const TDesC &aAppDllName, TUid aAppDllUid, TObjectFormat aFormat)
  Creates and inserts a default document of the specified application type.
IMPORT_C void  InsertObjectL (TUid aPictureType, CBase *aData)
  Creates and inserts a new embedded object of the specified type.
IMPORT_C void  ReEditObjectL ()
  Re-edits the embedded object at the cursor position.
IMPORT_C TInt  ObjectCursorPos () const
  Gets the document position and checks whether there is an embedded object at the cursor position.
IMPORT_C TBool  CheckForObjectL ()
  Tests whether there is an embedded object at the cursor position.
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.
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.
IMPORT_C void  GetEmbeddedAppL (CApaDoor *&aDoor, CApaDocument *&aDoc, TInt aDocPos)
  Gets a pointer to the embedded object located at the specified position.
IMPORT_C void  UpdatePictureFormatL ()
  Changes all embedded objects displayed as glass doors into temporarily iconic.
IMPORT_C void  UpdatePictureFormatL (TInt aStartPos, TInt aLength)
  Changes all embedded objects displayed as glass doors into temporarily iconic.
IMPORT_C void  SetDefaultIconicDoorSize (const TSize &aSize)
  Changes the size of the icons used to represent embedded objects.
IMPORT_C const TSize &  DefaultIconicDoorSize () const
  Gets the size of iconic doors.
IMPORT_C void  UpdatePictureSizeL ()
  Changes the size of all icons representing embedded objects to the default iconic door size.
IMPORT_C void  UpdatePictureSizeL (TInt aStartPos, TInt aLength)
  Changes the size of all icons representing embedded objects to the default iconic door size.
IMPORT_C void  SetParserObserver (MEikRichTextEditorParserObserver *aObserver)
  Sets a parser observer.
IMPORT_C void  SetPhoneNumberGrouping (TBool aEnable)
  Activate/Disable phone number grouping.
IMPORT_C TKeyResponse  OfferKeyEventL (const TKeyEvent &aKeyEvent, TEventCode aType)
  From CCoeControl.
IMPORT_C void  HandlePointerEventL (const TPointerEvent &aPointerEvent)
  From CCoeControl.
IMPORT_C void  ConstructFromResourceL (TResourceReader &aReader)
  From CCoeControl.
IMPORT_C void  ActivateL ()
  From CCoeControl.
IMPORT_C void  CopyDocumentContentL (CGlobalText &aInText, CGlobalText &aOutText)
  From CEikEdwin.
IMPORT_C void  RefreshParsersL ()
  Force everything to be parsed.

Protected Types

enum   {
  ECropFromLeft = 0x00010000, ECropFromRight = 0x00020000, ECropFromTop = 0x00040000, ECropFromBottom = 0x00080000,
  EReEditingObject = 0x00100000
}
  Internal flags used for indicating operations. More...

Protected Member Functions

IMPORT_C void  WriteInternalStateL (RWriteStream &aWriteStream) const
  From CCoeControl.
IMPORT_C void  EditObserver (TInt aStartEdit, TInt aEditLength)
  From MEditObserver.

Protected Attributes

TSize  iDefaultIconicDoorSize
  Default size of iconic door.

Friends

class  CEikParserManager

Member Enumeration Documentation

anonymous enum
 

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.

Enumerator:
EShowAllPicturesAsIconic  All embedded objects are represented by icon rather than glass doors.
ENoTextParsers  The editor has no text parsers.

Text parsers are used to recognise and tag special text strings, e.g. URLs.

EPasteAsPlainText  When pasting text into the editor, the text is stripped of all formatting.

Reimplemented from CEikEdwin.

anonymous enum [protected]
 

Internal flags used for indicating operations.

Enumerator:
ECropFromLeft  Crop from left.
ECropFromRight  Crop from right.
ECropFromTop  Crop from top.
ECropFromBottom  Crop from bottom.
EReEditingObject  Object is being re-edited.
enum CEikRichTextEditor::TObjectFormat
 

Identifies how an embedded object should be represented.

One of these values is specified when the object is inserted.

Enumerator:
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.

Constructor & Destructor Documentation

IMPORT_C CEikRichTextEditor::CEikRichTextEditor  ) 
 

C++ default constructor.

IMPORT_C CEikRichTextEditor::CEikRichTextEditor const TGulBorder &  aBorder  ) 
 

C++ constructor.

Parameters:
aBorder  Border for the rich text editor.
IMPORT_C CEikRichTextEditor::~CEikRichTextEditor  ) 
 

Destructor.


Member Function Documentation

IMPORT_C void CEikRichTextEditor::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.

Reimplemented from CEikGlobalTextEditor.

IMPORT_C TBool CEikRichTextEditor::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 CEikRichTextEditor::ConstructFromResourceL TResourceReader &  aReader  ) 
 

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.

Parameters:
aReader  A resource reader positioned for reading from an RTXTED resource.

Reimplemented from CEikGlobalTextEditor.

IMPORT_C void CEikRichTextEditor::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.

Parameters:
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.

Reimplemented from CEikGlobalTextEditor.

IMPORT_C void CEikRichTextEditor::CopyDocumentContentL CGlobalText &  aInText,
CGlobalText &  aOutText
[virtual]
 

From CEikEdwin.

Copies the contents of one text object into another.

Parameters:
[in]  aInText  The rich text object to copy.
[out]  aOutText  On return, contains a copy of aInText.
Panic:
26 In debug mode, if either aInText or aOutText is NULL.

Reimplemented from CEikEdwin.

IMPORT_C const TSize& CEikRichTextEditor::DefaultIconicDoorSize  )  const
 

Gets the size of iconic doors.

Returns:
The size of iconic doors.
IMPORT_C void CEikRichTextEditor::EditObserver TInt  aStartEdit,
TInt  aEditLength
[protected]
 

From MEditObserver.

This member is internal an not meant to be used.

Parameters:
aStartEdit  Start position for editing.
aEditLength  The length of the edited object.

Reimplemented from CEikEdwin.

IMPORT_C void CEikRichTextEditor::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 CEikRichTextEditor::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.

Parameters:
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 CEikRichTextEditor::HandlePointerEventL const TPointerEvent &  aPointerEvent  ) 
 

From CCoeControl.

Handles pointer events inside the editor.

Has no effect if the CEikEdwin::EDisplayOnly attribute flag was specified on construction.

Parameters:
aPointerEvent  The pointer event to be handled.

Reimplemented from CEikGlobalTextEditor.

IMPORT_C void CEikRichTextEditor::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.

Parameters:
aPictureType  The picture type.
aData  The base address of the data.
Leave:
KErrNotSupported No picture factory which supports the specified type is available in the control's Uikon environment.
IMPORT_C void CEikRichTextEditor::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.

Parameters:
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.
IMPORT_C void CEikRichTextEditor::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 CEikRichTextEditor::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.

Parameters:
aFormat  Specifies whether the embedded document should be displayed as an icon or as a glass door.
IMPORT_C TInt CEikRichTextEditor::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 CEikRichTextEditor::OfferKeyEventL const TKeyEvent &  aKeyEvent,
TEventCode  aType
 

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().

Parameters:
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.

Reimplemented from CEikGlobalTextEditor.

IMPORT_C void CEikRichTextEditor::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 CEikRichTextEditor::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 void CEikRichTextEditor::RefreshParsersL  ) 
 

Force everything to be parsed.

IMPORT_C CRichText* CEikRichTextEditor::RichText  )  const
 

Gets a pointer to the rich text object owned by the editor.

Returns:
Pointer to the rich text object.
IMPORT_C void CEikRichTextEditor::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().

Parameters:
aSize  The new iconic door size in twips.
IMPORT_C void CEikRichTextEditor::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.

Parameters:
aObserver  The parser observer.
IMPORT_C void CEikRichTextEditor::SetPhoneNumberGrouping TBool  aEnable  ) 
 

Activate/Disable phone number grouping.

Parameters:
aEnable  ETrue if phone number grouping is to be activated, EFalse otherwise.
IMPORT_C void CEikRichTextEditor::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.

Parameters:
aStartPos  The start position.
aLength  The number of characters, beginning at aStartPos over which the function operates.
IMPORT_C void CEikRichTextEditor::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 CEikRichTextEditor::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.

Parameters:
aStartPos  The start position.
aLength  The number of characters, beginning at aStartPos over which the function operates.
IMPORT_C void CEikRichTextEditor::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 CEikRichTextEditor::WriteInternalStateL RWriteStream &  aWriteStream  )  const [protected]
 

From CCoeControl.

Writes the internal state to the specified stream.

Parameters:
aWriteStream  Target stream.

Reimplemented from CEikGlobalTextEditor.


Friends And Related Function Documentation

friend class CEikParserManager [friend]
 

Field Documentation

TSize CEikRichTextEditor::iDefaultIconicDoorSize [protected]
 

Default size of iconic door.


The documentation for this class was generated from the following file:

Copyright © Nokia Corporation 2001-2008
Back to top