//
// Copyright (c) 2012 Samsung Electronics Co., Ltd.
//
-// Licensed under the Flora License, Version 1.0 (the License);
+// Licensed under the Flora License, Version 1.1 (the License);
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
using namespace Tizen::Ui::Scenes;
using namespace Tizen::Telephony;
using namespace Tizen::Base::Utility;
+using namespace Tizen::Messaging;
CallPresentationModel* CallPresentationModel::__pInstance = null;
__pNetworkManager = null;
__psimStateManager = null;
__psimInfo = null;
+ __pSmsManager = null;
+ __isMessageSendInProgress = false;
}
CallPresentationModel::~CallPresentationModel(void)
delete __psimInfo;
__psimInfo = null;
}
+ if(__pSmsManager != null)
+ {
+ delete __pSmsManager;
+ __pSmsManager = null;
+ }
}
void
void CallPresentationModel::OnAppForeground(void)
{
+ AppLogDebug("Enter %d %d",__isDialAppControlRunning ,__isMessageAppControlRunning);
if (__isDialAppControlRunning == true)
{
//This comes here, when Dialer AppControl is finished working.
__pAppControlMgr->AppControlRequestCompleted();
//Check if this was the last call, then terminate application.
//And if any calls are active, then those cases are already handled from Other places.
- if( GetCurrentCallCount() == 0)
+ if( GetCurrentCallCount() == 0 && IsIncomingorDialingCallPresent() == false)
{
- CallApp* pPhoneApp = static_cast<CallApp*>(UiApp::GetInstance());
- pPhoneApp->Terminate();
+ CallApp* pCallApp = static_cast<CallApp*>(UiApp::GetInstance());
+ pCallApp->Terminate();
}
}
}
if(__isDialAppControlRunning == true)
{
+ AppLogDebug("__isDialAppControlRunning == true");
//Do not allow another app control if already running
return;
}
}
+void
+CallPresentationModel::SendMessage(String& strMsg,String& recpientNum)
+{
+ AppLogDebug("Enter");
+ if(__pSmsManager == null)
+ {
+ __pSmsManager = new (std::nothrow) SmsManager();
+ }
+ result r = __pSmsManager->Construct(*this);
+ if (IsFailed(r) == false)
+ {
+ 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) == true)
+ {
+ //todo: error message
+ }
+ else
+ {
+ __isMessageSendInProgress = true;
+ }
+ }
+ else
+ {
+ //todo: error message
+ }
+ }
+ else
+ {
+ //todo: error message
+ }
+
+}
+
+bool
+CallPresentationModel::IsMessageSendingInProgress(void)
+{
+ AppLogDebug("Enter %d",__isMessageSendInProgress);
+ return __isMessageSendInProgress;
+}
+
+void
+CallPresentationModel::OnSmsMessageSent(result r)
+{
+ AppLogDebug("Enter");
+ __isMessageSendInProgress = false;
+
+}