securitysettings/cpeapuiplugins/cpeapuserpasswordui/inc/cpeapuserpasswordui.h
changeset 33 938269283a16
child 39 fe6b6762fccd
equal deleted inserted replaced
22:093cf0757204 33:938269283a16
       
     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 the License "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 username-password based EAP method configuration
       
    16  *
       
    17  */
       
    18 
       
    19 /*
       
    20  * %version: 18 %
       
    21  */
       
    22 
       
    23 #ifndef CPEAPUSERPASSWORDUI_H
       
    24 #define CPEAPUSERPASSWORDUI_H
       
    25 
       
    26 // System includes
       
    27 #include <cpbasesettingview.h>
       
    28 #include <eapqtplugininfo.h>
       
    29 #include <eapqtpluginhandle.h>
       
    30 #include <eapqtconfiginterface.h>
       
    31 
       
    32 // User includes
       
    33 
       
    34 // Forward declarations
       
    35 class HbDataForm;
       
    36 class HbDataFormModel;
       
    37 class CpSettingFormItemData;
       
    38 class HbLineEdit;
       
    39 class EapQtValidator;
       
    40 
       
    41 // External data types
       
    42 
       
    43 // Constants
       
    44 
       
    45 /*!
       
    46  * @addtogroup group_eap_ui_plugin_userpassword
       
    47  * @{
       
    48  */
       
    49 
       
    50 class CpEapUserPasswordUi: public CpBaseSettingView
       
    51 {
       
    52 Q_OBJECT
       
    53 
       
    54 public:
       
    55     CpEapUserPasswordUi(
       
    56         const EapQtConfigInterface::EapBearerType bearer,
       
    57         const int iapId,
       
    58         const EapQtPluginInfo &plugin,
       
    59         const EapQtPluginHandle& outerHandle);
       
    60     ~CpEapUserPasswordUi();
       
    61 
       
    62 protected:
       
    63     bool eventFilter(QObject *obj, QEvent *event);
       
    64     void close();
       
    65     
       
    66 private:
       
    67     void initializeUserPasswordUi();
       
    68     bool checkStateToBool(const int state);
       
    69     int boolToCheckState(const bool state);
       
    70     void storeSettings();
       
    71     bool validate();
       
    72     bool validatePasswordGroup();
       
    73     
       
    74 private slots:
       
    75     void setValidator(const QModelIndex);
       
    76     void passwordPromptChanged(int state);
       
    77     void passwordChanged();
       
    78     
       
    79 private:
       
    80     QScopedPointer <EapQtConfigInterface> mConfigIf;
       
    81     EapQtPluginInfo mPluginInfo;
       
    82     EapQtPluginHandle mOuterHandle;
       
    83     HbDataForm *mForm;
       
    84     HbDataFormModel *mModel;
       
    85     CpSettingFormItemData *mUsername;
       
    86     CpSettingFormItemData *mPasswordPrompt;
       
    87     CpSettingFormItemData *mPassword;
       
    88 
       
    89     QScopedPointer<EapQtValidator> mValidatorUsername;
       
    90     QScopedPointer<EapQtValidator> mValidatorPassword;
       
    91     
       
    92     bool mPasswordStored;
       
    93     bool mPasswordChanged;
       
    94     HbLineEdit *mPasswordEdit;
       
    95         
       
    96 };
       
    97 
       
    98 /*! @} */
       
    99 
       
   100 #endif