Fix for N_SE-51371
[apps/osp/Call.git] / src / CallActiveCallForm.cpp
index b00089d..4b9bae6 100644 (file)
@@ -1,7 +1,7 @@
 //
 // 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
 //
@@ -65,7 +65,7 @@ const int W_POPUP_ANCHOR = 72;
 const int H_POPUP_ANCHOR = 22;
 const int IDI_OPTIONMENU_ITEM_SPACING = 16;
 const Point IDI_OPTIONMENU_POS(238, 162);
-const Dimension IDI_OPTIONMENU_DIMEN(466, 99);
+const Dimension IDI_OPTIONMENU_DIMEN(486, 99);
 const int X_PHOTO_LBL = 166;
 const int Y_PHOTO_LBL = 232;
 const int W_PHOTO_LBL = 388;
@@ -97,6 +97,7 @@ static const wchar_t* IDC_CALLER1_BIGPHOTO_LABEL = L"IDC_CALLER1_BIGPHOTO_LABEL"
 static const wchar_t* IDC_CALLER2_PHOTO_LABEL = L"IDC_CALLER2_PHOTO_LABEL";
 static const wchar_t* IDC_CALLER1_PHOTO_LABEL = L"IDC_CALLER1_PHOTO_LABEL";
 static const wchar_t* IDC_KEY_BG_LABEL = L"IDC_KEY_BG_LABEL";
+static const wchar_t* IDC_DTMF_KEY_BG_LABEL = L"IDC_DTMF_KEY_BG_LABEL";
 
 ActiveCallForm::ActiveCallForm(FormType formType)
        : BaseForm(formType)
@@ -109,6 +110,8 @@ ActiveCallForm::ActiveCallForm(FormType formType)
        __pSmallPhotoLabel = null;
        __pActiveCallInfo = null;
        __pHeldCallInfo = null;
+       __isSwapInProgress = false;
+       __pAddressbook = null;
 }
 
 ActiveCallForm::~ActiveCallForm(void)
@@ -189,7 +192,6 @@ ActiveCallForm::OnInitializing(void)
        InitializeSwapButton();
        //Initialize manage conf. call list form
        InitializeManageConfCallButton();
-
        __pCallPresentor = CallPresentationModel::GetInstance();
        return r;
 }
@@ -197,42 +199,11 @@ ActiveCallForm::OnInitializing(void)
 void
 ActiveCallForm::ShowDTMFKeypad(void)
 {
-       if(__pDTMFKeypad == null)
-       {
-               //update rect according to client screen area
-               Rectangle rect(0, 0, 0, 0);
-               if (GetOrientationStatus() == ORIENTATION_STATUS_PORTRAIT || GetOrientationStatus() == ORIENTATION_STATUS_PORTRAIT_REVERSE)
-               {
-                       rect.width = GetClientAreaBounds().width;
-                       rect.height = GetClientAreaBounds().height - __pCallButtonsPanel->GetHeight();
-               }
-               else if (GetOrientationStatus() == ORIENTATION_STATUS_LANDSCAPE || GetOrientationStatus() == ORIENTATION_STATUS_LANDSCAPE_REVERSE)
-               {
-                       rect.height = GetClientAreaBounds().height;
-                       rect.width = GetClientAreaBounds().width - __pCallButtonsPanel->GetWidth();
-               }
-
-               AppLog("DTMF Keypad rect(%d,%d,%d,%d)",rect.x,rect.y,rect.width,rect.height);
-               __pDTMFKeypad = new (std::nothrow) DtmfKeyPadPanel();
-               __pDTMFKeypad->Initialize(this, rect);
-               AddControl(*__pDTMFKeypad);
-
-               //set layout relation w.r.t call buttons panel
-               RelativeLayout* pRelativeLayout = dynamic_cast<RelativeLayout*>(GetLandscapeLayoutN());
-               if (pRelativeLayout != null)
-               {
-                       pRelativeLayout->SetRelation(*__pDTMFKeypad, this, RECT_EDGE_RELATION_LEFT_TO_LEFT);
-                       pRelativeLayout->SetRelation(*__pDTMFKeypad, __pCallButtonsPanel, RECT_EDGE_RELATION_RIGHT_TO_LEFT);
-               }
-       }
+       EditField* pTextBox = static_cast<EditField*>(__pDTMFKeypad->GetControl(IDC_TEXTBOX));
        __pDTMFKeypad->SetShowState(true);
-       if(__DtmfString.IsEmpty() == false)
-       {
-               EditField* pTextBox = static_cast<EditField*>(__pDTMFKeypad->GetControl(IDC_TEXTBOX));
-               pTextBox->SetText(__DtmfString);
-       }
        __pDTMFKeypad->Draw(true);
        __pDTMFKeypad->Show();
+       pTextBox->SetFocus();
 }
 
 void
@@ -263,24 +234,60 @@ ActiveCallForm::OnOrientationChanged(const Tizen::Ui::Control& source, Tizen::Ui
                }
 
                //change orientation of DTMF Keypad, if it is visible.
-               if (__pDTMFKeypad != null)
+               if(__pDTMFKeypad != null)
+               {
+                       Rectangle rect(0, 0, 0, 0);
+                       if (orientationStatus == ORIENTATION_STATUS_LANDSCAPE || orientationStatus == ORIENTATION_STATUS_LANDSCAPE_REVERSE)
+                       {
+                               rect.height = GetClientAreaBounds().height;
+                               rect.width = GetClientAreaBounds().width - __pCallButtonsPanel->GetWidth();
+                       }
+                       else if (orientationStatus == ORIENTATION_STATUS_PORTRAIT || orientationStatus == ORIENTATION_STATUS_PORTRAIT_REVERSE)
+                       {
+                               rect.width = GetClientAreaBounds().width;
+                               rect.height = GetClientAreaBounds().height - __pCallButtonsPanel->GetHeight();
+                       }
+                       __pDTMFKeypad->SetBounds(rect);
+                       RelativeLayout* pRelativeLayout = dynamic_cast<RelativeLayout*>(GetLandscapeLayoutN());
+                       if (pRelativeLayout != null)
+                       {
+                               pRelativeLayout->SetRelation(*__pDTMFKeypad, this, RECT_EDGE_RELATION_LEFT_TO_LEFT);
+                               pRelativeLayout->SetRelation(*__pDTMFKeypad, __pCallButtonsPanel, RECT_EDGE_RELATION_RIGHT_TO_LEFT);
+                               pRelativeLayout->Update();
+                               delete pRelativeLayout;
+                       }
+                       pRelativeLayout = dynamic_cast<RelativeLayout*>(GetPortraitLayoutN());
+                       if (pRelativeLayout != null)
+                       {
+                               pRelativeLayout->SetRelation(*__pDTMFKeypad, this, RECT_EDGE_RELATION_LEFT_TO_LEFT);
+                               pRelativeLayout->SetRelation(*__pDTMFKeypad, __pCallButtonsPanel, RECT_EDGE_RELATION_BOTTOM_TO_TOP);
+                               pRelativeLayout->Update();
+                               delete pRelativeLayout;
+                       }
+                       __pDTMFKeypad->setKeysPanelBounds();
+                       __pDTMFKeypad->InvalidateBounds(rect);
+                       __pDTMFKeypad->Invalidate(true);
+
+                       //HideDTMFKeypad();
+                       //ShowDTMFKeypad();
+               }
+
+               //change orientation of DTMF Keypad, if it is visible.
+               if (__pDTMFKeypad != null && __pDTMFKeypad->GetShowState() == true)
                {
                        if (orientationStatus == ORIENTATION_STATUS_LANDSCAPE || orientationStatus == ORIENTATION_STATUS_LANDSCAPE_REVERSE)
                        {
                                //in landscape mode, caller info is visible.
                                SetShowStateOnKeypad(true);
+                               //Hide few labels and buttons in landscape mode when DTMF keypad is shown
+                               SetShowStateOnKeypadLandscape(false);
                                SetHoldButtonShowState(false);
                        }
                        else if (orientationStatus == ORIENTATION_STATUS_PORTRAIT || orientationStatus == ORIENTATION_STATUS_PORTRAIT_REVERSE)
                        {
                                //in Portrait mode it is hidden beneath DTMF Keypad.
                                SetShowStateOnKeypad(false);
-                       }
-                       if(__pDTMFKeypad->GetShowState() == true)
-                       {
-                               String dtmfText = static_cast<EditField*>(__pDTMFKeypad->GetControl(IDC_TEXTBOX))->GetText();
-                               HideDTMFKeypad();
-                               ShowDTMFKeypad();
+                               DestroyMoreOptionsMenuList();
                        }
                }
        }
@@ -298,9 +305,7 @@ ActiveCallForm::HideDTMFKeypad(void)
        if(__pDTMFKeypad != null)
        {
                __DtmfString = static_cast<EditField*>(__pDTMFKeypad->GetControl(IDC_TEXTBOX))->GetText();
-
-               RemoveControl(*__pDTMFKeypad);
-               __pDTMFKeypad = null;
+               __pDTMFKeypad->SetShowState(false);
        }
 }
 
@@ -321,7 +326,7 @@ ActiveCallForm::InitializeCallButtonsPanel(void)
                __pCallButtonsPanel = new (std::nothrow) CallButtonsPanel();
                __pCallButtonsPanel->ConstructPanel(this, __formType);
                __pCallButtonsPanel->SetBounds(pKeysBgLbl->GetBounds());
-               r = AddControl(*__pCallButtonsPanel);
+               r = AddControl(__pCallButtonsPanel);
        }
 
        RelativeLayout* pRelativeLayout = dynamic_cast<RelativeLayout*>(GetPortraitLayoutN());
@@ -453,6 +458,7 @@ ActiveCallForm::SetHoldButtonStatus(bool toHoldCall)
                pHoldBtn->SetActionId(cmdId);
                pHoldBtn->SetNormalBitmap(Point(0, 0),*normalImg);
                pHoldBtn->SetPressedBitmap(Point(0, 0),*pressImg);
+               pHoldBtn->Invalidate(true);
        }
        if (pHoldLbl)
        {
@@ -483,7 +489,7 @@ ActiveCallForm::CreateMoreOptionsMenuList(void)
                pBgPopupArwBmp = null;
 
                // Adds a Label to the Form
-               AddControl(*__pMoreOptionsListAnchor);
+               AddControl(__pMoreOptionsListAnchor);
        }
 
        //create options menu list
@@ -494,7 +500,7 @@ ActiveCallForm::CreateMoreOptionsMenuList(void)
                __pMoreOptionsList->SetItemProvider(*this);
                __pMoreOptionsList->AddListViewItemEventListener(*this);
                //Add option list to the form
-               AddControl(*__pMoreOptionsList);
+               AddControl(__pMoreOptionsList);
        }
        else
        {
@@ -509,14 +515,14 @@ ActiveCallForm::DestroyMoreOptionsMenuList(void)
        if (__pMoreOptionsListAnchor != null)
        {
                //removes and delete the child control
-               RemoveControl(*__pMoreOptionsListAnchor);
+               RemoveControl(__pMoreOptionsListAnchor);
                __pMoreOptionsListAnchor = null;
        }
 
        if (__pMoreOptionsList != null)
        {
                //removes and delete the child control
-               RemoveControl(*__pMoreOptionsList);
+               RemoveControl(__pMoreOptionsList);
                __pMoreOptionsList = null;
        }
 }
@@ -529,6 +535,10 @@ ActiveCallForm::OnTerminating(void)
        {
                __pCallPresentor = null;
        }
+       if(__pDTMFKeypad != null)
+       {
+               __pDTMFKeypad = null;
+       }
        return r;
 }
 
@@ -573,11 +583,55 @@ ActiveCallForm::OnActionPerformed(const Control& source, int actionId)
 
        case IDA_OPEN_NUMKEYPAD:
        {
+               if(__pDTMFKeypad != null)
+               {
+                       Rectangle rect(0, 0, 0, 0);
+                       if (GetOrientationStatus() == ORIENTATION_STATUS_LANDSCAPE || GetOrientationStatus() == ORIENTATION_STATUS_LANDSCAPE_REVERSE)
+                       {
+                               rect.height = GetClientAreaBounds().height;
+                               rect.width = GetClientAreaBounds().width - __pCallButtonsPanel->GetWidth();
+                       }
+                       else if (GetOrientationStatus() == ORIENTATION_STATUS_PORTRAIT || GetOrientationStatus() == ORIENTATION_STATUS_PORTRAIT_REVERSE)
+                       {
+                               rect.width = GetClientAreaBounds().width;
+                               rect.height = GetClientAreaBounds().height - __pCallButtonsPanel->GetHeight();
+                       }
+                       __pDTMFKeypad->SetBounds(rect);
+                       RelativeLayout* pRelativeLayout = dynamic_cast<RelativeLayout*>(GetLandscapeLayoutN());
+                       if (pRelativeLayout != null)
+                       {
+                               pRelativeLayout->SetRelation(*__pDTMFKeypad, this, RECT_EDGE_RELATION_LEFT_TO_LEFT);
+                               pRelativeLayout->SetRelation(*__pDTMFKeypad, __pCallButtonsPanel, RECT_EDGE_RELATION_RIGHT_TO_LEFT);
+                               pRelativeLayout->Update();
+                               delete pRelativeLayout;
+                       }
+                       pRelativeLayout = dynamic_cast<RelativeLayout*>(GetPortraitLayoutN());
+                       if (pRelativeLayout != null)
+                       {
+                               pRelativeLayout->SetRelation(*__pDTMFKeypad, this, RECT_EDGE_RELATION_LEFT_TO_LEFT);
+                               pRelativeLayout->SetRelation(*__pDTMFKeypad, __pCallButtonsPanel, RECT_EDGE_RELATION_BOTTOM_TO_TOP);
+                               pRelativeLayout->Update();
+                               delete pRelativeLayout;
+                       }
+                       __pDTMFKeypad->setKeysPanelBounds();
+                       __pDTMFKeypad->InvalidateBounds(rect);
+                       __pDTMFKeypad->Invalidate(true);
+
+               }
+
+
+
                if (GetOrientationStatus() == ORIENTATION_STATUS_PORTRAIT || GetOrientationStatus() == ORIENTATION_STATUS_PORTRAIT_REVERSE)
                {
                        //hide only in portrait mode.
                        SetShowStateOnKeypad(false);
+                       DestroyMoreOptionsMenuList();
+               }
+               if (GetOrientationStatus() == ORIENTATION_STATUS_LANDSCAPE || GetOrientationStatus() == ORIENTATION_STATUS_LANDSCAPE_REVERSE)
+               {
+                       SetShowStateOnKeypadLandscape(false);
                }
+
                //Hide the hold button as it goes behind DTMF keypad
                SetHoldButtonShowState(false);
                ShowDTMFKeypad();
@@ -587,7 +641,14 @@ ActiveCallForm::OnActionPerformed(const Control& source, int actionId)
 
        case IDA_CLOSE_NUMKEYPAD:
        {
-               SetShowStateOnKeypad(true);
+               if (GetOrientationStatus() == ORIENTATION_STATUS_PORTRAIT || GetOrientationStatus() == ORIENTATION_STATUS_PORTRAIT_REVERSE)
+               {
+                       SetShowStateOnKeypad(true);
+               }
+               if (GetOrientationStatus() == ORIENTATION_STATUS_LANDSCAPE || GetOrientationStatus() == ORIENTATION_STATUS_LANDSCAPE_REVERSE)
+               {
+                       SetShowStateOnKeypadLandscape(true);
+               }
                HideDTMFKeypad();
                __pCallButtonsPanel->SetKeypadButtonState(IDA_OPEN_NUMKEYPAD);
        }
@@ -729,8 +790,12 @@ ActiveCallForm::OnActionPerformed(const Control& source, int actionId)
 
        case IDA_SWAP_CALLS:
        {
-               AppAssert(__formType == FORMTYPE_MULTIPLECALLS);
-               __pCallPresentor->SwapCalls();
+               if(IsSwapInProgress() == false)
+               {
+                       AppAssert(__formType == FORMTYPE_MULTIPLECALLS);
+                       __pCallPresentor->SwapCalls();
+                       SetSwapInProgress(true);
+               }
        }
        break;
 
@@ -842,6 +907,18 @@ ActiveCallForm::OnActionPerformed(const Control& source, int actionId)
        }
 }
 
+bool
+ActiveCallForm::IsSwapInProgress(void)
+{
+       return __isSwapInProgress;
+}
+
+void
+ActiveCallForm::SetSwapInProgress(bool progress)
+{
+       __isSwapInProgress = progress;
+}
+
 void
 ActiveCallForm::SetTextToDTMFTextField(const String& dtmfStr)
 {
@@ -859,7 +936,7 @@ ActiveCallForm::SetTextToDTMFTextField(const String& dtmfStr)
 
                pTextBox->InsertTextAtCursorPosition(dtmfStr);
                //pTextBox->AppendText(dtmfStr);
-               pTextBox->SetFocus();
+       //      pTextBox->SetFocus();
                pTextBox->Invalidate(true);
        }
 }
@@ -878,6 +955,41 @@ ActiveCallForm::OnSceneActivatedN(const SceneId& previousSceneId, const SceneId&
        //Initialize keypad and buttons
        InitializeCallButtonsPanel();
 
+       if(__pDTMFKeypad == null)
+       {
+               Rectangle rect(0, 0, 0, 0);
+               if (GetOrientationStatus() == ORIENTATION_STATUS_PORTRAIT || GetOrientationStatus() == ORIENTATION_STATUS_PORTRAIT_REVERSE)
+               {
+                       rect.width = GetClientAreaBounds().width;
+                       rect.height = GetClientAreaBounds().height - __pCallButtonsPanel->GetHeight();
+               }
+               else if (GetOrientationStatus() == ORIENTATION_STATUS_LANDSCAPE || GetOrientationStatus() == ORIENTATION_STATUS_LANDSCAPE_REVERSE)
+               {
+                       rect.height = GetClientAreaBounds().height;
+                       rect.width = GetClientAreaBounds().width - __pCallButtonsPanel->GetWidth();
+               }
+
+               AppLog("DTMF Keypad rect(%d,%d,%d,%d)",rect.x,rect.y,rect.width,rect.height);
+               __pDTMFKeypad = new (std::nothrow) DtmfKeyPadPanel();
+               __pDTMFKeypad->Initialize(this, rect);
+               //set layout relation w.r.t call buttons panel
+               RelativeLayout* pRelativeLayout = dynamic_cast<RelativeLayout*>(GetLandscapeLayoutN());
+               if (pRelativeLayout != null)
+               {
+                       pRelativeLayout->SetRelation(*__pDTMFKeypad, this, RECT_EDGE_RELATION_LEFT_TO_LEFT);
+                       pRelativeLayout->SetRelation(*__pDTMFKeypad, __pCallButtonsPanel, RECT_EDGE_RELATION_RIGHT_TO_LEFT);
+               }
+               AddControl(__pDTMFKeypad);
+       }
+
+       AddressbookManager* pAddressbookManager = AddressbookManager::GetInstance();
+       __pAddressbook = pAddressbookManager->GetAddressbookN(DEFAULT_ADDRESSBOOK_ID);
+       if(__pAddressbook != null)
+       {
+               __pAddressbook->SetAddressbookChangeEventListener(this);
+       }
+
+
        if (__pActiveCallInfo != null)
        {
                delete __pActiveCallInfo;
@@ -939,9 +1051,9 @@ ActiveCallForm::OnSceneActivatedN(const SceneId& previousSceneId, const SceneId&
                        activeContactNo.Append(AppUtility::GetResourceString(IDS_NUMBER_UNKNOWN));
                }
                ShowPersonDetails(activeContactNo, IDC_NUMBER1_LABEL, IDC_CALLER1_LABEL, false,__pActiveCallInfo);
-
                //show call active time using Timer
-               __activeCallStartTime = pCall->GetCallConnectTime();
+               //__activeCallStartTime = pCall->GetCallConnectTime();
+               __activeCallStartTime = pCall->GetDurationTime();
                ShowTimerInfo(IDC_CALLER1_TIME_LABEL, pCall->IsOnHold(), __activeCallStartTime);
        }
        break;
@@ -955,7 +1067,8 @@ ActiveCallForm::OnSceneActivatedN(const SceneId& previousSceneId, const SceneId&
                *__pActiveCallInfo =  *pCall;
 
                //show call active time using Timer
-               __activeCallStartTime = pCall->GetCallConnectTime();
+               //__activeCallStartTime = pCall->GetCallConnectTime();
+               __activeCallStartTime = pCall->GetDurationTime();
                ShowTimerInfo(IDC_CALLER1_TIME_LABEL, pCall->IsOnHold(), __activeCallStartTime);
        }
        break;
@@ -999,8 +1112,14 @@ ActiveCallForm::OnSceneActivatedN(const SceneId& previousSceneId, const SceneId&
                        __pCallButtonsPanel->EnableAddCallButton(true);
                }
 
+
+               //bring button on top
+               __pCallButtonsPanel->SetButtonPosition();
+
+
                //show call active time using Timer
-               __activeCallStartTime = __pActiveCallInfo->GetCallConnectTime();
+               //__activeCallStartTime = __pActiveCallInfo->GetCallConnectTime();
+               __activeCallStartTime = __pActiveCallInfo->GetDurationTime();
                ShowTimerInfo(IDC_CALLER1_TIME_LABEL, __pActiveCallInfo->IsOnHold(),__activeCallStartTime);
        }
        break;
@@ -1023,6 +1142,7 @@ ActiveCallForm::OnSceneActivatedN(const SceneId& previousSceneId, const SceneId&
        //Hide DTMFKeypad, if visible and show caller info
        HideDTMFKeypad();
        SetShowStateOnKeypad(true);
+       SetShowStateOnKeypadLandscape(true);
        __pCallButtonsPanel->SetKeypadButtonState(IDA_OPEN_NUMKEYPAD);
 
        //Set the correct speaker status
@@ -1052,6 +1172,10 @@ ActiveCallForm::OnSceneActivatedN(const SceneId& previousSceneId, const SceneId&
                pArgs = null;
        }
 
+       //update position of call buttons panel
+       Label* pKeysBgLbl = static_cast<Label*>(GetControl(IDC_KEY_BG_LABEL, true));
+       __pCallButtonsPanel->SetBounds(pKeysBgLbl->GetBounds());
+
        CallApp* pCallApp = static_cast<CallApp*>(CallApp::GetInstance());
        pCallApp->SetTopMostWindow(false);
 }
@@ -1060,11 +1184,6 @@ void
 ActiveCallForm::OnSceneDeactivated(const SceneId& currentSceneId, const SceneId& nextSceneId)
 {
        RemoveOrientationEventListener(*this);
-       if (__pCallButtonsPanel != null)
-       {
-               RemoveControl(*__pCallButtonsPanel);
-               __pCallButtonsPanel = null;
-       }
        if (__pActiveCallTimer != null)
        {
                __pActiveCallTimer->Cancel();
@@ -1085,8 +1204,18 @@ ActiveCallForm::OnSceneDeactivated(const SceneId& currentSceneId, const SceneId&
                __pMoreOptionsList->SetShowState(false);
        }
        __DtmfString.Clear();
+
+       if(__pDTMFKeypad != null)
+       {
+               __pDTMFKeypad->SetShowState(false);
+       }
+
        CallApp* pCallApp = static_cast<CallApp*>(CallApp::GetInstance());
        pCallApp->RemoveAppStateChangeListener(*this);
+       if(__pAddressbook != null)
+       {
+               __pAddressbook->SetAddressbookChangeEventListener(null);
+       }
 }
 
 void
@@ -1160,6 +1289,113 @@ ActiveCallForm::HandleConfCallChanged(void)
 }
 
 void
+ActiveCallForm::OnContactsChanged(const Tizen::Base::Collection::IList& contactChangeInfoList)
+{
+       AppLog("Enter");
+       switch (__formType)
+       {
+
+       case FORMTYPE_OUTGOINGCALL:
+       case FORMTYPE_ACTIVECALL:
+       {
+               String pContactNumber;
+               pContactNumber.Append(__pActiveCallInfo->GetContactNumber());
+               Contact* pContact = __pCallPresentor->GetContactN(__pActiveCallInfo->GetContactNumber());
+               if(pContact == null)
+               {
+                       __pActiveCallInfo->ResetContactNumber(null);
+                       __pActiveCallInfo->ResetContactInfo(null);
+
+               }
+               else
+               {
+                       __pActiveCallInfo->SetContactNumber(pContactNumber);
+                       __pActiveCallInfo->SetContactInfo(*pContact);
+               }
+               if(pContact != null)
+               {
+                       delete pContact;
+                       pContact = null;
+               }
+               ShowPersonDetails(pContactNumber, IDC_NUMBER1_LABEL, IDC_CALLER1_LABEL, false,__pActiveCallInfo);
+       }
+       break;
+
+       case FORMTYPE_EMERGENCYACTIVECALL:
+       {
+       }
+       break;
+
+       case FORMTYPE_MULTIPLECALLS:
+       {
+
+               IListT<AppCallInfo>* pCallsList = __pCallPresentor->GetCallListN();
+               if(pCallsList != null)
+               {
+                       int listCount = pCallsList->GetCount();
+                       for(int index = 0; index < listCount; index++)
+                       {
+                               AppCallInfo callInfo;
+                               Contact* pContact;
+                               pCallsList->GetAt(index, callInfo);
+                               if(__pActiveCallInfo == null)
+                               {
+                                       __pActiveCallInfo = new (std::nothrow) AppCallInfo();
+                               }
+                               *__pActiveCallInfo =  callInfo;
+                               String contactNumber;
+                               contactNumber.Append(__pActiveCallInfo->GetContactNumber());
+                               pContact = __pCallPresentor->GetContactN(__pActiveCallInfo->GetContactNumber());
+                               if(pContact == null)
+                               {
+                                       __pActiveCallInfo->ResetContactNumber(null);
+                                       __pActiveCallInfo->ResetContactInfo(null);
+
+                               }
+                               else
+                               {
+                                       __pActiveCallInfo->SetContactNumber(contactNumber);
+                                       __pActiveCallInfo->SetContactInfo(*pContact);
+                               }
+                               if(pContact != null)
+                               {
+                                       delete pContact;
+                                       pContact = null;
+                               }
+                               if(callInfo.IsConferenceCall() == true)
+                               {
+                                       continue;
+                               }
+                               if(callInfo.IsOnHold() == false)
+                               {
+                                       ShowPersonDetails(contactNumber, IDC_NUMBER1_LABEL, IDC_CALLER1_LABEL, false,__pActiveCallInfo);
+                               }
+                               else
+                               {
+                                       ShowPersonDetails(contactNumber, IDC_NUMBER2_LABEL, IDC_CALLER2_LABEL, true,__pActiveCallInfo);
+                               }
+
+                       }
+
+                       delete pCallsList;
+                       pCallsList = null;
+               }
+       }
+       break;
+       default:
+               break;
+       }
+       AppLog("Exit");
+}
+
+void
+ActiveCallForm::OnCategoriesChanged(const Tizen::Base::Collection::IList& categoryChangeInfoList)
+{
+       //No implementation
+}
+
+
+void
 ActiveCallForm::UpdateMultipleCallScreen(Tizen::Base::Collection::IListT<AppCallInfo>& activeCallsList)
 {
        AppLog("ENTER");
@@ -1259,7 +1495,8 @@ ActiveCallForm::UpdateMultipleCallScreen(Tizen::Base::Collection::IListT<AppCall
                                }
                        }
                        //show call active time using Timer
-                       __activeCallStartTime = __pActiveCallInfo->GetCallConnectTime();
+                       //__activeCallStartTime = __pActiveCallInfo->GetCallConnectTime();
+                       __activeCallStartTime = __pActiveCallInfo->GetDurationTime();
                        ShowTimerInfo(IDC_CALLER1_TIME_LABEL,false,__activeCallStartTime);
                }
                else
@@ -1315,14 +1552,16 @@ ActiveCallForm::UpdateMultipleCallScreen(Tizen::Base::Collection::IListT<AppCall
 void
 ActiveCallForm::ShowPersonDetails(const String& phoneNumber, const String& contactLblName, const String& nameLblName, bool isSecondCaller, AppCallInfo* pCallInfo)
 {
+       result r = E_FAILURE;
+
        //call individual methods to show contact number, caller name & photo
        ShowPhoneNumber(phoneNumber, contactLblName);
 
        //fetch contact details based on phone number
-       String* pDisplayName = pCallInfo->FetchCallerNameN();
+       String* pDisplayName = pCallInfo->FetchLatestCallerNameN(phoneNumber);
        ShowCallerName(*pDisplayName, nameLblName);
 
-       Bitmap* pPhotoBitmap = pCallInfo->FetchCallerPhotoN();
+       Bitmap* pPhotoBitmap = pCallInfo->FetchLatestCallerPhotoN(phoneNumber);
        ShowCallerPhoto(pPhotoBitmap, isSecondCaller);
 
        //free resources
@@ -1442,7 +1681,7 @@ ActiveCallForm::ShowCallerPhoto(Bitmap* pPhotoId, bool isSecondCaller)
        //Remove small photo label
        if (__pSmallPhotoLabel != null)
        {
-               RemoveControl(*__pSmallPhotoLabel);
+               RemoveControl(__pSmallPhotoLabel);
                __pSmallPhotoLabel = null;
        }
 
@@ -1500,6 +1739,7 @@ ActiveCallForm::ShowCallerPhoto(Bitmap* pPhotoId, bool isSecondCaller)
                        if (pPhotoLbl)
                        {
                                pPhotoLbl->SetBackgroundBitmap(*pDefaultPhoto);
+                               pPhotoLbl->Invalidate(true);
                        }
                        delete pDefaultPhoto;
                }
@@ -1544,7 +1784,7 @@ ActiveCallForm::ShowCallersPhotoThumbnail(const Bitmap& pPhotoId)
 {
        if (__pSmallPhotoLabel != null)
        {
-               RemoveControl(*__pSmallPhotoLabel);
+               RemoveControl(__pSmallPhotoLabel);
                __pSmallPhotoLabel = null;
        }
        //Draw Small Photo and show on small photo label
@@ -1553,7 +1793,7 @@ ActiveCallForm::ShowCallersPhotoThumbnail(const Bitmap& pPhotoId)
        __pSmallPhotoLabel->SetBackgroundColor(Color(0,0,0));
        __pSmallPhotoLabel->SetBackgroundBitmap(pPhotoId);
        // Add a Label to the Form
-       AddControl(*__pSmallPhotoLabel);
+       AddControl(__pSmallPhotoLabel);
        __pSmallPhotoLabel->Invalidate(true);
 }
 
@@ -1582,7 +1822,9 @@ ActiveCallForm::ShowTimerInfo(const String& timerLblName, bool isOnHold, long lo
                        SetHoldButtonStatus(true);
                        //current system time
                        long long currTime = 0;
-                       SystemTime::GetTicks(currTime);
+                       //SystemTime::GetTicks(currTime);
+                       CallApp* pPhoneApp = static_cast<CallApp*>(CallApp::GetInstance());
+                       currTime = pPhoneApp->GetCallAppTicks();
                        //Set call duration
                        TimeSpan diffSpan(abs(startTime - currTime));
 
@@ -1622,9 +1864,49 @@ void
 ActiveCallForm::SetHoldButtonShowState(bool showState)
 {
        Label* pLblControl = static_cast<Label*>(GetControl(IDC_HOLD_LABEL));
-       pLblControl->SetShowState(showState);
+       if(pLblControl != null)
+       {
+               pLblControl->SetShowState(showState);
+       }
        Button* pButtonControl = static_cast<Button*>(GetControl(IDC_HOLD_BUTTON));
-       pButtonControl->SetShowState(showState);
+       if(pButtonControl != null)
+       {
+               pButtonControl->SetShowState(showState);
+       }
+}
+
+void
+ActiveCallForm::SetShowStateOnKeypadLandscape(bool showState)
+{
+       switch (__formType)
+               {
+               case FORMTYPE_ACTIVECONFCALL:
+               case FORMTYPE_ACTIVECALL:
+               {
+                       SetHoldButtonShowState(showState);
+               }
+               break;
+
+               case FORMTYPE_MULTIPLECALLS:
+               {
+                       Label* pLblControl = static_cast<Label*>(GetControl(IDC_CALLER2_LABEL));
+                       pLblControl->SetShowState(showState);
+                       pLblControl = static_cast<Label*>(GetControl(IDC_NUMBER2_LABEL));
+                       pLblControl->SetShowState(showState);
+                       pLblControl = static_cast<Label*>(GetControl(IDC_CALLER2_TIME_LABEL));
+                       pLblControl->SetShowState(showState);
+                       pLblControl = static_cast<Label*>(GetControl(IDC_SWAP_LABEL));
+                       pLblControl->SetShowState(showState);
+                       pLblControl = static_cast<Label*>(GetControl(IDC_BACKGROUND_LABEL2));
+                       pLblControl->SetShowState(showState);
+                       Button* pButtonControl = static_cast<Button*>(GetControl(IDC_SWAP_BUTTON));
+                       pButtonControl->SetShowState(showState);
+               }
+               break;
+
+               default:
+                       break;
+               }
 }
 
 void
@@ -1788,7 +2070,8 @@ ActiveCallForm::OnListViewItemStateChanged(ListView& listView, int index, int el
 {
        //Goto conference call list form
        SceneManager* pSceneManager = SceneManager::GetInstance();
-       pSceneManager->GoForward(ForwardSceneTransition(IDSCN_SCENE_CONFCALLLIST), null);
+       pSceneManager->GoForward(ForwardSceneTransition(IDSCN_SCENE_CONFCALLLIST, SCENE_TRANSITION_ANIMATION_TYPE_NONE,
+                        SCENE_HISTORY_OPTION_NO_HISTORY, SCENE_DESTROY_OPTION_KEEP), null);
 }
 
 void