phoneapp/phoneuistates/src/cphoneconferenceandwaitingandcallsetup.cpp
branchRCL_3
changeset 62 5266b1f337bd
parent 61 41a7f70b3818
child 69 8baf28733c3d
equal deleted inserted replaced
61:41a7f70b3818 62:5266b1f337bd
    52 // (other items were commented in a header).
    52 // (other items were commented in a header).
    53 // -----------------------------------------------------------
    53 // -----------------------------------------------------------
    54 //
    54 //
    55 CPhoneConferenceAndWaitingAndCallSetup::~CPhoneConferenceAndWaitingAndCallSetup()
    55 CPhoneConferenceAndWaitingAndCallSetup::~CPhoneConferenceAndWaitingAndCallSetup()
    56     {
    56     {
       
    57     // Need to check iViewCommandHandle validity here to not
       
    58     // trigger a high/can panic error in a Codescanner run.
       
    59     // coverity[var_compare_op]
       
    60     if ( iViewCommandHandle )
       
    61         {
       
    62         TPhoneCmdParamBoolean dtmfSendFlag;
       
    63         dtmfSendFlag.SetBoolean( EFalse );
       
    64         TRAP_IGNORE( iViewCommandHandle->ExecuteCommandL( EPhoneViewSetDtmfOptionsFlag, 
       
    65             &dtmfSendFlag ) );        
       
    66         }
    57     }
    67     }
    58 
    68 
    59 // -----------------------------------------------------------
    69 // -----------------------------------------------------------
    60 // CPhoneConferenceAndWaitingAndCallSetup::ConstructL()
    70 // CPhoneConferenceAndWaitingAndCallSetup::ConstructL()
    61 // Constructor
    71 // Constructor
   102     __LOGMETHODSTARTEND(EPhoneControl, 
   112     __LOGMETHODSTARTEND(EPhoneControl, 
   103         "CPhoneConferenceAndWaitingAndCallSetup::HandlePhoneEngineMessageL()");
   113         "CPhoneConferenceAndWaitingAndCallSetup::HandlePhoneEngineMessageL()");
   104     switch ( aMessage )
   114     switch ( aMessage )
   105         {
   115         {
   106         case MEngineMonitor::EPEMessageConnecting:
   116         case MEngineMonitor::EPEMessageConnecting:
       
   117             {
   107             iAlerting = ETrue;
   118             iAlerting = ETrue;
   108             HandleConnectingL( aCallId );
   119             HandleConnectingL( aCallId );
       
   120             }
   109             break;
   121             break;
   110             
   122             
   111         case MEngineMonitor::EPEMessageConnected:
   123         case MEngineMonitor::EPEMessageConnected:
       
   124             {
   112             HandleConnectedL( aCallId );
   125             HandleConnectedL( aCallId );
       
   126             }
   113             break;
   127             break;
   114         
   128         
   115         case MEngineMonitor::EPEMessageConferenceIdle:
   129         case MEngineMonitor::EPEMessageConferenceIdle:
       
   130             {
   116             HandleConferenceIdleL();
   131             HandleConferenceIdleL();
       
   132             }
   117             break;
   133             break;
   118 
   134 
   119         case MEngineMonitor::EPEMessageIdle:
   135         case MEngineMonitor::EPEMessageIdle:
       
   136             {
   120             HandleIdleL( aCallId );
   137             HandleIdleL( aCallId );
       
   138             }
   121             break;
   139             break;
   122 
   140 
   123         default:
   141         default:
       
   142             {
   124             CPhoneConference::HandlePhoneEngineMessageL( aMessage, 
   143             CPhoneConference::HandlePhoneEngineMessageL( aMessage, 
   125                 aCallId );
   144                 aCallId );
       
   145             }
   126             break;
   146             break;
   127         }
   147         }
   128     }
   148     }
   129 
   149 
   130 // -----------------------------------------------------------
   150 // -----------------------------------------------------------
   139     
   159     
   140     switch( aCommand )
   160     switch( aCommand )
   141         {   
   161         {   
   142         case EPhoneDtmfDialerCancel:
   162         case EPhoneDtmfDialerCancel:
   143             {
   163             {
       
   164             CloseDTMFEditorL();
   144             }
   165             }
   145             break;    
   166             break;    
   146     
   167     
   147         default:
   168         default:
   148             commandStatus = CPhoneConference::HandleCommandL( aCommand );
   169             commandStatus = CPhoneConference::HandleCommandL( aCommand );
   174                  {
   195                  {
   175                 // Number entry is behind waiting call bubble.
   196                 // Number entry is behind waiting call bubble.
   176                 // We can't answer to call in this state so display
   197                 // We can't answer to call in this state so display
   177                 // Not allowed -note.
   198                 // Not allowed -note.
   178                 SendGlobalErrorNoteL( 
   199                 SendGlobalErrorNoteL( 
   179                     EPhoneNoteTextNotAllowed, ETrue );                                             
   200                     EPhoneNoteTextNotAllowed );                                             
   180                  }
   201                  }
   181             break;
   202             break;
   182             
   203             
   183         default:
   204         default:
   184             // do base operation
   205             // do base operation
   185             CPhoneConference::HandleKeyMessageL( aMessage, aCode );
   206             CPhoneConference::HandleKeyMessageL( aMessage, aCode );
   186             break;
   207             break;
   187         }
   208         }
       
   209     }
       
   210 
       
   211 // -----------------------------------------------------------
       
   212 // CPhoneConferenceAndWaitingAndCallSetup::HandleErrorL
       
   213 // -----------------------------------------------------------
       
   214 //
       
   215 EXPORT_C void CPhoneConferenceAndWaitingAndCallSetup::HandleErrorL( 
       
   216         const TPEErrorInfo& aErrorInfo )
       
   217     {
       
   218     __LOGMETHODSTARTEND( EPhoneUIStates, "CPhoneConferenceAndWaitingAndCallSetup::HandleErrorL()");
       
   219     
       
   220     if( aErrorInfo.iErrorCode == ECCPErrorCCUserAlertingNoAnswer )
       
   221         {
       
   222         // Should not shown "No Answer" note
       
   223         __PHONELOG1( EBasic, EPhoneUIStates,
       
   224        "PhoneUIStates: CPhoneConferenceAndWaitingAndCallSetup::HandleErrorL - aErrorInfo.iErrorCode =%d ",
       
   225             aErrorInfo.iErrorCode);
       
   226         }
       
   227     else
       
   228         {
       
   229         CPhoneState::HandleErrorL( aErrorInfo );
       
   230         }
       
   231     }
       
   232 
       
   233 // -----------------------------------------------------------
       
   234 // CPhoneConferenceAndWaitingAndCallSetup::OpenMenuBarL
       
   235 // -----------------------------------------------------------
       
   236 //
       
   237 void CPhoneConferenceAndWaitingAndCallSetup::OpenMenuBarL()
       
   238     {
       
   239     __LOGMETHODSTARTEND( EPhoneUIStates, 
       
   240         "CPhoneConferenceAndWaitingAndCallSetup::OpenMenuBarL");
       
   241 
       
   242     // Set specific flag to view so that DTMF menu item available
       
   243     TPhoneCmdParamBoolean dtmfSendFlag;
       
   244     dtmfSendFlag.SetBoolean( ETrue );
       
   245     iViewCommandHandle->ExecuteCommandL( EPhoneViewSetDtmfOptionsFlag, 
       
   246         &dtmfSendFlag );
       
   247    
       
   248     TInt resourceId ( EPhoneAlertingWaitingAndConfHeldCallMenuBar );
       
   249     if ( iOnScreenDialer && IsDTMFEditorVisibleL() )
       
   250         {
       
   251         resourceId = EPhoneDtmfDialerMenubar;
       
   252         }
       
   253     else if ( IsNumberEntryVisibleL() )
       
   254         {
       
   255         resourceId = 
       
   256             EPhoneAlertingWaitingAndConfHeldCallMenuBarWithNumberEntry;
       
   257         }
       
   258     else if ( IsConferenceBubbleInSelectionMode() )
       
   259         {
       
   260         resourceId = EPhoneConfCallParticipantsDropMenubar;    
       
   261         }         
       
   262 
       
   263     TPhoneCmdParamInteger integerParam;
       
   264     integerParam.SetInteger( 
       
   265                 CPhoneMainResourceResolver::Instance()->
       
   266                 ResolveResourceID( resourceId ) );    
       
   267 
       
   268     iViewCommandHandle->ExecuteCommandL( EPhoneViewMenuBarOpen, 
       
   269         &integerParam );
   188     }
   270     }
   189 
   271 
   190 // -----------------------------------------------------------
   272 // -----------------------------------------------------------
   191 // CPhoneConferenceAndWaitingAndCallSetup::UpdateInCallCbaL
   273 // CPhoneConferenceAndWaitingAndCallSetup::UpdateInCallCbaL
   192 // -----------------------------------------------------------
   274 // -----------------------------------------------------------
   233     callHeaderParam.SetCallState( EPEStateConnecting );
   315     callHeaderParam.SetCallState( EPEStateConnecting );
   234     iViewCommandHandle->ExecuteCommandL( EPhoneViewUpdateBubble, aCallId, 
   316     iViewCommandHandle->ExecuteCommandL( EPhoneViewUpdateBubble, aCallId, 
   235         &callHeaderParam );
   317         &callHeaderParam );
   236         
   318         
   237     // Remove the number entry if it isn't DTMF dialer
   319     // Remove the number entry if it isn't DTMF dialer
   238     if ( !iOnScreenDialer || !IsNumberEntryVisibleL() )
   320     if ( !iOnScreenDialer || !IsNumberEntryVisibleL() || !IsDTMFEditorVisibleL() )
   239         {
   321         {
   240         iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNumberEntry );
   322         iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNumberEntry );
   241         }
   323         }
   242     
   324     
   243     EndUiUpdate();
   325     EndUiUpdate();
   267     // Capturing keys and number entry must be removed because some
   349     // Capturing keys and number entry must be removed because some
   268     // networks jump over connecting state directly to connected state.
   350     // networks jump over connecting state directly to connected state.
   269     CaptureKeysDuringCallNotificationL( EFalse );
   351     CaptureKeysDuringCallNotificationL( EFalse );
   270     
   352     
   271     // Remove the number entry if it isn't DTMF dialer
   353     // Remove the number entry if it isn't DTMF dialer
   272     if ( !iOnScreenDialer || !IsNumberEntryVisibleL() )
   354     if ( !iOnScreenDialer || !IsNumberEntryVisibleL() || !IsDTMFEditorVisibleL() )
   273         {
   355         {
   274         iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNumberEntry );
   356         iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNumberEntry );
   275         }
   357         }
   276     
   358     
   277     SetTouchPaneButtons( EPhoneWaitingCallButtons );    
   359     SetTouchPaneButtons( EPhoneWaitingCallButtons );    
       
   360     SetTouchPaneButtonDisabled( EPhoneCallComingCmdAnswer );
   278     EndUiUpdate();
   361     EndUiUpdate();
   279     
   362     
   280     // Go to Conference And Single And Waiting state
   363     // Go to Conference And Single And Waiting state
   281     UpdateCbaL( EPhoneCallHandlingCallWaitingCBA );  
   364     UpdateCbaL( EPhoneCallHandlingCallWaitingCBA );  
   282     iStateMachine->ChangeState( EPhoneStateConferenceAndSingleAndWaiting );                
   365     iStateMachine->ChangeState( EPhoneStateConferenceAndSingleAndWaiting );                
   300 //
   383 //
   301 void CPhoneConferenceAndWaitingAndCallSetup::HandleConferenceIdleL()
   384 void CPhoneConferenceAndWaitingAndCallSetup::HandleConferenceIdleL()
   302     {
   385     {
   303     __LOGMETHODSTARTEND( EPhoneUIStates, 
   386     __LOGMETHODSTARTEND( EPhoneUIStates, 
   304         "CPhoneConferenceAndWaitingAndCallSetup::HandleConferenceIdleL");
   387         "CPhoneConferenceAndWaitingAndCallSetup::HandleConferenceIdleL");
   305     
       
   306     BeginUiUpdateLC();
   388     BeginUiUpdateLC();
   307         
   389     
   308     iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveConferenceBubble );
   390     iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveConferenceBubble );
       
   391     iViewCommandHandle->ExecuteCommandL( EPhoneViewMenuBarClose );
   309 
   392 
   310     if ( IsNumberEntryUsedL() )
   393     if ( IsNumberEntryUsedL() )
   311         {
   394         {
   312         // Show the number entry if it exists
   395         // Show the number entry if it exists
   313         SetNumberEntryVisibilityL(ETrue);
   396         SetNumberEntryVisibilityL(ETrue);
   340         else
   423         else
   341             {
   424             {
   342             // Reset Hold flag to view
   425             // Reset Hold flag to view
   343             TPhoneCmdParamBoolean holdFlag;
   426             TPhoneCmdParamBoolean holdFlag;
   344             holdFlag.SetBoolean( EFalse );
   427             holdFlag.SetBoolean( EFalse );
   345             iViewCommandHandle->ExecuteCommandL( EPhoneViewSetHoldFlag, &holdFlag );       
   428             iViewCommandHandle->ExecuteCommandL( EPhoneViewSetHoldFlag, &holdFlag );
   346 
       
   347             // Go to Call Setup And Waiting state
       
   348             SetTouchPaneButtons( EPhoneCallSetupButtons ); 
   429             SetTouchPaneButtons( EPhoneCallSetupButtons ); 
   349 
   430             SetToolbarDimming( ETrue );
   350             // No need update cbas            
       
   351             iStateMachine->ChangeState( EPhoneStateCallSetupAndWaiting );
   431             iStateMachine->ChangeState( EPhoneStateCallSetupAndWaiting );
   352             }
   432             }
   353         }
   433         }
   354     EndUiUpdate();          
   434     EndUiUpdate();
   355     }
   435     }
   356 
   436 
   357 // -----------------------------------------------------------
   437 // -----------------------------------------------------------
   358 // CPhoneConferenceAndWaitingAndCallSetup::HandleIdleL
   438 // CPhoneConferenceAndWaitingAndCallSetup::HandleIdleL
   359 // -----------------------------------------------------------
   439 // -----------------------------------------------------------
   369     iViewCommandHandle->ExecuteCommandL( EPhoneViewSetGlobalNotifiersDisabled,
   449     iViewCommandHandle->ExecuteCommandL( EPhoneViewSetGlobalNotifiersDisabled,
   370         &globalNotifierParam );
   450         &globalNotifierParam );
   371 
   451 
   372     // Stop capturing keys
   452     // Stop capturing keys
   373     CaptureKeysDuringCallNotificationL( EFalse );
   453     CaptureKeysDuringCallNotificationL( EFalse );
       
   454 
       
   455     // Close menu bar, if it is displayed
       
   456     iViewCommandHandle->ExecuteCommandL( EPhoneViewMenuBarClose );
   374 
   457 
   375     TPhoneCmdParamBoolean conferenceExistsForCallId;
   458     TPhoneCmdParamBoolean conferenceExistsForCallId;
   376     iViewCommandHandle->ExecuteCommandL( EPhoneViewGetCallExistsInConference,
   459     iViewCommandHandle->ExecuteCommandL( EPhoneViewGetCallExistsInConference,
   377         aCallId, &conferenceExistsForCallId );
   460         aCallId, &conferenceExistsForCallId );
   378     
   461     
   424                 // Go to Conference And Call Setup state
   507                 // Go to Conference And Call Setup state
   425                 SetTouchPaneButtons( EPhoneCallSetupButtons );
   508                 SetTouchPaneButtons( EPhoneCallSetupButtons );
   426                 UpdateCbaL( EPhoneCallHandlingInCallCBA );                  
   509                 UpdateCbaL( EPhoneCallHandlingInCallCBA );                  
   427                 iStateMachine->ChangeState( EPhoneStateConferenceAndCallSetup );
   510                 iStateMachine->ChangeState( EPhoneStateConferenceAndCallSetup );
   428                 }
   511                 }
   429             EndUiUpdate();             
   512             EndUiUpdate();
   430             }
   513             }
   431         }
   514         }
   432     }
   515     }
   433     
   516     
   434 // End of File
   517 // End of File