wlansecuritysettings/wlaneapsettingsui/EapMschapv2/NotifierUi/src/MsChapv2NotifDialog.cpp
branchRCL_3
changeset 19 c74b3d9f6b9e
equal deleted inserted replaced
18:bad0cc58d154 19:c74b3d9f6b9e
       
     1 /*
       
     2 * Copyright (c) 2001-2010 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 dialog class of MsChapv2NotifDlg
       
    15 *
       
    16 */
       
    17 
       
    18 /*
       
    19 * %version: 18 %
       
    20 */
       
    21 
       
    22 // INCLUDE FILES
       
    23 #include <mschapv2notifdlgui.rsg>
       
    24 #include "MsChapv2NotifDlgPlugin.h"
       
    25 #include "MsChapv2NotifDialog.h"
       
    26 
       
    27 
       
    28 // ============================ MEMBER FUNCTIONS ===============================
       
    29 
       
    30 // -----------------------------------------------------------------------------
       
    31 // CMsChapv2Dialog::CMsChapv2Dialog
       
    32 // -----------------------------------------------------------------------------
       
    33 //
       
    34 CMsChapv2Dialog::CMsChapv2Dialog( CMsChapv2DialogPlugin* aPlugin, TBool aUsernameExists )
       
    35 : CAknMultiLineDataQueryDialog( ENoTone ), 
       
    36   iPlugin( aPlugin ),
       
    37   iUsernameExists( aUsernameExists )
       
    38     {
       
    39     }
       
    40 
       
    41 
       
    42 // -----------------------------------------------------------------------------
       
    43 // CMsChapv2Dialog::NewL
       
    44 // -----------------------------------------------------------------------------
       
    45 //
       
    46 CMsChapv2Dialog* CMsChapv2Dialog::NewL( TDes& aUsername, TDes& aPassword,
       
    47                                         CMsChapv2DialogPlugin* aPlugin )
       
    48     {
       
    49     CMsChapv2Dialog* self = new( ELeave ) CMsChapv2Dialog( aPlugin, aUsername.Length() > 0 );
       
    50     CleanupStack::PushL( self );
       
    51     if ( aUsername.Length() )
       
    52         {
       
    53         self->SetDataL( aUsername, aPassword );
       
    54         }
       
    55 
       
    56     CleanupStack::Pop( self );
       
    57     return self;
       
    58     }
       
    59 
       
    60 
       
    61 // -----------------------------------------------------------------------------
       
    62 // CMsChapv2Dialog::ConstructL
       
    63 // -----------------------------------------------------------------------------
       
    64 //
       
    65 void CMsChapv2Dialog::ConstructL()
       
    66     {
       
    67     }
       
    68 
       
    69 
       
    70 // -----------------------------------------------------------------------------
       
    71 // CMsChapv2Dialog::~CMsChapv2Dialog
       
    72 // -----------------------------------------------------------------------------
       
    73 //
       
    74 CMsChapv2Dialog::~CMsChapv2Dialog()
       
    75     {
       
    76     }
       
    77 
       
    78 
       
    79 // -----------------------------------------------------------------------------
       
    80 // CMsChapv2Dialog::OkToExitL
       
    81 // -----------------------------------------------------------------------------
       
    82 //
       
    83 TBool CMsChapv2Dialog::OkToExitL( TInt aButtonId )
       
    84     {
       
    85     if ( CAknMultiLineDataQueryDialog::OkToExitL( aButtonId ) )
       
    86         {
       
    87         if ( aButtonId == EAknSoftkeyOk )
       
    88             {
       
    89             CAknMultilineQueryControl* firstControl = FirstControl();
       
    90             firstControl->GetText( iPlugin->GetUsername() );
       
    91 
       
    92             CAknMultilineQueryControl* secondControl = SecondControl();
       
    93             secondControl->GetText( iPlugin->GetPassword() );
       
    94         
       
    95             _LIT( KEmpty, "" );     // Empty string
       
    96 
       
    97             // Empty when we are not changing password
       
    98             iPlugin->SetOldPassword( KEmpty );
       
    99                   
       
   100             iPlugin->CompleteL( KErrNone );
       
   101             return( ETrue );
       
   102             }
       
   103         else
       
   104             {
       
   105             iPlugin->CompleteL( KErrCancel );
       
   106             return( ETrue );
       
   107             }
       
   108         }
       
   109 
       
   110     return( EFalse );
       
   111     }
       
   112 
       
   113 
       
   114 // -----------------------------------------------------------------------------
       
   115 // CMsChapv2Dialog::HandleResourceChange
       
   116 // -----------------------------------------------------------------------------
       
   117 //
       
   118 void CMsChapv2Dialog::HandleResourceChange( TInt aType )
       
   119     {
       
   120     CAknMultiLineDataQueryDialog::HandleResourceChange( aType );
       
   121 
       
   122     if ( aType == KAknsMessageSkinChange )
       
   123         {
       
   124         }
       
   125     }
       
   126 
       
   127 
       
   128 // End of File