phoneapp/phoneuicontrol/src/cphonestatecallsetup.cpp
changeset 56 5bcb308bd24d
parent 46 bc5a64e5bc3c
child 65 2a5d4ab426d3
equal deleted inserted replaced
46:bc5a64e5bc3c 56:5bcb308bd24d
    80     {
    80     {
    81     __ASSERT_DEBUG( iStateMachine->PhoneEngineInfo(),
    81     __ASSERT_DEBUG( iStateMachine->PhoneEngineInfo(),
    82         Panic( EPhoneCtrlInvariant ) );
    82         Panic( EPhoneCtrlInvariant ) );
    83     
    83     
    84     CPhoneState::BaseConstructL();
    84     CPhoneState::BaseConstructL();
    85     
    85 
    86     // Enable the volume display
       
    87     iViewCommandHandle->ExecuteCommandL( EPhoneViewShowNaviPaneAudioVolume );   
       
    88     HandleAudioOutputChangedL();
    86     HandleAudioOutputChangedL();
    89     }
    87     }
    90 
    88 
    91 // -----------------------------------------------------------
    89 // -----------------------------------------------------------
    92 // CPhoneStateCallSetup::NewL()
    90 // CPhoneStateCallSetup::NewL()
   155                 iDtmfWaitCharTimer = CPhoneDtmfWaitCharTimer::NewL( 
   153                 iDtmfWaitCharTimer = CPhoneDtmfWaitCharTimer::NewL( 
   156                     iStateMachine );                    
   154                     iStateMachine );                    
   157                 }
   155                 }
   158             iDtmfWaitCharTimer->ButtonPressedL();
   156             iDtmfWaitCharTimer->ButtonPressedL();
   159             break;
   157             break;
   160                 
   158 
   161         case EPhoneDialerCmdHelpDtmf:
       
   162             {
       
   163             if ( FeatureManager::FeatureSupported( KFeatureIdHelp ) )
       
   164                 {                
       
   165                 TPtrC contextName( KDATA_DIALER_HLP_SEND_DTMF );
       
   166                 iViewCommandHandle->ExecuteCommandL( 
       
   167                     EPhoneViewLaunchHelpApplication,
       
   168                     0,
       
   169                     contextName );
       
   170                 }
       
   171             }
       
   172             break;
       
   173         
   159         
   174         case EPhoneCmdOptions:
   160         case EPhoneCmdOptions:
   175             OpenMenuBarL();
       
   176             break;
   161             break;
   177         
   162         
   178         case EPhoneInCallCmdDtmfManualQuery:
   163         case EPhoneInCallCmdDtmfManualQuery:
   179              if ( iOnScreenDialer )
       
   180                  {
       
   181                  ShowDtmfDialerL();
       
   182                  }
       
   183               break;    
   164               break;    
   184             
   165             
   185         case EPhoneDtmfDialerExit:      // fall through
   166         case EPhoneDtmfDialerExit:      // fall through
   186         case EPhoneDtmfDialerCancel:
   167         case EPhoneDtmfDialerCancel:
   187             CloseDTMFEditorL();
       
   188             break;
   168             break;
   189 
   169 
   190         case EPhoneInCallCmdMute: // fall through
   170         case EPhoneInCallCmdMute: // fall through
   191         case EPhoneInCallCmdUnmute:
   171         case EPhoneInCallCmdUnmute:
   192             iStateMachine->PhoneEngineInfo()->SetAudioMuteCommand( 
   172             iStateMachine->PhoneEngineInfo()->SetAudioMuteCommand( 
   201         }
   181         }
   202 
   182 
   203     return commandStatus;
   183     return commandStatus;
   204     }
   184     }
   205 
   185 
   206 // -----------------------------------------------------------
       
   207 // CPhoneStateCallSetup::OpenMenuBarL   
       
   208 // -----------------------------------------------------------
       
   209 //
       
   210 EXPORT_C void CPhoneStateCallSetup::OpenMenuBarL()
       
   211     {
       
   212     __LOGMETHODSTARTEND(EPhoneControl,  
       
   213         "CPhoneStateCallSetup::OpenMenuBarL()" );
       
   214 
       
   215     if ( iOnScreenDialer )
       
   216         {
       
   217         if ( IsDTMFEditorVisibleL() && IsNumberEntryVisibleL() )
       
   218             {
       
   219             TInt resourceId = EPhoneDtmfDialerMenubar;
       
   220             
       
   221             TPhoneCmdParamInteger integerParam;
       
   222             integerParam.SetInteger( 
       
   223                 CPhoneMainResourceResolver::Instance()->
       
   224                 ResolveResourceID( resourceId ) );
       
   225             iViewCommandHandle->ExecuteCommandL( EPhoneViewMenuBarOpen, 
       
   226                 &integerParam );
       
   227             }
       
   228         }
       
   229     }
       
   230 
   186 
   231 // -----------------------------------------------------------
   187 // -----------------------------------------------------------
   232 // CPhoneStateCallSetup::HandleNumberEntryClearedL()
   188 // CPhoneStateCallSetup::HandleNumberEntryClearedL()
   233 // -----------------------------------------------------------
   189 // -----------------------------------------------------------
   234 //
   190 //
   240     // Update call setup CBA when number entry is cleared
   196     // Update call setup CBA when number entry is cleared
   241     UpdateInCallCbaL();
   197     UpdateInCallCbaL();
   242     }
   198     }
   243 
   199 
   244 // -----------------------------------------------------------
   200 // -----------------------------------------------------------
   245 // CPhoneStateCallSetup::HandleCreateNumberEntryL
       
   246 // -----------------------------------------------------------
       
   247 //
       
   248 EXPORT_C void CPhoneStateCallSetup::HandleCreateNumberEntryL( 
       
   249         const TKeyEvent& /*aKeyEvent*/,
       
   250         TEventCode /*aEventCode*/)
       
   251     {
       
   252     __LOGMETHODSTARTEND(EPhoneControl,  
       
   253         "CPhoneStateCallSetup::HandleCreateNumberEntryL()" );
       
   254     
       
   255     }
       
   256 
       
   257 
       
   258 // -----------------------------------------------------------
       
   259 // CPhoneStateCallSetup::UpdateInCallCbaL
   201 // CPhoneStateCallSetup::UpdateInCallCbaL
   260 // -----------------------------------------------------------
   202 // -----------------------------------------------------------
   261 //
   203 //
   262 EXPORT_C void CPhoneStateCallSetup::UpdateInCallCbaL()
   204 EXPORT_C void CPhoneStateCallSetup::UpdateInCallCbaL()
   263     {
   205     {
   270 // -----------------------------------------------------------
   212 // -----------------------------------------------------------
   271 //
   213 //
   272 EXPORT_C void CPhoneStateCallSetup::UpdateCbaL( TInt aResource )
   214 EXPORT_C void CPhoneStateCallSetup::UpdateCbaL( TInt aResource )
   273     {
   215     {
   274     __LOGMETHODSTARTEND(EPhoneControl, "CPhoneStateCallSetup::UpdateCbaL() ");
   216     __LOGMETHODSTARTEND(EPhoneControl, "CPhoneStateCallSetup::UpdateCbaL() ");
   275     if ( iOnScreenDialer && IsDTMFEditorVisibleL() )
   217     iCbaManager->UpdateCbaL( aResource );   
   276         {
       
   277         iCbaManager->SetCbaL( EPhoneDtmfDialerCBA );        
       
   278         }
       
   279     else
       
   280         {
       
   281         iCbaManager->UpdateCbaL( aResource );   
       
   282         }
       
   283     }
   218     }
   284 
   219 
   285 // -----------------------------------------------------------
   220 // -----------------------------------------------------------
   286 // CPhoneStateCallSetup::HandleKeyEventL
   221 // CPhoneStateCallSetup::HandleKeyEventL
   287 // -----------------------------------------------------------
   222 // -----------------------------------------------------------
   373                     MPEPhoneModel::EPEMessageTerminateAllConnections );
   308                     MPEPhoneModel::EPEMessageTerminateAllConnections );
   374                 
   309                 
   375                 // Remove number entry if long press
   310                 // Remove number entry if long press
   376                 if ( IsNumberEntryUsedL() )
   311                 if ( IsNumberEntryUsedL() )
   377                     {
   312                     {
   378                     if ( iOnScreenDialer && IsDTMFEditorVisibleL() )
   313                     iViewCommandHandle->ExecuteCommandL( 
   379                         {
   314                         EPhoneViewRemoveNumberEntry );
   380                         CloseDTMFEditorL();
       
   381                         } 
       
   382                     else
       
   383                         {
       
   384                         iViewCommandHandle->ExecuteCommandL( 
       
   385                             EPhoneViewRemoveNumberEntry );
       
   386                         }
       
   387                     }
   315                     }
   388                 }
   316                 }
   389             else
   317             else
   390                 {                
   318                 {                
   391                 // handle end key
   319                 // handle end key
   576     // Keep Phone in the foreground
   504     // Keep Phone in the foreground
   577     TPhoneCmdParamBoolean booleanParam;
   505     TPhoneCmdParamBoolean booleanParam;
   578     booleanParam.SetBoolean( EFalse );
   506     booleanParam.SetBoolean( EFalse );
   579     iViewCommandHandle->ExecuteCommandL( 
   507     iViewCommandHandle->ExecuteCommandL( 
   580         EPhoneViewSetNeedToSendToBackgroundStatus, &booleanParam );
   508         EPhoneViewSetNeedToSendToBackgroundStatus, &booleanParam );
   581         
       
   582     // Close menu bar, if it is displayed
       
   583     iViewCommandHandle->ExecuteCommandL( EPhoneViewMenuBarClose );
       
   584     
   509     
   585     BeginUiUpdateLC();
   510     BeginUiUpdateLC();
   586         
   511  
   587     // Remove the number entry if it isn't DTMF dialer
       
   588     /*if ( !iOnScreenDialer || !IsNumberEntryVisibleL() || !IsDTMFEditorVisibleL() )
       
   589         {
       
   590         iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNumberEntry );
       
   591         }*/
       
   592     
       
   593     // Update the single call
   512     // Update the single call
   594     CPhoneState::UpdateSingleActiveCallL( aCallId );
   513     CPhoneState::UpdateSingleActiveCallL( aCallId );
   595             
   514             
   596     // Update touch buttons
   515     // Update touch buttons
   597     SetTouchPaneButtons( EPhoneIncallButtons );        
   516     SetTouchPaneButtons( EPhoneIncallButtons );        
   598 
   517 
   599     SetToolbarDimming( EFalse );
       
   600 
       
   601     EndUiUpdate();
   518     EndUiUpdate();
   602     
   519     
   603     // Go to single state
   520     // Go to single state
   604     UpdateCbaL( EPhoneCallHandlingInCallCBA );    
   521     UpdateCbaL( EPhoneCallHandlingInCallCBA );    
   605 
   522 
   612 //
   529 //
   613 void CPhoneStateCallSetup::HandleIdleL( TInt aCallId )
   530 void CPhoneStateCallSetup::HandleIdleL( TInt aCallId )
   614     {
   531     {
   615     __LOGMETHODSTARTEND(EPhoneControl, "CPhoneStateCallSetup::HandleIdleL()");
   532     __LOGMETHODSTARTEND(EPhoneControl, "CPhoneStateCallSetup::HandleIdleL()");
   616     
   533     
   617     BeginTransEffectLC ( ENumberEntryOpen );
       
   618     BeginUiUpdateLC ();
   534     BeginUiUpdateLC ();
   619     
   535     
   620     // Disable the volume display
   536     // Disable the volume display
   621     iViewCommandHandle->ExecuteCommandL( EPhoneViewHideNaviPaneAudioVolume );
   537     iViewCommandHandle->ExecuteCommandL( EPhoneViewHideNaviPaneAudioVolume );
   622 
   538 
   644          // Display idle screen
   560          // Display idle screen
   645         DisplayIdleScreenL();
   561         DisplayIdleScreenL();
   646         }
   562         }
   647         
   563         
   648     EndUiUpdate();
   564     EndUiUpdate();
   649     EndTransEffect(); 
       
   650     // Go to idle state
   565     // Go to idle state
   651     // No need update cba
   566     // No need update cba
   652     iStateMachine->ChangeState( EPhoneStateIdle );
   567     iStateMachine->ChangeState( EPhoneStateIdle );
   653     }
   568     }
   654 
   569 
   655 // -----------------------------------------------------------------------------
   570 // -----------------------------------------------------------------------------
   656 // CPhoneStateCallSetup::HandleRemoteTerminatedL
   571 // CPhoneStateCallSetup::HandleRemoteTerminatedL
   657 // -----------------------------------------------------------------------------
   572 // -----------------------------------------------------------------------------
   658 //
   573 //
   659 void CPhoneStateCallSetup::HandleRemoteTerminatedL( TInt aCallId )
   574 void CPhoneStateCallSetup::HandleRemoteTerminatedL( TInt /*aCallId*/ )
   660     {
   575     {
   661     __LOGMETHODSTARTEND(EPhoneControl, "CPhoneStateCallSetup::HandleRemoteTerminatedL( ) ");
   576     __LOGMETHODSTARTEND(EPhoneControl, "CPhoneStateCallSetup::HandleRemoteTerminatedL( ) ");
   662 
   577 
   663     // Remove call header
   578     // Remove call header
   664     /*iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveCallHeader, aCallId );
   579     /*iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveCallHeader, aCallId );
   702     TPhoneCmdParamString dtmfSequence;
   617     TPhoneCmdParamString dtmfSequence;
   703     HBufC *content = HBufC::NewLC( KPEDtmfMaxLength );
   618     HBufC *content = HBufC::NewLC( KPEDtmfMaxLength );
   704     TPtr ptr( content->Des() );
   619     TPtr ptr( content->Des() );
   705     dtmfSequence.SetString( &ptr );
   620     dtmfSequence.SetString( &ptr );
   706     
   621     
   707     if ( iOnScreenDialer && IsDTMFEditorVisibleL() )
   622     if ( iOnScreenDialer )
   708         {
   623         {
   709         iViewCommandHandle->ExecuteCommand(
   624         iViewCommandHandle->ExecuteCommand(
   710             EPhoneViewGetNumberFromEntry,
   625             EPhoneViewGetNumberFromEntry,
   711             &dtmfSequence );  
   626             &dtmfSequence );  
   712                     
   627         }     
   713         CloseDTMFEditorL();
       
   714         }
       
   715     else
       
   716         {
       
   717         iViewCommandHandle->ExecuteCommandL( EPhoneViewGetTextQueryContent,
       
   718                                              &dtmfSequence );
       
   719         }        
       
   720 
   628 
   721     // Send the DTMF
   629     // Send the DTMF
   722     if ( ptr.Length() )
   630     if ( ptr.Length() )
   723         {
   631         {
   724         iStateMachine->PhoneEngineInfo()->SetDtmfStringCommand( ptr );
   632         iStateMachine->PhoneEngineInfo()->SetDtmfStringCommand( ptr );