convergedcallengine/cce/src/cccecallcontainer.cpp
changeset 12 ae8abd0db65c
parent 0 ff3b6d0fd310
child 31 a2467631ae02
equal deleted inserted replaced
0:ff3b6d0fd310 12:ae8abd0db65c
    59 // Construct object
    59 // Construct object
    60 // ---------------------------------------------------------------------------
    60 // ---------------------------------------------------------------------------
    61 //
    61 //
    62 void CCCECallContainer::ConstructL()
    62 void CCCECallContainer::ConstructL()
    63     {
    63     {
    64 	FeatureManager::InitializeLibL();
    64     FeatureManager::InitializeLibL();
    65     iCallStateMediator = CCCECallInfoMediator::NewL( *this );
    65     iCallStateMediator = CCCECallInfoMediator::NewL( *this );
    66     
    66     
    67     CreateCallDataArraysL();
    67     CreateCallDataArraysL();
    68  
    68  
    69     iTransferController = CCCETransferController::NewL( *this );
    69     iTransferController = CCCETransferController::NewL( *this );
   168 // Is called after handover, when call type has changed
   168 // Is called after handover, when call type has changed
   169 // -----------------------------------------------------------------------------
   169 // -----------------------------------------------------------------------------
   170 //
   170 //
   171 void CCCECallContainer::AirTimeDurationSwap(
   171 void CCCECallContainer::AirTimeDurationSwap(
   172                            const CCPCall::TCallType aNewCallType)
   172                            const CCPCall::TCallType aNewCallType)
   173 	{
   173     {
   174     CCELOGSTRING("CCCECallContainer::AirTimeDurationSwap(): IN");
   174     CCELOGSTRING("CCCECallContainer::AirTimeDurationSwap(): IN");
   175     
   175     
   176     CCCECall* call = NULL;
   176     CCCECall* call = NULL;
   177     TInt calls(0);
   177     TInt calls(0);
   178     for ( TInt i = 0; i < KCCECallObjects; i++ )
   178     for ( TInt i = 0; i < KCCECallObjects; i++ )
   189         {
   189         {
   190         calls ++;
   190         calls ++;
   191         }
   191         }
   192     
   192     
   193     if( 1 == calls )
   193     if( 1 == calls )
   194     	{
   194         {
   195     	// After handover we will have only one active call
   195         // After handover we will have only one active call
   196     	// If we have more or less, timer swapping will not happend
   196         // If we have more or less, timer swapping will not happend
   197 	    if (aNewCallType == CCPCall::ECallTypePS )
   197         if (aNewCallType == CCPCall::ECallTypePS )
   198 	    	{
   198             {
   199 	    	CCELOGSTRING2("CCCECallContainer::AirTimeDurationSwap(): CS Stops, PS restarts from %d",
   199             CCELOGSTRING2("CCCECallContainer::AirTimeDurationSwap(): CS Stops, PS restarts from %d",
   200 	    			iCSDuration->NumberOfBeats() );
   200                     iCSDuration->NumberOfBeats() );
   201 	    	iCSDuration->Stop();
   201             iCSDuration->Stop();
   202 	    	iPSDuration->RestartAirTimeDuration(iCSDuration->NumberOfBeats());
   202             iPSDuration->RestartAirTimeDuration(iCSDuration->NumberOfBeats());
   203 	    	iCSDuration->Reset();
   203             iCSDuration->Reset();
   204 	    	}
   204             }
   205 	    else
   205         else
   206 	    	{
   206             {
   207 	    	CCELOGSTRING2("CCCECallContainer::AirTimeDurationSwap(): PS Stops, CS restarts from %d",
   207             CCELOGSTRING2("CCCECallContainer::AirTimeDurationSwap(): PS Stops, CS restarts from %d",
   208 	    			iPSDuration->NumberOfBeats() );
   208                     iPSDuration->NumberOfBeats() );
   209 	    	iPSDuration->Stop();
   209             iPSDuration->Stop();
   210 	    	iCSDuration->RestartAirTimeDuration(iPSDuration->NumberOfBeats());
   210             iCSDuration->RestartAirTimeDuration(iPSDuration->NumberOfBeats());
   211 	    	iPSDuration->Reset();
   211             iPSDuration->Reset();
   212 	    	}
   212             }
   213     	}
   213         }
   214     CCELOGSTRING("CCCECallContainer::AirTimeDurationSwap(): OUT");
   214     CCELOGSTRING("CCCECallContainer::AirTimeDurationSwap(): OUT");
   215 	}
   215     }
   216 	
   216     
   217 // ---------------------------------------------------------------------------
   217 // ---------------------------------------------------------------------------
   218 // AirTimeDurationStop()
   218 // AirTimeDurationStop()
   219 // ---------------------------------------------------------------------------
   219 // ---------------------------------------------------------------------------
   220 //
   220 //
   221 void CCCECallContainer::AirTimeDurationStop( CCCECall* /*aCall*/ ) const
   221 void CCCECallContainer::AirTimeDurationStop( CCCECall* /*aCall*/ ) const
   292     for ( TInt i = 0; i < KCCECallObjects; i++ )
   292     for ( TInt i = 0; i < KCCECallObjects; i++ )
   293         {
   293         {
   294         call = GetCall( i );
   294         call = GetCall( i );
   295         if ( call->State() == CCPCall::EStateConnected ||
   295         if ( call->State() == CCPCall::EStateConnected ||
   296              call->State() == CCPCall::EStateHold  )
   296              call->State() == CCPCall::EStateHold  )
   297             { 	   
   297             {      
   298             if ( IsCsPlugin( call, EFalse ) )
   298             if ( IsCsPlugin( call, EFalse ) )
   299                 {
   299                 {
   300                 csCalls++;
   300                 csCalls++;
   301                 CCELOGSTRING2("   AirTimeDurationStart() csCalls=%d ", csCalls);
   301                 CCELOGSTRING2("   AirTimeDurationStart() csCalls=%d ", csCalls);
   302                 }
   302                 }
   983             if( iConferenceCall->EnumerateCalls() != 0 )
   983             if( iConferenceCall->EnumerateCalls() != 0 )
   984                 {
   984                 {
   985                 // Do nothing when there is only cscalls
   985                 // Do nothing when there is only cscalls
   986 
   986 
   987                 if ( IsCsPlugin( aCall, ETrue ) )
   987                 if ( IsCsPlugin( aCall, ETrue ) )
   988                 	{
   988                     {
   989                 	
   989                     
   990                     break;
   990                     break;
   991                     }
   991                     }
   992                     
   992                     
   993                 // If call or conferencecall isn`t cscall then do conference swap
   993                 // If call or conferencecall isn`t cscall then do conference swap
   994                 if( iConferenceCall->State() == MCCEConferenceCallObserver::ECCEConferenceHold &&
   994                 if( iConferenceCall->State() == MCCEConferenceCallObserver::ECCEConferenceHold &&
  1286 // -----------------------------------------------------------------------------
  1286 // -----------------------------------------------------------------------------
  1287 // GetLifeTime()
  1287 // GetLifeTime()
  1288 // -----------------------------------------------------------------------------
  1288 // -----------------------------------------------------------------------------
  1289 // 
  1289 // 
  1290 TBool CCCECallContainer::GetLifeTime( TDes8& aLifeTimeInfo )
  1290 TBool CCCECallContainer::GetLifeTime( TDes8& aLifeTimeInfo )
  1291 	{
  1291     {
  1292     CCELOGSTRING("CCCE::GetLifeTime()");
  1292     CCELOGSTRING("CCCE::GetLifeTime()");
  1293     
  1293     
  1294 	CConvergedCallProvider* plugin = NULL;
  1294     CConvergedCallProvider* plugin = NULL;
  1295 	
  1295     
  1296     TRAP_IGNORE( plugin = iPluginManager->GetPluginL(KCSServiceId));
  1296     TRAP_IGNORE( plugin = iPluginManager->GetPluginL(KCSServiceId));
  1297     
  1297     
  1298     if( plugin )
  1298     if( plugin )
  1299     	{
  1299         {
  1300     	plugin->GetLifeTime(aLifeTimeInfo);
  1300         plugin->GetLifeTime(aLifeTimeInfo);
  1301     	}
  1301         }
  1302 	else
  1302     else
  1303 		{
  1303         {
  1304     	CCELOGSTRING("CCCE::GetLifeTime() - CS plugin not found!");
  1304         CCELOGSTRING("CCCE::GetLifeTime() - CS plugin not found!");
  1305     	return EFalse;
  1305         return EFalse;
  1306 		}
  1306         }
  1307 
  1307 
  1308    	return ETrue;
  1308     return ETrue;
  1309     }
  1309     }
  1310 
  1310 
  1311 // -----------------------------------------------------------------------------
  1311 // -----------------------------------------------------------------------------
  1312 // GetCSInfo()
  1312 // GetCSInfo()
  1313 // -----------------------------------------------------------------------------
  1313 // -----------------------------------------------------------------------------
  1314 // 
  1314 // 
  1315 TBool CCCECallContainer::GetCSInfo( CSInfo& aCSInfo )
  1315 TBool CCCECallContainer::GetCSInfo( CSInfo& aCSInfo )
  1316 	{
  1316     {
  1317     CCELOGSTRING("CCCE::GetCSInfo()");
  1317     CCELOGSTRING("CCCE::GetCSInfo()");
  1318 
  1318 
  1319 	CConvergedCallProvider* plugin = NULL;
  1319     CConvergedCallProvider* plugin = NULL;
  1320 	
  1320     
  1321 	TRAP_IGNORE( plugin = iPluginManager->GetPluginL(KCSServiceId));
  1321     TRAP_IGNORE( plugin = iPluginManager->GetPluginL(KCSServiceId));
  1322         
  1322         
  1323     
  1323     
  1324     if( plugin )
  1324     if( plugin )
  1325     	{
  1325         {
  1326     	plugin->GetCSInfo(aCSInfo);
  1326         plugin->GetCSInfo(aCSInfo);
  1327     	}
  1327         }
  1328 	else
  1328     else
  1329 		{
  1329         {
  1330     	CCELOGSTRING("CCCE::GetCSInfo() - CS plugin not found!");
  1330         CCELOGSTRING("CCCE::GetCSInfo() - CS plugin not found!");
  1331     	return EFalse;
  1331         return EFalse;
  1332 		}
  1332         }
  1333 
  1333 
  1334    	return ETrue;
  1334     return ETrue;
  1335 	}
  1335     }
  1336 
  1336 
  1337 // ---------------------------------------------------------------------------
  1337 // ---------------------------------------------------------------------------
  1338 // CCCECallContainer::IsCsPlugin
  1338 // CCCECallContainer::IsCsPlugin
  1339 // ---------------------------------------------------------------------------
  1339 // ---------------------------------------------------------------------------
  1340 //
  1340 //