//
// 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
//
* @brief Incoming Call form implementation
*/
#include <FBaseColIList.h>
-#include <FMessaging.h>
#include "CallIncomingCallForm.h"
#include "CallAppUtility.h"
#include "CallSettingsManager.h"
using namespace Tizen::Base;
using namespace Tizen::Base::Collection;
using namespace Tizen::Graphics;
-using namespace Tizen::Messaging;
using namespace Tizen::Ui;
using namespace Tizen::Ui::Animations;
using namespace Tizen::Ui::Controls;
const wchar_t* IDI_REJECT_FINAL_VISUAL_ELE_NAME = L"RejectFinalVisEle";
const wchar_t* IDI_ACCEPT_FINAL_VISUAL_ELE_NAME = L"AcceptFinalVisEle";
-class SmsListener
- : public Object
- , public ISmsListener
-{
-public:
- void OnSmsMessageSent(result r)
- {
- }
-};
-
IncomingCallForm::IncomingCallForm(void)
: BaseForm(FORMTYPE_INCOMINGCALL)
{
}
HideRejectPanel();
- //Get Reject list from Settings Manager
- IMapT<int,String>* pMsgMap = SettingsManager::GetInstance()->GetRejectMessageListN();
- if(pMsgMap != null)
- {
- __pRejectMessageList = pMsgMap->GetValuesN();
- delete pMsgMap;
- pMsgMap = null;
- }
+
InitializeTableView();
__pAcceptCircle = AppUtility::GetBitmapFromResourcesN(IDB_ACCEPT_CIRCLE_ICON, W_DIAL_LABEL, H_DIAL_LABEL);
footerItemCreate.Construct(IDA_CREATE_REJECT_CALL_MESSAGE);
footerItemCreate.SetText(AppUtility::GetResourceString(IDS_REJECT_MESSAGE_CREATE));
pFooter->AddItem(footerItemCreate);
- pFooter->SetBackButton();
pFooter->SetShowState(false);
}
}
pButtonReject->SetActionId(IDA_CANCEL_REJECT_CALL_MESSAGE_PANEL);
pButtonReject->AddActionEventListener(*this);
pButtonReject->SetEnabled(true);
- pButtonReject->SetFocus();
+ //pButtonReject->SetFocus();
ShowRejectMessageFooter();
case IDA_SEND_REJECT_MSG6:
{
__pCallPresentor->RejectCall(__incomingCallHandle, false,*__pActiveContactNo);
- SmsListener* pSmsListener = new (std::nothrow) SmsListener();
- SmsManager* pSmsManager = new (std::nothrow) SmsManager();
- result r = pSmsManager->Construct(*pSmsListener);
- if (IsFailed(r) == false)
- {
- RecipientList recipient;
- recipient.Add(RECIPIENT_TYPE_TO,*__pActiveContactNo);
- SmsMessage smsMessage;
- String textToBeSent;
- //calculate msgIndex
- int msgIndex = IDA_SEND_REJECT_MSG1;
- msgIndex = actionId - msgIndex;
- __pRejectMessageList->GetAt(msgIndex, textToBeSent);
- r = smsMessage.SetText(textToBeSent);
- if (IsFailed(r) == false)
- {
- r = pSmsManager->Send(smsMessage,recipient,true);
- if (IsFailed(r) == true)
- {
- //todo: error message
- }
- }
- else
- {
- //todo: error message
- }
- }
- else
- {
- //todo: error message
- }
- delete pSmsListener;
- delete pSmsManager;
- /*ArrayListT<CallInfo>* pCallList = static_cast<ArrayListT<CallInfo>*>(__pCallPresentor->GetCallListN());
- __pCallPresentor->HandleCallConnected(*pCallList);
- pCallList = null;*/
+ String textToBeSent;
+ //calculate msgIndex
+ int msgIndex = IDA_SEND_REJECT_MSG1;
+ msgIndex = actionId - msgIndex;
+ __pRejectMessageList->GetAt(msgIndex, textToBeSent);
+ __pCallPresentor->SendMessage(textToBeSent,*__pActiveContactNo);
}
break;
IncomingCallForm::OnSceneActivatedN(const SceneId& previousSceneId, const SceneId& currentSceneId, IList* pArgs)
{
AddOrientationEventListener(*this);
+ //Get Reject list from Settings Manager
+ IMapT<int,String>* pMsgMap = SettingsManager::GetInstance()->GetRejectMessageListN();
+ if(pMsgMap != null)
+ {
+ if (__pRejectMessageList != null)
+ {
+ delete __pRejectMessageList;
+ __pRejectMessageList = null;
+ }
+ __pRejectMessageList = pMsgMap->GetValuesN();
+ delete pMsgMap;
+ pMsgMap = null;
+ }
+ //No reject messages
+ else
+ {
+ if (__pRejectMessageList != null)
+ {
+ delete __pRejectMessageList;
+ __pRejectMessageList = null;
+ }
+ }
//listen to Foreground events
CallApp* pPhoneApp = static_cast<CallApp*>(CallApp::GetInstance());
pPhoneApp->AddAppStateChangeListener(*this);
__pCallPresentor = CallPresentationModel::GetInstance();
}
__pCallPresentor->SetTelEventListener(this);
+ //Abort any AppControl Request running already to show incoming call screen
+ if (__pCallPresentor->IsAppControlRunning() == true)
+ {
+ __pCallPresentor->AbortAppControlRequest();
+ }
+
HideRejectPanel();
if(__pAcceptLabel->GetVisualElement()->GetChild(IDI_ACCEPT_VISUAL_ELE_NAME,true) == null)
pButtonRejectMessage->AddActionEventListener(*this);
}
+ //This called here to handle the case when incoming call comes when
+ // add call is in foreground.
+ //__pCallPresentor->OnAppForeground();
+
}
void
}
CallApp* pCallApp = static_cast<CallApp*>(CallApp::GetInstance());
- pCallApp->SetTopMostWindow(false);
pCallApp->RemoveAppStateChangeListener(*this);
}
pMsgLbl->SetTextVerticalAlignment(ALIGNMENT_MIDDLE);
pMsgLbl->SetTextConfig(FONT_SIZE_MSG_TXT, LABEL_TEXT_STYLE_NORMAL);
pMsgLbl->SetTextColor(COLOR_LIST_TEXT_NORMAL);
- pItem->AddControl(*pMsgLbl);
+ pItem->AddControl(pMsgLbl);
//Send Button
if(isShowSendButton == true)
SetTextToLabel(phoneNumber, contactLblName);
//fetch contact details based on phone number
- String* pDisplayName = pCallInfo->FetchCallerNameN();
- Bitmap* pPhotoBitmap = pCallInfo->FetchCallerPhotoN();
+ String* pDisplayName = pCallInfo->FetchLatestCallerNameN(phoneNumber);
+ Bitmap* pPhotoBitmap = pCallInfo->FetchLatestCallerPhotoN(phoneNumber);
ShowCallerPhoto(pPhotoBitmap);
//free resources
void
IncomingCallForm::OnTouchPressed(const Control& source, const Point& currentPosition, const TouchEventInfo& touchInfo)
{
- __pCallPresentor->StopAlert();
+ //__pCallPresentor->StopAlert();
if (currentPosition.x < VALID_TOUCH_X_OFFSET && currentPosition.y < VALID_TOUCH_Y_OFFSET)
{
Rectangle rect = source.GetBounds();
void
IncomingCallForm::OnForeground(void)
{
- __pCallPresentor->OnAppForeground();
+ AppLogDebug("Enter");
+// __pCallPresentor->OnAppForeground();
}
void