phoneapp/phoneuistates/src/cphoneconferenceandsingle.cpp
changeset 77 2be0b271d017
parent 72 c76a0b1755b9
child 76 cfea66083b62
equal deleted inserted replaced
72:c76a0b1755b9 77:2be0b271d017
   152             HandleSendL();
   152             HandleSendL();
   153             break;
   153             break;
   154                     
   154                     
   155         case EAknSoftkeyCancel:
   155         case EAknSoftkeyCancel:
   156             commandStatus = CPhoneConference::HandleCommandL( aCommand );
   156             commandStatus = CPhoneConference::HandleCommandL( aCommand );
   157             SetTouchPaneButtons( EPhoneConferenceAndHeldSingleButtons );
   157             UpdateUiCommands();
   158             break;
   158             break;
   159             
   159             
   160         case EPhoneInCallCmdJoin:
   160         case EPhoneInCallCmdJoin:
   161             iStateMachine->SendPhoneEngineMessage(
   161             iStateMachine->SendPhoneEngineMessage(
   162                 CPEPhoneModelIF::EPEMessageAddConferenceMember );
   162                 CPEPhoneModelIF::EPEMessageAddConferenceMember );
   176 // CPhoneConferenceAndSingle::HandleConnectedConferenceL
   176 // CPhoneConferenceAndSingle::HandleConnectedConferenceL
   177 // -----------------------------------------------------------
   177 // -----------------------------------------------------------
   178 //
   178 //
   179 void CPhoneConferenceAndSingle::HandleConnectedConferenceL()
   179 void CPhoneConferenceAndSingle::HandleConnectedConferenceL()
   180     {
   180     {
   181     __LOGMETHODSTARTEND( EPhoneUIStates, "CPhoneConferenceAndSingle::HandleConnectedConferenceL");
   181     __LOGMETHODSTARTEND( EPhoneUIStates, 
   182     TPhoneCmdParamCallHeaderData callHeaderParam;
   182             "CPhoneConferenceAndSingle::HandleConnectedConferenceL");
   183     callHeaderParam.SetCallState( EPEStateConnectedConference );
       
   184 
       
   185     TBuf<KPhoneCallHeaderLabelMaxLength> conferenceText( KNullDesC );
       
   186     TInt callLabelId = CPhoneMainResourceResolver::Instance()->
       
   187             ResolveResourceID( EPhoneCLIConferenceCall );
       
   188 
       
   189     StringLoader::Load( 
       
   190         conferenceText, 
       
   191         callLabelId, 
       
   192         CCoeEnv::Static() );        
       
   193     callHeaderParam.SetLabelText( conferenceText );
       
   194             
       
   195     // Conference call is no longer on hold
       
   196     TPhoneCmdParamBoolean holdFlag;
       
   197     holdFlag.SetBoolean( EFalse );
       
   198     iViewCommandHandle->ExecuteCommandL( EPhoneViewSetHoldFlag, &holdFlag );
       
   199     
       
   200     BeginUiUpdateLC();
   183     BeginUiUpdateLC();
   201     iViewCommandHandle->ExecuteCommandL( 
   184     iViewCommandHandle->ExecuteCommandL( 
   202         EPhoneViewUpdateBubble, KConferenceCallId, &callHeaderParam );
   185         EPhoneViewUpdateBubble, 
   203     
   186         KConferenceCallId );
   204     SetTouchPaneButtons( EPhoneConferenceAndHeldSingleButtons );
   187     UpdateUiCommands();
   205     UpdateInCallCbaL();
       
   206     EndUiUpdate();
   188     EndUiUpdate();
   207     }
   189     }
   208 
   190 
   209 // -----------------------------------------------------------
   191 // -----------------------------------------------------------
   210 // CPhoneConferenceAndSingle::HandleHeldConferenceL
   192 // CPhoneConferenceAndSingle::HandleHeldConferenceL
   213 // -----------------------------------------------------------
   195 // -----------------------------------------------------------
   214 //
   196 //
   215 void CPhoneConferenceAndSingle::HandleHeldConferenceL()
   197 void CPhoneConferenceAndSingle::HandleHeldConferenceL()
   216     {
   198     {
   217     __LOGMETHODSTARTEND( EPhoneUIStates, "CPhoneConferenceAndSingle::HandleHeldConferenceL");
   199     __LOGMETHODSTARTEND( EPhoneUIStates, "CPhoneConferenceAndSingle::HandleHeldConferenceL");
   218     TPhoneCmdParamCallHeaderData callHeaderParam;
       
   219     callHeaderParam.SetCallState( EPEStateHeldConference );
       
   220     TInt callLabelId;
       
   221     TBuf<KPhoneCallHeaderLabelMaxLength> labelText( KNullDesC );
       
   222     callLabelId = CPhoneMainResourceResolver::Instance()->
       
   223             ResolveResourceID( EPhoneCallOnHold );
       
   224     StringLoader::Load( 
       
   225         labelText, 
       
   226         callLabelId, 
       
   227         CCoeEnv::Static() );        
       
   228     callHeaderParam.SetLabelText( labelText );
       
   229     BeginUiUpdateLC();
   200     BeginUiUpdateLC();
   230     
   201     
   231     iViewCommandHandle->ExecuteCommandL( 
   202     iViewCommandHandle->ExecuteCommandL( 
   232         EPhoneViewUpdateBubble, KConferenceCallId, &callHeaderParam );
   203         EPhoneViewUpdateBubble, KConferenceCallId );
   233     SetTouchPaneButtons( EPhoneConferenceAndSingleButtons );
   204     UpdateUiCommands();
   234     
       
   235     EndUiUpdate();
   205     EndUiUpdate();
   236     }
   206     }
   237 
   207 
   238 // -----------------------------------------------------------
   208 // -----------------------------------------------------------
   239 // CPhoneConferenceAndSingle::HandleConnectedL
   209 // CPhoneConferenceAndSingle::HandleConnectedL
   240 // -----------------------------------------------------------
   210 // -----------------------------------------------------------
   241 //
   211 //
   242 void CPhoneConferenceAndSingle::HandleConnectedL( TInt aCallId )
   212 void CPhoneConferenceAndSingle::HandleConnectedL( TInt aCallId )
   243     {
   213     {
   244     __LOGMETHODSTARTEND( EPhoneUIStates, "CPhoneConferenceAndSingle::HandleConnectedL");
   214     __LOGMETHODSTARTEND( EPhoneUIStates, "CPhoneConferenceAndSingle::HandleConnectedL");
   245     TPhoneCmdParamCallHeaderData callHeaderParam;
   215     iViewCommandHandle->ExecuteCommandL( EPhoneViewUpdateBubble, aCallId );
   246     callHeaderParam.SetCallState( EPEStateConnected );
   216     UpdateUiCommands();
   247     iViewCommandHandle->ExecuteCommandL( EPhoneViewUpdateBubble, aCallId, 
       
   248         &callHeaderParam );
       
   249     UpdateInCallCbaL();
       
   250     SetTouchPaneButtons( EPhoneConferenceButtons );
       
   251     }
   217     }
   252 
   218 
   253 // -----------------------------------------------------------
   219 // -----------------------------------------------------------
   254 // CPhoneConferenceAndSingle::HandleHeldL
   220 // CPhoneConferenceAndSingle::HandleHeldL
   255 // -----------------------------------------------------------
   221 // -----------------------------------------------------------
   256 //
   222 //
   257 void CPhoneConferenceAndSingle::HandleHeldL( TInt aCallId )
   223 void CPhoneConferenceAndSingle::HandleHeldL( TInt aCallId )
   258     {
   224     {
   259     __LOGMETHODSTARTEND( EPhoneUIStates, "CPhoneConferenceAndSingle::HandleHeldL");
   225     __LOGMETHODSTARTEND( EPhoneUIStates, "CPhoneConferenceAndSingle::HandleHeldL");
   260     TPhoneCmdParamCallHeaderData callHeaderParam;
   226     iViewCommandHandle->ExecuteCommandL( EPhoneViewUpdateBubble, aCallId );
   261     callHeaderParam.SetCallState( EPEStateHeld );
   227     UpdateUiCommands();
   262     
       
   263     TBuf<KPhoneCallHeaderLabelMaxLength> labelText( KNullDesC );
       
   264     TInt callLabelId = CPhoneMainResourceResolver::Instance()->
       
   265             ResolveResourceID( EPhoneCallOnHold );
       
   266     StringLoader::Load( 
       
   267         labelText, 
       
   268         callLabelId, 
       
   269         CCoeEnv::Static() );        
       
   270     callHeaderParam.SetLabelText( labelText );
       
   271     iViewCommandHandle->ExecuteCommandL( EPhoneViewUpdateBubble, aCallId, 
       
   272         &callHeaderParam );
       
   273     SetTouchPaneButtons( EPhoneConferenceButtons );
       
   274     }
   228     }
   275 
   229 
   276 // -----------------------------------------------------------
   230 // -----------------------------------------------------------
   277 // CPhoneConferenceAndSingle::HandleAddedConferenceMemberL
   231 // CPhoneConferenceAndSingle::HandleAddedConferenceMemberL
   278 // -----------------------------------------------------------
   232 // -----------------------------------------------------------
   281     {
   235     {
   282     __LOGMETHODSTARTEND( EPhoneUIStates, "CPhoneConferenceAndSingle::HandleAddedConferenceMemberL");
   236     __LOGMETHODSTARTEND( EPhoneUIStates, "CPhoneConferenceAndSingle::HandleAddedConferenceMemberL");
   283     BeginUiUpdateLC();
   237     BeginUiUpdateLC();
   284     iViewCommandHandle->ExecuteCommandL( EPhoneViewAddToConference );
   238     iViewCommandHandle->ExecuteCommandL( EPhoneViewAddToConference );
   285     UpdateConferenceSecurityStatusL( aCallId );
   239     UpdateConferenceSecurityStatusL( aCallId );
   286     SetTouchPaneButtons( EPhoneConferenceButtons );
   240     UpdateUiCommands();
   287     EndUiUpdate();
   241     EndUiUpdate();
   288     UpdateCbaL( EPhoneCallHandlingInCallCBA );
       
   289     iStateMachine->ChangeState( EPhoneStateConference );
   242     iStateMachine->ChangeState( EPhoneStateConference );
   290     }
       
   291 
       
   292 // -----------------------------------------------------------
       
   293 // CPhoneConferenceAndSingle::UpdateInCallCbaL
       
   294 // -----------------------------------------------------------
       
   295 //
       
   296 void CPhoneConferenceAndSingle::UpdateInCallCbaL()
       
   297     {
       
   298     __LOGMETHODSTARTEND(EPhoneControl, "CPhoneConferenceAndSingle::UpdateInCallCbaL() ");
       
   299     UpdateCbaL ( EPhoneCallHandlingNewCallSwapCBA );
       
   300     }
   243     }
   301 
   244 
   302 // -----------------------------------------------------------
   245 // -----------------------------------------------------------
   303 // CPhoneConferenceAndSingle::HandleIncomingL
   246 // CPhoneConferenceAndSingle::HandleIncomingL
   304 // -----------------------------------------------------------
   247 // -----------------------------------------------------------
   305 //
   248 //
   306 void CPhoneConferenceAndSingle::HandleIncomingL( TInt aCallId )
   249 void CPhoneConferenceAndSingle::HandleIncomingL( TInt aCallId )
   307     {
   250     {
   308     __LOGMETHODSTARTEND( EPhoneUIStates, 
   251     __LOGMETHODSTARTEND( EPhoneUIStates, 
   309         "CPhoneConferenceAndSingle::HandleIncomingL");
   252         "CPhoneConferenceAndSingle::HandleIncomingL");
   310     BeginUiUpdateLC(); 
   253     DisplayCallHeaderL( aCallId, ECheckIfNEUsedBeforeSettingVisibilityFalse );
   311     
       
   312     TPhoneCmdParamBoolean dialerParam;
       
   313     dialerParam.SetBoolean( ETrue );
       
   314     AllowShowingOfWaitingCallHeaderL( dialerParam );
       
   315     
       
   316     iViewCommandHandle->ExecuteCommandL( EPhoneViewCloseFSW );
       
   317     
       
   318     CheckDisableHWKeysAndCallUIL();
       
   319     DisplayIncomingCallL( aCallId, dialerParam  );
       
   320     SetTouchPaneButtons( EPhoneWaitingCallButtons );
       
   321     
       
   322     EndUiUpdate();
       
   323     
       
   324     UpdateCbaL( EPhoneCallHandlingIncomingRejectCBA );
       
   325     iStateMachine->ChangeState( EPhoneStateConferenceAndSingleAndWaiting );
   254     iStateMachine->ChangeState( EPhoneStateConferenceAndSingleAndWaiting );
   326     }
   255     }
   327 
   256 
   328 // -----------------------------------------------------------
   257 // -----------------------------------------------------------
   329 // CPhoneConferenceAndSingle::HandleIdleL
   258 // CPhoneConferenceAndSingle::HandleIdleL
   344         }
   273         }
   345     else
   274     else
   346         {
   275         {
   347         BeginUiUpdateLC(); 
   276         BeginUiUpdateLC(); 
   348         iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveCallHeader, aCallId );
   277         iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveCallHeader, aCallId );
   349         SetTouchPaneButtons( EPhoneConferenceButtons );
   278         UpdateUiCommands();
   350         UpdateCbaL( EPhoneCallHandlingInCallCBA );
       
   351         EndUiUpdate();
   279         EndUiUpdate();
   352         iStateMachine->ChangeState( EPhoneStateConference );
   280         iStateMachine->ChangeState( EPhoneStateConference );
   353         }
   281         }
   354     }
   282     }
   355 
   283 
   389     __LOGMETHODSTARTEND( EPhoneUIStates, 
   317     __LOGMETHODSTARTEND( EPhoneUIStates, 
   390         "CPhoneConferenceAndSingle::HandleKeyMessageL()");
   318         "CPhoneConferenceAndSingle::HandleKeyMessageL()");
   391     switch ( aCode )
   319     switch ( aCode )
   392         {
   320         {
   393         case EKeyYes: // send-key
   321         case EKeyYes: // send-key
   394             if( IsNumberEntryVisibleL() )
   322             if( iNumberEntryManager->IsNumberEntryVisibleL() )
   395                 {
   323                 {
   396                 HandleSendL();
   324                 HandleSendL();
   397                 }
   325                 }
   398             else
   326             else
   399                 {
   327                 {
   424     iStateMachine->PhoneEngineInfo()->SetPhoneNumber( ptr ) ;
   352     iStateMachine->PhoneEngineInfo()->SetPhoneNumber( ptr ) ;
   425     
   353     
   426     if ( iStateMachine->PhoneEngineInfo()->PhoneNumberIsServiceCode() || 
   354     if ( iStateMachine->PhoneEngineInfo()->PhoneNumberIsServiceCode() || 
   427          phoneNumber->Des().Length() < KPhoneValidPhoneNumberLength )
   355          phoneNumber->Des().Length() < KPhoneValidPhoneNumberLength )
   428         {
   356         {
   429         CallFromNumberEntryL();
   357         iNumberEntryManager->CallFromNumberEntryL();
   430         }
   358         }
   431     else
   359     else
   432         {
   360         {
   433         iStateMachine->SendPhoneEngineMessage( 
   361         iStateMachine->SendPhoneEngineMessage( 
   434             MPEPhoneModel::EPEMessageCheckEmergencyNumber );
   362             MPEPhoneModel::EPEMessageCheckEmergencyNumber );