phoneapp/phoneuistates/src/cphonetwosingles.cpp
branchRCL_3
changeset 61 41a7f70b3818
parent 58 40a3f856b14d
child 62 5266b1f337bd
equal deleted inserted replaced
58:40a3f856b14d 61:41a7f70b3818
    15 *
    15 *
    16 */
    16 */
    17 
    17 
    18 
    18 
    19 // INCLUDES
    19 // INCLUDES
    20 #include <ScreensaverInternalPSKeys.h>
       
    21 #include <eikmenub.h> 
    20 #include <eikmenub.h> 
    22 #include <eikenv.h>
    21 #include <eikenv.h>
    23 #include <StringLoader.h>
    22 #include <StringLoader.h>
    24 #include <pevirtualengine.h>
    23 #include <pevirtualengine.h>
    25 #include <mpeengineinfo.h>
    24 #include <mpeengineinfo.h>
    38 #include "tphonecmdparamstring.h"
    37 #include "tphonecmdparamstring.h"
    39 #include "tphonecmdparamcallheaderdata.h"
    38 #include "tphonecmdparamcallheaderdata.h"
    40 #include "tphonecmdparamcallstatedata.h"
    39 #include "tphonecmdparamcallstatedata.h"
    41 #include "phonestatedefinitionsgsm.h"
    40 #include "phonestatedefinitionsgsm.h"
    42 #include "phonelogger.h"
    41 #include "phonelogger.h"
    43 #include "cphonepubsubproxy.h"
       
    44 
    42 
    45 // ================= MEMBER FUNCTIONS =======================
    43 // ================= MEMBER FUNCTIONS =======================
    46 
    44 
    47 // C++ default constructor can NOT contain any code, that
    45 // C++ default constructor can NOT contain any code, that
    48 // might leave.
    46 // might leave.
    78     // Re-enable global notes
    76     // Re-enable global notes
    79     TPhoneCmdParamBoolean globalNotifierParam;
    77     TPhoneCmdParamBoolean globalNotifierParam;
    80     globalNotifierParam.SetBoolean( EFalse );
    78     globalNotifierParam.SetBoolean( EFalse );
    81     iViewCommandHandle->ExecuteCommandL( EPhoneViewSetGlobalNotifiersDisabled,
    79     iViewCommandHandle->ExecuteCommandL( EPhoneViewSetGlobalNotifiersDisabled,
    82         &globalNotifierParam );
    80         &globalNotifierParam );
    83     
       
    84     CPhonePubSubProxy::Instance()->ChangePropertyValue(
       
    85                     KPSUidScreenSaver,
       
    86                     KScreenSaverAllowScreenSaver,
       
    87                     EPhoneScreensaverAllowed );
       
    88     }
    81     }
    89 
    82 
    90 // -----------------------------------------------------------
    83 // -----------------------------------------------------------
    91 // CPhoneTwoSingles::NewL()
    84 // CPhoneTwoSingles::NewL()
    92 // Constructor
    85 // Constructor
   143         default:
   136         default:
   144             CPhoneGsmInCall::HandlePhoneEngineMessageL( aMessage, aCallId );
   137             CPhoneGsmInCall::HandlePhoneEngineMessageL( aMessage, aCallId );
   145             break;
   138             break;
   146         }
   139         }
   147     }
   140     }
   148 
       
   149 // -----------------------------------------------------------
       
   150 // CPhoneTwoSingles::OpenMenuBarL
       
   151 // -----------------------------------------------------------
       
   152 //
       
   153 EXPORT_C void CPhoneTwoSingles::OpenMenuBarL()
       
   154     {
       
   155     __LOGMETHODSTARTEND( EPhoneUIStates, 
       
   156         "CPhoneTwoSingles::OpenMenuBarL()");
       
   157     TInt resourceId;
       
   158 
       
   159     if ( iOnScreenDialer && IsDTMFEditorVisibleL() )
       
   160         {
       
   161         resourceId = EPhoneDtmfDialerMenubar;
       
   162         }
       
   163     if ( iOnScreenDialer && IsCustomizedDialerVisibleL() )
       
   164         {
       
   165         resourceId = CustomizedDialerMenuResourceIdL();
       
   166         }
       
   167     else if ( IsNumberEntryVisibleL() )
       
   168         {
       
   169         resourceId = EPhoneCallActiveAndHeldMenubarWithNumberEntry;
       
   170         }
       
   171     else
       
   172         {
       
   173         resourceId = EPhoneCallActiveAndHeldMenubar;
       
   174         }
       
   175 
       
   176     TPhoneCmdParamInteger integerParam;
       
   177     integerParam.SetInteger( 
       
   178         CPhoneMainResourceResolver::Instance()->
       
   179         ResolveResourceID( resourceId ) );
       
   180 
       
   181     // Set Hold flag to view
       
   182     TPhoneCmdParamBoolean holdFlag;
       
   183     holdFlag.SetBoolean( EFalse );
       
   184     iViewCommandHandle->ExecuteCommandL( EPhoneViewSetHoldFlag, &holdFlag );
       
   185 
       
   186     iViewCommandHandle->ExecuteCommandL( EPhoneViewMenuBarOpen, 
       
   187         &integerParam );
       
   188     }
       
   189       
   141       
   190 // -----------------------------------------------------------
   142 // -----------------------------------------------------------
   191 // CPhoneTwoSingles:HandleIdleL
   143 // CPhoneTwoSingles:HandleIdleL
   192 // -----------------------------------------------------------
   144 // -----------------------------------------------------------
   193 //    
   145 //    
   205         EPhoneViewGetCountOfActiveCalls, &activeCallCount );
   157         EPhoneViewGetCountOfActiveCalls, &activeCallCount );
   206 
   158 
   207     switch( activeCallCount.Integer() )
   159     switch( activeCallCount.Integer() )
   208         {
   160         {
   209         case EOneActiveCall:
   161         case EOneActiveCall:
   210             {
   162             {   
   211             // Close menu bar if number entry is not open.
   163             if ( IsNumberEntryUsedL() )
   212             iViewCommandHandle->ExecuteCommandL( EPhoneViewMenuBarClose );
   164                 {
       
   165                 // Show the number entry if it exists
       
   166                 SetNumberEntryVisibilityL(ETrue);
       
   167                 }
       
   168             else
       
   169                 {
   213                 
   170                 
   214             // Set incall CBAs
   171                 // Set incall CBAs
   215             UpdateCbaL( EPhoneCallHandlingInCallCBA );                
   172                 UpdateCbaL( EPhoneCallHandlingInCallCBA );                
       
   173                 }
   216             
   174             
   217             TPhoneCmdParamCallStateData callStateData;  
   175             TPhoneCmdParamCallStateData callStateData;  
   218             callStateData.SetCallState( EPEStateHeld );
   176             callStateData.SetCallState( EPEStateHeld );
   219             iViewCommandHandle->HandleCommandL(
   177             iViewCommandHandle->HandleCommandL(
   220                 EPhoneViewGetCallIdByState, &callStateData );
   178                 EPhoneViewGetCallIdByState, &callStateData );
   234                 CloseDtmfQueryL(); 
   192                 CloseDtmfQueryL(); 
   235                 }
   193                 }
   236 
   194 
   237             iViewCommandHandle->ExecuteCommandL( EPhoneViewSetHoldFlag, &holdFlag );
   195             iViewCommandHandle->ExecuteCommandL( EPhoneViewSetHoldFlag, &holdFlag );
   238 
   196 
   239     	    SetTouchPaneButtons( EPhoneIncallButtons );         
   197             SetTouchPaneButtons( EPhoneIncallButtons );         
   240             // Go to single state
   198             // Go to single state
   241             // CBA updates in above if-else conditions
   199             // CBA updates in above if-else conditions
   242             iStateMachine->ChangeState( EPhoneStateSingle ); 
   200             iStateMachine->ChangeState( EPhoneStateSingle ); 
   243             }
   201             }
   244             
   202             
   293     // Show bubble
   251     // Show bubble
   294     TPhoneCmdParamCallHeaderData callHeaderParam;
   252     TPhoneCmdParamCallHeaderData callHeaderParam;
   295     callHeaderParam.SetCallState( EPEStateConnected );
   253     callHeaderParam.SetCallState( EPEStateConnected );
   296     iViewCommandHandle->ExecuteCommandL( EPhoneViewUpdateBubble, aCallId, 
   254     iViewCommandHandle->ExecuteCommandL( EPhoneViewUpdateBubble, aCallId, 
   297         &callHeaderParam );
   255         &callHeaderParam );
       
   256     
       
   257     SetTouchPaneButtons( EPhoneIncallButtons );
   298     }
   258     }
   299     
   259     
   300 // -----------------------------------------------------------
   260 // -----------------------------------------------------------
   301 // CPhoneTwoSingles::HandleHeldL
   261 // CPhoneTwoSingles::HandleHeldL
   302 // -----------------------------------------------------------
   262 // -----------------------------------------------------------
   319         CCoeEnv::Static() );        
   279         CCoeEnv::Static() );        
   320     callHeaderParam.SetLabelText( labelText );
   280     callHeaderParam.SetLabelText( labelText );
   321     
   281     
   322     iViewCommandHandle->ExecuteCommandL( EPhoneViewUpdateBubble, aCallId, 
   282     iViewCommandHandle->ExecuteCommandL( EPhoneViewUpdateBubble, aCallId, 
   323         &callHeaderParam );
   283         &callHeaderParam );
       
   284     
       
   285     SetTouchPaneButtons( EPhoneIncallButtons );
   324     }
   286     }
   325     
   287     
   326 // -----------------------------------------------------------
   288 // -----------------------------------------------------------
   327 // CPhoneTwoSingles::HandleNumberEntryClearedL()
   289 // CPhoneTwoSingles::HandleNumberEntryClearedL()
   328 // -----------------------------------------------------------
   290 // -----------------------------------------------------------
   352 
   314 
   353     StringLoader::Load( 
   315     StringLoader::Load( 
   354         conferenceText, 
   316         conferenceText, 
   355         callLabelId, 
   317         callLabelId, 
   356         CCoeEnv::Static() );
   318         CCoeEnv::Static() );
   357     callHeaderParam.SetCLIText( conferenceText, CBubbleManager::ERight );
   319     callHeaderParam.SetCLIText( conferenceText, TPhoneCmdParamCallHeaderData::ERight );
       
   320     
       
   321     callHeaderParam.SetCallState(EPEStateConnectedConference);
   358     BeginUiUpdateLC();
   322     BeginUiUpdateLC();
   359     
   323     
   360     callHeaderParam.SetCiphering(
   324     callHeaderParam.SetCiphering(
   361         iStateMachine->PhoneEngineInfo()->IsSecureCall( aCallId ) );
   325         iStateMachine->PhoneEngineInfo()->IsSecureCall( aCallId ) );
   362         
   326         
   375     TPhoneCmdParamBoolean holdFlag;
   339     TPhoneCmdParamBoolean holdFlag;
   376     holdFlag.SetBoolean( EFalse );
   340     holdFlag.SetBoolean( EFalse );
   377     iViewCommandHandle->ExecuteCommandL( EPhoneViewSetHoldFlag, &holdFlag );
   341     iViewCommandHandle->ExecuteCommandL( EPhoneViewSetHoldFlag, &holdFlag );
   378 
   342 
   379     SetTouchPaneButtons( EPhoneConferenceButtons );
   343     SetTouchPaneButtons( EPhoneConferenceButtons );
   380     SetTouchPaneButtonEnabled( EPhoneInCallCmdPrivate );
       
   381     EndUiUpdate();
   344     EndUiUpdate();
   382     
   345     
   383     UpdateCbaL( EPhoneCallHandlingInCallCBA );
   346     UpdateCbaL( EPhoneCallHandlingInCallCBA );
   384     
   347     
   385     // Go to conference state
   348     // Go to conference state
   394 void CPhoneTwoSingles::HandleIncomingL( TInt aCallId )
   357 void CPhoneTwoSingles::HandleIncomingL( TInt aCallId )
   395     {
   358     {
   396     __LOGMETHODSTARTEND( EPhoneUIStates, 
   359     __LOGMETHODSTARTEND( EPhoneUIStates, 
   397         "CPhoneTwoSingles::HandleIncomingL()");
   360         "CPhoneTwoSingles::HandleIncomingL()");
   398     
   361     
   399     CPhonePubSubProxy::Instance()->ChangePropertyValue(
       
   400                     KPSUidScreenSaver,
       
   401                     KScreenSaverAllowScreenSaver,
       
   402                     EPhoneScreensaverNotAllowed );
       
   403     
       
   404     IsNumberEntryUsedL() ? 
       
   405         BeginTransEffectLC( ECallUiAppear ) :
       
   406         BeginTransEffectLC( ENumberEntryOpen );
       
   407     BeginUiUpdateLC();
   362     BeginUiUpdateLC();
   408     
       
   409     // Hide the number entry if it exists
       
   410     if ( IsNumberEntryUsedL() )
       
   411         {
       
   412         SetNumberEntryVisibilityL( EFalse );    
       
   413         }
       
   414     
   363     
   415     TPhoneCmdParamBoolean dialerParam;
   364     TPhoneCmdParamBoolean dialerParam;
   416     dialerParam.SetBoolean( ETrue );
   365     dialerParam.SetBoolean( ETrue );
   417     
   366     
   418     // Get allow waiting call header param value.
   367     // Get allow waiting call header param value.
   419     AllowShowingOfWaitingCallHeaderL( dialerParam );
   368     AllowShowingOfWaitingCallHeaderL( dialerParam );
   420     
   369     
   421     // Close fast swap window if it's displayed
   370     // Close fast swap window if it's displayed
   422     EikonEnv()->DismissTaskList();
   371     CEikonEnv::Static()->DismissTaskList();
   423 
   372 
   424     // Display incoming call
   373     // Display incoming call
   425     DisplayIncomingCallL( aCallId, dialerParam );
   374     DisplayIncomingCallL( aCallId, dialerParam );
   426     
   375     
   427     // Set touch controls
   376     // Check if HW Keys or Call UI should be disabled
   428     SetTouchPaneButtonDisabled( EPhoneCallComingCmdAnswer );
   377     CheckDisableHWKeysAndCallUIL();
   429     
   378     
   430     SetTouchPaneButtons( EPhoneWaitingCallButtons );
   379     SetTouchPaneButtons( EPhoneWaitingCallButtons );
   431 
   380 
   432     EndUiUpdate();
   381     EndUiUpdate();
   433     EndTransEffect();
       
   434 
   382 
   435     // Go to incoming state
   383     // Go to incoming state
   436     UpdateCbaL( EPhoneCallHandlingCallWaitingCBA );
   384     iCbaManager->SetCbaL( EPhoneCallHandlingIncomingRejectCBA );
       
   385     
   437     iStateMachine->ChangeState( EPhoneStateTwoSinglesAndWaiting );        
   386     iStateMachine->ChangeState( EPhoneStateTwoSinglesAndWaiting );        
   438     }
   387     }
   439 
   388 
   440 // -----------------------------------------------------------
   389 // -----------------------------------------------------------
   441 // CPhoneTwoSingles::DisplayIncomingCallL
   390 // CPhoneTwoSingles::DisplayIncomingCallL
   442 // -----------------------------------------------------------
   391 // -----------------------------------------------------------
   443 //
   392 //
   444 void CPhoneTwoSingles::DisplayIncomingCallL( 
   393 void CPhoneTwoSingles::DisplayIncomingCallL( 
   445     TInt aCallId, 
   394     TInt aCallId, 
   446     const TPhoneCmdParamBoolean /*aCommandParam*/ )
   395     const TPhoneCmdParamBoolean aCommandParam )
   447     {
   396     {
   448     __LOGMETHODSTARTEND( EPhoneUIStates,
   397     __LOGMETHODSTARTEND( EPhoneUIStates,
   449          "CPhoneTwoSingles::DisplayIncomingCallL()"); 
   398          "CPhoneTwoSingles::DisplayIncomingCallL()"); 
   450     // Close menu bar, if it is displayed
   399 
   451     iViewCommandHandle->ExecuteCommandL( EPhoneViewMenuBarClose );
   400     // Cannot delete active note, e.g. New call query, 
   452 
   401     // but show waiting note with or without caller name
   453     // Remove any phone dialogs if they are displayed
   402     if ( IsAnyQueryActiveL() ||  
   454     iViewCommandHandle->ExecuteCommandL( EPhoneViewRemovePhoneDialogs );
   403         ( !aCommandParam.Boolean() && iOnScreenDialer ) )
       
   404         {
       
   405         CallWaitingNoteL( aCallId );        
       
   406         }
       
   407     else
       
   408         {
       
   409         // Remove any phone dialogs if they are displayed
       
   410         iViewCommandHandle->ExecuteCommandL( EPhoneViewRemovePhoneDialogs );
       
   411         }
   455 
   412 
   456     // Indicate that the Phone needs to be sent to the background if
   413     // Indicate that the Phone needs to be sent to the background if
   457     // an application other than the top application is in the foreground
   414     // an application other than the top application is in the foreground
   458     SetNeedToReturnToForegroundAppStatusL( !TopAppIsDisplayedL() );
   415     TPhoneCmdParamBoolean booleanParam;
       
   416     booleanParam.SetBoolean( !TopAppIsDisplayedL() );
       
   417     iViewCommandHandle->ExecuteCommandL( 
       
   418         EPhoneViewSetNeedToSendToBackgroundStatus,
       
   419         &booleanParam );
   459 
   420 
   460     // Bring Phone app in the foreground
   421     // Bring Phone app in the foreground
   461     TPhoneCmdParamInteger uidParam;
   422     TPhoneCmdParamInteger uidParam;
   462     uidParam.SetInteger( KUidPhoneApplication.iUid );
   423     uidParam.SetInteger( KUidPhoneApplication.iUid );
   463     iViewCommandHandle->ExecuteCommandL( EPhoneViewBringAppToForeground,
   424     iViewCommandHandle->ExecuteCommandL( EPhoneViewBringAppToForeground,
   475 // -----------------------------------------------------------
   436 // -----------------------------------------------------------
   476 //
   437 //
   477 EXPORT_C void CPhoneTwoSingles::UpdateInCallCbaL()
   438 EXPORT_C void CPhoneTwoSingles::UpdateInCallCbaL()
   478     {
   439     {
   479     __LOGMETHODSTARTEND( EPhoneUIStates, "CPhoneTwoSingles::UpdateInCallCbaL() ");
   440     __LOGMETHODSTARTEND( EPhoneUIStates, "CPhoneTwoSingles::UpdateInCallCbaL() ");
   480 	UpdateCbaL( EPhoneCallHandlingNewCallSwapCBA );
   441     UpdateCbaL( EPhoneCallHandlingNewCallSwapCBA );
   481     }
   442     }
   482 
   443 
   483 // End of File
   444 // End of File