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