securitysettings/eapqtdialogs/src/eapfastpacstorepwquerydialog.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 Pac Store Password Query Dialog implementation
    14 * Description: EAP-FAST PAC Store Password Query Dialog implementation
    15 *
    15 *
    16 */
    16 */
    17 
    17 
    18 /*
    18 /*
    19 * %version: 5 %
    19 * %version: 6 %
    20 */
    20 */
    21 
    21 
       
    22 // System includes
    22 #include <HbTranslator>
    23 #include <HbTranslator>
    23 #include <HbAction>
    24 #include <HbAction>
    24 #include <HbTranslator>
    25 #include <HbTranslator>
    25 #include <HbMessageBox>
    26 #include <HbMessageBox>
    26 #include <HbParameterLengthLimiter>
    27 #include <HbParameterLengthLimiter>
    27 #include <eapqtvalidator.h>
    28 #include <eapqtvalidator.h>
    28 #include <eapqtexpandedeaptype.h>
    29 #include <eapqtexpandedeaptype.h>
    29 #include <eapqtconfiginterface.h>
    30 #include <eapqtconfiginterface.h>
    30 #include <eapqtconfig.h>
    31 #include <eapqtconfig.h>
       
    32 
       
    33 // User includes
    31 #include "eapfastpacstorepwquerydialog.h"
    34 #include "eapfastpacstorepwquerydialog.h"
    32 #include "OstTraceDefinitions.h"
    35 #include "OstTraceDefinitions.h"
    33 #ifdef OST_TRACE_COMPILER_IN_USE
    36 #ifdef OST_TRACE_COMPILER_IN_USE
    34 #endif
    37 #endif
    35 
    38 
    36 
    39 
    37 /**
    40 /*!
    38  * The constructor
    41  * \class EapFastPacStorePwQueryDialog
       
    42  * \brief Implements EAP-FAST PAC Store Password Query Dialog. 
       
    43  */
       
    44 
       
    45 // External function prototypes
       
    46 
       
    47 // Local constants
       
    48 static const uint PacStorePwQueryTimeout = 60000;
       
    49  
       
    50 // ======== LOCAL FUNCTIONS ========
       
    51 
       
    52 // ======== MEMBER FUNCTIONS ========
       
    53 
       
    54 /*!
       
    55  * Constructor.
       
    56  * 
       
    57  * @param [in]  parameters Parameters for the Constructor.
    39  */
    58  */
    40 EapFastPacStorePwQueryDialog::EapFastPacStorePwQueryDialog(const QVariantMap &parameters) 
    59 EapFastPacStorePwQueryDialog::EapFastPacStorePwQueryDialog(const QVariantMap &parameters) 
    41  :mEdit(NULL), 
    60  :mEdit(NULL), 
    42  mPwdValidator(NULL),
    61  mPwdValidator(NULL),
    43  mTranslator(new HbTranslator("eapprompts")),
    62  mTranslator(new HbTranslator("eapprompts")),
    44  mErrMsgTranslator(new HbTranslator("cpdestinationplugin")),
    63  mErrMsgTranslator(new HbTranslator("cpdestinationplugin")),
    45  mClose(false)
    64  mClose(false)
    46 {
    65 {
    47     OstTraceFunctionEntry0( EAPFASTPACSTOREPWQUERYDIALOG_EAPFASTPACSTOREPWQUERYDIALOG_ENTRY );
    66     OstTraceFunctionEntry0( EAPFASTPACSTOREPWQUERYDIALOG_EAPFASTPACSTOREPWQUERYDIALOG_ENTRY );
    48     qDebug("EapFastPacStorePwQueryDialog::EapFastPacStorePwQueryDialog ENTER");
    67     qDebug("EapFastPacStorePwQueryDialog::EapFastPacStorePwQueryDialog ENTER");
       
    68     
       
    69     Q_UNUSED(parameters)
    49           
    70           
    50     createDialog(parameters);
    71     createDialog();
    51      
    72      
    52     OstTraceFunctionExit0( EAPFASTPACSTOREPWQUERYDIALOG_EAPFASTPACSTOREPWQUERYDIALOG_EXIT );
    73     OstTraceFunctionExit0( EAPFASTPACSTOREPWQUERYDIALOG_EAPFASTPACSTOREPWQUERYDIALOG_EXIT );
    53     qDebug("EapFastPacStorePwQueryDialog::EapFastPacStorePwQueryDialog EXIT");
    74     qDebug("EapFastPacStorePwQueryDialog::EapFastPacStorePwQueryDialog EXIT");
    54 }
    75 }
    55     
    76     
    56 /**
    77 /*!
    57  * The construction of the dialog
    78  * The construction of the dialog
    58  */ 
    79  */ 
    59 void EapFastPacStorePwQueryDialog::createDialog(const QVariantMap &parameters )
    80 void EapFastPacStorePwQueryDialog::createDialog()
    60 {
    81 {
    61     OstTraceFunctionEntry0( EAPFASTPACSTOREPWQUERYDIALOG_CREATEDIALOG_ENTRY );
    82     OstTraceFunctionEntry0( EAPFASTPACSTOREPWQUERYDIALOG_CREATEDIALOG_ENTRY );
    62     qDebug("EapFastPacStorePwQueryDialog::createDialog ENTER");
    83     qDebug("EapFastPacStorePwQueryDialog::createDialog ENTER");
    63 
    84 
    64     QString labelText(hbTrId("txt_occ_dialog_pac_store_password"));
    85     QString labelText(hbTrId("txt_occ_dialog_pac_store_password"));
    65     
    86     
    66     Q_UNUSED(parameters)
       
    67 
       
    68     // Set the dialog to be on the screen for 60 seconds, unless
    87     // Set the dialog to be on the screen for 60 seconds, unless
    69     // the user reacts earlier
    88     // the user reacts earlier
    70     this->setModal(true);
    89     this->setModal(true);
    71     this->setTimeout(60000);
    90     this->setTimeout(PacStorePwQueryTimeout);
    72     this->setDismissPolicy(HbPopup::NoDismiss);
    91     this->setDismissPolicy(HbPopup::NoDismiss);
    73     this->setPromptText(labelText, 0);  
    92     this->setPromptText(labelText, 0);  
    74     
    93     
    75     mEdit = this->lineEdit(0);
    94     mEdit = this->lineEdit(0);
    76     mEdit->setEchoMode(HbLineEdit::Password);
    95     mEdit->setEchoMode(HbLineEdit::Password);
   119    
   138    
   120     OstTraceFunctionExit0( DUP1_EAPFASTPACSTOREPWQUERYDIALOG_CREATEDIALOG_EXIT );
   139     OstTraceFunctionExit0( DUP1_EAPFASTPACSTOREPWQUERYDIALOG_CREATEDIALOG_EXIT );
   121     qDebug("EapFastPacStorePwQueryDialog::createDialog EXIT");
   140     qDebug("EapFastPacStorePwQueryDialog::createDialog EXIT");
   122 }
   141 }
   123 
   142 
   124 /**
   143 /*!
   125  * Destructor
   144  * Destructor.
   126  */
   145  */
   127 EapFastPacStorePwQueryDialog::~EapFastPacStorePwQueryDialog()
   146 EapFastPacStorePwQueryDialog::~EapFastPacStorePwQueryDialog()
   128 {
   147 {
   129     OstTraceFunctionEntry0( EAPFASTPACSTOREPWQUERYDIALOG_DEAPFASTPACSTOREPWQUERYDIALOG_ENTRY );
   148     OstTraceFunctionEntry0( EAPFASTPACSTOREPWQUERYDIALOG_DEAPFASTPACSTOREPWQUERYDIALOG_ENTRY );
   130     
   149     
   132     // mPwdValidator:   scoped pointer deleted automatically
   151     // mPwdValidator:   scoped pointer deleted automatically
   133     
   152     
   134     OstTraceFunctionExit0( EAPFASTPACSTOREPWQUERYDIALOG_DEAPFASTPACSTOREPWQUERYDIALOG_EXIT );
   153     OstTraceFunctionExit0( EAPFASTPACSTOREPWQUERYDIALOG_DEAPFASTPACSTOREPWQUERYDIALOG_EXIT );
   135 }
   154 }
   136 
   155 
   137 /**
   156 /*!
   138  * Line edit validator
   157  * Line edit validator
       
   158  *
       
   159  * @return true if content is valid.
   139  */
   160  */
   140 bool EapFastPacStorePwQueryDialog::validate() const
   161 bool EapFastPacStorePwQueryDialog::validate() const
   141 {
   162 {
   142     qDebug("EapFastPacStorePwQueryDialog::validate ENTER");
   163     qDebug("EapFastPacStorePwQueryDialog::validate ENTER");
   143     
   164     
   150     
   171     
   151     qDebug("EapFastPacStorePwQueryDialog::validate EXIT");
   172     qDebug("EapFastPacStorePwQueryDialog::validate EXIT");
   152     return valid;
   173     return valid;
   153 }
   174 }
   154 
   175 
   155 /**
   176 /*!
   156  * Function is called when the Ok Action button is pressed
   177  * Function is called when the Ok Action button is pressed
   157  */
   178  */
   158 void EapFastPacStorePwQueryDialog::okPressed()
   179 void EapFastPacStorePwQueryDialog::okPressed()
   159 {
   180 {
   160     OstTraceFunctionEntry0( EAPFASTPACSTOREPWQUERYDIALOG_OKPRESSED_ENTRY );
   181     OstTraceFunctionEntry0( EAPFASTPACSTOREPWQUERYDIALOG_OKPRESSED_ENTRY );
   182         
   203         
   183     OstTraceFunctionExit0( EAPFASTPACSTOREPWQUERYDIALOG_OKPRESSED_EXIT );
   204     OstTraceFunctionExit0( EAPFASTPACSTOREPWQUERYDIALOG_OKPRESSED_EXIT );
   184     qDebug("EapFastPacStorePwQueryDialog::okPressed EXIT");
   205     qDebug("EapFastPacStorePwQueryDialog::okPressed EXIT");
   185 }
   206 }
   186 
   207 
   187 /**
   208 /*!
   188  * Function is called when the Cancel Action button is pressed
   209  * Function is called when the Cancel Action button is pressed
   189  */
   210  */
   190 void EapFastPacStorePwQueryDialog::cancelPressed()
   211 void EapFastPacStorePwQueryDialog::cancelPressed()
   191 {
   212 {
   192     OstTraceFunctionEntry0( EAPFASTPACSTOREPWQUERYDIALOG_CANCELPRESSED_ENTRY );
   213     OstTraceFunctionEntry0( EAPFASTPACSTOREPWQUERYDIALOG_CANCELPRESSED_ENTRY );
   198     }   
   219     }   
   199     qDebug("EapFastPacStorePwQueryDialog::cancelPressed EXIT");
   220     qDebug("EapFastPacStorePwQueryDialog::cancelPressed EXIT");
   200     OstTraceFunctionExit0( EAPFASTPACSTOREPWQUERYDIALOG_CANCELPRESSED_EXIT );
   221     OstTraceFunctionExit0( EAPFASTPACSTOREPWQUERYDIALOG_CANCELPRESSED_EXIT );
   201 }
   222 }
   202 
   223 
   203 /**
   224 /*!
   204  * Function is called when the dialog is about to close
   225  * Function is called when the dialog is about to close
   205  * 
       
   206  */
   226  */
   207 void EapFastPacStorePwQueryDialog::closingDialog()
   227 void EapFastPacStorePwQueryDialog::closingDialog()
   208 {
   228 {
   209     OstTraceFunctionEntry0( EAPFASTPACSTOREPWQUERYDIALOG_CLOSINGDIALOG_ENTRY );
   229     OstTraceFunctionEntry0( EAPFASTPACSTOREPWQUERYDIALOG_CLOSINGDIALOG_ENTRY );
   210     qDebug("EapFastPacStorePwQueryDialog::closingDialog ENTER");
   230     qDebug("EapFastPacStorePwQueryDialog::closingDialog ENTER");
   211      
   231      
   212     qDebug("EapFastPacStorePwQueryDialog::closingDialog EXIT");
   232     qDebug("EapFastPacStorePwQueryDialog::closingDialog EXIT");
   213     OstTraceFunctionExit0( EAPFASTPACSTOREPWQUERYDIALOG_CLOSINGDIALOG_EXIT );
   233     OstTraceFunctionExit0( EAPFASTPACSTOREPWQUERYDIALOG_CLOSINGDIALOG_EXIT );
   214 }
   234 }
   215 
   235 
   216 /**
   236 /*!
   217  * Updating the dialog during its showing is not allowed.
   237  * Device dialog parameters to be set while dialog is displayed.
   218  */ 
   238  * Not supported. 
       
   239  *
       
   240  * @param [in] parameters NOT USED
       
   241  * @return true always.
       
   242  */  
   219 bool EapFastPacStorePwQueryDialog::setDeviceDialogParameters
   243 bool EapFastPacStorePwQueryDialog::setDeviceDialogParameters
   220                 (const QVariantMap &parameters)
   244                 (const QVariantMap &parameters)
   221 {
   245 {
   222     OstTraceFunctionEntry0( EAPFASTPACSTOREPWQUERYDIALOG_SETDEVICEDIALOGPARAMETERS_ENTRY );
   246     OstTraceFunctionEntry0( EAPFASTPACSTOREPWQUERYDIALOG_SETDEVICEDIALOGPARAMETERS_ENTRY );
   223     
   247     
   226     
   250     
   227     OstTraceFunctionExit0( EAPFASTPACSTOREPWQUERYDIALOG_SETDEVICEDIALOGPARAMETERS_EXIT );
   251     OstTraceFunctionExit0( EAPFASTPACSTOREPWQUERYDIALOG_SETDEVICEDIALOGPARAMETERS_EXIT );
   228     return true;
   252     return true;
   229 }
   253 }
   230 
   254 
   231 /**
   255 /*!
   232  * Not supported, 0 always returned
   256  * Not supported
       
   257  *
       
   258  * @return 0 always returned.
   233  */
   259  */
   234 int EapFastPacStorePwQueryDialog::deviceDialogError() const
   260 int EapFastPacStorePwQueryDialog::deviceDialogError() const
   235 {
   261 {
   236     OstTraceFunctionEntry0( EAPFASTPACSTOREPWQUERYDIALOG_DEVICEDIALOGERROR_ENTRY );
   262     OstTraceFunctionEntry0( EAPFASTPACSTOREPWQUERYDIALOG_DEVICEDIALOGERROR_ENTRY );
   237     OstTraceFunctionExit0( EAPFASTPACSTOREPWQUERYDIALOG_DEVICEDIALOGERROR_EXIT);
   263     OstTraceFunctionExit0( EAPFASTPACSTOREPWQUERYDIALOG_DEVICEDIALOGERROR_EXIT);
   238     return 0;
   264     return 0;
   239 }
   265 }
   240 
   266 
   241 /**
   267 /*!
   242  * Dialog is closed and the signal about closing is emitted
   268  * Dialog is closed and the signal about closing is emitted
       
   269  *
       
   270  * @param [in] byClient indicates when the user closes the dialog
   243  */
   271  */
   244 void EapFastPacStorePwQueryDialog::closeDeviceDialog(bool byClient)
   272 void EapFastPacStorePwQueryDialog::closeDeviceDialog(bool byClient)
   245 {   
   273 {   
   246     OstTraceFunctionEntry0( EAPFASTPACSTOREPWQUERYDIALOG_CLOSEDEVICEDIALOG_ENTRY );
   274     OstTraceFunctionEntry0( EAPFASTPACSTOREPWQUERYDIALOG_CLOSEDEVICEDIALOG_ENTRY );
   247     qDebug("EapFastPacStorePwQueryDialog::closeDeviceDialog ENTER");
   275     qDebug("EapFastPacStorePwQueryDialog::closeDeviceDialog ENTER");
   255     
   283     
   256     qDebug("EapFastPacStorePwQueryDialog::closeDeviceDialog EXIT");
   284     qDebug("EapFastPacStorePwQueryDialog::closeDeviceDialog EXIT");
   257     OstTraceFunctionExit0( EAPFASTPACSTOREPWQUERYDIALOG_CLOSEDEVICEDIALOG_EXIT );
   285     OstTraceFunctionExit0( EAPFASTPACSTOREPWQUERYDIALOG_CLOSEDEVICEDIALOG_EXIT );
   258 }
   286 }
   259 
   287 
   260 /**
   288 /*!
   261  * This dialog widget is returned to the caller
   289  * This dialog widget is returned to the caller
       
   290  *
       
   291  * @return this dialog widget
   262  */
   292  */
   263 HbPopup *EapFastPacStorePwQueryDialog::deviceDialogWidget() const
   293 HbPopup *EapFastPacStorePwQueryDialog::deviceDialogWidget() const
   264 {
   294 {
   265     OstTraceFunctionEntry0( EAPFASTPACSTOREPWQUERYDIALOG_DEVICEDIALOGWIDGET_ENTRY );
   295     OstTraceFunctionEntry0( EAPFASTPACSTOREPWQUERYDIALOG_DEVICEDIALOGWIDGET_ENTRY );
   266     OstTraceFunctionExit0( EAPFASTPACSTOREPWQUERYDIALOG_DEVICEDIALOGWIDGET_EXIT );
   296     OstTraceFunctionExit0( EAPFASTPACSTOREPWQUERYDIALOG_DEVICEDIALOGWIDGET_EXIT );