CEikSecretEditor 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 <eikseced.h>

Inherits CEikBorderedControl.

Inherited by CAknNumericSecretEditor.


Detailed Description

A single line text editor which displays an asterisk for every character entered.

The editor is suitable for editing confidential information such as a password. You can paste to the editor but no other clipboard functions are available.

The editor has an associated resource struct SECRETED and control factory identifier EEikCtSecretEd.


Public Types

enum   { EMaxSecEdBufLength = 32, EMaxSecEdSecArrayLength = 255 }

Public Member Functions

IMPORT_C  CEikSecretEditor ()
  Default constructor.
IMPORT_C  ~CEikSecretEditor ()
  Destructor.
virtual IMPORT_C void  ConstructFromResourceL (TResourceReader &aReader)
  Second-phase construction from a resource file.
virtual IMPORT_C TSize  MinimumSize ()
  Gets the editor's minimum size in pixels.
virtual IMPORT_C TKeyResponse  OfferKeyEventL (const TKeyEvent &aKeyEvent, TEventCode aType)
  Responds to key presses.
virtual IMPORT_C void  GetColorUseListL (CArrayFix< TCoeColorUse > &aColorUseList) const
  Gets the list of logical colours used to draw the editor.
virtual IMPORT_C void  HandleResourceChange (TInt aType)
  Handles a change to the editor's resources.
virtual IMPORT_C TCoeInputCapabilities  InputCapabilities () const
  Gets the editor's input capabilities.
IMPORT_C void  HandlePointerEventL (const TPointerEvent &aPointerEvent)
  From CCoeControl.
IMPORT_C void  GetText (TDes &aText) const
  Gets the editor's text string.
virtual IMPORT_C void  SetText (const TDesC &aText)
  Set the contents of the character buffer.
virtual IMPORT_C void  InitializeDisplay (TInt aNumberOfChars)
  Set the initial display of the secret editor.
IMPORT_C void  Reset ()
  Clears the editor's text string removing any trace of it from memory.
IMPORT_C void  SetMaxLength (TInt aMaxLength)
  Set the maximum length of the editor.
IMPORT_C void  AknSetFont (const CFont &aFont)
  Sets the font that is used to draw the text in this editor.
IMPORT_C void  AknSetAlignment (const CGraphicsContext::TTextAlign &aAlign)
  Sets the alignment of the editor.
IMPORT_C void  SetDefaultInputMode (TInt aInputMode)
  Changes default and current input mode of a secret editor.
IMPORT_C TInt  MaxLength () const
  Returns the current maximum length of the internal buffer.
IMPORT_C const TDesC &  Buffer () const
  Access method for getting at the buffer without copying out from it.
IMPORT_C void  RevealSecretText (TBool aReveal)
  Method to reveal (or hide) the currently input editor contents.
IMPORT_C void  SetSkinBackgroundControlContextL (MAknsControlContext *aContext)
  Set the skin control context to be used with this secret editor.
void  StartTimer ()
IMPORT_C void  SetSkinTextColorL (TInt aAknSkinIDForTextColor, TInt aAknSkinIdForBgColor=KErrNotFound)
  Sets the colors for text and background as skin IDs.

Protected Member Functions

virtual IMPORT_C void  AppendCharacterL (TInt aKeyCode)
  Appends a character to the editor.
virtual IMPORT_C void  Update ()
  Updates and redraws the editor.
void  InsertSecretChar ()
IMPORT_C void  SizeChanged ()
  Responds to changes to the size and position of the contents of this control.

Protected Attributes

HBufC *  iSecCharArr
TInt  iSecPos
TSecEdBuf  iBuf
TInt  iMaxLen
TInt  iCharWidth
TInt  iAscent
TBool  iBufferFull

Member Enumeration Documentation

anonymous enum
 
Enumerator:
EMaxSecEdBufLength  The maximum number of characters in the displayed text buffer.
EMaxSecEdSecArrayLength  Indicates the maximum number of characters which may be entered into the editor.

Editors additionally have a maximum length, see SetMaxLength(), which must not exceed this value.


Constructor & Destructor Documentation

IMPORT_C CEikSecretEditor::CEikSecretEditor  ) 
 

Default constructor.

This constructs a editor with a border type of TGulBorder::ESingleGray.

This function should be used as the first stage in two stage construction, followed by a call to either ConstructFromResourceL() or SetMaxLength().

IMPORT_C CEikSecretEditor::~CEikSecretEditor  ) 
 

Destructor.


Member Function Documentation

IMPORT_C void CEikSecretEditor::AknSetAlignment const CGraphicsContext::TTextAlign &  aAlign  ) 
 

Sets the alignment of the editor.

Parameters:
aAlign  The editor's alignment.
IMPORT_C void CEikSecretEditor::AknSetFont const CFont &  aFont  ) 
 

Sets the font that is used to draw the text in this editor.

Parameters:
aFont  A pointer to a CFont object that is used to draw the text in this editor.
virtual IMPORT_C void CEikSecretEditor::AppendCharacterL TInt  aKeyCode  )  [protected, virtual]
 

Appends a character to the editor.

Parameters:
aKeyCode  The character to append.

Reimplemented in CAknNumericSecretEditor.

IMPORT_C const TDesC& CEikSecretEditor::Buffer  )  const
 

Access method for getting at the buffer without copying out from it.

Returns:
Non-modifiable descriptor reference to the contained buffer.
virtual IMPORT_C void CEikSecretEditor::ConstructFromResourceL TResourceReader &  aReader  )  [virtual]
 

Second-phase construction from a resource file.

This function reads the number of characters which may be entered by the user into the editor from a SECRETED resource. You should call either this function or SetMaxLength() before drawing the editor and offering key events, otherwise the editor will not accept text input.

Parameters:
aReader  A resource file reader.
Panic:
EIKCTL 13 If the value read from resource is greater than EMaxSecEdLength.
virtual IMPORT_C void CEikSecretEditor::GetColorUseListL CArrayFix< TCoeColorUse > &  aColorUseList  )  const [virtual]
 

Gets the list of logical colours used to draw the editor.

Overrides CCoeControl::GetColorUseListL().

Parameters:
aColorUseList  On return, the colour list.

Reimplemented from CEikBorderedControl.

IMPORT_C void CEikSecretEditor::GetText TDes &  aText  )  const
 

Gets the editor's text string.

This may be called from the container class when the model data should be updated according to the text contained in the editor.

Parameters:
aText  On return, the editor's text. This is what is stored in memory, not what is displayed. This descriptor must be capable of holding the maxlength of the internal buffer.
IMPORT_C void CEikSecretEditor::HandlePointerEventL const TPointerEvent &  aPointerEvent  ) 
 

From CCoeControl.

Handles pointer events.

Parameters:
aPointerEvent  The pointer event.

Reimplemented from CEikBorderedControl.

Reimplemented in CAknNumericSecretEditor.

virtual IMPORT_C void CEikSecretEditor::HandleResourceChange TInt  aType  )  [virtual]
 

Handles a change to the editor's resources.

The types of resources handled are those which are shared across the environment, e.g. colours or fonts.

Calls CEikBorderedControl::HandleResourceChange().

Parameters:
aType  A message UID value.

Reimplemented from CEikBorderedControl.

virtual IMPORT_C void CEikSecretEditor::InitializeDisplay TInt  aNumberOfChars  )  [virtual]
 

Set the initial display of the secret editor.

Calling this routine doesn't affect the actual character buffer.

Parameters:
aNumberOfCharacters  Must be >=0 and <= EMaxSecEdBufLength.
virtual IMPORT_C TCoeInputCapabilities CEikSecretEditor::InputCapabilities  )  const [virtual]
 

Gets the editor's input capabilities.

Overrides CCoeControl::InputCapabilities().

If this function is overrided in a subclass, the subclass should obtain this class' InputCapabilities' object provider through TCoeInputCapabilities::ObjectProvider() and set that as a part of the subclass' InputCapabilities object provider chain to ensure maximum functionality.

Returns:
The editor's input capabilities. The ESecretText and ENavigation flags are set.

Reimplemented in CAknNumericSecretEditor.

void CEikSecretEditor::InsertSecretChar  )  [protected]
 
IMPORT_C TInt CEikSecretEditor::MaxLength  )  const
 

Returns the current maximum length of the internal buffer.

Returns:
the current maximum length of the internal buffer.
virtual IMPORT_C TSize CEikSecretEditor::MinimumSize  )  [virtual]
 

Gets the editor's minimum size in pixels.

Overrides CCoeControl::MinimumSize().

Returns:
The editor's minimum size in pixels.
virtual IMPORT_C TKeyResponse CEikSecretEditor::OfferKeyEventL const TKeyEvent &  aKeyEvent,
TEventCode  aType
[virtual]
 

Responds to key presses.

Overrides CCoeControl::OfferKeyEventL().

Parameters:
aKeyEvent  The key event.
aType  Not used.
Returns:
Indicates whether or not the key event was consumed.
IMPORT_C void CEikSecretEditor::Reset  ) 
 

Clears the editor's text string removing any trace of it from memory.

IMPORT_C void CEikSecretEditor::RevealSecretText TBool  aReveal  ) 
 

Method to reveal (or hide) the currently input editor contents.

Parameters:
aReveal  - if ETrue, reveals the contents; if EFalse hides them.
IMPORT_C void CEikSecretEditor::SetDefaultInputMode TInt  aInputMode  ) 
 

Changes default and current input mode of a secret editor.

By default input mode in the secret editor is alpha input mode (EAknEditorSecretAlphaInputMode). By using this method the default input mode can be changed to numeric input mode (EAknEditorNumericInputMode).

Parameters:
aInputMode  Default input mode in the secret editor. Only EAknEditorNumericInputMode and EAknEditorSecretAlphaInputMode are supported.
IMPORT_C void CEikSecretEditor::SetMaxLength TInt  aMaxLength  ) 
 

Set the maximum length of the editor.

This is the maximum number of characters which may be entered by the user into the editor.

Parameters:
aMaxLength  The maximum number of characters which may be entered.
Panic:
EIKCTL 13 If aMaxLength is greater than EMaxSecEdLength.
IMPORT_C void CEikSecretEditor::SetSkinBackgroundControlContextL MAknsControlContext aContext  ) 
 

Set the skin control context to be used with this secret editor.

If this method is not called, the control context available through MOP (if any) is used. If NULL control context is specified, no control context is used at all.

Parameters:
aContext  The background control context used to draw the background of this editor or NULL. Ownership is not transferred.
IMPORT_C void CEikSecretEditor::SetSkinTextColorL TInt  aAknSkinIDForTextColor,
TInt  aAknSkinIdForBgColor = KErrNotFound
 

Sets the colors for text and background as skin IDs.

Parameters:
aAknSkinIDForTextColor  ID for text color.
aAknSkinIDForBgColor  ID for background color.
virtual IMPORT_C void CEikSecretEditor::SetText const TDesC &  aText  )  [virtual]
 

Set the contents of the character buffer.

Parameters:
aText  The text to be set as the contents of the character buffer.
IMPORT_C void CEikSecretEditor::SizeChanged  )  [protected]
 

Responds to changes to the size and position of the contents of this control.

Overrides CCoeControl::SizeChanged().

void CEikSecretEditor::StartTimer  ) 
 
virtual IMPORT_C void CEikSecretEditor::Update  )  [protected, virtual]
 

Updates and redraws the editor.


Field Documentation

TInt CEikSecretEditor::iAscent [protected]
 
TSecEdBuf CEikSecretEditor::iBuf [protected]
 
TBool CEikSecretEditor::iBufferFull [protected]
 
TInt CEikSecretEditor::iCharWidth [protected]
 
TInt CEikSecretEditor::iMaxLen [protected]
 
HBufC* CEikSecretEditor::iSecCharArr [protected]
 
TInt CEikSecretEditor::iSecPos [protected]
 

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

Copyright © Nokia Corporation 2001-2008
Back to top