securitysettings/cpwlansecurityuiplugins/cpwepui/inc/cpwepui.h
changeset 52 c23bdf5a328a
parent 39 fe6b6762fccd
equal deleted inserted replaced
51:e863583e6720 52:c23bdf5a328a
    15  *    Control Panel QT UI for WEP configuration
    15  *    Control Panel QT UI for WEP configuration
    16  *
    16  *
    17  */
    17  */
    18 
    18 
    19 /*
    19 /*
    20  * %version: tr1cfwln#18 %
    20  * %version: tr1cfwln#20 %
    21  */
    21  */
    22 
    22 
    23 #ifndef CPWEPUI_H
    23 #ifndef CPWEPUI_H
    24 #define CPWEPUI_H
    24 #define CPWEPUI_H
    25 
    25 
    27 #include <cpsettingformitemdata.h>
    27 #include <cpsettingformitemdata.h>
    28 #include <QStringList>
    28 #include <QStringList>
    29 #include <HbMessageBox>
    29 #include <HbMessageBox>
    30 #include <cpwlansecurityplugininterface.h>
    30 #include <cpwlansecurityplugininterface.h>
    31 
    31 
    32 //User Includes
    32 // User Includes
    33 
    33 
    34 // Forward declarations
    34 // Forward declarations
    35 class CmConnectionMethodShim;
    35 class CmConnectionMethodShim;
    36 class HbTranslator;
    36 class HbTranslator;
    37 class WepKeyValidator;
    37 class WepKeyValidator;
    38 
    38 
    39 //Constant declarations
    39 // Constants
       
    40 
    40 //!Maximum Number of Keys for WEP
    41 //!Maximum Number of Keys for WEP
    41 static const int KMaxNumberofKeys =  4;
    42 static const int KMaxNumberofKeys =  4;
    42 
    43 
    43 /*! 
    44 /*! 
    44  * Implements WEP plugin for Wlan security control panel  
    45  * Implements WEP plugin for Wlan security control panel  
    45  */
    46  */
    46 
    47 
    47 // Class declaration
    48 // Class declaration
    48 class CpWepUi : public QObject, public CpWlanSecurityPluginInterface
    49 class CpWepUi : public CpSettingFormItemData
    49 {
    50 {
    50     Q_OBJECT
    51     Q_OBJECT
    51     Q_INTERFACES(CpWlanSecurityPluginInterface)
       
    52 
    52 
    53 public:
    53 public: // CpWepUi public methods
    54     CpWepUi();
    54     
       
    55     CpWepUi(
       
    56         CpItemDataHelper* dataHelper,
       
    57         CmConnectionMethodShim* cmCM );
       
    58     
    55     ~CpWepUi();
    59     ~CpWepUi();
    56 
       
    57 public:
       
    58     // from CpWlanSecurityPluginInterface 
       
    59 
       
    60     CMManagerShim::WlanSecMode securityMode() const;
       
    61 
       
    62     QString securityModeTextId() const;
       
    63     
       
    64     void setReference(CmConnectionMethodShim *cmCm, uint id);
       
    65     
       
    66     int orderNumber() const;
       
    67     
       
    68     CpSettingFormItemData* uiInstance(CpItemDataHelper &dataHelper);
       
    69     
    60     
    70     bool validateSettings();
    61     bool validateSettings();
    71 
    62 
    72 private:
    63 signals:
       
    64 
       
    65 public slots:
       
    66 
       
    67 protected:
       
    68 
       
    69 protected slots:
       
    70     
       
    71 private: // CpWepUi private definitions
    73 
    72 
    74     enum WEPKeyFormat
    73     enum WEPKeyFormat
    75         {
    74         {
    76         EFormatHex, EFormatAscii,
    75         EFormatHex, EFormatAscii,
    77         };
    76         };
    78 
    77 
    79 private:
    78 private: // CpWepUi private methods
    80 
    79 
       
    80     void createUi();
       
    81     
    81     void loadFieldsFromDataBase();
    82     void loadFieldsFromDataBase();
    82 
    83 
    83     void wepKeyTextChanged(int index);
    84     void wepKeyTextChanged(int index);
    84 
    85 
    85     bool tryUpdate();
    86     bool tryUpdate();
    91 
    92 
    92     void updateWepSettings();
    93     void updateWepSettings();
    93 
    94 
    94     void commitWEPkeys(int index);
    95     void commitWEPkeys(int index);
    95     
    96     
    96     void createWEPKeyOneGroup(CpItemDataHelper &dataHelpper);
    97     void createWEPKeyOneGroup(CpItemDataHelper &dataHelper);
    97     
    98     
    98     void createWEPKeyTwoGroup(CpItemDataHelper &dataHelpper);
    99     void createWEPKeyTwoGroup(CpItemDataHelper &dataHelper);
    99     
   100     
   100     void createWEPKeyThreeGroup(CpItemDataHelper &dataHelpper);
   101     void createWEPKeyThreeGroup(CpItemDataHelper &dataHelper);
   101     
   102     
   102     void createWEPKeyFourGroup(CpItemDataHelper &dataHelpper); 
   103     void createWEPKeyFourGroup(CpItemDataHelper &dataHelper); 
   103     
   104     
   104     void storeWEPKey(CMManagerShim::ConnectionMethodAttribute enumValue,QString& key);
   105     void storeWEPKey(CMManagerShim::ConnectionMethodAttribute enumValue,QString& key);
   105     
   106     
   106     void setKeyFormat(QString& key,int index);
   107     void setKeyFormat(QString& key,int index);
   107         
   108         
   108     CMManagerShim::ConnectionMethodAttribute getWEPKeyEnum(int index);
   109     CMManagerShim::ConnectionMethodAttribute getWEPKeyEnum(int index);
   109     
   110     
   110     void createWEPKeyGroup(int index);
   111     void createWEPKeyGroup(int index);
   111     
   112     
   112     void addConnections(CpItemDataHelper &dataHelpper);
   113     void addConnections(CpItemDataHelper* dataHelper);
   113     
   114     
   114 private slots:
   115 private slots:
   115 
   116 
   116     void wepKeyInUseChanged(int index);
   117     void wepKeyInUseChanged(int index);
   117 
   118 
   123 
   124 
   124     void wepKeyFourChanged();
   125     void wepKeyFourChanged();
   125     
   126     
   126     void setEditorPreferences(const QModelIndex &modelIndex);
   127     void setEditorPreferences(const QModelIndex &modelIndex);
   127 
   128 
   128 private:
   129 private: // CpWepUi private members
   129 
   130 
   130     Q_DISABLE_COPY(CpWepUi)
   131     Q_DISABLE_COPY(CpWepUi)
   131 
       
   132     //!WEP security group item
       
   133     CpSettingFormItemData* mUi;
       
   134 
   132 
   135     //! Store strings of WEP keys
   133     //! Store strings of WEP keys
   136     QStringList mKeyData;
   134     QStringList mKeyData;
   137 
   135 
   138     //! WEP keys item
   136     //! WEP keys item
   141     //! WEP keys text item
   139     //! WEP keys text item
   142     CpSettingFormItemData *mWepKeyText[KMaxNumberofKeys];
   140     CpSettingFormItemData *mWepKeyText[KMaxNumberofKeys];
   143 
   141 
   144     //!Store the index of the current key in use   
   142     //!Store the index of the current key in use   
   145     int mNewKeySelected;
   143     int mNewKeySelected;
   146    
       
   147     //!Translator for all the localisation Text Id's
       
   148     HbTranslator* mTranslator;
       
   149 
   144 
   150     //!Connection Settings Shim connection method pointer
   145     //!Connection Settings Shim connection method pointer
   151     CmConnectionMethodShim *mCmCM;
   146     CmConnectionMethodShim *mCmCM;
   152 
       
   153     //! Connection method Id
       
   154     int mCmId;
       
   155 
   147 
   156     //! Message box for info notes
   148     //! Message box for info notes
   157     QSharedPointer<HbMessageBox> mMessageBox;
   149     QSharedPointer<HbMessageBox> mMessageBox;
   158 
   150 
   159     //! Store Formats of WEP keys
   151     //! Store Formats of WEP keys
   160     WEPKeyFormat mkeyFormat[KMaxNumberofKeys];
   152     WEPKeyFormat mkeyFormat[KMaxNumberofKeys];
   161         
   153         
   162     CpItemDataHelper* mItemDataHelper;
   154     CpItemDataHelper* mItemDataHelper;
   163     
       
   164     
       
   165 
   155 
   166 };
   156 };
   167 
   157 
   168 /*! @} */
   158 /*! @} */
   169 
   159