phoneapp/phoneuistates/src/cphoneconferenceandcallsetup.cpp
branchRCL_3
changeset 61 41a7f70b3818
parent 58 40a3f856b14d
child 62 5266b1f337bd
equal deleted inserted replaced
58:40a3f856b14d 61:41a7f70b3818
    50 // (other items were commented in a header).
    50 // (other items were commented in a header).
    51 // -----------------------------------------------------------
    51 // -----------------------------------------------------------
    52 //
    52 //
    53 CPhoneConferenceAndCallSetup::~CPhoneConferenceAndCallSetup()
    53 CPhoneConferenceAndCallSetup::~CPhoneConferenceAndCallSetup()
    54     {
    54     {
    55     // Need to check iViewCommandHandle validity here to not
       
    56     // trigger a high/can panic error in a Codescanner run.
       
    57     // coverity[var_compare_op]
       
    58     if ( iViewCommandHandle )
       
    59         {
       
    60         TPhoneCmdParamBoolean dtmfSendFlag;
       
    61         dtmfSendFlag.SetBoolean( EFalse );
       
    62         TRAP_IGNORE( iViewCommandHandle->ExecuteCommandL( EPhoneViewSetDtmfOptionsFlag, 
       
    63     	    &dtmfSendFlag ) );
       
    64         }
       
    65     }
    55     }
    66 
    56 
    67 // -----------------------------------------------------------
    57 // -----------------------------------------------------------
    68 // CPhoneConferenceAndCallSetup::ConstructL()
    58 // CPhoneConferenceAndCallSetup::ConstructL()
    69 // Constructor
    59 // Constructor
   107     {
    97     {
   108     __LOGMETHODSTARTEND(EPhoneControl, "CPhoneConferenceAndCallSetup::HandlePhoneEngineMessageL()");
    98     __LOGMETHODSTARTEND(EPhoneControl, "CPhoneConferenceAndCallSetup::HandlePhoneEngineMessageL()");
   109     switch ( aMessage )
    99     switch ( aMessage )
   110         {
   100         {
   111         case MEngineMonitor::EPEMessageConnecting:
   101         case MEngineMonitor::EPEMessageConnecting:
   112             {
       
   113             iAlerting = ETrue;
   102             iAlerting = ETrue;
   114             HandleConnectingL( aCallId );
   103             HandleConnectingL( aCallId );
   115             }
       
   116             break;
   104             break;
   117             
   105             
   118         case MEngineMonitor::EPEMessageConnected:
   106         case MEngineMonitor::EPEMessageConnected:
   119             {
       
   120             HandleConnectedL( aCallId );
   107             HandleConnectedL( aCallId );
   121             }
       
   122             break;
   108             break;
   123             
   109             
   124         case MEngineMonitor::EPEMessageIdle:
   110         case MEngineMonitor::EPEMessageIdle:
   125             {
       
   126             HandleIdleL( aCallId );
   111             HandleIdleL( aCallId );
   127             }
       
   128             break;
   112             break;
   129             
   113             
   130         case MEngineMonitor::EPEMessageConferenceIdle:
   114         case MEngineMonitor::EPEMessageConferenceIdle:
   131             {
       
   132             HandleConferenceIdleL();
   115             HandleConferenceIdleL();
   133             }
       
   134             break;
   116             break;
   135             
   117             
   136         default:
   118         default:
   137             {
       
   138             CPhoneConference::HandlePhoneEngineMessageL( aMessage, 
   119             CPhoneConference::HandlePhoneEngineMessageL( aMessage, 
   139                 aCallId );
   120                 aCallId );
   140             }
       
   141             break;
   121             break;
   142         }
   122         }
   143     }
   123     }
   144 
   124 
   145 // -----------------------------------------------------------
   125 // -----------------------------------------------------------
   154     
   134     
   155     switch( aCommand )
   135     switch( aCommand )
   156         {   
   136         {   
   157         case EPhoneDtmfDialerCancel:
   137         case EPhoneDtmfDialerCancel:
   158             {
   138             {
   159             CloseDTMFEditorL();
       
   160             }
   139             }
   161             break;    
   140             break;    
   162     
   141     
   163         default:
   142         default:
   164             commandStatus = CPhoneConference::HandleCommandL( aCommand );
   143             commandStatus = CPhoneConference::HandleCommandL( aCommand );
   197             // do base operation
   176             // do base operation
   198             CPhoneConference::HandleKeyMessageL( aMessage, aCode );
   177             CPhoneConference::HandleKeyMessageL( aMessage, aCode );
   199             break;
   178             break;
   200         }
   179         }
   201     }
   180     }
   202 // -----------------------------------------------------------
       
   203 // CPhoneConferenceAndCallSetup::OpenMenuBarL
       
   204 // -----------------------------------------------------------
       
   205 //
       
   206 void CPhoneConferenceAndCallSetup::OpenMenuBarL()
       
   207     {
       
   208     __LOGMETHODSTARTEND(EPhoneControl, "CPhoneConferenceAndCallSetup::OpenMenuBarL()");
       
   209     TInt resourceId;
       
   210     
       
   211     // Set specific flag to view so that DTMF menu item available
       
   212     TPhoneCmdParamBoolean dtmfSendFlag;
       
   213     dtmfSendFlag.SetBoolean( ETrue );
       
   214     iViewCommandHandle->ExecuteCommandL( EPhoneViewSetDtmfOptionsFlag, 
       
   215     	&dtmfSendFlag );
       
   216      
       
   217     if ( iOnScreenDialer &&  IsDTMFEditorVisibleL() )
       
   218         {
       
   219         resourceId = EPhoneDtmfDialerMenubar;
       
   220         }
       
   221     else if ( IsNumberEntryVisibleL() )
       
   222         {
       
   223         resourceId = EPhoneAlertingAndConfHeldCallMenuBarWithNumberEntry;
       
   224         }
       
   225     else if ( IsConferenceBubbleInSelectionMode() )
       
   226         {
       
   227         resourceId = EPhoneConfCallParticipantsDropMenubar;    
       
   228         }        
       
   229     else
       
   230 	    {
       
   231 	    resourceId = EPhoneAlertingAndConfHeldCallMenuBar;
       
   232 	    }
       
   233 
       
   234     TPhoneCmdParamInteger integerParam;
       
   235     integerParam.SetInteger( 
       
   236                 CPhoneMainResourceResolver::Instance()->
       
   237                 ResolveResourceID( resourceId ) );
       
   238 	    
       
   239     iViewCommandHandle->ExecuteCommandL( EPhoneViewMenuBarOpen, 
       
   240         &integerParam );
       
   241     }
       
   242 
   181 
   243 // -----------------------------------------------------------
   182 // -----------------------------------------------------------
   244 // CPhoneConferenceAndCallSetup::HandleConnectingL
   183 // CPhoneConferenceAndCallSetup::HandleConnectingL
   245 // -----------------------------------------------------------
   184 // -----------------------------------------------------------
   246 //
   185 //
   262 
   201 
   263     // Stop capturing keys
   202     // Stop capturing keys
   264     CaptureKeysDuringCallNotificationL( EFalse );
   203     CaptureKeysDuringCallNotificationL( EFalse );
   265 
   204 
   266     // Remove the number entry if it isn't DTMF dialer
   205     // Remove the number entry if it isn't DTMF dialer
   267     if ( !iOnScreenDialer || !IsNumberEntryVisibleL() || ! IsDTMFEditorVisibleL() )
   206     if ( !iOnScreenDialer || !IsNumberEntryVisibleL() )
   268         {
   207         {
   269         iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNumberEntry );
   208         iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNumberEntry );
   270         }
   209         }
   271     
   210     
   272     // Set Hold flag to view EFalse that IHF is on RSK not unhold
   211     // Set Hold flag to view EFalse that IHF is on RSK not unhold
   291 //
   230 //
   292 void CPhoneConferenceAndCallSetup::HandleConnectedL( TInt aCallId )
   231 void CPhoneConferenceAndCallSetup::HandleConnectedL( TInt aCallId )
   293     {
   232     {
   294     __LOGMETHODSTARTEND(EPhoneControl, "CPhoneConferenceAndCallSetup::HandleConnectedL()");
   233     __LOGMETHODSTARTEND(EPhoneControl, "CPhoneConferenceAndCallSetup::HandleConnectedL()");
   295     
   234     
   296     // Close menu bar, if it is displayed
   235     // Keep Phone in the foreground
   297     iViewCommandHandle->ExecuteCommandL( EPhoneViewMenuBarClose );
   236     TPhoneCmdParamBoolean booleanParam;
   298  
   237     booleanParam.SetBoolean( EFalse );
       
   238     iViewCommandHandle->ExecuteCommandL( 
       
   239         EPhoneViewSetNeedToSendToBackgroundStatus, &booleanParam );
       
   240     
   299     BeginUiUpdateLC();
   241     BeginUiUpdateLC();
   300         
   242         
   301     // Show bubble
   243     // Show bubble
   302     TPhoneCmdParamCallHeaderData callHeaderParam;
   244     TPhoneCmdParamCallHeaderData callHeaderParam;
   303     callHeaderParam.SetCallState( EPEStateConnected );
   245     callHeaderParam.SetCallState( EPEStateConnected );
   307     // Capturing keys and number entry must be removed because some
   249     // Capturing keys and number entry must be removed because some
   308     // networks jump over connecting state directly to connected state.
   250     // networks jump over connecting state directly to connected state.
   309     CaptureKeysDuringCallNotificationL( EFalse );
   251     CaptureKeysDuringCallNotificationL( EFalse );
   310     
   252     
   311     // Remove the number entry if it isn't DTMF dialer
   253     // Remove the number entry if it isn't DTMF dialer
   312     if ( !iOnScreenDialer || !IsNumberEntryVisibleL() || ! IsDTMFEditorVisibleL() )
   254     if ( !iOnScreenDialer || !IsNumberEntryVisibleL() )
   313         {
   255         {
   314         iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNumberEntry );
   256         iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNumberEntry );
   315         }
   257         }
   316     
   258     
   317     SetTouchPaneButtons( EPhoneConferenceAndSingleButtons );
   259     SetTouchPaneButtons( EPhoneConferenceAndSingleButtons );
   318     SetTouchPaneButtonDisabled( EPhoneInCallCmdPrivate );
       
   319     EndUiUpdate(); 
   260     EndUiUpdate(); 
   320     
   261     
   321     UpdateCbaL ( EPhoneCallHandlingNewCallSwapCBA );
   262     UpdateCbaL ( EPhoneCallHandlingNewCallSwapCBA );
   322    
   263    
   323     iStateMachine->ChangeState( EPhoneStateConferenceAndSingle );                     
   264     iStateMachine->ChangeState( EPhoneStateConferenceAndSingle );                     
   338         &globalNotifierParam );
   279         &globalNotifierParam );
   339 
   280 
   340     // Stop capturing keys
   281     // Stop capturing keys
   341     CaptureKeysDuringCallNotificationL( EFalse );
   282     CaptureKeysDuringCallNotificationL( EFalse );
   342 
   283 
   343     // Close menu bar, if it is displayed
       
   344     iViewCommandHandle->ExecuteCommandL( EPhoneViewMenuBarClose );
       
   345 
       
   346     TPhoneCmdParamBoolean conferenceExistsForCallId;
   284     TPhoneCmdParamBoolean conferenceExistsForCallId;
   347     iViewCommandHandle->ExecuteCommandL( EPhoneViewGetCallExistsInConference,
   285     iViewCommandHandle->ExecuteCommandL( EPhoneViewGetCallExistsInConference,
   348         aCallId, &conferenceExistsForCallId );
   286         aCallId, &conferenceExistsForCallId );
   349     
   287     
   350     if( conferenceExistsForCallId.Boolean() )
   288     if( conferenceExistsForCallId.Boolean() )
   351         {
   289         {
   352 		// Remove 'Conference on hold' global note
   290         // Remove 'Conference on hold' global note
   353 	    iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveGlobalNote );
   291         iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveGlobalNote );
   354     
   292     
   355         // Remove conference member from conference bubble
   293         // Remove conference member from conference bubble
   356         iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveFromConference, 
   294         iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveFromConference, 
   357             aCallId );
   295             aCallId );
   358         
   296         
   372                 {
   310                 {
   373                 iStateMachine->ChangeState( EPhoneStateAlertingInSingle ); 
   311                 iStateMachine->ChangeState( EPhoneStateAlertingInSingle ); 
   374                 }
   312                 }
   375             else
   313             else
   376                 {
   314                 {
   377                 iStateMachine->ChangeState( EPhoneStateCallSetupInSingle );
   315                 iStateMachine->ChangeState( EPhoneStateCallSetupInSingle );     
   378                 }
   316                 }
   379             }
   317             }
   380         }
   318         }
   381     else
   319     else
   382         {
   320         {       
   383         // Remove  outgoing call 
   321         // Remove  outgoing call 
   384         BeginTransEffectLC( ENumberEntryOpen );
       
   385         BeginUiUpdateLC();
   322         BeginUiUpdateLC();
       
   323         
   386         iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveCallHeader, aCallId );
   324         iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveCallHeader, aCallId );
       
   325         
   387         CheckIfRestoreNEContentAfterDtmfDialer();
   326         CheckIfRestoreNEContentAfterDtmfDialer();
       
   327          
   388         if ( IsNumberEntryUsedL() )
   328         if ( IsNumberEntryUsedL() )
   389             {
   329             {
   390             // Show the number entry if it exists
   330             // Show the number entry if it exists
   391             SetNumberEntryVisibilityL(ETrue);
   331             SetNumberEntryVisibilityL(ETrue);
   392             }
   332             }
   393             
   333             
   394         SetTouchPaneButtons( EPhoneConferenceButtons );
   334         SetTouchPaneButtons( EPhoneConferenceButtons );
   395         EndUiUpdate();
   335         EndUiUpdate();
   396         EndTransEffect(); 
   336 
       
   337         // Go to conference state
   397         UpdateCbaL( EPhoneCallHandlingInCallCBA );
   338         UpdateCbaL( EPhoneCallHandlingInCallCBA );
   398         iStateMachine->ChangeState( EPhoneStateConference );
   339         iStateMachine->ChangeState( EPhoneStateConference );
   399         }
   340         } 
   400     }
   341 
       
   342     }
       
   343    
   401     
   344     
   402 // -----------------------------------------------------------
   345 // -----------------------------------------------------------
   403 // CPhoneConferenceAndCallSetup::UpdateInCallCbaL
   346 // CPhoneConferenceAndCallSetup::UpdateInCallCbaL
   404 // -----------------------------------------------------------
   347 // -----------------------------------------------------------
   405 //
   348 //