Fix for 37272 37208 37254
[apps/osp/Call.git] / src / CallIncomingCallForm.cpp
index ad4175f..2adcc58 100644 (file)
@@ -83,6 +83,7 @@ const int H_LIST_TEXT_ITEM = 111;
 const int X_SEND_TEXT_ITEM = 484;
 const int Y_SEND_TEXT_ITEM = 20;
 const int W_SEND_TEXT_ITEM = 220;
+const int W_SEND_BUTTON_MARGIN = 14;
 const int H_SEND_TEXT_ITEM = 72;
 const int X_PHOTO_LBL = 166;
 const int Y_PHOTO_LBL = 232;
@@ -119,6 +120,11 @@ static const wchar_t* IDC_MSG_TABLEVIEW = L"IDC_MSG_TABLEVIEW";
 static const wchar_t* IDC_CALLER_LABEL = L"IDC_CALLER_LABEL";
 static const wchar_t* IDC_NUMBER_LABEL = L"IDC_NUMBER_LABEL";
 static const wchar_t* IDC_BIG_PHOTO_LABEL = L"IDC_BIG_PHOTO_LABEL";
+static const wchar_t* IDC_CALLHANDEL_PANEL = L"IDC_CALLHANDEL_PANEL";
+static const wchar_t* IDC_ACCEPT_LABEL = L"IDC_ACCEPT_LABEL";
+static const wchar_t* IDC_REJECT_LEBEL = L"IDC_REJECT_LEBEL";
+static const wchar_t* IDC_ACCEPT_ARROW = L"IDC_ACCEPT_ARROW_";
+static const wchar_t* IDC_REJECT_ARROW = L"IDC_REJECT_ARROW_";
 const wchar_t* IDS_REJECT_MESSAGE_BTN = L"IDS_REJECT_MESSAGE_BTN";
 const wchar_t* IDS_LIST_SEND_BUTTON = L"IDS_LIST_SEND_BUTTON";
 const wchar_t* IDS_NO_MESSAGE_STR = L"IDS_NO_MESSAGE_STR";
@@ -195,7 +201,7 @@ IncomingCallForm::OnInitializing(void)
 
        VisualElement* pFormVisElem = new (std::nothrow) VisualElement();
        r = pFormVisElem->Construct();
-       pFormVisElem->SetBounds(FloatRectangle(GetClientAreaBounds().x, GetClientAreaBounds().y, GetClientAreaBounds().width, GetClientAreaBounds().height));
+       pFormVisElem->SetBounds(FloatRectangle(GetBounds().x, GetBounds().y, GetBounds().width, GetBounds().height));
        pFormVisElem->SetShowState(true);
        pFormVisElem->SetOpacity(1.0f);
        pFormVisElem->SetName(IDI_FORM_VISUAL_ELE_NAME);
@@ -206,23 +212,12 @@ IncomingCallForm::OnInitializing(void)
                pCanvas->Clear();
                pCanvas->SetBackgroundColor(COLOR_SWIPE_PANEL);
                pCanvas->SetForegroundColor(COLOR_SWIPE_PANEL);
-               pCanvas->FillRectangle(COLOR_SWIPE_PANEL, Rectangle(GetClientAreaBounds().x, GetClientAreaBounds().y, GetClientAreaBounds().width, GetClientAreaBounds().height));
+               pCanvas->FillRectangle(COLOR_SWIPE_PANEL, Rectangle(GetBounds().x, GetBounds().y, GetBounds().width, GetBounds().height));
                delete pCanvas;
                pCanvas = null;
        }
        HideRejectPanel();
 
-       Button* pButtonRejectMessage = static_cast<Button*>(GetControl(IDC_REJECT_MESSAGE_BUTTON));
-       if (pButtonRejectMessage)
-       {
-               SetBitmapToRejectMessageButton(IDS_REJECT_MESSAGE_BTN,IDB_REJECT_MESSAGE_BG,
-                                                                          IDB_REJECT_MESSAGE_UP_ARROW, IDB_REJECT_MESSAGE_ICON, false, false);
-               SetBitmapToRejectMessageButton(IDS_REJECT_MESSAGE_BTN,IDB_REJECT_MESSAGE_BG,
-                                                                          IDB_REJECT_MESSAGE_UP_ARROW, IDB_REJECT_MESSAGE_ICON, false, true);
-               pButtonRejectMessage->SetActionId(IDA_SHOW_REJECT_CALL_MESSAGE_PANEL);
-               pButtonRejectMessage->AddActionEventListener(*this);
-       }
-
        //Get Reject list from Settings Manager
        IMapT<int,String>* pMsgMap = SettingsManager::GetInstance()->GetRejectMessageListN();
        if(pMsgMap != null)
@@ -249,14 +244,12 @@ IncomingCallForm::OnInitializing(void)
        Label* pPhotoLbl = static_cast<Label*>(GetControl(IDC_BIG_PHOTO_LABEL, true));
         int yPos = pPhotoLbl->GetX()+pPhotoLbl->GetHeight()+ Y_CALL_PANEL;
 
-       __pCallHandlePanel = new (std::nothrow) Panel();
-       r = __pCallHandlePanel->Construct(Rectangle(X_CALL_PANEL, yPos, GetClientAreaBounds().width - X_CALL_PANEL, H_CALL_PANEL), GROUP_STYLE_NONE);
+       __pCallHandlePanel = static_cast<Panel*>(GetControl(IDC_CALLHANDEL_PANEL, true));
        __pCallHandlePanel->AddTouchEventListener(*this);
-       AddControl(*__pCallHandlePanel);
        __pCallHandlePanel->SetBackgroundColor(COLOR_SWIPE_PANEL);
        VisualElement* pCallPanelVisElem = new (std::nothrow) VisualElement();
        r = pCallPanelVisElem->Construct();
-       pCallPanelVisElem->SetBounds(FloatRectangle(X_CALL_PANEL, yPos, GetClientAreaBounds().width, H_CALL_PANEL));
+       pCallPanelVisElem->SetBounds(FloatRectangle(__pCallHandlePanel->GetBoundsF()));
        pCallPanelVisElem->SetShowState(true);
        pCallPanelVisElem->SetOpacity(1.0f);
        pCallPanelVisElem->SetName(IDI_PANEL_VISUAL_ELE_NAME);
@@ -273,15 +266,13 @@ IncomingCallForm::OnInitializing(void)
                pCanvas = null;
        }
        //Lock Label for animation
-       __pAcceptLabel = new (std::nothrow) Label();
-       r = __pAcceptLabel->Construct(Rectangle(0, 0, W_DIAL_LABEL, H_DIAL_LABEL), L"");
+       __pAcceptLabel = static_cast<Label*>(GetControl(IDC_ACCEPT_LABEL, true));
        __pAcceptLabel->SetBackgroundColor(COLOR_SWIPE_PANEL);
        __pAcceptLabel->AddTouchEventListener(*this);
-       __pCallHandlePanel->AddControl(*__pAcceptLabel);
        //left dial icon
        __pAcceptVisElem = new (std::nothrow) VisualElement();
        r = __pAcceptVisElem->Construct();
-       __pAcceptVisElem->SetBounds(FloatRectangle(0, 0, W_DIAL_LABEL, H_DIAL_LABEL));
+       __pAcceptVisElem->SetBounds(FloatRectangle(0, 0, __pAcceptLabel->GetWidth(), __pAcceptLabel->GetHeight()));
        __pAcceptVisElem->SetShowState(true);
        __pAcceptVisElem->SetOpacity(1.0f);
        __pAcceptVisElem->SetName(IDI_ACCEPT_VISUAL_ELE_NAME);
@@ -300,10 +291,8 @@ IncomingCallForm::OnInitializing(void)
                pCanvas = null;
        }
        //UnLock Label for animation
-       __pRejectLabel = new (std::nothrow) Label();
-       r = __pRejectLabel->Construct(Rectangle(REJECT_LABEL_X_OFFSET, 0, W_DIAL_LABEL, H_DIAL_LABEL), L"");
+       __pRejectLabel = static_cast<Label*>(GetControl(IDC_REJECT_LEBEL, true));
        __pRejectLabel->AddTouchEventListener(*this);
-       __pCallHandlePanel->AddControl(*__pRejectLabel);
        __pRejectLabel->SetBackgroundColor(COLOR_SWIPE_PANEL);
        SetControlAlwaysAtBottom(*__pCallHandlePanel, true);
 
@@ -337,10 +326,10 @@ IncomingCallForm::OnInitializing(void)
        int x = X_ARROW_LABEL_STARTPOS;
        for (int index = 0; index < COUNT_ARROW_ELEMENTS; index++)
        {
-               __pAcceptArrowLabel = new (std::nothrow) Label();
-               r = __pAcceptArrowLabel->Construct(Rectangle(x, Y_ARROW_LABEL, W_ARROW_LABEL, H_ARROW_LABEL), L"");
+               String LabelName(IDC_ACCEPT_ARROW);
+               LabelName.Append(index+1);
+               __pAcceptArrowLabel = static_cast<Label*>(GetControl(LabelName, true));
                __pAcceptArrowLabel->AddTouchEventListener(*this);
-               __pCallHandlePanel->AddControl(*__pAcceptArrowLabel);
                __pAcceptArrowLabelsList->Add(*__pAcceptArrowLabel);
                __pAcceptArrowVisElem = new (std::nothrow) VisualElement();
                r = __pAcceptArrowVisElem->Construct();
@@ -373,10 +362,10 @@ IncomingCallForm::OnInitializing(void)
        x = X_ARROW_REJECT_LABEL_STARTPOS;
        for (int index = 0; index < COUNT_ARROW_ELEMENTS; index++)
        {
-               __pRejectArrowLabel = new (std::nothrow) Label();
-               r = __pRejectArrowLabel->Construct(Rectangle(x, Y_ARROW_LABEL, W_ARROW_LABEL, H_ARROW_LABEL), L"");
+               String LabelName(IDC_REJECT_ARROW);
+               LabelName.Append(index+1);
+               __pRejectArrowLabel = static_cast<Label*>(GetControl(LabelName, true));
                __pRejectArrowLabel->AddTouchEventListener(*this);
-               __pCallHandlePanel->AddControl(*__pRejectArrowLabel);
                __pRejectArrowLabelsList->Add(*__pRejectArrowLabel);
                __pRejectArrowVisElem = new (std::nothrow) VisualElement();
                r = __pRejectArrowVisElem->Construct();
@@ -432,6 +421,7 @@ IncomingCallForm::ShowRejectMessageFooter(void)
        Footer* pFooter = GetFooter();
        if(pFooter != null)
        {
+               AppLogDebug("SetShowState");
                pFooter->SetShowState(true);
 
        }
@@ -582,11 +572,7 @@ IncomingCallForm::OnTerminating(void)
 }
 
 void
-IncomingCallForm::OnActionPerformed(const Control& source, int actionId)
-{
-       switch (actionId)
-       {
-       case IDA_SHOW_REJECT_CALL_MESSAGE_PANEL: // applicable in all form states
+IncomingCallForm::ShowRejectMessagePanel(void)
        {
                Panel* pKeysPanel = static_cast<Panel*>(GetControl(IDC_REJECT_PANEL));
                if (pKeysPanel)
@@ -608,6 +594,7 @@ IncomingCallForm::OnActionPerformed(const Control& source, int actionId)
                        }
 
                        pMessageList->SetBounds(tmpRect.x, tmpRect.y, tmpRect.width, listHeight);
+                       pMessageList->UpdateTableView();
                        tmpRect = pKeysPanel->GetBounds();
                        pKeysPanel->SetBounds(tmpRect.x, tmpRect.y, tmpRect.width, H_MESSAGE_BG_BITMAP /*+ H_REJECT_VIEW_FOOTER*/ + listHeight);
 
@@ -619,17 +606,6 @@ IncomingCallForm::OnActionPerformed(const Control& source, int actionId)
 
                        ShowRejectMessageFooter();
 
-               /*      pButtonReject = static_cast<Button*>(pKeysPanel->GetControl(IDC_BACK_BUTTON));
-                       pButtonReject->SetActionId(IDA_CANCEL_REJECT_CALL_MESSAGE_PANEL);
-                       pButtonReject->AddActionEventListener(*this);
-                       pButtonReject->SetEnabled(true);
-                       pButtonReject->SetFocus();
-
-                       Button* pButtonCreate = static_cast<Button*>(pKeysPanel->GetControl(IDC_CREATE_BUTTON));
-                       pButtonCreate->SetActionId(IDA_CREATE_REJECT_CALL_MESSAGE);
-                       pButtonCreate->AddActionEventListener(*this);
-                       pButtonCreate->SetEnabled(true);
-                       pButtonCreate->SetFocus();*/
 
                        pKeysPanel->SetFocus();
                        pKeysPanel->Draw();
@@ -642,12 +618,39 @@ IncomingCallForm::OnActionPerformed(const Control& source, int actionId)
                        pButtonRejectMessage->Draw();
                }
        }
+void
+IncomingCallForm::HideRejectMessagePanel(void)
+{
+       HideRejectPanel();
+       Button* pButtonRejectMessage = static_cast<Button*>(GetControl(IDC_REJECT_MESSAGE_BUTTON));
+       if (pButtonRejectMessage)
+       {
+               pButtonRejectMessage->SetShowState(true);
+               RelativeLayout* pRelativeLayout = dynamic_cast<RelativeLayout*>(GetLandscapeLayoutN());
+               if (pRelativeLayout != null)
+               {
+                       pRelativeLayout->SetRelation(*pButtonRejectMessage,*this,RECT_EDGE_RELATION_BOTTOM_TO_BOTTOM);
+                       pRelativeLayout->Update();
+                       delete pRelativeLayout;
+               }
+       }
+}
+
+void
+IncomingCallForm::OnActionPerformed(const Control& source, int actionId)
+{
+       switch (actionId)
+       {
+       case IDA_SHOW_REJECT_CALL_MESSAGE_PANEL: // applicable in all form states
+       {
+               ShowRejectMessagePanel();
+       }
        break;
 
        case IDA_CREATE_REJECT_CALL_MESSAGE:
        {
                __pCallPresentor->RejectCall(__incomingCallHandle, true,*__pActiveContactNo);
-               ArrayListT<CallInfo>* pCallList  = static_cast<ArrayListT<CallInfo>*>(__pCallPresentor->GetCallListN());
+               ArrayListT<AppCallInfo>* pCallList  = static_cast<ArrayListT<AppCallInfo>*>(__pCallPresentor->GetCallListN());
                if(pCallList != null && pCallList->GetCount() > 0)
                {
                        __pCallPresentor->HandleCallConnected(*pCallList);
@@ -658,16 +661,7 @@ IncomingCallForm::OnActionPerformed(const Control& source, int actionId)
 
        case IDA_CANCEL_REJECT_CALL_MESSAGE_PANEL:
        {
-               HideRejectPanel();
-               SetFocus();
-               Button* pButtonRejectMessage = static_cast<Button*>(GetControl(IDC_REJECT_MESSAGE_BUTTON));
-               if (pButtonRejectMessage)
-               {
-                       pButtonRejectMessage->SetShowState(true);
-                       pButtonRejectMessage->Invalidate(true);
-                       pButtonRejectMessage->Draw();
-               }
-               RequestRedraw(true);
+               HideRejectMessagePanel();
        }
        break;
 
@@ -726,6 +720,10 @@ IncomingCallForm::OnActionPerformed(const Control& source, int actionId)
 void
 IncomingCallForm::OnSceneActivatedN(const SceneId& previousSceneId,    const SceneId& currentSceneId, IList* pArgs)
 {
+       AddOrientationEventListener(*this);
+       //listen to Foreground events
+       CallApp* pPhoneApp = static_cast<CallApp*>(CallApp::GetInstance());
+       pPhoneApp->AddAppStateChangeListener(*this);
        if(__pCallPresentor == null)
        {
                __pCallPresentor = CallPresentationModel::GetInstance();
@@ -776,7 +774,7 @@ IncomingCallForm::OnSceneActivatedN(const SceneId& previousSceneId, const SceneI
        if (pArgs != null)
        {
                //get Call Info
-               CallInfo* pIncomingCall = static_cast<CallInfo*>(pArgs->GetAt(0));
+               AppCallInfo* pIncomingCall = static_cast<AppCallInfo*>(pArgs->GetAt(0));
                if (pIncomingCall != null)
                {
                        //start alert with contact's custom ringtone
@@ -817,13 +815,23 @@ IncomingCallForm::OnSceneActivatedN(const SceneId& previousSceneId,       const SceneI
        }
        CallApp* pCallApp = static_cast<CallApp*>(CallApp::GetInstance());
        pCallApp->SetTopMostWindow(true);
-
+       Button* pButtonRejectMessage = static_cast<Button*>(GetControl(IDC_REJECT_MESSAGE_BUTTON));
+       if (pButtonRejectMessage)
+       {
+               SetBitmapToRejectMessageButton(IDS_REJECT_MESSAGE_BTN,IDB_REJECT_MESSAGE_BG,
+                                                                          IDB_REJECT_MESSAGE_UP_ARROW, IDB_REJECT_MESSAGE_ICON, false, false);
+               SetBitmapToRejectMessageButton(IDS_REJECT_MESSAGE_BTN,IDB_REJECT_MESSAGE_BG,
+                                                                          IDB_REJECT_MESSAGE_UP_ARROW, IDB_REJECT_MESSAGE_ICON, false, true);
+               pButtonRejectMessage->SetActionId(IDA_SHOW_REJECT_CALL_MESSAGE_PANEL);
+               pButtonRejectMessage->AddActionEventListener(*this);
+       }
 
 }
 
 void
 IncomingCallForm::OnSceneDeactivated(const SceneId& currentSceneId, const SceneId& nextSceneId)
 {
+       RemoveOrientationEventListener(*this);
        if (__pSmallPhotoLabel != null)
        {
                RemoveControl(*__pSmallPhotoLabel);
@@ -860,7 +868,7 @@ IncomingCallForm::OnSceneDeactivated(const SceneId& currentSceneId, const SceneI
 
        }
        CallApp* pCallApp = static_cast<CallApp*>(CallApp::GetInstance());
-       pCallApp->SetTopMostWindow(false);
+       pCallApp->RemoveAppStateChangeListener(*this);
 }
 
 result
@@ -969,7 +977,7 @@ IncomingCallForm::CreateItem(int itemIndex, int itemWidth)
        {
                String sendText = AppUtility::GetResourceString(IDS_LIST_SEND_BUTTON);
                Button* pSendButton = new (std::nothrow) Button();
-               pSendButton->Construct(Rectangle(X_SEND_TEXT_ITEM, Y_SEND_TEXT_ITEM, W_SEND_TEXT_ITEM, H_SEND_TEXT_ITEM), sendText);
+               pSendButton->Construct(Rectangle(GetClientAreaBounds().width - W_SEND_BUTTON_MARGIN -W_SEND_TEXT_ITEM, Y_SEND_TEXT_ITEM, W_SEND_TEXT_ITEM, H_SEND_TEXT_ITEM), sendText);
                //set action id and listener
                int actionId = IDA_SEND_REJECT_MSG1;
                switch(itemIndex)
@@ -998,6 +1006,10 @@ IncomingCallForm::CreateItem(int itemIndex, int itemWidth)
                pItem->AddControl(*pSendButton);
                pItem->SetIndividualSelectionEnabled(pSendButton, true);
        }
+       else
+       {
+               pItem->SetEnabled(false);
+       }
 
        return pItem;
 }
@@ -1017,7 +1029,7 @@ IncomingCallForm::GetDefaultItemHeight(void)
 }
 
 void
-IncomingCallForm::ShowPersonDetails(const String& phoneNumber, const String& contactLblName, const String& nameLblName, CallInfo* pCallInfo)
+IncomingCallForm::ShowPersonDetails(const String& phoneNumber, const String& contactLblName, const String& nameLblName, AppCallInfo* pCallInfo)
 {
        //call individual methods to show contact number, caller name & photo
        SetTextToLabel(phoneNumber, contactLblName);
@@ -1208,7 +1220,7 @@ IncomingCallForm::SetBitmapToRejectMessageButton(const String& btnName, const St
 
        //set button name
        String holdBtnName = AppUtility::GetResourceString(btnName);
-       Dimension textDimension;
+       FloatDimension textDimension;
        if (!holdBtnName.IsEmpty())
        {
                Font font;
@@ -1300,20 +1312,21 @@ IncomingCallForm::OnTouchPressed(const Control& source, const Point& currentPosi
 void
 IncomingCallForm::OnTouchReleased(const Control& source, const Point& currentPosition, const TouchEventInfo& touchInfo)
 {
+       AppLogDebug("%d",currentPosition.x);
        if (__isAnswerCallStarted == true)
        {
-               if (currentPosition.x > REJECT_LABEL_X_OFFSET)
+               if (currentPosition.x > __pRejectLabel->GetBounds().x)
                {
                        //Right reject icon
                        if(__pRejectFinalVisElem == null)
                        {
                                __pRejectFinalVisElem = new (std::nothrow) VisualElement();
+                               __pRejectFinalVisElem->Construct();
+                               __pRejectFinalVisElem->SetName(IDI_REJECT_FINAL_VISUAL_ELE_NAME);
                        }
-                       __pRejectFinalVisElem->Construct();
                        __pRejectFinalVisElem->SetBounds(FloatRectangle(0, 0, W_DIAL_LABEL, H_DIAL_LABEL));
                        __pRejectFinalVisElem->SetShowState(true);
                        __pRejectFinalVisElem->SetOpacity(1.00f);
-                       __pRejectFinalVisElem->SetName(IDI_REJECT_FINAL_VISUAL_ELE_NAME);
                        if(__pRejectLabel->GetVisualElement()->GetChild(IDI_REJECT_FINAL_VISUAL_ELE_NAME,true) == null)
                        {
                                AppLogDebug("AttachChild __pRejectFinalVisElem");
@@ -1331,11 +1344,11 @@ IncomingCallForm::OnTouchReleased(const Control& source, const Point& currentPos
 
                        __pAcceptVisElem->SetOpacity(0.0f);
                        //fetch already active call list
-                       ArrayListT<CallInfo>* pCallList  = static_cast<ArrayListT<CallInfo>*>(__pCallPresentor->GetCallListN());
+                       ArrayListT<AppCallInfo>* pCallList  = static_cast<ArrayListT<AppCallInfo>*>(__pCallPresentor->GetCallListN());
                        if (pCallList != null && pCallList->GetCount() > 0)
                        {
                                //then atleast 1 active call exist.
-                               CallInfo phnCallInfo;
+                               AppCallInfo phnCallInfo;
                                pCallList->GetAt(0,phnCallInfo);
                                //Check if only 1 call exist and it is on Hold
                                if(pCallList->GetCount() == 1 && phnCallInfo.IsOnHold())
@@ -1377,18 +1390,19 @@ IncomingCallForm::OnTouchReleased(const Control& source, const Point& currentPos
        }
        else if (__isRejectCallStarted == true)
        {
-               if (currentPosition.x < ACCEPT_LABEL_RELATIVE_POS)
+               if (currentPosition.x < ((__pAcceptLabel->GetBounds().x + __pAcceptLabel->GetWidth())- __pRejectLabel->GetBounds().x))
                {
                        //left dial icon
                        if(__pAcceptFinalVisElem == null)
                        {
                                __pAcceptFinalVisElem = new (std::nothrow) VisualElement();
+                               __pAcceptFinalVisElem->Construct();
+                               __pAcceptFinalVisElem->SetName(IDI_ACCEPT_FINAL_VISUAL_ELE_NAME);
                        }
-                       __pAcceptFinalVisElem->Construct();
                        __pAcceptFinalVisElem->SetBounds(FloatRectangle(0, 0, W_DIAL_LABEL, H_DIAL_LABEL));
-                       __pAcceptFinalVisElem->SetShowState(true);
                        __pAcceptFinalVisElem->SetOpacity(1.0f);
-                       __pAcceptFinalVisElem->SetName(IDI_ACCEPT_FINAL_VISUAL_ELE_NAME);
+
+
                        if(__pAcceptLabel->GetVisualElement()->GetChild(IDI_ACCEPT_FINAL_VISUAL_ELE_NAME,true) == null)
                        {
                                AppLogDebug("AttachChild __pAcceptFinalVisElem");
@@ -1461,7 +1475,6 @@ IncomingCallForm::OnTouchMoved(const Control& source, const Point& currentPositi
 void
 IncomingCallForm::OnItemSelected(int itemIndex)
 {
-
        ArrayList* pArgs = new (std::nothrow) ArrayList(SingleObjectDeleter);
        pArgs->Construct();
 
@@ -1469,7 +1482,6 @@ IncomingCallForm::OnItemSelected(int itemIndex)
        Integer* argIndex = new (std::nothrow) Integer(itemIndex);
        pArgs->Add(argIndex);
        SendUserEvent(REQUEST_ITEM_SELECTED,pArgs);
-
 }
 
 void
@@ -1487,37 +1499,27 @@ IncomingCallForm::HandleMultipleCallSelection(int itemIndex)
        __pAcceptVisElem->SetOpacity(1.0f);
        __pRejectVisElem->SetOpacity(1.00f);
 
-       for (int i = 0; i < COUNT_ARROW_ELEMENTS; i++)
-       {
-               __pRejectArrowLabel = static_cast<Label*>(__pRejectArrowLabelsList->GetAt(i));
-               String RejectVisualEleName(IDI_REJECT_ARROW_VISUAL_ELE_NAME);
-               RejectVisualEleName.Append(i);
-               __pRejectArrowVisElem = __pRejectArrowLabel->GetVisualElement()->GetChild(RejectVisualEleName,true);
-               __pRejectArrowVisElem->SetOpacity(0.0f);
-               __pAcceptArrowLabel = static_cast<Label*>(__pAcceptArrowLabelsList->GetAt(i));
-               String AcceptVisualEleName(IDI_ACCEPT_ARROW_VISUAL_ELE_NAME);
-               AcceptVisualEleName.Append(i);
-               __pAcceptArrowVisElem = __pAcceptArrowLabel->GetVisualElement()->GetChild(AcceptVisualEleName,true);
-               __pAcceptArrowVisElem->SetOpacity(0.0f);
-       }
        if (__pRejectFinalVisElem != null)
        {
                __pRejectFinalVisElem->Destroy();
                __pRejectFinalVisElem = null;
        }
-
        if (__pAcceptFinalVisElem != null)
        {
                __pAcceptFinalVisElem->Destroy();
                __pAcceptFinalVisElem = null;
        }
+
        if (__pOptionPopup)
        {
                delete __pOptionPopup;
                __pOptionPopup = null;
        }
        //accept call
-       __pCallPresentor->AcceptIncomingCall(CallAnsweringOptions(itemIndex),__incomingCallHandle);
+       if(itemIndex != IDA_BUTTON_CANCEL_OPTIONS_POPUP)
+       {
+               __pCallPresentor->AcceptIncomingCall(CallAnsweringOptions(itemIndex),__incomingCallHandle);
+       }
 }
 
 void
@@ -1556,3 +1558,95 @@ IncomingCallForm::OnFormBackRequested(Tizen::Ui::Controls::Form& source)
        RequestRedraw(true);
 
 }
+
+void
+IncomingCallForm::OnOrientationChanged(const Control& source, OrientationStatus orientationStatus)
+{
+       Panel* pKeysPanel = static_cast<Panel*>(GetControl(IDC_REJECT_PANEL));
+       if(pKeysPanel->GetShowState() == true)
+       {
+               HideRejectMessagePanel();
+               ShowRejectMessagePanel();
+       }
+
+       Button* pButtonRejectMessage = static_cast<Button*>(GetControl(IDC_REJECT_MESSAGE_BUTTON));
+       if (pButtonRejectMessage != null)
+       {
+               SetBitmapToRejectMessageButton(IDS_REJECT_MESSAGE_BTN,IDB_REJECT_MESSAGE_BG,
+                                                                          IDB_REJECT_MESSAGE_UP_ARROW, IDB_REJECT_MESSAGE_ICON, false, false);
+               SetBitmapToRejectMessageButton(IDS_REJECT_MESSAGE_BTN,IDB_REJECT_MESSAGE_BG,
+                                                                          IDB_REJECT_MESSAGE_UP_ARROW, IDB_REJECT_MESSAGE_ICON, false, true);
+               pButtonRejectMessage->Invalidate(true);
+       }
+
+       Button* pButtonReject = static_cast<Button*>(pKeysPanel->GetControl(IDC_REJECT_MESSAGE_CANCEL_BUTTON));
+       if (pButtonReject != null)
+       {
+               SetBitmapToRejectMessageButton(IDS_REJECT_MESSAGE_BTN,IDB_REJECT_MESSAGE_BG,
+                                                                          IDB_REJECT_MESSAGE_DOWN_ARROW, IDB_REJECT_MESSAGE_ICON, true, false);
+               SetBitmapToRejectMessageButton(IDS_REJECT_MESSAGE_BTN,IDB_REJECT_MESSAGE_BG,
+                                                                          IDB_REJECT_MESSAGE_DOWN_ARROW, IDB_REJECT_MESSAGE_ICON, true, true);
+               pButtonReject->Invalidate(true);
+       }
+}
+
+void
+IncomingCallForm::OnForeground(void)
+{
+       __pCallPresentor->OnAppForeground();
+}
+
+void
+IncomingCallForm::OnScreenOff(void)
+{
+       __pCallPresentor->StopAlert();
+}
+
+void
+IncomingCallForm::CallDisconnected(void)
+{
+       //check if no call option popup is shown, then remain on incoming call screen.
+       //As user has neither accepted nor rejected incoming call.
+       if (__pOptionPopup == null)
+       {
+               return;
+       }
+
+       //fetch already active call list and show updated option popup
+       ArrayListT<AppCallInfo>* pCallList  = static_cast<ArrayListT<AppCallInfo>*>(__pCallPresentor->GetCallListN());
+       if (pCallList != null && pCallList->GetCount() > 0)
+       {
+               //then atleast 1 active call exist.
+               AppCallInfo phnCallInfo;
+               pCallList->GetAt(0,phnCallInfo);
+               //Check if only 1 call exist and it is on Hold
+               if(pCallList->GetCount() == 1 && phnCallInfo.IsOnHold())
+               {
+                       //directly accept call
+                       __pCallPresentor->AcceptIncomingCall(ANSERWING_OPTION_ACCEPT_CALL,__incomingCallHandle);
+               }
+               else
+               {
+                       //Either 1 call exist and not "on Hold".
+                       //Or 2 calls exist.
+                       if(__pOptionPopup != null)
+                       {
+                               delete __pOptionPopup;
+                               __pOptionPopup = null;
+                       }
+                       __pOptionPopup = new (std::nothrow) CallOptionPopup(*this,*(__pCallPresentor));
+                       __pOptionPopup->Initialize();
+                       __pOptionPopup->SetShowState(true);
+                       __pOptionPopup->Draw();
+                       __pOptionPopup->Show();
+               }
+               pCallList->RemoveAll();
+       }
+       else
+       {
+               //no active call - Accept the  incoming call
+               __pCallPresentor->AcceptIncomingCall(ANSERWING_OPTION_ACCEPT_CALL,__incomingCallHandle);
+       }
+       delete pCallList;
+       pCallList = null;
+}