aknpasswordsettingpage.h

Go to the documentation of this file.
00001 /*
00002 * ============================================================================
00003 *  Name     : AknPasswordSettingPage.h
00004 *  Part of  : Avkon
00005 *
00006 *  Description:
00007 *     Support for passwords in Settings Pages
00008 *
00009 *  Version:
00010 *
00011 *  Copyright © 2002 Nokia Corporation.
00012 *  This material, including documentation and any related 
00013 *  computer programs, is protected by copyright controlled by 
00014 *  Nokia Corporation. All rights are reserved. Copying, 
00015 *  including reproducing, storing,  adapting or translating, any 
00016 *  or all of this material requires the prior written consent of 
00017 *  Nokia Corporation. This material also contains confidential 
00018 *  information which may not be disclosed to others without the 
00019 *  prior written consent of Nokia Corporation.
00020 * ============================================================================
00021 */
00022 
00023 #ifndef __AKNPASSWORDSETTINGPAGE__
00024 #define __AKNPASSWORDSETTINGPAGE__ 
00025 
00026 #include <eikdef.h>
00027 #include <eikbtgpc.h>
00028 
00029 // for the alphanumeric secret editor:
00030 #include <eikseced.h>
00031 #include <aknsettingpage.h>
00032 
00033 const TInt KDefaultAlphaPasswordLength = 12;
00034 const TInt KDefaultNumericPasswordLength = 4;
00035 
00043 class SAknConfirmationResource 
00044 {
00045 public:
00046 
00050         TInt iEntryQueryResourceId;
00054         TInt iSuccessNoteResourceId;
00058         TInt iFailureNoteResourceId;
00059 };
00060 
00061 
00071 class CAknPasswordSettingPage : public CAknSettingPage
00072 {
00073 public:
00079         enum TAknPasswordMatchingMode
00080         {
00081         ECaseSensitive,
00082         ECaseInsensitive
00083         };
00084 public:
00093         IMPORT_C CAknPasswordSettingPage(
00094                 TInt aResourceID, 
00095                 TDes& aNewPassword, 
00096                 const TDesC& aOldPassword);
00097 
00132         IMPORT_C CAknPasswordSettingPage(       const TDesC* aSettingTitleText, 
00133                                                                 TInt aSettingNumber, 
00134                                                                 TInt aControlType,
00135                                                                 TInt aEditorResourceId, 
00136                                                                 TInt aSettingPageResourceId,    
00137                                                                 TDes& aNewPassword, 
00138                                                                 const TDesC& aOldPassword );
00139 
00140 
00147         IMPORT_C void SetOldPasswordConfirmationResourceId( TInt aOldPasswordConfirmationResourceId ); 
00148 
00155         IMPORT_C void SetNewPasswordConfirmationResourceId( TInt aNewPasswordConfirmationResourceId );
00156         
00161         IMPORT_C void SetMatchingMode( TAknPasswordMatchingMode aMode );
00162         
00167         IMPORT_C TAknPasswordMatchingMode MatchingMode();
00168         
00169         
00176         IMPORT_C void SetMaxPasswordLength( TInt aLength );
00177         
00178         
00184         IMPORT_C TInt MaxPasswordLength() const;
00185 
00189     IMPORT_C void HandlePointerEventL(const TPointerEvent& aPointerEvent);
00190 protected:
00191 
00198         IMPORT_C virtual void UpdateSettingL();
00199         
00200         
00206         IMPORT_C virtual void AcceptSettingL();
00207         
00208         
00215         IMPORT_C virtual void HandleControlEventL(CCoeControl* aControl, TCoeEvent aEventType );        
00216         
00217         
00223         IMPORT_C virtual void PostDisplayInitL();
00224         
00235         IMPORT_C virtual TBool PostDisplayCheckL();
00236         
00237         
00242         IMPORT_C virtual TBool OkToExitL(TBool aAccept);
00243 
00248         IMPORT_C virtual void SizeChanged();
00249         
00254         IMPORT_C void Draw(const TRect& aRect) const;
00255 
00261         virtual void UpdateTextL() = 0;
00262 
00269         IMPORT_C virtual TBool ExecuteOldPasswordConfirmationL(const TDesC& aPassword, TInt aPasswordConfirmationResourceId );
00270                 
00277         IMPORT_C virtual TBool ExecuteNewPasswordConfirmationL(const TDesC& aPassword, TInt aPasswordConfirmationResourceId );
00278                 
00285         IMPORT_C virtual TInt ComparePasswords( const TDesC& aRefPassword, const TDesC& aCandidatePassword, TAknPasswordMatchingMode ) const;
00286 
00292         IMPORT_C TInt OldPasswordConfirmationResourceId() const;
00293 
00299         IMPORT_C TInt NewPasswordConfirmationResourceId() const;
00300 
00307         IMPORT_C void ReadConfirmationResourceL( TInt aPasswordResourceId, SAknConfirmationResource& aResourceGroup );
00308 
00313         IMPORT_C TBool DoPasswordConfirmationL(const TDesC& aPassword, TInt aPasswordConfirmationResourceId, TAknPasswordMatchingMode aMatchMode, TInt& aTries );
00314 
00320         IMPORT_C TDes& NewPassword() const;
00321 
00326         IMPORT_C const TDesC& OldPassword() const;
00327 
00328 //
00329 // CoeControl Framework and reserved methods
00330 //
00331 protected:
00332 
00340         IMPORT_C virtual void WriteInternalStateL(RWriteStream& aWriteStream) const;
00341 
00342 private: 
00343 
00347         IMPORT_C virtual void Reserved_2();
00348 
00349 private:
00353     IMPORT_C void* ExtensionInterface( TUid aInterface );
00354 
00358 private: 
00359         IMPORT_C virtual void CAknSettingPage_Reserved_1();
00360         IMPORT_C virtual void CAknSettingPage_Reserved_2();
00361 
00362 private:
00363         TDes& iNewPassword;
00364         const TDesC& iOldPassword;
00365         TInt iOldPasswordConfirmationResourceId;
00366         TInt iNewPasswordConfirmationResourceId;
00367         TAknPasswordMatchingMode iMatchingMode;
00368         TInt iMaxPasswordLength;
00369 
00370         TAknLayoutRect iSecretEditorLayoutRect;
00371         TAknLayoutRect iHorizontalShadow;
00372         TAknLayoutRect iVerticalShadow;
00373         TAknLayoutRect iOutlineFrame;
00374 
00375         TInt iSpare_1;
00376 
00377 };
00378 
00379 
00386 class CAknAlphaPasswordSettingPage : public CAknPasswordSettingPage
00387 {
00388 public:
00397         IMPORT_C CAknAlphaPasswordSettingPage(
00398                 TInt aResourceID, 
00399                 TDes& aNewPassword, 
00400                 const TDesC& aOldPassword);
00434         IMPORT_C CAknAlphaPasswordSettingPage(  const TDesC* aSettingTitleText, 
00435                                                                 TInt aSettingNumber, 
00436                                                                 TInt aControlType,
00437                                                                 TInt aEditorResourceId, 
00438                                                                 TInt aSettingPageResourceId,    
00439                                                                 TDes& aNewPassword, 
00440                                                                 const TDesC& aOldPassword );
00441 
00448         IMPORT_C virtual void ConstructL();
00449 
00454         IMPORT_C CEikSecretEditor* AlphaPasswordEditor();
00455 
00461     IMPORT_C void HandlePointerEventL(const TPointerEvent& aPointerEvent);
00462 
00463 protected:
00467         IMPORT_C virtual ~CAknAlphaPasswordSettingPage();
00468 
00473         IMPORT_C virtual void UpdateTextL();
00474 
00481         IMPORT_C virtual TInt ComparePasswords( const TDesC& aRefPassword, const TDesC& aCandidatePassword, TAknPasswordMatchingMode ) const;
00482 
00483 //
00484 // CoeControl Framework and reserved methods
00485 //
00486 protected:
00487 
00495         IMPORT_C virtual void WriteInternalStateL(RWriteStream& aWriteStream) const;
00496 
00497 private:
00498 
00502         IMPORT_C virtual void Reserved_2();
00503 
00504 private:
00508     IMPORT_C void* ExtensionInterface( TUid aInterface );
00509 
00513 private: 
00514         IMPORT_C virtual void CAknSettingPage_Reserved_1();
00515         IMPORT_C virtual void CAknSettingPage_Reserved_2();
00516 
00517 private:
00518     TInt iSpare;
00519 };
00520 
00521 
00529 #include <aknnumseced.h>
00530 
00531 class CAknNumericPasswordSettingPage : public CAknPasswordSettingPage
00532 {
00533 public:
00542         IMPORT_C CAknNumericPasswordSettingPage(
00543                 TInt aResourceID, 
00544                 TDes& aNewPassword, 
00545                 const TDesC& aOldPassword);
00579         IMPORT_C CAknNumericPasswordSettingPage(        const TDesC* aSettingTitleText, 
00580                                                                 TInt aSettingNumber, 
00581                                                                 TInt aControlType,
00582                                                                 TInt aEditorResourceId, 
00583                                                                 TInt aSettingPageResourceId,    
00584                                                                 TDes& aNewPassword, 
00585                                                                 const TDesC& aOldPassword );
00586 
00593         IMPORT_C virtual void ConstructL();
00594         
00599         IMPORT_C CAknNumericSecretEditor* NumericPasswordEditor();
00600 
00606     IMPORT_C void HandlePointerEventL(const TPointerEvent& aPointerEvent);
00607 
00608 protected:
00612         IMPORT_C virtual ~CAknNumericPasswordSettingPage();
00613 
00618         IMPORT_C virtual void UpdateTextL();
00619 
00620 //
00621 // CoeControl Framework and reserved methods
00622 //
00623 protected:
00624 
00632         IMPORT_C virtual void WriteInternalStateL(RWriteStream& aWriteStream) const;
00633 
00634 private:
00635    
00639         IMPORT_C virtual void Reserved_2();
00640 
00641 private:
00645     IMPORT_C void* ExtensionInterface( TUid aInterface );
00646 
00650 private: 
00651         IMPORT_C virtual void CAknSettingPage_Reserved_1();
00652         IMPORT_C virtual void CAknSettingPage_Reserved_2();
00653 
00654 private:
00655     TInt iSpare;
00656 };
00657 
00658 
00659 #endif

Copyright © Nokia Corporation 2001-2008
Back to top