eapol/eapol_framework/eapol_symbian/am/eap_notifier/inc/eap_auth_notifier.h
changeset 36 c98682f98478
parent 34 ad1f037f1ac2
child 49 43351a4f2da3
equal deleted inserted replaced
34:ad1f037f1ac2 36:c98682f98478
     9 * Initial Contributors:
     9 * Initial Contributors:
    10 * Nokia Corporation - initial contribution.
    10 * Nokia Corporation - initial contribution.
    11 *
    11 *
    12 * Contributors:
    12 * Contributors:
    13 *
    13 *
    14 * Description: EAP Auth Notifier
    14 * Description: EAP Authentication Notifier
    15 *
    15 *
    16 */
    16 */
    17 
    17 
    18 /*
    18 /*
    19 * %version: 3 %
    19 * %version: 15 %
    20 */
    20 */
    21 
    21 
    22 #ifndef __EAPAUTHNOTIFIER_H__
    22 #ifndef __EAPAUTHNOTIFIER_H__
    23 #define __EAPAUTHNOTIFIER_H__
    23 #define __EAPAUTHNOTIFIER_H__
    24 
    24 
       
    25 // System includes
    25 #include <e32base.h>
    26 #include <e32base.h>
    26 #include <hb/hbcore/hbdevicedialogsymbian.h>
    27 #include <hb/hbcore/hbdevicedialogsymbian.h>
       
    28 
       
    29 // User includes
       
    30 
       
    31 // Forward declarations
       
    32 
       
    33 class TEapExpandedType; 
       
    34 class CEapAuthObserver;
       
    35 
       
    36 // External data types
       
    37 
       
    38 //Global function prototypes
       
    39 
       
    40 //Constants
    27 
    41 
    28 const TUint KMaxNotifItemLength = 256;
    42 const TUint KMaxNotifItemLength = 256;
    29 const TUint KMaxUiDataLength = 1024;
    43 const TUint KMaxUiDataLength = 1024;
    30 
    44 
    31 /**
    45 /**
    32  * Callback interface
    46  * Callback interface
    33  */
    47  */
    34 class MNotificationCallback
    48 class MNotificationCallback
    35     {
    49     {
    36     public:
    50     public:
       
    51        /**
       
    52         * Notify for the client that the Dialog is complete
       
    53         *
       
    54         * @param  aStatus status
       
    55         * return  -
       
    56         */
    37         virtual void DlgComplete( TInt aStatus ) = 0;
    57         virtual void DlgComplete( TInt aStatus ) = 0;
    38     };
    58     };
    39 
    59 
    40 class TEapExpandedType; 
    60 /**
    41 class CEapAuthObserver;
    61  * EAP Notifier
    42 
    62  */
    43 
       
    44 NONSHARABLE_CLASS ( CEapAuthNotifier ): public CBase
    63 NONSHARABLE_CLASS ( CEapAuthNotifier ): public CBase
    45     {
    64     {
    46     public:
    65     public:
    47         
    66         // Data types
       
    67         
       
    68         /** EAP Notifier types */
    48         enum EEapNotifierType
    69         enum EEapNotifierType
    49         {
    70         {
    50             EEapNotifierTypeLEapUsernamePasswordDialog, 
    71             EEapNotifierTypeLEapUsernamePasswordDialog, 
    51             EEapNotifierTypeGTCQueryDialog,
    72             EEapNotifierTypeGTCQueryDialog,
    52             EEapNotifierTypePapAuthQueryDialog,
    73             EEapNotifierTypePapAuthQueryDialog,
    66             EEapNotifierTypeMsChapV2OldPasswordDialog,
    87             EEapNotifierTypeMsChapV2OldPasswordDialog,
    67             EEapNotifierTypeMsChapV2PasswordExpiredNote,
    88             EEapNotifierTypeMsChapV2PasswordExpiredNote,
    68             EEapNotifierTypeGTCUsernamePasswordDialog,
    89             EEapNotifierTypeGTCUsernamePasswordDialog,
    69         }; 
    90         }; 
    70         
    91         
       
    92         /**  EAP Notifier Data struct */
    71         struct TEapDialogInfo
    93         struct TEapDialogInfo
    72         {
    94         {
    73             TBool iPasswordPromptEnabled;
    95             TBool iPasswordPromptEnabled;
    74             TBool iIsIdentityQuery;
    96             TBool iIsIdentityQuery;
    75             TBuf16<KMaxNotifItemLength> iUsername;
    97             TBuf16<KMaxNotifItemLength> iUsername;
    76             TBuf16<KMaxNotifItemLength> iPassword;
    98             TBuf16<KMaxNotifItemLength> iPassword;
    77             TBuf16<KMaxNotifItemLength> iOldPassword; 
    99             TBuf16<KMaxNotifItemLength> iOldPassword; 
    78             TBool iIsFirstQuery;
   100             TBool iIsFirstQuery;
    79             TBuf16<KMaxUiDataLength> iUidata;
   101             TBuf16<KMaxUiDataLength> iUidata;
    80         };
   102         };
    81           
   103                      
    82         /**
   104         /**
    83         * Two-phased constructor.
   105         * Two-phased constructor.
    84         */
   106         */
    85         IMPORT_C  static CEapAuthNotifier* NewL( MNotificationCallback& aClient );
   107         IMPORT_C  static CEapAuthNotifier* NewL( MNotificationCallback& aClient );
    86         
   108         
    87         /**
   109         /**
    88         * Destructor
   110         * Destructor
    89         */
   111         */
    90         ~CEapAuthNotifier();
   112         ~CEapAuthNotifier();
    91         
   113     
       
   114     public:          
    92         /**
   115         /**
    93         * Start the Notifier
   116         * Start the Notifier
       
   117         *
    94         * @param  aType            notifier type
   118         * @param  aType            notifier type
    95         * @param  aPasswordInfo    data to be filled
   119         * @param  aPasswordInfo    data to be filled
    96         * @param  aEapType         eap type
   120         * @param  aEapType         eap type
    97         * return -
   121         * return -
    98         */
   122         */
   100                               TEapDialogInfo* aEapInfo,
   124                               TEapDialogInfo* aEapInfo,
   101                               TEapExpandedType& aEapType );
   125                               TEapExpandedType& aEapType );
   102         
   126         
   103         /**
   127         /**
   104         * Cancel() the notifier
   128         * Cancel() the notifier
       
   129         *
   105         * @param  -
   130         * @param  -
   106         * return -
   131         * return -
   107         */
   132         */
   108         IMPORT_C void Cancel();
   133         IMPORT_C void Cancel();
   109         
   134                  
   110     public:           
       
   111         /**
   135         /**
   112         * CompleteL the notifier is complete
   136         * CompleteL the notifier is complete
       
   137         *
   113         * @param  aStatus status
   138         * @param  aStatus status
   114         * return  -
   139         * return  -
   115         */
   140         */
   116         void CompleteL( TInt aStatus );
   141         void CompleteL( TInt aStatus );
   117         
   142         
   118         /**
   143         /**
   119         * Sets the selected user name and password of the presented dialog
   144         * Sets the selected user name and password of the presented dialog
       
   145         *
   120         * @param  aPasswordInfo password 
   146         * @param  aPasswordInfo password 
   121         * return  -
   147         * return  -
   122         */
   148         */
   123         void SetSelectedUnameAndPwd( TEapDialogInfo& aPasswordInfo );
   149         void SetSelectedUnameAndPwd( TEapDialogInfo& aPasswordInfo );
   124                 
   150                 
   125         /**
   151         /**
   126         * Sets the selected password of the presented dialog
   152         * Sets the selected password of the presented dialog
       
   153         *
   127         * @param  aPasswordInfo password 
   154         * @param  aPasswordInfo password 
   128         * return  -
   155         * return  -
   129         */
   156         */
   130         void SetSelectedPassword(
   157         void SetSelectedPassword(
   131                 TEapDialogInfo& aPasswordInfo );
   158                 TEapDialogInfo& aPasswordInfo );
   132         
   159         
   133         /**
   160         /**
   134         * Sets the selected Old password of the presented dialog
   161         * Sets the selected Old password of the presented dialog
       
   162         *
   135         * @param  aPasswordInfo old password 
   163         * @param  aPasswordInfo old password 
   136         * return  -
   164         * return  -
   137         */
   165         */
   138         void SetSelectedOldPassword(
   166         void SetSelectedOldPassword(
   139                 TEapDialogInfo& aPasswordInfo );
   167                 TEapDialogInfo& aPasswordInfo );
   149         */
   177         */
   150         void ConstructL();
   178         void ConstructL();
   151         
   179         
   152         /**
   180         /**
   153         * Set data for the UsernamePassword Dialog(s)
   181         * Set data for the UsernamePassword Dialog(s)
       
   182         *
   154         * @param  aPasswordInfo    data to be filled
   183         * @param  aPasswordInfo    data to be filled
   155         * @param  aEapType         Eap type to be used
   184         * @param  aEapType         Eap type to be used
   156         * @param  aMap             Pointer to variant data
   185         * @param  aMap             Pointer to variant data
   157         * @param  aAuthMethod      Auth method to be used
   186         * @param  aAuthMethod      Authentication method to be used
   158         * return -
   187         * return -
   159         */
   188         */
   160         void SetUsernamePasswordDataL( 
   189         void SetUsernamePasswordDataL( 
   161             TEapDialogInfo* aPasswordInfo,
   190             TEapDialogInfo* aPasswordInfo,
   162             TEapExpandedType& aEapType,
   191             TEapExpandedType& aEapType,
   164             const TDesC& aAuthMethod );
   193             const TDesC& aAuthMethod );
   165                 
   194                 
   166         
   195         
   167         /**
   196         /**
   168         * Set data for the query Dialog(s)
   197         * Set data for the query Dialog(s)
       
   198         *
   169         * @param  aEapInfo         data to be filled
   199         * @param  aEapInfo         data to be filled
   170         * @param  aMap             Pointer to variant data
   200         * @param  aMap             Pointer to variant data
   171         * @param  aAuthMethod      Auth method to be used
   201         * @param  aAuthMethod      Authentication method to be used
   172         * return -
   202         * return -
   173         */
   203         */
   174         void SetQueryDialogDataL( 
   204         void SetQueryDialogDataL( 
   175             TEapDialogInfo* aEapInfo,
   205             TEapDialogInfo* aEapInfo,
   176             CHbSymbianVariantMap* aMap,
   206             CHbSymbianVariantMap* aMap,
   177             const TDesC& aAuthMethod );
   207             const TDesC& aAuthMethod );
   178         
   208         
   179        /**
   209        /**
   180         * Set data for the Install Pac query Dialog(s)
   210         * Set data for the Install Pac query Dialog(s)
       
   211         *
   181         * @param  aEapInfo         data to be filled
   212         * @param  aEapInfo         data to be filled
   182         * @param  aMap             Pointer to variant data
   213         * @param  aMap             Pointer to variant data
   183         * return -
   214         * return -
   184         */
   215         */
   185         void SetFastInstallPacQueryDialogDataL( 
   216         void SetFastInstallPacQueryDialogDataL( 
   186             TEapDialogInfo* aEapInfo,
   217             TEapDialogInfo* aEapInfo,
   187             CHbSymbianVariantMap* aMap );
   218             CHbSymbianVariantMap* aMap );
   188         
   219         
   189        /**
   220        /**
   190         * Set data for the Pac file query Dialog(s)
   221         * Set data for the Pac file query Dialog(s)
       
   222         *
   191         * @param  aEapInfo         data to be filled
   223         * @param  aEapInfo         data to be filled
   192         * @param  aMap             Pointer to variant data
   224         * @param  aMap             Pointer to variant data
   193         * return -
   225         * return -
   194         */
   226         */
   195         void setFastPacFileQueryPwDialogDataL( 
   227         void SetFastPacFileQueryPwDialogDataL( 
   196             TEapDialogInfo* aEapInfo,
   228             TEapDialogInfo* aEapInfo,
   197             CHbSymbianVariantMap* aMap );
   229             CHbSymbianVariantMap* aMap );
   198         
   230         
   199        /**
   231        /**
   200         * Set data for the prov wait note Dialog(s)
   232         * Set data for the prov wait note Dialog(s)
       
   233         *
   201         * @param  aMap                  Pointer to variant data
   234         * @param  aMap                  Pointer to variant data
   202         * @param  aAuthProvWaitNote     Tells whether aut or unauth 
   235         * @param  aAuthProvWaitNote     Tells whether auth or unauth 
   203         * return -
   236         * return -
   204         */
   237         */
   205         void setFastProvWaitNoteDialogDataL( 
   238         void SetFastProvWaitNoteDialogDataL( 
   206             CHbSymbianVariantMap* aMap,
   239             CHbSymbianVariantMap* aMap,
   207             TBool aAuthProvWaitNote );
   240             TBool aAuthProvWaitNote );
   208                     
   241                     
   209        /**
   242        /**
   210         * Set data for the Password Dialog(s)
   243         * Set data for the Password Dialog(s)
       
   244         *
   211         * @param  aEapType         Eap type to be used
   245         * @param  aEapType         Eap type to be used
   212         * @param  aMap             Pointer to variant data
   246         * @param  aMap             Pointer to variant data
   213         * @param  aAuthMethod      Auth method to be used
   247         * @param  aAuthMethod      Authentication method to be used
   214         * return -
   248         * return -
   215         */
   249         */
   216         void SetPasswordQueryDataL( 
   250         void SetPasswordQueryDataL( 
   217             TEapExpandedType& aEapType,
   251             TEapExpandedType& aEapType,
   218             CHbSymbianVariantMap* aMap,
   252             CHbSymbianVariantMap* aMap,
   219             const TDesC& aAuthMethod );
   253             const TDesC& aAuthMethod );
   220         
   254         
   221     private:
   255     private: // Data
   222         
   256         
   223         /** For callback */
   257         /** 
       
   258          * For callback 
       
   259          */
   224         MNotificationCallback& iClient;  
   260         MNotificationCallback& iClient;  
   225         
   261         
   226         /** Pointer to the device dialog interface for handling the dialog */
   262         /** 
       
   263          * Pointer to the device dialog interface for handling the dialog 
       
   264          */
   227         CHbDeviceDialogSymbian* iDialog;
   265         CHbDeviceDialogSymbian* iDialog;
   228         /** The observer to handle the data received from the orbit dialog */
   266         
       
   267         /** 
       
   268          * The observer to handle the data received from the orbit dialog 
       
   269          */
   229         CEapAuthObserver* iObserver;
   270         CEapAuthObserver* iObserver;
   230                         
   271                         
   231         /* Information if request was already completed, in case the
   272         /** 
       
   273          * Information if request was already completed, in case the
   232          * observer receives the data signal and the signal about closing the
   274          * observer receives the data signal and the signal about closing the
   233          * dialog.
   275          * dialog.
   234          */
   276          */
   235         TBool iCompleted;
   277         TBool iCompleted;
   236         
   278         
   237         /** Information if request was already cancelled.*/
   279         /**
       
   280          * Information if request was already cancelled.
       
   281          */
   238         TBool iCancelled;
   282         TBool iCancelled;
   239         
   283         
   240         /** Pointer to the Eap Dialog Info structure */
   284         /** 
       
   285          * Pointer to the Eap Dialog Info structure 
       
   286          */
   241         TEapDialogInfo* iEapInfo;
   287         TEapDialogInfo* iEapInfo;
   242         
   288         
   243     
   289     
   244     };
   290     };
   245 
   291