securitysettings/cpeapuiplugins/cpeaptlsmethodsui/inc/cpeaptlsmethodsui.h
branchRCL_3
changeset 19 c74b3d9f6b9e
parent 18 bad0cc58d154
equal deleted inserted replaced
18:bad0cc58d154 19:c74b3d9f6b9e
     1 /*
       
     2  * Copyright (c) 2010 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: 
       
    15  *   Control Panel QT UI for TLS-based EAP methods configuration
       
    16  *
       
    17  */
       
    18 
       
    19 /*
       
    20  * %version: 17 %
       
    21  */
       
    22 
       
    23 #ifndef CPEAPTLSMETHODSUI_H
       
    24 #define CPEAPTLSMETHODSUI_H
       
    25 
       
    26 // System includes
       
    27 #include <cpbasesettingview.h>
       
    28 #include <eapqtconfiginterface.h>
       
    29 #include <eapqtplugininfo.h>
       
    30 #include <eapqtpluginhandle.h>
       
    31 
       
    32 // User includes
       
    33 
       
    34 // Forward declarations
       
    35 class HbDataForm;
       
    36 class HbDataFormModel;
       
    37 class HbDataFormModelItem;
       
    38 class HbMessageBox;
       
    39 class CpSettingFormItemData;
       
    40 class EapQtValidator;
       
    41 class EapQtCertificateInfo;
       
    42 class CpEapCiphersuiteUi;
       
    43 
       
    44 // External data types
       
    45 
       
    46 // Constants
       
    47 
       
    48 /*!
       
    49  * @addtogroup group_eap_ui_plugin_eap_tlsmethods
       
    50  * @{
       
    51  */
       
    52 
       
    53 class CpEapTlsMethodsUi : public CpBaseSettingView
       
    54 {
       
    55 Q_OBJECT
       
    56 
       
    57 public:
       
    58     CpEapTlsMethodsUi(
       
    59         const EapQtConfigInterface::EapBearerType bearer,
       
    60         const int iapId,
       
    61         const EapQtPluginInfo &plugin,
       
    62         const EapQtPluginHandle& outerHandle);
       
    63     ~CpEapTlsMethodsUi();
       
    64 
       
    65     CpBaseSettingView *innerUiInstance();
       
    66 
       
    67 protected:
       
    68     void close();
       
    69 
       
    70 private:
       
    71     // Supported PEAP versions
       
    72     enum PeapVersions {
       
    73         //PEAPv0
       
    74         PeapVersion0,
       
    75         //PEAPv1
       
    76         PeapVersion1,
       
    77         //PEAPv0 or PEAPv1
       
    78         PeapVersionBoth
       
    79     };
       
    80     
       
    81 private:
       
    82     void createUi();
       
    83     void createTlsUi();
       
    84     void createTtlsUi();
       
    85     void createPeapUi();
       
    86     void createFastUi();
       
    87     
       
    88     void createUsername();
       
    89     void createRealm();
       
    90     void createUserCerts();
       
    91     void createAuthorityCerts();
       
    92     void createPeapVersion();
       
    93     void createInnerMethod();
       
    94     void createEapSelector();
       
    95     
       
    96     void defaultInnerPlugin();
       
    97 
       
    98     bool checkStateToBool(const int state);
       
    99     int boolToCheckState(const bool state);
       
   100     
       
   101     bool validate();
       
   102     bool validateUsernameGroup();
       
   103     bool validateRealmGroup();
       
   104     bool validateAuthorityCertificate();
       
   105     bool validateUserCertificate();
       
   106     bool validateCiphersuites();
       
   107     void setPeapVersion(EapQtConfig &eapConfig);
       
   108     bool storeSettings();
       
   109     
       
   110 private slots:  
       
   111     void setValidator(const QModelIndex);
       
   112     void usernameAutomaticChanged(int state);
       
   113     void realmAutomaticChanged(int state);
       
   114     void userCertChanged(int value);
       
   115     void authorityCertAutomaticChanged(int state);
       
   116     void authorityCertChanged(int value);
       
   117     void peapVersionChanged(int value);
       
   118     void innerEapTypeChanged(int value);
       
   119     
       
   120 private:
       
   121     //! Pointer to EapQtConfigInterface
       
   122     QScopedPointer <EapQtConfigInterface> mConfigIf;
       
   123     //! List of supported Inner EAP types
       
   124     QList<EapQtPluginInfo> mPlugins;
       
   125     //! Plugin info
       
   126     EapQtPluginInfo mPluginInfo;
       
   127     //! Outer handle
       
   128     EapQtPluginHandle mOuterHandle;
       
   129     //! Current EAP configuration
       
   130     EapQtConfig mEapConfig;
       
   131     
       
   132     //! Dataform
       
   133     HbDataForm *mForm;
       
   134     //! Datform model
       
   135     HbDataFormModel *mModel;
       
   136     //! Control Panel item data helper for TLS methods plugins
       
   137     CpItemDataHelper *mItemDataHelper;
       
   138     //! TLS based methods settings group
       
   139     HbDataFormModelItem *mGroupItem;    
       
   140     //! Username generate automatically checkBox
       
   141     CpSettingFormItemData *mUsernameAutomatic;
       
   142     //! Username lineEdit
       
   143     CpSettingFormItemData *mUsername;
       
   144     //! Realm generate automatically checkBox
       
   145     CpSettingFormItemData *mRealmAutomatic;
       
   146     //! Realm lineEdit
       
   147     CpSettingFormItemData *mRealm;
       
   148     //! Authority certificate select automatically checkBox
       
   149     CpSettingFormItemData *mCaCertAutomatic;
       
   150     //! Authority certificate comboBox
       
   151     CpSettingFormItemData *mCaCert;
       
   152     //! Peap version comboBox
       
   153     CpSettingFormItemData *mPeapVersion;
       
   154     //! Inner EAP type comboBox
       
   155     CpSettingFormItemData *mInnerEapType;
       
   156     //! Cipher suites group
       
   157     CpEapCiphersuiteUi *mGroupItemCs;
       
   158     
       
   159     //! Realm validator
       
   160     QScopedPointer<EapQtValidator> mValidatorRealm;
       
   161     //! Username validator
       
   162     QScopedPointer<EapQtValidator> mValidatorUsername;
       
   163     
       
   164     //! List of system's user certificates
       
   165     QList<EapQtCertificateInfo> mUserCerts;
       
   166     //! Index of selected user certificate
       
   167     int mCurrentUserCert;
       
   168     //! List if system's authority certificates
       
   169     QList<EapQtCertificateInfo> mAuthorityCerts;
       
   170     //! Index of selected authority certificate
       
   171     int mCurrentAuthorityCert;
       
   172     //! Index of current PEAP version 
       
   173     //  0:PEAPv0, 1:PEAPv2, 2:PEAPv0 or PEAPv1
       
   174     int mCurrentPeapVersion;
       
   175     //! Index of selected Inner EAP type
       
   176     int mCurrentInnerPlugin;
       
   177     //! Index of inner type EAP-MSCHAPv2, default value for PEAP and EAP-FAST 
       
   178     int mInnerEapMschapv2;
       
   179     //! Index of inner type EAP-GTC, default value for PEAPv1
       
   180     int mInnerEapGtc;
       
   181     //! Tells if no inner EAP type is stored and default value is used instead
       
   182     bool mDefaultPluginInUse;
       
   183 };
       
   184 
       
   185 /*! @} */
       
   186 
       
   187 #endif