uiservicetab/vimpststorage/src/cvimpststorageactivehandler.cpp
branchRCL_3
changeset 14 9fdee5e1da30
parent 0 5e5d6b214f4f
equal deleted inserted replaced
13:796276a1bdcc 14:9fdee5e1da30
    18 
    18 
    19 // INCLUDE FILES
    19 // INCLUDE FILES
    20 #include "cvimpststorageactivehandler.h"
    20 #include "cvimpststorageactivehandler.h"
    21 #include "mvimpststorageactiveobserver.h"
    21 #include "mvimpststorageactiveobserver.h"
    22 
    22 
    23 #include "vimpstdebugtrace.h"
    23 #include "uiservicetabtracer.h"
    24 #include <e32base.h>
    24 #include <e32base.h>
    25 
    25 
    26 // CONSTANTS
    26 // CONSTANTS
    27 const TInt KTimeToWaitBeforeRefresh( 1000000 ); // 1 seconds in microseconds
    27 const TInt KTimeToWaitBeforeRefresh( 1000000 ); // 1 seconds in microseconds
    28 // ============================ MEMBER FUNCTIONS ===============================
    28 // ============================ MEMBER FUNCTIONS ===============================
    57 // -----------------------------------------------------------------------------
    57 // -----------------------------------------------------------------------------
    58 //
    58 //
    59 CVIMPSTStorageActiveHandler* CVIMPSTStorageActiveHandler::NewL( 
    59 CVIMPSTStorageActiveHandler* CVIMPSTStorageActiveHandler::NewL( 
    60 					MVIMPSTStorageActiveObserver* aObserver )
    60 					MVIMPSTStorageActiveObserver* aObserver )
    61     {
    61     {
       
    62 	TRACER_AUTO;
    62     CVIMPSTStorageActiveHandler* self = new( ELeave ) CVIMPSTStorageActiveHandler( aObserver );
    63     CVIMPSTStorageActiveHandler* self = new( ELeave ) CVIMPSTStorageActiveHandler( aObserver );
    63 	CleanupStack::PushL( self );
    64 	CleanupStack::PushL( self );
    64     self->ConstructL();
    65     self->ConstructL();
    65     CleanupStack::Pop( self );
    66     CleanupStack::Pop( self );
    66 	return self;
    67 	return self;
    79 void CVIMPSTStorageActiveHandler::IssueRequest(TVIMPSTEnums::TVIMPSTStorgaeEventType aType,
    80 void CVIMPSTStorageActiveHandler::IssueRequest(TVIMPSTEnums::TVIMPSTStorgaeEventType aType,
    80 											  MVIMPSTStorageContactList *aList,
    81 											  MVIMPSTStorageContactList *aList,
    81 					                          MVIMPSTStorageContact* aContact,
    82 					                          MVIMPSTStorageContact* aContact,
    82 					                          TInt aContactIndex )
    83 					                          TInt aContactIndex )
    83 	{
    84 	{
    84 	TRACE( T_LIT("CVIMPSTStorageActiveHandler::IssueRequest() begin") );
    85 	TRACER_AUTO;
    85 	
    86 	
    86 	 if( IsActive() )
    87 	 if( IsActive() )
    87         {
    88         {
    88         Cancel();
    89         Cancel();
    89         }
    90         }
    92   
    93   
    93 	iEventType = aType ;
    94 	iEventType = aType ;
    94 	iList = aList ; 
    95 	iList = aList ; 
    95 	iContact = aContact ;
    96 	iContact = aContact ;
    96 	iContactIndex = aContactIndex;
    97 	iContactIndex = aContactIndex;
    97 	TRACE( T_LIT("CVIMPSTStorageActiveHandler::IssueRequest() end") );
       
    98 	}
    98 	}
    99 
    99 
   100 // -----------------------------------------------------------------------------
   100 // -----------------------------------------------------------------------------
   101 // CVIMPSTStorageActiveHandler::RunL
   101 // CVIMPSTStorageActiveHandler::RunL
   102 // Derived from CActive
   102 // Derived from CActive
   103 // -----------------------------------------------------------------------------
   103 // -----------------------------------------------------------------------------
   104 //
   104 //
   105 void CVIMPSTStorageActiveHandler::RunL()
   105 void CVIMPSTStorageActiveHandler::RunL()
   106 	{
   106 	{
   107 	TRACE( T_LIT("CVIMPSTStorageActiveHandler::RunL() begin") );
   107 	TRACER_AUTO;
   108 	if( iObserver )
   108 	if( iObserver )
   109 		{
   109 		{
   110 		TRACE( T_LIT("CVIMPSTStorageActiveHandler::RunL() send notification") );
   110 	TRACE( "send notification" );
   111 		TInt status( iStatus.Int() );
   111 		TInt status( iStatus.Int() );
   112 	    if( status != KErrCancel )
   112 	    if( status != KErrCancel )
   113             {
   113             {
   114 		    iObserver->HandleDelayedNotificationL(iEventType,
   114 		    iObserver->HandleDelayedNotificationL(iEventType,
   115 											iList ,
   115 											iList ,
   116 											iContact,
   116 											iContact,
   117 											iContactIndex );
   117 											iContactIndex );
   118             }
   118             }
   119             
   119             
   120         
   120         
   121 		TRACE( T_LIT("CVIMPSTStorageActiveHandler::RunL() notification sent") );
   121 	    TRACE( " notification sent" );
   122 		}
   122 		}
   123     TRACE( T_LIT("CVIMPSTStorageActiveHandler::RunL() end") );
       
   124 	}
   123 	}
   125 
   124 
   126 // ---------------------------------------------------------
   125 // ---------------------------------------------------------
   127 // CVIMPSTStorageActiveHandler::RunError
   126 // CVIMPSTStorageActiveHandler::RunError
   128 // Derived from CActive
   127 // Derived from CActive
   129 // ---------------------------------------------------------
   128 // ---------------------------------------------------------
   130 //
   129 //
   131 TInt CVIMPSTStorageActiveHandler::RunError( TInt aError )
   130 TInt CVIMPSTStorageActiveHandler::RunError( TInt aError )
   132 	{
   131 	{
   133 	TRACE( T_LIT("CVIMPSTStorageActiveHandler::RunError() begin") );
   132 	TRACER_AUTO;
   134 	if( iObserver )
   133 	if( iObserver )
   135 		{
   134 		{
   136 	    TRAP_IGNORE( iObserver->HandleDelayedNotificationL(iEventType,
   135 	    TRAP_IGNORE( iObserver->HandleDelayedNotificationL(iEventType,
   137 											iList ,
   136 											iList ,
   138 											iContact,
   137 											iContact,
   139 											iContactIndex ) );
   138 											iContactIndex ) );
   140         }
   139         }
   141     TRACE( T_LIT("CVIMPSTStorageActiveHandler::RunError() End ") );
       
   142 	return aError;
   140 	return aError;
   143 	}
   141 	}
   144 // ---------------------------------------------------------
   142 // ---------------------------------------------------------
   145 // CVIMPSTStorageActiveHandler::DoCancel
   143 // CVIMPSTStorageActiveHandler::DoCancel
   146 // Derived from CActive
   144 // Derived from CActive