phoneapp/phoneuistates/src/cphonecallsetupandwaiting.cpp
changeset 72 c76a0b1755b9
parent 56 5bcb308bd24d
child 74 d1c62c765e48
equal deleted inserted replaced
64:6aaf0276100e 72:c76a0b1755b9
   125 //
   125 //
   126 void CPhoneCallSetupAndWaiting::HandleIdleL( TInt aCallId )
   126 void CPhoneCallSetupAndWaiting::HandleIdleL( TInt aCallId )
   127     {
   127     {
   128     __LOGMETHODSTARTEND( EPhoneUIStates,
   128     __LOGMETHODSTARTEND( EPhoneUIStates,
   129         "CPhoneCallSetupAndWaiting::HandleIdleL()");
   129         "CPhoneCallSetupAndWaiting::HandleIdleL()");
   130 
       
   131     BeginUiUpdateLC();
   130     BeginUiUpdateLC();
   132 
       
   133     // Remove call
       
   134     iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveCallHeader, aCallId );
   131     iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveCallHeader, aCallId );
   135 
   132 
   136     // Find out do we have waiting or outgoing call left
   133     // Find out do we have waiting or outgoing call left
   137     TPhoneCmdParamCallStateData callStateData;
   134     TPhoneCmdParamCallStateData callStateData;
   138     callStateData.SetCallState( EPEStateRinging );
   135     callStateData.SetCallState( EPEStateRinging );
   139     iViewCommandHandle->HandleCommandL( EPhoneViewGetCallIdByState,
   136     iViewCommandHandle->HandleCommandL( EPhoneViewGetCallIdByState,
   140         &callStateData );
   137         &callStateData );
   141 
   138 
   142     if( callStateData.CallId() > KErrNotFound )
   139     if( callStateData.CallId() > KErrNotFound )
   143         {
   140         {
   144 
       
   145         // Display ringing bubble
       
   146         TPhoneCmdParamCallHeaderData callHeaderParam;
   141         TPhoneCmdParamCallHeaderData callHeaderParam;
   147         callHeaderParam.SetCallState( EPEStateRinging );
   142         callHeaderParam.SetCallState( EPEStateRinging );
   148 
       
   149         SetCallHeaderTextsForCallComingInL( callStateData.CallId(), EFalse, &callHeaderParam );
   143         SetCallHeaderTextsForCallComingInL( callStateData.CallId(), EFalse, &callHeaderParam );
   150 
   144 
   151         iViewCommandHandle->ExecuteCommandL( EPhoneViewUpdateBubble,
   145         iViewCommandHandle->ExecuteCommandL( EPhoneViewUpdateBubble,
   152             callStateData.CallId(),
   146             callStateData.CallId(),
   153             &callHeaderParam );
   147             &callHeaderParam );
   154 
   148 
   155         // Show incoming call buttons
       
   156         SetTouchPaneButtons( EPhoneIncomingCallButtons );
   149         SetTouchPaneButtons( EPhoneIncomingCallButtons );
   157 
       
   158         // Bring up callhandling view
       
   159         BringIncomingToForegroundL();
   150         BringIncomingToForegroundL();
   160 
       
   161         // state changes to Incoming
       
   162         iCbaManager->UpdateIncomingCbaL( callStateData.CallId() );
   151         iCbaManager->UpdateIncomingCbaL( callStateData.CallId() );
   163         SetRingingTonePlaybackL( callStateData.CallId() );
   152         SetRingingTonePlaybackL( callStateData.CallId() );
   164         SetBackButtonActive(EFalse);
   153         SetBackButtonActive(EFalse);
   165         iStateMachine->ChangeState( EPhoneStateIncoming );
   154         iStateMachine->ChangeState( EPhoneStateIncoming );
   166         }
   155         }
   167 
   156     else // waiting call was terminated.
   168     else
   157         {
   169         {
       
   170         // Show call setup buttons
       
   171         CPhoneState::SetTouchPaneButtons( EPhoneCallSetupButtons );
   158         CPhoneState::SetTouchPaneButtons( EPhoneCallSetupButtons );
   172         // Waiting call was terminated
       
   173         UpdateCbaL( EPhoneCallHandlingInCallCBA );
   159         UpdateCbaL( EPhoneCallHandlingInCallCBA );
   174         iStateMachine->ChangeState( EPhoneStateAlerting );
   160         iStateMachine->ChangeState( EPhoneStateAlerting );
   175         }
   161         }
   176 
       
   177     EndUiUpdate();
   162     EndUiUpdate();
   178     }
   163     }
   179 
   164 
   180 // -----------------------------------------------------------
   165 // -----------------------------------------------------------
   181 // CPhoneCallSetupAndWaiting::UpdateInCallCbaL
   166 // CPhoneCallSetupAndWaiting::UpdateInCallCbaL
   183 //
   168 //
   184 void CPhoneCallSetupAndWaiting::UpdateInCallCbaL()
   169 void CPhoneCallSetupAndWaiting::UpdateInCallCbaL()
   185     {
   170     {
   186     __LOGMETHODSTARTEND( EPhoneControl,
   171     __LOGMETHODSTARTEND( EPhoneControl,
   187         "CPhoneCallSetupAndWaiting::UpdateInCallCbaL() ");
   172         "CPhoneCallSetupAndWaiting::UpdateInCallCbaL() ");
   188 
       
   189     UpdateCbaL( EPhoneCallHandlingIncomingRejectCBA );
   173     UpdateCbaL( EPhoneCallHandlingIncomingRejectCBA );
   190     }
   174     }
   191 
   175 
   192 // -----------------------------------------------------------
   176 // -----------------------------------------------------------
   193 // CPhoneCallSetupAndWaiting::HandleConnectedL
   177 // CPhoneCallSetupAndWaiting::HandleConnectedL
   194 // -----------------------------------------------------------
   178 // -----------------------------------------------------------
   195 //
   179 //
   196 void CPhoneCallSetupAndWaiting::HandleConnectedL( TInt aCallId )
   180 void CPhoneCallSetupAndWaiting::HandleConnectedL( TInt aCallId )
   197     {
   181     {
   198     __LOGMETHODSTARTEND( EPhoneUIStates, "CPhoneCallSetupAndWaiting::HandleConnectedL() ");
   182     __LOGMETHODSTARTEND( EPhoneUIStates, "CPhoneCallSetupAndWaiting::HandleConnectedL() ");
   199 
   183     BeginUiUpdateLC();
   200     CPhoneState::BeginUiUpdateLC();
       
   201 
       
   202     // Update bubble
       
   203     TPhoneCmdParamCallHeaderData callHeaderParam;
   184     TPhoneCmdParamCallHeaderData callHeaderParam;
   204     callHeaderParam.SetCallState( EPEStateConnected );
   185     callHeaderParam.SetCallState( EPEStateConnected );
   205     iViewCommandHandle->ExecuteCommandL( EPhoneViewUpdateBubble, aCallId,
   186     iViewCommandHandle->ExecuteCommandL( EPhoneViewUpdateBubble, aCallId,
   206         &callHeaderParam );
   187         &callHeaderParam );
   207 
   188     
   208     // Update Touch buttons
   189     SetTouchPaneButtons( EPhoneWaitingCallButtons );
   209     CPhoneState::SetTouchPaneButtons( EPhoneWaitingCallButtons );
   190     EndUiUpdate();
   210 
   191     
   211     CPhoneState::EndUiUpdate();
   192     if ( IsNumberEntryUsedL() )
   212 
   193         {
   213     if ( CPhoneState::IsNumberEntryUsedL() )
       
   214         {
       
   215         // Show number entry
       
   216         TPhoneCmdParamBoolean booleanParam;
   194         TPhoneCmdParamBoolean booleanParam;
   217         booleanParam.SetBoolean( ETrue );
   195         booleanParam.SetBoolean( ETrue );
   218         iViewCommandHandle->ExecuteCommandL( EPhoneViewSetNumberEntryVisible, &booleanParam );
   196         iViewCommandHandle->ExecuteCommandL( EPhoneViewSetNumberEntryVisible, &booleanParam );
   219         }
   197         }
   220 
       
   221     // Go to Single And Waiting state
       
   222     UpdateCbaL( EPhoneCallHandlingCallWaitingCBA );
   198     UpdateCbaL( EPhoneCallHandlingCallWaitingCBA );
   223     iStateMachine->ChangeState( EPhoneStateWaitingInSingle );
   199     iStateMachine->ChangeState( EPhoneStateWaitingInSingle );
   224     }
   200     }
   225 
   201 
   226 // End of File
   202 // End of File