//
// 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 Base class for all Call forms
*/
#include "CallActiveCallForm.h"
+#include "CallIncomingCallForm.h"
#include "CallBaseForm.h"
#include "CallInfo.h"
#include "CallPresentationModel.h"
/////////////////////////////////////////////////////////////////
void
-BaseForm::HandleCallConnected(IListT<CallInfo>& pCallList)
+BaseForm::HandleCallConnected(IListT<AppCallInfo>& pCallList)
{
+ if(__pCallPresentor->IsIncomingorDialingCallPresent() == true)
+ {
+ //This scenario will come, if 1 call is disconnected from conf. call having 2 participants.
+ //In this case, if there is any dialing call exists, then ignore.
+ //Else, if there is any incoming call exists, then update call option popup.
+ switch (__formType)
+ {
+ case FORMTYPE_INCOMINGCALL:
+ {
+ IncomingCallForm* pIncomingCallForm = dynamic_cast<IncomingCallForm*>(this);
+ if (pIncomingCallForm != null)
+ {
+ pIncomingCallForm->CallDisconnected();
+ }
+ }
+ break;
+
+ default:
+ break;
+ }
+ return;
+ }
+
SceneManager* pSceneManager = SceneManager::GetInstance();
switch (__formType)
for (int index = 0; index < noOfCalls; index++)
{
//fetch call info and add to list
- CallInfo callInfo;
+ AppCallInfo callInfo;
result r = pCallList.GetAt(index, callInfo);
if (r == E_SUCCESS)
{
//copy call information to new instance
- CallInfo* pCaller = new (std::nothrow) CallInfo();
+ AppCallInfo* pCaller = new (std::nothrow) AppCallInfo();
*pCaller = callInfo;
pCallInfoList->Add(pCaller);
}
if (noOfCalls == 1)
{
//Check if active call is conference call
- CallInfo* pActiveCallInfo = static_cast<CallInfo*>(pCallInfoList->GetAt(0));
+ AppCallInfo* pActiveCallInfo = static_cast<AppCallInfo*>(pCallInfoList->GetAt(0));
if(pActiveCallInfo->IsConferenceCall() == true)
{
//single Conference call - goto active Conf. call form
- pSceneManager->GoForward(ForwardSceneTransition(IDSCN_SCENE_CONFCALL), pCallInfoList);
+ pSceneManager->GoForward(ForwardSceneTransition(IDSCN_SCENE_CONFCALL,
+ SCENE_TRANSITION_ANIMATION_TYPE_NONE, SCENE_HISTORY_OPTION_NO_HISTORY,SCENE_DESTROY_OPTION_KEEP), pCallInfoList);
}
else
{
//single active call - goto active call form
- pSceneManager->GoForward(ForwardSceneTransition(IDSCN_SCENE_ACTIVECALL), pCallInfoList);
+ pSceneManager->GoForward(ForwardSceneTransition(IDSCN_SCENE_ACTIVECALL,
+ SCENE_TRANSITION_ANIMATION_TYPE_NONE, SCENE_HISTORY_OPTION_NO_HISTORY,SCENE_DESTROY_OPTION_KEEP), pCallInfoList);
}
}
else if(noOfCalls == 2)
{
//goto multiple active call form
- pSceneManager->GoForward(ForwardSceneTransition(IDSCN_SCENE_MULTIPLEACTIVECALL), pCallInfoList);
+ pSceneManager->GoForward(ForwardSceneTransition(IDSCN_SCENE_MULTIPLEACTIVECALL,
+ SCENE_TRANSITION_ANIMATION_TYPE_NONE, SCENE_HISTORY_OPTION_NO_HISTORY,SCENE_DESTROY_OPTION_KEEP), pCallInfoList);
}
}
break;
pCallInfoList->Construct(1);
//fetch call info and add to list
- CallInfo callInfo;
+ AppCallInfo callInfo;
result r = pCallList.GetAt(0, callInfo);
if (r == E_SUCCESS)
{
//copy call information to new instance
- CallInfo* pCaller = new (std::nothrow) CallInfo();
+ AppCallInfo* pCaller = new (std::nothrow) AppCallInfo();
*pCaller = callInfo;
pCallInfoList->Add(pCaller);
//single active call - goto active call form
- pSceneManager->GoForward(ForwardSceneTransition(IDSCN_SCENE_ACTIVE_EMERGENCYCALL), pCallInfoList);
+ pSceneManager->GoForward(ForwardSceneTransition(IDSCN_SCENE_ACTIVE_EMERGENCYCALL,
+ SCENE_TRANSITION_ANIMATION_TYPE_NONE, SCENE_HISTORY_OPTION_NO_HISTORY,SCENE_DESTROY_OPTION_KEEP), pCallInfoList);
}
}
break;
}
void
-BaseForm::HandleCallDisconnected(bool isLastCall, IListT<CallInfo>& pCallList)
+BaseForm::HandleCallDisconnected(bool isLastCall, IListT<AppCallInfo>& pCurrentActiveCallList)
{
+ AppLogDebug("Enter");
+ if(__pCallPresentor->IsIncomingorDialingCallPresent() == true)
+ {
+ //This scenario will come, if this disconnected call is neither incoming nor dialing call.
+ //In this case, if there is any dialing call exists, then ignore.
+ //Else, if there is any incoming call exists, then update call option popup.
+ AppLogDebug("IsIncomingorDialingCallPresent %d",__formType);
+ switch (__formType)
+ {
+ case FORMTYPE_INCOMINGCALL:
+ {
+ IncomingCallForm* pIncomingCallForm = dynamic_cast<IncomingCallForm*>(this);
+ if (pIncomingCallForm != null)
+ {
+ pIncomingCallForm->CallDisconnected();
+ }
+ }
+ break;
+
+ default:
+ break;
+ }
+ return;
+ }
+
SceneManager* pSceneManager = SceneManager::GetInstance();
CallApp* pPhoneApp = static_cast<CallApp*>(UiApp::GetInstance());
- int callCount = pCallList.GetCount();
+ int callCount = pCurrentActiveCallList.GetCount();
if (callCount > 0)
{
//Ownership - To be deleted in 'OnSceneActivatedN' of next form
for (int index = 0; index < callCount; index++)
{
//fetch call info and add to list
- CallInfo callInfo;
- result r = pCallList.GetAt(index, callInfo);
+ AppCallInfo callInfo;
+ result r = pCurrentActiveCallList.GetAt(index, callInfo);
if (r == E_SUCCESS)
{
//copy call information to new instance
- CallInfo* pCaller = new (std::nothrow) CallInfo();
+ AppCallInfo* pCaller = new (std::nothrow) AppCallInfo();
*pCaller = callInfo;
pCallInfoList->Add(pCaller);
}
}
+
if (callCount == 1)
{
//fetch call info and add to list
- CallInfo callInfo;
- result r = pCallList.GetAt(0, callInfo);
+ AppCallInfo callInfo;
+ result r = pCurrentActiveCallList.GetAt(0, callInfo);
if (r == E_SUCCESS)
{
//copy call information to new instance
- CallInfo* pCaller = new (std::nothrow) CallInfo();
+ AppCallInfo* pCaller = new (std::nothrow) AppCallInfo();
*pCaller = callInfo;
pCallInfoList->Add(pCaller);
}
if (isLastCall == true)
{
- //goto End Call form if single call. else terminate
- if (callInfo.IsConferenceCall() == false)
+ //list contains 1 last ended call to show EndCall screen.
+ //goto End Call form if single call was ended else terminate
+ // if (callInfo.IsConferenceCall() == false)
+ if (1)
{
- pSceneManager->GoForward(ForwardSceneTransition(IDSCN_SCENE_ENDCALL), pCallInfoList);
+ pSceneManager->GoForward(ForwardSceneTransition(IDSCN_SCENE_ENDCALL,
+ SCENE_TRANSITION_ANIMATION_TYPE_NONE, SCENE_HISTORY_OPTION_NO_HISTORY,SCENE_DESTROY_OPTION_KEEP), pCallInfoList);
}
else
{
}
else
{
- if (pCallList.GetCount() == 1)
+ //list contains 1 active call
+ if (pCurrentActiveCallList.GetCount() == 1)
{
if (callInfo.IsConferenceCall() == true)
{
- pSceneManager->GoForward(ForwardSceneTransition(IDSCN_SCENE_CONFCALL), pCallInfoList);
+ pSceneManager->GoForward(ForwardSceneTransition(IDSCN_SCENE_CONFCALL,
+ SCENE_TRANSITION_ANIMATION_TYPE_NONE, SCENE_HISTORY_OPTION_NO_HISTORY,SCENE_DESTROY_OPTION_KEEP), pCallInfoList);
}
else
{
//goto Single Active Call form
- pSceneManager->GoForward(ForwardSceneTransition(IDSCN_SCENE_ACTIVECALL), pCallInfoList);
+ pSceneManager->GoForward(ForwardSceneTransition(IDSCN_SCENE_ACTIVECALL,
+ SCENE_TRANSITION_ANIMATION_TYPE_NONE, SCENE_HISTORY_OPTION_NO_HISTORY,SCENE_DESTROY_OPTION_KEEP), pCallInfoList);
}
}
}
}
else
{
- pSceneManager->GoForward(ForwardSceneTransition(IDSCN_SCENE_MULTIPLEACTIVECALL), pCallInfoList);
+ //multiple active calls are present.
+ pSceneManager->GoForward(ForwardSceneTransition(IDSCN_SCENE_MULTIPLEACTIVECALL,
+ SCENE_TRANSITION_ANIMATION_TYPE_NONE, SCENE_HISTORY_OPTION_NO_HISTORY,SCENE_DESTROY_OPTION_KEEP), pCallInfoList);
}
}
else
{
- pPhoneApp->Terminate();
+ //This is done to show end call form in missed call case also
+ //this was done on request received from HQ to solve a bug in
+ //camera application. In which if a call comes when camera is
+ //running and user disconnects before the ui is shown the camera
+ //application hangs
+ ArrayList* pCallInfoList = new (std::nothrow) ArrayList(SingleObjectDeleter);
+ pCallInfoList->Construct(1);
+ AppCallInfo callInfo;
+ result r = pCurrentActiveCallList.GetAt(0, callInfo);
+ if (r == E_SUCCESS)
+ {
+ //copy call information to new instance
+ AppCallInfo* pCaller = new (std::nothrow) AppCallInfo();
+ *pCaller = callInfo;
+ pCallInfoList->Add(pCaller);
+ //multiple active calls are present.
+ pSceneManager->GoForward(ForwardSceneTransition(IDSCN_SCENE_ENDCALL,
+ SCENE_TRANSITION_ANIMATION_TYPE_NONE, SCENE_HISTORY_OPTION_NO_HISTORY,SCENE_DESTROY_OPTION_KEEP), pCallInfoList);
+
+ }
+ else
+ {
+ pPhoneApp->Terminate();
+ }
+
}
}
void
-BaseForm::HandleConferenceCall(CallInfo& pCallInfo)
+BaseForm::HandleConferenceCall(AppCallInfo& pCallInfo)
{
SceneManager* pSceneManager = SceneManager::GetInstance();
pCallInfoList->Construct(1);
//update list to be passed
- CallInfo* pConfInfo = new (std::nothrow) CallInfo();
+ AppCallInfo* pConfInfo = new (std::nothrow) AppCallInfo();
*pConfInfo = pCallInfo;
pCallInfoList->Add(pConfInfo);
//Todo: create screens for single conf call and conf call with another held call
- pSceneManager->GoForward(ForwardSceneTransition(IDSCN_SCENE_CONFCALL), pCallInfoList);
+ pSceneManager->GoForward(ForwardSceneTransition(IDSCN_SCENE_CONFCALL,
+ SCENE_TRANSITION_ANIMATION_TYPE_NONE, SCENE_HISTORY_OPTION_NO_HISTORY,SCENE_DESTROY_OPTION_KEEP), pCallInfoList);
}
void
-BaseForm::HandleIncomingCall(CallInfo& pCallInfo)
+BaseForm::HandleIncomingCall(AppCallInfo& pCallInfo)
{
SceneManager* pSceneManager = SceneManager::GetInstance();
pCallInfoList->Construct(1);
//update list to be passed
- CallInfo* pIncomingCall = new (std::nothrow) CallInfo();
+ AppCallInfo* pIncomingCall = new (std::nothrow) AppCallInfo();
*pIncomingCall = pCallInfo;
pCallInfoList->Add(pIncomingCall);
- pSceneManager->GoForward(ForwardSceneTransition(IDSCN_SCENE_INCOMINGCALL), pCallInfoList);
+ pSceneManager->GoForward(ForwardSceneTransition(IDSCN_SCENE_INCOMINGCALL,
+ SCENE_TRANSITION_ANIMATION_TYPE_NONE, SCENE_HISTORY_OPTION_NO_HISTORY,SCENE_DESTROY_OPTION_KEEP), pCallInfoList);
}
void
-BaseForm::HandleCallSwapOccured(IListT<CallInfo>& pCallList)
+BaseForm::HandleCallSwapOccured(IListT<AppCallInfo>& pCallList)
{
int noOfCalls = pCallList.GetCount();
if(noOfCalls != IDI_MAX_ACTIVE_CALLS && __formType != FORMTYPE_MULTIPLECALLS)
{
//update calls state
pActiveCallForm->UpdateMultipleCallScreen(pCallList);
+ pActiveCallForm->SetSwapInProgress(false);
+
}
}
void
BaseForm::HandleConferenceChange(void)
{
+ if(__pCallPresentor->IsIncomingorDialingCallPresent() == true)
+ {
+ //This scenario will come, if 1 call is disconnected from conf. call having more than 2 participants.
+ //In this case, if there is any dialing call exists, then ignore.
+ //Else, if there is any incoming call exists, then update call option popup.
+ switch (__formType)
+ {
+ case FORMTYPE_INCOMINGCALL:
+ {
+ IncomingCallForm* pIncomingCallForm = dynamic_cast<IncomingCallForm*>(this);
+ if (pIncomingCallForm != null)
+ {
+ pIncomingCallForm->CallDisconnected();
+ }
+ }
+ break;
+
+ default:
+ break;
+ }
+ return;
+ }
+
switch (__formType)
{
case FORMTYPE_CONFCALLLIST:
if (__pErrorMsgPopup == null)
{
__pErrorMsgPopup = new (std::nothrow) ErrorMsgPopup(this);
+ __pErrorMsgPopup->ShowErrorMsgPopupN(errorCode);
}
- __pErrorMsgPopup->ShowErrorMsgPopupN(errorCode);
}
void
if(pPresentor->GetCurrentCallCount() > 0)
{
//fetch current call list
- IListT<CallInfo>* pCurrentCallList = pPresentor->GetCallListN();
+ IListT<AppCallInfo>* pCurrentCallList = pPresentor->GetCallListN();
HandleCallDisconnected(false,*pCurrentCallList);
delete pCurrentCallList;
pCurrentCallList = null;