securitysettings/cpeapuiplugins/cpeaptlsmethodsui/inc/cpeaptlsmethodsui.h
changeset 49 43351a4f2da3
parent 34 ad1f037f1ac2
equal deleted inserted replaced
47:712b4ffd76bb 49:43351a4f2da3
    15  *   Control Panel QT UI for TLS-based EAP methods configuration
    15  *   Control Panel QT UI for TLS-based EAP methods configuration
    16  *
    16  *
    17  */
    17  */
    18 
    18 
    19 /*
    19 /*
    20  * %version: 17 %
    20  * %version: 26 %
    21  */
    21  */
    22 
    22 
    23 #ifndef CPEAPTLSMETHODSUI_H
    23 #ifndef CPEAPTLSMETHODSUI_H
    24 #define CPEAPTLSMETHODSUI_H
    24 #define CPEAPTLSMETHODSUI_H
    25 
    25 
    26 // System includes
    26 // System includes
    27 #include <cpbasesettingview.h>
    27 #include <cpbasesettingview.h>
    28 #include <eapqtconfiginterface.h>
    28 #include <eapqtconfiginterface.h>
    29 #include <eapqtplugininfo.h>
    29 #include <eapqtplugininfo.h>
    30 #include <eapqtpluginhandle.h>
    30 #include <eapqtpluginhandle.h>
       
    31 #include <cpeappacstoreui.h>
    31 
    32 
    32 // User includes
    33 // User includes
    33 
    34 
    34 // Forward declarations
    35 // Forward declarations
    35 class HbDataForm;
    36 class HbDataForm;
    36 class HbDataFormModel;
    37 class HbDataFormModel;
    37 class HbDataFormModelItem;
    38 class HbDataFormModelItem;
    38 class HbMessageBox;
    39 class HbMessageBox;
       
    40 class HbInputDialog;
    39 class CpSettingFormItemData;
    41 class CpSettingFormItemData;
    40 class EapQtValidator;
    42 class EapQtValidator;
    41 class EapQtCertificateInfo;
    43 class EapQtCertificateInfo;
    42 class CpEapCiphersuiteUi;
    44 class CpEapCiphersuiteUi;
       
    45 class EapInnerMethodEntryItemData;
    43 
    46 
    44 // External data types
    47 // External data types
    45 
    48 
    46 // Constants
    49 // Constants
    47 
    50 
    48 /*!
    51 /*!
    49  * @addtogroup group_eap_ui_plugin_eap_tlsmethods
    52  * @addtogroup group_eap_ui_plugin_eap_tlsmethods
    50  * @{
    53  * @{
    51  */
    54  */
    52 
    55 // Class declaration
    53 class CpEapTlsMethodsUi : public CpBaseSettingView
    56 class CpEapTlsMethodsUi : public CpBaseSettingView
    54 {
    57 {
    55 Q_OBJECT
    58 Q_OBJECT
    56 
    59 
    57 public:
    60 public:
    61         const EapQtPluginInfo &plugin,
    64         const EapQtPluginInfo &plugin,
    62         const EapQtPluginHandle& outerHandle);
    65         const EapQtPluginHandle& outerHandle);
    63     ~CpEapTlsMethodsUi();
    66     ~CpEapTlsMethodsUi();
    64 
    67 
    65     CpBaseSettingView *innerUiInstance();
    68     CpBaseSettingView *innerUiInstance();
       
    69     CpBaseSettingView *secondInnerUiInstance();
       
    70 
       
    71 signals:
       
    72 
       
    73 public slots:
    66 
    74 
    67 protected:
    75 protected:
    68     void close();
    76     void close();
       
    77 
       
    78 protected slots:
    69 
    79 
    70 private:
    80 private:
    71     // Supported PEAP versions
    81     // Supported PEAP versions
    72     enum PeapVersions {
    82     enum PeapVersions {
    73         //PEAPv0
    83         //PEAPv0
    76         PeapVersion1,
    86         PeapVersion1,
    77         //PEAPv0 or PEAPv1
    87         //PEAPv0 or PEAPv1
    78         PeapVersionBoth
    88         PeapVersionBoth
    79     };
    89     };
    80     
    90     
       
    91     enum TlsPrivacyIndexes {
       
    92         TlsPrivacyOff,
       
    93         TlsPrivacyOn
       
    94     };
       
    95 
    81 private:
    96 private:
    82     void createUi();
    97     void createUi();
    83     void createTlsUi();
    98     void createTlsUi();
    84     void createTtlsUi();
    99     void createTtlsUi();
    85     void createPeapUi();
   100     void createPeapUi();
    88     void createUsername();
   103     void createUsername();
    89     void createRealm();
   104     void createRealm();
    90     void createUserCerts();
   105     void createUserCerts();
    91     void createAuthorityCerts();
   106     void createAuthorityCerts();
    92     void createPeapVersion();
   107     void createPeapVersion();
       
   108     void createProvisioning();
       
   109     void createTlsPrivacy();
    93     void createInnerMethod();
   110     void createInnerMethod();
    94     void createEapSelector();
   111     void createEapSelector();
       
   112     void createSecondInnerMethod();
       
   113     void createSecondEapSelector();
       
   114     void createPacStoreGroup();
    95     
   115     
    96     void defaultInnerPlugin();
   116     void defaultInnerPlugin();
    97 
   117     
    98     bool checkStateToBool(const int state);
   118     bool checkStateToBool(const int state);
    99     int boolToCheckState(const bool state);
   119     int boolToCheckState(const bool state);
   100     
   120     
   101     bool validate();
   121     bool validate();
   102     bool validateUsernameGroup();
   122     bool validateUsernameGroup();
   103     bool validateRealmGroup();
   123     bool validateRealmGroup();
   104     bool validateAuthorityCertificate();
   124     bool validateAuthorityCertificate();
   105     bool validateUserCertificate();
   125     bool validateUserCertificate();
   106     bool validateCiphersuites();
   126     bool validateCiphersuites();
   107     void setPeapVersion(EapQtConfig &eapConfig);
   127     void setPeapVersion(EapQtConfig &eapConfig);
       
   128     void setFastSettings(EapQtConfig &eapConfig);
   108     bool storeSettings();
   129     bool storeSettings();
   109     
   130     
   110 private slots:  
   131 private slots:  
   111     void setValidator(const QModelIndex);
   132     void setValidator(const QModelIndex);
   112     void usernameAutomaticChanged(int state);
   133     void usernameAutomaticChanged(int state);
   113     void realmAutomaticChanged(int state);
   134     void realmAutomaticChanged(int state);
   114     void userCertChanged(int value);
   135     void userCertChanged(int value);
   115     void authorityCertAutomaticChanged(int state);
   136     void authorityCertAutomaticChanged(int state);
   116     void authorityCertChanged(int value);
   137     void authorityCertChanged(int value);
   117     void peapVersionChanged(int value);
   138     void peapVersionChanged(int value);
       
   139     void provisioningModeChanged(int state);
   118     void innerEapTypeChanged(int value);
   140     void innerEapTypeChanged(int value);
       
   141     void secondInnerEapTypeChanged(int value);
       
   142     void incompletedSettingsConfirmed(int action);
       
   143     void unableToSaveSettingsClosed(int action);
   119     
   144     
   120 private:
   145 private:
   121     //! Pointer to EapQtConfigInterface
   146     //! Pointer to EapQtConfigInterface
   122     QScopedPointer <EapQtConfigInterface> mConfigIf;
   147     QScopedPointer <EapQtConfigInterface> mConfigIf;
   123     //! List of supported Inner EAP types
   148     //! List of supported Inner EAP types
   126     EapQtPluginInfo mPluginInfo;
   151     EapQtPluginInfo mPluginInfo;
   127     //! Outer handle
   152     //! Outer handle
   128     EapQtPluginHandle mOuterHandle;
   153     EapQtPluginHandle mOuterHandle;
   129     //! Current EAP configuration
   154     //! Current EAP configuration
   130     EapQtConfig mEapConfig;
   155     EapQtConfig mEapConfig;
       
   156     //! Pointer to PAC store UI class
       
   157     CpEapPacStoreUi *mPacStoreUi;
   131     
   158     
   132     //! Dataform
   159     //! Dataform
   133     HbDataForm *mForm;
   160     HbDataForm *mForm;
   134     //! Datform model
   161     //! Datform model
   135     HbDataFormModel *mModel;
   162     HbDataFormModel *mModel;
   143     CpSettingFormItemData *mUsername;
   170     CpSettingFormItemData *mUsername;
   144     //! Realm generate automatically checkBox
   171     //! Realm generate automatically checkBox
   145     CpSettingFormItemData *mRealmAutomatic;
   172     CpSettingFormItemData *mRealmAutomatic;
   146     //! Realm lineEdit
   173     //! Realm lineEdit
   147     CpSettingFormItemData *mRealm;
   174     CpSettingFormItemData *mRealm;
       
   175     //! User certificate comboBox
       
   176     CpSettingFormItemData *mUserCertificate;
   148     //! Authority certificate select automatically checkBox
   177     //! Authority certificate select automatically checkBox
   149     CpSettingFormItemData *mCaCertAutomatic;
   178     CpSettingFormItemData *mCaCertAutomatic;
   150     //! Authority certificate comboBox
   179     //! Authority certificate comboBox
   151     CpSettingFormItemData *mCaCert;
   180     CpSettingFormItemData *mCaCert;
   152     //! Peap version comboBox
   181     //! Peap version comboBox
   153     CpSettingFormItemData *mPeapVersion;
   182     CpSettingFormItemData *mPeapVersion;
       
   183     //! Authenticated provisioning checkBox
       
   184     CpSettingFormItemData *mAuthProvisioning;
       
   185     //! Unauthenticated provisioning checkBox
       
   186     CpSettingFormItemData *mUnauthProvisioning;
       
   187     //! TLS Privacy comboBox
       
   188     CpSettingFormItemData *mTlsPrivacy;
   154     //! Inner EAP type comboBox
   189     //! Inner EAP type comboBox
   155     CpSettingFormItemData *mInnerEapType;
   190     CpSettingFormItemData *mInnerEapType;
       
   191     //! Second inner EAP type comboBox
       
   192     CpSettingFormItemData *mSecondInnerEapType;
       
   193     //! Second inner EAP type configure button
       
   194     EapInnerMethodEntryItemData *mSecondEapEntry;
       
   195     //! Pac store group
       
   196     HbDataFormModelItem *mGroupItemPacStore;
   156     //! Cipher suites group
   197     //! Cipher suites group
   157     CpEapCiphersuiteUi *mGroupItemCs;
   198     CpEapCiphersuiteUi *mGroupItemCs;
   158     
   199     
   159     //! Realm validator
   200     //! Realm validator
   160     QScopedPointer<EapQtValidator> mValidatorRealm;
   201     QScopedPointer<EapQtValidator> mValidatorRealm;
   172     //! Index of current PEAP version 
   213     //! Index of current PEAP version 
   173     //  0:PEAPv0, 1:PEAPv2, 2:PEAPv0 or PEAPv1
   214     //  0:PEAPv0, 1:PEAPv2, 2:PEAPv0 or PEAPv1
   174     int mCurrentPeapVersion;
   215     int mCurrentPeapVersion;
   175     //! Index of selected Inner EAP type
   216     //! Index of selected Inner EAP type
   176     int mCurrentInnerPlugin;
   217     int mCurrentInnerPlugin;
       
   218     //! Index of selected second Inner EAP type
       
   219     int mCurrentSecondInnerPlugin;
   177     //! Index of inner type EAP-MSCHAPv2, default value for PEAP and EAP-FAST 
   220     //! Index of inner type EAP-MSCHAPv2, default value for PEAP and EAP-FAST 
   178     int mInnerEapMschapv2;
   221     int mInnerEapMschapv2;
   179     //! Index of inner type EAP-GTC, default value for PEAPv1
   222     //! Index of inner type EAP-GTC, default value for PEAPv1
   180     int mInnerEapGtc;
   223     int mInnerEapGtc;
       
   224     //! Index of second inner type EAP-GTC
       
   225     int mSecondInnerEapGtc;
   181     //! Tells if no inner EAP type is stored and default value is used instead
   226     //! Tells if no inner EAP type is stored and default value is used instead
   182     bool mDefaultPluginInUse;
   227     bool mDefaultPluginInUse;
       
   228     //! Tells if EAP-MSCHAPv2 is the only possible inner EAP type
       
   229     bool mInnerEapMschapv2Only;
       
   230     //! List of supported inner EAP types localisation strings
       
   231     QStringList mInnerEapItems;
       
   232     //! EAP-MSCHAPv2 localisation string. 
       
   233     //  Used in Inner EAP tyupe combobox when only EAP-MSCHAPv2 is supported
       
   234     QStringList mMschapv2Items;
   183 };
   235 };
   184 
   236 
   185 /*! @} */
   237 /*! @} */
   186 
   238 
   187 #endif
   239 #endif