securitydialogs/simlockui/src/SimLockUIAppui.cpp
branchRCL_3
changeset 20 63339781d179
parent 5 3b17fc5c9564
equal deleted inserted replaced
19:94b923fa11ed 20:63339781d179
    28 #include <exterror.h>           // KErrGsm0707OperationNotAllowed
    28 #include <exterror.h>           // KErrGsm0707OperationNotAllowed
    29 #include <eikspane.h>     // CEikStatusPane
    29 #include <eikspane.h>     // CEikStatusPane
    30 #include <aknmessagequerydialog.h> // CAknMessageQueryDialog
    30 #include <aknmessagequerydialog.h> // CAknMessageQueryDialog
    31 #include <e32base.h>
    31 #include <e32base.h>
    32 #include <e32property.h> //Rproperty
    32 #include <e32property.h> //Rproperty
       
    33 #include <rmmcustomapi.h>       // TSimLockPassword
       
    34 
    33 // Local Includes
    35 // Local Includes
    34 #include "simlockisaserverdefinitions.h"
    36 #include "simlockisaserverdefinitions.h"
    35 #include "simlockui.pan"
    37 #include "simlockui.pan"
    36 #include "simlockuiappui.h"
    38 #include "simlockuiappui.h"
    37 #include "simlockuibackgroundcontrol.h"
    39 #include "simlockuibackgroundcontrol.h"
   126 // ---------------------------------------------------------------------------
   128 // ---------------------------------------------------------------------------
   127 TBool CSimLockUIAppUi::ProcessSimUnlockDialogsL()
   129 TBool CSimLockUIAppUi::ProcessSimUnlockDialogsL()
   128     {
   130     {
   129     TBool keepLooping = ETrue;
   131     TBool keepLooping = ETrue;
   130 
   132 
   131     TBuf<SEC_ATT_PASSWORD_MAX_BUFFER> password;
   133     RMmCustomAPI::TSimLockPassword password;
       
   134 
   132 
   135 
   133     // Loop until flag is set
   136     // Loop until flag is set
   134     do
   137     do
   135         {
   138         {
   136         // Create background if not already there
   139         // Create background if not already there
   163 // ---------------------------------------------------------------------------
   166 // ---------------------------------------------------------------------------
   164 // CSimLockUIAppUi::CreateBackgroundControlL
   167 // CSimLockUIAppUi::CreateBackgroundControlL
   165 // ---------------------------------------------------------------------------
   168 // ---------------------------------------------------------------------------
   166 void CSimLockUIAppUi::CreateBackgroundControlL()
   169 void CSimLockUIAppUi::CreateBackgroundControlL()
   167     {
   170     {
   168     CEikStatusPane* statusPane = StatusPane();
   171     iBackgroundControl = CSimLockUIBackgroundControl::NewL();
   169 
       
   170     // Remove status pane
       
   171     // Crop background pane to reveal idle status pane
       
   172     TRect background = ClientRect();
       
   173     statusPane->ReduceRect(background);
       
   174     statusPane->SwitchLayoutL(R_AVKON_STATUS_PANE_LAYOUT_EMPTY);
       
   175 
       
   176     iBackgroundControl = CSimLockUIBackgroundControl::NewL(background);
       
   177     AddToStackL(iBackgroundControl);
   172     AddToStackL(iBackgroundControl);
   178     }
   173     }
   179 
   174 
   180 // ---------------------------------------------------------------------------
   175 // ---------------------------------------------------------------------------
   181 // CSimLockUIAppUi::DisplayIntroductionDialogL
   176 // CSimLockUIAppUi::DisplayIntroductionDialogL
   199 // ---------------------------------------------------------------------------
   194 // ---------------------------------------------------------------------------
   200 // CSimLockUIAppUi::PromptForPasswordL
   195 // CSimLockUIAppUi::PromptForPasswordL
   201 // ---------------------------------------------------------------------------
   196 // ---------------------------------------------------------------------------
   202 TBool CSimLockUIAppUi::PromptForPasswordL(TDes& aPassword)
   197 TBool CSimLockUIAppUi::PromptForPasswordL(TDes& aPassword)
   203     {
   198     {
   204     TBuf<SEC_ATT_PASSWORD_MAX_BUFFER> newPassword;
   199     RMmCustomAPI::TSimLockPassword newPassword;
   205 
   200 
   206     // Prompt for password twice.  Loop until passwords match.
   201     // Prompt for password twice.  Loop until passwords match.
   207     do
   202     do
   208         {
   203         {
   209         aPassword.Zero();
   204         aPassword.Zero();
   210 
   205 
   211         // Ask for password
   206         // Ask for password
   212         CAknTextQueryDialog* dialog = CAknTextQueryDialog::NewL(aPassword);
   207         CAknTextQueryDialog* dialog = CAknTextQueryDialog::NewL(aPassword);
   213        // dialog->SetMaxLength(SEC_ATT_PASSWORD_MAX_LENGTH);
       
   214 
       
   215         if (!dialog->ExecuteLD(R_SIM_INFO_ENTER_PASSWORD))
   208         if (!dialog->ExecuteLD(R_SIM_INFO_ENTER_PASSWORD))
   216             {
   209             {
   217             return EFalse;
   210             return EFalse;
   218             }
   211             }
   219 
   212 
   327 // ---------------------------------------------------------------------------
   320 // ---------------------------------------------------------------------------
   328 // CSimLockUIAppUi::HandleUnlockFailedL
   321 // CSimLockUIAppUi::HandleUnlockFailedL
   329 // ---------------------------------------------------------------------------
   322 // ---------------------------------------------------------------------------
   330 TBool CSimLockUIAppUi::HandleUnlockFailedL()
   323 TBool CSimLockUIAppUi::HandleUnlockFailedL()
   331     {
   324     {
   332     TBuf<SEC_ATT_PASSWORD_MAX_BUFFER> password;
   325     RMmCustomAPI::TSimLockPassword password;
       
   326 
   333     // Otherwise, prompt user to try again
   327     // Otherwise, prompt user to try again
   334     SetBackgroundTextL(EBackgroundTextEmpty);
   328     SetBackgroundTextL(EBackgroundTextEmpty);
   335 
   329 
   336     // Show "Code Incorrect" and prompt user to continue or not
   330     // Show "Code Incorrect" and prompt user to continue or not
   337     CAknMessageQueryDialog* query = new (ELeave) CAknMessageQueryDialog(
   331     CAknMessageQueryDialog* query = new (ELeave) CAknMessageQueryDialog(