epoc32/include/mw/aknpasswordsettingpage.h
branchSymbian2
changeset 2 2fe1408b6811
parent 1 666f914201fb
child 4 837f303aceeb
equal deleted inserted replaced
1:666f914201fb 2:2fe1408b6811
     1 aknpasswordsettingpage.h
     1 /*
       
     2 * Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description: 
       
    15 *     Support for passwords in Settings Pages
       
    16 *
       
    17 *
       
    18 */
       
    19 
       
    20 
       
    21 #ifndef __AKNPASSWORDSETTINGPAGE__
       
    22 #define __AKNPASSWORDSETTINGPAGE__ 
       
    23 
       
    24 #include <eikdef.h>
       
    25 #include <eikbtgpc.h>
       
    26 
       
    27 // for the alphanumeric secret editor:
       
    28 #include <eikseced.h>
       
    29 #include <aknsettingpage.h>
       
    30 
       
    31 const TInt KDefaultAlphaPasswordLength = 12;
       
    32 const TInt KDefaultNumericPasswordLength = 4;
       
    33 
       
    34 /** 
       
    35  * Structure to hold the required resources for a password confirmation sequence 
       
    36  * This holds 3 resource IDs.  One for a query, and a note each for 
       
    37  * success or failure
       
    38  * This structure contains the information read in from a AVKON_PASSWORD_CONFIRMATION
       
    39  * resource structure.
       
    40  */
       
    41 class SAknConfirmationResource 
       
    42 {
       
    43 public:
       
    44 
       
    45 	/**
       
    46 	* Resource for the password query, if non-zero
       
    47 	*/
       
    48 	TInt iEntryQueryResourceId;
       
    49 	/** 
       
    50 	* Resource for the success note, if non-zero
       
    51 	*/
       
    52 	TInt iSuccessNoteResourceId;
       
    53 	/** 
       
    54 	* Resource for the failure note, if non-zero
       
    55 	*/
       
    56 	TInt iFailureNoteResourceId;
       
    57 };
       
    58 
       
    59 
       
    60 /**
       
    61  * Base class for Password editors to ensure that their general functionality is 
       
    62  * consistent.  
       
    63  * 
       
    64  * All contained-editor-specific stuff should be in the derived classes.
       
    65  *
       
    66  * THIS CLASS IS NOT INSTANTIATABLE
       
    67  * 
       
    68  */
       
    69 class CAknPasswordSettingPage : public CAknSettingPage
       
    70 {
       
    71 public:
       
    72 	/**
       
    73 	*
       
    74 	* Modes to be used for the matching of password texts
       
    75 	*
       
    76 	*/
       
    77 	enum TAknPasswordMatchingMode
       
    78 	{
       
    79 	ECaseSensitive,
       
    80 	ECaseInsensitive
       
    81 	};
       
    82 public:
       
    83 	/**
       
    84 	 * Simple constructor depending only on a single resource Id and the new and old password.
       
    85 	 * Editor resource is given via the link in the setting page resource. 
       
    86 	 *
       
    87 	 * @param aSettingPageResourceId		Setting Page to use (if present)
       
    88 	 * @param aNewPassword
       
    89 	 * @param aOldPassword					password to be checked against
       
    90 	 */
       
    91 	IMPORT_C CAknPasswordSettingPage(
       
    92 		TInt aResourceID, 
       
    93 		TDes& aNewPassword, 
       
    94 		const TDesC& aOldPassword);
       
    95 
       
    96 	/**
       
    97 	 * Constructor that allows separate setting page and editor resources
       
    98 	 * 
       
    99 	 * This constructor allows the use of setting page using only the editor resource.  Other combinations are also possible
       
   100 	 *
       
   101 	 * In all cases the number (if supplied i.e. <> 0 ) is used.  
       
   102 	 *
       
   103 	 *		Editor Resource		Setting Page Resource
       
   104 	 *			present				present				Both are used (but text & number overridden)
       
   105 	 *			 = 0					present				Editor resource is used via SP resource (Effectively like the other constructor)
       
   106 	 *			present				= 0					Default Avkon SP resource if used + this editor resource
       
   107 	 *			 = 0					= 0					uses default resource for both SP and editor. This is OK if:
       
   108 	 *	 i) control type is present, 
       
   109 	 *  ii) a default resource exists ( OK for text, integer, date, time, duration )
       
   110 	 *
       
   111 	 * Note: The first argument is a TDesC* (rather than TDesC&) because the other constructor
       
   112 	 * cannot initialize such a member without allocation or having an internal dummy buffer.
       
   113 	 * This descriptor must be owned by the client since not copy is taken until ExecuteLD()
       
   114 	 *
       
   115 	 * Rules for text and numbers: The rules are the same for both: (non-zero length) text or number other 
       
   116 	 * than EAknSettingPageNoOrdinalDisplayed if given in this constructor will not override resource 
       
   117 	 * (unless that is zero length or EAknSettingPageNoOrdinalDisplayed).  Note, however, that text or number given via the 
       
   118 	 * specific API for setting them, WILL override resource.
       
   119 	 * It is assumed that number from resource is very rare.  Special text is somewhat more likely.
       
   120 	 * 
       
   121 	 * @param aSettingTitleText	Text at top of setting pane; EXTERNALLY OWNED
       
   122 	 * @param aSettingNumber		Number at top left (if present)
       
   123 	 * @param aControlType			Determines the type constructed and how its resource is read
       
   124 	 * @param aEditorResourceId	Editor resource to use in the setting page (if present)
       
   125 	 * @param aSettingPageResourceId		Setting Page to use (if present)
       
   126 	 * @param aNewPassword			Descriptor for the new password
       
   127 	 * @param aOldPassword			Descriptor for the old password
       
   128 	 */
       
   129 
       
   130 	IMPORT_C CAknPasswordSettingPage(	const TDesC* aSettingTitleText, 
       
   131 								TInt aSettingNumber, 
       
   132 								TInt aControlType,
       
   133 								TInt aEditorResourceId, 
       
   134 								TInt aSettingPageResourceId,	
       
   135 								TDes& aNewPassword, 
       
   136 								const TDesC& aOldPassword );
       
   137 
       
   138 
       
   139 	/**
       
   140 	* Set the resource Id set for the old password confirmation sequence. 
       
   141 	* Resource Id should be for a AVKON_PASSWORD_CONFIRMATION structure
       
   142 	*
       
   143 	* @param resource for old password sequence
       
   144 	*/
       
   145 	IMPORT_C void SetOldPasswordConfirmationResourceId( TInt aOldPasswordConfirmationResourceId ); 
       
   146 
       
   147 	/** 
       
   148 	* Set the resource Id set for the new password confirmation sequence
       
   149 	* Resource Id should be for a AVKON_PASSWORD_CONFIRMATION structure
       
   150 	*
       
   151 	* @param resource for new password sequence
       
   152 	*/
       
   153 	IMPORT_C void SetNewPasswordConfirmationResourceId( TInt aNewPasswordConfirmationResourceId );
       
   154 	
       
   155 	/**
       
   156 	* Sets the matching mode to be used in the password validation
       
   157 	* @param	one of ECaseSensitive or ECaseInsensitive
       
   158 	*/
       
   159 	IMPORT_C void SetMatchingMode( TAknPasswordMatchingMode aMode );
       
   160 	
       
   161 	/**
       
   162 	* Returns the matching mode to be used in the password validation
       
   163 	* @return	one of ECaseSensitive or ECaseInsensitive
       
   164 	*/
       
   165 	IMPORT_C TAknPasswordMatchingMode MatchingMode();
       
   166 	
       
   167 	
       
   168 	/**
       
   169 	* Sets the maximum length of the password. The user will not be able to enter
       
   170 	* more than this number of characters/keys
       
   171 	*
       
   172 	* @param	set the max length
       
   173 	*/
       
   174 	IMPORT_C void SetMaxPasswordLength( TInt aLength );
       
   175 	
       
   176 	
       
   177 	/** 
       
   178 	* Access the maximum password length
       
   179 	*
       
   180 	* @return the maximum length
       
   181 	*/
       
   182 	IMPORT_C TInt MaxPasswordLength() const;
       
   183 
       
   184     /**
       
   185     *  From CCoeControl
       
   186     */
       
   187     IMPORT_C void HandlePointerEventL(const TPointerEvent& aPointerEvent);
       
   188 protected:
       
   189 
       
   190 	/**
       
   191 	* Implementation of CAknSettingPage framework method
       
   192 	* Called when the client's value is updated. Frequency of calling depends 
       
   193 	* upon the flag passed to ExecuteLD()
       
   194 	*
       
   195 	*/
       
   196 	IMPORT_C virtual void UpdateSettingL();
       
   197 	
       
   198 	
       
   199 	/** 
       
   200 	* Implementation of CAknSettingPage framework method
       
   201 	* Perform necessary operations when the user accepts. 
       
   202 	* Default implementation has password checking 
       
   203 	*/
       
   204 	IMPORT_C virtual void AcceptSettingL();
       
   205 	
       
   206 	
       
   207 	/**
       
   208 	* Acts upon changes in the hosted control's state. 
       
   209 	*
       
   210 	* @param	aControl	The control changing its state (not used)
       
   211 	* @param	aEventType	The type of control event 
       
   212 	*/
       
   213 	IMPORT_C virtual void HandleControlEventL(CCoeControl* aControl, TCoeEvent aEventType );	
       
   214 	
       
   215 	
       
   216 	/** 
       
   217 	* Implementation of CAknSettingPage framework method
       
   218 	*  
       
   219 	* Method called after full construction and activation of the setting page
       
   220 	*/
       
   221 	IMPORT_C virtual void PostDisplayInitL();
       
   222 	
       
   223 	/** 
       
   224 	* Implementation of CAknSettingPage framework method
       
   225 	* Called after display of the setting page, but before the start of the 
       
   226 	* setting page "waiting".  
       
   227 	*
       
   228 	* If overidden, would normally hold a query.
       
   229 	*
       
   230 	* @return	ETrue if OK to carry on; EFalse if setting it to be abandoned
       
   231 	*
       
   232 	*/
       
   233 	IMPORT_C virtual TBool PostDisplayCheckL();
       
   234 	
       
   235 	
       
   236 	/** 
       
   237 	* Implementation of CAknSettingPage framework method
       
   238 	*
       
   239 	*/
       
   240 	IMPORT_C virtual TBool OkToExitL(TBool aAccept);
       
   241 
       
   242 	/** 
       
   243 	* Implementation of CCoeControl framework method
       
   244 	* Called when the control has its size changed
       
   245 	*/
       
   246 	IMPORT_C virtual void SizeChanged();
       
   247 	
       
   248 	/** 
       
   249 	* Implementation of CCoeControl framework method
       
   250 	* Called when required to draw
       
   251 	*/
       
   252 	IMPORT_C void Draw(const TRect& aRect) const;
       
   253 
       
   254 	/**
       
   255 	* Only implemented in the derived classes
       
   256 	* Updates the text in the referenced password descriptor using a utility routine.
       
   257 	*
       
   258 	*/
       
   259 	virtual void UpdateTextL() = 0;
       
   260 
       
   261 	/**
       
   262 	* Framework for password handling
       
   263 	* Called when the old password is to be confirmed
       
   264 	* @param	aPassword	old password
       
   265 	* @param	aResourceId	AVKON_PASSWORD_CONFIRMATION id to use
       
   266 	*/
       
   267 	IMPORT_C virtual TBool ExecuteOldPasswordConfirmationL(const TDesC& aPassword, TInt aPasswordConfirmationResourceId );
       
   268 		
       
   269 	/**
       
   270 	* Framework for password handling
       
   271 	* Called when the new password is to be confirmed
       
   272 	* @param	aPassword	new password
       
   273 	* @param	aResourceId	AVKON_PASSWORD_CONFIRMATION id to use
       
   274 	*/
       
   275 	IMPORT_C virtual TBool ExecuteNewPasswordConfirmationL(const TDesC& aPassword, TInt aPasswordConfirmationResourceId );
       
   276 		
       
   277 	/**
       
   278 	* Framework for password handling
       
   279 	* Called to compare the two passwords
       
   280 	* @param	reference (old) password
       
   281 	* @param	candidate password; password just entered
       
   282 	*/
       
   283 	IMPORT_C virtual TInt ComparePasswords( const TDesC& aRefPassword, const TDesC& aCandidatePassword, TAknPasswordMatchingMode ) const;
       
   284 
       
   285 	/**
       
   286 	* Utility method
       
   287 	* Access to the old password confirmation resource
       
   288 	* @return	id for AVKON_PASSWORD_CONFIRMATION structure
       
   289 	*/
       
   290 	IMPORT_C TInt OldPasswordConfirmationResourceId() const;
       
   291 
       
   292 	/**
       
   293 	* Utility method
       
   294 	* Access to the new password confirmation resource
       
   295 	* @return	id for AVKON_PASSWORD_CONFIRMATION structure
       
   296 	*/
       
   297 	IMPORT_C TInt NewPasswordConfirmationResourceId() const;
       
   298 
       
   299 	/**
       
   300 	* Utility method
       
   301 	* Read in the confirmation resource structure
       
   302 	* @param	aPasswordResourceId		id to use
       
   303 	* @param	aResourceGroup		structure to fill
       
   304 	*/
       
   305 	IMPORT_C void ReadConfirmationResourceL( TInt aPasswordResourceId, SAknConfirmationResource& aResourceGroup );
       
   306 
       
   307 	/**
       
   308 	* Utility method
       
   309 	* Run the password confirmation
       
   310 	*/
       
   311 	IMPORT_C TBool DoPasswordConfirmationL(const TDesC& aPassword, TInt aPasswordConfirmationResourceId, TAknPasswordMatchingMode aMatchMode, TInt& aTries );
       
   312 
       
   313 	/**
       
   314 	* Utility method
       
   315 	* Access to new password candidate
       
   316 	*/
       
   317 
       
   318 	IMPORT_C TDes& NewPassword() const;
       
   319 
       
   320 	/**
       
   321 	* Utility method
       
   322 	* Access to old password
       
   323 	*/
       
   324 	IMPORT_C const TDesC& OldPassword() const;
       
   325 
       
   326 //
       
   327 // CoeControl Framework and reserved methods
       
   328 //
       
   329 protected:
       
   330 
       
   331 /**
       
   332  * Writes the internal state of the control and its components to aStream.
       
   333  * Does nothing in release mode.
       
   334  * Designed to be overidden and base called by subclasses.
       
   335  *
       
   336  * @param	aWriteSteam		A connected write stream
       
   337  */	
       
   338 	IMPORT_C virtual void WriteInternalStateL(RWriteStream& aWriteStream) const;
       
   339 
       
   340 private: 
       
   341 
       
   342 /**
       
   343  *	Reserved method derived from CCoeControl
       
   344  */
       
   345 	IMPORT_C virtual void Reserved_2();
       
   346 
       
   347 private:
       
   348     /**
       
   349     * From CAknControl
       
   350     */
       
   351     IMPORT_C void* ExtensionInterface( TUid aInterface );
       
   352 
       
   353 /**
       
   354  * New reserved methods for CAknSettingPage hierarchy
       
   355  */ 
       
   356 private: 
       
   357 	IMPORT_C virtual void CAknSettingPage_Reserved_1();
       
   358 	IMPORT_C virtual void CAknSettingPage_Reserved_2();
       
   359 
       
   360 private:
       
   361 	TDes& iNewPassword;
       
   362 	const TDesC& iOldPassword;
       
   363 	TInt iOldPasswordConfirmationResourceId;
       
   364 	TInt iNewPasswordConfirmationResourceId;
       
   365 	TAknPasswordMatchingMode iMatchingMode;
       
   366 	TInt iMaxPasswordLength;
       
   367 
       
   368 	TAknLayoutRect iSecretEditorLayoutRect;
       
   369 	TAknLayoutRect iHorizontalShadow;
       
   370 	TAknLayoutRect iVerticalShadow;
       
   371 	TAknLayoutRect iOutlineFrame;
       
   372 
       
   373 	TInt iSpare_1;
       
   374 
       
   375 };
       
   376 
       
   377 
       
   378 /** 
       
   379  *
       
   380  * This class is used for alphanumeric passwords
       
   381  *
       
   382  */
       
   383 
       
   384 class CAknAlphaPasswordSettingPage : public CAknPasswordSettingPage
       
   385 {
       
   386 public:
       
   387 	/**
       
   388 	 * Simple constructor depending only on a single resource Id and the new and old password.
       
   389 	 * Editor resource is given via the link in the setting page resource. 
       
   390 	 *
       
   391 	 * @param aSettingPageResourceId		Setting Page to use (if present)
       
   392 	 * @param aNewPassword
       
   393 	 * @param aOldPassword					password to be checked against
       
   394 	 */
       
   395 	IMPORT_C CAknAlphaPasswordSettingPage(
       
   396 		TInt aResourceID, 
       
   397 		TDes& aNewPassword, 
       
   398 		const TDesC& aOldPassword);
       
   399 	/**
       
   400 	 * Constructor that allows separate setting page and editor resources
       
   401 	 * 
       
   402 	 * This constructor allows the use of setting page using only the editor resource. Other combinations are also possible
       
   403 	 *
       
   404 	 * In all cases the number (if supplied i.e. <> 0 ) is used.  
       
   405 	 *
       
   406 	 *		Editor Resource		Setting Page Resource
       
   407 	 *			present				present				Both are used (but text & number overridden)
       
   408 	 *			 = 0					present				Editor resource is used via SP resource (Effectively like the other constructor)
       
   409 	 *			present				= 0					Default Avkon SP resource if used + this editor resource
       
   410 	 *			 = 0					= 0					uses default resource for both SP and editor. This is OK if:
       
   411 	 *	 i) control type is present, 
       
   412 	 *  ii) a default resource exists ( OK for text, integer, date, time, duration )
       
   413 	 *
       
   414 	 * Note: The first argument is a TDesC* (rather than TDesC&) because the other constructor
       
   415 	 * cannot initialize such a member without allocation or having an internal dummy buffer.
       
   416 	 * This descriptor must be owned by the client since not copy is taken until ExecuteLD()
       
   417 	 *
       
   418 	 * Rules for text and numbers: The rules are the same for both:  (non-zero length) text or number other 
       
   419 	 * than EAknSettingPageNoOrdinalDisplayed if given in this constructor will not override resource 
       
   420 	 * (unless that is zero length or EAknSettingPageNoOrdinalDisplayed). Note, however, that text or number given via the 
       
   421 	 * specific API for setting them, WILL override resource.
       
   422 	 * It is assumed that number from resource is very rare.  Special text is somewhat more likely.
       
   423 	 * 
       
   424 	 * @param aSettingTitleText		Text at top of setting pane; EXTERNALLY OWNED
       
   425 	 * @param aSettingNumber		Number at top left (if present)
       
   426 	 * @param aControlType			Determines the type constructed and how its resource is read
       
   427 	 * @param aEditorResourceId	Editor resource to use in the setting page (if present)
       
   428 	 * @param aSettingPageResourceId		Setting Page to use (if present)
       
   429 	 * @param aNewPassword			Descriptor for the new password
       
   430 	 * @param aOldPassword			Descriptor for the old password
       
   431 	 */
       
   432 	IMPORT_C CAknAlphaPasswordSettingPage(	const TDesC* aSettingTitleText, 
       
   433 								TInt aSettingNumber, 
       
   434 								TInt aControlType,
       
   435 								TInt aEditorResourceId, 
       
   436 								TInt aSettingPageResourceId,	
       
   437 								TDes& aNewPassword, 
       
   438 								const TDesC& aOldPassword );
       
   439 
       
   440 	/**
       
   441 	*
       
   442 	* 2nd stage construction.  This uses stored values from the constructor to allocate the 
       
   443 	* required aggregate objects, and then set the Date value. 
       
   444 	*
       
   445 	*/
       
   446 	IMPORT_C virtual void ConstructL();
       
   447 
       
   448 	/**
       
   449 	* Type specific access to hosted editor
       
   450 	* @return	the hosted (alpha secret) editor
       
   451 	*/
       
   452 	IMPORT_C CEikSecretEditor* AlphaPasswordEditor();
       
   453 
       
   454     /**
       
   455      * From CCoeControl.     
       
   456      * Handles pointer events
       
   457      * @param aPointerEvent     The pointer event.
       
   458      */	 
       
   459     IMPORT_C void HandlePointerEventL(const TPointerEvent& aPointerEvent);
       
   460 
       
   461 protected:
       
   462 	/**
       
   463 	* Destructor
       
   464 	*/
       
   465 	IMPORT_C virtual ~CAknAlphaPasswordSettingPage();
       
   466 
       
   467     /**
       
   468 	* From CAknPasswordSettingPage - Implemented in this class
       
   469 	* Copy text from the editor to the client's descriptor
       
   470 	*/
       
   471 	IMPORT_C virtual void UpdateTextL();
       
   472 
       
   473 	/**
       
   474 	* Framework for password handling
       
   475 	* Called to compare the two passwords
       
   476 	* @param	reference (old) password
       
   477 	* @param	candidate password; password just entered
       
   478 	*/
       
   479 	IMPORT_C virtual TInt ComparePasswords( const TDesC& aRefPassword, const TDesC& aCandidatePassword, TAknPasswordMatchingMode ) const;
       
   480 
       
   481 //
       
   482 // CoeControl Framework and reserved methods
       
   483 //
       
   484 protected:
       
   485 
       
   486 /**
       
   487  * Writes the internal state of the control and its components to aStream.
       
   488  * Does nothing in release mode.
       
   489  * Designed to be overidden and base called by subclasses.
       
   490  *
       
   491  * @param	aWriteSteam		A connected write stream
       
   492  */	
       
   493 	IMPORT_C virtual void WriteInternalStateL(RWriteStream& aWriteStream) const;
       
   494 
       
   495 private:
       
   496 
       
   497 /**
       
   498  *	Reserved method derived from CCoeControl
       
   499  */
       
   500 	IMPORT_C virtual void Reserved_2();
       
   501 
       
   502 private:
       
   503     /**
       
   504     * From CAknControl
       
   505     */
       
   506     IMPORT_C void* ExtensionInterface( TUid aInterface );
       
   507 
       
   508 /**
       
   509  * New reserved methods for CAknSettingPage hierarchy
       
   510  */ 
       
   511 private: 
       
   512 	IMPORT_C virtual void CAknSettingPage_Reserved_1();
       
   513 	IMPORT_C virtual void CAknSettingPage_Reserved_2();
       
   514 
       
   515 private:
       
   516     TInt iSpare;
       
   517 };
       
   518 
       
   519 
       
   520 /** 
       
   521  *
       
   522  * This class is used for numeric passwords.  The API uses text descriptors rather than
       
   523  * integers for the PIN numbers as this is the usage
       
   524  *
       
   525  */
       
   526 
       
   527 #include <aknnumseced.h>
       
   528 
       
   529 class CAknNumericPasswordSettingPage : public CAknPasswordSettingPage
       
   530 {
       
   531 public:
       
   532 	/**
       
   533 	 * Simple constructor depending only on a single resource Id and the new and old password.
       
   534 	 * Editor resource is given via the link in the setting page resource. 
       
   535 	 *
       
   536 	 * @param aSettingPageResourceId		Setting Page to use (if present)
       
   537 	 * @param aNewPassword
       
   538 	 * @param aOldPassword					password to be checked against
       
   539 	 */
       
   540 	IMPORT_C CAknNumericPasswordSettingPage(
       
   541 		TInt aResourceID, 
       
   542 		TDes& aNewPassword, 
       
   543 		const TDesC& aOldPassword);
       
   544 	/**
       
   545 	 * Constructor that allows separate setting page and editor resources
       
   546 	 * 
       
   547 	 * This constructor allows the use of setting page using only the editor resource.  Other combinations are also possible
       
   548 	 *
       
   549 	 * In all cases the number (if supplied i.e. <> 0 ) is used.  
       
   550 	 *
       
   551 	 *		Editor Resource		Setting Page Resource
       
   552 	 *			present				present				Both are used (but text & number overridden)
       
   553 	 *			 = 0					present				Editor resource is used via SP resource (Effectively like the other constructor)
       
   554 	 *			present				= 0					Default Avkon SP resource if used + this editor resource
       
   555 	 *			 = 0					= 0					uses default resource for both SP and editor. This is OK if:
       
   556 	 *	 i) control type is present, 
       
   557 	 *  ii) a default resource exists ( OK for text, integer, date, time, duration )
       
   558 	 *
       
   559 	 * Note: The first argument is a TDesC* (rather than TDesC&) because the other constructor
       
   560 	 * cannot initialize such a member without allocation or having an internal dummy buffer.
       
   561 	 * This descriptor must be owned by the client since not copy is taken until ExecuteLD()
       
   562 	 *
       
   563 	 * Rules for text and numbers: The rules are the same for both: (non-zero length) text or number other 
       
   564 	 * than EAknSettingPageNoOrdinalDisplayed if given in this constructor will not override resource 
       
   565 	 * (unless that is zero length or EAknSettingPageNoOrdinalDisplayed). Note, however, that text or number given via the 
       
   566 	 * specific API for setting them, WILL override resource.
       
   567 	 * It is assumed that number from resource is very rare.  Special text is somewhat more likely.
       
   568 	 * 
       
   569 	 * @param aSettingTitleText	Text at top of setting pane; EXTERNALLY OWNED
       
   570 	 * @param aSettingNumber		Number at top left (if present)
       
   571 	 * @param aControlType			Determines the type constructed and how its resource is read
       
   572 	 * @param aEditorResourceId	Editor resource to use in the setting page (if present)
       
   573 	 * @param aSettingPageResourceId		Setting Page to use (if present)
       
   574 	 * @param aNewPassword			Descriptor for the new password
       
   575 	 * @param aOldPassword			Descriptor for the old password
       
   576 	 */
       
   577 	IMPORT_C CAknNumericPasswordSettingPage(	const TDesC* aSettingTitleText, 
       
   578 								TInt aSettingNumber, 
       
   579 								TInt aControlType,
       
   580 								TInt aEditorResourceId, 
       
   581 								TInt aSettingPageResourceId,	
       
   582 								TDes& aNewPassword, 
       
   583 								const TDesC& aOldPassword );
       
   584 
       
   585 	/**
       
   586 	*
       
   587 	* 2nd stage construction.  This uses stored values from the conststuctor to allocate the 
       
   588 	* required aggregate objects, and then set the Date value. 
       
   589 	*
       
   590 	*/
       
   591 	IMPORT_C virtual void ConstructL();
       
   592 	
       
   593 	/**
       
   594 	* Type specific access to hosted editor
       
   595 	* @return	the hosted (numeric secret) editor
       
   596 	*/
       
   597 	IMPORT_C CAknNumericSecretEditor* NumericPasswordEditor();
       
   598 
       
   599     /**
       
   600     * From CCoeControl.     
       
   601     * Handles pointer events
       
   602     * @param aPointerEvent     The pointer event.
       
   603     */
       
   604     IMPORT_C void HandlePointerEventL(const TPointerEvent& aPointerEvent);
       
   605 
       
   606 protected:
       
   607 	/**
       
   608 	* Destructor
       
   609 	*/
       
   610 	IMPORT_C virtual ~CAknNumericPasswordSettingPage();
       
   611 
       
   612     /**
       
   613 	* From CAknPasswordSettingPage - Implemented in this class
       
   614 	* Copy text from the editor to the client's descriptor
       
   615 	*/
       
   616 	IMPORT_C virtual void UpdateTextL();
       
   617 
       
   618 //
       
   619 // CoeControl Framework and reserved methods
       
   620 //
       
   621 protected:
       
   622 
       
   623 /**
       
   624  * Writes the internal state of the control and its components to aStream.
       
   625  * Does nothing in release mode.
       
   626  * Designed to be overidden and base called by subclasses.
       
   627  *
       
   628  * @param	aWriteSteam		A connected write stream
       
   629  */	
       
   630 	IMPORT_C virtual void WriteInternalStateL(RWriteStream& aWriteStream) const;
       
   631 
       
   632 private:
       
   633    
       
   634 /**
       
   635  *	Reserved method derived from CCoeControl
       
   636  */
       
   637 	IMPORT_C virtual void Reserved_2();
       
   638 
       
   639 private:
       
   640     /**
       
   641     * From CAknControl
       
   642     */
       
   643     IMPORT_C void* ExtensionInterface( TUid aInterface );
       
   644 
       
   645 /**
       
   646  * New reserved methods for CAknSettingPage hierarchy
       
   647  */ 
       
   648 private: 
       
   649 	IMPORT_C virtual void CAknSettingPage_Reserved_1();
       
   650 	IMPORT_C virtual void CAknSettingPage_Reserved_2();
       
   651 
       
   652 private:
       
   653     TInt iSpare;
       
   654 };
       
   655 
       
   656 
       
   657 #endif