wlansecuritysettings/wifiprotectedsetup/pluginsrc/wifiprotenterpindlg.cpp
branchRCL_3
changeset 46 c74b3d9f6b9e
equal deleted inserted replaced
45:bad0cc58d154 46:c74b3d9f6b9e
       
     1 /*
       
     2 * Copyright (c) 2001-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of the License "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description: Implementation of class CWiFiProtEnterPinDlg.
       
    15 *
       
    16 */
       
    17 
       
    18 /*
       
    19 * %version: tr1cfwln#8 %
       
    20 */
       
    21 
       
    22 // INCLUDE FILES
       
    23 //system includes
       
    24 #include <uikon/eiksrvui.h>
       
    25 
       
    26 //user includes
       
    27 #include "wifiprotenterpindlg.h"
       
    28 #include "wifiprotactiverunnercallback.h"
       
    29 #include "wifiprotplugin.hrh"
       
    30 
       
    31 
       
    32 // FORWARD DECLARATIONS
       
    33 //class MActiveRunnerCallback;
       
    34 
       
    35 // ================= MEMBER FUNCTIONS =======================
       
    36 //
       
    37 // --------------------------------------------------------------------------
       
    38 // CWiFiProtEnterPinDlg::CWiFiProtEnterPinDlg
       
    39 // --------------------------------------------------------------------------
       
    40 //
       
    41 CWiFiProtEnterPinDlg::CWiFiProtEnterPinDlg(
       
    42                               MActiveRunnerCallback& aActiveRunnerCallback ):
       
    43                               iActiveRunnerCallback ( aActiveRunnerCallback )
       
    44     {
       
    45     }
       
    46     
       
    47     
       
    48 // --------------------------------------------------------------------------
       
    49 // CWiFiProtEnterPinDlg::~CWiFiProtEnterPinDlg
       
    50 // --------------------------------------------------------------------------
       
    51 //
       
    52 CWiFiProtEnterPinDlg::~CWiFiProtEnterPinDlg()
       
    53     {
       
    54     STATIC_CAST( CEikServAppUi*, 
       
    55                 CCoeEnv::Static()->AppUi() )->SuppressAppSwitching( EFalse );
       
    56     }
       
    57 
       
    58 // --------------------------------------------------------------------------
       
    59 // CWiFiProtInitiateEasySetupDlg::ProcessCommandL()
       
    60 // --------------------------------------------------------------------------
       
    61 //    
       
    62 void CWiFiProtEnterPinDlg::ProcessCommandL( TInt aCommandId )
       
    63     {
       
    64     switch ( aCommandId )
       
    65         {
       
    66         case EWiFiSoftkeyContinue: 
       
    67             {
       
    68             TryExitL(aCommandId);           
       
    69             break;              
       
    70             }
       
    71         default:
       
    72             {
       
    73             CAknQueryDialog::ProcessCommandL( aCommandId );
       
    74             break;
       
    75             }
       
    76         }    
       
    77     }
       
    78 
       
    79 // --------------------------------------------------------------------------
       
    80 // CWiFiProtEnterPinDlg::OkToExitL
       
    81 // --------------------------------------------------------------------------
       
    82 //
       
    83 TBool CWiFiProtEnterPinDlg::OkToExitL( TInt aButtonId )
       
    84     {
       
    85     if (aButtonId == EAknSoftkeyEmpty)
       
    86         {
       
    87         return EFalse;
       
    88         }
       
    89     else
       
    90         {
       
    91         TInt status = KErrCancel;
       
    92         if (   aButtonId == EAknSoftkeyOk
       
    93             || aButtonId == EAknSoftkeyYes
       
    94             || aButtonId == EAknSoftkeyDone
       
    95             || aButtonId == EWiFiSoftkeyContinue )
       
    96             {
       
    97             status = KErrNone;
       
    98             }
       
    99         iActiveRunnerCallback.PinQueryExitL( status );
       
   100         return ETrue;
       
   101         }
       
   102     }
       
   103     
       
   104     
       
   105 // --------------------------------------------------------------------------
       
   106 // CWiFiProtEnterPinDlg::PreLayoutDynInitL()
       
   107 // --------------------------------------------------------------------------
       
   108 //
       
   109 void CWiFiProtEnterPinDlg::PreLayoutDynInitL()
       
   110     {
       
   111     CAknQueryDialog::PreLayoutDynInitL();
       
   112     STATIC_CAST( CEikServAppUi*, 
       
   113                 CCoeEnv::Static()->AppUi() )->SuppressAppSwitching( ETrue );
       
   114     }
       
   115 
       
   116 // --------------------------------------------------------------------------
       
   117 // CWiFiProtEnterPinDlg::RemoveCancel
       
   118 // --------------------------------------------------------------------------
       
   119 //
       
   120 void CWiFiProtEnterPinDlg::RemoveCancel()
       
   121     {
       
   122     CEikButtonGroupContainer& cba = ButtonGroupContainer();
       
   123     TRAP_IGNORE( cba.SetCommandL( CEikButtonGroupContainer::ERightSoftkeyPosition,
       
   124                      EAknSoftkeyEmpty, KNullDesC) );
       
   125     cba.DrawNow();                           
       
   126     }
       
   127 
       
   128 // End of File