Prevent issue fix. 2Nabi issues fixed
[apps/osp/Call.git] / src / CallActiveCallForm.cpp
index 3d2bed6..11ef10b 100644 (file)
@@ -117,17 +117,14 @@ ActiveCallForm::~ActiveCallForm(void)
        }
        if (__pMoreOptionsList != null)
        {
-               RemoveControl(*__pMoreOptionsList);
                __pMoreOptionsList = null;
        }
        if (__pMoreOptionsListAnchor != null)
        {
-               RemoveControl(*__pMoreOptionsListAnchor);
                __pMoreOptionsListAnchor = null;
        }
        if (__pSmallPhotoLabel != null)
        {
-               RemoveControl(*__pSmallPhotoLabel);
                __pSmallPhotoLabel = null;
        }
        if (__pActiveCallInfo != null)
@@ -140,7 +137,6 @@ ActiveCallForm::~ActiveCallForm(void)
        }
        if(__pDTMFKeypad != null)
        {
-               RemoveControl(*__pDTMFKeypad);
                __pDTMFKeypad = null;
        }
 }
@@ -198,11 +194,7 @@ ActiveCallForm::OnInitializing(void)
 void
 ActiveCallForm::ShowDTMFKeypad(void)
 {
-       if(__pDTMFKeypad != null)
-       {
-               RemoveControl(*__pDTMFKeypad);
-               __pDTMFKeypad = null;
-       }
+
 
        if(__pDTMFKeypad == null)
        {
@@ -232,9 +224,12 @@ ActiveCallForm::ShowDTMFKeypad(void)
                        pRelativeLayout->SetRelation(*__pDTMFKeypad, __pCallButtonsPanel, RECT_EDGE_RELATION_RIGHT_TO_LEFT);
                }
        }
-       EditField* pTextBox = static_cast<EditField*>(__pDTMFKeypad->GetControl(IDC_TEXTBOX));
-       pTextBox->SetText(L"");
        __pDTMFKeypad->SetShowState(true);
+       if(__DtmfString.IsEmpty() == false)
+       {
+               EditField* pTextBox = static_cast<EditField*>(__pDTMFKeypad->GetControl(IDC_TEXTBOX));
+               pTextBox->SetText(__DtmfString);
+       }
        __pDTMFKeypad->Draw(true);
        __pDTMFKeypad->Show();
 }
@@ -279,13 +274,20 @@ ActiveCallForm::OnOrientationChanged(const Tizen::Ui::Control& source, Tizen::Ui
                                //in Portrait mode it is hidden beneath DTMF Keypad.
                                SetShowStateOnKeypad(false);
                        }
-                       String dtmfText = static_cast<EditField*>(__pDTMFKeypad->GetControl(IDC_TEXTBOX))->GetText();
-                       ShowDTMFKeypad();
-                       //get new text box.
-                       EditField* pTextBox = static_cast<EditField*>(__pDTMFKeypad->GetControl(IDC_TEXTBOX));
-                       pTextBox->SetText(dtmfText);
+                       if(__pDTMFKeypad->GetShowState() == true)
+                       {
+                               String dtmfText = static_cast<EditField*>(__pDTMFKeypad->GetControl(IDC_TEXTBOX))->GetText();
+                               HideDTMFKeypad();
+                               ShowDTMFKeypad();
+                       }
                }
        }
+       //More option is displayed recreate it
+       if(__pMoreOptionsListAnchor != null)
+       {
+               CreateMoreOptionsMenuList();
+               CreateMoreOptionsMenuList();
+       }
 }
 
 void
@@ -293,6 +295,8 @@ ActiveCallForm::HideDTMFKeypad(void)
 {
        if(__pDTMFKeypad != null)
        {
+               __DtmfString = static_cast<EditField*>(__pDTMFKeypad->GetControl(IDC_TEXTBOX))->GetText();
+
                RemoveControl(*__pDTMFKeypad);
                __pDTMFKeypad = null;
        }
@@ -571,7 +575,6 @@ ActiveCallForm::OnActionPerformed(const Control& source, int actionId)
                SetShowStateOnKeypad(false);
                }
                ShowDTMFKeypad();
-               SetTextToDTMFTextField(L"");
                __pCallButtonsPanel->SetKeypadButtonState(IDA_CLOSE_NUMKEYPAD);
        }
        break;
@@ -892,7 +895,7 @@ ActiveCallForm::OnSceneActivatedN(const SceneId& previousSceneId, const SceneId&
        {
                String contactNo;
                contactNo.Append(*(static_cast<String*>(pArgs->GetAt(0))));
-               __pActiveCallInfo = new (std::nothrow) CallInfo();
+               __pActiveCallInfo = new (std::nothrow) AppCallInfo();
                __pActiveCallInfo->SetContactNumber(contactNo);
                Contact* pContact = __pCallPresentor->GetContactN(contactNo);
                if (pContact != null)
@@ -909,7 +912,7 @@ ActiveCallForm::OnSceneActivatedN(const SceneId& previousSceneId, const SceneId&
        case FORMTYPE_EMERGENCYOUTGOINGCALL:
        {
                String* pContactNo = static_cast<String*>(pArgs->GetAt(0));
-               __pActiveCallInfo = new (std::nothrow) CallInfo();
+               __pActiveCallInfo = new (std::nothrow) AppCallInfo();
                long long phNumber = 0;
                LongLong::Parse(*pContactNo, phNumber);
                __pActiveCallInfo->SetContactNumber(*pContactNo);
@@ -921,9 +924,9 @@ ActiveCallForm::OnSceneActivatedN(const SceneId& previousSceneId, const SceneId&
        case FORMTYPE_ACTIVECALL:
        {
                //get contact number
-               CallInfo* pCall = static_cast<CallInfo*>(pArgs->GetAt(0));
+               AppCallInfo* pCall = static_cast<AppCallInfo*>(pArgs->GetAt(0));
 
-               __pActiveCallInfo = new (std::nothrow) CallInfo();
+               __pActiveCallInfo = new (std::nothrow) AppCallInfo();
                *__pActiveCallInfo =  *pCall;
                String activeContactNo;
                if(pCall->GetContactNumber().IsEmpty() == false)
@@ -945,9 +948,9 @@ ActiveCallForm::OnSceneActivatedN(const SceneId& previousSceneId, const SceneId&
        case FORMTYPE_EMERGENCYACTIVECALL:
        {
                //get contact number
-               CallInfo* pCall = static_cast<CallInfo*>(pArgs->GetAt(0));
+               AppCallInfo* pCall = static_cast<AppCallInfo*>(pArgs->GetAt(0));
 
-               __pActiveCallInfo = new (std::nothrow) CallInfo();
+               __pActiveCallInfo = new (std::nothrow) AppCallInfo();
                *__pActiveCallInfo =  *pCall;
 
                //show call active time using Timer
@@ -958,7 +961,7 @@ ActiveCallForm::OnSceneActivatedN(const SceneId& previousSceneId, const SceneId&
 
        case FORMTYPE_MULTIPLECALLS:
        {
-               IListT<CallInfo>* pCallsList = __pCallPresentor->GetCallListN();
+               IListT<AppCallInfo>* pCallsList = __pCallPresentor->GetCallListN();
                //update calls state
                UpdateMultipleCallScreen(*pCallsList);
                delete pCallsList;
@@ -969,8 +972,8 @@ ActiveCallForm::OnSceneActivatedN(const SceneId& previousSceneId, const SceneId&
        case FORMTYPE_ACTIVECONFCALL:
        {
                //get Conf call
-               CallInfo* pConfInfo = static_cast<CallInfo*>(pArgs->GetAt(0));
-               __pActiveCallInfo = new (std::nothrow) CallInfo();
+               AppCallInfo* pConfInfo = static_cast<AppCallInfo*>(pArgs->GetAt(0));
+               __pActiveCallInfo = new (std::nothrow) AppCallInfo();
                *__pActiveCallInfo =  *pConfInfo;
 
                int participantsCount = __pActiveCallInfo->GetCallerListCount();
@@ -1066,6 +1069,7 @@ ActiveCallForm::OnSceneDeactivated(const SceneId& currentSceneId, const SceneId&
        {
                __pMoreOptionsList->SetShowState(false);
        }
+       __DtmfString.Clear();
 }
 
 void
@@ -1074,7 +1078,7 @@ ActiveCallForm::HandleConfCallChanged(void)
        AppLog("ENTER");
        AppAssert((__formType == FORMTYPE_ACTIVECONFCALL) || (__formType == FORMTYPE_MULTIPLECALLS));
        //fetch changed conference call info
-       CallInfo* pConfCallInfo = __pCallPresentor->GetConferenceCallInfoN();
+       AppCallInfo* pConfCallInfo = __pCallPresentor->GetConferenceCallInfoN();
        if (pConfCallInfo == null)
        {
                AppLog("EXIT");
@@ -1099,7 +1103,7 @@ ActiveCallForm::HandleConfCallChanged(void)
        {
                //Active call is conference call
                delete __pActiveCallInfo;
-               __pActiveCallInfo = new (std::nothrow) CallInfo();
+               __pActiveCallInfo = new (std::nothrow) AppCallInfo();
                *__pActiveCallInfo = *pConfCallInfo;
 
                if (__formType == FORMTYPE_MULTIPLECALLS)
@@ -1116,7 +1120,7 @@ ActiveCallForm::HandleConfCallChanged(void)
        {
                //Held call is conference call - this is definitely multiple call screen.
                delete __pHeldCallInfo;
-               __pHeldCallInfo = new (std::nothrow) CallInfo();
+               __pHeldCallInfo = new (std::nothrow) AppCallInfo();
                *__pHeldCallInfo = *pConfCallInfo;
                pPeopleCountLbl = static_cast<Label*>(GetControl(IDC_NUMBER2_LABEL));
        }
@@ -1139,7 +1143,7 @@ ActiveCallForm::HandleConfCallChanged(void)
 }
 
 void
-ActiveCallForm::UpdateMultipleCallScreen(Tizen::Base::Collection::IListT<CallInfo>& activeCallsList)
+ActiveCallForm::UpdateMultipleCallScreen(Tizen::Base::Collection::IListT<AppCallInfo>& activeCallsList)
 {
        AppLog("ENTER");
        if(__pActiveCallInfo != null)
@@ -1163,7 +1167,7 @@ ActiveCallForm::UpdateMultipleCallScreen(Tizen::Base::Collection::IListT<CallInf
        for (int index = 0; index < activeCallsList.GetCount(); index++)
        {
                //Fetch call info
-               CallInfo callInfo;
+               AppCallInfo callInfo;
                activeCallsList.GetAt(index, callInfo);
 
                String contactNo;
@@ -1178,7 +1182,7 @@ ActiveCallForm::UpdateMultipleCallScreen(Tizen::Base::Collection::IListT<CallInf
 
                if (callInfo.IsOnHold() == false)
                {
-                       __pActiveCallInfo = new (std::nothrow) CallInfo();
+                       __pActiveCallInfo = new (std::nothrow) AppCallInfo();
                        *__pActiveCallInfo =  callInfo;
 
                        if (__pActiveCallInfo->IsConferenceCall() == false)
@@ -1193,6 +1197,10 @@ ActiveCallForm::UpdateMultipleCallScreen(Tizen::Base::Collection::IListT<CallInf
                                        pMoreBtn->SetShowState(false);
                                }
                                ShowPersonDetails(contactNo, IDC_NUMBER1_LABEL, IDC_CALLER1_LABEL, false,__pActiveCallInfo);
+                               if(__pMoreOptionsListAnchor != null && __pMoreOptionsListAnchor->GetShowState() == true)
+                               {
+                                       CreateMoreOptionsMenuList();
+                               }
                        }
                        else
                        {
@@ -1239,7 +1247,7 @@ ActiveCallForm::UpdateMultipleCallScreen(Tizen::Base::Collection::IListT<CallInf
                }
                else
                {
-                       __pHeldCallInfo = new (std::nothrow) CallInfo();
+                       __pHeldCallInfo = new (std::nothrow) AppCallInfo();
                        *__pHeldCallInfo = callInfo;
 
                        if (__pHeldCallInfo->IsConferenceCall() == false)
@@ -1283,7 +1291,7 @@ ActiveCallForm::UpdateMultipleCallScreen(Tizen::Base::Collection::IListT<CallInf
 
        //update JoinCall button status
        bool isEnableJoinCall = true;
-       CallInfo* pConfCallInfo = __pCallPresentor->GetConferenceCallInfoN();
+       AppCallInfo* pConfCallInfo = __pCallPresentor->GetConferenceCallInfoN();
        if(pConfCallInfo != null && pConfCallInfo->GetCallerListCount() >= IDI_MAX_CONF_CALL_PARTICIPANTS)
        {
                isEnableJoinCall = false;
@@ -1296,7 +1304,7 @@ ActiveCallForm::UpdateMultipleCallScreen(Tizen::Base::Collection::IListT<CallInf
 }
 
 void
-ActiveCallForm::ShowPersonDetails(const String& phoneNumber, const String& contactLblName, const String& nameLblName, bool isSecondCaller, CallInfo* pCallInfo)
+ActiveCallForm::ShowPersonDetails(const String& phoneNumber, const String& contactLblName, const String& nameLblName, bool isSecondCaller, AppCallInfo* pCallInfo)
 {
        //call individual methods to show contact number, caller name & photo
        ShowPhoneNumber(phoneNumber, contactLblName);
@@ -1829,7 +1837,7 @@ ActiveCallForm::CreateItem(int index, int itemWidth)
        pTextElement->SetFont(font);
        //construct Enriched text
        EnrichedText* pEnrichedText = new (std::nothrow) EnrichedText();
-       Dimension textDimension;
+       FloatDimension textDimension;
        font.GetTextExtent(confCallName, confCallName.GetLength(), textDimension);
        textDimension.height = textDimension.height + font.GetDescender();
        pEnrichedText->Construct(textDimension);
@@ -1837,8 +1845,8 @@ ActiveCallForm::CreateItem(int index, int itemWidth)
        pEnrichedText->Add(*pTextElement);
 
        //Add Enriched text to pItem
-       Point textPos(((2 * IDI_OPTIONMENU_ITEM_SPACING) + W_MGR_CONFCALL_BITMAP), ((IDI_OPTIONMENU_DIMEN.height - textDimension.height) / 2));
-       pItem->AddElement(Rectangle(textPos, textDimension), 2, *pEnrichedText);
+       FloatPoint textPos(((2 * IDI_OPTIONMENU_ITEM_SPACING) + W_MGR_CONFCALL_BITMAP), ((IDI_OPTIONMENU_DIMEN.height - textDimension.height) / 2));
+       pItem->AddElement(FloatRectangle(textPos, textDimension), 2, *pEnrichedText);
        // Cleans up
        pEnrichedText->RemoveAll(true);
        delete pEnrichedText;