phoneapp/phoneuistates/src/cphoneconferenceandwaitingandcallsetup.cpp
branchRCL_3
changeset 61 41a7f70b3818
parent 58 40a3f856b14d
child 62 5266b1f337bd
equal deleted inserted replaced
58:40a3f856b14d 61:41a7f70b3818
    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         }
       
    67     }
    57     }
    68 
    58 
    69 // -----------------------------------------------------------
    59 // -----------------------------------------------------------
    70 // CPhoneConferenceAndWaitingAndCallSetup::ConstructL()
    60 // CPhoneConferenceAndWaitingAndCallSetup::ConstructL()
    71 // Constructor
    61 // Constructor
   112     __LOGMETHODSTARTEND(EPhoneControl, 
   102     __LOGMETHODSTARTEND(EPhoneControl, 
   113         "CPhoneConferenceAndWaitingAndCallSetup::HandlePhoneEngineMessageL()");
   103         "CPhoneConferenceAndWaitingAndCallSetup::HandlePhoneEngineMessageL()");
   114     switch ( aMessage )
   104     switch ( aMessage )
   115         {
   105         {
   116         case MEngineMonitor::EPEMessageConnecting:
   106         case MEngineMonitor::EPEMessageConnecting:
   117             {
       
   118             iAlerting = ETrue;
   107             iAlerting = ETrue;
   119             HandleConnectingL( aCallId );
   108             HandleConnectingL( aCallId );
   120             }
       
   121             break;
   109             break;
   122             
   110             
   123         case MEngineMonitor::EPEMessageConnected:
   111         case MEngineMonitor::EPEMessageConnected:
   124             {
       
   125             HandleConnectedL( aCallId );
   112             HandleConnectedL( aCallId );
   126             }
       
   127             break;
   113             break;
   128         
   114         
   129         case MEngineMonitor::EPEMessageConferenceIdle:
   115         case MEngineMonitor::EPEMessageConferenceIdle:
   130             {
       
   131             HandleConferenceIdleL();
   116             HandleConferenceIdleL();
   132             }
       
   133             break;
   117             break;
   134 
   118 
   135         case MEngineMonitor::EPEMessageIdle:
   119         case MEngineMonitor::EPEMessageIdle:
   136             {
       
   137             HandleIdleL( aCallId );
   120             HandleIdleL( aCallId );
   138             }
       
   139             break;
   121             break;
   140 
   122 
   141         default:
   123         default:
   142             {
       
   143             CPhoneConference::HandlePhoneEngineMessageL( aMessage, 
   124             CPhoneConference::HandlePhoneEngineMessageL( aMessage, 
   144                 aCallId );
   125                 aCallId );
   145             }
       
   146             break;
   126             break;
   147         }
   127         }
   148     }
   128     }
   149 
   129 
   150 // -----------------------------------------------------------
   130 // -----------------------------------------------------------
   159     
   139     
   160     switch( aCommand )
   140     switch( aCommand )
   161         {   
   141         {   
   162         case EPhoneDtmfDialerCancel:
   142         case EPhoneDtmfDialerCancel:
   163             {
   143             {
   164             CloseDTMFEditorL();
       
   165             }
   144             }
   166             break;    
   145             break;    
   167     
   146     
   168         default:
   147         default:
   169             commandStatus = CPhoneConference::HandleCommandL( aCommand );
   148             commandStatus = CPhoneConference::HandleCommandL( aCommand );
   195                  {
   174                  {
   196                 // Number entry is behind waiting call bubble.
   175                 // Number entry is behind waiting call bubble.
   197                 // We can't answer to call in this state so display
   176                 // We can't answer to call in this state so display
   198                 // Not allowed -note.
   177                 // Not allowed -note.
   199                 SendGlobalErrorNoteL( 
   178                 SendGlobalErrorNoteL( 
   200                     EPhoneNoteTextNotAllowed );                                             
   179                     EPhoneNoteTextNotAllowed, ETrue );                                             
   201                  }
   180                  }
   202             break;
   181             break;
   203             
   182             
   204         default:
   183         default:
   205             // do base operation
   184             // do base operation
   206             CPhoneConference::HandleKeyMessageL( aMessage, aCode );
   185             CPhoneConference::HandleKeyMessageL( aMessage, aCode );
   207             break;
   186             break;
   208         }
   187         }
   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 );
       
   270     }
   188     }
   271 
   189 
   272 // -----------------------------------------------------------
   190 // -----------------------------------------------------------
   273 // CPhoneConferenceAndWaitingAndCallSetup::UpdateInCallCbaL
   191 // CPhoneConferenceAndWaitingAndCallSetup::UpdateInCallCbaL
   274 // -----------------------------------------------------------
   192 // -----------------------------------------------------------
   315     callHeaderParam.SetCallState( EPEStateConnecting );
   233     callHeaderParam.SetCallState( EPEStateConnecting );
   316     iViewCommandHandle->ExecuteCommandL( EPhoneViewUpdateBubble, aCallId, 
   234     iViewCommandHandle->ExecuteCommandL( EPhoneViewUpdateBubble, aCallId, 
   317         &callHeaderParam );
   235         &callHeaderParam );
   318         
   236         
   319     // Remove the number entry if it isn't DTMF dialer
   237     // Remove the number entry if it isn't DTMF dialer
   320     if ( !iOnScreenDialer || !IsNumberEntryVisibleL() || !IsDTMFEditorVisibleL() )
   238     if ( !iOnScreenDialer || !IsNumberEntryVisibleL() )
   321         {
   239         {
   322         iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNumberEntry );
   240         iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNumberEntry );
   323         }
   241         }
   324     
   242     
   325     EndUiUpdate();
   243     EndUiUpdate();
   349     // Capturing keys and number entry must be removed because some
   267     // Capturing keys and number entry must be removed because some
   350     // networks jump over connecting state directly to connected state.
   268     // networks jump over connecting state directly to connected state.
   351     CaptureKeysDuringCallNotificationL( EFalse );
   269     CaptureKeysDuringCallNotificationL( EFalse );
   352     
   270     
   353     // Remove the number entry if it isn't DTMF dialer
   271     // Remove the number entry if it isn't DTMF dialer
   354     if ( !iOnScreenDialer || !IsNumberEntryVisibleL() || !IsDTMFEditorVisibleL() )
   272     if ( !iOnScreenDialer || !IsNumberEntryVisibleL() )
   355         {
   273         {
   356         iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNumberEntry );
   274         iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNumberEntry );
   357         }
   275         }
   358     
   276     
   359     SetTouchPaneButtons( EPhoneWaitingCallButtons );    
   277     SetTouchPaneButtons( EPhoneWaitingCallButtons );    
   360     SetTouchPaneButtonDisabled( EPhoneCallComingCmdAnswer );
       
   361     EndUiUpdate();
   278     EndUiUpdate();
   362     
   279     
   363     // Go to Conference And Single And Waiting state
   280     // Go to Conference And Single And Waiting state
   364     UpdateCbaL( EPhoneCallHandlingCallWaitingCBA );  
   281     UpdateCbaL( EPhoneCallHandlingCallWaitingCBA );  
   365     iStateMachine->ChangeState( EPhoneStateConferenceAndSingleAndWaiting );                
   282     iStateMachine->ChangeState( EPhoneStateConferenceAndSingleAndWaiting );                
   383 //
   300 //
   384 void CPhoneConferenceAndWaitingAndCallSetup::HandleConferenceIdleL()
   301 void CPhoneConferenceAndWaitingAndCallSetup::HandleConferenceIdleL()
   385     {
   302     {
   386     __LOGMETHODSTARTEND( EPhoneUIStates, 
   303     __LOGMETHODSTARTEND( EPhoneUIStates, 
   387         "CPhoneConferenceAndWaitingAndCallSetup::HandleConferenceIdleL");
   304         "CPhoneConferenceAndWaitingAndCallSetup::HandleConferenceIdleL");
       
   305     
   388     BeginUiUpdateLC();
   306     BeginUiUpdateLC();
   389     
   307         
   390     iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveConferenceBubble );
   308     iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveConferenceBubble );
   391     iViewCommandHandle->ExecuteCommandL( EPhoneViewMenuBarClose );
       
   392 
   309 
   393     if ( IsNumberEntryUsedL() )
   310     if ( IsNumberEntryUsedL() )
   394         {
   311         {
   395         // Show the number entry if it exists
   312         // Show the number entry if it exists
   396         SetNumberEntryVisibilityL(ETrue);
   313         SetNumberEntryVisibilityL(ETrue);
   423         else
   340         else
   424             {
   341             {
   425             // Reset Hold flag to view
   342             // Reset Hold flag to view
   426             TPhoneCmdParamBoolean holdFlag;
   343             TPhoneCmdParamBoolean holdFlag;
   427             holdFlag.SetBoolean( EFalse );
   344             holdFlag.SetBoolean( EFalse );
   428             iViewCommandHandle->ExecuteCommandL( EPhoneViewSetHoldFlag, &holdFlag );
   345             iViewCommandHandle->ExecuteCommandL( EPhoneViewSetHoldFlag, &holdFlag );       
       
   346 
       
   347             // Go to Call Setup And Waiting state
   429             SetTouchPaneButtons( EPhoneCallSetupButtons ); 
   348             SetTouchPaneButtons( EPhoneCallSetupButtons ); 
   430             SetToolbarDimming( ETrue );
   349 
       
   350             // No need update cbas            
   431             iStateMachine->ChangeState( EPhoneStateCallSetupAndWaiting );
   351             iStateMachine->ChangeState( EPhoneStateCallSetupAndWaiting );
   432             }
   352             }
   433         }
   353         }
   434     EndUiUpdate();
   354     EndUiUpdate();          
   435     }
   355     }
   436 
   356 
   437 // -----------------------------------------------------------
   357 // -----------------------------------------------------------
   438 // CPhoneConferenceAndWaitingAndCallSetup::HandleIdleL
   358 // CPhoneConferenceAndWaitingAndCallSetup::HandleIdleL
   439 // -----------------------------------------------------------
   359 // -----------------------------------------------------------
   449     iViewCommandHandle->ExecuteCommandL( EPhoneViewSetGlobalNotifiersDisabled,
   369     iViewCommandHandle->ExecuteCommandL( EPhoneViewSetGlobalNotifiersDisabled,
   450         &globalNotifierParam );
   370         &globalNotifierParam );
   451 
   371 
   452     // Stop capturing keys
   372     // Stop capturing keys
   453     CaptureKeysDuringCallNotificationL( EFalse );
   373     CaptureKeysDuringCallNotificationL( EFalse );
   454 
       
   455     // Close menu bar, if it is displayed
       
   456     iViewCommandHandle->ExecuteCommandL( EPhoneViewMenuBarClose );
       
   457 
   374 
   458     TPhoneCmdParamBoolean conferenceExistsForCallId;
   375     TPhoneCmdParamBoolean conferenceExistsForCallId;
   459     iViewCommandHandle->ExecuteCommandL( EPhoneViewGetCallExistsInConference,
   376     iViewCommandHandle->ExecuteCommandL( EPhoneViewGetCallExistsInConference,
   460         aCallId, &conferenceExistsForCallId );
   377         aCallId, &conferenceExistsForCallId );
   461     
   378     
   507                 // Go to Conference And Call Setup state
   424                 // Go to Conference And Call Setup state
   508                 SetTouchPaneButtons( EPhoneCallSetupButtons );
   425                 SetTouchPaneButtons( EPhoneCallSetupButtons );
   509                 UpdateCbaL( EPhoneCallHandlingInCallCBA );                  
   426                 UpdateCbaL( EPhoneCallHandlingInCallCBA );                  
   510                 iStateMachine->ChangeState( EPhoneStateConferenceAndCallSetup );
   427                 iStateMachine->ChangeState( EPhoneStateConferenceAndCallSetup );
   511                 }
   428                 }
   512             EndUiUpdate();
   429             EndUiUpdate();             
   513             }
   430             }
   514         }
   431         }
   515     }
   432     }
   516     
   433     
   517 // End of File
   434 // End of File