CEikGlobalTextEditor 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 <eikgted.h>

Inherits CEikEdwin.

Inherited by CEikRichTextEditor.


Detailed Description

Global text editor.

This is an edit window which supports globally formatted text. Supports a line cursor and provides functions which make it easy to launch various dialogs, for instance search, replace, set font etc.


Public Types

enum   TFontStyleFlags { EStandard = 0x00, EBold = 0x01, EItalic = 0x02, EUnderline = 0x04 }
  Font style. More...

Public Member Functions

IMPORT_C  CEikGlobalTextEditor ()
  C++ default constructor.
IMPORT_C  CEikGlobalTextEditor (const TGulBorder &aBorder)
  C++ default constructor.
IMPORT_C  ~CEikGlobalTextEditor ()
  Destructor.
IMPORT_C void  ConstructL (const CCoeControl *aParent, TInt aNumberOfLines, TInt aTextLimit, TInt aEdwinFlags, TInt aFontControlFlags, TInt aFontNameFlags)
  By Default symbian 2nd phase constructor is private.
IMPORT_C void  SetButtonGroup (CCoeControl *aButtonGroup)
  Not implemented.
IMPORT_C void  SetLineCursorBitmapL (CFbsBitmap *aBitmap)
  Not implemented.
IMPORT_C TBool  RunFontDialogL (TInt aFontFlags=EGulNoSymbolFonts, CGraphicsDevice *aGraphicsDevice=NULL, TInt aFontControlFlags=EGulFontControlAll)
  Runs a dialog enabling a user to set the font.
IMPORT_C void  RunTabsDialogL (TInt aPageWidth)
  Runs a dialog enabling an user to set tab position.
IMPORT_C void  RunIndentsDialogL (TInt aPageWidth)
  Runs indents dialog.
IMPORT_C void  SetGraphicsDevice (CGraphicsDevice *aGraphicsDevice)
  Sets the Graphics device to be used.
IMPORT_C void  RunFindDialogL ()
  Runs the find dialog.
IMPORT_C void  RunFindAgainDialogL ()
  Runs the find dialog again.
IMPORT_C void  RunReplaceDialogL ()
  Runs the replace dialog.
IMPORT_C void  InitFindL (SEdwinFindModel *&aModel, CDesCArray *&aFindList, CDesCArray *&aReplaceList)
  Sets up the find model, the find list and the replace list ready for find or replace operations.
IMPORT_C TBool  DoFindL ()
  Searches for text.
IMPORT_C void  RunParaDialogsL (TInt aCommand)
  Runs a dialog enabling a user to set one of text alignment, spacing or borders.
IMPORT_C TBool  RunPaginateDialogL (CPrintSetup *aPrintSetup, CArrayFix< TInt > *aCharsPerPage)
  Runs a dialog enabling a user to do pagination.
IMPORT_C CGlobalText *  GlobalText () const
  Gets the global text that is being edited.
IMPORT_C void  ApplyParaFormatL (CParaFormat *aParaFormat, TParaFormatMask &aParaMask)
  Applies the paragraph formatting and updates the screen layout.
IMPORT_C void  ApplyCharFormatL (TCharFormat &aCharFormat, TCharFormatMask &aCharMask)
  Applies the character formatting and updates the screen layout.
IMPORT_C void  BoldItalicUnderlineEventL (TInt aFontFlag)
  Toggles format in the current selection.
IMPORT_C void  UpdateButtonGroup ()
  Update the buttons in the button group so that they reflect the formatting of the global text object.
IMPORT_C void  ConstructFromResourceL (TResourceReader &aReader)
  From CCoeControl.
IMPORT_C TKeyResponse  OfferKeyEventL (const TKeyEvent &aKeyEvent, TEventCode aType)
  From CCoeControl.
IMPORT_C void  ActivateL ()
  From CCoeControl.
IMPORT_C void  HandlePointerEventL (const TPointerEvent &aPointerEvent)
  From CCoeControl.
IMPORT_C TInt  LineCursorWidth () const
  From CEikEdwin.

Protected Member Functions

IMPORT_C void  BaseConstructL ()
  Completes the second-phase construction of a CEikEdwin object.
IMPORT_C void  WriteInternalStateL (RWriteStream &aWriteStream) const
  From CCoeControl.

Protected Attributes

CCharFormatLayer *  iCharFormatLayer
  Stores the object's global character formatting.
CParaFormatLayer *  iParaFormatLayer
  Stores the object's global paragraph formatting.

Member Enumeration Documentation

enum CEikGlobalTextEditor::TFontStyleFlags
 

Font style.

Enumerator:
EStandard  Normal font.
EBold  Bolded font.
EItalic  Italic font.
EUnderline  Underlined font.

Constructor & Destructor Documentation

IMPORT_C CEikGlobalTextEditor::CEikGlobalTextEditor  ) 
 

C++ default constructor.

IMPORT_C CEikGlobalTextEditor::CEikGlobalTextEditor const TGulBorder &  aBorder  ) 
 

C++ default constructor.

Parameters:
aBorder  The editor's border.
IMPORT_C CEikGlobalTextEditor::~CEikGlobalTextEditor  ) 
 

Destructor.


Member Function Documentation

IMPORT_C void CEikGlobalTextEditor::ActivateL  ) 
 

From CCoeControl.

Sets the editor ready for drawing.

Reimplemented from CEikEdwin.

Reimplemented in CEikRichTextEditor.

IMPORT_C void CEikGlobalTextEditor::ApplyCharFormatL TCharFormat &  aCharFormat,
TCharFormatMask &  aCharMask
 

Applies the character formatting and updates the screen layout.

The attributes which are set in the mask are read from aCharFormat. The attributes which are not set in the mask are not changed.

Parameters:
aCharFormat  Contain the new character formatting values to apply.
aCharMask  Bitmask specifying the character format attributes to change.
IMPORT_C void CEikGlobalTextEditor::ApplyParaFormatL CParaFormat *  aParaFormat,
TParaFormatMask &  aParaMask
 

Applies the paragraph formatting and updates the screen layout.

The attributes which are set in the mask are read from aParaMask. The attributes which are not set in the mask are not changed.

Parameters:
aParaFormat  Contains the new paragraph formatting values to apply.
aParaMask  Bitmask specifying the paragraph format attributes to change.
IMPORT_C void CEikGlobalTextEditor::BaseConstructL  )  [protected]
 

Completes the second-phase construction of a CEikEdwin object.

This protected function is called by ConstructL() and ConstructFromResourceL() after the Edwin’s size, flags and text limit have been set. Derived classes should call either this function or CEikEdwin’s ConstructL() or ConstructFromResourceL() functions during their construction before initialising their own members.

Reimplemented from CEikEdwin.

IMPORT_C void CEikGlobalTextEditor::BoldItalicUnderlineEventL TInt  aFontFlag  ) 
 

Toggles format in the current selection.

For a global text editor the format change is applied globally. For a rich text editor where there is no selection the format change is applied to the word at the current cursor position.

Parameters:
aFontFlag  The format attribute toggle. See the TFontStyleFlags enum.
IMPORT_C void CEikGlobalTextEditor::ConstructFromResourceL TResourceReader &  aReader  ) 
 

From CCoeControl.

Completes construction of the global text editor from a resource file.

The editor's paragraph and character formatting is set to default values.

See the GTXTED resource struct

Parameters:
aReader  A reader positioned for reading from a GTXTED resource.

Reimplemented from CEikEdwin.

Reimplemented in CEikRichTextEditor.

IMPORT_C void CEikGlobalTextEditor::ConstructL const CCoeControl *  aParent,
TInt  aNumberOfLines,
TInt  aTextLimit,
TInt  aEdwinFlags,
TInt  aFontControlFlags,
TInt  aFontNameFlags
 

By Default symbian 2nd phase constructor is private.

Completes construction of the global text editor.

The editor's paragraph and character formatting is set to default values.

Parameters:
aParent  The editor's parent control. Omit if the editor has no parent.
aNumberOfLines  The editor's number of lines.
aTextLimit  The maximum length of the editor in characters.
aEdwinFlags  The editor's flags. See CEikEdwin::TFlags.
aFontControlFlags  A set of flags that specify which font controls should appear, e.g. specifying EGulFontControlBold removes the bold checkbox control. The default shows all. For possible values, see gulftflg.hrh.
aFontNameFlags  The editor's font name flags. For possible values, see gulftflg.hrh.

Reimplemented in CEikRichTextEditor.

IMPORT_C TBool CEikGlobalTextEditor::DoFindL  ) 
 

Searches for text.

Returns ETrue if text is found.

Used by RunFindDialogL(), RunFindAgainDialogL() and RunReplaceDialogL() methods.

Returns:
ETrue if the text is found EFalse otherwise.
IMPORT_C CGlobalText* CEikGlobalTextEditor::GlobalText  )  const
 

Gets the global text that is being edited.

Returns:
The global text being edited.
IMPORT_C void CEikGlobalTextEditor::HandlePointerEventL const TPointerEvent &  aPointerEvent  ) 
 

From CCoeControl.

Handles pointer events.

Parameters:
aPointerEvent  Pointer to an event that is to be handled.

Reimplemented from CEikEdwin.

Reimplemented in CEikRichTextEditor.

IMPORT_C void CEikGlobalTextEditor::InitFindL SEdwinFindModel *&  aModel,
CDesCArray *&  aFindList,
CDesCArray *&  aReplaceList
 

Sets up the find model, the find list and the replace list ready for find or replace operations.

Parameters:
aModel  The find model to be used.
aFindList  The find list to be used.
aReplaceList  The replace list to be used.
IMPORT_C TInt CEikGlobalTextEditor::LineCursorWidth  )  const [virtual]
 

From CEikEdwin.

Gets the width of a line cursor in pixels.

Returns:
The width of the line cursor in pixels.

Reimplemented from CEikEdwin.

IMPORT_C TKeyResponse CEikGlobalTextEditor::OfferKeyEventL const TKeyEvent &  aKeyEvent,
TEventCode  aType
 

From CCoeControl.

Handles key events.

Parameters:
aKeyEvent  The key code and modifier
aType  The type of the event: e.g. Key up.
Returns:
EKeyWasConsumed if the event was handled. EKeyWasNotConsumed if the event was not handled.

Reimplemented from CEikEdwin.

Reimplemented in CEikRichTextEditor.

IMPORT_C void CEikGlobalTextEditor::RunFindAgainDialogL  ) 
 

Runs the find dialog again.

IMPORT_C void CEikGlobalTextEditor::RunFindDialogL  ) 
 

Runs the find dialog.

Enables an user to specify the text for which to search for.

IMPORT_C TBool CEikGlobalTextEditor::RunFontDialogL TInt  aFontFlags = EGulNoSymbolFonts,
CGraphicsDevice *  aGraphicsDevice = NULL,
TInt  aFontControlFlags = EGulFontControlAll
 

Runs a dialog enabling a user to set the font.

Updates the button group to reflect any text formatting applied.

Parameters:
aFontFlags  = EGulNoSymbolFonts Specifies which font types should appear in the list. For possible values see gulftflg.hrh.
aGraphicsDevice  = NULL The graphics device. This is used to get the list of available fonts. If NULL the default screen device is used.
aFontControlFlags  = EGulFontControlAll A set of flags that specify which font controls should appear in the dialog e.g. specifying EGulFontControlBold removes the bold checkbox control. The default shows all. For possible values see gulftflg.hrh.
Returns:
ETrue if user made a change and pressed OK. EFalse if user pressed cancel or made no changes.
IMPORT_C void CEikGlobalTextEditor::RunIndentsDialogL TInt  aPageWidth  ) 
 

Runs indents dialog.

Changes the paragraph format to indent all text.

Parameters:
aPageWidth  Width of page in twips.
IMPORT_C TBool CEikGlobalTextEditor::RunPaginateDialogL CPrintSetup *  aPrintSetup,
CArrayFix< TInt > *  aCharsPerPage
 

Runs a dialog enabling a user to do pagination.

Parameters:
aPrintSetup  The printer setup.
aCharsPerPage  Page table (array of characters per page).
Returns:
ETrue if pagination is succesfull EFalse otherwise.
IMPORT_C void CEikGlobalTextEditor::RunParaDialogsL TInt  aCommand  ) 
 

Runs a dialog enabling a user to set one of text alignment, spacing or borders.

Depending on the user's choice another dialog is run enabling them to set their requirements.

Parameters:
aCommand  User selected command. One of EEikCmdParaAlign, EEikCmdParaSpacing or EEikCmdParaBorder.
IMPORT_C void CEikGlobalTextEditor::RunReplaceDialogL  ) 
 

Runs the replace dialog.

Enables the user to specify the text to be searched for and the replacement for that text. Can replace single or multiple occurances.

IMPORT_C void CEikGlobalTextEditor::RunTabsDialogL TInt  aPageWidth  ) 
 

Runs a dialog enabling an user to set tab position.

Parameters:
aPageWidth  Width of the page in twips.
IMPORT_C void CEikGlobalTextEditor::SetButtonGroup CCoeControl *  aButtonGroup  ) 
 

Not implemented.

Parameters:
aButtonGroup  Not used
IMPORT_C void CEikGlobalTextEditor::SetGraphicsDevice CGraphicsDevice *  aGraphicsDevice  ) 
 

Sets the Graphics device to be used.

Parameters:
aGraphicsDevice  Wanted graphics device.
IMPORT_C void CEikGlobalTextEditor::SetLineCursorBitmapL CFbsBitmap *  aBitmap  ) 
 

Not implemented.

Parameters:
aBitmap  Not used
IMPORT_C void CEikGlobalTextEditor::UpdateButtonGroup  ) 
 

Update the buttons in the button group so that they reflect the formatting of the global text object.

IMPORT_C void CEikGlobalTextEditor::WriteInternalStateL RWriteStream &  aWriteStream  )  const [protected]
 

From CCoeControl.

Writes the internal state to the specified stream. Does nothing in release mode.

Parameters:
aWriteStream  The stream to write to.

Reimplemented from CEikEdwin.

Reimplemented in CEikRichTextEditor.


Field Documentation

CCharFormatLayer* CEikGlobalTextEditor::iCharFormatLayer [protected]
 

Stores the object's global character formatting.

Reimplemented from CEikEdwin.

CParaFormatLayer* CEikGlobalTextEditor::iParaFormatLayer [protected]
 

Stores the object's global paragraph formatting.

Reimplemented from CEikEdwin.


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

Copyright © Nokia Corporation 2001-2008
Back to top