phoneapp/phoneuicontrol/src/cphonestate.cpp
changeset 22 6bb1b21d2484
parent 21 92ab7f8d0eab
child 27 2f8f8080a020
equal deleted inserted replaced
21:92ab7f8d0eab 22:6bb1b21d2484
    30 #include <Profile.hrh>
    30 #include <Profile.hrh>
    31 #include <PUAcodes.hrh>
    31 #include <PUAcodes.hrh>
    32 #include <AknUtils.h>
    32 #include <AknUtils.h>
    33 #include <telephonyvariant.hrh>
    33 #include <telephonyvariant.hrh>
    34 #include <aknsoundsystem.h>
    34 #include <aknsoundsystem.h>
    35 // <-- QT PHONE START --> 
       
    36 //#include <cphcntprofileengine.h>
       
    37 // <-- QT PHONE END --> 
       
    38 #include <wlaninternalpskeys.h>
    35 #include <wlaninternalpskeys.h>
    39 #include <btengdomainpskeys.h>
    36 #include <btengdomainpskeys.h>
    40 #include <btengdomaincrkeys.h>
    37 #include <btengdomaincrkeys.h>
    41 #include <settingsinternalcrkeys.h>
    38 #include <settingsinternalcrkeys.h>
    42 #include <starterclient.h>
    39 #include <starterclient.h>
    43 #include <rsssettings.h>
    40 #include <rsssettings.h>
    44 #include <UikonInternalPSKeys.h>
    41 #include <uikoninternalpskeys.h>
    45 #include <telephonydomainpstypes.h>
    42 #include <telephonydomainpstypes.h>
    46 #include <telinformationpskeys.h>
    43 #include <telinformationpskeys.h>
    47 // <-- QT PHONE START --> 
       
    48 //#include <activeidle2domainpskeys.h>
       
    49 // <-- QT PHONE END --> 
       
    50 #include <coreapplicationuisdomainpskeys.h>
    44 #include <coreapplicationuisdomainpskeys.h>
    51 #include <mccecall.h>
    45 #include <mccecall.h>
    52 #include <ccpdefs.h>
    46 #include <ccpdefs.h>
    53 #include <LogsDomainCRKeys.h>
    47 #include <LogsDomainCRKeys.h>
    54 #include <spsettings.h>
    48 #include <spsettings.h>
    55 #include <ScreensaverInternalPSKeys.h>
       
    56 #include <startupdomainpskeys.h>
    49 #include <startupdomainpskeys.h>
    57 #include <MediatorDomainUIDs.h>
    50 #include <MediatorDomainUIDs.h>
    58 // <-- QT PHONE START --> 
       
    59 #include <videotelcontrolmediatorapi.h>
    51 #include <videotelcontrolmediatorapi.h>
    60 // <-- QT PHONE END --> 
       
    61 #include <textresolver.h>
    52 #include <textresolver.h>
    62 #include <phoneappvoipcommands.hrh>
    53 #include <phoneappvoipcommands.hrh>
    63 #include <hwrmdomainpskeys.h>
    54 #include <hwrmdomainpskeys.h>
    64 
    55 
    65 #include "phoneui.pan"
    56 #include "phoneui.pan"
    71 #include "tphonecmdparamkeyevent.h"
    62 #include "tphonecmdparamkeyevent.h"
    72 #include "tphonecmdparamdynmenu.h"
    63 #include "tphonecmdparamdynmenu.h"
    73 #include "tphonecmdparamcallheaderdata.h"
    64 #include "tphonecmdparamcallheaderdata.h"
    74 #include "tphonecmdparamincallindicatordata.h"
    65 #include "tphonecmdparamincallindicatordata.h"
    75 #include "tphonecmdparamnote.h"
    66 #include "tphonecmdparamnote.h"
    76 #include "tphonecmdparamKeycapture.h"
    67 #include "tphonecmdparamkeycapture.h"
    77 #include "tphonecmdparamglobalnote.h"
    68 #include "tphonecmdparamglobalnote.h"
    78 #include "tphonecmdparamquery.h"
    69 #include "tphonecmdparamquery.h"
    79 #include "tphonecmdparamstring.h"
    70 #include "tphonecmdparamstring.h"
    80 // <-- QT PHONE START --> 
       
    81 //#include "tphonecmdparammessageeditor.h"
       
    82 // <-- QT PHONE END --> 
       
    83 #include "tphonecmdparamcallstatedata.h"
    71 #include "tphonecmdparamcallstatedata.h"
    84 #include "tphonecmdparambitmap.h"
    72 #include "tphonecmdparambitmap.h"
    85 #include "tphonecmdparamAudioOutput.h"
    73 #include "tphonecmdparamaudiooutput.h"
    86 #include "tphonecmdparamaudioavailability.h"
    74 #include "tphonecmdparamaudioavailability.h"
    87 #include "tphonecmdparamappinfo.h"
    75 #include "tphonecmdparamappinfo.h"
    88 #include "tphonecmdparamtranseffect.h"
    76 #include "tphonecmdparamtranseffect.h"
    89 #include "tphonecmdparamringtone.h"
    77 #include "tphonecmdparamringtone.h"
    90 #include "tphonecmdparamcustomdialer.h"
    78 #include "tphonecmdparamcustomdialer.h"
   110 #include "cphonemediatorsender.h"
    98 #include "cphonemediatorsender.h"
   111 #include "cphonereleasecommand.h"
    99 #include "cphonereleasecommand.h"
   112 #include "cphonecontinueemergencycallcommand.h"
   100 #include "cphonecontinueemergencycallcommand.h"
   113 #include "cphonecallheadermanager.h"
   101 #include "cphonecallheadermanager.h"
   114 #include "cphonenumberentrymanager.h"
   102 #include "cphonenumberentrymanager.h"
       
   103 #include "tphonecmdparamsfidata.h" 
   115 #include "mphonestorage.h"
   104 #include "mphonestorage.h"
   116 
   105 
   117 // ================= MEMBER FUNCTIONS =======================
   106 // ================= MEMBER FUNCTIONS =======================
   118 
   107 
   119 EXPORT_C CPhoneState::CPhoneState(
   108 EXPORT_C CPhoneState::CPhoneState(
   656 
   645 
   657     if ( !IsTouchDTmfDialerOn()
   646     if ( !IsTouchDTmfDialerOn()
   658         && !IsAnyQueryActiveL()
   647         && !IsAnyQueryActiveL()
   659         && !IsMenuBarVisibleL() )
   648         && !IsMenuBarVisibleL() )
   660         {
   649         {
   661 // <-- QT PHONE START -->
       
   662         //if( IsKeyEventFurtherProcessedL( aKeyEvent ))
       
   663         //    {
       
   664         // Send the key event to the phone engine.
   650         // Send the key event to the phone engine.
   665         SendKeyEventL( aKeyEvent, aEventCode );
   651         SendKeyEventL( aKeyEvent, aEventCode );
   666         //    }
   652         }
   667         }
       
   668 // <-- QT PHONE END -->
       
   669     }
   653     }
   670 
   654 
   671 // -----------------------------------------------------------------------------
   655 // -----------------------------------------------------------------------------
   672 // CPhoneState::IsKeyEventFurtherProcessed
   656 // CPhoneState::IsKeyEventFurtherProcessed
   673 // -----------------------------------------------------------------------------
   657 // -----------------------------------------------------------------------------
   806         case ECCPErrorSatControl:
   790         case ECCPErrorSatControl:
   807             {
   791             {
   808             // check, that there really was a call established before completing SAT request
   792             // check, that there really was a call established before completing SAT request
   809             if( aErrorInfo.iCallId != KPECallIdNotUsed )
   793             if( aErrorInfo.iCallId != KPECallIdNotUsed )
   810                 {
   794                 {
   811 // <-- QT PHONE START --> 
       
   812                 /*// Complete sat request
       
   813                 if ( iStateMachine->PhoneEngineInfo()->CallOrigin( aErrorInfo.iCallId ) == EPECallOriginSAT )
       
   814                     {
       
   815                     CompleteSatRequestL( aErrorInfo.iCallId );
       
   816                     }*/
       
   817 // <-- QT PHONE END --> 
       
   818                 }
   795                 }
   819 
   796 
   820             // remove number entry
   797             // remove number entry
   821             if ( !IsOnScreenDialerSupported() && IsNumberEntryUsedL() )
   798             if ( !IsOnScreenDialerSupported() && IsNumberEntryUsedL() )
   822                 {
   799                 {
   831             break;
   808             break;
   832 
   809 
   833         default:
   810         default:
   834             break;
   811             break;
   835         }
   812         }
   836     // clear call blacklist if call failure occurs
       
   837 // <-- QT PHONE START --> 
       
   838 //    CPhoneClearBlacklist::Instance()->ClearBlackListOnNextKey();          
       
   839 // <-- QT PHONE END --> 
       
   840     }
   813     }
   841 
   814 
   842 // -----------------------------------------------------------
   815 // -----------------------------------------------------------
   843 // CPhoneState::HandleChangedCallDurationL
   816 // CPhoneState::HandleChangedCallDurationL
   844 // Default handling for EPEMessageChangedCallDuration message
   817 // Default handling for EPEMessageChangedCallDuration message
   846 // -----------------------------------------------------------
   819 // -----------------------------------------------------------
   847 void CPhoneState::HandleChangedCallDurationL( TInt aCallId )
   820 void CPhoneState::HandleChangedCallDurationL( TInt aCallId )
   848     {
   821     {
   849      __LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::HandleChangedCallDurationL() ");
   822      __LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::HandleChangedCallDurationL() ");
   850     // Get the call duration
   823     // Get the call duration
   851     TTime time( 0 );
   824     TTimeIntervalSeconds seconds =
   852     TTimeIntervalSeconds timeInterval =
       
   853         iStateMachine->PhoneEngineInfo()->CallDuration( aCallId );
   825         iStateMachine->PhoneEngineInfo()->CallDuration( aCallId );
   854     time += timeInterval;
   826 
   855 
   827     TPhoneCmdParamInteger time;
   856     // Read format string from AVKON resource
   828     time.SetInteger(seconds.Int());
   857     TBuf<KPhoneMaxCharsInNote> timeDurationFormatString( KNullDesC );
   829     iViewCommandHandle->ExecuteCommandL(EPhoneViewUpdateCallHeaderCallDuration, aCallId, &time);
   858     LoadResource( timeDurationFormatString, EPhoneCallDurationFormatString );
       
   859 
       
   860     // Format the time
       
   861     TBuf<KPhoneMaxTimeDisplayTextLength> timeString( KNullDesC );
       
   862     time.FormatL( timeString, timeDurationFormatString );
       
   863 
       
   864     // Localize time format
       
   865     AknTextUtils::LanguageSpecificNumberConversion( timeString );
       
   866 
       
   867     // update the call header call duration
       
   868     iViewCommandHandle->ExecuteCommandL(
       
   869         EPhoneViewUpdateCallHeaderCallDuration,
       
   870         aCallId,
       
   871         timeString );
       
   872     }
   830     }
   873 
   831 
   874 // -----------------------------------------------------------------------------
   832 // -----------------------------------------------------------------------------
   875 // CPhoneState::HandleRemoteBusyL
   833 // CPhoneState::HandleRemoteBusyL
   876 // -----------------------------------------------------------------------------
   834 // -----------------------------------------------------------------------------
   889          __PHONELOG1( EBasic, EPhoneControl,
   847          __PHONELOG1( EBasic, EPhoneControl,
   890             "PhoneUIControl: CPhoneState::HandleRemoteBusyL - ShowReconnectQueryL vid 5, callid%d ",
   848             "PhoneUIControl: CPhoneState::HandleRemoteBusyL - ShowReconnectQueryL vid 5, callid%d ",
   891                 aCallId );
   849                 aCallId );
   892         CPhoneReconnectQuery::InstanceL()->ShowReconnectQueryL( ETrue );
   850         CPhoneReconnectQuery::InstanceL()->ShowReconnectQueryL( ETrue );
   893         }
   851         }
   894     else
       
   895         {
       
   896 // <-- QT PHONE START --> 
       
   897         /*// Complete sat request
       
   898         if ( iStateMachine->PhoneEngineInfo()->CallOrigin( aCallId ) == EPECallOriginSAT )
       
   899             {
       
   900             CompleteSatRequestL( aCallId );
       
   901             }*/
       
   902 // <-- QT PHONE END --> 
       
   903         }
       
   904     }
   852     }
   905 
   853 
   906 // -----------------------------------------------------------
   854 // -----------------------------------------------------------
   907 // CPhoneState::HandleDisconnectingL
   855 // CPhoneState::HandleDisconnectingL
   908 // -----------------------------------------------------------
   856 // -----------------------------------------------------------
   929     callHeaderParam.SetLabelText( labelText );
   877     callHeaderParam.SetLabelText( labelText );
   930 
   878 
   931     iViewCommandHandle->ExecuteCommandL( EPhoneViewStopRingTone );
   879     iViewCommandHandle->ExecuteCommandL( EPhoneViewStopRingTone );
   932 
   880 
   933     iViewCommandHandle->ExecuteCommandL( EPhoneViewUpdateBubble, aCallId,
   881     iViewCommandHandle->ExecuteCommandL( EPhoneViewUpdateBubble, aCallId,
   934         &callHeaderParam );
   882         &callHeaderParam );    
   935     
       
   936 // <-- QT PHONE START --> 
       
   937 //    CPhoneClearBlacklist::Instance()->ClearBlackListOnNextKey();
       
   938 // <-- QT PHONE END --> 
       
   939     }
   883     }
   940 
   884 
   941 // -----------------------------------------------------------
   885 // -----------------------------------------------------------
   942 // CPhoneState::IsCustomizedDialerVisibleL()
   886 // CPhoneState::IsCustomizedDialerVisibleL()
   943 // -----------------------------------------------------------
   887 // -----------------------------------------------------------
  1312 // CPhoneState::HandlePhoneForegroundEventL
  1256 // CPhoneState::HandlePhoneForegroundEventL
  1313 // -----------------------------------------------------------
  1257 // -----------------------------------------------------------
  1314 //
  1258 //
  1315 EXPORT_C void CPhoneState::HandlePhoneForegroundEventL()
  1259 EXPORT_C void CPhoneState::HandlePhoneForegroundEventL()
  1316     {
  1260     {
  1317 // <-- QT PHONE START --> 
  1261     }
  1318     /*__LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::HandlePhoneForegroundEventL( ) ");
       
  1319 
       
  1320     // Force Idle to the foreground if a foreground event is received,
       
  1321     // but Idle is the top application
       
  1322 
       
  1323     const TBool idleIsTopApp = iViewCommandHandle->HandleCommandL(
       
  1324         EPhoneViewIsIdleTopApp ) ==
       
  1325         EPhoneViewResponseSuccess ;
       
  1326 
       
  1327     if ( !IsOnScreenDialerSupported() && idleIsTopApp )
       
  1328         {
       
  1329         TBool activatePhone = CPhonePubSubProxy::Instance()->Value(
       
  1330             KPSUidAiInformation, KActiveIdleState ) == EPSAiNumberEntry;
       
  1331         if ( activatePhone )
       
  1332             {
       
  1333             // Set Phone as the top application
       
  1334             TPhoneCmdParamInteger uidParam;
       
  1335             uidParam.SetInteger( KUidPhoneApplication.iUid );
       
  1336             iViewCommandHandle->ExecuteCommandL( EPhoneViewSetTopApplication,
       
  1337                 &uidParam );
       
  1338             NumberEntryManagerL()->CreateNumberEntryL();
       
  1339             SetNumberEntryVisibilityL(ETrue);
       
  1340             }
       
  1341         else
       
  1342             {
       
  1343             TPhoneCmdParamBoolean isSecurityMode;
       
  1344             iViewCommandHandle->ExecuteCommandL( EPhoneViewGetSecurityModeStatus, &isSecurityMode );
       
  1345 
       
  1346             if ( !isSecurityMode.Boolean() )
       
  1347                 {
       
  1348                 __PHONELOG( EBasic, EPhoneControl,
       
  1349                   "CPhoneState::HandlePhoneForegroundEventL - Force Idle to the foreground" );
       
  1350                 // Bring Idle app to the foreground
       
  1351                 iViewCommandHandle->ExecuteCommandL( EPhoneViewBringIdleToForeground );
       
  1352                 }
       
  1353             }
       
  1354         }*/
       
  1355 // <-- QT PHONE END --> 
       
  1356      }
       
  1357 
  1262 
  1358 // -----------------------------------------------------------
  1263 // -----------------------------------------------------------
  1359 // CPhoneState::HandlePhoneFocusLostEventL
  1264 // CPhoneState::HandlePhoneFocusLostEventL
  1360 // -----------------------------------------------------------
  1265 // -----------------------------------------------------------
  1361 //
  1266 //
  1748 
  1653 
  1749         case EPhoneCmdVideoCallOutOfMemory:
  1654         case EPhoneCmdVideoCallOutOfMemory:
  1750             ShowVideoCallOutOfMemoryNoteL();
  1655             ShowVideoCallOutOfMemoryNoteL();
  1751             DisconnectCallL();
  1656             DisconnectCallL();
  1752             break;
  1657             break;
  1753 
  1658             
       
  1659         case EPhoneCallComingCmdSoftReject:
       
  1660             // Open Soft reject message editor
       
  1661             OpenSoftRejectMessageEditorL();
       
  1662             break;
       
  1663             
  1754         default:
  1664         default:
  1755             if ( IsOnScreenDialerSupported() )
  1665 
       
  1666             /*if ( IsOnScreenDialerSupported() )
  1756                 {
  1667                 {
  1757                 // Offer command to view.
  1668                 // Offer command to view.
  1758                 TPhoneViewResponseId resId =
  1669                 TPhoneViewResponseId resId =
  1759                             iViewCommandHandle->HandleCommandL( aCommand );
  1670                             iViewCommandHandle->HandleCommandL( aCommand );
  1760 
  1671 
  1761                 if( resId == EPhoneViewResponseFailed )
  1672                 if( resId == EPhoneViewResponseFailed )
  1762                     {
  1673                     {
  1763                     commandStatus = EFalse;
  1674                     commandStatus = EFalse;
  1764                     }
  1675                     }
  1765                 }
  1676                 }
  1766             else
  1677             else*/
       
  1678 
  1767                 {
  1679                 {
  1768                 commandStatus = EFalse;
  1680                 commandStatus = EFalse;
  1769                 }
  1681                 }
  1770             break;
  1682             break;
  1771         }
  1683         }
  1902         // Syncronizes audio volume level between engine and ui
  1814         // Syncronizes audio volume level between engine and ui
  1903         // causes EPEMessageAudioVolumeChanged message to phoneUI
  1815         // causes EPEMessageAudioVolumeChanged message to phoneUI
  1904         iStateMachine->SendPhoneEngineMessage(
  1816         iStateMachine->SendPhoneEngineMessage(
  1905             MPEPhoneModel::EPEMessageSetAudioVolume );
  1817             MPEPhoneModel::EPEMessageSetAudioVolume );
  1906         }
  1818         }
  1907 // <-- QT PHONE START --> 
       
  1908    /* else 
       
  1909         {
       
  1910         CAknKeySoundSystem* keySounds = 
       
  1911             static_cast<CAknAppUi*>( iEnv.EikAppUi() )
       
  1912                 ->KeySounds();
       
  1913                 
       
  1914         if ( aLevel < KPhoneVolumeMinValue )
       
  1915             {
       
  1916             // Set the volume value to volume control
       
  1917             valueToControl = KPhoneVolumeMinValue;
       
  1918             keySounds->PlaySound( EAvkonSIDVolumeMinTone );
       
  1919             }
       
  1920         else // aLevel > KPhoneVolumeMaxValue
       
  1921             {
       
  1922             // Set the volume value to volume control
       
  1923             valueToControl = KPhoneVolumeMaxValue;
       
  1924             keySounds->PlaySound( EAvkonSIDVolumeMaxTone );
       
  1925             }
       
  1926         }*/
       
  1927 // <-- QT PHONE END --> 
       
  1928         
  1819         
  1929     if ( aUpdateControl )        
  1820     if ( aUpdateControl )        
  1930         {
  1821         {
  1931         // Update the volume display.
  1822         // Update the volume display.
  1932         // Upper max (11) and under min (-1)
  1823         // Upper max (11) and under min (-1)
  1978 // -----------------------------------------------------------
  1869 // -----------------------------------------------------------
  1979 //
  1870 //
  1980 EXPORT_C TBool CPhoneState::DisconnectCallL()
  1871 EXPORT_C TBool CPhoneState::DisconnectCallL()
  1981     {
  1872     {
  1982     __LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::DisconnectCallL( ) ");
  1873     __LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::DisconnectCallL( ) ");
  1983 // <-- QT PHONE START -->
       
  1984     TPhoneCmdParamInteger callIdParam;
  1874     TPhoneCmdParamInteger callIdParam;
  1985     iViewCommandHandle->ExecuteCommandL( 
  1875     iViewCommandHandle->ExecuteCommandL( 
  1986             EPhoneViewGetExpandedBubbleCallId, &callIdParam );
  1876             EPhoneViewGetExpandedBubbleCallId, &callIdParam );
  1987     // Fetch waiting call's id from view
       
  1988     /*TPhoneCmdParamCallStateData callStateData;
       
  1989     callStateData.SetCallState( EPEStateRinging );
       
  1990     iViewCommandHandle->HandleCommandL(
       
  1991         EPhoneViewGetCallIdByState, &callStateData );
       
  1992     if( callStateData.CallId() == KErrNotFound )
       
  1993         {
       
  1994         // No waiting call, find the connected call
       
  1995         callStateData.SetCallState( EPEStateConnected );
       
  1996         iViewCommandHandle->HandleCommandL(
       
  1997             EPhoneViewGetCallIdByState, &callStateData );
       
  1998 
       
  1999         if( callStateData.CallId() == KErrNotFound )
       
  2000             {
       
  2001             // No connected call, find the hold call
       
  2002             callStateData.SetCallState( EPEStateHeld );
       
  2003             iViewCommandHandle->HandleCommandL(
       
  2004                 EPhoneViewGetCallIdByState, &callStateData );
       
  2005 
       
  2006             if( callStateData.CallId() == KErrNotFound )
       
  2007                 {
       
  2008                 // No hold call, find the dialing call
       
  2009                 callStateData.SetCallState( EPEStateDialing );
       
  2010                 iViewCommandHandle->HandleCommandL(
       
  2011                     EPhoneViewGetCallIdByState, &callStateData );
       
  2012                 }
       
  2013 
       
  2014             if( callStateData.CallId() == KErrNotFound )
       
  2015                 {
       
  2016                 // No dialing call, find the outgoing call
       
  2017                 callStateData.SetCallState( EPEStateConnecting );
       
  2018                 iViewCommandHandle->HandleCommandL(
       
  2019                     EPhoneViewGetCallIdByState, &callStateData );
       
  2020                 }
       
  2021 
       
  2022             if( callStateData.CallId() == KErrNotFound )
       
  2023                 {
       
  2024                 // No active call, find the disconnectinging call
       
  2025                 callStateData.SetCallState( EPEStateDisconnecting );
       
  2026                 iViewCommandHandle->HandleCommandL(
       
  2027                     EPhoneViewGetCallIdByState, &callStateData );
       
  2028                 }
       
  2029            }
       
  2030         }*/
       
  2031 
       
  2032 
  1877 
  2033     TBool ret = EFalse;
  1878     TBool ret = EFalse;
  2034     if( callIdParam.Integer() > KErrNotFound )
  1879     if( callIdParam.Integer() > KErrNotFound )
  2035         {
  1880         {
  2036         // Release the call
  1881         // Release the call
  2037         iStateMachine->SetCallId( callIdParam.Integer() );
  1882         iStateMachine->SetCallId( callIdParam.Integer() );
  2038 
  1883 
  2039         if( IsVideoCall( callIdParam.Integer() ) )
  1884         if( IsVideoCall( callIdParam.Integer() ) )
  2040 // <-- QT PHONE END -->
       
  2041             {
  1885             {
  2042             // Video call can be released only after we get response to VT Shutdown Command
  1886             // Video call can be released only after we get response to VT Shutdown Command
  2043 // <-- QT PHONE START -->
       
  2044  
       
  2045             CPhoneMediatorFactory::Instance()->Sender()->IssueCommand( KMediatorVideoTelephonyDomain,
  1887             CPhoneMediatorFactory::Instance()->Sender()->IssueCommand( KMediatorVideoTelephonyDomain,
  2046                                                                                  KCatPhoneToVideotelCommands,
  1888                                                                                  KCatPhoneToVideotelCommands,
  2047                                                                                  EVtCmdReleaseDataport,
  1889                                                                                  EVtCmdReleaseDataport,
  2048                                                                        TVersion( KPhoneToVideotelCmdVersionMajor,
  1890                                                                        TVersion( KPhoneToVideotelCmdVersionMajor,
  2049                                                                                  KPhoneToVideotelCmdVersionMinor,
  1891                                                                                  KPhoneToVideotelCmdVersionMinor,
  2050                                                                                  KPhoneToVideotelCmdVersionBuild ),
  1892                                                                                  KPhoneToVideotelCmdVersionBuild ),
  2051                                                                        KNullDesC8,
  1893                                                                        KNullDesC8,
  2052                                                                        CPhoneReleaseCommand::NewL( *iStateMachine ) );
  1894                                                                        CPhoneReleaseCommand::NewL( *iStateMachine ) );
  2053 
       
  2054 // <-- QT PHONE END --> 
       
  2055             }
  1895             }
  2056         else
  1896         else
  2057             {
  1897             {
  2058             // Release the call
  1898             // Release the call
  2059             iStateMachine->SendPhoneEngineMessage(
  1899             iStateMachine->SendPhoneEngineMessage(
  2245 
  2085 
  2246     // Update remote info data
  2086     // Update remote info data
  2247     UpdateRemoteInfoDataL( aCallId );
  2087     UpdateRemoteInfoDataL( aCallId );
  2248 
  2088 
  2249     // Create call duration label if enabled
  2089     // Create call duration label if enabled
  2250 // <-- QT PHONE START-->
       
  2251     // This key will be moved to some other area, but since key
  2090     // This key will be moved to some other area, but since key
  2252     // is supported we can still use it.
  2091     // is supported we can still use it.
  2253     TBool callDuration( EFalse );
  2092     TBool callDuration( EFalse );
  2254     CPhoneCenRepProxy::Instance()->GetInt(
  2093     CPhoneCenRepProxy::Instance()->GetInt(
  2255             KCRUidLogs, KLogsShowCallDuration, callDuration );
  2094             KCRUidLogs, KLogsShowCallDuration, callDuration );
  2256 // <-- QT PHONE END-->
       
  2257 
  2095 
  2258     if ( callDuration )
  2096     if ( callDuration )
  2259         {
  2097         {
  2260         HandleChangedCallDurationL( aCallId );
  2098         HandleChangedCallDurationL( aCallId );
  2261         }
  2099         }
  2282         }
  2120         }
  2283 
  2121 
  2284     // Go to background if necessary
  2122     // Go to background if necessary
  2285     if ( NeedToSendToBackgroundL() ||  IsAutoLockOn() )
  2123     if ( NeedToSendToBackgroundL() ||  IsAutoLockOn() )
  2286         {
  2124         {
  2287 // <-- QT PHONE START -->             
       
  2288         //iViewCommandHandle->ExecuteCommandL( EPhoneViewSendToBackground );
       
  2289 // <-- QT PHONE END -->         
       
  2290         // If number entry is used set control and visibility.
  2125         // If number entry is used set control and visibility.
  2291         if ( IsNumberEntryUsedL() )
  2126         if ( IsNumberEntryUsedL() )
  2292            {
  2127            {
  2293            iViewCommandHandle->ExecuteCommandL( EPhoneViewSetControlAndVisibility );
  2128            iViewCommandHandle->ExecuteCommandL( EPhoneViewSetControlAndVisibility );
  2294            }
  2129            }
  2307 //
  2142 //
  2308 EXPORT_C void CPhoneState::CaptureKeysDuringCallNotificationL(
  2143 EXPORT_C void CPhoneState::CaptureKeysDuringCallNotificationL(
  2309     TBool aCaptured )
  2144     TBool aCaptured )
  2310     {
  2145     {
  2311     __LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::CaptureKeysDuringCallNotificationL( ) ");
  2146     __LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::CaptureKeysDuringCallNotificationL( ) ");
  2312 // <-- QT PHONE START --> 
       
  2313 /*    
       
  2314     if ( AknLayoutUtils::PenEnabled() )
       
  2315         {
       
  2316         //Capture pointer events
       
  2317         TPhoneCmdParamBoolean booleanParam;
       
  2318         booleanParam.SetBoolean( aCaptured );
       
  2319         iViewCommandHandle->ExecuteCommandL( EPhoneViewSetPointerCapture, &booleanParam );
       
  2320         }  
       
  2321 */    
       
  2322 // <-- QT PHONE END --> 
       
  2323     // Determine which view command to execute based on the capture status
  2147     // Determine which view command to execute based on the capture status
  2324     const TInt viewCommandId = aCaptured ?
  2148     const TInt viewCommandId = aCaptured ?
  2325         EPhoneViewStartCapturingKey :
  2149         EPhoneViewStartCapturingKey :
  2326         EPhoneViewStopCapturingKey;
  2150         EPhoneViewStopCapturingKey;
  2327 
  2151 
  2394 
  2218 
  2395 // -----------------------------------------------------------
  2219 // -----------------------------------------------------------
  2396 // CPhoneState::SetCallHeaderType
  2220 // CPhoneState::SetCallHeaderType
  2397 // -----------------------------------------------------------
  2221 // -----------------------------------------------------------
  2398 //
  2222 //
  2399 // <-- QT PHONE START --> 
       
  2400 EXPORT_C void CPhoneState::SetCallHeaderType(
  2223 EXPORT_C void CPhoneState::SetCallHeaderType(
  2401     TInt aCallHeaderType )
  2224     TInt aCallHeaderType )
  2402 // <-- QT PHONE END --> 
       
  2403     {
  2225     {
  2404     __LOGMETHODSTARTEND( EPhoneControl, "CPhoneState::SetCallHeaderType() ");
  2226     __LOGMETHODSTARTEND( EPhoneControl, "CPhoneState::SetCallHeaderType() ");
  2405     TRAP_IGNORE( CallheaderManagerL()->SetCallHeaderType( aCallHeaderType ) );
  2227     TRAP_IGNORE( CallheaderManagerL()->SetCallHeaderType( aCallHeaderType ) );
  2406     }
  2228     }
  2407 
  2229 
  2837 // CPhoneState::UpdateProfileDisplayL
  2659 // CPhoneState::UpdateProfileDisplayL
  2838 // -----------------------------------------------------------
  2660 // -----------------------------------------------------------
  2839 //
  2661 //
  2840 void CPhoneState::UpdateProfileDisplayL()
  2662 void CPhoneState::UpdateProfileDisplayL()
  2841     {
  2663     {
  2842 // <-- QT PHONE START --> 
       
  2843 /*
       
  2844     __LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::UpdateProfileDisplayL( ) ");
       
  2845     // Get the profile information
       
  2846     const TInt profileId =
       
  2847         iStateMachine->PhoneEngineInfo()->ProfileId();
       
  2848     TPEProfileName profileName =
       
  2849         iStateMachine->PhoneEngineInfo()->ProfileName();
       
  2850 
       
  2851     HBufC* profileString = HBufC::NewLC( profileName.Length() +
       
  2852         KPhoneMaxDateDisplayTextLength );
       
  2853 
       
  2854     TPtr profileNameBuf = profileString->Des();
       
  2855     profileNameBuf.Zero();
       
  2856     profileNameBuf.Append( profileName );
       
  2857 
       
  2858     if ( ( profileId == EProfileGeneralId ) ||
       
  2859         ( profileId == EProfileOffLineId ) )
       
  2860         {
       
  2861         // Show date instead of profile name on navi pane
       
  2862         HBufC* buffer = HBufC::NewLC( KPhoneMaxDateDisplayTextLength );
       
  2863         TPtr dateString( buffer->Des() );
       
  2864 
       
  2865         TTime time;
       
  2866         time.HomeTime();
       
  2867 
       
  2868         // Get date string
       
  2869         CCoeEnv* coeEnv = CCoeEnv::Static();
       
  2870 
       
  2871         HBufC* dateFormatString =
       
  2872             StringLoader::LoadLC( R_QTN_DATE_USUAL_WITH_ZERO, coeEnv );
       
  2873         time.FormatL( dateString, *dateFormatString );
       
  2874         CleanupStack::PopAndDestroy( dateFormatString );
       
  2875 
       
  2876         // To arabic
       
  2877         AknTextUtils::DisplayTextLanguageSpecificNumberConversion(
       
  2878             dateString );
       
  2879 
       
  2880         //Get week day abbreviation
       
  2881         TDayNameAbb wkDayAbb = TDayNameAbb();
       
  2882         wkDayAbb.Set(time.DayNoInWeek());
       
  2883 
       
  2884         //Get time format string
       
  2885         HBufC* timeFormat = StringLoader::LoadLC(
       
  2886             CPhoneMainResourceResolver::Instance()->
       
  2887                 ResolveResourceID( EPhoneIdleTimeFormat ),
       
  2888             coeEnv );
       
  2889 
       
  2890         //Set date and weekdays to time format
       
  2891         profileNameBuf.Zero();
       
  2892 
       
  2893         StringLoader::Format(
       
  2894             profileNameBuf,
       
  2895             *timeFormat,
       
  2896             1, // date
       
  2897             dateString );
       
  2898 
       
  2899         dateString.Copy( profileNameBuf );
       
  2900 
       
  2901         StringLoader::Format(
       
  2902             profileNameBuf,
       
  2903             dateString,
       
  2904             0, // weekday
       
  2905             wkDayAbb );
       
  2906 
       
  2907         CleanupStack::PopAndDestroy( timeFormat );
       
  2908         CleanupStack::PopAndDestroy( buffer );
       
  2909         }
       
  2910 
       
  2911     // Set silence indicator based on the ringing profile
       
  2912     const TProfileRingingType ringingType =
       
  2913         iStateMachine->PhoneEngineInfo()->RingingType();
       
  2914     if ( ringingType == EProfileRingingTypeSilent )
       
  2915         {
       
  2916         TBuf< 1 > silent;
       
  2917         silent.Append( KPuaCodeSilentSymbol );
       
  2918         profileNameBuf.Insert( 0, silent );
       
  2919         }
       
  2920 
       
  2921     // Update the profile display on the navi pane
       
  2922     iViewCommandHandle->ExecuteCommandL( EPhoneViewSetNaviPaneContent, 0,
       
  2923         profileNameBuf );
       
  2924 
       
  2925     if ( profileId == EProfileOffLineId )
       
  2926         {
       
  2927         iViewCommandHandle->ExecuteCommandL(
       
  2928             EPhoneViewSetTitlePaneContent,
       
  2929             0,
       
  2930             profileName );
       
  2931         }
       
  2932     else
       
  2933         {
       
  2934         UpdateOperatorDisplayL();
       
  2935         }
       
  2936 
       
  2937     CleanupStack::PopAndDestroy( profileString );
       
  2938 */
       
  2939 // <-- QT PHONE END --> 
       
  2940     }
  2664     }
  2941 
  2665 
  2942 // -----------------------------------------------------------
  2666 // -----------------------------------------------------------
  2943 // CPhoneState::UpdateOperatorDisplayL
  2667 // CPhoneState::UpdateOperatorDisplayL
  2944 // -----------------------------------------------------------
  2668 // -----------------------------------------------------------
  3101     {
  2825     {
  3102     __LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::HandleInitiatedEmergencyWhileActiveVideoL( ) ");
  2826     __LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::HandleInitiatedEmergencyWhileActiveVideoL( ) ");
  3103 
  2827 
  3104     // We have existing video call so need to release dataport before continuing
  2828     // We have existing video call so need to release dataport before continuing
  3105     // emergency call. Otherwise we will face problems with dataport use later.
  2829     // emergency call. Otherwise we will face problems with dataport use later.
  3106 // <-- QT PHONE START -->
       
  3107  
       
  3108     CPhoneMediatorFactory::Instance()->Sender()->IssueCommand( KMediatorVideoTelephonyDomain,
  2830     CPhoneMediatorFactory::Instance()->Sender()->IssueCommand( KMediatorVideoTelephonyDomain,
  3109                                                                      KCatPhoneToVideotelCommands,
  2831                                                                      KCatPhoneToVideotelCommands,
  3110                                                                      EVtCmdReleaseDataport,
  2832                                                                      EVtCmdReleaseDataport,
  3111                                                                TVersion( KPhoneToVideotelCmdVersionMajor,
  2833                                                                TVersion( KPhoneToVideotelCmdVersionMajor,
  3112                                                                          KPhoneToVideotelCmdVersionMinor,
  2834                                                                          KPhoneToVideotelCmdVersionMinor,
  3113                                                                          KPhoneToVideotelCmdVersionBuild ),
  2835                                                                          KPhoneToVideotelCmdVersionBuild ),
  3114                                                                KNullDesC8,
  2836                                                                KNullDesC8,
  3115                                                                CPhoneContinueEmergencyCallCommand::NewL( *iStateMachine ) );
  2837                                                                CPhoneContinueEmergencyCallCommand::NewL( *iStateMachine ) );
  3116 
       
  3117 // <-- QT PHONE END --> 
       
  3118     }
  2838     }
  3119 
  2839 
  3120 // -----------------------------------------------------------
  2840 // -----------------------------------------------------------
  3121 // CPhoneState::HandleShowImeiL
  2841 // CPhoneState::HandleShowImeiL
  3122 // -----------------------------------------------------------
  2842 // -----------------------------------------------------------
  3781 
  3501 
  3782 // ---------------------------------------------------------
  3502 // ---------------------------------------------------------
  3783 // CPhoneState::SetTouchPaneButtons
  3503 // CPhoneState::SetTouchPaneButtons
  3784 // ---------------------------------------------------------
  3504 // ---------------------------------------------------------
  3785 //
  3505 //
  3786 // <-- QT PHONE START --> 
       
  3787 EXPORT_C void CPhoneState::SetTouchPaneButtons( TInt /*aResourceId*/ )
  3506 EXPORT_C void CPhoneState::SetTouchPaneButtons( TInt /*aResourceId*/ )
  3788 // <-- QT PHONE END --> 
       
  3789     {
  3507     {
  3790     if ( FeatureManager::FeatureSupported( KFeatureIdTouchCallHandling ) )
  3508     if ( FeatureManager::FeatureSupported( KFeatureIdTouchCallHandling ) )
  3791         {
  3509         {
  3792 // <-- QT PHONE START -->
       
  3793         TBool emergency( EPEStateIdle != 
  3510         TBool emergency( EPEStateIdle != 
  3794             iStateMachine->PhoneEngineInfo()->CallState( KPEEmergencyCallId ) );
  3511             iStateMachine->PhoneEngineInfo()->CallState( KPEEmergencyCallId ) );
  3795         TPhoneCmdParamBoolean booleanParam;
  3512         TPhoneCmdParamBoolean booleanParam;
  3796         booleanParam.SetBoolean( emergency );
  3513         booleanParam.SetBoolean( emergency );
  3797 
  3514 
  3798         TRAP_IGNORE( iViewCommandHandle->ExecuteCommandL(
  3515         TRAP_IGNORE( iViewCommandHandle->ExecuteCommandL(
  3799                      EPhoneViewSetTouchPaneButtons,
  3516                      EPhoneViewSetTouchPaneButtons,
  3800                      &booleanParam ) );
  3517                      &booleanParam ) );
  3801 // <-- QT PHONE END -->
       
  3802         SetTouchPaneVisible( ETrue );
  3518         SetTouchPaneVisible( ETrue );
  3803         }
  3519         }
  3804     }
  3520     }
  3805 
  3521 
  3806 // ---------------------------------------------------------
  3522 // ---------------------------------------------------------
  3809 //
  3525 //
  3810 EXPORT_C void CPhoneState::DeleteTouchPaneButtons()
  3526 EXPORT_C void CPhoneState::DeleteTouchPaneButtons()
  3811     {
  3527     {
  3812     if ( FeatureManager::FeatureSupported( KFeatureIdTouchCallHandling ) )
  3528     if ( FeatureManager::FeatureSupported( KFeatureIdTouchCallHandling ) )
  3813         {
  3529         {
  3814 // <-- QT PHONE START -->
       
  3815         TPhoneCmdParamBoolean boolParam;
  3530         TPhoneCmdParamBoolean boolParam;
  3816         TRAP_IGNORE( iViewCommandHandle->ExecuteCommandL(
  3531         TRAP_IGNORE( iViewCommandHandle->ExecuteCommandL(
  3817                         EPhoneViewSetTouchPaneButtons,
  3532                         EPhoneViewSetTouchPaneButtons,
  3818                         &boolParam ) );
  3533                         &boolParam ) );
  3819 // <-- QT PHONE END -->
       
  3820         SetTouchPaneVisible( EFalse );
  3534         SetTouchPaneVisible( EFalse );
  3821         }
  3535         }
  3822     }
  3536     }
  3823 
  3537 
  3824 // ---------------------------------------------------------
  3538 // ---------------------------------------------------------
  4117     iViewCommandHandle->ExecuteCommandL( EPhoneViewGetSecurityModeStatus, &isSecurityMode );
  3831     iViewCommandHandle->ExecuteCommandL( EPhoneViewGetSecurityModeStatus, &isSecurityMode );
  4118     if ( !isSecurityMode.Boolean() )
  3832     if ( !isSecurityMode.Boolean() )
  4119         {
  3833         {
  4120         CaptureKeysDuringCallNotificationL( EFalse );
  3834         CaptureKeysDuringCallNotificationL( EFalse );
  4121         }
  3835         }
  4122     
       
  4123     CPhonePubSubProxy::Instance()->ChangePropertyValue(
       
  4124                     KPSUidScreenSaver,
       
  4125                     KScreenSaverAllowScreenSaver,
       
  4126                     EPhoneScreensaverAllowed );
       
  4127 
  3836 
  4128     // Restore keylock if phone has been locked before call.
  3837     // Restore keylock if phone has been locked before call.
  4129     if ( iStateMachine->PhoneStorage()->NeedToEnableKeylock() )
  3838     if ( iStateMachine->PhoneStorage()->NeedToEnableKeylock() )
  4130         {
  3839         {
  4131         iViewCommandHandle->ExecuteCommandL( EPhoneViewEnableKeyLock );
  3840         iViewCommandHandle->ExecuteCommandL( EPhoneViewEnableKeyLock );
  4999         TRAP_IGNORE( iViewCommandHandle->ExecuteCommandL(
  4708         TRAP_IGNORE( iViewCommandHandle->ExecuteCommandL(
  5000             EPhoneViewEnableToolbarButton, &integerParam ));
  4709             EPhoneViewEnableToolbarButton, &integerParam ));
  5001         }
  4710         }
  5002     }
  4711     }
  5003 
  4712 
       
  4713 // ---------------------------------------------------------
       
  4714 // CPhoneState::SetToolbarDimming
       
  4715 // ---------------------------------------------------------
       
  4716 //
       
  4717 EXPORT_C void CPhoneState::SetBackButtonActive( TBool aActive )
       
  4718     {
       
  4719     if ( FeatureManager::FeatureSupported( KFeatureIdTouchCallHandling ) )
       
  4720         {
       
  4721         TPhoneCmdParamBoolean booleanParam;
       
  4722         booleanParam.SetBoolean( aActive );
       
  4723         iViewCommandHandle->ExecuteCommand(
       
  4724             EPhoneViewBackButtonActive, &booleanParam );
       
  4725         }
       
  4726     }
       
  4727 
       
  4728 // -----------------------------------------------------------
       
  4729 // CPhoneState::OpenSoftRejectMessageEditorL
       
  4730 // -----------------------------------------------------------
       
  4731 //
       
  4732 EXPORT_C void CPhoneState::OpenSoftRejectMessageEditorL()
       
  4733     {
       
  4734     __LOGMETHODSTARTEND(EPhoneControl,
       
  4735         "CPhoneState::OpenSoftRejectMessageEditorL ()" );
       
  4736 
       
  4737     // Fetch incoming call's id from view
       
  4738     TPhoneCmdParamCallStateData callStateData;
       
  4739     callStateData.SetCallState( EPEStateRinging );
       
  4740     iViewCommandHandle->HandleCommandL(
       
  4741         EPhoneViewGetCallIdByState, &callStateData );
       
  4742 
       
  4743     TInt ringingCallId( KErrNotFound );
       
  4744     // Do nothing if negative incoming call id
       
  4745     if( callStateData.CallId() > KErrNotFound  )
       
  4746         {
       
  4747         iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveQuery );
       
  4748         
       
  4749         ringingCallId = callStateData.CallId();
       
  4750         }
       
  4751     
       
  4752     
       
  4753     TPhoneCmdParamSfiData sfiDataParam;
       
  4754 
       
  4755     if (KErrNotFound != ringingCallId) 
       
  4756         {
       
  4757         if ( iStateMachine->PhoneEngineInfo()->RemoteName( ringingCallId ).Length() )
       
  4758             {
       
  4759             // store both the name and the number
       
  4760             sfiDataParam.SetNumber( iStateMachine->PhoneEngineInfo()->RemotePhoneNumber( ringingCallId ) );
       
  4761             sfiDataParam.SetName( iStateMachine->PhoneEngineInfo()->RemoteName( ringingCallId ) );
       
  4762             }
       
  4763         else
       
  4764             {
       
  4765             // store the number
       
  4766             sfiDataParam.SetNumber( iStateMachine->PhoneEngineInfo()->RemotePhoneNumber( ringingCallId ) );
       
  4767             }
       
  4768         }
       
  4769 
       
  4770     iViewCommandHandle->ExecuteCommandL(
       
  4771         EPhoneViewOpenSoftRejectEditor, &sfiDataParam );
       
  4772     }
  5004 
  4773 
  5005 //  End of File
  4774 //  End of File
  5006 
  4775