uiservicetab/vimpstcmdprocess/src/cvimpstcmdcancellogin.cpp
branchRCL_3
changeset 22 3104fc151679
parent 21 2b7283837edb
child 23 9a48e301e94b
equal deleted inserted replaced
21:2b7283837edb 22:3104fc151679
     1 /*
       
     2 * Copyright (c) 2008 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 "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:  cancel login command implementation 
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 // INCLUDE FILES
       
    20 
       
    21 #include "cvimpstcmdcancellogin.h"
       
    22 
       
    23 #include "vimpstcmd.hrh"
       
    24 #include "mvimpstcmdobserver.h"
       
    25 
       
    26 #include "uiservicetabtracer.h"
       
    27 
       
    28 #include <e32def.h>
       
    29 #include "mvimpstengine.h"
       
    30 
       
    31 
       
    32 // --------------------------------------------------------------------------
       
    33 // CVIMPSTCmdLogout::CVIMPSTCmdLogout
       
    34 // --------------------------------------------------------------------------
       
    35 //
       
    36 CVIMPSTCmdCancelLogin::CVIMPSTCmdCancelLogin( const TInt aCommandId, 
       
    37         MVIMPSTEngine& aEngine) :     
       
    38         iCommandId( aCommandId ),
       
    39         iEngine(aEngine)
       
    40         {
       
    41         }
       
    42 
       
    43 // --------------------------------------------------------------------------
       
    44 // CVIMPSTCmdCancelLogin::~CVIMPSTCmdCancelLogin
       
    45 // --------------------------------------------------------------------------
       
    46 //
       
    47 CVIMPSTCmdCancelLogin::~CVIMPSTCmdCancelLogin()
       
    48     {    
       
    49     }
       
    50 
       
    51 // --------------------------------------------------------------------------
       
    52 // CVIMPSTCmdCancelLogin::NewL
       
    53 // --------------------------------------------------------------------------
       
    54 //
       
    55 CVIMPSTCmdCancelLogin* CVIMPSTCmdCancelLogin::NewL( 
       
    56         const TInt aCommandId,
       
    57         MVIMPSTEngine& aEngine)
       
    58     {
       
    59     // return the object created 
       
    60    
       
    61     TRACER_AUTO;
       
    62     return  new (ELeave ) CVIMPSTCmdCancelLogin( aCommandId , aEngine);
       
    63     }
       
    64 
       
    65 // --------------------------------------------------------------------------
       
    66 // CVIMPSTCmdCancelLogin::ExecuteLD
       
    67 // --------------------------------------------------------------------------
       
    68 //
       
    69 void CVIMPSTCmdCancelLogin::ExecuteLD()
       
    70     {
       
    71    	
       
    72     TRACER_AUTO;
       
    73     //push to the cleanupstack
       
    74     CleanupStack::PushL( this );    
       
    75     
       
    76     // now  call logout for cancel login
       
    77     // protocol adaptation has to take care of this 
       
    78     iEngine.LogoutL();	
       
    79     
       
    80 
       
    81     if(iObserver)
       
    82 	    {
       
    83 	    iObserver->CommandFinishedL(*this);
       
    84 	    }
       
    85 		
       
    86 	CleanupStack::PopAndDestroy();	
       
    87 	
       
    88     }
       
    89 
       
    90 
       
    91 // --------------------------------------------------------------------------
       
    92 // CVIMPSTCmdCancelLogin::AddObserver
       
    93 // --------------------------------------------------------------------------
       
    94 //
       
    95 void CVIMPSTCmdCancelLogin::AddObserver( MVIMPSTCmdObserver& aObserver )
       
    96     {
       
    97     // store the observer to notify the command completion
       
    98     iObserver = &aObserver;
       
    99     }
       
   100 
       
   101 
       
   102 // --------------------------------------------------------------------------
       
   103 // CVIMPSTCmdCancelLogin::CommandId
       
   104 // --------------------------------------------------------------------------
       
   105 //
       
   106 TInt CVIMPSTCmdCancelLogin::CommandId() const
       
   107 	{
       
   108 	return iCommandId;	
       
   109 	}
       
   110 
       
   111 // --------------------------------------------------------------------------
       
   112 // CVIMPSTCmdCancelLogin::Result
       
   113 // --------------------------------------------------------------------------
       
   114 //
       
   115 TInt CVIMPSTCmdCancelLogin::Result() const
       
   116 	{
       
   117 	// return KErrNone since iEngine.Logout() doesnot return any error value
       
   118 	return KErrNone;
       
   119 	}
       
   120 
       
   121 // End of File