uiservicetab/vimpstengine/src/cvimpstenginecvlistener.cpp
branchRCL_3
changeset 14 9fdee5e1da30
parent 11 bef90b82da71
equal deleted inserted replaced
13:796276a1bdcc 14:9fdee5e1da30
    20 #include "cvimpstenginecvlistener.h"
    20 #include "cvimpstenginecvlistener.h"
    21 #include "cvimpststoragemanagerfactory.h"
    21 #include "cvimpststoragemanagerfactory.h"
    22 #include "mvimpststorageserviceview.h"
    22 #include "mvimpststorageserviceview.h"
    23 #include "mvimpststoragecontact.h"
    23 #include "mvimpststoragecontact.h"
    24 #include "cvimpstengineservicetablefetcher.h"
    24 #include "cvimpstengineservicetablefetcher.h"
    25 #include "vimpstdebugtrace.h"
    25 #include "uiservicetabtracer.h"
    26 
    26 
    27 //system includes
    27 //system includes
    28 #include <e32base.h>
    28 #include <e32base.h>
    29 #include <MVPbkContactLink.h>
    29 #include <MVPbkContactLink.h>
    30 
    30 
    47 // CVIMPSTEngineCVListener::ConstructL
    47 // CVIMPSTEngineCVListener::ConstructL
    48 // --------------------------------------------------------------------------
    48 // --------------------------------------------------------------------------
    49 //
    49 //
    50 void CVIMPSTEngineCVListener::ConstructL()
    50 void CVIMPSTEngineCVListener::ConstructL()
    51     {
    51     {
    52     TRACE( T_LIT("CVIMPSTEngineCVListener::ConstructL() start"));
    52 	TRACER_AUTO;
       
    53     
    53     // subscribing for the property published by conversation view.
    54     // subscribing for the property published by conversation view.
    54     // attach the properties.
    55     // attach the properties.
    55     User::LeaveIfError( iProperty.Attach(KConvViewUID,KXspIdServiceIDKey  ) );
    56     User::LeaveIfError( iProperty.Attach(KConvViewUID,KXspIdServiceIDKey  ) );
    56     //start listening property published by CV (to get Contact link and Display name.).
    57     //start listening property published by CV (to get Contact link and Display name.).
    57     iProperty.Subscribe( iStatus );
    58     iProperty.Subscribe( iStatus );
    58     SetActive();
    59     SetActive();
    59     TRACE( T_LIT("CVIMPSTEngineCVListener::ConstructL() end"));
       
    60     }
    60     }
    61 
    61 
    62 // --------------------------------------------------------------------------
    62 // --------------------------------------------------------------------------
    63 // CVIMPSTEngineCVListener::NewL
    63 // CVIMPSTEngineCVListener::NewL
    64 // --------------------------------------------------------------------------
    64 // --------------------------------------------------------------------------
    86 // CVIMPSTEngineCVListener::RunL()
    86 // CVIMPSTEngineCVListener::RunL()
    87 // ---------------------------------------------------------
    87 // ---------------------------------------------------------
    88 //
    88 //
    89 void CVIMPSTEngineCVListener::RunL()
    89 void CVIMPSTEngineCVListener::RunL()
    90     {
    90     {
    91     TRACE( T_LIT("CVIMPSTEngineCVListener::RunL() start"));
    91 	TRACER_AUTO;
    92     // resubscribe before processing new value to prevent missing updates
    92     // resubscribe before processing new value to prevent missing updates
    93     //TBuf <KMaxSerIdXspIdLen> serId_usrId;
    93     //TBuf <KMaxSerIdXspIdLen> serId_usrId;
    94     HBufC16* serId_usrId = HBufC16::NewLC(KMaxSerIdXspIdLen);
    94     HBufC16* serId_usrId = HBufC16::NewLC(KMaxSerIdXspIdLen);
    95     if ( serId_usrId )
    95     if ( serId_usrId )
    96         {
    96         {
   155                 userDetailsPtr.Append(KDelimiter());
   155                 userDetailsPtr.Append(KDelimiter());
   156                 userDetailsPtr.Append(*dispName);
   156                 userDetailsPtr.Append(*dispName);
   157                 userDetailsPtr.Append(KDelimiter());
   157                 userDetailsPtr.Append(KDelimiter());
   158                 userDetailsPtr.Append( *contactLink );
   158                 userDetailsPtr.Append( *contactLink );
   159                 
   159                 
   160                 TRACE( T_LIT("CVIMPSTEngineCVListener::RunL publishing = %S"),&(*userDetails));        
   160                 TRACE( " publishing = %S",&(*userDetails)); 
   161                 
   161                 
   162                 iProperty.Set(KConvViewUID,KContactLinkDisplayNameKey,*userDetails);
   162                 iProperty.Set(KConvViewUID,KContactLinkDisplayNameKey,*userDetails);
   163                 CleanupStack::PopAndDestroy(3);//userDetails,contactLink,dispName
   163                 CleanupStack::PopAndDestroy(3);//userDetails,contactLink,dispName
   164               
   164               
   165                 }
   165                 }
   166             // contact not found
   166             // contact not found
   167             else
   167             else
   168                 {
   168                 {
   169                 TRACE( T_LIT("CVIMPSTEngineCVListener::RunL publishing null display name"));        
   169             TRACE( "publishing null display name"); 
   170                 iProperty.Set(KConvViewUID,KContactLinkDisplayNameKey,KNullDesC());
   170                 iProperty.Set(KConvViewUID,KContactLinkDisplayNameKey,KNullDesC());
   171                 }
   171                 }
   172             }
   172             }
   173         CleanupStack::PopAndDestroy( &supportedServices );
   173         CleanupStack::PopAndDestroy( &supportedServices );
   174         }
   174         }
   177     		{
   177     		{
   178     		CleanupStack::PopAndDestroy( serId_usrId );
   178     		CleanupStack::PopAndDestroy( serId_usrId );
   179     		}  
   179     		}  
   180     iProperty.Subscribe( iStatus );
   180     iProperty.Subscribe( iStatus );
   181     SetActive();
   181     SetActive();
   182     TRACE( T_LIT("CVIMPSTEngineCVListener::RunL() end"));
       
   183     }
   182     }
   184 
   183 
   185 // ---------------------------------------------------------
   184 // ---------------------------------------------------------
   186 // CVIMPSTEngineCVListener::RunL()
   185 // CVIMPSTEngineCVListener::RunL()
   187 // ---------------------------------------------------------
   186 // ---------------------------------------------------------
   188 //
   187 //
   189 void CVIMPSTEngineCVListener::DoCancel()
   188 void CVIMPSTEngineCVListener::DoCancel()
   190     {    
   189     {    
   191     TRACE( T_LIT("CVIMPSTEngineCVListener::DoCancel() start"));
   190 	TRACER_AUTO;
   192     iProperty.Cancel();
   191     iProperty.Cancel();
   193     }
   192     }
   194   		     
   193   		     
   195 // ---------------------------------------------------------
   194 // ---------------------------------------------------------
   196 // CIMCVEngineStorageListener::StopListening()
   195 // CIMCVEngineStorageListener::StopListening()
   197 // ---------------------------------------------------------
   196 // ---------------------------------------------------------
   198 //
   197 //
   199 TInt CVIMPSTEngineCVListener::RunError( TInt aError )
   198 TInt CVIMPSTEngineCVListener::RunError( TInt aError )
   200     {
   199     {
   201     TRACE( T_LIT("CVIMPSTEngineCVListener::RunError() start"));
   200     TRACER_AUTO;
   202     if ( KErrCancel != aError )
   201     if ( KErrCancel != aError )
   203         {
   202         {
   204         iProperty.Subscribe( iStatus );
   203         iProperty.Subscribe( iStatus );
   205         SetActive();
   204         SetActive();
   206         }
   205         }