uiservicetab/vimpstcmdprocess/src/cvimpstcmdaddcontact.cpp
branchRCL_3
changeset 14 9fdee5e1da30
parent 0 5e5d6b214f4f
equal deleted inserted replaced
13:796276a1bdcc 14:9fdee5e1da30
    19 // INCLUDE FILES
    19 // INCLUDE FILES
    20 #include "cvimpstcmdaddcontact.h"
    20 #include "cvimpstcmdaddcontact.h"
    21 
    21 
    22 #include "vimpstcmd.hrh"
    22 #include "vimpstcmd.hrh"
    23 #include "mvimpstcmdobserver.h"
    23 #include "mvimpstcmdobserver.h"
    24 #include "vimpstdebugprint.h" 
    24 
    25 
    25 
    26 #include <e32def.h>
    26 #include <e32def.h>
    27 #include "mvimpstengine.h"
    27 #include "mvimpstengine.h"
    28 #include "mvimpstenginecontactmgmtextention.h"
    28 #include "mvimpstenginecontactmgmtextention.h"
    29 #include "mvimpstengineextentionfeatures.h"
    29 #include "mvimpstengineextentionfeatures.h"
    38 #include "tvimpstenums.h" 
    38 #include "tvimpstenums.h" 
    39 #include "tvimpstconsts.h"
    39 #include "tvimpstconsts.h"
    40 #include "mvimpstenginesubservice.h"
    40 #include "mvimpstenginesubservice.h"
    41 #include "mvimpstenginepresencesubservice.h"
    41 #include "mvimpstenginepresencesubservice.h"
    42 
    42 
       
    43 #include "uiservicetabtracer.h"
       
    44 
    43 // Constants
    45 // Constants
    44 _LIT( KListNameAllBuddy ,"buddylist" );
    46 _LIT( KListNameAllBuddy ,"buddylist" );
    45 
    47 
    46 // --------------------------------------------------------------------------
    48 // --------------------------------------------------------------------------
    47 // CVIMPSTCmdAddContact::CVIMPSTCmdAddContact
    49 // CVIMPSTCmdAddContact::CVIMPSTCmdAddContact
    52         MVIMPSTEngine& aEngine) :            
    54         MVIMPSTEngine& aEngine) :            
    53             iCommandId( aCommandId ),
    55             iCommandId( aCommandId ),
    54             iContactId( aContactId ),
    56             iContactId( aContactId ),
    55             iEngine(aEngine)
    57             iEngine(aEngine)
    56     {
    58     {
       
    59     TRACER_AUTO;
    57     }
    60     }
    58 
    61 
    59 // --------------------------------------------------------------------------
    62 // --------------------------------------------------------------------------
    60 // CVIMPSTCmdAddContact::~CVIMPSTCmdAddContact
    63 // CVIMPSTCmdAddContact::~CVIMPSTCmdAddContact
    61 // --------------------------------------------------------------------------
    64 // --------------------------------------------------------------------------
    62 //
    65 //
    63 CVIMPSTCmdAddContact::~CVIMPSTCmdAddContact()
    66 CVIMPSTCmdAddContact::~CVIMPSTCmdAddContact()
    64     {    
    67     {    
    65     
    68     TRACER_AUTO;
    66     }
    69     }
    67 
    70 
    68 // --------------------------------------------------------------------------
    71 // --------------------------------------------------------------------------
    69 // CVIMPSTCmdAddContact::NewL
    72 // CVIMPSTCmdAddContact::NewL
    70 // --------------------------------------------------------------------------
    73 // --------------------------------------------------------------------------
    71 //
    74 //
    72 CVIMPSTCmdAddContact* CVIMPSTCmdAddContact::NewL( 
    75 CVIMPSTCmdAddContact* CVIMPSTCmdAddContact::NewL( 
    73         const TInt aCommandId,const TDesC& aContactId,
    76         const TInt aCommandId,const TDesC& aContactId,
    74         MVIMPSTEngine& aEngine)
    77         MVIMPSTEngine& aEngine)
    75     {
    78     {
       
    79     TRACER_AUTO;
    76     CVIMPSTCmdAddContact* self = new (ELeave ) CVIMPSTCmdAddContact( aCommandId ,aContactId, aEngine);
    80     CVIMPSTCmdAddContact* self = new (ELeave ) CVIMPSTCmdAddContact( aCommandId ,aContactId, aEngine);
    77     self->ConstructL(); //use contsurctL if necessary
    81     self->ConstructL(); //use contsurctL if necessary
    78     return self;
    82     return self;
    79     }
    83     }
    80 // --------------------------------------------------------------------------
    84 // --------------------------------------------------------------------------
    81 // CVIMPSTCmdAddContact::ConstructL
    85 // CVIMPSTCmdAddContact::ConstructL
    82 // --------------------------------------------------------------------------
    86 // --------------------------------------------------------------------------
    83 //
    87 //
    84 void CVIMPSTCmdAddContact::ConstructL()
    88 void CVIMPSTCmdAddContact::ConstructL()
    85     {    
    89     {
       
    90     TRACER_AUTO;
    86     iError = KErrNone;
    91     iError = KErrNone;
    87     }
    92     }
    88 
    93 
    89 // --------------------------------------------------------------------------
    94 // --------------------------------------------------------------------------
    90 // CVIMPSTCmdAddContact::ExecuteLD
    95 // CVIMPSTCmdAddContact::ExecuteLD
    91 // --------------------------------------------------------------------------
    96 // --------------------------------------------------------------------------
    92 //
    97 //
    93 void CVIMPSTCmdAddContact::ExecuteLD()
    98 void CVIMPSTCmdAddContact::ExecuteLD()
    94     {
    99     {
    95    	CHAT_DP_FUNC_ENTER("CVIMPSTEnableServiceCmd::ExecuteLD");
   100    
       
   101     TRACER_AUTO;
    96     //push to the cleanupstack
   102     //push to the cleanupstack
    97     CleanupStack::PushL( this );
   103     CleanupStack::PushL( this );
    98     MVIMPSTStorageServiceView* storage = CVIMPSTStorageManagerFactory::ContactListInterfaceL(iEngine.ServiceId()) ;
   104     MVIMPSTStorageServiceView* storage = CVIMPSTStorageManagerFactory::ContactListInterfaceL(iEngine.ServiceId()) ;
    99     if(storage )
   105     if(storage )
   100         {
   106         {
   133 	        {
   139 	        {
   134 	        iError = EErrExistInBlockList;		
   140 	        iError = EErrExistInBlockList;		
   135 	        }
   141 	        }
   136         }//End  if(storage)
   142         }//End  if(storage)
   137    			
   143    			
   138     CHAT_DP_FUNC_ENTER("CVIMPSTEnableServiceCmd:: CommandFinished");
   144     
   139 
   145 
   140     if(iObserver)
   146     if(iObserver)
   141 	    {
   147 	    {
   142 	    iObserver->CommandFinishedL(*this);
   148 	    iObserver->CommandFinishedL(*this);
   143 	    }
   149 	    }
   144 	CHAT_DP_FUNC_ENTER("CVIMPSTEnableServiceCmd:: CommandFinished");	
   150 		
   145 	CleanupStack::PopAndDestroy();	
   151 	CleanupStack::PopAndDestroy();	
   146 	CHAT_DP_FUNC_DONE("CVIMPSTEnableServiceCmd::ExecuteLD");	
   152 	
   147     }
   153     }
   148 
   154 
   149 // --------------------------------------------------------------------------
   155 // --------------------------------------------------------------------------
   150 // CVIMPSTCmdAddContact::IsContactBlocked
   156 // CVIMPSTCmdAddContact::IsContactBlocked
   151 // --------------------------------------------------------------------------
   157 // --------------------------------------------------------------------------
   152 TBool CVIMPSTCmdAddContact::IsContactBlocked(const TDesC& aUserId)
   158 TBool CVIMPSTCmdAddContact::IsContactBlocked(const TDesC& aUserId)
   153 	{
   159 	{
       
   160 	TRACER_AUTO;
       
   161 	TRACE("userId: %S", &aUserId);
   154    	MVIMPSTEngineSubService* subService =    	   
   162    	MVIMPSTEngineSubService* subService =    	   
   155    	   					(iEngine.SubService(TVIMPSTEnums::EPresence));
   163    	   					(iEngine.SubService(TVIMPSTEnums::EPresence));
   156     if(subService)
   164     if(subService)
   157         {
   165         {
   158         MVIMPSTEnginePresenceSubService& presence = 
   166         MVIMPSTEnginePresenceSubService& presence =