wim/WimServer/inc/WimSecurityDlgHandler.h
changeset 0 164170e6151a
equal deleted inserted replaced
-1:000000000000 0:164170e6151a
       
     1 /*
       
     2 * Copyright (c) 2003 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 "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:  Wrapper class for security dialog management
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #ifndef CWIMSECURITYDLGHANDLER_H
       
    21 #define CWIMSECURITYDLGHANDLER_H
       
    22 
       
    23 //  INCLUDES
       
    24 #include    <e32base.h>
       
    25 #include    <secdlg.h>  // Symbian security dialog interface
       
    26 #include    <data_caging_path_literals.hrh>
       
    27 //#include    <PKIDlg.h>
       
    28 
       
    29 // CONSTANTS
       
    30 _LIT( KWimSecDlgsDllName, "CTSecDlgs.dll" );        // Security dialogs DLL
       
    31 
       
    32 // CLASS DECLARATION
       
    33 
       
    34 /**
       
    35 *  Wrapper for security dialog management
       
    36 *
       
    37 *  @since Series60 2.6
       
    38 */
       
    39 class CWimSecurityDlgHandler : public CBase
       
    40     {
       
    41     public:  // Constructors and destructor
       
    42         
       
    43         /**
       
    44         * Two-phased constructor.
       
    45         */
       
    46         static CWimSecurityDlgHandler* NewL();
       
    47         
       
    48         /**
       
    49         * Destructor.
       
    50         */
       
    51         virtual ~CWimSecurityDlgHandler();
       
    52 
       
    53     public: // New functions
       
    54         
       
    55         /**
       
    56         * Shows a security dialog to enable/disable PIN query.
       
    57         * @param aEnable TRUE = enable query, FALSE = disable query.
       
    58         * @param aRetry is it first time or retry.
       
    59         * @param aPINParams PIN parameters.
       
    60         * @param aPINValue returned PIN value.
       
    61         * @param aStatus Status of request.
       
    62         * @return   void
       
    63         */
       
    64         void EnablePIN( TBool aEnable,
       
    65                         TBool aRetry,
       
    66                         const TPINParams& aPINParams, 
       
    67                         TPINValue& aPINValue,
       
    68                         TRequestStatus& aStatus );
       
    69 
       
    70 
       
    71         /**
       
    72         * Shows a security dialog for changing PIN value.
       
    73         * @param aRetry Is it first time or retry?
       
    74         * @param aPINParams PIN parameters.
       
    75         * @param aOldPINValue old PIN to be chanced.
       
    76         * @param aNewPINValue New PIN to set up.
       
    77         * @param aStatus Status of request.
       
    78         * @return   void
       
    79         */
       
    80         void ChangePINValue( TBool aRetry,
       
    81                              const TPINParams& aPINParams,
       
    82                              TPINValue& aOldPINValue,
       
    83                              TPINValue& aNewPINValue,
       
    84                              TRequestStatus& aStatus );
       
    85 
       
    86         /**
       
    87         * Shows the note about blocked PIN to the user.
       
    88         * @param aPINParams PIN parameters.
       
    89         * @param aStatus Status of request.
       
    90         * @return   void
       
    91         */
       
    92         void ShowPINBlocked( const TPINParams& aPINParams, 
       
    93                              TRequestStatus& aStatus );
       
    94         
       
    95         /**
       
    96         * Shows the note about total blocked PIN to the user.
       
    97         * @param aPINParams PIN parameters.
       
    98         * @param aStatus Status of request.
       
    99         * @return   void
       
   100         */
       
   101         void ShowPINTotalBlocked( const TPINParams& aPINParams, 
       
   102                                   TRequestStatus& aStatus );
       
   103         /**
       
   104         * Shows the note about card removing to the user.
       
   105         * @param aStatus Status of request.
       
   106         * @return   void
       
   107         */                     
       
   108         void ShowCardRemoved( TRequestStatus& aStatus );
       
   109 
       
   110         /**
       
   111         * Shows a security dialog for fetching PIN and PUK 
       
   112         * values for unblocking blocked PIN.
       
   113         * @param aRetry is it first time or retry.
       
   114         * @param aBlockedPINParams Blocked PIN parameters.
       
   115         * @param aUnblockingPINParams Unblocking PIN parameters.
       
   116         * @param aUnblockingPINValue Unblocking PIN value.
       
   117         * @param aNewPINValue New PIN to set up.
       
   118         * @param aStatus Status of request.
       
   119         * @return   void
       
   120         */
       
   121         void UnblockPIN( TBool aRetry,
       
   122                          const TPINParams& aBlockedPINParams,
       
   123                          const TPINParams& aUnblockingPINParams,
       
   124                          TPINValue& aUnblockingPINValue, 
       
   125                          TPINValue& aNewPINValue,
       
   126                          TRequestStatus& aStatus );
       
   127 
       
   128         /**
       
   129         * Shows a security dialog for asking user to enter PIN code.
       
   130         * @param aRetry is it first time or retry.
       
   131         * @param aPINParams PIN parameters.
       
   132         * @param aPINValue PIN value to be query.
       
   133         * @param aStatus Status of request.
       
   134         * @return   void
       
   135         */
       
   136         void EnterPIN( TBool aRetry, 
       
   137                        const TPINParams& aPINParams, 
       
   138                        TPINValue& aPINValue,
       
   139                        TRequestStatus& aStatus );
       
   140                        
       
   141         /**
       
   142         * Close the ongoing dialog 
       
   143         * @param
       
   144         * @return void 
       
   145         */
       
   146         void Cancel();               
       
   147 
       
   148     private:
       
   149 
       
   150         /**
       
   151         * C++ default constructor.
       
   152         */
       
   153         CWimSecurityDlgHandler();
       
   154 
       
   155         /**
       
   156         * By default Symbian 2nd phase constructor is private.
       
   157         */
       
   158         void ConstructL();
       
   159 
       
   160 
       
   161         /**
       
   162         * Load and get new instance of security dialog. Completes status
       
   163         * if call to DoLoadSecurityDialogL() leaves (Dll load fails).
       
   164         * @return Error code (KErrNone means dialog loaded succesfully)
       
   165         * If something else than KErrNone status is completed with same error.
       
   166         */
       
   167         TInt LoadSecurityDialog( TRequestStatus& aStatus );
       
   168         
       
   169         /**
       
   170         * Load and get new instance of PKI dialog. Completes status
       
   171         * if call to DoLoadPKIDialogL() leaves (Dll load fails).
       
   172         * @return Error code (KErrNone means dialog loaded succesfully)
       
   173         * If something else than KErrNone status is completed with same error.
       
   174         */
       
   175         TInt LoadPKIDialog( TRequestStatus& aStatus );
       
   176         
       
   177         /**
       
   178         * Load and get new instance of security dialog. Leaves if load fails.
       
   179         * Leave is trapped in LoadSecurityDialog().
       
   180         * @return void
       
   181         */
       
   182         void DoLoadSecurityDialogL();
       
   183         
       
   184         /**
       
   185         * Load and get new instance of PKI dialog. Leaves if load fails.
       
   186         * Leave is trapped in LoadPKIDialog().
       
   187         * @return void
       
   188         */
       
   189         void DoLoadPKIDialogL();
       
   190         
       
   191     private:    // Data
       
   192         // Pointer to security dialog class. Owned.
       
   193         MSecurityDialog* iSecurityDlg;
       
   194         
       
   195         //Pointer to PKI dialog class Owned
       
   196         //MPKIDialog*      iPKIDlg;
       
   197         
       
   198         // Pointer to RLibrary object. Owned.
       
   199         RLibrary         iLibrary;
       
   200          
       
   201     };
       
   202 
       
   203 #endif      // CWIMSECURITYDLGHANDLER_H   
       
   204             
       
   205 // End of File