phoneapp/phoneuistates/src/cphonetwosinglesandwaiting.cpp
changeset 77 2be0b271d017
parent 72 c76a0b1755b9
child 76 cfea66083b62
equal deleted inserted replaced
72:c76a0b1755b9 77:2be0b271d017
   111         "CPhoneTwoSinglesAndWaiting::HandleKeyMessageL()");
   111         "CPhoneTwoSinglesAndWaiting::HandleKeyMessageL()");
   112     switch ( aCode )
   112     switch ( aCode )
   113         {
   113         {
   114         case EKeyYes: // send-key
   114         case EKeyYes: // send-key
   115             {
   115             {
   116             if( IsNumberEntryVisibleL() )
   116             if( iNumberEntryManager->IsNumberEntryVisibleL() )
   117                 {
   117                 {
   118                 CallFromNumberEntryL();
   118                 iNumberEntryManager->CallFromNumberEntryL();
   119                 }
   119                 }
   120             else
   120             else
   121                 {
   121                 {
   122                 // Waiting call bubble is over number entry
   122                 // Waiting call bubble is over number entry
   123                 // so display not allowed note because we
   123                 // so display not allowed note because we
   132             break;
   132             break;
   133         }
   133         }
   134     }
   134     }
   135 
   135 
   136 // -----------------------------------------------------------
   136 // -----------------------------------------------------------
   137 // CPhoneTwoSinglesAndWaiting::HandleKeyEventL
       
   138 // -----------------------------------------------------------
       
   139 //
       
   140 void CPhoneTwoSinglesAndWaiting::HandleKeyEventL(
       
   141     const TKeyEvent& aKeyEvent,
       
   142     TEventCode /*aEventCode*/ )
       
   143     {
       
   144     if( EKeyDeviceF == aKeyEvent.iCode )
       
   145         {
       
   146         __PHONELOG( EBasic, EPhoneUIStates,
       
   147             "CPhoneTwoSinglesAndWaiting::HandleKeyMessageL-deviceF" );
       
   148         HandleHoldSwitchL();
       
   149         }
       
   150     }
       
   151 
       
   152 // -----------------------------------------------------------
       
   153 // CPhoneTwoSinglesAndWaiting::HandlePhoneEngineMessageL
   137 // CPhoneTwoSinglesAndWaiting::HandlePhoneEngineMessageL
   154 // -----------------------------------------------------------
   138 // -----------------------------------------------------------
   155 //
   139 //
   156 void CPhoneTwoSinglesAndWaiting::HandlePhoneEngineMessageL( 
   140 void CPhoneTwoSinglesAndWaiting::HandlePhoneEngineMessageL( 
   157     const TInt aMessage, 
   141     const TInt aMessage, 
   163         {
   147         {
   164         case MEngineMonitor::EPEMessageIdle:
   148         case MEngineMonitor::EPEMessageIdle:
   165             HandleIdleL( aCallId );
   149             HandleIdleL( aCallId );
   166             break;
   150             break;
   167         case MEngineMonitor::EPEMessageConnected:
   151         case MEngineMonitor::EPEMessageConnected:
   168             UpdateInCallCbaL();
   152             UpdateUiCommands();
   169             CPhoneTwoSingles::HandlePhoneEngineMessageL( aMessage, aCallId );
   153             CPhoneTwoSingles::HandlePhoneEngineMessageL( aMessage, aCallId );
   170             break;           
   154             break;           
   171         default:
   155         default:
   172             CPhoneTwoSingles::HandlePhoneEngineMessageL( aMessage, aCallId );
   156             CPhoneTwoSingles::HandlePhoneEngineMessageL( aMessage, aCallId );
   173             break;
   157             break;
   224 //
   208 //
   225 void CPhoneTwoSinglesAndWaiting::StateTransitionToTwoSinglesL()
   209 void CPhoneTwoSinglesAndWaiting::StateTransitionToTwoSinglesL()
   226     {
   210     {
   227     __LOGMETHODSTARTEND( EPhoneUIStates, 
   211     __LOGMETHODSTARTEND( EPhoneUIStates, 
   228         "CPhoneTwoSinglesAndWaiting::StateTransitionToTwoSinglesL()");
   212         "CPhoneTwoSinglesAndWaiting::StateTransitionToTwoSinglesL()");
   229     if ( IsNumberEntryUsedL() )
   213     iNumberEntryManager->SetVisibilityIfNumberEntryUsedL(ETrue);
   230         {
   214     
   231         if ( NeedToSendToBackgroundL() )
   215     UpdateUiCommands();
   232             {
   216     iStateMachine->ChangeState( EPhoneStateTwoSingles );
   233             iViewCommandHandle->ExecuteCommandL( EPhoneViewSendToBackground );
       
   234             UpdateCbaL( EPhoneCallHandlingInCallCBA );
       
   235             }
       
   236         else
       
   237             {
       
   238             SetNumberEntryVisibilityL(ETrue);
       
   239             }
       
   240         } 
       
   241     else
       
   242         {
       
   243         // Set Two singles softkeys
       
   244         UpdateCbaL( EPhoneCallHandlingNewCallSwapCBA );
       
   245         
       
   246         // If numberentry is not open just check NeedToSendToBackgroundL and 
       
   247         // sendbackround if needed.
       
   248         if ( NeedToSendToBackgroundL() )
       
   249             {
       
   250             iViewCommandHandle->ExecuteCommandL( EPhoneViewSendToBackground );
       
   251             }
       
   252         }
       
   253 
       
   254     if( FeatureManager::FeatureSupported( KFeatureIdFfTouchUnlockStroke ) 
       
   255         && iStateMachine->PhoneStorage()->IsScreenLocked() )
       
   256         {
       
   257         EnableCallUIL();
       
   258         }
       
   259     
       
   260     iStateMachine->PhoneStorage()->ResetBlockedKeysList();
       
   261     SetTouchPaneButtons( EPhoneTwoSinglesButtons );
       
   262     iStateMachine->ChangeState( EPhoneStateTwoSingles );                     
       
   263     }
   217     }
   264 
   218 
   265 // -----------------------------------------------------------
   219 // -----------------------------------------------------------
   266 // CPhoneTwoSinglesAndWaiting::StateTransitionToSingleAndWaitingL
   220 // CPhoneTwoSinglesAndWaiting::StateTransitionToSingleAndWaitingL
   267 // -----------------------------------------------------------
   221 // -----------------------------------------------------------
   268 //
   222 //
   269 void CPhoneTwoSinglesAndWaiting::StateTransitionToSingleAndWaitingL()
   223 void CPhoneTwoSinglesAndWaiting::StateTransitionToSingleAndWaitingL()
   270     {
   224     {
   271     __LOGMETHODSTARTEND( EPhoneUIStates, 
   225     __LOGMETHODSTARTEND( EPhoneUIStates, 
   272         "CPhoneTwoSinglesAndWaiting::StateTransitionToSingleAndWaitingL()")
   226         "CPhoneTwoSinglesAndWaiting::StateTransitionToSingleAndWaitingL()")
   273     TPhoneCmdParamInteger callIdParam;
   227     UpdateUiCommands();
   274     iViewCommandHandle->ExecuteCommandL( 
       
   275             EPhoneViewGetExpandedBubbleCallId, &callIdParam );
       
   276     
       
   277     if ( callIdParam.Integer()!=iRingingCallId )
       
   278         {
       
   279         CPhoneGsmInCall::UpdateInCallCbaL();
       
   280         } 
       
   281     else 
       
   282         {
       
   283         UpdateCbaL( EPhoneCallHandlingCallWaitingCBA );
       
   284         }
       
   285     CheckDisableHWKeysAndCallUIL();
       
   286     SetTouchPaneButtons( EPhoneWaitingCallButtons );
       
   287     iStateMachine->ChangeState( EPhoneStateWaitingInSingle );
   228     iStateMachine->ChangeState( EPhoneStateWaitingInSingle );
   288     }
   229     }
   289 
   230 
   290 // -----------------------------------------------------------
   231 // -----------------------------------------------------------
   291 // CPhoneTwoSinglesAndWaiting::HandleConnectedConferenceL
   232 // CPhoneTwoSinglesAndWaiting::HandleConnectedConferenceL
   294 void CPhoneTwoSinglesAndWaiting::HandleConnectedConferenceL( TInt aCallId )
   235 void CPhoneTwoSinglesAndWaiting::HandleConnectedConferenceL( TInt aCallId )
   295     {
   236     {
   296     __LOGMETHODSTARTEND( EPhoneUIStates, 
   237     __LOGMETHODSTARTEND( EPhoneUIStates, 
   297         "CPhoneTwoSinglesAndWaiting::HandleConnectedConferenceL()");
   238         "CPhoneTwoSinglesAndWaiting::HandleConnectedConferenceL()");
   298     BeginUiUpdateLC();
   239     BeginUiUpdateLC();
   299     
   240 
   300     TInt callLabelId;
   241     iViewCommandHandle->ExecuteCommandL( EPhoneViewCreateConference, aCallId );
   301     TBuf<KPhoneCallHeaderLabelMaxLength> conferenceText( KNullDesC );
   242     UpdateUiCommands();
   302     callLabelId = CPhoneMainResourceResolver::Instance()->
       
   303             ResolveResourceID( EPhoneCLIConferenceCall );
       
   304     StringLoader::Load( 
       
   305         conferenceText, 
       
   306         callLabelId, 
       
   307         CCoeEnv::Static() );
       
   308     
       
   309     TPhoneCmdParamCallHeaderData callHeaderParam;
       
   310     callHeaderParam.SetCLIText( conferenceText, TPhoneCmdParamCallHeaderData::ERight );
       
   311     callHeaderParam.SetCallState(EPEStateConnectedConference);
       
   312     callHeaderParam.SetCiphering(
       
   313         iStateMachine->PhoneEngineInfo()->IsSecureCall( aCallId ) );
       
   314     callHeaderParam.SetCipheringIndicatorAllowed(
       
   315         iStateMachine->PhoneEngineInfo()->SecureSpecified() );
       
   316     // Service identifier must be given so that service specific settings
       
   317     // can be taken into account at phoneuiview.
       
   318     callHeaderParam.SetServiceId( 
       
   319         iStateMachine->PhoneEngineInfo()->ServiceId( aCallId ) );
       
   320     
       
   321     CheckDisableHWKeysAndCallUIL();
       
   322 
       
   323     iViewCommandHandle->ExecuteCommandL( EPhoneViewCreateConference, aCallId,
       
   324         &callHeaderParam );
       
   325         
       
   326     // Clear the flag
       
   327     TPhoneCmdParamBoolean booleanParam;
       
   328     booleanParam.SetBoolean( EFalse );
       
   329     iViewCommandHandle->ExecuteCommandL( 
       
   330         EPhoneViewSetNeedToSendToBackgroundStatus, &booleanParam );
       
   331     
       
   332     SetTouchPaneButtons( EPhoneWaitingCallButtons );
       
   333     UpdateCbaL( EPhoneCallHandlingCallWaitingCBA );
       
   334     EndUiUpdate();
   243     EndUiUpdate();
   335     iStateMachine->ChangeState( EPhoneStateConferenceAndWaiting );
   244     iStateMachine->ChangeState( EPhoneStateConferenceAndWaiting );
   336     }
   245     }
   337     
       
   338 // -----------------------------------------------------------
       
   339 // CPhoneTwoSinglesAndWaiting::UpdateInCallCbaL
       
   340 // -----------------------------------------------------------
       
   341 //
       
   342 void CPhoneTwoSinglesAndWaiting::UpdateInCallCbaL()
       
   343     {
       
   344     __LOGMETHODSTARTEND( EPhoneUIStates, 
       
   345         "CPhoneTwoSinglesAndWaiting::UpdateInCallCbaL()");
       
   346     TPhoneCmdParamInteger callIdParam;
       
   347     iViewCommandHandle->ExecuteCommandL( 
       
   348             EPhoneViewGetExpandedBubbleCallId, &callIdParam );
       
   349     if ( callIdParam.Integer()!=iRingingCallId )
       
   350         {
       
   351         CPhoneGsmInCall::UpdateInCallCbaL();
       
   352         } 
       
   353     else 
       
   354         {
       
   355         iCbaManager->SetCbaL( EPhoneCallHandlingIncomingRejectCBA );
       
   356         }
       
   357     }
       
   358 
   246 
   359 // -----------------------------------------------------------
   247 // -----------------------------------------------------------
   360 // CPhoneTwoSinglesAndWaiting::HandleNumberEntryClearedL()
   248 // CPhoneTwoSinglesAndWaiting::HandleNumberEntryClearedL()
   361 // -----------------------------------------------------------
   249 // -----------------------------------------------------------
   362 //
   250 //
   363 void CPhoneTwoSinglesAndWaiting::HandleNumberEntryClearedL()
   251 void CPhoneTwoSinglesAndWaiting::HandleNumberEntryClearedL()
   364     {
   252     {
   365     __LOGMETHODSTARTEND( EPhoneUIStates, 
   253     __LOGMETHODSTARTEND( EPhoneUIStates, 
   366         "CPhoneTwoSinglesAndWaiting::HandleNumberEntryClearedL()");
   254         "CPhoneTwoSinglesAndWaiting::HandleNumberEntryClearedL()");
   367     UpdateCbaL( EPhoneCallHandlingCallWaitingCBA );
   255     UpdateUiCommands();
   368     }
   256     }
   369 
   257 
   370 // -----------------------------------------------------------
   258 // -----------------------------------------------------------
   371 // CPhoneTwoSinglesAndWaiting::HandleCommandL
   259 // CPhoneTwoSinglesAndWaiting::HandleCommandL
   372 // -----------------------------------------------------------
   260 // -----------------------------------------------------------
   395 // -----------------------------------------------------------
   283 // -----------------------------------------------------------
   396 //
   284 //
   397 void CPhoneTwoSinglesAndWaiting::UpdateUiControlsL()
   285 void CPhoneTwoSinglesAndWaiting::UpdateUiControlsL()
   398     {
   286     {
   399     __LOGMETHODSTARTEND( EPhoneUIStates, "CPhoneSingleAndWaiting::UpdateUiControlsL( ) ");
   287     __LOGMETHODSTARTEND( EPhoneUIStates, "CPhoneSingleAndWaiting::UpdateUiControlsL( ) ");
   400     UpdateInCallCbaL();
   288     UpdateUiCommands();
   401     }
   289     }
   402 
   290 
   403 // End of File
   291 // End of File