2 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
4 // Licensed under the Flora License, Version 1.1 (the License);
5 // you may not use this file except in compliance with the License.
6 // You may obtain a copy of the License at
8 // http://floralicense.org/license/
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an AS IS BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
18 * @file CallCallPresentationModel.cpp
19 * @brief Call Presentation model class
25 #include "CallAppControlRequestMgr.h"
26 #include "CallActiveCallForm.h"
28 #include "CallPresentationModel.h"
29 #include "CallSettingsPresentationModel.h"
30 #include "CallConfCallerListForm.h"
31 #include "CallTelephonyManager.h"
32 #include "CallSceneRegister.h"
33 #include "CallTypes.h"
35 using namespace Tizen::Base;
36 using namespace Tizen::Base::Collection;
37 using namespace Tizen::App;
38 using namespace Tizen::Graphics;
39 using namespace Tizen::Media;
40 using namespace Tizen::Social;
41 using namespace Tizen::Ui::Scenes;
42 using namespace Tizen::Telephony;
43 using namespace Tizen::Base::Utility;
44 using namespace Tizen::Messaging;
46 CallPresentationModel* CallPresentationModel::__pInstance = null;
48 CallPresentationModel::CallPresentationModel(void)
50 __pTelephonyMgr = null;
51 __pTelEventListener = null;
52 __pSettingsPresentor = null;
53 __isMessageAppControlRunning = false;
54 __isDialAppControlRunning = false;
55 __pAppControlMgr = null;
56 __pNetworkManager = null;
57 __psimStateManager = null;
60 __isMessageSendInProgress = false;
63 CallPresentationModel::~CallPresentationModel(void)
65 AppControl::StopAppControlResponseListener(this);
66 __pTelephonyMgr = null;
67 __pSettingsPresentor = null;
68 __pAppControlMgr =null;
69 if(__pNetworkManager != null)
71 delete __pNetworkManager;
72 __pNetworkManager = null;
74 if(__psimStateManager != null)
76 delete __psimStateManager;
77 __psimStateManager = null;
79 if(__psimInfo != null)
84 if(__pSmsManager != null)
92 CallPresentationModel::CreateInstance(void)
94 __pInstance = new (std::nothrow) CallPresentationModel();
95 result r = __pInstance->Construct();
103 std::atexit(DestroyInstance);
106 CallPresentationModel*
107 CallPresentationModel::GetInstance(void)
109 if (__pInstance == null)
117 CallPresentationModel::DestroyInstance(void)
119 if (__pInstance != null)
127 CallPresentationModel::Construct(void)
129 //Fetch Telephony Manager
130 __pTelephonyMgr = TelephonyManager::GetInstance(this);
131 __pSettingsPresentor = SettingsPresentationModel::GetInstance();
132 __pAppControlMgr = CallAppControlRequestMgr::GetInstance();
133 __pNetworkManager = new (std::nothrow)NetworkManager();
134 __pNetworkManager->Construct(null);
140 CallPresentationModel::SetTelEventListener(ITelephonyEventListener* pTelEventListener)
142 //set form as telephony event listener
143 __pTelEventListener = pTelEventListener;
147 CallPresentationModel::IfNumberEndsWithHash(Tizen::Base::String& phoneNumber)
149 String phoneNumberEndingWithHash(L"#$");
150 RegularExpression checkHash;
151 checkHash.Construct(phoneNumberEndingWithHash);
152 bool endsWithHash = checkHash.Match(phoneNumber,false);
153 if(endsWithHash == true)
161 CallPresentationModel::DialCall(String& contactNumber, bool isEmergency)
163 int errorCode = ERROR_NONE;
164 bool isCallServiceAvailable = false;
165 bool numberEndsWithHash = false;
166 NetworkStatus networkStatus;
168 //Check if Telephony Manager is initialized
169 TryCatch(__pTelephonyMgr != null, (errorCode = ERROR_TAPI_INIT_FAILED), "TAPI initialization failed");
171 //check if phone is in flight mode
172 if(__pSettingsPresentor != null && __pSettingsPresentor->GetFlightModeStatus() == true)
174 __pTelEventListener->HandleTelephonyError(ERROR_FLIGHT_MODE_SET);
177 //Check if dialing a call is possible - Check if sim is available
178 if (IsSimAvailable() == false)
180 __pTelEventListener->HandleTelephonyError(ERROR_CODE_SIM_INITIALIZATION_FAILED);
184 //fetch call service status
185 if(__pNetworkManager != null)
187 r = __pNetworkManager->GetNetworkStatus(networkStatus);
190 isCallServiceAvailable = networkStatus.IsCallServiceAvailable();
195 if (isCallServiceAvailable == false)
197 __pTelEventListener->HandleTelephonyError(ERROR_DIAL_FAILED);
200 // check if GPRS number
201 numberEndsWithHash = IfNumberEndsWithHash(contactNumber);
202 if(numberEndsWithHash == true)
204 __pTelEventListener->HandleTelephonyError(ERROR_USSD_NUMBER);
208 //setup outgoing call
209 errorCode = __pTelephonyMgr->SetupMoCall(contactNumber, isEmergency);
210 TryCatch(errorCode == ERROR_NONE,,"Error occurred while setup MO call");
211 if(__pSettingsPresentor != null)
213 __pSettingsPresentor->SetCallState(CALL_STATE_CALL_VOICE_CONNECTING);
218 __pTelEventListener->HandleTelephonyError(errorCode);
222 CallPresentationModel::EndActiveCall(Long callHandle)
224 if(__pTelephonyMgr != null)
226 __pTelephonyMgr->EndActiveCall(callHandle);
231 CallPresentationModel::EndDialingCall(String& contactNumber)
233 if(__pTelephonyMgr != null)
235 __pTelephonyMgr->EndDialingCall(contactNumber);
240 CallPresentationModel::EndConferenceCall(void)
242 result r = __pTelephonyMgr->EndConferenceCall();
245 //TODO: send proper error code
246 __pTelEventListener->HandleTelephonyError(ERROR_GENERAL);
253 CallPresentationModel::EndAllCall(void)
255 if(__pTelephonyMgr != null)
257 __pTelephonyMgr->EndAllCalls();
261 CallPresentationModel::HoldCall(Tizen::Base::Long callHandle)
263 result r = __pTelephonyMgr->HoldCall(callHandle, true);
264 return (!IsFailed(r));
268 CallPresentationModel::UnHoldCall(Tizen::Base::Long callHandle)
270 result r = __pTelephonyMgr->HoldCall(callHandle, false);
271 return (!IsFailed(r));
275 CallPresentationModel::HoldConferenceCall(void)
277 result r = __pTelephonyMgr->HoldConferenceCall(true);
278 return (!IsFailed(r));
282 CallPresentationModel::ActivateConferenceCall(void)
284 result r = __pTelephonyMgr->HoldConferenceCall(false);
285 return (!IsFailed(r));
289 CallPresentationModel::JoinCall(void)
291 result r = __pTelephonyMgr->JoinCall();
294 __pTelEventListener->HandleTelephonyError(ERROR_JOIN_FAILED);
299 CallPresentationModel::SwapCalls(void)
301 result r = __pTelephonyMgr->SwapCalls();
304 __pTelEventListener->HandleTelephonyError(ERROR_SWAP_FAILED);
309 CallPresentationModel::SetMuteStatus(bool setMute)
311 result r = __pTelephonyMgr->SetMuteStatus(setMute);
312 return (!IsFailed(r));
316 CallPresentationModel::IsCallMuted(void)
318 return __pTelephonyMgr->IsCallMuted();
322 CallPresentationModel::SetSpeakerStatus(bool setSpeaker)
324 result r = __pTelephonyMgr->SetSpeakerStatus(setSpeaker);
325 return (!IsFailed(r));
329 CallPresentationModel::IsSpeakerOn(void)
331 return __pTelephonyMgr->IsSpeakerOn();
334 CallPresentationModel::SendDTMFSignal(String& textToBeSent)
336 __pTelephonyMgr->SendCallDTMF(textToBeSent);
340 CallPresentationModel::GetConferenceCallInfoN(void)
342 return __pTelephonyMgr->GetConferenceCallInfoN();
346 CallPresentationModel::SplitFromConference(SplitConfCallerCmdIds splitCallerCmdId, IListT<AppCallInfo>* pConfCallList)
349 AppCallInfo callToBeSpli;
350 switch (splitCallerCmdId)
352 case IDA_SPLIT_CALLER1:
356 case IDA_SPLIT_CALLER2:
360 case IDA_SPLIT_CALLER3:
364 case IDA_SPLIT_CALLER4:
368 case IDA_SPLIT_CALLER5:
376 result r = pConfCallList->GetAt(callIndex, callToBeSpli);
377 TryCatch(r == E_SUCCESS,,"conf. call list corrupted");
378 //split single call from conference
379 r = __pTelephonyMgr->SplitFromConference(callToBeSpli.GetCallHandle()->ToLong());
380 TryCatch(r == E_SUCCESS,,"Split from conf. call failed");
384 __pTelEventListener->HandleTelephonyError(ERROR_SPLIT_FROM_CONFERENCE_FAILED);
389 CallPresentationModel::EndCallFromConference(EndConfCallerCmdIds endCallerCmdId, IListT<AppCallInfo>* pConfCallList)
392 AppCallInfo callToBeEnded;
393 switch (endCallerCmdId)
395 case IDA_END_CALLER1:
399 case IDA_END_CALLER2:
403 case IDA_END_CALLER3:
407 case IDA_END_CALLER4:
411 case IDA_END_CALLER5:
419 result r = pConfCallList->GetAt(callIndex, callToBeEnded);
420 TryCatch(r == E_SUCCESS,,"conference call list corrupted");
422 r = __pTelephonyMgr->EndFromConference(callToBeEnded.GetCallHandle()->ToLong());
423 TryCatch(r == E_SUCCESS,,"End single call from conference call failed");
428 __pTelEventListener->HandleTelephonyError(ERROR_END_CALL_FAILED);
433 CallPresentationModel::IsSplitAllowed(void)
435 return __pTelephonyMgr->IsSplitAllowed();
439 CallPresentationModel::AcceptIncomingCall(CallAnsweringOptions answerOptions,int callHandle)
441 result r = E_FAILURE;
442 if (answerOptions == ANSERWING_OPTION_ACCEPT_CALL)
444 r = __pTelephonyMgr->AnswerCall(callHandle, true);
448 r = __pTelephonyMgr->AcceptCall(answerOptions,callHandle);
452 __pTelEventListener->HandleTelephonyError(ERROR_GENERAL);
457 CallPresentationModel::GetCallListN(void)
459 return __pTelephonyMgr->GetCallListN();
464 CallPresentationModel::RejectCall(int callHandle, bool sendMsg, const String& contactNumber)
466 AppLogDebug("Enter %d",callHandle);
467 if (sendMsg == true && __pAppControlMgr != null)
469 //launch compose message AppControl
470 __isMessageAppControlRunning = __pAppControlMgr->LaunchComposeMessageAppControl(*(const_cast<String*>(&contactNumber)), this);
472 result r = __pTelephonyMgr->AnswerCall(callHandle, false);
475 __pTelEventListener->HandleTelephonyError(ERROR_GENERAL);
484 void CallPresentationModel::OnAppForeground(void)
486 AppLogDebug("Enter %d %d",__isDialAppControlRunning ,__isMessageAppControlRunning);
487 if (__isDialAppControlRunning == true)
489 //This comes here, when Dialer AppControl is finished working.
490 __isDialAppControlRunning = false;
491 __pAppControlMgr->AppControlRequestCompleted();
493 if (__isMessageAppControlRunning == true)
495 //This comes here, when Message AppControl is finished working.
496 __isMessageAppControlRunning = false;
497 __pAppControlMgr->AppControlRequestCompleted();
498 //Check if this was the last call, then terminate application.
499 //And if any calls are active, then those cases are already handled from Other places.
500 if( GetCurrentCallCount() == 0 && IsIncomingorDialingCallPresent() == false)
502 CallApp* pCallApp = static_cast<CallApp*>(UiApp::GetInstance());
503 pCallApp->Terminate();
509 CallPresentationModel::OnAppControlCompleteResponseReceived(const AppId& appId, const String& operationId, AppCtrlResult appControlResult, const IMap* pExtraData)
511 AppLogDebug("Enter");
512 if (__isMessageAppControlRunning == true)
514 //This comes here, when Message AppControl is finished working.
515 __isMessageAppControlRunning = false;
516 __pAppControlMgr->AppControlRequestCompleted();
517 //Check if this was the last call, then terminate application.
518 //And if any calls are active, then those cases are already handled from Other places.
519 if( GetCurrentCallCount() == 0)
521 CallApp* pPhoneApp = static_cast<CallApp*>(UiApp::GetInstance());
522 pPhoneApp->Terminate();
525 if(appId.Equals(PROVIDER_ID_PHONE,false) == true && operationId.Equals(OPERATION_ID_DIAL,false) == true)
527 __isDialAppControlRunning = false;
529 __pAppControlMgr->AppControlRequestCompleted();
530 if(appControlResult == APP_CTRL_RESULT_SUCCEEDED)
532 String* pKey = new (std::nothrow) String(PARAM_PHONE_NUMBER);
533 if (pExtraData->ContainsKey(*pKey) == true)
535 const String* pPhoneNumber = static_cast<const String*>(pExtraData->GetValue(*pKey));
536 if(pPhoneNumber != null && pPhoneNumber->IsEmpty() == false)
538 AddCall(*pPhoneNumber);
549 CallPresentationModel::AddCall(const String& phoneNumber)
551 ArrayList* pLaunchArgs = null;
552 SceneManager* pSceneManager = SceneManager::GetInstance();
553 int currentActiveCallCount = GetCurrentCallCount();
554 if(currentActiveCallCount <= 1 && IsIncomingorDialingCallPresent() == false)
556 //make an outgoing call with given number
557 String* contactTxt = new (std::nothrow) String(phoneNumber);
558 pLaunchArgs = new (std::nothrow) ArrayList(SingleObjectDeleter);
559 pLaunchArgs->Construct();
560 pLaunchArgs->Add(contactTxt);
561 bool isEmergencyCall = IsEmergencyNumber(*contactTxt, true);
563 SceneId nextScene = IDSCN_SCENE_OUTCALL;
566 nextScene = IDSCN_SCENE_OUT_EMERGENCYCALL;
568 pSceneManager->GoForward( ForwardSceneTransition( nextScene,
569 SCENE_TRANSITION_ANIMATION_TYPE_NONE, SCENE_HISTORY_OPTION_NO_HISTORY,SCENE_DESTROY_OPTION_KEEP), pLaunchArgs);
575 CallPresentationModel::GetCurrentCallCount(void)
577 return __pTelephonyMgr->GetCurrentCallCount();
581 CallPresentationModel::CheckSimInitializationIsCompleted()
583 result r = E_FAILURE;
584 if(__pTelephonyMgr != null)
586 r = __pTelephonyMgr->CheckIfMOCallIsPossible();
588 return (!IsFailed(r));
592 CallPresentationModel::IsEmergencyNumber(const Tizen::Base::String& phoneNumber, bool isSimInitialized)
594 return __pTelephonyMgr->CheckIfMOCallIsEmergency(phoneNumber, isSimInitialized);
598 CallPresentationModel::StartAlert(AppCallInfo& incomingCallInfo)
600 //Adding incoming call sate setting here
601 if(__pSettingsPresentor != null)
603 __pSettingsPresentor->SetCallState(CALL_STATE_CALL_VOICE_CONNECTING);
605 __pTelephonyMgr->StartAlert(incomingCallInfo);
609 CallPresentationModel::StopAlert(void)
611 __pTelephonyMgr->StopAlert();
615 CallPresentationModel::GetContactN(const String& phoneNumber)
617 return __pTelephonyMgr->GetContactN(phoneNumber);
621 CallPresentationModel::FetchIncomingCallDetailsN(const String& callHandle, const String& contactNumber)
624 return __pTelephonyMgr->FetchIncomingCallHandleN(callHandle, contactNumber);
628 CallPresentationModel::CheckIncomingCallToBeRejected(AppCallInfo* pIncomingCallInfo)
630 return __pTelephonyMgr->CheckIncomingCallToBeRejected(pIncomingCallInfo);
633 /////////////////////////////////////////////////////////////////
634 ///// Event Listener methods from ITelephonyEventListener /////
635 /////////////////////////////////////////////////////////////////
637 CallPresentationModel::HandleCallConnected(Tizen::Base::Collection::IListT<AppCallInfo>& pCallList)
639 if (__pTelEventListener != null)
641 __pTelEventListener->HandleCallConnected(pCallList);
643 if(__pSettingsPresentor != null)
645 if(IsIncomingorDialingCallPresent() == false)
647 __pSettingsPresentor->SetCallState(CALL_STATE_CALL_VOICE_ACTIVE);
653 CallPresentationModel::HandleCallActive(bool isActive)
655 if (__pTelEventListener != null)
657 __pTelEventListener->HandleCallActive(isActive);
662 CallPresentationModel::HandleCallHeld(bool isHeld)
664 if (__pTelEventListener != null)
666 __pTelEventListener->HandleCallHeld(isHeld);
671 CallPresentationModel::HandleCallDisconnected(bool isLastCall, Tizen::Base::Collection::IListT<AppCallInfo>& pCallList)
673 AppLogDebug("Enter");
674 if (isLastCall == true)
676 SetSpeakerStatus(false);
677 SetMuteStatus(false);
678 if(__pSettingsPresentor != null)
680 //Check if there is a incoming call or dialing call present before setting the status
681 if(IsIncomingorDialingCallPresent() == false)
683 __pSettingsPresentor->SetCallState(CALL_STATE_CALL_OFF);
689 if(__pSettingsPresentor != null)
691 if(IsIncomingorDialingCallPresent() == false)
693 __pSettingsPresentor->SetCallState(CALL_STATE_CALL_VOICE_ACTIVE);
697 //1) Defer from sending call disconnected event to form, in case Msg AppControl is running,
698 //to avoid PhoneApp from going to EndCall form, where it shows for 3 sec. and automatically closes.
699 //2) Do not send call disconnected event to any form, in case an incoming call or dialing call is present.
700 if (__pTelEventListener != null /*&& __isMessageAppControlRunning == false*/ )
702 __pTelEventListener->HandleCallDisconnected(isLastCall, pCallList);
707 CallPresentationModel::HandleConferenceCall(AppCallInfo& pCallInfo)
709 if (__pTelEventListener != null)
711 __pTelEventListener->HandleConferenceCall(pCallInfo);
716 CallPresentationModel::HandleIncomingCall(AppCallInfo& pCallInfo)
718 AppLogDebug("Error - This will never come here. Since, now we are getting incoming call event through AppControl!!");
722 CallPresentationModel::HandleConfCallHoldOccured(bool success)
724 if (__pTelEventListener != null)
726 __pTelEventListener->HandleConfCallHoldOccured(success);
731 CallPresentationModel::HandleConfCallActiveOccured(bool success)
733 if (__pTelEventListener != null)
735 __pTelEventListener->HandleConfCallActiveOccured(success);
740 CallPresentationModel::HandleCallSwapOccured(Tizen::Base::Collection::IListT<AppCallInfo>& pCallList)
742 if (__pTelEventListener != null)
744 __pTelEventListener->HandleCallSwapOccured(pCallList);
749 CallPresentationModel::HandleConferenceChange(void)
751 //1) Do not send conf. call changed event to any form, in case an incoming call or dialing call is present.
752 if (__pTelEventListener != null)
754 __pTelEventListener->HandleConferenceChange();
759 CallPresentationModel::HandleTelephonyError(int errorCode)
761 if (__pTelEventListener != null)
763 __pTelEventListener->HandleTelephonyError(errorCode);
768 CallPresentationModel::LaunchDialAppControl()
771 if(__isDialAppControlRunning == true)
773 AppLogDebug("__isDialAppControlRunning == true");
774 //Do not allow another app control if already running
778 //Launch dialer AppControl
779 if (__pAppControlMgr != null)
781 __isDialAppControlRunning = __pAppControlMgr->LaunchDialerAppControl(this);
787 CallPresentationModel::IsEnableJoinCallButton(void)
789 //Check if conf. call has maximum participants
790 AppCallInfo* pConfCallInfo = GetConferenceCallInfoN();
791 if(pConfCallInfo != null && pConfCallInfo->GetCallerListCount() >= IDI_MAX_CONF_CALL_PARTICIPANTS)
796 //check if either of the caller is same or present in conf call.
797 IListT<AppCallInfo>* pActiveCallList = GetCallListN();
798 if ( pActiveCallList != null && pActiveCallList->GetCount() == IDI_MAX_ACTIVE_CALLS)
800 AppCallInfo firstCall;
801 AppCallInfo secondCall;
802 pActiveCallList->GetAt(0, firstCall);
803 pActiveCallList->GetAt(1, secondCall);
805 if (firstCall.IsConferenceCall() == true)
807 IListT<AppCallInfo>* pConfMemberList = firstCall.GetCallerList();
808 for (int index = 0; index < pConfMemberList->GetCount(); index++)
810 AppCallInfo singleConfMember;
811 pConfMemberList->GetAt(index, singleConfMember);
812 if (secondCall.GetContactNumber().IsEmpty() == false && secondCall.GetContactNumber().Equals(singleConfMember.GetContactNumber()) == true)
818 else if (secondCall.IsConferenceCall() == true)
820 IListT<AppCallInfo>* pConfMemberList = secondCall.GetCallerList();
821 for (int index = 0; index < pConfMemberList->GetCount(); index++)
823 AppCallInfo singleConfMember;
824 pConfMemberList->GetAt(index, singleConfMember);
825 if (firstCall.GetContactNumber().IsEmpty() == false && firstCall.GetContactNumber().Equals(singleConfMember.GetContactNumber()) == true)
833 //Now, we definitely know that both are single active calls.
834 if (firstCall.GetContactNumber().IsEmpty() == false && firstCall.GetContactNumber().Equals(secondCall.GetContactNumber()) == true)
840 delete pConfCallInfo;
841 pConfCallInfo = null;
846 CallPresentationModel::IsIncomingorDialingCallPresent(void)
848 //returns false, if incoming call or dialed call is present.
849 return __pTelephonyMgr->IsIncomingorDialingCallPresent();
853 CallPresentationModel::LaunchComposeMessageAppControl(String& contactNumber, IAppControlResponseListener* pListener)
855 if (__pAppControlMgr != null)
857 return __pAppControlMgr->LaunchComposeMessageAppControl(contactNumber, pListener);
863 CallPresentationModel::LaunchViewContactAppControl(String& contactId, IAppControlResponseListener* pListener)
865 if (__pAppControlMgr != null)
867 return __pAppControlMgr->LaunchViewContactAppControl(contactId, pListener);
873 CallPresentationModel::LaunchAddContactAppControl(Tizen::Base::String& contactNumber, Tizen::App::IAppControlResponseListener* pListener)
875 if (__pAppControlMgr != null)
877 return __pAppControlMgr->LaunchAddContactAppControl(contactNumber, pListener);
883 CallPresentationModel::IsAppControlRunning(void)
885 if (__pAppControlMgr != null)
887 return __pAppControlMgr->IsAppControlRunning();
893 CallPresentationModel::AbortAppControlRequest(void)
895 if (__pAppControlMgr != null)
897 __pAppControlMgr->AbortAppControlRequest();
902 CallPresentationModel::AppControlRequestCompleted(void)
904 if (__pAppControlMgr != null)
906 __pAppControlMgr->AppControlRequestCompleted();
911 CallPresentationModel::GetSimInfo(void)
913 __psimStateManager = new (std::nothrow)SimStateManager();
914 result r = __psimStateManager->Construct();
917 delete __psimStateManager;
918 __psimStateManager = null;
921 __psimStateManager->SetSimEventListener(this);
923 __psimInfo = new (std::nothrow)SimInfo();
924 r = __psimStateManager->GetSimInfo(*__psimInfo);
927 delete __psimStateManager;
928 __psimStateManager = null;
937 CallPresentationModel::OnTelephonyNetworkStatusChanged(const NetworkStatus& networkStatus)
943 CallPresentationModel::OnTelephonySimStateChanged(Tizen::Telephony::SimState state)
945 if(__psimStateManager != null)
947 delete __psimStateManager;
948 __psimStateManager =null;
950 if(__psimInfo != null)
956 __psimStateManager = new SimStateManager();
957 result r = __psimStateManager->Construct();
960 delete __psimStateManager;
961 __psimStateManager = null;
965 __psimInfo = new SimInfo();
966 r = __psimStateManager->GetSimInfo(*__psimInfo);
969 delete __psimStateManager;
970 __psimStateManager = null;
979 CallPresentationModel::IsSimAvailable(void)
981 if(__psimInfo != null)
983 return __psimInfo->IsAvailable();
994 CallPresentationModel::SendMessage(String& strMsg,String& recpientNum)
996 AppLogDebug("Enter");
998 if(__pSmsManager == null)
1000 __pSmsManager = new (std::nothrow) SmsManager();
1001 result r = __pSmsManager->Construct(*this);
1002 if (IsFailed(r) == true)
1004 delete __pSmsManager;
1005 __pSmsManager = null;
1010 RecipientList recipient;
1011 recipient.Add(RECIPIENT_TYPE_TO,recpientNum);
1012 SmsMessage smsMessage;
1013 r = smsMessage.SetText(strMsg);
1014 if (IsFailed(r) == false)
1016 r = __pSmsManager->Send(smsMessage,recipient,true);
1017 if (IsFailed(r) == false)
1019 __isMessageSendInProgress = true;
1027 CallPresentationModel::IsMessageSendingInProgress(void)
1029 AppLogDebug("Enter %d",__isMessageSendInProgress);
1030 return __isMessageSendInProgress;
1034 CallPresentationModel::OnSmsMessageSent(result r)
1036 AppLogDebug("Enter");
1037 __isMessageSendInProgress = false;