phoneapp/phoneuistates/src/cphonecallsetupandwaiting.cpp
changeset 56 5bcb308bd24d
parent 37 ba76fc04e6c2
child 65 2a5d4ab426d3
equal deleted inserted replaced
46:bc5a64e5bc3c 56:5bcb308bd24d
   118             break;
   118             break;
   119         }
   119         }
   120     }
   120     }
   121 
   121 
   122 // -----------------------------------------------------------
   122 // -----------------------------------------------------------
   123 // CPhoneCallSetupAndWaiting::OpenMenuBarL
       
   124 // -----------------------------------------------------------
       
   125 //
       
   126 void CPhoneCallSetupAndWaiting::OpenMenuBarL()
       
   127     {
       
   128     __LOGMETHODSTARTEND( EPhoneUIStates,
       
   129         "CPhoneCallSetupAndWaiting::OpenMenuBarL()");
       
   130     TInt resourceId;
       
   131 
       
   132     if ( iOnScreenDialer && IsDTMFEditorVisibleL() )
       
   133         {
       
   134         resourceId = EPhoneDtmfDialerMenubar;
       
   135         }
       
   136     else if ( IsNumberEntryVisibleL() )
       
   137         {
       
   138         resourceId = EPhoneAlertingAndWaitingCallMenuBarWithNumberEntry;
       
   139         }
       
   140     else
       
   141         {
       
   142         resourceId = EPhoneAlertingAndWaitingCallMenuBar;
       
   143         }
       
   144 
       
   145     TPhoneCmdParamInteger integerParam;
       
   146     integerParam.SetInteger(
       
   147         CPhoneMainResourceResolver::Instance()->
       
   148         ResolveResourceID( resourceId ) );
       
   149     iViewCommandHandle->ExecuteCommandL( EPhoneViewMenuBarOpen,
       
   150         &integerParam );
       
   151     }
       
   152 
       
   153 // -----------------------------------------------------------
       
   154 // CPhoneCallSetupAndWaiting::HandleIdleL
   123 // CPhoneCallSetupAndWaiting::HandleIdleL
   155 // -----------------------------------------------------------
   124 // -----------------------------------------------------------
   156 //
   125 //
   157 void CPhoneCallSetupAndWaiting::HandleIdleL( TInt aCallId )
   126 void CPhoneCallSetupAndWaiting::HandleIdleL( TInt aCallId )
   158     {
   127     {
   161 
   130 
   162     BeginUiUpdateLC();
   131     BeginUiUpdateLC();
   163 
   132 
   164     // Remove call
   133     // Remove call
   165     iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveCallHeader, aCallId );
   134     iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveCallHeader, aCallId );
   166 
       
   167     // Close menu bar, if it is displayed
       
   168     iViewCommandHandle->ExecuteCommandL( EPhoneViewMenuBarClose );
       
   169 
   135 
   170     // Find out do we have waiting or outgoing call left
   136     // Find out do we have waiting or outgoing call left
   171     TPhoneCmdParamCallStateData callStateData;
   137     TPhoneCmdParamCallStateData callStateData;
   172     callStateData.SetCallState( EPEStateRinging );
   138     callStateData.SetCallState( EPEStateRinging );
   173     iViewCommandHandle->HandleCommandL( EPhoneViewGetCallIdByState,
   139     iViewCommandHandle->HandleCommandL( EPhoneViewGetCallIdByState,
   174         &callStateData );
   140         &callStateData );
   175 
   141 
   176     if( callStateData.CallId() > KErrNotFound )
   142     if( callStateData.CallId() > KErrNotFound )
   177         {
   143         {
   178         // Idle message came for callSetup
       
   179 
       
   180         if ( iOnScreenDialer && IsDTMFEditorVisibleL()  )
       
   181             {
       
   182             CloseDTMFEditorL();
       
   183             }
       
   184 
   144 
   185         // Display ringing bubble
   145         // Display ringing bubble
   186         TPhoneCmdParamCallHeaderData callHeaderParam;
   146         TPhoneCmdParamCallHeaderData callHeaderParam;
   187         callHeaderParam.SetCallState( EPEStateRinging );
   147         callHeaderParam.SetCallState( EPEStateRinging );
   188 
   148 
   192             callStateData.CallId(),
   152             callStateData.CallId(),
   193             &callHeaderParam );
   153             &callHeaderParam );
   194 
   154 
   195         // Show incoming call buttons
   155         // Show incoming call buttons
   196         SetTouchPaneButtons( EPhoneIncomingCallButtons );
   156         SetTouchPaneButtons( EPhoneIncomingCallButtons );
   197         SetTouchPaneButtonEnabled( EPhoneCallComingCmdSilent );
       
   198 
   157 
   199         // Bring up callhandling view
   158         // Bring up callhandling view
   200         BringIncomingToForegroundL();
   159         BringIncomingToForegroundL();
   201 
   160 
   202         // state changes to Incoming
   161         // state changes to Incoming
   203         iCbaManager->UpdateIncomingCbaL( callStateData.CallId() );
   162         iCbaManager->UpdateIncomingCbaL( callStateData.CallId() );
   204         UpdateSilenceButtonDimming();
       
   205         SetRingingTonePlaybackL( callStateData.CallId() );
   163         SetRingingTonePlaybackL( callStateData.CallId() );
   206         SetBackButtonActive(EFalse);
   164         SetBackButtonActive(EFalse);
   207         iStateMachine->ChangeState( EPhoneStateIncoming );
   165         iStateMachine->ChangeState( EPhoneStateIncoming );
   208         }
   166         }
   209 
   167 
   237 //
   195 //
   238 void CPhoneCallSetupAndWaiting::HandleConnectedL( TInt aCallId )
   196 void CPhoneCallSetupAndWaiting::HandleConnectedL( TInt aCallId )
   239     {
   197     {
   240     __LOGMETHODSTARTEND( EPhoneUIStates, "CPhoneCallSetupAndWaiting::HandleConnectedL() ");
   198     __LOGMETHODSTARTEND( EPhoneUIStates, "CPhoneCallSetupAndWaiting::HandleConnectedL() ");
   241 
   199 
   242     // Close menu bar, if it is displayed
       
   243     iViewCommandHandle->ExecuteCommandL( EPhoneViewMenuBarClose );
       
   244 
       
   245     CPhoneState::BeginUiUpdateLC();
   200     CPhoneState::BeginUiUpdateLC();
   246 
   201 
   247     // Update bubble
   202     // Update bubble
   248     TPhoneCmdParamCallHeaderData callHeaderParam;
   203     TPhoneCmdParamCallHeaderData callHeaderParam;
   249     callHeaderParam.SetCallState( EPEStateConnected );
   204     callHeaderParam.SetCallState( EPEStateConnected );
   250     iViewCommandHandle->ExecuteCommandL( EPhoneViewUpdateBubble, aCallId,
   205     iViewCommandHandle->ExecuteCommandL( EPhoneViewUpdateBubble, aCallId,
   251         &callHeaderParam );
   206         &callHeaderParam );
   252 
   207 
   253     // Update Touch buttons
   208     // Update Touch buttons
   254     CPhoneState::SetTouchPaneButtons( EPhoneWaitingCallButtons );
   209     CPhoneState::SetTouchPaneButtons( EPhoneWaitingCallButtons );
   255     SetToolbarDimming( EFalse );
       
   256 
   210 
   257     CPhoneState::EndUiUpdate();
   211     CPhoneState::EndUiUpdate();
   258 
   212 
   259     if ( CPhoneState::IsNumberEntryUsedL() )
   213     if ( CPhoneState::IsNumberEntryUsedL() )
   260         {
   214         {