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