2 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
4 // Licensed under the Flora License, Version 1.1 (the License);
5 // you may not use this file except in compliance with the License.
6 // You may obtain a copy of the License at
8 // http://floralicense.org/license/
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an AS IS BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
18 * @file CallEndCallForm.cpp
19 * @brief End Call form implementation
25 #include "CallAppUtility.h"
26 #include "CallEndCallForm.h"
27 #include "CallButtonsPanel.h"
28 #include "CallPresentationModel.h"
29 #include "CallSceneRegister.h"
30 #include "CallTypes.h"
31 #include "CallAppControlRequestMgr.h"
33 using namespace Tizen::App;
34 using namespace Tizen::Base;
35 using namespace Tizen::Base::Collection;
36 using namespace Tizen::Graphics;
37 using namespace Tizen::Media;
38 using namespace Tizen::Ui;
39 using namespace Tizen::Ui::Controls;
40 using namespace Tizen::Ui::Scenes;
41 using namespace Tizen::Social;
44 const int IDI_APP_END_TIMER = 3000;
45 const int W_PHOTO_LABEL = 720;
46 const int H_PHOTO_LABEL = 720;
47 const int X_PHOTO_LBL = 166;
48 const int Y_PHOTO_LBL = 232;
49 const int W_PHOTO_LBL = 388;
50 const int H_PHOTO_LBL = 388;
51 const int END_CALL_TIMER_VAL = 2000;
52 const int END_CALL_WAIT_TIMER_VAL = 500;
53 static const wchar_t* IDL_END_CALL_FORM = L"IDL_END_CALL_FORM";
54 static const wchar_t* IDC_NUMBER1_LABEL = L"IDC_NUMBER1_LABEL";
55 static const wchar_t* IDC_CALLER1_LABEL = L"IDC_CALLER1_LABEL";
56 static const wchar_t* IDC_KEY_BG_LABEL = L"IDC_KEY_BG_LABEL";
57 static const wchar_t* IDC_CALLER1_BIGPHOTO_LABEL = L"IDC_CALLER1_BIGPHOTO_LABEL";
58 static const wchar_t* IDB_END_CALL_DEFAULT_ICON = L"C01-1_call_default_caller ID_720x720.png";
59 static const wchar_t* IDC_VOICECALL_BUTTON = L"IDC_VOICECALL_BUTTON";
60 static const wchar_t* IDC_VIDEOCALL_BUTTON = L"IDC_VIDEOCALL_BUTTON";
61 static const wchar_t* IDC_ADD_TO_CONTACT_BUTTON = L"IDC_ADD_TO_CONTACT_BUTTON";
62 static const wchar_t* IDC_MSG_BUTTON = L"IDC_MSG_BUTTON";
66 EndCallForm::EndCallForm(void)
67 : BaseForm(FORMTYPE_ENDCALL)
69 __pCallButtonsPanel = null;
70 __pContactNumber = null;
71 __pEndCallEventTimer = null;
72 __pSmallPhotoLabel = null;
73 __isMsgAppControlLaunched = false;
74 __isContactAppControlLaunched = false;
75 __pAddressBook = null;
78 EndCallForm::~EndCallForm(void)
80 if (__pEndCallEventTimer != null)
82 __pEndCallEventTimer->Cancel();
83 delete __pEndCallEventTimer;
84 __pEndCallEventTimer = null;
86 if (__pSmallPhotoLabel != null)
88 __pSmallPhotoLabel = null;
90 if (__pAddressBook != null)
92 delete __pAddressBook;
93 __pAddressBook = null;
98 EndCallForm::Initialize(void)
100 Construct(IDL_END_CALL_FORM);
104 EndCallForm::OnInitializing(void)
106 result r = E_SUCCESS;
108 //initialize keypad and buttons
109 InitializeCallButtonsPanel();
111 __pEndCallEventTimer = new (std::nothrow) Tizen::Base::Runtime::Timer();
112 r = __pEndCallEventTimer->Construct(*this);
114 __pCallPresentor = CallPresentationModel::GetInstance();
119 EndCallForm::InitializeCallButtonsPanel(void)
121 Label* pKeysBgLbl = static_cast<Label*>(GetControl(IDC_KEY_BG_LABEL, true));
122 Bitmap* pBgBitmap = AppUtility::GetBitmapFromResourcesN(IDB_BACKGROUND_BITMAP, pKeysBgLbl->GetWidth(), pKeysBgLbl->GetHeight());
123 if (pBgBitmap != null)
125 pKeysBgLbl->SetBackgroundBitmap(*pBgBitmap);
127 if (__pCallButtonsPanel == null)
129 __pCallButtonsPanel = new (std::nothrow) CallButtonsPanel();
130 __pCallButtonsPanel->ConstructPanel(this, FORMTYPE_ENDCALL);
131 __pCallButtonsPanel->SetBounds(pKeysBgLbl->GetBounds());
132 AddControl(__pCallButtonsPanel);
135 RelativeLayout* pRelativeLayout = dynamic_cast<RelativeLayout*>(GetPortraitLayoutN());
136 if (pRelativeLayout != null)
138 pRelativeLayout->SetRelation(*__pCallButtonsPanel, *pKeysBgLbl, RECT_EDGE_RELATION_BOTTOM_TO_BOTTOM);
140 pRelativeLayout = dynamic_cast<RelativeLayout*>(GetLandscapeLayoutN());
141 if (pRelativeLayout != null)
143 pRelativeLayout->SetRelation(*__pCallButtonsPanel, *pKeysBgLbl, RECT_EDGE_RELATION_LEFT_TO_LEFT);
144 pRelativeLayout->SetRelation(*__pCallButtonsPanel, *pKeysBgLbl, RECT_EDGE_RELATION_RIGHT_TO_RIGHT);
149 EndCallForm::AddKeyPadActionListener(const String& keyName, CommandIds cmdId)
151 Button* pButton = static_cast<Button*>(GetControl(keyName));
154 pButton->SetActionId(cmdId);
155 pButton->AddActionEventListener(*this);
160 EndCallForm::OnTerminating(void)
162 result r = E_SUCCESS;
164 if (__pCallPresentor)
166 //Abort any AppControl Request running already to show incoming call screen
167 if (__pCallPresentor->IsAppControlRunning() == true)
169 __pCallPresentor->AbortAppControlRequest();
171 __pCallPresentor = null;
177 EndCallForm::OnActionPerformed(const Control& source, int actionId)
179 SceneManager* pSceneManager = SceneManager::GetInstance();
180 AppAssert(pSceneManager);
186 if(CallAppControlRequestMgr::GetInstance()->IsAppControlRunning() == true)
190 if (__isMsgAppControlLaunched == true)
192 //AppControl already launched.
195 //check if EndCallTimer is running, then cancel it
196 if(__pEndCallEventTimer != null)
198 __pEndCallEventTimer->Cancel();
200 //make an outgoing call with given number
201 String* contactTxt = new (std::nothrow) String(*__pContactNumber);
202 //switch to dialing outgoing call form
203 ArrayList* pContact = new (std::nothrow) ArrayList(SingleObjectDeleter);
204 pContact->Construct();
205 pContact->Add(contactTxt);
207 //Check if dialing a call is possible
208 bool isSimInitialized = __pCallPresentor->CheckSimInitializationIsCompleted();
209 if (isSimInitialized)
211 //Disable all buttons
212 Button* pButton = static_cast<Button*>(GetControl(IDC_VIDEOCALL_BUTTON,true));
213 pButton->SetEnabled(false);
214 pButton->Invalidate(true);
215 pButton = static_cast<Button*>(GetControl(IDC_VOICECALL_BUTTON,true));
216 pButton->SetEnabled(false);
217 pButton->Invalidate(true);
218 pButton = static_cast<Button*>(GetControl(IDC_ADD_TO_CONTACT_BUTTON,true));
219 if(pButton->GetShowState() == true)
221 pButton->SetEnabled(false);
222 pButton->Invalidate(true);
224 pButton = static_cast<Button*>(GetControl(IDC_MSG_BUTTON,true));
225 pButton->SetEnabled(false);
226 pButton->Invalidate(true);
227 //Check if dialing an emergency call
228 bool isEmergencyCall = __pCallPresentor->IsEmergencyNumber(*contactTxt, true);
231 pSceneManager->GoForward( ForwardSceneTransition( IDSCN_SCENE_OUT_EMERGENCYCALL,
232 SCENE_TRANSITION_ANIMATION_TYPE_NONE, SCENE_HISTORY_OPTION_NO_HISTORY,SCENE_DESTROY_OPTION_DESTROY), pContact);
236 pSceneManager->GoForward( ForwardSceneTransition(IDSCN_SCENE_OUTCALL,
237 SCENE_TRANSITION_ANIMATION_TYPE_NONE, SCENE_HISTORY_OPTION_NO_HISTORY,SCENE_DESTROY_OPTION_DESTROY), pContact);
242 //Show error message Popup
243 HandleTelephonyError(ERROR_CODE_SIM_INITIALIZATION_FAILED);
254 if (__isMsgAppControlLaunched == true)
256 //AppControl already launched.
259 //launch message AppControl
260 __isMsgAppControlLaunched = __pCallPresentor->LaunchComposeMessageAppControl(*__pContactNumber, this);
261 if (__isMsgAppControlLaunched == true && __pEndCallEventTimer != null)
263 //cancel EndCallTimer, if AppControl request was successful.
264 __pEndCallEventTimer->Cancel();
265 //Disable the call buttons
266 Button* pButton = static_cast<Button*>(GetControl(IDC_VIDEOCALL_BUTTON,true));
267 pButton->SetEnabled(false);
268 pButton->Invalidate(true);
269 pButton = static_cast<Button*>(GetControl(IDC_VOICECALL_BUTTON,true));
270 pButton->SetEnabled(false);
271 pButton->Invalidate(true);
272 pButton = static_cast<Button*>(GetControl(IDC_ADD_TO_CONTACT_BUTTON,true));
273 if(pButton->GetShowState() == true)
275 pButton->SetEnabled(false);
276 pButton->Invalidate(true);
282 case IDA_ADD_TO_CONTACTS:
284 if(__isContactAppControlLaunched == true)
286 //AppControl already launched.
287 AppLogDebug("__isContactAppControlLaunched == true");
290 HandleAddToContacts();
291 Button* pButton = static_cast<Button*>(GetControl(IDC_VIDEOCALL_BUTTON,true));
292 pButton->SetEnabled(false);
293 pButton->Invalidate(true);
294 pButton = static_cast<Button*>(GetControl(IDC_VOICECALL_BUTTON,true));
295 pButton->SetEnabled(false);
296 pButton->Invalidate(true);
297 pButton = static_cast<Button*>(GetControl(IDC_ADD_TO_CONTACT_BUTTON,true));
298 if(pButton->GetShowState() == true)
300 pButton->SetEnabled(false);
301 pButton->Invalidate(true);
303 pButton = static_cast<Button*>(GetControl(IDC_MSG_BUTTON,true));
304 pButton->SetEnabled(false);
305 pButton->Invalidate(true);
315 EndCallForm::HandleAddToContacts(void)
317 AppLogDebug("Enter");
319 Contact* pContact = __pCallPresentor->GetContactN(*__pContactNumber);
320 //Launch Contact AppControl
321 String requestParameter;
322 if (pContact != null)
325 requestParameter.Append(pContact->GetRecordId());
326 __isContactAppControlLaunched = __pCallPresentor->LaunchViewContactAppControl(requestParameter, this);
333 requestParameter.Append(*__pContactNumber);
334 __isContactAppControlLaunched = __pCallPresentor->LaunchAddContactAppControl(requestParameter, this);
337 if (__isContactAppControlLaunched == true && __pEndCallEventTimer != null)
339 //cancel EndCallTimer, if AppControl request was success.
340 __pEndCallEventTimer->Cancel();
345 EndCallForm::OnSceneActivatedN(const SceneId& previousSceneId, const SceneId& currentSceneId, IList* pArgs)
347 //set itself as listener
348 __pCallPresentor->SetTelEventListener(this);
349 //listen to Foreground events
350 CallApp* pPhoneApp = static_cast<CallApp*>(CallApp::GetInstance());
351 pPhoneApp->AddAppStateChangeListener(*this);
352 __isMsgAppControlLaunched = false;
353 __isContactAppControlLaunched = false;
357 case FORMTYPE_ENDCALL:
359 //fetch ended call details
360 AppCallInfo* pEndCall = static_cast<AppCallInfo*>(pArgs->GetAt(0));
363 __pContactNumber = new (std::nothrow) String();
364 if(pEndCall->IsConferenceCall() == false)
366 if(pEndCall->GetContactNumber().IsEmpty() == false)
368 __pContactNumber->Append(pEndCall->GetContactNumber());
372 __pContactNumber->Append(AppUtility::GetResourceString(IDS_NUMBER_UNKNOWN));
378 count.Append(pEndCall->GetCallerListCount());
380 count.Append(AppUtility::GetResourceString(IDS_PEOPLE_STR));
381 __pContactNumber->Append(count);
384 //Fetch & show contact person details
385 ShowPersonDetails(*__pContactNumber, IDC_CALLER1_LABEL, IDC_CALLER1_BIGPHOTO_LABEL,pEndCall);
386 //If call is hidden means contact number is empty,
387 //or if call is from known number(i.e present in contacts db), Then do NOT show "Add to Contact" button.
388 if (pEndCall->GetContactNumber().IsEmpty() == false)
390 //Check if contact is deleted in mean time.
391 Contact* pContact = __pCallPresentor->GetContactN(pEndCall->GetContactNumber());
392 //before setting check if the contact is deleted
395 ShowViewContactButton();
401 ShowAddContactButton();
407 ShowAddContactButton();
410 //Check if call is Emergency call or Hidden call,
411 //then disable all button in Call button panel.
412 if(pEndCall->IsConferenceCall() == false)
414 if (pEndCall->IsEmergency() == true || pEndCall->GetContactNumber().IsEmpty() == true)
416 __pCallButtonsPanel->SetEndCallPanelState(false);
420 __pCallButtonsPanel->SetEndCallPanelState(true);
425 __pCallButtonsPanel->SetEndCallPanelState(false);
428 //check if we reached the end call form of an outgoing call then don't show add to contacts
429 if(pEndCall->GetCalllogType() == CALL_LOG_TYPE_VOICE_OUTGOING)
431 __pCallButtonsPanel->ShowOrHideAddtoContactsButton(false);
433 else if(pEndCall->GetCalllogType() == CALL_LOG_TYPE_VOICE_INCOMING)
435 if(pEndCall->GetContactNumber().IsEmpty() == false)
437 __pCallButtonsPanel->ShowOrHideAddtoContactsButton(true);
448 //Before starting end call timer check if messaging appcontrol was launched during incoming call
449 if (__pEndCallEventTimer && __pCallPresentor->IsAppControlRunning() == false)
451 __pEndCallEventTimer->Start(IDI_APP_END_TIMER);
460 CallApp* pCallApp = static_cast<CallApp*>(CallApp::GetInstance());
461 pCallApp->SetTopMostWindow(false);
462 AddOrientationEventListener(*this);
463 __pAddressBook = AddressbookManager::GetInstance()->GetAddressbookN();
464 //Add address book listener to listen to contacts changed events
465 if(__pAddressBook != null)
467 __pAddressBook->SetAddressbookChangeEventListener(this);
472 EndCallForm::OnSceneDeactivated(const SceneId& currentSceneId, const SceneId& nextSceneId)
474 if (__pEndCallEventTimer != null)
476 __pEndCallEventTimer->Cancel();
478 if (__pContactNumber)
480 delete __pContactNumber;
481 __pContactNumber = null;
483 if (__pSmallPhotoLabel != null)
485 __pSmallPhotoLabel->SetShowState(false);
487 //remove contact change event listener
488 if(__pAddressBook != null)
490 __pAddressBook->SetAddressbookChangeEventListener(null);
492 //remove itself as listener
493 CallApp* pPhoneApp = static_cast<CallApp*>(CallApp::GetInstance());
494 pPhoneApp->RemoveAppStateChangeListener(*this);
495 RemoveOrientationEventListener(*this);
499 EndCallForm::OnDraw(void)
505 EndCallForm::ShowViewContactButton(void)
507 __pCallButtonsPanel->ShowViewContactButton();
511 EndCallForm::ShowAddContactButton(void)
513 __pCallButtonsPanel->ShowAddContactButton();
517 EndCallForm::ShowPhoneNumber(const String& phoneNumber, const String& lblName)
519 String formattedNumber = phoneNumber;
520 Label* pContactLbl = static_cast<Label*>(GetControl(lblName));
521 pContactLbl->SetText(formattedNumber);
525 EndCallForm::ShowPersonDetails(const String& phoneNumber, const String& nameLblName, const String& photoLblName, AppCallInfo* pCallInfo)
528 ShowPhoneNumber(phoneNumber, IDC_NUMBER1_LABEL);
530 Label* pNameLbl = static_cast<Label*>(GetControl(nameLblName));
531 Label* pPhotoLbl = static_cast<Label*>(GetControl(photoLblName));
533 String* pDisplayName;
534 if(pCallInfo->IsConferenceCall() == false)
536 //fetch contact details based on phone number
537 pDisplayName = pCallInfo->FetchLatestCallerNameN(phoneNumber);
541 pDisplayName = new (std::nothrow) String(AppUtility::GetResourceString(IDS_CONFERENCE_CALL_STRING));
543 Bitmap* pPhotoBitmap = null;
544 if(pCallInfo->IsConferenceCall() == false)
546 pPhotoBitmap = pCallInfo->FetchLatestCallerPhotoN(phoneNumber);
549 //passing an empty string to SetText fails in label,
550 //if previously valid text has been set
551 if (pDisplayName != null && pDisplayName->IsEmpty() == true && pNameLbl->GetText().IsEmpty() == false)
553 pDisplayName->Append(L" ");
556 // show display name on name Label
557 if (pDisplayName != null)
559 pNameLbl->SetText(*pDisplayName);
562 // If record not found or no photo id present for user,
563 //fetch default bitmap.
564 if (pPhotoBitmap != null)
566 if(pPhotoBitmap->GetHeight() <= H_SMALL_PHOTO
567 && pPhotoBitmap->GetWidth() <= W_SMALL_PHOTO)
569 ShowThumbnailImage(pPhotoBitmap,photoLblName);
573 Canvas* pCanvas = new (std::nothrow) Canvas;
574 Rectangle canvasRect(Rectangle(0, 0, pPhotoLbl->GetBounds().width, pPhotoLbl->GetBounds().height));
575 pCanvas->Construct(canvasRect);
576 //draw the contact bitmap
577 pCanvas->DrawBitmap(canvasRect,*pPhotoBitmap);
578 Bitmap* pNewPhotoId = new Bitmap();
579 pNewPhotoId->Construct(*pCanvas, pCanvas->GetBounds());
582 pPhotoLbl->SetBackgroundBitmap(*pNewPhotoId);
583 pPhotoLbl->Invalidate(true);
590 Bitmap* pDefaultPhoto = null;
591 if(pCallInfo->IsConferenceCall() == false)
593 pDefaultPhoto = AppUtility::GetBitmapFromResourcesN(IDB_END_CALL_DEFAULT_ICON,W_PHOTO_LABEL,H_PHOTO_LABEL);
597 pDefaultPhoto = AppUtility::GetBitmapFromResourcesN(IDB_CONFERENCE_BG_ICON,W_CONFERENCE_PHOTO,H_CONFERENCE_PHOTO);
599 if (pDefaultPhoto != null)
601 pPhotoLbl->SetBackgroundBitmap(*pDefaultPhoto);
602 pPhotoLbl->Invalidate(true);
603 delete pDefaultPhoto;
621 EndCallForm::ShowThumbnailImage(const Bitmap* pPhotoId,const String& photoLabel)
623 Label* pPhotoLbl = static_cast<Label*>(GetControl(photoLabel));
625 if (pPhotoLbl != null && pPhotoId != null)
627 Canvas* pCanvas = new (std::nothrow) Canvas;
628 Bitmap* pBackground = AppUtility::GetBitmapFromResourcesN(IDB_CALL_THUMBNAIL_BACKGROUND,W_CALL_THUMBNAIL,H_CALL_THUMBNAIL);
629 Bitmap* pShadow = AppUtility::GetBitmapFromResourcesN(IDB_CALL_THUMBNAIL_SHADOW,W_CALL_THUMBNAIL_SHADOW,H_CALL_THUMBNAIL_SHADOW);
630 Rectangle canvasRect(Rectangle(0, 0, pPhotoLbl->GetBounds().width, pPhotoLbl->GetBounds().height));
631 pCanvas->Construct(canvasRect);
632 //draw the back ground
633 pCanvas->DrawBitmap(canvasRect,*pBackground);
634 //draw shadow (to be enabled after correct shadow image is provided )
635 //pCanvas->DrawBitmap(Rectangle((pPhotoLbl->GetBounds().width/2)-(W_CALL_THUMBNAIL_SHADOW/2),
636 // (pPhotoLbl->GetBounds().height/2)-(H_CALL_THUMBNAIL_SHADOW/2),W_CALL_THUMBNAIL_SHADOW,H_CALL_THUMBNAIL_SHADOW),*pShadow);
637 //draw the contact bitmap
638 pCanvas->DrawBitmap(Rectangle((pPhotoLbl->GetBounds().width/2)-(W_SMALL_PHOTO/2),
639 (pPhotoLbl->GetBounds().height/2)-(H_SMALL_PHOTO/2),W_SMALL_PHOTO,H_SMALL_PHOTO),*pPhotoId);
640 Bitmap* pNewPhotoId = new Bitmap();
641 pNewPhotoId->Construct(*pCanvas, pCanvas->GetBounds());
644 pPhotoLbl->SetBackgroundBitmap(*pNewPhotoId);
645 pPhotoLbl->Invalidate(true);
653 EndCallForm::ShowCallersPhotoThumbnail(const Bitmap& pPhotoId)
655 if (__pSmallPhotoLabel != null)
657 RemoveControl(__pSmallPhotoLabel);
658 __pSmallPhotoLabel = null;
660 //Draw Small Photo and show on small photo label
661 __pSmallPhotoLabel = new (std::nothrow) Label();//static_cast<Label*>(GetControl(IDC_SMALL_PHOTO_LABEL));
662 __pSmallPhotoLabel->Construct(Rectangle(X_PHOTO_LBL, Y_PHOTO_LBL, W_PHOTO_LBL, H_PHOTO_LBL), L"");
663 __pSmallPhotoLabel->SetBackgroundColor(Color(0,0,0));
664 __pSmallPhotoLabel->SetBackgroundBitmap(pPhotoId);
665 // Add a Label to the Form
666 AddControl(__pSmallPhotoLabel);
667 __pSmallPhotoLabel->Invalidate(true);
671 EndCallForm::OnTimerExpired(Tizen::Base::Runtime::Timer& timer)
673 //goto initial scene or close application, since this was last active call.
674 HandleLastCallCompletion();
678 EndCallForm::OnAppControlCompleteResponseReceived(const AppId& appId, const String& operationId, AppCtrlResult appControlResult, const IMap* pExtraData)
680 AppLogDebug("Enter");
681 if (__isMsgAppControlLaunched == true)
683 //Message AppControl request completed.
684 __isMsgAppControlLaunched = false;
685 __pCallPresentor->AppControlRequestCompleted();
687 if(__isContactAppControlLaunched == true)
689 //notify app control completed
690 __isContactAppControlLaunched = false;
691 __pCallPresentor->AppControlRequestCompleted();
693 //AppControl completed, goto initial scene if present
695 HandleLastCallCompletion();
699 EndCallForm::HandleLastCallCompletion(void)
701 //Check if message sending is in progress if yes
702 //wait for it to complete by restarting the timer
703 AppLogDebug("Enter");
704 if(__pCallPresentor->IsMessageSendingInProgress() == true)
706 __pEndCallEventTimer->Start(END_CALL_WAIT_TIMER_VAL);
710 CallApp* pPhoneApp = (static_cast<CallApp*>(UiApp::GetInstance()));
711 pPhoneApp->Terminate();
716 EndCallForm::OnForeground(void)
718 AppLogDebug("Enter");
719 //If Contact app control was launched
720 //as we do not know if it success or failed.
721 if(__isContactAppControlLaunched == true)
723 if(__pEndCallEventTimer != null)
725 __pEndCallEventTimer->Start(END_CALL_TIMER_VAL);
727 UpdatePersonDetail();
728 //notify app control completed
729 __isContactAppControlLaunched = false;
730 __pCallPresentor->AppControlRequestCompleted();
732 else if (__isMsgAppControlLaunched == true)
734 //Message AppControl request completed.
735 if(__pEndCallEventTimer != null)
737 __pEndCallEventTimer->Start(2000);
739 __isMsgAppControlLaunched = false;
740 __pCallPresentor->AppControlRequestCompleted();
742 else if(__pCallPresentor->IsAppControlRunning() == true)
744 if(__pEndCallEventTimer != null)
746 __pEndCallEventTimer->Start(2000);
748 __pCallPresentor->AppControlRequestCompleted();
751 Button* pButton = static_cast<Button*>(GetControl(IDC_VIDEOCALL_BUTTON,true));
752 pButton->SetEnabled(false);
753 pButton->Invalidate(true);
754 pButton = static_cast<Button*>(GetControl(IDC_VOICECALL_BUTTON,true));
755 pButton->SetEnabled(true);
756 pButton->Invalidate(true);
757 pButton = static_cast<Button*>(GetControl(IDC_ADD_TO_CONTACT_BUTTON,true));
758 if(pButton->GetShowState() == true)
760 pButton->SetEnabled(true);
761 pButton->Invalidate(true);
763 pButton = static_cast<Button*>(GetControl(IDC_MSG_BUTTON,true));
764 pButton->SetEnabled(true);
765 pButton->Invalidate(true);
770 EndCallForm::OnBackground(void)
772 AppLogDebug("Enter");
776 EndCallForm::OnOrientationChanged(const Tizen::Ui::Control& source, Tizen::Ui::OrientationStatus orientationStatus)
778 AppLogDebug("Enter");
779 if (__pCallButtonsPanel != null)
781 //update position of call buttons panel
782 Label* pKeysBgLbl = static_cast<Label*>(GetControl(IDC_KEY_BG_LABEL, true));
783 __pCallButtonsPanel->SetBounds(pKeysBgLbl->GetBounds());
784 //bring button on top
785 __pCallButtonsPanel->SetButtonPosition();
786 RelativeLayout* pRelativeLayout = dynamic_cast<RelativeLayout*>(GetPortraitLayoutN());
787 if (pRelativeLayout != null)
789 //pRelativeLayout->SetRelation(*__pCallButtonsPanel, *pKeysBgLbl, RECT_EDGE_RELATION_TOP_TO_TOP);
791 pRelativeLayout = dynamic_cast<RelativeLayout*>(GetLandscapeLayoutN());
792 if (pRelativeLayout != null)
794 pRelativeLayout->SetRelation(*__pCallButtonsPanel, *pKeysBgLbl, RECT_EDGE_RELATION_LEFT_TO_LEFT);
795 pRelativeLayout->SetRelation(*__pCallButtonsPanel, *this, RECT_EDGE_RELATION_RIGHT_TO_RIGHT);
801 EndCallForm::OnContactsChanged(const IList& contactChangeInfoList)
803 UpdatePersonDetail();
807 EndCallForm::UpdatePersonDetail()
810 if (__pContactNumber != null && __pContactNumber->IsEmpty() == false)
812 AppCallInfo* ActiveCallInfo = new (std::nothrow) AppCallInfo();
813 ActiveCallInfo->SetContactNumber(*__pContactNumber);
814 Contact* pContact = __pCallPresentor->GetContactN(*__pContactNumber);
815 if (pContact != null)
817 ActiveCallInfo->SetContactInfo(*pContact);
819 //before setting check if the contact is deleted
822 ShowViewContactButton();
828 ShowAddContactButton();
830 ShowPersonDetails(*__pContactNumber, IDC_CALLER1_LABEL, IDC_CALLER1_BIGPHOTO_LABEL,ActiveCallInfo);
831 delete ActiveCallInfo;