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