65 #include "tphonecmdparamnote.h" |
65 #include "tphonecmdparamnote.h" |
66 #include "tphonecmdparamkeycapture.h" |
66 #include "tphonecmdparamkeycapture.h" |
67 #include "tphonecmdparamglobalnote.h" |
67 #include "tphonecmdparamglobalnote.h" |
68 #include "tphonecmdparamquery.h" |
68 #include "tphonecmdparamquery.h" |
69 #include "tphonecmdparamstring.h" |
69 #include "tphonecmdparamstring.h" |
70 #include "tphonecmdparamcallstatedata.h" |
|
71 #include "tphonecmdparambitmap.h" |
70 #include "tphonecmdparambitmap.h" |
72 #include "tphonecmdparamappinfo.h" |
71 #include "tphonecmdparamappinfo.h" |
73 #include "tphonecmdparamtranseffect.h" |
72 #include "tphonecmdparamtranseffect.h" |
74 #include "tphonecmdparamringtone.h" |
73 #include "tphonecmdparamringtone.h" |
75 #include "tphonecmdparamcustomdialer.h" |
74 #include "tphonecmdparamcustomdialer.h" |
833 // <-------------------------- COMMON STATE FUNCTIONS ------------------------> |
834 // <-------------------------- COMMON STATE FUNCTIONS ------------------------> |
834 // ----------------------------------------------------------- |
835 // ----------------------------------------------------------- |
835 // CPhoneState::DialMultimediaCallL |
836 // CPhoneState::DialMultimediaCallL |
836 // ----------------------------------------------------------- |
837 // ----------------------------------------------------------- |
837 // |
838 // |
838 EXPORT_C void CPhoneState::DialMultimediaCallL() |
839 EXPORT_C void CPhoneState::DialMultimediaCall() |
839 { |
840 { |
840 __LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::DialMultimediaCall() "); |
841 __LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::DialMultimediaCall() "); |
841 __ASSERT_DEBUG( iStateMachine->PhoneEngineInfo(), |
842 __ASSERT_DEBUG( iStateMachine->PhoneEngineInfo(), |
842 Panic( EPhoneCtrlInvariant ) ); |
843 Panic( EPhoneCtrlInvariant ) ); |
843 iStateMachine->PhoneEngineInfo()->SetCallTypeCommand( EPECallTypeVideo ); |
844 PhoneCallUtil::DialMultimediaCall(); |
844 iStateMachine->SendPhoneEngineMessage( MPEPhoneModel::EPEMessageDial ); |
|
845 } |
845 } |
846 |
846 |
847 // ----------------------------------------------------------- |
847 // ----------------------------------------------------------- |
848 // CPhoneState::DialVoiceCallL |
848 // CPhoneState::DialVoiceCallL |
849 // ----------------------------------------------------------- |
849 // ----------------------------------------------------------- |
850 // |
850 // |
851 EXPORT_C void CPhoneState::DialVoiceCallL() |
851 EXPORT_C void CPhoneState::DialVoiceCallL() |
852 { |
852 { |
853 __LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::DialVoiceCallL() "); |
853 __LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::DialVoiceCallL() "); |
854 __ASSERT_DEBUG( iStateMachine->PhoneEngineInfo(), Panic( EPhoneCtrlInvariant ) ); |
854 __ASSERT_DEBUG( iStateMachine->PhoneEngineInfo(), Panic( EPhoneCtrlInvariant ) ); |
855 TPhoneCmdParamBoolean globalNotifierParam; |
855 PhoneCallUtil::DialVoiceCallL(); |
856 globalNotifierParam.SetBoolean( ETrue ); |
|
857 iViewCommandHandle->ExecuteCommandL( EPhoneViewSetGlobalNotifiersDisabled, |
|
858 &globalNotifierParam ); |
|
859 iStateMachine->PhoneEngineInfo()->SetCallTypeCommand( EPECallTypeCSVoice ); |
|
860 iStateMachine->SendPhoneEngineMessage( MPEPhoneModel::EPEMessageDial ); |
|
861 } |
856 } |
862 |
857 |
863 // ----------------------------------------------------------- |
858 // ----------------------------------------------------------- |
864 // CPhoneState::DisconnectCallL |
859 // CPhoneState::DisconnectCallL |
865 // ----------------------------------------------------------- |
860 // ----------------------------------------------------------- |
866 // |
861 // |
867 EXPORT_C TBool CPhoneState::DisconnectCallL() |
862 EXPORT_C TBool CPhoneState::DisconnectCallL() |
868 { |
863 { |
869 __LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::DisconnectCallL( ) "); |
864 __LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::DisconnectCallL( ) "); |
870 TPhoneCmdParamInteger callIdParam; |
865 return PhoneCallUtil::DisconnectCallL(); |
871 iViewCommandHandle->ExecuteCommand( |
|
872 EPhoneViewGetExpandedBubbleCallId, &callIdParam ); |
|
873 TBool ret = EFalse; |
|
874 if( callIdParam.Integer() > KErrNotFound ) |
|
875 { |
|
876 iStateMachine->SetCallId( callIdParam.Integer() ); |
|
877 if( IsVideoCall( callIdParam.Integer() ) ) |
|
878 { |
|
879 // Video call can be released only after we get response to VT Shutdown Command |
|
880 CPhoneMediatorFactory::Instance()->Sender()->IssueCommand( |
|
881 KMediatorVideoTelephonyDomain, |
|
882 KCatPhoneToVideotelCommands, |
|
883 EVtCmdReleaseDataport, |
|
884 TVersion( KPhoneToVideotelCmdVersionMajor, |
|
885 KPhoneToVideotelCmdVersionMinor, |
|
886 KPhoneToVideotelCmdVersionBuild ), |
|
887 KNullDesC8, |
|
888 CPhoneReleaseCommand::NewL( *iStateMachine ) ); |
|
889 } |
|
890 else |
|
891 { |
|
892 iStateMachine->SendPhoneEngineMessage( |
|
893 MPEPhoneModel::EPEMessageRelease ); |
|
894 } |
|
895 ret = ETrue; |
|
896 } |
|
897 else |
|
898 { |
|
899 __PHONELOG( EOnlyFatal, EPhoneControl, |
|
900 "CPhoneState::DisconnectCallL has negative call id!" ); |
|
901 } |
|
902 return ret; |
|
903 } |
866 } |
904 |
867 |
905 // ----------------------------------------------------------- |
868 // ----------------------------------------------------------- |
906 // CPhoneState::RemoveDialogsAndSendPhoneToBackgroundL() |
869 // CPhoneState::RemoveDialogsAndSendPhoneToBackgroundL() |
907 // ----------------------------------------------------------- |
870 // ----------------------------------------------------------- |
943 // we must show number entry. |
906 // we must show number entry. |
944 if ( iNumberEntryManager->IsNumberEntryUsedL() && !IsAutoLockOn() ) |
907 if ( iNumberEntryManager->IsNumberEntryUsedL() && !IsAutoLockOn() ) |
945 { |
908 { |
946 iNumberEntryManager->SetNumberEntryVisibilityL(ETrue); |
909 iNumberEntryManager->SetNumberEntryVisibilityL(ETrue); |
947 } |
910 } |
948 } |
|
949 |
|
950 // ----------------------------------------------------------- |
|
951 // CPhoneState::IsWaitingCallL |
|
952 // ----------------------------------------------------------- |
|
953 // |
|
954 TBool CPhoneState::IsWaitingCallL( const TInt aCallId ) |
|
955 { |
|
956 __LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::IsWaitingCallL( ) "); |
|
957 TBool waiting( EFalse ); |
|
958 if ( aCallId >= 0 && |
|
959 iStateMachine->PhoneEngineInfo()->CallState( aCallId ) == EPEStateRinging ) |
|
960 { |
|
961 TPhoneCmdParamInteger activeCallCount; |
|
962 iViewCommandHandle->ExecuteCommandL( |
|
963 EPhoneViewGetCountOfActiveCalls, &activeCallCount ); |
|
964 |
|
965 if( activeCallCount.Integer() > 0 ) |
|
966 { |
|
967 waiting = ETrue; |
|
968 } |
|
969 } |
|
970 |
|
971 return waiting; |
|
972 } |
911 } |
973 |
912 |
974 // ----------------------------------------------------------- |
913 // ----------------------------------------------------------- |
975 // CPhoneState::UpdateCallHeader |
914 // CPhoneState::UpdateCallHeader |
976 // ----------------------------------------------------------- |
915 // ----------------------------------------------------------- |
1722 aData, |
1656 aData, |
1723 CPhoneMainResourceResolver::Instance()->ResolveResourceID( aResource ), |
1657 CPhoneMainResourceResolver::Instance()->ResolveResourceID( aResource ), |
1724 EikonEnv() ); |
1658 EikonEnv() ); |
1725 } |
1659 } |
1726 |
1660 |
1727 // ----------------------------------------------------------- |
|
1728 // CPhoneState::IsAnyConnectedCalls |
|
1729 // ----------------------------------------------------------- |
|
1730 // |
|
1731 TBool CPhoneState::IsAnyConnectedCalls() |
|
1732 { |
|
1733 __LOGMETHODSTARTEND( EPhoneControl, "CPhoneState::IsAnyConnectedCalls() "); |
|
1734 TBool connectedCall(EFalse); |
|
1735 if ( iStateMachine->PhoneEngineInfo()->CheckIfCallStateExists( EPEStateConnected ) || |
|
1736 iStateMachine->PhoneEngineInfo()->CheckIfCallStateExists( EPEStateConnecting ) || |
|
1737 iStateMachine->PhoneEngineInfo()->CheckIfCallStateExists( EPEStateConnectedConference ) ) |
|
1738 { |
|
1739 connectedCall = ETrue; |
|
1740 } |
|
1741 __PHONELOG1( EBasic, EPhoneControl, "CPhoneState::IsAnyConnectedCalls: (%d)", connectedCall ); |
|
1742 return connectedCall; |
|
1743 } |
|
1744 |
|
1745 // --------------------------------------------------------- |
1661 // --------------------------------------------------------- |
1746 // CPhoneState::SetToolbarButtonLoudspeakerEnabled |
1662 // CPhoneState::SetToolbarButtonLoudspeakerEnabled |
1747 // --------------------------------------------------------- |
1663 // --------------------------------------------------------- |
1748 // |
1664 // |
1749 EXPORT_C void CPhoneState::SetToolbarButtonLoudspeakerEnabled() |
1665 EXPORT_C void CPhoneState::SetToolbarButtonLoudspeakerEnabled() |
1778 EXPORT_C void CPhoneState::OpenSoftRejectMessageEditorL() |
1694 EXPORT_C void CPhoneState::OpenSoftRejectMessageEditorL() |
1779 { |
1695 { |
1780 __LOGMETHODSTARTEND(EPhoneControl, |
1696 __LOGMETHODSTARTEND(EPhoneControl, |
1781 "CPhoneState::OpenSoftRejectMessageEditorL ()" ); |
1697 "CPhoneState::OpenSoftRejectMessageEditorL ()" ); |
1782 iUiCommandManager->SetSoftRejectStatus( EFalse ); |
1698 iUiCommandManager->SetSoftRejectStatus( EFalse ); |
1783 TPhoneCmdParamCallStateData callStateData; |
1699 |
1784 callStateData.SetCallState( EPEStateRinging ); |
1700 TInt ringingCallId( PhoneCallUtil::CallIdByState( EPEStateRinging ) ); |
1785 iViewCommandHandle->HandleCommandL( |
|
1786 EPhoneViewGetCallIdByState, &callStateData ); |
|
1787 |
|
1788 TInt ringingCallId( KErrNotFound ); |
|
1789 // Do nothing if negative incoming call id |
|
1790 if( callStateData.CallId() > KErrNotFound ) |
|
1791 { |
|
1792 iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveQuery ); |
|
1793 ringingCallId = callStateData.CallId(); |
|
1794 } |
|
1795 |
1701 |
1796 TPhoneCmdParamSfiData sfiDataParam; |
1702 TPhoneCmdParamSfiData sfiDataParam; |
1797 if (KErrNotFound != ringingCallId) |
1703 if( ringingCallId > KErrNotFound ) |
1798 { |
1704 { |
|
1705 iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveQuery ); |
1799 if ( iStateMachine->PhoneEngineInfo()-> |
1706 if ( iStateMachine->PhoneEngineInfo()-> |
1800 RemoteName( ringingCallId ).Length() ) |
1707 RemoteName( ringingCallId ).Length() ) |
1801 { |
1708 { |
1802 // store both the name and the number |
1709 // store both the name and the number |
1803 sfiDataParam.SetNumber( |
1710 sfiDataParam.SetNumber( |