uiservicetab/vimpstcmdprocess/src/cvimpstcmdcloseconversation.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:  command process for close conversation
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 // INCLUDE FILES
       
    20 #include "cvimpstcmdcloseconversation.h"
       
    21 
       
    22 #include "vimpstcmd.hrh"
       
    23 #include "mvimpstcmdobserver.h"
       
    24 #include "vimpstdebugprint.h" 
       
    25 
       
    26 #include <e32def.h>
       
    27 #include "mvimpstengine.h"
       
    28 #include "mvimpstenginesubservice.h"
       
    29 #include "mvimpstengineimsubservice.h"
       
    30 
       
    31 // Constants
       
    32 
       
    33 // --------------------------------------------------------------------------
       
    34 // CVIMPSTCmdCloseConversation::CVIMPSTCmdCloseConversation
       
    35 // --------------------------------------------------------------------------
       
    36 //
       
    37 CVIMPSTCmdCloseConversation::CVIMPSTCmdCloseConversation( const TInt aCommandId,
       
    38                                                           const TDesC& aContactId,
       
    39                                                           MVIMPSTEngine& aEngine ):            
       
    40                                                           iCommandId( aCommandId ),
       
    41                                                           iContactId( aContactId ),
       
    42                                                           iEngine(aEngine)
       
    43     {
       
    44     }
       
    45 
       
    46 // --------------------------------------------------------------------------
       
    47 // CVIMPSTCmdCloseConversation::~CVIMPSTCmdCloseConversation
       
    48 // --------------------------------------------------------------------------
       
    49 //
       
    50 CVIMPSTCmdCloseConversation::~CVIMPSTCmdCloseConversation()
       
    51     {    
       
    52     
       
    53     }
       
    54 
       
    55 // --------------------------------------------------------------------------
       
    56 // CVIMPSTCmdCloseConversation::NewL
       
    57 // --------------------------------------------------------------------------
       
    58 //
       
    59 CVIMPSTCmdCloseConversation* CVIMPSTCmdCloseConversation::NewL( const TInt aCommandId,
       
    60                                                                 const TDesC& aContactId,
       
    61                                                                 MVIMPSTEngine& aEngine )
       
    62     {
       
    63     CVIMPSTCmdCloseConversation* self = new (ELeave ) CVIMPSTCmdCloseConversation( aCommandId ,aContactId, aEngine);
       
    64     self->ConstructL(); //use contsurctL if necessary
       
    65     return self;
       
    66     }
       
    67 // --------------------------------------------------------------------------
       
    68 // CVIMPSTCmdCloseConversation::ConstructL
       
    69 // --------------------------------------------------------------------------
       
    70 //
       
    71 void CVIMPSTCmdCloseConversation::ConstructL()
       
    72     {    
       
    73     iError = KErrNone;
       
    74     }
       
    75 
       
    76 // --------------------------------------------------------------------------
       
    77 // CVIMPSTCmdCloseConversation::ExecuteLD
       
    78 // --------------------------------------------------------------------------
       
    79 //
       
    80 void CVIMPSTCmdCloseConversation::ExecuteLD()
       
    81     {
       
    82     CHAT_DP_FUNC_ENTER("CVIMPSTCmdCloseConversation::ExecuteLD");
       
    83     //push to the cleanupstack
       
    84     CleanupStack::PushL( this );
       
    85     
       
    86     //Get IM SubService     
       
    87     MVIMPSTEngineSubService* subService1 =    	   
       
    88    	   			(iEngine.SubService(TVIMPSTEnums::EIM));
       
    89     
       
    90     if(subService1)
       
    91         {
       
    92         MVIMPSTEngineIMSubService& imSubService = 
       
    93         		MVIMPSTEngineIMSubService::Cast (*subService1);
       
    94         imSubService.CloseConversationL( iContactId );
       
    95         }
       
    96    
       
    97     if(iObserver)
       
    98         {
       
    99         iObserver->CommandFinishedL(*this);
       
   100         }
       
   101     
       
   102     CHAT_DP_FUNC_ENTER("CVIMPSTCmdCloseConversation:: CommandFinished");    
       
   103     CleanupStack::PopAndDestroy();  
       
   104     CHAT_DP_FUNC_DONE("CVIMPSTCmdCloseConversation::ExecuteLD");    
       
   105     }
       
   106 
       
   107 
       
   108 // --------------------------------------------------------------------------
       
   109 // CVIMPSTCmdCloseConversation::AddObserver
       
   110 // --------------------------------------------------------------------------
       
   111 //
       
   112 void CVIMPSTCmdCloseConversation::AddObserver( MVIMPSTCmdObserver& aObserver )
       
   113     {
       
   114     // store the observer to notify the command completion
       
   115     iObserver = &aObserver;
       
   116     }
       
   117 
       
   118 
       
   119 // --------------------------------------------------------------------------
       
   120 // CVIMPSTCmdCloseConversation::CommandId
       
   121 // --------------------------------------------------------------------------
       
   122 //
       
   123 TInt CVIMPSTCmdCloseConversation::CommandId() const
       
   124     {
       
   125     return iCommandId;  
       
   126     }
       
   127 
       
   128 // --------------------------------------------------------------------------
       
   129 // CVIMPSTCmdCloseConversation::Result
       
   130 // --------------------------------------------------------------------------
       
   131 //
       
   132 TInt CVIMPSTCmdCloseConversation::Result() const
       
   133     {
       
   134     //return valid data regd the command operation
       
   135     return iError;
       
   136     }
       
   137 
       
   138 // End of File