CAknPasswordSettingPage Class Reference

API published in: S60 1st Ed

Link against: avkon.lib

Capability Information

Required Capabilities

None


#include <aknpasswordsettingpage.h>

Inherits CAknSettingPage.

Inherited by CAknAlphaPasswordSettingPage, and CAknNumericPasswordSettingPage.


Detailed Description

Base class for Password editors to ensure that their general functionality is consistent.

All contained-editor-specific stuff should be in the derived classes.

THIS CLASS IS NOT INSTANTIATABLE


Public Types

enum   TAknPasswordMatchingMode { ECaseSensitive, ECaseInsensitive }
  Modes to be used for the matching of password texts. More...

Public Member Functions

IMPORT_C  CAknPasswordSettingPage (TInt aResourceID, TDes &aNewPassword, const TDesC &aOldPassword)
  Simple constructor depending only on a single resource Id and the new and old password.
IMPORT_C  CAknPasswordSettingPage (const TDesC *aSettingTitleText, TInt aSettingNumber, TInt aControlType, TInt aEditorResourceId, TInt aSettingPageResourceId, TDes &aNewPassword, const TDesC &aOldPassword)
  Constructor that allows separate setting page and editor resources.
IMPORT_C void  SetOldPasswordConfirmationResourceId (TInt aOldPasswordConfirmationResourceId)
  Set the resource Id set for the old password confirmation sequence.
IMPORT_C void  SetNewPasswordConfirmationResourceId (TInt aNewPasswordConfirmationResourceId)
  Set the resource Id set for the new password confirmation sequence Resource Id should be for a AVKON_PASSWORD_CONFIRMATION structure.
IMPORT_C void  SetMatchingMode (TAknPasswordMatchingMode aMode)
  Sets the matching mode to be used in the password validation.
IMPORT_C TAknPasswordMatchingMode  MatchingMode ()
  Returns the matching mode to be used in the password validation.
IMPORT_C void  SetMaxPasswordLength (TInt aLength)
  Sets the maximum length of the password.
IMPORT_C TInt  MaxPasswordLength () const
  Access the maximum password length.
IMPORT_C void  HandlePointerEventL (const TPointerEvent &aPointerEvent)
  From CCoeControl.

Protected Member Functions

virtual IMPORT_C void  UpdateSettingL ()
  Implementation of CAknSettingPage framework method Called when the client's value is updated.
virtual IMPORT_C void  AcceptSettingL ()
  Implementation of CAknSettingPage framework method Perform necessary operations when the user accepts.
virtual IMPORT_C void  HandleControlEventL (CCoeControl *aControl, TCoeEvent aEventType)
  Acts upon changes in the hosted control's state.
virtual IMPORT_C void  PostDisplayInitL ()
  Implementation of CAknSettingPage framework method.
virtual IMPORT_C TBool  PostDisplayCheckL ()
  Implementation of CAknSettingPage framework method Called after display of the setting page, but before the start of the setting page "waiting".
virtual IMPORT_C TBool  OkToExitL (TBool aAccept)
  Implementation of CAknSettingPage framework method.
virtual IMPORT_C void  SizeChanged ()
  Implementation of CCoeControl framework method Called when the control has its size changed.
IMPORT_C void  Draw (const TRect &aRect) const
  Implementation of CCoeControl framework method Called when required to draw.
virtual void  UpdateTextL ()=0
  Only implemented in the derived classes Updates the text in the referenced password descriptor using a utility routine.
virtual IMPORT_C TBool  ExecuteOldPasswordConfirmationL (const TDesC &aPassword, TInt aPasswordConfirmationResourceId)
  Framework for password handling Called when the old password is to be confirmed.
virtual IMPORT_C TBool  ExecuteNewPasswordConfirmationL (const TDesC &aPassword, TInt aPasswordConfirmationResourceId)
  Framework for password handling Called when the new password is to be confirmed.
virtual IMPORT_C TInt  ComparePasswords (const TDesC &aRefPassword, const TDesC &aCandidatePassword, TAknPasswordMatchingMode) const
  Framework for password handling Called to compare the two passwords.
IMPORT_C TInt  OldPasswordConfirmationResourceId () const
  Utility method Access to the old password confirmation resource.
IMPORT_C TInt  NewPasswordConfirmationResourceId () const
  Utility method Access to the new password confirmation resource.
IMPORT_C void  ReadConfirmationResourceL (TInt aPasswordResourceId, SAknConfirmationResource &aResourceGroup)
  Utility method Read in the confirmation resource structure.
IMPORT_C TBool  DoPasswordConfirmationL (const TDesC &aPassword, TInt aPasswordConfirmationResourceId, TAknPasswordMatchingMode aMatchMode, TInt &aTries)
  Utility method Run the password confirmation.
IMPORT_C TDes &  NewPassword () const
  Utility method Access to new password candidate.
IMPORT_C const TDesC &  OldPassword () const
  Utility method Access to old password.
virtual IMPORT_C void  WriteInternalStateL (RWriteStream &aWriteStream) const
  Writes the internal state of the control and its components to aStream.

Member Enumeration Documentation

enum CAknPasswordSettingPage::TAknPasswordMatchingMode
 

Modes to be used for the matching of password texts.

Enumerator:
ECaseSensitive 
ECaseInsensitive 

Constructor & Destructor Documentation

IMPORT_C CAknPasswordSettingPage::CAknPasswordSettingPage TInt  aResourceID,
TDes &  aNewPassword,
const TDesC &  aOldPassword
 

Simple constructor depending only on a single resource Id and the new and old password.

Editor resource is given via the link in the setting page resource.

Parameters:
aSettingPageResourceId  Setting Page to use (if present)
aNewPassword 
aOldPassword  password to be checked against
IMPORT_C CAknPasswordSettingPage::CAknPasswordSettingPage const TDesC *  aSettingTitleText,
TInt  aSettingNumber,
TInt  aControlType,
TInt  aEditorResourceId,
TInt  aSettingPageResourceId,
TDes &  aNewPassword,
const TDesC &  aOldPassword
 

Constructor that allows separate setting page and editor resources.

This constructor allows the use of setting page using only the editor resource. Other combinations are also possible

In all cases the number (if supplied i.e. <> 0 ) is used.

Editor Resource Setting Page Resource present present Both are used (but text & number overridden) = 0 present Editor resource is used via SP resource (Effectively like the other constructor) present = 0 Default Avkon SP resource if used + this editor resource = 0 = 0 uses default resource for both SP and editor. This is OK if: i) control type is present, ii) a default resource exists ( OK for text, integer, date, time, duration )

Note: The first argument is a TDesC* (rather than TDesC&) because the other constructor cannot initialize such a member without allocation or having an internal dummy buffer. This descriptor must be owned by the client since not copy is taken until ExecuteLD()

Rules for text and numbers: The rules are the same for both: (non-zero length) text or number other than EAknSettingPageNoOrdinalDisplayed if given in this constructor will not override resource (unless that is zero length or EAknSettingPageNoOrdinalDisplayed). Note, however, that text or number given via the specific API for setting them, WILL override resource. It is assumed that number from resource is very rare. Special text is somewhat more likely.

Parameters:
aSettingTitleText  Text at top of setting pane; EXTERNALLY OWNED
aSettingNumber  Number at top left (if present)
aControlType  Determines the type constructed and how its resource is read
aEditorResourceId  Editor resource to use in the setting page (if present)
aSettingPageResourceId  Setting Page to use (if present)
aNewPassword  Descriptor for the new password
aOldPassword  Descriptor for the old password

Member Function Documentation

virtual IMPORT_C void CAknPasswordSettingPage::AcceptSettingL  )  [protected, virtual]
 

Implementation of CAknSettingPage framework method Perform necessary operations when the user accepts.

Default implementation has password checking

Reimplemented from CAknSettingPage.

virtual IMPORT_C TInt CAknPasswordSettingPage::ComparePasswords const TDesC &  aRefPassword,
const TDesC &  aCandidatePassword,
TAknPasswordMatchingMode 
const [protected, virtual]
 

Framework for password handling Called to compare the two passwords.

Parameters:
reference  (old) password
candidate  password; password just entered
IMPORT_C TBool CAknPasswordSettingPage::DoPasswordConfirmationL const TDesC &  aPassword,
TInt  aPasswordConfirmationResourceId,
TAknPasswordMatchingMode  aMatchMode,
TInt &  aTries
[protected]
 

Utility method Run the password confirmation.

IMPORT_C void CAknPasswordSettingPage::Draw const TRect &  aRect  )  const [protected]
 

Implementation of CCoeControl framework method Called when required to draw.

Reimplemented from CAknSettingPage.

virtual IMPORT_C TBool CAknPasswordSettingPage::ExecuteNewPasswordConfirmationL const TDesC &  aPassword,
TInt  aPasswordConfirmationResourceId
[protected, virtual]
 

Framework for password handling Called when the new password is to be confirmed.

Parameters:
aPassword  new password
aResourceId  AVKON_PASSWORD_CONFIRMATION id to use
virtual IMPORT_C TBool CAknPasswordSettingPage::ExecuteOldPasswordConfirmationL const TDesC &  aPassword,
TInt  aPasswordConfirmationResourceId
[protected, virtual]
 

Framework for password handling Called when the old password is to be confirmed.

Parameters:
aPassword  old password
aResourceId  AVKON_PASSWORD_CONFIRMATION id to use
virtual IMPORT_C void CAknPasswordSettingPage::HandleControlEventL CCoeControl *  aControl,
TCoeEvent  aEventType
[protected, virtual]
 

Acts upon changes in the hosted control's state.

Parameters:
aControl  The control changing its state (not used)
aEventType  The type of control event

Reimplemented from CAknSettingPage.

IMPORT_C void CAknPasswordSettingPage::HandlePointerEventL const TPointerEvent &  aPointerEvent  ) 
 

From CCoeControl.

Reimplemented from CAknSettingPage.

Reimplemented in CAknAlphaPasswordSettingPage, and CAknNumericPasswordSettingPage.

IMPORT_C TAknPasswordMatchingMode CAknPasswordSettingPage::MatchingMode  ) 
 

Returns the matching mode to be used in the password validation.

Returns:
one of ECaseSensitive or ECaseInsensitive
IMPORT_C TInt CAknPasswordSettingPage::MaxPasswordLength  )  const
 

Access the maximum password length.

Returns:
the maximum length
IMPORT_C TDes& CAknPasswordSettingPage::NewPassword  )  const [protected]
 

Utility method Access to new password candidate.

IMPORT_C TInt CAknPasswordSettingPage::NewPasswordConfirmationResourceId  )  const [protected]
 

Utility method Access to the new password confirmation resource.

Returns:
id for AVKON_PASSWORD_CONFIRMATION structure
virtual IMPORT_C TBool CAknPasswordSettingPage::OkToExitL TBool  aAccept  )  [protected, virtual]
 

Implementation of CAknSettingPage framework method.

Reimplemented from CAknSettingPage.

IMPORT_C const TDesC& CAknPasswordSettingPage::OldPassword  )  const [protected]
 

Utility method Access to old password.

IMPORT_C TInt CAknPasswordSettingPage::OldPasswordConfirmationResourceId  )  const [protected]
 

Utility method Access to the old password confirmation resource.

Returns:
id for AVKON_PASSWORD_CONFIRMATION structure
virtual IMPORT_C TBool CAknPasswordSettingPage::PostDisplayCheckL  )  [protected, virtual]
 

Implementation of CAknSettingPage framework method Called after display of the setting page, but before the start of the setting page "waiting".

If overidden, would normally hold a query.

Returns:
ETrue if OK to carry on; EFalse if setting it to be abandoned

Reimplemented from CAknSettingPage.

virtual IMPORT_C void CAknPasswordSettingPage::PostDisplayInitL  )  [protected, virtual]
 

Implementation of CAknSettingPage framework method.

Method called after full construction and activation of the setting page

IMPORT_C void CAknPasswordSettingPage::ReadConfirmationResourceL TInt  aPasswordResourceId,
SAknConfirmationResource aResourceGroup
[protected]
 

Utility method Read in the confirmation resource structure.

Parameters:
aPasswordResourceId  id to use
aResourceGroup  structure to fill
IMPORT_C void CAknPasswordSettingPage::SetMatchingMode TAknPasswordMatchingMode  aMode  ) 
 

Sets the matching mode to be used in the password validation.

Parameters:
one  of ECaseSensitive or ECaseInsensitive
IMPORT_C void CAknPasswordSettingPage::SetMaxPasswordLength TInt  aLength  ) 
 

Sets the maximum length of the password.

The user will not be able to enter more than this number of characters/keys

Parameters:
set  the max length
IMPORT_C void CAknPasswordSettingPage::SetNewPasswordConfirmationResourceId TInt  aNewPasswordConfirmationResourceId  ) 
 

Set the resource Id set for the new password confirmation sequence Resource Id should be for a AVKON_PASSWORD_CONFIRMATION structure.

Parameters:
resource  for new password sequence
IMPORT_C void CAknPasswordSettingPage::SetOldPasswordConfirmationResourceId TInt  aOldPasswordConfirmationResourceId  ) 
 

Set the resource Id set for the old password confirmation sequence.

Resource Id should be for a AVKON_PASSWORD_CONFIRMATION structure

Parameters:
resource  for old password sequence
virtual IMPORT_C void CAknPasswordSettingPage::SizeChanged  )  [protected, virtual]
 

Implementation of CCoeControl framework method Called when the control has its size changed.

Reimplemented from CAknSettingPage.

virtual IMPORT_C void CAknPasswordSettingPage::UpdateSettingL  )  [protected, virtual]
 

Implementation of CAknSettingPage framework method Called when the client's value is updated.

Frequency of calling depends upon the flag passed to ExecuteLD()

Reimplemented from CAknSettingPage.

virtual void CAknPasswordSettingPage::UpdateTextL  )  [protected, pure virtual]
 

Only implemented in the derived classes Updates the text in the referenced password descriptor using a utility routine.

Implemented in CAknAlphaPasswordSettingPage, and CAknNumericPasswordSettingPage.

virtual IMPORT_C void CAknPasswordSettingPage::WriteInternalStateL RWriteStream &  aWriteStream  )  const [protected, virtual]
 

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.

Parameters:
aWriteSteam  A connected write stream

Reimplemented from CAknSettingPage.

Reimplemented in CAknAlphaPasswordSettingPage, and CAknNumericPasswordSettingPage.


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

Copyright © Nokia Corporation 2001-2008
Back to top