+
+bool
+CallPresentationModel::IsIncomingorDialingCallPresent(void)
+{
+ //returns false, if incoming call or dialed call is present.
+ return __pTelephonyMgr->IsIncomingorDialingCallPresent();
+}
+
+bool
+CallPresentationModel::LaunchComposeMessageAppControl(String& contactNumber, IAppControlResponseListener* pListener)
+{
+ if (__pAppControlMgr != null)
+ {
+ return __pAppControlMgr->LaunchComposeMessageAppControl(contactNumber, pListener);
+ }
+ return false;
+}
+
+bool
+CallPresentationModel::LaunchViewContactAppControl(String& contactId, IAppControlResponseListener* pListener)
+{
+ if (__pAppControlMgr != null)
+ {
+ return __pAppControlMgr->LaunchViewContactAppControl(contactId, pListener);
+ }
+ return false;
+}
+
+bool
+CallPresentationModel::LaunchAddContactAppControl(Tizen::Base::String& contactNumber, Tizen::App::IAppControlResponseListener* pListener)
+{
+ if (__pAppControlMgr != null)
+ {
+ return __pAppControlMgr->LaunchAddContactAppControl(contactNumber, pListener);
+ }
+ return false;
+}
+
+bool
+CallPresentationModel::IsAppControlRunning(void)
+{
+ if (__pAppControlMgr != null)
+ {
+ return __pAppControlMgr->IsAppControlRunning();
+ }
+ return false;
+}
+
+void
+CallPresentationModel::AbortAppControlRequest(void)
+{
+ if (__pAppControlMgr != null)
+ {
+ __pAppControlMgr->AbortAppControlRequest();
+ }
+}
+
+void
+CallPresentationModel::AppControlRequestCompleted(void)
+{
+ if (__pAppControlMgr != null)
+ {
+ __pAppControlMgr->AppControlRequestCompleted();
+ }
+}
+
+result
+CallPresentationModel::GetSimInfo(void)
+{
+ __psimStateManager = new (std::nothrow)SimStateManager();
+ result r = __psimStateManager->Construct();
+ if (IsFailed(r))
+ {
+ delete __psimStateManager;
+ __psimStateManager = null;
+ return E_FAILURE;
+ }
+ __psimStateManager->SetSimEventListener(this);
+
+ __psimInfo = new (std::nothrow)SimInfo();
+ r = __psimStateManager->GetSimInfo(*__psimInfo);
+ if (IsFailed(r))
+ {
+ delete __psimStateManager;
+ __psimStateManager = null;
+ delete __psimInfo;
+ __psimInfo = null;
+ return E_FAILURE;
+ }
+ return E_SUCCESS;
+}
+
+void
+CallPresentationModel::OnTelephonyNetworkStatusChanged(const NetworkStatus& networkStatus)
+{
+
+}
+
+void
+CallPresentationModel::OnTelephonySimStateChanged(Tizen::Telephony::SimState state)
+{
+ if(__psimStateManager != null)
+ {
+ delete __psimStateManager;
+ __psimStateManager =null;
+ }
+ if(__psimInfo != null)
+ {
+ delete __psimInfo;
+ __psimInfo = null;
+ }
+
+ __psimStateManager = new SimStateManager();
+ result r = __psimStateManager->Construct();
+ if (IsFailed(r))
+ {
+ delete __psimStateManager;
+ __psimStateManager = null;
+ return ;
+ }
+
+ __psimInfo = new SimInfo();
+ r = __psimStateManager->GetSimInfo(*__psimInfo);
+ if (IsFailed(r))
+ {
+ delete __psimStateManager;
+ __psimStateManager = null;
+ delete __psimInfo;
+ __psimInfo = null;
+ return ;
+ }
+
+}
+
+bool
+CallPresentationModel::IsSimAvailable(void)
+{
+ if(__psimInfo != null)
+ {
+ return __psimInfo->IsAvailable();
+ }
+ else
+ {
+ return false;
+ }
+
+
+}
+
+void
+CallPresentationModel::SendMessage(String& strMsg,String& recpientNum)
+{
+ AppLogDebug("Enter");
+ result r;
+ if(__pSmsManager == null)
+ {
+ __pSmsManager = new (std::nothrow) SmsManager();
+ result r = __pSmsManager->Construct(*this);
+ if (IsFailed(r) == true)
+ {
+ delete __pSmsManager;
+ __pSmsManager = null;
+ return;
+ }
+
+ }
+ RecipientList recipient;
+ recipient.Add(RECIPIENT_TYPE_TO,recpientNum);
+ SmsMessage smsMessage;
+ r = smsMessage.SetText(strMsg);
+ if (IsFailed(r) == false)
+ {
+ r = __pSmsManager->Send(smsMessage,recipient,true);
+ if (IsFailed(r) == false)
+ {
+ __isMessageSendInProgress = true;
+ }
+
+ }
+
+}
+
+bool
+CallPresentationModel::IsMessageSendingInProgress(void)
+{
+ AppLogDebug("Enter %d",__isMessageSendInProgress);
+ return __isMessageSendInProgress;
+}
+
+void
+CallPresentationModel::OnSmsMessageSent(result r)
+{
+ AppLogDebug("Enter");
+ __isMessageSendInProgress = false;
+
+}