securitysettings/eapqtdialogs/src/eapusernamepwddialog.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:   User authentication Dialog implementation
    14 * Description:   
       
    15 *   User authentication Dialog implementation
    15 *
    16 *
    16 */
    17 */
    17 
    18 
    18 /*
    19 /*
    19  * %version: 4 %
    20  * %version: 5 %
    20  */
    21  */
    21 
    22 
       
    23 // System includes
    22 #include <eapqtvalidator.h>
    24 #include <eapqtvalidator.h>
    23 #include <eapqtexpandedeaptype.h>
    25 #include <eapqtexpandedeaptype.h>
    24 #include <eapqtconfiginterface.h>
    26 #include <eapqtconfiginterface.h>
    25 #include <eapqtconfig.h>
    27 #include <eapqtconfig.h>
    26 #include <HbParameterLengthLimiter>
    28 #include <HbParameterLengthLimiter>
    27 #include <HbTranslator>
    29 #include <HbTranslator>
    28 #include <HbLineEdit>
    30 #include <HbLineEdit>
    29 #include <HbAction>
    31 #include <HbAction>
       
    32 
       
    33 // User includes
    30 #include "eapusernamepwddialog.h"
    34 #include "eapusernamepwddialog.h"
    31 #include "OstTraceDefinitions.h"
    35 #include "OstTraceDefinitions.h"
    32 #ifdef OST_TRACE_COMPILER_IN_USE
    36 #ifdef OST_TRACE_COMPILER_IN_USE
    33 
    37 
    34 #endif
    38 #endif
    35 
    39 
    36 /**
    40 /*!
    37  * The constructor
    41  * \class EapUsernamePwdDialog
       
    42  * \brief Implements Username Password Input Dialog. 
       
    43  */
       
    44 
       
    45 // External function prototypes
       
    46 
       
    47 // Local constants
       
    48  
       
    49 // ======== LOCAL FUNCTIONS ========
       
    50 
       
    51 // ======== MEMBER FUNCTIONS ========
       
    52 
       
    53 /*!
       
    54  * Constructor.
       
    55  * 
       
    56  * @param [in]  parameters Parameters for the Constructor.
    38  */
    57  */
    39 EapUsernamePwdDialog::EapUsernamePwdDialog(const QVariantMap &parameters) 
    58 EapUsernamePwdDialog::EapUsernamePwdDialog(const QVariantMap &parameters) 
    40  :mEdit1(NULL), 
    59  :mEdit1(NULL), 
    41  mEdit2(NULL), 
    60  mEdit2(NULL), 
    42  mUnameValidator(NULL),
    61  mUnameValidator(NULL),
    52         
    71         
    53     OstTraceFunctionExit0( EAPUSERNAMEPWDDIALOG_EAPUSERNAMEPWDDIALOG_EXIT );
    72     OstTraceFunctionExit0( EAPUSERNAMEPWDDIALOG_EAPUSERNAMEPWDDIALOG_EXIT );
    54     qDebug("EapUsernamePwdDialog::EapUsernamePwdDialog EXIT");
    73     qDebug("EapUsernamePwdDialog::EapUsernamePwdDialog EXIT");
    55 }
    74 }
    56     
    75     
    57 /**
    76 /*!
    58  * The construction of the dialog
    77  * The construction of the dialog
       
    78  *
       
    79  * @param [in] parameters Parameters for the Construction of the dialog.
    59  */ 
    80  */ 
    60 void EapUsernamePwdDialog::createDialog(const QVariantMap &parameters )
    81 void EapUsernamePwdDialog::createDialog(const QVariantMap &parameters )
    61 {
    82 {
    62     OstTraceFunctionEntry0( EAPUSERNAMEPWDDIALOG_CREATEDIALOG_ENTRY );
    83     OstTraceFunctionEntry0( EAPUSERNAMEPWDDIALOG_CREATEDIALOG_ENTRY );
    63     qDebug("EapUsernamePwdDialog::createDialog ENTER");
    84     qDebug("EapUsernamePwdDialog::createDialog ENTER");
    90     this->setModal(true);
   111     this->setModal(true);
    91     this->setTimeout(HbPopup::NoTimeout);
   112     this->setTimeout(HbPopup::NoTimeout);
    92     this->setDismissPolicy(HbPopup::NoDismiss);    
   113     this->setDismissPolicy(HbPopup::NoDismiss);    
    93     this->setAdditionalRowVisible(true);
   114     this->setAdditionalRowVisible(true);
    94     
   115     
       
   116     //Set the first Line Edit (user name) to be on the screen
    95     this->setPromptText(labelText1, 0);   
   117     this->setPromptText(labelText1, 0);   
    96     mEdit1 = this->lineEdit(0);
   118     mEdit1 = this->lineEdit(0);
       
   119     //Set default user name string
    97     mEdit1->setText(unamestr);
   120     mEdit1->setText(unamestr);
    98     
   121     
       
   122     //Set the second Line Edit (password) to be on the screen also
    99     this->setPromptText(labelText2, 1);   
   123     this->setPromptText(labelText2, 1);   
   100     mEdit2 = this->lineEdit(1);        
   124     mEdit2 = this->lineEdit(1);        
   101     
   125     
   102     //Get the EAP type for the Line Edits (Validator)
   126     //Get the EAP type for the Line Edits (Validator)
   103     QByteArray ba;
   127     QByteArray ba;
   155    
   179    
   156     OstTraceFunctionExit0( DUP1_EAPUSERNAMEPWDDIALOG_CREATEDIALOG_EXIT );
   180     OstTraceFunctionExit0( DUP1_EAPUSERNAMEPWDDIALOG_CREATEDIALOG_EXIT );
   157     qDebug("EapUsernamePwdDialog::createDialog EXIT");
   181     qDebug("EapUsernamePwdDialog::createDialog EXIT");
   158 }
   182 }
   159 
   183 
   160 /**
   184 /*!
   161  * Destructor
   185  * Destructor
   162  */
   186  */
   163 EapUsernamePwdDialog::~EapUsernamePwdDialog()
   187 EapUsernamePwdDialog::~EapUsernamePwdDialog()
   164 {
   188 {
   165     OstTraceFunctionEntry0( EAPUSERNAMEPWDDIALOG_DEAPUSERNAMEPWDDIALOG_ENTRY );
   189     OstTraceFunctionEntry0( EAPUSERNAMEPWDDIALOG_DEAPUSERNAMEPWDDIALOG_ENTRY );
   170     // mUnameValidator: scoped pointer deleted automatically
   194     // mUnameValidator: scoped pointer deleted automatically
   171     
   195     
   172     OstTraceFunctionExit0( EAPUSERNAMEPWDDIALOG_DEAPUSERNAMEPWDDIALOG_EXIT );
   196     OstTraceFunctionExit0( EAPUSERNAMEPWDDIALOG_DEAPUSERNAMEPWDDIALOG_EXIT );
   173 }
   197 }
   174 
   198 
   175 /**
   199 /*!
   176  * Line Edit Validator 
   200  * Line edit validator
       
   201  *
       
   202  * @return true if content is valid.
   177  */
   203  */
   178 bool EapUsernamePwdDialog::validate() const
   204 bool EapUsernamePwdDialog::validate() const
   179 {
   205 {
   180     qDebug("EapUsernamePwdDialog::validate ENTER");
   206     qDebug("EapUsernamePwdDialog::validate ENTER");
   181     
   207     
   190 
   216 
   191     qDebug("EapUsernamePwdDialog::validate EXIT");
   217     qDebug("EapUsernamePwdDialog::validate EXIT");
   192     return valid;
   218     return valid;
   193 }
   219 }
   194 
   220 
   195 /**
   221 /*!
   196  * Function is called when the Ok Action button is pressed
   222  * Function is called when the Ok Action button is pressed
   197  */
   223  */
   198 void EapUsernamePwdDialog::okPressed()
   224 void EapUsernamePwdDialog::okPressed()
   199 {
   225 {
   200     OstTraceFunctionEntry0( EAPUSERNAMEPWDDIALOG_OKPRESSED_ENTRY );
   226     OstTraceFunctionEntry0( EAPUSERNAMEPWDDIALOG_OKPRESSED_ENTRY );
   216     }
   242     }
   217     OstTraceFunctionExit0( EAPUSERNAMEPWDDIALOG_OKPRESSED_EXIT );
   243     OstTraceFunctionExit0( EAPUSERNAMEPWDDIALOG_OKPRESSED_EXIT );
   218     qDebug("EapUsernamePwdDialog::okPressed EXIT");
   244     qDebug("EapUsernamePwdDialog::okPressed EXIT");
   219 }
   245 }
   220 
   246 
   221 /**
   247 /*!
   222  * Function is called when the Cancel Action button is pressed
   248  * Function is called when the Cancel Action button is pressed
   223  */
   249  */
   224 void EapUsernamePwdDialog::cancelPressed()
   250 void EapUsernamePwdDialog::cancelPressed()
   225 {
   251 {
   226     OstTraceFunctionEntry0( EAPUSERNAMEPWDDIALOG_CANCELPRESSED_ENTRY );
   252     OstTraceFunctionEntry0( EAPUSERNAMEPWDDIALOG_CANCELPRESSED_ENTRY );
   232     }   
   258     }   
   233     qDebug("EapUsernamePwdDialog::cancelPressed EXIT");
   259     qDebug("EapUsernamePwdDialog::cancelPressed EXIT");
   234     OstTraceFunctionExit0( EAPUSERNAMEPWDDIALOG_CANCELPRESSED_EXIT );
   260     OstTraceFunctionExit0( EAPUSERNAMEPWDDIALOG_CANCELPRESSED_EXIT );
   235 }
   261 }
   236 
   262 
   237 /**
   263 /*!
   238  * Function is called when the dialog is about to close
   264  * Function is called when the dialog is about to close
   239  * 
       
   240  */
   265  */
   241 void EapUsernamePwdDialog::closingDialog()
   266 void EapUsernamePwdDialog::closingDialog()
   242 {
   267 {
   243     OstTraceFunctionEntry0( EAPUSERNAMEPWDDIALOG_CLOSINGDIALOG_ENTRY );
   268     OstTraceFunctionEntry0( EAPUSERNAMEPWDDIALOG_CLOSINGDIALOG_ENTRY );
   244     qDebug("EapUsernamePwdDialog::closingDialog ENTER");
   269     qDebug("EapUsernamePwdDialog::closingDialog ENTER");
   245      
   270      
   246     qDebug("EapUsernamePwdDialog::closingDialog EXIT");
   271     qDebug("EapUsernamePwdDialog::closingDialog EXIT");
   247     OstTraceFunctionExit0( EAPUSERNAMEPWDDIALOG_CLOSINGDIALOG_EXIT );
   272     OstTraceFunctionExit0( EAPUSERNAMEPWDDIALOG_CLOSINGDIALOG_EXIT );
   248 }
   273 }
   249 
   274 
   250 /**
   275 /*!
   251  * Updating the dialog during its showing is not allowed.
   276  * Device dialog parameters to be set while dialog is displayed.
   252  */ 
   277  * Not supported. 
       
   278  *
       
   279  * @param [in] parameters NOT USED
       
   280  * @return true always.
       
   281  */  
   253 bool EapUsernamePwdDialog::setDeviceDialogParameters
   282 bool EapUsernamePwdDialog::setDeviceDialogParameters
   254                 (const QVariantMap &parameters)
   283                 (const QVariantMap &parameters)
   255 {
   284 {
   256     OstTraceFunctionEntry0( EAPUSERNAMEPWDDIALOG_SETDEVICEDIALOGPARAMETERS_ENTRY );
   285     OstTraceFunctionEntry0( EAPUSERNAMEPWDDIALOG_SETDEVICEDIALOGPARAMETERS_ENTRY );
   257     
   286     
   260     
   289     
   261     OstTraceFunctionExit0( EAPUSERNAMEPWDDIALOG_SETDEVICEDIALOGPARAMETERS_EXIT );
   290     OstTraceFunctionExit0( EAPUSERNAMEPWDDIALOG_SETDEVICEDIALOGPARAMETERS_EXIT );
   262     return true;
   291     return true;
   263 }
   292 }
   264 
   293 
   265 /**
   294 /*!
   266  * Not supported, 0 always returned
   295  * Not supported
       
   296  *
       
   297  * @return 0 always returned.
   267  */
   298  */
   268 int EapUsernamePwdDialog::deviceDialogError() const
   299 int EapUsernamePwdDialog::deviceDialogError() const
   269 {
   300 {
   270     OstTraceFunctionEntry0( EAPUSERNAMEPWDDIALOG_DEVICEDIALOGERROR_ENTRY );
   301     OstTraceFunctionEntry0( EAPUSERNAMEPWDDIALOG_DEVICEDIALOGERROR_ENTRY );
   271     OstTraceFunctionExit0( EAPUSERNAMEPWDDIALOG_DEVICEDIALOGERROR_EXIT);
   302     OstTraceFunctionExit0( EAPUSERNAMEPWDDIALOG_DEVICEDIALOGERROR_EXIT);
   272     return 0;
   303     return 0;
   273 }
   304 }
   274 
   305 
   275 /**
   306 /*!
   276  * Dialog is closed and the signal about closing is emitted
   307  * Dialog is closed and the signal about closing is emitted
       
   308  *
       
   309  * @param [in] byClient indicates when the user closes the dialog
   277  */
   310  */
   278 void EapUsernamePwdDialog::closeDeviceDialog(bool byClient)
   311 void EapUsernamePwdDialog::closeDeviceDialog(bool byClient)
   279 {   
   312 {   
   280     OstTraceFunctionEntry0( EAPUSERNAMEPWDDIALOG_CLOSEDEVICEDIALOG_ENTRY );
   313     OstTraceFunctionEntry0( EAPUSERNAMEPWDDIALOG_CLOSEDEVICEDIALOG_ENTRY );
   281     qDebug("EapUsernamePwdDialog::closeDeviceDialog ENTER");
   314     qDebug("EapUsernamePwdDialog::closeDeviceDialog ENTER");
   289     
   322     
   290     qDebug("EapUsernamePwdDialog::closeDeviceDialog EXIT");
   323     qDebug("EapUsernamePwdDialog::closeDeviceDialog EXIT");
   291     OstTraceFunctionExit0( EAPUSERNAMEPWDDIALOG_CLOSEDEVICEDIALOG_EXIT );
   324     OstTraceFunctionExit0( EAPUSERNAMEPWDDIALOG_CLOSEDEVICEDIALOG_EXIT );
   292 }
   325 }
   293 
   326 
   294 /**
   327 /*!
   295  * This dialog widget is returned to the caller
   328  * This dialog widget is returned to the caller
       
   329  *
       
   330  * @return this dialog widget
   296  */
   331  */
   297 HbPopup *EapUsernamePwdDialog::deviceDialogWidget() const
   332 HbPopup *EapUsernamePwdDialog::deviceDialogWidget() const
   298 {
   333 {
   299     OstTraceFunctionEntry0( EAPUSERNAMEPWDDIALOG_DEVICEDIALOGWIDGET_ENTRY );
   334     OstTraceFunctionEntry0( EAPUSERNAMEPWDDIALOG_DEVICEDIALOGWIDGET_ENTRY );
   300     OstTraceFunctionExit0( EAPUSERNAMEPWDDIALOG_DEVICEDIALOGWIDGET_EXIT );
   335     OstTraceFunctionExit0( EAPUSERNAMEPWDDIALOG_DEVICEDIALOGWIDGET_EXIT );