phoneapp/phoneuistates/src/cphoneconferenceandcallsetup.cpp
changeset 72 c76a0b1755b9
parent 56 5bcb308bd24d
child 74 d1c62c765e48
equal deleted inserted replaced
64:6aaf0276100e 72:c76a0b1755b9
    61 // -----------------------------------------------------------
    61 // -----------------------------------------------------------
    62 //
    62 //
    63 void CPhoneConferenceAndCallSetup::ConstructL()
    63 void CPhoneConferenceAndCallSetup::ConstructL()
    64     {
    64     {
    65     CPhoneConference::ConstructL();
    65     CPhoneConference::ConstructL();
    66   
       
    67     }
    66     }
    68 
    67 
    69 // -----------------------------------------------------------
    68 // -----------------------------------------------------------
    70 // CPhoneConferenceAndCallSetup::NewL()
    69 // CPhoneConferenceAndCallSetup::NewL()
    71 // Constructor
    70 // Constructor
   129 TBool CPhoneConferenceAndCallSetup::HandleCommandL( TInt aCommand )
   128 TBool CPhoneConferenceAndCallSetup::HandleCommandL( TInt aCommand )
   130     {
   129     {
   131     __LOGMETHODSTARTEND( EPhoneUIStates, 
   130     __LOGMETHODSTARTEND( EPhoneUIStates, 
   132         "CPhoneConferenceAndCallSetup::HandleCommandL()");
   131         "CPhoneConferenceAndCallSetup::HandleCommandL()");
   133     TBool commandStatus = ETrue;
   132     TBool commandStatus = ETrue;
   134     
       
   135     switch( aCommand )
   133     switch( aCommand )
   136         {   
   134         {   
   137         case EPhoneDtmfDialerCancel:
   135         case EPhoneDtmfDialerCancel:
   138             {
   136             {
   139             }
   137             }
   141     
   139     
   142         default:
   140         default:
   143             commandStatus = CPhoneConference::HandleCommandL( aCommand );
   141             commandStatus = CPhoneConference::HandleCommandL( aCommand );
   144             break;
   142             break;
   145         }
   143         }
   146 
       
   147     return commandStatus;
   144     return commandStatus;
   148     }
   145     }
   149     
   146     
   150 // --------------------------------------------------------------
   147 // --------------------------------------------------------------
   151 // CPhoneConferenceAndCallSetup::HandleKeyMessageL
   148 // CPhoneConferenceAndCallSetup::HandleKeyMessageL
   157     {
   154     {
   158     __LOGMETHODSTARTEND( EPhoneUIStates, 
   155     __LOGMETHODSTARTEND( EPhoneUIStates, 
   159         "CPhoneConferenceAndCallSetup::HandleKeyMessageL()");
   156         "CPhoneConferenceAndCallSetup::HandleKeyMessageL()");
   160     switch ( aCode )
   157     switch ( aCode )
   161         {
   158         {
   162         // End-key
   159         case EKeyNo: // End-key
   163         case EKeyNo:
       
   164             if ( aMessage == EPhoneKeyLongPress )
   160             if ( aMessage == EPhoneKeyLongPress )
   165                 {
   161                 {
   166                 iStateMachine->SendPhoneEngineMessage(
   162                 iStateMachine->SendPhoneEngineMessage(
   167                         MPEPhoneModel::EPEMessageTerminateAllConnections );   
   163                         MPEPhoneModel::EPEMessageTerminateAllConnections );   
   168                 }
   164                 }
   171                 DisconnectOutgoingCallL();
   167                 DisconnectOutgoingCallL();
   172                 }
   168                 }
   173             break;
   169             break;
   174             
   170             
   175         default:
   171         default:
   176             // do base operation
       
   177             CPhoneConference::HandleKeyMessageL( aMessage, aCode );
   172             CPhoneConference::HandleKeyMessageL( aMessage, aCode );
   178             break;
   173             break;
   179         }
   174         }
   180     }
   175     }
   181 
   176 
   184 // -----------------------------------------------------------
   179 // -----------------------------------------------------------
   185 //
   180 //
   186 void CPhoneConferenceAndCallSetup::HandleConnectingL( TInt aCallId )
   181 void CPhoneConferenceAndCallSetup::HandleConnectingL( TInt aCallId )
   187     {
   182     {
   188     __LOGMETHODSTARTEND(EPhoneControl, "CPhoneConferenceAndCallSetup::HandleConnectingL()");
   183     __LOGMETHODSTARTEND(EPhoneControl, "CPhoneConferenceAndCallSetup::HandleConnectingL()");
   189     
       
   190     BeginUiUpdateLC();
   184     BeginUiUpdateLC();
   191         
       
   192     UpdateRemoteInfoDataL ( aCallId );
   185     UpdateRemoteInfoDataL ( aCallId );
   193     
       
   194     iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveGlobalNote );
   186     iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveGlobalNote );
   195     
   187     
   196     // Re-enable global notes
       
   197     TPhoneCmdParamBoolean globalNotifierParam;
   188     TPhoneCmdParamBoolean globalNotifierParam;
   198     globalNotifierParam.SetBoolean( EFalse );
   189     globalNotifierParam.SetBoolean( EFalse );
   199     iViewCommandHandle->ExecuteCommandL( EPhoneViewSetGlobalNotifiersDisabled,
   190     iViewCommandHandle->ExecuteCommandL( EPhoneViewSetGlobalNotifiersDisabled,
   200         &globalNotifierParam );
   191         &globalNotifierParam );
   201 
   192     
   202     // Stop capturing keys
   193     if ( !IsNumberEntryVisibleL() )
   203     CaptureKeysDuringCallNotificationL( EFalse );
       
   204 
       
   205     // Remove the number entry if it isn't DTMF dialer
       
   206     if ( !iOnScreenDialer || !IsNumberEntryVisibleL() )
       
   207         {
   194         {
   208         iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNumberEntry );
   195         iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNumberEntry );
   209         }
   196         }
   210     
   197     
   211     // Set Hold flag to view EFalse that IHF is on RSK not unhold
   198     // Set Hold flag to view EFalse that IHF is on RSK not unhold
   212     TPhoneCmdParamBoolean holdFlag;
   199     TPhoneCmdParamBoolean holdFlag;
   213     holdFlag.SetBoolean( EFalse );
   200     holdFlag.SetBoolean( EFalse );
   214     iViewCommandHandle->ExecuteCommandL( EPhoneViewSetHoldFlag, &holdFlag );
   201     iViewCommandHandle->ExecuteCommandL( EPhoneViewSetHoldFlag, &holdFlag );
   215     
   202     
   216     // Updated connecting cba's   
       
   217     UpdateCbaL( EPhoneCallHandlingInCallCBA );
   203     UpdateCbaL( EPhoneCallHandlingInCallCBA );
   218 
       
   219     TPhoneCmdParamCallHeaderData callHeaderParam;
   204     TPhoneCmdParamCallHeaderData callHeaderParam;
   220     callHeaderParam.SetCallState( EPEStateConnecting );
   205     callHeaderParam.SetCallState( EPEStateConnecting );
   221     iViewCommandHandle->ExecuteCommandL( EPhoneViewUpdateBubble, aCallId, 
   206     iViewCommandHandle->ExecuteCommandL( EPhoneViewUpdateBubble, aCallId, 
   222         &callHeaderParam );       
   207         &callHeaderParam );
   223         
       
   224     EndUiUpdate();        
   208     EndUiUpdate();        
   225     }
   209     }
   226     
   210     
   227 // -----------------------------------------------------------
   211 // -----------------------------------------------------------
   228 // CPhoneConferenceAndCallSetup::HandleConnectedL
   212 // CPhoneConferenceAndCallSetup::HandleConnectedL
   229 // -----------------------------------------------------------
   213 // -----------------------------------------------------------
   230 //
   214 //
   231 void CPhoneConferenceAndCallSetup::HandleConnectedL( TInt aCallId )
   215 void CPhoneConferenceAndCallSetup::HandleConnectedL( TInt aCallId )
   232     {
   216     {
   233     __LOGMETHODSTARTEND(EPhoneControl, "CPhoneConferenceAndCallSetup::HandleConnectedL()");
   217     __LOGMETHODSTARTEND(EPhoneControl, "CPhoneConferenceAndCallSetup::HandleConnectedL()");
   234     
       
   235     // Keep Phone in the foreground
       
   236     TPhoneCmdParamBoolean booleanParam;
   218     TPhoneCmdParamBoolean booleanParam;
   237     booleanParam.SetBoolean( EFalse );
   219     booleanParam.SetBoolean( EFalse );
   238     iViewCommandHandle->ExecuteCommandL( 
   220     iViewCommandHandle->ExecuteCommandL( 
   239         EPhoneViewSetNeedToSendToBackgroundStatus, &booleanParam );
   221         EPhoneViewSetNeedToSendToBackgroundStatus, &booleanParam );
   240     
       
   241     BeginUiUpdateLC();
   222     BeginUiUpdateLC();
   242         
       
   243     // Show bubble
       
   244     TPhoneCmdParamCallHeaderData callHeaderParam;
   223     TPhoneCmdParamCallHeaderData callHeaderParam;
   245     callHeaderParam.SetCallState( EPEStateConnected );
   224     callHeaderParam.SetCallState( EPEStateConnected );
   246     iViewCommandHandle->ExecuteCommandL( EPhoneViewUpdateBubble, aCallId, 
   225     iViewCommandHandle->ExecuteCommandL( EPhoneViewUpdateBubble, aCallId, 
   247         &callHeaderParam );
   226         &callHeaderParam );
   248     
   227     
   249     // Capturing keys and number entry must be removed because some
   228     if ( !IsNumberEntryVisibleL() )
   250     // networks jump over connecting state directly to connected state.
       
   251     CaptureKeysDuringCallNotificationL( EFalse );
       
   252     
       
   253     // Remove the number entry if it isn't DTMF dialer
       
   254     if ( !iOnScreenDialer || !IsNumberEntryVisibleL() )
       
   255         {
   229         {
   256         iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNumberEntry );
   230         iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNumberEntry );
   257         }
   231         }
   258     
       
   259     SetTouchPaneButtons( EPhoneConferenceAndSingleButtons );
   232     SetTouchPaneButtons( EPhoneConferenceAndSingleButtons );
   260     EndUiUpdate(); 
   233     EndUiUpdate(); 
   261     
       
   262     UpdateCbaL ( EPhoneCallHandlingNewCallSwapCBA );
   234     UpdateCbaL ( EPhoneCallHandlingNewCallSwapCBA );
   263    
   235     iStateMachine->ChangeState( EPhoneStateConferenceAndSingle );
   264     iStateMachine->ChangeState( EPhoneStateConferenceAndSingle );                     
       
   265     }
   236     }
   266 
   237 
   267 // -----------------------------------------------------------
   238 // -----------------------------------------------------------
   268 // CPhoneConferenceAndCallSetup:HandleIdleL
   239 // CPhoneConferenceAndCallSetup:HandleIdleL
   269 // -----------------------------------------------------------
   240 // -----------------------------------------------------------
   270 //
   241 //
   271 void CPhoneConferenceAndCallSetup::HandleIdleL( TInt aCallId )
   242 void CPhoneConferenceAndCallSetup::HandleIdleL( TInt aCallId )
   272     {
   243     {
   273     __LOGMETHODSTARTEND( EPhoneUIStates, 
   244     __LOGMETHODSTARTEND( EPhoneUIStates, 
   274         "CPhoneConferenceAndCallSetup::HandleIdleL()");
   245         "CPhoneConferenceAndCallSetup::HandleIdleL()");
   275     // Re-enable global notes
       
   276     TPhoneCmdParamBoolean globalNotifierParam;
   246     TPhoneCmdParamBoolean globalNotifierParam;
   277     globalNotifierParam.SetBoolean( EFalse );
   247     globalNotifierParam.SetBoolean( EFalse );
   278     iViewCommandHandle->ExecuteCommandL( EPhoneViewSetGlobalNotifiersDisabled,
   248     iViewCommandHandle->ExecuteCommandL( EPhoneViewSetGlobalNotifiersDisabled,
   279         &globalNotifierParam );
   249         &globalNotifierParam );
   280 
   250 
   281     // Stop capturing keys
       
   282     CaptureKeysDuringCallNotificationL( EFalse );
       
   283 
       
   284     TPhoneCmdParamBoolean conferenceExistsForCallId;
   251     TPhoneCmdParamBoolean conferenceExistsForCallId;
   285     iViewCommandHandle->ExecuteCommandL( EPhoneViewGetCallExistsInConference,
   252     iViewCommandHandle->ExecuteCommandL( EPhoneViewGetCallExistsInConference,
   286         aCallId, &conferenceExistsForCallId );
   253         aCallId, &conferenceExistsForCallId );
   287     
   254     
   288     if( conferenceExistsForCallId.Boolean() )
   255     if( conferenceExistsForCallId.Boolean() )
   289         {
   256         {
   290         // Remove 'Conference on hold' global note
   257         // Remove 'Conference on hold' global note
   291         iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveGlobalNote );
   258         iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveGlobalNote );
   292     
   259         iViewCommandHandle->ExecuteCommandL( 
   293         // Remove conference member from conference bubble
   260                 EPhoneViewRemoveFromConference, 
   294         iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveFromConference, 
   261                 aCallId );
   295             aCallId );
       
   296         
   262         
   297         //Check if removed call was last one to be able to be in conference mode
   263         //Check if removed call was last one to be able to be in conference mode
   298         //If there is no confrence call, go to single and call setup state
   264         //If there is no confrence call, go to single and call setup state
   299         TPhoneCmdParamBoolean conferenceExists;
   265         TPhoneCmdParamBoolean conferenceExists;
   300         iViewCommandHandle->ExecuteCommandL( EPhoneViewGetIsConference, 
   266         iViewCommandHandle->ExecuteCommandL( EPhoneViewGetIsConference, 
   301             &conferenceExists );
   267             &conferenceExists );
   302         
       
   303         __PHONELOG1( EBasic, EPhoneControl,
   268         __PHONELOG1( EBasic, EPhoneControl,
   304             "CPhoneConferenceAndCallSetup::HandleIdleL - conferenceExists =%d ",
   269             "CPhoneConferenceAndCallSetup::HandleIdleL - conferenceExists =%d ",
   305             conferenceExists.Boolean() );
   270             conferenceExists.Boolean() );
   306                 
   271                 
   307         if( !conferenceExists.Boolean() )
   272         if( !conferenceExists.Boolean() )
   310                 {
   275                 {
   311                 iStateMachine->ChangeState( EPhoneStateAlertingInSingle ); 
   276                 iStateMachine->ChangeState( EPhoneStateAlertingInSingle ); 
   312                 }
   277                 }
   313             else
   278             else
   314                 {
   279                 {
   315                 iStateMachine->ChangeState( EPhoneStateCallSetupInSingle );     
   280                 iStateMachine->ChangeState( EPhoneStateCallSetupInSingle );
   316                 }
   281                 }
   317             }
   282             }
   318         }
   283         }
   319     else
   284     else
   320         {       
   285         {
   321         // Remove  outgoing call 
   286         // Remove  outgoing call 
   322         BeginUiUpdateLC();
   287         BeginUiUpdateLC();
   323         
       
   324         iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveCallHeader, aCallId );
   288         iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveCallHeader, aCallId );
   325         
       
   326         CheckIfRestoreNEContentAfterDtmfDialer();
       
   327          
   289          
   328         if ( IsNumberEntryUsedL() )
   290         if ( IsNumberEntryUsedL() )
   329             {
   291             {
   330             // Show the number entry if it exists
       
   331             SetNumberEntryVisibilityL(ETrue);
   292             SetNumberEntryVisibilityL(ETrue);
   332             }
   293             }
   333             
   294             
   334         SetTouchPaneButtons( EPhoneConferenceButtons );
   295         SetTouchPaneButtons( EPhoneConferenceButtons );
   335         EndUiUpdate();
   296         EndUiUpdate();
   336 
       
   337         // Go to conference state
       
   338         UpdateCbaL( EPhoneCallHandlingInCallCBA );
   297         UpdateCbaL( EPhoneCallHandlingInCallCBA );
   339         iStateMachine->ChangeState( EPhoneStateConference );
   298         iStateMachine->ChangeState( EPhoneStateConference );
   340         } 
   299         }
   341 
       
   342     }
   300     }
   343    
   301    
   344     
   302     
   345 // -----------------------------------------------------------
   303 // -----------------------------------------------------------
   346 // CPhoneConferenceAndCallSetup::UpdateInCallCbaL
   304 // CPhoneConferenceAndCallSetup::UpdateInCallCbaL
   347 // -----------------------------------------------------------
   305 // -----------------------------------------------------------
   348 //
   306 //
   349 void CPhoneConferenceAndCallSetup::UpdateInCallCbaL()
   307 void CPhoneConferenceAndCallSetup::UpdateInCallCbaL()
   350     {
   308     {
   351     __LOGMETHODSTARTEND(EPhoneControl, "CPhoneConferenceAndCallSetup::UpdateInCallCbaL() ");
   309     __LOGMETHODSTARTEND(EPhoneControl, "CPhoneConferenceAndCallSetup::UpdateInCallCbaL() ");
   352 
       
   353     if ( iAlerting )
   310     if ( iAlerting )
   354         {
   311         {
   355         UpdateCbaL( EPhoneCallHandlingInCallCBA );
   312         UpdateCbaL( EPhoneCallHandlingInCallCBA );
   356         }
   313         }
   357     else
   314     else
   366 //
   323 //
   367 void CPhoneConferenceAndCallSetup::HandleConferenceIdleL()
   324 void CPhoneConferenceAndCallSetup::HandleConferenceIdleL()
   368     {
   325     {
   369     __LOGMETHODSTARTEND( EPhoneUIStates, 
   326     __LOGMETHODSTARTEND( EPhoneUIStates, 
   370         "CPhoneConferenceAndCallSetup::HandleConferenceIdleL()");
   327         "CPhoneConferenceAndCallSetup::HandleConferenceIdleL()");
   371         
       
   372     iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveConferenceBubble );
   328     iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveConferenceBubble );
   373         
   329     
   374     // Fetch alerting call's id from view
       
   375     TPhoneCmdParamCallStateData callStateData;
   330     TPhoneCmdParamCallStateData callStateData;
   376     callStateData.SetCallState( EPEStateConnecting );
   331     callStateData.SetCallState( EPEStateConnecting );
   377     iViewCommandHandle->HandleCommandL(
   332     iViewCommandHandle->HandleCommandL(
   378         EPhoneViewGetCallIdByState, &callStateData );
   333         EPhoneViewGetCallIdByState, &callStateData );
   379 
   334 
   387         UpdateCbaL( EPhoneCallHandlingInCallCBA );
   342         UpdateCbaL( EPhoneCallHandlingInCallCBA );
   388         iStateMachine->ChangeState( EPhoneStateAlertingInSingle );     
   343         iStateMachine->ChangeState( EPhoneStateAlertingInSingle );     
   389         }
   344         }
   390     else
   345     else
   391         {
   346         {
   392         // Go to callsetup and single state
       
   393         UpdateCbaL( EPhoneCallHandlingCallSetupCBA );
   347         UpdateCbaL( EPhoneCallHandlingCallSetupCBA );
   394         iStateMachine->ChangeState( EPhoneStateCallSetupInSingle );
   348         iStateMachine->ChangeState( EPhoneStateCallSetupInSingle );
   395         }           
   349         }
   396     }
   350     }
   397 
   351 
   398 // End of File
   352 // End of File