securitysettings/eapqtdialogs/src/eapfastcreatemasterkeyquerydialog.cpp
changeset 36 c98682f98478
parent 34 ad1f037f1ac2
child 44 22d80358905b
equal deleted inserted replaced
34:ad1f037f1ac2 36:c98682f98478
     9 * Initial Contributors:
     9 * Initial Contributors:
    10 * Nokia Corporation - initial contribution.
    10 * Nokia Corporation - initial contribution.
    11 *
    11 *
    12 * Contributors:
    12 * Contributors:
    13 *
    13 *
    14 * Description: Fast Create Master Key Query Dialog implementation
    14 * Description: EAP-FAST Create Master Key Query Dialog implementation
    15 *
    15 *
    16 */
    16 */
    17 
    17 
    18 /*
    18 /*
    19 * %version: 4 %
    19 * %version: 5 %
    20 */
    20 */
    21 
    21 
       
    22 // System includes
    22 #include <HbLineEdit>
    23 #include <HbLineEdit>
    23 #include <HbAction>
    24 #include <HbAction>
    24 #include <HbMessageBox>
    25 #include <HbMessageBox>
    25 #include <HbTranslator>
    26 #include <HbTranslator>
    26 #include <eapqtvalidator.h>
    27 #include <eapqtvalidator.h>
    27 #include <eapqtexpandedeaptype.h>
    28 #include <eapqtexpandedeaptype.h>
    28 #include <eapqtconfiginterface.h>
    29 #include <eapqtconfiginterface.h>
    29 #include <eapqtconfig.h>
    30 #include <eapqtconfig.h>
       
    31 
       
    32 // User includes
    30 #include "eapfastcreatemasterkeyquerydialog.h"
    33 #include "eapfastcreatemasterkeyquerydialog.h"
    31 #include "OstTraceDefinitions.h"
    34 #include "OstTraceDefinitions.h"
    32 #ifdef OST_TRACE_COMPILER_IN_USE
    35 #ifdef OST_TRACE_COMPILER_IN_USE
    33 #endif
    36 #endif
    34 
    37 
    35 
    38 /*!
    36 /**
    39  * \class EapFastCreateMasterKeyQueryDialog
    37  * The constructor
    40  * \brief Implements EAP-FAST Create Master Key Query Dialog. 
       
    41  */
       
    42 
       
    43 // External function prototypes
       
    44 
       
    45 // Local constants
       
    46  
       
    47 // ======== LOCAL FUNCTIONS ========
       
    48 
       
    49 // ======== MEMBER FUNCTIONS ========
       
    50 
       
    51 /*!
       
    52  * Constructor.
       
    53  * 
       
    54  * @param [in]  parameters Parameters for the Constructor.
    38  */
    55  */
    39 EapFastCreateMasterKeyQueryDialog::EapFastCreateMasterKeyQueryDialog(const QVariantMap &parameters) 
    56 EapFastCreateMasterKeyQueryDialog::EapFastCreateMasterKeyQueryDialog(const QVariantMap &parameters) 
    40  :mEdit1(NULL), 
    57  :mEdit1(NULL), 
    41   mEdit2(NULL), 
    58   mEdit2(NULL), 
    42   mPwdValidator(NULL),
    59   mPwdValidator(NULL),
    52         
    69         
    53     OstTraceFunctionExit0( EAPFASTCREATEMASTERKEYQUERYDIALOG_EAPFASTCREATEMASTERKEYQUERYDIALOG_EXIT );
    70     OstTraceFunctionExit0( EAPFASTCREATEMASTERKEYQUERYDIALOG_EAPFASTCREATEMASTERKEYQUERYDIALOG_EXIT );
    54     qDebug("EapFastCreateMasterKeyQueryDialog::EapFastCreateMasterKeyQueryDialog EXIT");
    71     qDebug("EapFastCreateMasterKeyQueryDialog::EapFastCreateMasterKeyQueryDialog EXIT");
    55 }
    72 }
    56     
    73     
    57 /**
    74 /*!
    58  * The construction of the dialog
    75  * The construction of the dialog
       
    76  *
       
    77  * @param [in] parameters Parameters for the Construction of the dialog.
    59  */ 
    78  */ 
    60 void EapFastCreateMasterKeyQueryDialog::createDialog(const QVariantMap &parameters )
    79 void EapFastCreateMasterKeyQueryDialog::createDialog(const QVariantMap &parameters )
    61 {
    80 {
    62     OstTraceFunctionEntry0( EAPFASTCREATEMASTERKEYQUERYDIALOG_CREATEDIALOG_ENTRY );
    81     OstTraceFunctionEntry0( EAPFASTCREATEMASTERKEYQUERYDIALOG_CREATEDIALOG_ENTRY );
    63     qDebug("EapFastCreateMasterKeyQueryDialog::createDialog ENTER");
    82     qDebug("EapFastCreateMasterKeyQueryDialog::createDialog ENTER");
   126    
   145    
   127     OstTraceFunctionExit0( DUP1_EAPFASTCREATEMASTERKEYQUERYDIALOG_CREATEDIALOG_EXIT );
   146     OstTraceFunctionExit0( DUP1_EAPFASTCREATEMASTERKEYQUERYDIALOG_CREATEDIALOG_EXIT );
   128     qDebug("EapFastCreateMasterKeyQueryDialog::createDialog EXIT");
   147     qDebug("EapFastCreateMasterKeyQueryDialog::createDialog EXIT");
   129 }
   148 }
   130 
   149 
   131 /**
   150 /*!
   132  * Destructor
   151  * Destructor.
   133  */
   152  */
   134 EapFastCreateMasterKeyQueryDialog::~EapFastCreateMasterKeyQueryDialog()
   153 EapFastCreateMasterKeyQueryDialog::~EapFastCreateMasterKeyQueryDialog()
   135 {
   154 {
   136     OstTraceFunctionEntry0( EAPFASTCREATEMASTERKEYQUERYDIALOG_DEAPFASTCREATEMASTERKEYQUERYDIALOG_ENTRY );
   155     OstTraceFunctionEntry0( EAPFASTCREATEMASTERKEYQUERYDIALOG_DEAPFASTCREATEMASTERKEYQUERYDIALOG_ENTRY );
   137     qDebug("EapFastCreateMasterKeyQueryDialog::~EapFastCreateMasterKeyQueryDialog");
   156     qDebug("EapFastCreateMasterKeyQueryDialog::~EapFastCreateMasterKeyQueryDialog");
   140     // mPwdValidator:   scoped pointer deleted automatically
   159     // mPwdValidator:   scoped pointer deleted automatically
   141     
   160     
   142     OstTraceFunctionExit0( EAPFASTCREATEMASTERKEYQUERYDIALOG_DEAPFASTCREATEMASTERKEYQUERYDIALOG_EXIT );
   161     OstTraceFunctionExit0( EAPFASTCREATEMASTERKEYQUERYDIALOG_DEAPFASTCREATEMASTERKEYQUERYDIALOG_EXIT );
   143 }
   162 }
   144 
   163 
   145 /**
   164 /*!
   146  * Line edit validator
   165  * Line edit validator
       
   166  *
       
   167  * @return true if content is valid.
   147  */
   168  */
   148 bool EapFastCreateMasterKeyQueryDialog::validate() const
   169 bool EapFastCreateMasterKeyQueryDialog::validate() const
   149 {
   170 {
   150     qDebug("EapFastCreateMasterKeyQueryDialog::validate");
   171     qDebug("EapFastCreateMasterKeyQueryDialog::validate");
   151     
   172     
   152     bool valid = false;
   173     bool valid = false;
   153     
       
   154     EapQtValidator::Status test_status = mPwdValidator->validate(mEdit1->text());
       
   155     
   174     
   156     if ( mPwdValidator->validate(mEdit1->text())== EapQtValidator::StatusOk &&
   175     if ( mPwdValidator->validate(mEdit1->text())== EapQtValidator::StatusOk &&
   157         mEdit1->text() == mEdit2->text()) {
   176         mEdit1->text() == mEdit2->text()) {
   158         qDebug("EapFastCreateMasterKeyQueryDialog::validate: ret val: TRUE");
   177         qDebug("EapFastCreateMasterKeyQueryDialog::validate: ret val: TRUE");
   159         valid = true;
   178         valid = true;
   160     }
   179     }
   161     return valid;
   180     return valid;
   162 }
   181 }
   163 
   182 
   164 /**
   183 /*!
   165  * Function is called when the Ok Action button is pressed
   184  * Function is called when the Ok Action button is pressed
   166  */
   185  */
   167 void EapFastCreateMasterKeyQueryDialog::okPressed()
   186 void EapFastCreateMasterKeyQueryDialog::okPressed()
   168 {
   187 {
   169     OstTraceFunctionEntry0( EAPFASTCREATEMASTERKEYQUERYDIALOG_FIRSTBUTTONPRESSED_ENTRY );
   188     OstTraceFunctionEntry0( EAPFASTCREATEMASTERKEYQUERYDIALOG_FIRSTBUTTONPRESSED_ENTRY );
   189         }
   208         }
   190     OstTraceFunctionExit0( EAPFASTCREATEMASTERKEYQUERYDIALOG_FIRSTBUTTONPRESSED_EXIT );
   209     OstTraceFunctionExit0( EAPFASTCREATEMASTERKEYQUERYDIALOG_FIRSTBUTTONPRESSED_EXIT );
   191     qDebug("EapFastCreateMasterKeyQueryDialog::okPressed EXIT");
   210     qDebug("EapFastCreateMasterKeyQueryDialog::okPressed EXIT");
   192 }
   211 }
   193 
   212 
   194 /**
   213 /*!
   195  * Function is called when the Cancel Action button is pressed
   214  * Function is called when the Cancel Action button is pressed
   196  */
   215  */
   197 void EapFastCreateMasterKeyQueryDialog::cancelPressed()
   216 void EapFastCreateMasterKeyQueryDialog::cancelPressed()
   198 {
   217 {
   199     OstTraceFunctionEntry0( EAPFASTCREATEMASTERKEYQUERYDIALOG_CANCELPRESSED_ENTRY );
   218     OstTraceFunctionEntry0( EAPFASTCREATEMASTERKEYQUERYDIALOG_CANCELPRESSED_ENTRY );
   205     }   
   224     }   
   206     qDebug("EapFastCreateMasterKeyQueryDialog::cancelPressed EXIT");
   225     qDebug("EapFastCreateMasterKeyQueryDialog::cancelPressed EXIT");
   207     OstTraceFunctionExit0( EAPFASTCREATEMASTERKEYQUERYDIALOG_CANCELPRESSED_EXIT );
   226     OstTraceFunctionExit0( EAPFASTCREATEMASTERKEYQUERYDIALOG_CANCELPRESSED_EXIT );
   208 }
   227 }
   209 
   228 
   210 /**
   229 /*!
   211  * Function is called when the dialog is about to close
   230  * Function is called when the dialog is about to close
   212  * 
       
   213  */
   231  */
   214 void EapFastCreateMasterKeyQueryDialog::closingDialog()
   232 void EapFastCreateMasterKeyQueryDialog::closingDialog()
   215 {
   233 {
   216     OstTraceFunctionEntry0( EAPFASTCREATEMASTERKEYQUERYDIALOG_CLOSINGDIALOG_ENTRY );
   234     OstTraceFunctionEntry0( EAPFASTCREATEMASTERKEYQUERYDIALOG_CLOSINGDIALOG_ENTRY );
   217     qDebug("EapFastCreateMasterKeyQueryDialog::closingDialog ENTER");
   235     qDebug("EapFastCreateMasterKeyQueryDialog::closingDialog ENTER");
   218  
   236  
   219     qDebug("EapFastCreateMasterKeyQueryDialog::closingDialog EXIT");
   237     qDebug("EapFastCreateMasterKeyQueryDialog::closingDialog EXIT");
   220     OstTraceFunctionExit0( EAPFASTCREATEMASTERKEYQUERYDIALOG_CLOSINGDIALOG_EXIT );
   238     OstTraceFunctionExit0( EAPFASTCREATEMASTERKEYQUERYDIALOG_CLOSINGDIALOG_EXIT );
   221 }
   239 }
   222 
   240 
   223 /**
   241 /*!
   224  * Updating the dialog during its showing is not allowed.
   242  * Device dialog parameters to be set while dialog is displayed.
   225  */ 
   243  * Not supported. 
       
   244  *
       
   245  * @param [in] parameters NOT USED
       
   246  * @return true always.
       
   247  */  
   226 bool EapFastCreateMasterKeyQueryDialog::setDeviceDialogParameters
   248 bool EapFastCreateMasterKeyQueryDialog::setDeviceDialogParameters
   227                 (const QVariantMap &parameters)
   249                 (const QVariantMap &parameters)
   228 {
   250 {
   229     OstTraceFunctionEntry0( EAPFASTCREATEMASTERKEYQUERYDIALOG_SETDEVICEDIALOGPARAMETERS_ENTRY );
   251     OstTraceFunctionEntry0( EAPFASTCREATEMASTERKEYQUERYDIALOG_SETDEVICEDIALOGPARAMETERS_ENTRY );
   230     
   252     
   233     
   255     
   234     OstTraceFunctionExit0( EAPFASTCREATEMASTERKEYQUERYDIALOG_SETDEVICEDIALOGPARAMETERS_EXIT );
   256     OstTraceFunctionExit0( EAPFASTCREATEMASTERKEYQUERYDIALOG_SETDEVICEDIALOGPARAMETERS_EXIT );
   235     return true;
   257     return true;
   236 }
   258 }
   237 
   259 
   238 /**
   260 /*!
   239  * Not supported, 0 always returned
   261  * Not supported
       
   262  *
       
   263  * @return 0 always returned.
   240  */
   264  */
   241 int EapFastCreateMasterKeyQueryDialog::deviceDialogError() const
   265 int EapFastCreateMasterKeyQueryDialog::deviceDialogError() const
   242 {
   266 {
   243     OstTraceFunctionEntry0( EAPFASTCREATEMASTERKEYQUERYDIALOG_DEVICEDIALOGERROR_ENTRY );
   267     OstTraceFunctionEntry0( EAPFASTCREATEMASTERKEYQUERYDIALOG_DEVICEDIALOGERROR_ENTRY );
   244     OstTraceFunctionExit0( EAPFASTCREATEMASTERKEYQUERYDIALOG_DEVICEDIALOGERROR_EXIT);
   268     OstTraceFunctionExit0( EAPFASTCREATEMASTERKEYQUERYDIALOG_DEVICEDIALOGERROR_EXIT);
   245     return 0;
   269     return 0;
   246 }
   270 }
   247 
   271 
   248 /**
   272 /*!
   249  * Dialog is closed and the signal about closing is emitted
   273  * Dialog is closed and the signal about closing is emitted
       
   274  *
       
   275  * @param [in] byClient indicates when the user closes the dialog
   250  */
   276  */
   251 void EapFastCreateMasterKeyQueryDialog::closeDeviceDialog(bool byClient)
   277 void EapFastCreateMasterKeyQueryDialog::closeDeviceDialog(bool byClient)
   252 {   
   278 {   
   253     OstTraceFunctionEntry0( EAPFASTCREATEMASTERKEYQUERYDIALOG_CLOSEDEVICEDIALOG_ENTRY );
   279     OstTraceFunctionEntry0( EAPFASTCREATEMASTERKEYQUERYDIALOG_CLOSEDEVICEDIALOG_ENTRY );
   254     qDebug("EapFastCreateMasterKeyQueryDialog::closeDeviceDialog ENTER");
   280     qDebug("EapFastCreateMasterKeyQueryDialog::closeDeviceDialog ENTER");
   262     
   288     
   263     qDebug("EapFastCreateMasterKeyQueryDialog::closeDeviceDialog EXIT");
   289     qDebug("EapFastCreateMasterKeyQueryDialog::closeDeviceDialog EXIT");
   264     OstTraceFunctionExit0( EAPFASTCREATEMASTERKEYQUERYDIALOG_CLOSEDEVICEDIALOG_EXIT );
   290     OstTraceFunctionExit0( EAPFASTCREATEMASTERKEYQUERYDIALOG_CLOSEDEVICEDIALOG_EXIT );
   265 }
   291 }
   266 
   292 
   267 /**
   293 /*!
   268  * This dialog widget is returned to the caller
   294  * This dialog widget is returned to the caller
       
   295  *
       
   296  * @return this dialog widget
   269  */
   297  */
   270 HbPopup *EapFastCreateMasterKeyQueryDialog::deviceDialogWidget() const
   298 HbPopup *EapFastCreateMasterKeyQueryDialog::deviceDialogWidget() const
   271 {
   299 {
   272     OstTraceFunctionEntry0( EAPFASTCREATEMASTERKEYQUERYDIALOG_DEVICEDIALOGWIDGET_ENTRY );
   300     OstTraceFunctionEntry0( EAPFASTCREATEMASTERKEYQUERYDIALOG_DEVICEDIALOGWIDGET_ENTRY );
   273     OstTraceFunctionExit0( EAPFASTCREATEMASTERKEYQUERYDIALOG_DEVICEDIALOGWIDGET_EXIT );
   301     OstTraceFunctionExit0( EAPFASTCREATEMASTERKEYQUERYDIALOG_DEVICEDIALOGWIDGET_EXIT );