securitysettings/cpeapuiplugins/cpeapsimakaui/inc/cpeapsimakaui.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 EAP-SIM and EAP-AKA method configuration
       
    16  *
       
    17  */
       
    18 
       
    19 /*
       
    20  * %version:  14 %
       
    21  */
       
    22 
       
    23 #ifndef CPEAPSIMAKAUI_H
       
    24 #define CPEAPSIMAKAUI_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 CpSettingFormItemData;
       
    39 class EapQtValidator;
       
    40 
       
    41 // External data types
       
    42 
       
    43 // Constants
       
    44 
       
    45 /*!
       
    46  * @addtogroup group_eap_ui_plugin_simaka
       
    47  * @{
       
    48  */
       
    49 
       
    50 class CpEapSimAkaUi : public CpBaseSettingView
       
    51 {
       
    52 Q_OBJECT
       
    53 
       
    54 public:
       
    55     CpEapSimAkaUi(
       
    56         const EapQtConfigInterface::EapBearerType bearer,
       
    57         const int iapId,
       
    58         const EapQtPluginInfo &plugin,
       
    59         const EapQtPluginHandle& outerHandle);
       
    60     ~CpEapSimAkaUi();
       
    61 
       
    62 protected:
       
    63     void close();
       
    64     
       
    65 private:
       
    66     void createUi();
       
    67     void createUsername();
       
    68     void createRealm();
       
    69     
       
    70     bool checkStateToBool(const int state);
       
    71     int boolToCheckState(const bool state);
       
    72     
       
    73     bool storeSettings();
       
    74     bool validate();
       
    75     bool validateGroup(CpSettingFormItemData *edit, CpSettingFormItemData *checkBox,
       
    76         EapQtValidator* validator);
       
    77 
       
    78 private slots:
       
    79     void setValidator(const QModelIndex);
       
    80     void usernameAutomaticChanged(int state);
       
    81     void realmAutomaticChanged(int state);
       
    82 
       
    83 private:
       
    84     //! Pointer to EapQtConfigInterface
       
    85     QScopedPointer <EapQtConfigInterface> mConfigIf;
       
    86     //! Plugin info
       
    87     EapQtPluginInfo mPluginInfo;
       
    88     //! Outer handle
       
    89     EapQtPluginHandle mOuterHandle;
       
    90     //! Current EAP configuration
       
    91     EapQtConfig mEapConfig;
       
    92     
       
    93     //! Dataform
       
    94     HbDataForm *mForm;
       
    95     //! Datform model
       
    96     HbDataFormModel *mModel;
       
    97     //! Control Panel item data helper for EAP-SIM/AKA plugins
       
    98     CpItemDataHelper *mItemDataHelper;
       
    99     //! EAP-SIM/AKA settings group
       
   100     HbDataFormModelItem *mGroupItem;
       
   101     //! Username generate automatically checkBox
       
   102     CpSettingFormItemData *mUsernameAutomatic;
       
   103     //! Username lineEdit
       
   104     CpSettingFormItemData *mUsername;
       
   105     //! Realm generate automatically checkBox
       
   106     CpSettingFormItemData *mRealmAutomatic;
       
   107     //! Realm lineEdit
       
   108     CpSettingFormItemData *mRealm;
       
   109 
       
   110     //! Realm validator
       
   111     QScopedPointer<EapQtValidator> mValidatorRealm;
       
   112     //! Username validator
       
   113     QScopedPointer<EapQtValidator> mValidatorUsername;
       
   114 };
       
   115 
       
   116 /*! @} */
       
   117 
       
   118 #endif