1.Disconnecting call when no network 2.Support for Automatic:4dir
[apps/osp/Call.git] / src / CallActiveCallForm.cpp
index c502712..058a3ba 100644 (file)
@@ -219,10 +219,18 @@ ActiveCallForm::ShowDTMFKeypad(void)
                        rect.width = GetClientAreaBounds().width - __pCallButtonsPanel->GetWidth();
                }
 
-               AppLog("rect(%d,%d,%d,%d)",rect.x,rect.y,rect.width,rect.height);
+               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));
        pTextBox->SetText(L"");
@@ -839,7 +847,17 @@ ActiveCallForm::SetTextToDTMFTextField(const String& dtmfStr)
        if(__pDTMFKeypad != null)
        {
                EditField* pTextBox = static_cast<EditField*>(__pDTMFKeypad->GetControl(IDC_TEXTBOX));
-               pTextBox->AppendText(dtmfStr);
+
+               int startpos=-1,endpos=-1;
+               pTextBox->GetBlockRange(startpos,endpos);
+               if(startpos != -1)
+               {
+                       pTextBox->Remove();
+                       pTextBox->ReleaseBlock();
+               }
+
+               pTextBox->InsertTextAtCursorPosition(dtmfStr);
+               //pTextBox->AppendText(dtmfStr);
                pTextBox->SetFocus();
                pTextBox->Invalidate(true);
        }
@@ -874,7 +892,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)
@@ -891,7 +909,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);
@@ -903,9 +921,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)
@@ -927,9 +945,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
@@ -940,7 +958,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;
@@ -951,8 +969,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();
@@ -1056,7 +1074,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");
@@ -1081,7 +1099,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)
@@ -1098,7 +1116,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));
        }
@@ -1121,7 +1139,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)
@@ -1145,7 +1163,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;
@@ -1160,7 +1178,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)
@@ -1221,7 +1239,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)
@@ -1265,7 +1283,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;
@@ -1278,7 +1296,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);