securitysettings/cpwlansecurityuiplugins/cpwpacmnui/inc/cpwpacmnui_p.h
changeset 26 9abfd4f00d37
child 34 ad1f037f1ac2
equal deleted inserted replaced
25:e03a3db4489e 26:9abfd4f00d37
       
     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  *    Private Implementation for Control Panel QT UI for WPA/WPA2/802_Dot_1x configuration
       
    16  *
       
    17  */
       
    18 
       
    19 /*
       
    20  * %version: 6 %
       
    21  */
       
    22 
       
    23 #ifndef CPWPACMNUI_P_H_
       
    24 #define CPWPACMNUI_P_H_
       
    25 
       
    26 // System includes
       
    27 #include <HbMessageBox>
       
    28 #include <cmmanagerdefines_shim.h>
       
    29 
       
    30 // User includes
       
    31 
       
    32 // Forward declarations
       
    33 class CpItemDataHelper;
       
    34 class CpSettingFormItemData;
       
    35 class EapQtConfigInterface;
       
    36 class CmConnectionMethodShim;
       
    37 class EapEntryItemData;
       
    38 class CpBaseSettingView;
       
    39 class EapQtPluginInfo;
       
    40 
       
    41 //class declaration
       
    42 class CpWpaCmnUiPrivate :public QObject
       
    43     { 
       
    44     Q_OBJECT  
       
    45 public:
       
    46 
       
    47     CpWpaCmnUiPrivate(CMManagerShim::WlanSecMode securityMode,
       
    48             CpItemDataHelper &dataHelpper);
       
    49     ~CpWpaCmnUiPrivate();
       
    50 
       
    51     CpSettingFormItemData* createUi(
       
    52             EapQtConfigInterface *mEapQtConfigInterface,
       
    53             CmConnectionMethodShim *cmCM);
       
    54     
       
    55     CpBaseSettingView *eapUiInstance();
       
    56     
       
    57     bool validateSettings();
       
    58 
       
    59 private:
       
    60     
       
    61     
       
    62     CpSettingFormItemData* createWpaTypeSelector();
       
    63     CpSettingFormItemData* createPskEditor();
       
    64     CpSettingFormItemData* createEapSelector();
       
    65     EapEntryItemData* createEapEntryItem();
       
    66     CpSettingFormItemData *createUnencryptedBox();
       
    67     void removeObjectFromView(CpSettingFormItemData *&object);
       
    68 
       
    69     void loadWPAPskView();
       
    70     void loadWPAEapView();       
       
    71     void loadUi();
       
    72     void loadWPA_WPA2Fields();
       
    73     void load802Dot1xFields(); 
       
    74     void loadEapConfigurations();
       
    75     
       
    76     void readValues();
       
    77         
       
    78     bool tryUpdate();
       
    79     void handleUpdateError();
       
    80     void showMessageBox(
       
    81         HbMessageBox::MessageBoxType type,
       
    82         const QString &text);      
       
    83    
       
    84     void updateWpaType(int pskEnable);
       
    85     void updatePskKey(QString& key);
       
    86     
       
    87     void reset();  
       
    88 
       
    89 private slots:
       
    90 
       
    91     void wpaTypeChanged(int pskEnable);
       
    92     void pskKeyChanged();
       
    93     void eapTypeChanged(int eapPlugin);
       
    94     void unencryptConnStateChanged(int state);
       
    95     
       
    96     static bool pluginLessThan(
       
    97         const EapQtPluginInfo &plugin1,
       
    98         const EapQtPluginInfo &plugin2);
       
    99 
       
   100     void setEditorPreferences(const QModelIndex &modelIndex);
       
   101 
       
   102 private:
       
   103     Q_DISABLE_COPY(CpWpaCmnUiPrivate)
       
   104     
       
   105     //!Data Helper from CpWlan Interface
       
   106     CpItemDataHelper &mDataHelper;
       
   107     
       
   108     //!Parent element encompassing all the Ui Setting Items   
       
   109     CpSettingFormItemData *mCmnUi;
       
   110     
       
   111     //!ui element for Pre-Shared Key
       
   112     CpSettingFormItemData *mPskKeyText;
       
   113     
       
   114     /*!ui element ,holding the list of EAP plugins 
       
   115      * from which the user can choose
       
   116      */
       
   117     CpSettingFormItemData *mEapPlugins;
       
   118     
       
   119     /*!ui element to hold Encrypted Connection flag status, 
       
   120      * for 802.1x mode
       
   121      */
       
   122     CpSettingFormItemData *mUnencryptedConnection;
       
   123     
       
   124     //!Opens a separate View for the EAPmode chosen 
       
   125     CpSettingFormItemData *mWpaEapItem;
       
   126     
       
   127     //!Stores the Pre-Shared key value entered
       
   128     QString mKeyData;
       
   129     
       
   130     //!List hthe EAP plugins
       
   131     QList<EapQtPluginInfo> mPlugins;
       
   132     
       
   133     //!Pointer to API that returns the Ui instance for the EAP plugin 
       
   134     EapEntryItemData *mEapEntry;
       
   135     
       
   136     //!Pointer to EAP interface 
       
   137     EapQtConfigInterface *mEapQtConfigInterface;
       
   138     
       
   139     //!Current mode chosen
       
   140     CMManagerShim::WlanSecMode mSecurityMode;   
       
   141     
       
   142     //! Connection Settings Shim connection method pointer    
       
   143     CmConnectionMethodShim* mConnMethod;
       
   144     
       
   145     //!Flag to indicate if its the EAP/PSK mode
       
   146     bool mEnablePskMode;
       
   147     
       
   148     //!The current EAP method chosen 
       
   149     int mCurrentEapPlugin;
       
   150     
       
   151     //!Flag to indicate if Unecrypted Connection is enabled 
       
   152    	bool mUnencryptState;
       
   153 
       
   154     //! Message box for info notes
       
   155     QSharedPointer<HbMessageBox> mMessageBox;
       
   156 
       
   157     };
       
   158 
       
   159 #endif /* CPWPACMNUI_P_H_ */