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 PhnActiveCallForm.cpp
19 * @brief Active Call Form class
26 #include "CallActiveCallForm.h"
27 #include "CallButtonsPanel.h"
29 #include "CallAppUtility.h"
30 #include "CallDtmfKeypadPanel.h"
31 #include "CallPresentationModel.h"
32 #include "CallSceneRegister.h"
33 #include "CallTypes.h"
36 using namespace Tizen::App;
37 using namespace Tizen::Base;
38 using namespace Tizen::Base::Collection;
39 using namespace Tizen::Base::Utility;
40 using namespace Tizen::Graphics;
41 using namespace Tizen::Media;
42 using namespace Tizen::Social;
43 using namespace Tizen::System;
44 using namespace Tizen::Ui;
45 using namespace Tizen::Ui::Controls;
46 using namespace Tizen::Ui::Scenes;
47 using namespace Tizen::Shell;
50 const int IDI_MAX_SECONDS = 60;
51 const int IDI_MAX_MINS = 60;
52 const int W_HOLD_BITMAP = 78;
53 const int H_HOLD_BITMAP = 78;
54 //for Options menu list
55 const int IDI_POPUP_TEXT_SIZE = 33;
56 const unsigned int COLOR_POPUP_TEXT = Color32<255, 255, 255, 255>::Value;
57 const int IDI_MOREOPTIONS_LIST_ITEMS = 1;
58 const int W_OPTION_ANCHOR = 72;
59 const int H_OPTION_ANCHOR = 22;
60 const int W_MGR_CONFCALL_BITMAP = 64;
61 const int H_MGR_CONFCALL_BITMAP = 64;
62 const int X_POPUP_ANCHOR = 632;
63 const int Y_POPUP_ANCHOR = 140;
64 const int W_POPUP_ANCHOR = 72;
65 const int H_POPUP_ANCHOR = 22;
66 const int IDI_OPTIONMENU_ITEM_SPACING = 16;
67 const Point IDI_OPTIONMENU_POS(238, 162);
68 const Dimension IDI_OPTIONMENU_DIMEN(486, 99);
69 const int X_PHOTO_LBL = 166;
70 const int Y_PHOTO_LBL = 232;
71 const int W_PHOTO_LBL = 388;
72 const int H_PHOTO_LBL = 388;
73 const int W_PHOTO_LABEL = 720;
74 const int H_PHOTO_LABEL = 720;
75 const int W_RIGHT_MORE_ICON_MARGIN = 24;
76 const int W_MORE_LABEL = 466;
77 const int H_MORE_LABEL = 162;
78 const int W_MORE_ICON = 70;
80 static const wchar_t* IDC_CONF_CALL_MORE_BUTTON = L"IDC_CONF_CALL_MORE_BUTTON";
81 static const wchar_t* IDC_HOLD_BUTTON = L"IDC_HOLD_BUTTON";
82 static const wchar_t* IDC_SWAP_BUTTON = L"IDC_SWAP_BUTTON";
83 static const wchar_t* IDC_HOLD_LABEL = L"IDC_HOLD_LABEL";
84 static const wchar_t* IDC_TEXTBOX = L"IDC_NUM_EDITFIELD";
85 static const wchar_t* IDC_CALLER1_LABEL = L"IDC_CALLER1_LABEL";
86 static const wchar_t* IDC_BACKGROUND_LABEL = L"IDC_BACKGROUND_LABEL";
87 static const wchar_t* IDC_CALLER1_TIME_LABEL = L"IDC_CALLER1_TIME_LABEL";
88 static const wchar_t* IDC_NUMBER1_LABEL = L"IDC_NUMBER1_LABEL";
89 static const wchar_t* IDC_VOICE_CALL_ICON_LABEL = L"IDC_VOICE_CALL_ICON_LABEL";
90 static const wchar_t* IDC_CALLER2_LABEL = L"IDC_CALLER2_LABEL";
91 static const wchar_t* IDC_NUMBER2_LABEL = L"IDC_NUMBER2_LABEL";
92 static const wchar_t* IDC_CALLER2_TIME_LABEL = L"IDC_CALLER2_TIME_LABEL";
93 static const wchar_t* IDC_SWAP_LABEL = L"IDC_SWAP_LABEL";
94 static const wchar_t* IDC_BACKGROUND_LABEL2 = L"IDC_BACKGROUND_LABEL2";
95 static const wchar_t* IDC_PARTICIPANTS_LABEL = L"IDC_PARTICIPANTS_LABEL";
96 static const wchar_t* IDC_CALLER1_BIGPHOTO_LABEL = L"IDC_CALLER1_BIGPHOTO_LABEL";
97 static const wchar_t* IDC_CALLER2_PHOTO_LABEL = L"IDC_CALLER2_PHOTO_LABEL";
98 static const wchar_t* IDC_CALLER1_PHOTO_LABEL = L"IDC_CALLER1_PHOTO_LABEL";
99 static const wchar_t* IDC_KEY_BG_LABEL = L"IDC_KEY_BG_LABEL";
100 static const wchar_t* IDC_DTMF_KEY_BG_LABEL = L"IDC_DTMF_KEY_BG_LABEL";
102 ActiveCallForm::ActiveCallForm(FormType formType)
105 __pActiveCallTimer = null;
106 __pCallButtonsPanel = null;
107 __pDTMFKeypad = null;
108 __pMoreOptionsList = null;
109 __pMoreOptionsListAnchor = null;
110 __pSmallPhotoLabel = null;
111 __pActiveCallInfo = null;
112 __pHeldCallInfo = null;
113 __isSwapInProgress = false;
114 __isCallStateInProgress = false;
115 __isConfCallStateInProgress = false;
116 __pAddressbook = null;
119 ActiveCallForm::~ActiveCallForm(void)
121 if (__pActiveCallTimer != null)
123 __pActiveCallTimer->Cancel();
124 delete __pActiveCallTimer;
126 if (__pMoreOptionsList != null)
128 __pMoreOptionsList = null;
130 if (__pMoreOptionsListAnchor != null)
132 __pMoreOptionsListAnchor = null;
134 if (__pSmallPhotoLabel != null)
136 __pSmallPhotoLabel = null;
138 if (__pActiveCallInfo != null)
140 delete __pActiveCallInfo;
142 if (__pHeldCallInfo != null)
144 delete __pHeldCallInfo;
146 if(__pDTMFKeypad != null)
148 __pDTMFKeypad = null;
153 ActiveCallForm::Initialize(void)
157 case FORMTYPE_OUTGOINGCALL:
158 Construct(IDL_OUTCALL_FORM);
161 case FORMTYPE_EMERGENCYOUTGOINGCALL:
162 Construct(IDL_OUT_EMERGENCYCALL_FORM);
165 case FORMTYPE_ACTIVECALL:
166 Construct(IDL_CALL_FORM);
169 case FORMTYPE_EMERGENCYACTIVECALL:
170 Construct(IDL_EMERGENCY_CALL_FORM);
173 case FORMTYPE_MULTIPLECALLS:
174 Construct(IDL_MULTIPLE_CALL_FORM);
177 case FORMTYPE_ACTIVECONFCALL:
178 Construct(IDL_CONFCALL_FORM);
187 ActiveCallForm::OnInitializing(void)
189 result r = E_SUCCESS;
191 //Hold Button - Shown on single active/conf call scene
192 InitializeHoldButton();
193 //Swap button for multiple call screen
194 InitializeSwapButton();
195 //Initialize manage conf. call list form
196 InitializeManageConfCallButton();
197 __pCallPresentor = CallPresentationModel::GetInstance();
202 ActiveCallForm::ShowDTMFKeypad(void)
204 EditField* pTextBox = static_cast<EditField*>(__pDTMFKeypad->GetControl(IDC_TEXTBOX));
205 __pDTMFKeypad->SetShowState(true);
206 __pDTMFKeypad->Draw(true);
207 __pDTMFKeypad->Show();
208 pTextBox->SetPropagatedKeyEventListener(this);
209 pTextBox->SetFocus();
213 ActiveCallForm::OnOrientationChanged(const Tizen::Ui::Control& source, Tizen::Ui::OrientationStatus orientationStatus)
217 if (__pCallButtonsPanel != null)
219 //update position of call buttons panel
220 Label* pKeysBgLbl = static_cast<Label*>(GetControl(IDC_KEY_BG_LABEL, true));
221 __pCallButtonsPanel->SetBounds(pKeysBgLbl->GetBounds());
223 //bring button on top
224 __pCallButtonsPanel->SetButtonPosition();
226 RelativeLayout* pRelativeLayout = dynamic_cast<RelativeLayout*>(GetPortraitLayoutN());
227 if (pRelativeLayout != null)
229 pRelativeLayout->SetRelation(*__pCallButtonsPanel, *pKeysBgLbl, RECT_EDGE_RELATION_BOTTOM_TO_BOTTOM);
232 pRelativeLayout = dynamic_cast<RelativeLayout*>(GetLandscapeLayoutN());
233 if (pRelativeLayout != null)
235 pRelativeLayout->SetRelation(*__pCallButtonsPanel, *pKeysBgLbl, RECT_EDGE_RELATION_LEFT_TO_LEFT);
236 pRelativeLayout->SetRelation(*__pCallButtonsPanel, *pKeysBgLbl, RECT_EDGE_RELATION_RIGHT_TO_RIGHT);
239 //change orientation of DTMF Keypad, if it is visible.
240 if(__pDTMFKeypad != null)
242 Rectangle rect(0, 0, 0, 0);
243 if (orientationStatus == ORIENTATION_STATUS_LANDSCAPE || orientationStatus == ORIENTATION_STATUS_LANDSCAPE_REVERSE)
245 rect.height = GetClientAreaBounds().height;
246 rect.width = GetClientAreaBounds().width - __pCallButtonsPanel->GetWidth();
248 else if (orientationStatus == ORIENTATION_STATUS_PORTRAIT || orientationStatus == ORIENTATION_STATUS_PORTRAIT_REVERSE)
250 rect.width = GetClientAreaBounds().width;
251 rect.height = GetClientAreaBounds().height - __pCallButtonsPanel->GetHeight();
253 __pDTMFKeypad->SetBounds(rect);
254 RelativeLayout* pRelativeLayout = dynamic_cast<RelativeLayout*>(GetLandscapeLayoutN());
255 if (pRelativeLayout != null)
257 pRelativeLayout->SetRelation(*__pDTMFKeypad, this, RECT_EDGE_RELATION_LEFT_TO_LEFT);
258 pRelativeLayout->SetRelation(*__pDTMFKeypad, __pCallButtonsPanel, RECT_EDGE_RELATION_RIGHT_TO_LEFT);
259 pRelativeLayout->Update();
260 delete pRelativeLayout;
262 pRelativeLayout = dynamic_cast<RelativeLayout*>(GetPortraitLayoutN());
263 if (pRelativeLayout != null)
265 pRelativeLayout->SetRelation(*__pDTMFKeypad, this, RECT_EDGE_RELATION_LEFT_TO_LEFT);
266 pRelativeLayout->SetRelation(*__pDTMFKeypad, __pCallButtonsPanel, RECT_EDGE_RELATION_BOTTOM_TO_TOP);
267 pRelativeLayout->Update();
268 delete pRelativeLayout;
270 __pDTMFKeypad->setKeysPanelBounds();
271 __pDTMFKeypad->InvalidateBounds(rect);
272 __pDTMFKeypad->Invalidate(true);
278 //change orientation of DTMF Keypad, if it is visible.
279 if (__pDTMFKeypad != null && __pDTMFKeypad->GetShowState() == true)
281 if (orientationStatus == ORIENTATION_STATUS_LANDSCAPE || orientationStatus == ORIENTATION_STATUS_LANDSCAPE_REVERSE)
283 //in landscape mode, caller info is visible.
284 SetShowStateOnKeypad(true);
285 //Hide few labels and buttons in landscape mode when DTMF keypad is shown
286 SetShowStateOnKeypadLandscape(false);
287 SetHoldButtonShowState(false);
289 else if (orientationStatus == ORIENTATION_STATUS_PORTRAIT || orientationStatus == ORIENTATION_STATUS_PORTRAIT_REVERSE)
291 //in Portrait mode it is hidden beneath DTMF Keypad.
292 SetShowStateOnKeypad(false);
293 DestroyMoreOptionsMenuList();
297 //More option is displayed recreate it
298 if(__pMoreOptionsListAnchor != null)
300 CreateMoreOptionsMenuList();
301 CreateMoreOptionsMenuList();
308 ActiveCallForm::UpdateCallerPhoto()
310 IListT<AppCallInfo>* activeCallsList = __pCallPresentor->GetCallListN();
311 if(activeCallsList != null && activeCallsList->GetCount() > 1)
313 for (int index = 0; index < activeCallsList->GetCount(); index++)
316 AppCallInfo callInfo;
317 activeCallsList->GetAt(index, callInfo);
320 if(callInfo.GetContactNumber().IsEmpty() == false)
322 contactNo.Append(callInfo.GetContactNumber());
326 contactNo.Append(AppUtility::GetResourceString(IDS_NUMBER_UNKNOWN));
329 if (callInfo.IsOnHold() == false)
331 AppCallInfo* activeCallInfo;
332 activeCallInfo = new (std::nothrow) AppCallInfo();
333 *activeCallInfo = callInfo;
335 if (activeCallInfo->IsConferenceCall() == false)
338 ShowPersonDetails(contactNo, IDC_NUMBER1_LABEL, IDC_CALLER1_LABEL, false,activeCallInfo);
339 delete activeCallInfo;
344 Bitmap* pPhotoBitmap = AppUtility::GetBitmapFromResourcesN(IDB_CONFERENCE_BG_ICON,W_CONFERENCE_PHOTO,H_CONFERENCE_PHOTO);
345 if (pPhotoBitmap != null)
347 Label* pPhotoLbl = static_cast<Label*>(GetControl(IDC_CALLER1_PHOTO_LABEL));
350 pPhotoLbl->SetBackgroundBitmap(*pPhotoBitmap);
351 pPhotoLbl->Invalidate(true);
359 AppCallInfo* heldCallInfo;
360 heldCallInfo = new (std::nothrow) AppCallInfo();
361 *heldCallInfo = callInfo;
363 if (heldCallInfo->IsConferenceCall() == false)
365 ShowPersonDetails(contactNo, IDC_NUMBER2_LABEL, IDC_CALLER2_LABEL, true, heldCallInfo);
370 Bitmap* pPhotoBitmap = AppUtility::GetBitmapFromResourcesN(IDB_CONFERENCE_BG_ICON,W_CONFERENCE_PHOTO,H_CONFERENCE_PHOTO);
371 if (pPhotoBitmap != null)
373 Label* pPhotoLbl = static_cast<Label*>(GetControl(IDC_CALLER2_PHOTO_LABEL));
376 pPhotoLbl->SetBackgroundBitmap(*pPhotoBitmap);
377 pPhotoLbl->Invalidate(true);
387 if(__pActiveCallInfo != null)
389 Bitmap* pPhotoBitmap = __pActiveCallInfo->FetchLatestCallerPhotoN(__pActiveCallInfo->GetContactNumber());
390 ShowCallerPhoto(pPhotoBitmap, false);
395 delete activeCallsList;
396 activeCallsList = null;
400 ActiveCallForm::HideDTMFKeypad(void)
402 if(__pDTMFKeypad != null)
404 EditField* pTextBox = static_cast<EditField*>(__pDTMFKeypad->GetControl(IDC_TEXTBOX));
405 __DtmfString = pTextBox->GetText();
406 __pDTMFKeypad->SetShowState(false);
407 pTextBox->SetPropagatedKeyEventListener(null);
412 ActiveCallForm::InitializeCallButtonsPanel(void)
414 result r = E_SUCCESS;
415 //Set background bitmap for call keypad
416 Label* pKeysBgLbl = static_cast<Label*>(GetControl(IDC_KEY_BG_LABEL, true));
417 Bitmap* pBgBitmap = AppUtility::GetBitmapFromResourcesN(IDB_BACKGROUND_BITMAP, pKeysBgLbl->GetWidth(), pKeysBgLbl->GetHeight());
418 if (pBgBitmap != null)
420 pKeysBgLbl->SetBackgroundBitmap(*pBgBitmap);
423 if (__pCallButtonsPanel == null)
425 __pCallButtonsPanel = new (std::nothrow) CallButtonsPanel();
426 __pCallButtonsPanel->ConstructPanel(this, __formType);
427 __pCallButtonsPanel->SetBounds(pKeysBgLbl->GetBounds());
428 r = AddControl(__pCallButtonsPanel);
431 RelativeLayout* pRelativeLayout = dynamic_cast<RelativeLayout*>(GetPortraitLayoutN());
432 if (pRelativeLayout != null)
434 pRelativeLayout->SetRelation(*__pCallButtonsPanel, *pKeysBgLbl, RECT_EDGE_RELATION_BOTTOM_TO_BOTTOM);
436 pRelativeLayout = dynamic_cast<RelativeLayout*>(GetLandscapeLayoutN());
437 if (pRelativeLayout != null)
439 pRelativeLayout->SetRelation(*__pCallButtonsPanel, *pKeysBgLbl, RECT_EDGE_RELATION_LEFT_TO_LEFT);
440 pRelativeLayout->SetRelation(*__pCallButtonsPanel, *pKeysBgLbl, RECT_EDGE_RELATION_RIGHT_TO_RIGHT);
441 pRelativeLayout->SetRelation(*__pCallButtonsPanel, *pKeysBgLbl, RECT_EDGE_RELATION_BOTTOM_TO_BOTTOM);
442 pRelativeLayout->SetRelation(*__pCallButtonsPanel, *pKeysBgLbl, RECT_EDGE_RELATION_TOP_TO_TOP);
449 ActiveCallForm::InitializeSwapButton(void)
451 Button* pSwapBtn = static_cast<Button*>(GetControl(IDC_SWAP_BUTTON));
454 Bitmap* pSwapBmp = AppUtility::GetBitmapFromResourcesN(IDB_SWAP_ICON_NORMAL,
455 W_HOLD_BITMAP, H_HOLD_BITMAP);
458 pSwapBtn->SetNormalBitmap(Point(0, 0), *pSwapBmp);
463 pSwapBmp = AppUtility::GetBitmapFromResourcesN(IDB_SWAP_ICON_PRESS,
464 W_HOLD_BITMAP, H_HOLD_BITMAP);
467 pSwapBtn->SetPressedBitmap(Point(0, 0), *pSwapBmp);
471 pSwapBtn->SetActionId(IDA_SWAP_CALLS);
472 pSwapBtn->AddActionEventListener(*this);
477 ActiveCallForm::InitializeManageConfCallButton(void)
479 Button* pMoreBtn = static_cast<Button*>(GetControl(IDC_CONF_CALL_MORE_BUTTON));
480 if (pMoreBtn != null)
482 pMoreBtn->SetActionId(IDA_MORE_OPTIONS_MENU);
483 pMoreBtn->AddActionEventListener(*this);
484 if (__formType == FORMTYPE_MULTIPLECALLS)
486 //Correct state will be set in OnSceneActivated based on the call
487 pMoreBtn->SetShowState(false);
489 else if (__formType == FORMTYPE_ACTIVECONFCALL)
491 pMoreBtn->SetShowState(true);
497 ActiveCallForm::InitializeHoldButton(void)
499 Button* pHoldBtn = static_cast<Button*>(GetControl(IDC_HOLD_BUTTON));
500 if (pHoldBtn != null)
502 //set status of Hold Button
503 SetHoldButtonStatus(true);
504 pHoldBtn->AddActionEventListener(*this);
509 ActiveCallForm::SetHoldButtonStatus(bool toHoldCall)
511 //background bitmap & button name
513 Bitmap* normalImg = null;
514 Bitmap* pressImg = null;
517 btnName.Append(AppUtility::GetResourceString(IDS_HOLD_BTN_NAME));
518 normalImg = AppUtility::GetBitmapFromResourcesN(IDB_HOLD_NORMAL_BUTTON_ICON,
519 W_HOLD_BITMAP, H_HOLD_BITMAP);
520 pressImg = AppUtility::GetBitmapFromResourcesN(IDB_HOLD_PRESS_BUTTON_ICON,
521 W_HOLD_BITMAP, H_HOLD_BITMAP);
525 btnName.Append(AppUtility::GetResourceString(IDS_UNHOLD_BTN_NAME));
526 normalImg = AppUtility::GetBitmapFromResourcesN(IDB_UNHOLD_NORMAL_BUTTON_ICON,
527 W_HOLD_BITMAP, H_HOLD_BITMAP);
528 pressImg = AppUtility::GetBitmapFromResourcesN(IDB_UNHOLD_PRESS_BUTTON_ICON,
529 W_HOLD_BITMAP, H_HOLD_BITMAP);
533 CommandIds cmdId = IDA_HOLD_CALL;
536 case FORMTYPE_ACTIVECALL:
538 cmdId = toHoldCall ? IDA_HOLD_CALL : IDA_UNHOLD_CALL;
542 case FORMTYPE_ACTIVECONFCALL:
544 cmdId = toHoldCall ? IDA_HOLD_CONF_CALL : IDA_UNHOLD_CONF_CALL;
552 //set background bitmap, button name & action id
553 Button* pHoldBtn = static_cast<Button*>(GetControl(IDC_HOLD_BUTTON));
554 Label* pHoldLbl = static_cast<Label*>(GetControl(IDC_HOLD_LABEL));
557 pHoldBtn->SetActionId(cmdId);
558 pHoldBtn->SetNormalBitmap(Point(0, 0),*normalImg);
559 pHoldBtn->SetPressedBitmap(Point(0, 0),*pressImg);
560 pHoldBtn->Invalidate(true);
564 pHoldLbl->SetText(btnName);
565 pHoldLbl->Invalidate(true);
576 ActiveCallForm::CreateMoreOptionsMenuList(void)
578 //create option list anchor
579 if (__pMoreOptionsListAnchor == null)
581 Bitmap* pBgPopupArwBmp = AppUtility::GetBitmapFromResourcesN(IDB_POPUP_ARROW_ICON, W_OPTION_ANCHOR,
583 __pMoreOptionsListAnchor = new (std::nothrow) Label();
584 __pMoreOptionsListAnchor->Construct(Rectangle(GetWidth()-W_RIGHT_MORE_ICON_MARGIN - W_MORE_ICON, Y_POPUP_ANCHOR, W_POPUP_ANCHOR, H_POPUP_ANCHOR), L"");
585 __pMoreOptionsListAnchor->SetBackgroundBitmap(*pBgPopupArwBmp);
587 delete pBgPopupArwBmp;
588 pBgPopupArwBmp = null;
590 // Adds a Label to the Form
591 AddControl(__pMoreOptionsListAnchor);
594 //create options menu list
595 if (__pMoreOptionsList == null)
597 __pMoreOptionsList = new (std::nothrow) ListView();
598 __pMoreOptionsList->Construct(Rectangle(Point(GetWidth()-W_RIGHT_MORE_ICON_MARGIN - W_MORE_LABEL,H_MORE_LABEL), IDI_OPTIONMENU_DIMEN), false, SCROLL_STYLE_FADE_OUT);
599 __pMoreOptionsList->SetItemProvider(*this);
600 __pMoreOptionsList->AddListViewItemEventListener(*this);
601 //Add option list to the form
602 AddControl(__pMoreOptionsList);
606 //Hide option menu list
607 DestroyMoreOptionsMenuList();
612 ActiveCallForm::DestroyMoreOptionsMenuList(void)
614 if (__pMoreOptionsListAnchor != null)
616 //removes and delete the child control
617 //Commented this for the bug N_SE-52426 and added SetShowState(false) below
618 //RemoveControl(__pMoreOptionsListAnchor);
619 __pMoreOptionsListAnchor->SetShowState(false);
620 __pMoreOptionsListAnchor = null;
623 if (__pMoreOptionsList != null)
625 //removes and delete the child control
626 //Commented this for the bug N_SE-52426 and added SetShowState(false) below
627 //RemoveControl(__pMoreOptionsList);
628 __pMoreOptionsList->SetShowState(false);
629 __pMoreOptionsList = null;
634 ActiveCallForm::OnTerminating(void)
636 result r = E_SUCCESS;
637 if (__pCallPresentor != null)
639 __pCallPresentor = null;
641 if(__pDTMFKeypad != null)
643 __pDTMFKeypad = null;
649 ActiveCallForm::OnActionPerformed(const Control& source, int actionId)
657 //End the currently active / dialing call
658 if (__pActiveCallInfo != null && __pActiveCallInfo->IsConferenceCall() == false)
660 String activeContactNo;
661 activeContactNo.Append(__pActiveCallInfo->GetContactNumber());
662 //Check if it is call is in dialing state, then
663 if (__formType == FORMTYPE_EMERGENCYOUTGOINGCALL || __formType == FORMTYPE_OUTGOINGCALL)
665 __pCallPresentor->EndDialingCall(activeContactNo);
670 __pCallPresentor->EndActiveCall(*__pActiveCallInfo->GetCallHandle());
675 __pCallPresentor->EndConferenceCall();
680 case IDA_END_CONF_CALL:
682 AppAssert(__formType == FORMTYPE_ACTIVECONFCALL);
683 __pCallPresentor->EndConferenceCall();
687 case IDA_OPEN_NUMKEYPAD:
689 if(__pDTMFKeypad != null)
691 Rectangle rect(0, 0, 0, 0);
692 if (GetOrientationStatus() == ORIENTATION_STATUS_LANDSCAPE || GetOrientationStatus() == ORIENTATION_STATUS_LANDSCAPE_REVERSE)
694 rect.height = GetClientAreaBounds().height;
695 rect.width = GetClientAreaBounds().width - __pCallButtonsPanel->GetWidth();
697 else if (GetOrientationStatus() == ORIENTATION_STATUS_PORTRAIT || GetOrientationStatus() == ORIENTATION_STATUS_PORTRAIT_REVERSE)
699 rect.width = GetClientAreaBounds().width;
700 rect.height = GetClientAreaBounds().height - __pCallButtonsPanel->GetHeight();
702 __pDTMFKeypad->SetBounds(rect);
703 RelativeLayout* pRelativeLayout = dynamic_cast<RelativeLayout*>(GetLandscapeLayoutN());
704 if (pRelativeLayout != null)
706 pRelativeLayout->SetRelation(*__pDTMFKeypad, this, RECT_EDGE_RELATION_LEFT_TO_LEFT);
707 pRelativeLayout->SetRelation(*__pDTMFKeypad, __pCallButtonsPanel, RECT_EDGE_RELATION_RIGHT_TO_LEFT);
708 pRelativeLayout->Update();
709 delete pRelativeLayout;
711 pRelativeLayout = dynamic_cast<RelativeLayout*>(GetPortraitLayoutN());
712 if (pRelativeLayout != null)
714 pRelativeLayout->SetRelation(*__pDTMFKeypad, this, RECT_EDGE_RELATION_LEFT_TO_LEFT);
715 pRelativeLayout->SetRelation(*__pDTMFKeypad, __pCallButtonsPanel, RECT_EDGE_RELATION_BOTTOM_TO_TOP);
716 pRelativeLayout->Update();
717 delete pRelativeLayout;
719 __pDTMFKeypad->setKeysPanelBounds();
720 __pDTMFKeypad->InvalidateBounds(rect);
721 __pDTMFKeypad->Invalidate(true);
727 if (GetOrientationStatus() == ORIENTATION_STATUS_PORTRAIT || GetOrientationStatus() == ORIENTATION_STATUS_PORTRAIT_REVERSE)
729 //hide only in portrait mode.
730 SetShowStateOnKeypad(false);
731 DestroyMoreOptionsMenuList();
733 if (GetOrientationStatus() == ORIENTATION_STATUS_LANDSCAPE || GetOrientationStatus() == ORIENTATION_STATUS_LANDSCAPE_REVERSE)
735 SetShowStateOnKeypadLandscape(false);
738 //Hide the hold button as it goes behind DTMF keypad
739 SetHoldButtonShowState(false);
741 __pCallButtonsPanel->SetKeypadButtonState(IDA_CLOSE_NUMKEYPAD);
745 case IDA_CLOSE_NUMKEYPAD:
747 if (GetOrientationStatus() == ORIENTATION_STATUS_PORTRAIT || GetOrientationStatus() == ORIENTATION_STATUS_PORTRAIT_REVERSE)
749 SetShowStateOnKeypad(true);
751 if (GetOrientationStatus() == ORIENTATION_STATUS_LANDSCAPE || GetOrientationStatus() == ORIENTATION_STATUS_LANDSCAPE_REVERSE)
753 SetShowStateOnKeypadLandscape(true);
756 __pCallButtonsPanel->SetKeypadButtonState(IDA_OPEN_NUMKEYPAD);
762 //switch to Dialer Form to make an call
763 if(__pCallPresentor->GetCurrentCallCount() == 1)
765 __pCallPresentor->LaunchDialAppControl();
773 if (__pActiveCallInfo->IsConferenceCall() == false)
775 if(__pActiveCallInfo->GetCallHandle() != null)
777 if(IsCallStateInProgress() == false)
779 success = __pCallPresentor->HoldCall(*__pActiveCallInfo->GetCallHandle());
780 SetCallStateInProgress(true);
786 success = __pCallPresentor->HoldConferenceCall();
791 case IDA_UNHOLD_CALL:
793 bool success = false;
794 if (__pActiveCallInfo->IsConferenceCall() == false)
796 if(__pActiveCallInfo->GetCallHandle() != null)
798 if(IsCallStateInProgress() == false)
800 success = __pCallPresentor->UnHoldCall(*__pActiveCallInfo->GetCallHandle());
801 SetCallStateInProgress(true);
807 success = __pCallPresentor->ActivateConferenceCall();
812 case IDA_HOLD_CONF_CALL:
814 AppAssert(__formType == FORMTYPE_ACTIVECONFCALL);
815 if(IsConfCallStateInProgress() == false)
817 bool success = __pCallPresentor->HoldConferenceCall();
818 SetConfCallStateInProgress(true);
823 case IDA_UNHOLD_CONF_CALL:
825 AppAssert(__formType == FORMTYPE_ACTIVECONFCALL);
826 if(IsConfCallStateInProgress() == false)
828 bool success = __pCallPresentor->ActivateConferenceCall();
829 SetConfCallStateInProgress(true);
834 case IDA_OPEN_CONTACTS:
837 //Launch call application
838 AppManager* pAppManager = AppManager::GetInstance();
839 pAppManager->LaunchApplication(PROVIDER_ID_CONTACTS);
845 bool success = __pCallPresentor->SetMuteStatus(true);
848 __pCallButtonsPanel->SetMuteButtonState(IDA_UNMUTE);
855 bool success = __pCallPresentor->SetMuteStatus(false);
858 __pCallButtonsPanel->SetMuteButtonState(IDA_MUTE);
865 bool success = __pCallPresentor->SetSpeakerStatus(true);
868 __pCallButtonsPanel->SetSpeakerButtonState(IDA_SPEAKER_OFF);
873 case IDA_SPEAKER_OFF:
875 bool success = __pCallPresentor->SetSpeakerStatus(false);
878 __pCallButtonsPanel->SetSpeakerButtonState(IDA_SPEAKER);
885 AppAssert(__formType == FORMTYPE_MULTIPLECALLS);
886 __pCallPresentor->JoinCall();
892 if(IsSwapInProgress() == false)
894 AppAssert(__formType == FORMTYPE_MULTIPLECALLS);
895 __pCallPresentor->SwapCalls();
896 SetSwapInProgress(true);
901 case IDA_MORE_OPTIONS_MENU:
903 //Show 'more' options menu
904 CreateMoreOptionsMenuList();
910 dtmfString.Append(L"0");
911 SetTextToDTMFTextField(dtmfString);
912 __pCallPresentor->SendDTMFSignal(dtmfString);
918 dtmfString.Append(L"1");
919 SetTextToDTMFTextField(dtmfString);
920 __pCallPresentor->SendDTMFSignal(dtmfString);
926 dtmfString.Append(L"2");
927 SetTextToDTMFTextField(dtmfString);
928 __pCallPresentor->SendDTMFSignal(dtmfString);
934 dtmfString.Append(L"3");
935 SetTextToDTMFTextField(dtmfString);
936 __pCallPresentor->SendDTMFSignal(dtmfString);
942 dtmfString.Append(L"4");
943 SetTextToDTMFTextField(dtmfString);
944 __pCallPresentor->SendDTMFSignal(dtmfString);
950 dtmfString.Append(L"5");
951 SetTextToDTMFTextField(dtmfString);
952 __pCallPresentor->SendDTMFSignal(dtmfString);
958 dtmfString.Append(L"6");
959 SetTextToDTMFTextField(dtmfString);
960 __pCallPresentor->SendDTMFSignal(dtmfString);
966 dtmfString.Append(L"7");
967 SetTextToDTMFTextField(dtmfString);
968 __pCallPresentor->SendDTMFSignal(dtmfString);
974 dtmfString.Append(L"8");
975 SetTextToDTMFTextField(dtmfString);
976 __pCallPresentor->SendDTMFSignal(dtmfString);
982 dtmfString.Append(L"9");
983 SetTextToDTMFTextField(dtmfString);
984 __pCallPresentor->SendDTMFSignal(dtmfString);
990 dtmfString.Append(L"*");
991 SetTextToDTMFTextField(dtmfString);
992 __pCallPresentor->SendDTMFSignal(dtmfString);
998 dtmfString.Append(L"#");
999 SetTextToDTMFTextField(dtmfString);
1000 __pCallPresentor->SendDTMFSignal(dtmfString);
1010 ActiveCallForm::IsConfCallStateInProgress(void)
1012 return __isConfCallStateInProgress;
1017 ActiveCallForm::IsCallStateInProgress(void)
1019 return __isCallStateInProgress;
1023 ActiveCallForm::IsSwapInProgress(void)
1025 return __isSwapInProgress;
1030 ActiveCallForm::OnActiveTelephonyCallback(bool isActive)
1032 AppLogDebug("Enter");
1033 //reset hold status and show call timer
1034 ShowTimerInfo(IDC_CALLER1_TIME_LABEL, !isActive, __activeCallStartTime);
1035 SetHoldButtonStatus(isActive);
1036 SetCallStateInProgress(false);
1040 ActiveCallForm::OnHoldTelephonyCallback(bool isHeld)
1042 AppLogDebug("Enter");
1043 //reset hold status and "OnHold" text
1044 ShowTimerInfo(IDC_CALLER1_TIME_LABEL, isHeld);
1045 if(__pActiveCallTimer != null)
1047 __pActiveCallTimer->Cancel();
1049 SetHoldButtonStatus(!isHeld);
1050 SetCallStateInProgress(false);
1054 ActiveCallForm::SetConfCallStateInProgress(bool progress)
1056 __isConfCallStateInProgress = progress;
1060 ActiveCallForm::SetCallStateInProgress(bool progress)
1062 __isCallStateInProgress = progress;
1066 ActiveCallForm::SetSwapInProgress(bool progress)
1068 __isSwapInProgress = progress;
1072 ActiveCallForm::SetTextToDTMFTextField(const String& dtmfStr)
1074 if(__pDTMFKeypad != null)
1076 EditField* pTextBox = static_cast<EditField*>(__pDTMFKeypad->GetControl(IDC_TEXTBOX));
1078 int startpos=-1,endpos=-1;
1079 pTextBox->GetBlockRange(startpos,endpos);
1083 pTextBox->ReleaseBlock();
1086 pTextBox->InsertTextAtCursorPosition(dtmfStr);
1087 //pTextBox->AppendText(dtmfStr);
1088 // pTextBox->SetFocus();
1089 pTextBox->Invalidate(true);
1094 ActiveCallForm::OnSceneActivatedN(const SceneId& previousSceneId, const SceneId& currentSceneId, IList* pArgs)
1097 //set itself as listener
1098 __pCallPresentor->SetTelEventListener(this);
1099 AddOrientationEventListener(*this);
1101 CallApp* pPhoneApp = static_cast<CallApp*>(CallApp::GetInstance());
1102 pPhoneApp->AddAppStateChangeListener(*this);
1104 //Initialize keypad and buttons
1105 InitializeCallButtonsPanel();
1107 if(__pDTMFKeypad == null)
1109 Rectangle rect(0, 0, 0, 0);
1110 if (GetOrientationStatus() == ORIENTATION_STATUS_PORTRAIT || GetOrientationStatus() == ORIENTATION_STATUS_PORTRAIT_REVERSE)
1112 rect.width = GetClientAreaBounds().width;
1113 rect.height = GetClientAreaBounds().height - __pCallButtonsPanel->GetHeight();
1115 else if (GetOrientationStatus() == ORIENTATION_STATUS_LANDSCAPE || GetOrientationStatus() == ORIENTATION_STATUS_LANDSCAPE_REVERSE)
1117 rect.height = GetClientAreaBounds().height;
1118 rect.width = GetClientAreaBounds().width - __pCallButtonsPanel->GetWidth();
1121 AppLog("DTMF Keypad rect(%d,%d,%d,%d)",rect.x,rect.y,rect.width,rect.height);
1122 __pDTMFKeypad = new (std::nothrow) DtmfKeyPadPanel();
1123 __pDTMFKeypad->Initialize(this, rect);
1124 //set layout relation w.r.t call buttons panel
1125 RelativeLayout* pRelativeLayout = dynamic_cast<RelativeLayout*>(GetLandscapeLayoutN());
1126 if (pRelativeLayout != null)
1128 pRelativeLayout->SetRelation(*__pDTMFKeypad, this, RECT_EDGE_RELATION_LEFT_TO_LEFT);
1129 pRelativeLayout->SetRelation(*__pDTMFKeypad, __pCallButtonsPanel, RECT_EDGE_RELATION_RIGHT_TO_LEFT);
1131 AddControl(__pDTMFKeypad);
1134 AddressbookManager* pAddressbookManager = AddressbookManager::GetInstance();
1135 __pAddressbook = pAddressbookManager->GetAddressbookN(DEFAULT_ADDRESSBOOK_ID);
1136 if(__pAddressbook != null)
1138 __pAddressbook->SetAddressbookChangeEventListener(this);
1142 if (__pActiveCallInfo != null)
1144 delete __pActiveCallInfo;
1145 __pActiveCallInfo = null;
1147 if (__pHeldCallInfo != null)
1149 delete __pHeldCallInfo;
1150 __pHeldCallInfo = null;
1152 DestroyMoreOptionsMenuList();
1156 case FORMTYPE_OUTGOINGCALL:
1159 contactNo.Append(*(static_cast<String*>(pArgs->GetAt(0))));
1160 __pActiveCallInfo = new (std::nothrow) AppCallInfo();
1161 __pActiveCallInfo->SetContactNumber(contactNo);
1162 Contact* pContact = __pCallPresentor->GetContactN(contactNo);
1163 if (pContact != null)
1165 __pActiveCallInfo->SetContactInfo(*pContact);
1168 ShowPersonDetails(contactNo, IDC_NUMBER1_LABEL, IDC_CALLER1_LABEL, false,__pActiveCallInfo);
1169 //make an normal outgoing call
1170 __pCallPresentor->DialCall(contactNo, false);
1171 if (__pCallPresentor->IsAppControlRunning() == true)
1173 __pCallPresentor->AbortAppControlRequest();
1178 case FORMTYPE_EMERGENCYOUTGOINGCALL:
1180 String* pContactNo = static_cast<String*>(pArgs->GetAt(0));
1181 __pActiveCallInfo = new (std::nothrow) AppCallInfo();
1182 long long phNumber = 0;
1183 LongLong::Parse(*pContactNo, phNumber);
1184 __pActiveCallInfo->SetContactNumber(*pContactNo);
1185 //make an emergency call
1186 __pCallPresentor->DialCall(*pContactNo, true);
1190 case FORMTYPE_ACTIVECALL:
1192 //get contact number
1193 AppCallInfo* pCall = static_cast<AppCallInfo*>(pArgs->GetAt(0));
1195 __pActiveCallInfo = new (std::nothrow) AppCallInfo();
1196 *__pActiveCallInfo = *pCall;
1197 String activeContactNo;
1198 if(pCall->GetContactNumber().IsEmpty() == false)
1200 activeContactNo.Append(pCall->GetContactNumber());
1204 activeContactNo.Append(AppUtility::GetResourceString(IDS_NUMBER_UNKNOWN));
1206 ShowPersonDetails(activeContactNo, IDC_NUMBER1_LABEL, IDC_CALLER1_LABEL, false,__pActiveCallInfo);
1207 //show call active time using Timer
1208 //__activeCallStartTime = pCall->GetCallConnectTime();
1209 __activeCallStartTime = pCall->GetDurationTime();
1210 ShowTimerInfo(IDC_CALLER1_TIME_LABEL, pCall->IsOnHold(), __activeCallStartTime);
1214 case FORMTYPE_EMERGENCYACTIVECALL:
1216 //get contact number
1217 AppCallInfo* pCall = static_cast<AppCallInfo*>(pArgs->GetAt(0));
1219 __pActiveCallInfo = new (std::nothrow) AppCallInfo();
1220 *__pActiveCallInfo = *pCall;
1222 //show call active time using Timer
1223 //__activeCallStartTime = pCall->GetCallConnectTime();
1224 __activeCallStartTime = pCall->GetDurationTime();
1225 ShowTimerInfo(IDC_CALLER1_TIME_LABEL, pCall->IsOnHold(), __activeCallStartTime);
1229 case FORMTYPE_MULTIPLECALLS:
1231 IListT<AppCallInfo>* pCallsList = __pCallPresentor->GetCallListN();
1232 //update calls state
1233 UpdateMultipleCallScreen(*pCallsList);
1239 case FORMTYPE_ACTIVECONFCALL:
1242 AppCallInfo* pConfInfo = static_cast<AppCallInfo*>(pArgs->GetAt(0));
1243 __pActiveCallInfo = new (std::nothrow) AppCallInfo();
1244 *__pActiveCallInfo = *pConfInfo;
1246 int participantsCount = __pActiveCallInfo->GetCallerListCount();
1248 // show participant count on name Label
1249 Label* pPeopleCountLbl = static_cast<Label*>(GetControl(IDC_PARTICIPANTS_LABEL));
1250 if (pPeopleCountLbl)
1253 count.Append(participantsCount);
1255 count.Append(AppUtility::GetResourceString(IDS_PEOPLE_STR));
1256 pPeopleCountLbl->SetText(count);
1259 if(participantsCount >= IDI_MAX_CONF_CALL_PARTICIPANTS)
1261 __pCallButtonsPanel->EnableAddCallButton(false);
1265 __pCallButtonsPanel->EnableAddCallButton(true);
1269 //bring button on top
1270 __pCallButtonsPanel->SetButtonPosition();
1273 //show call active time using Timer
1274 //__activeCallStartTime = __pActiveCallInfo->GetCallConnectTime();
1275 __activeCallStartTime = __pActiveCallInfo->GetDurationTime();
1276 ShowTimerInfo(IDC_CALLER1_TIME_LABEL, __pActiveCallInfo->IsOnHold(),__activeCallStartTime);
1284 if(__formType == FORMTYPE_ACTIVECALL || __formType == FORMTYPE_EMERGENCYACTIVECALL ||
1285 __formType == FORMTYPE_MULTIPLECALLS || __formType == FORMTYPE_ACTIVECONFCALL)
1287 //Unlock the phone if its locked
1288 if(LockManager::GetInstance()->IsLocked())
1290 AppLogDebug("Phone Locked");
1291 LockManager::GetInstance()->Unlock();
1295 //Hide DTMFKeypad, if visible and show caller info
1297 SetShowStateOnKeypad(true);
1298 SetShowStateOnKeypadLandscape(true);
1299 __pCallButtonsPanel->SetKeypadButtonState(IDA_OPEN_NUMKEYPAD);
1301 //Set the correct speaker status
1302 if(__pCallPresentor->IsSpeakerOn() == true)
1304 __pCallButtonsPanel->SetSpeakerButtonState(IDA_SPEAKER_OFF);
1308 __pCallButtonsPanel->SetSpeakerButtonState(IDA_SPEAKER);
1311 //Set the correct Mute status
1312 if (__pCallPresentor->IsCallMuted() == true)
1314 __pCallButtonsPanel->SetMuteButtonState(IDA_UNMUTE);
1318 __pCallButtonsPanel->SetMuteButtonState(IDA_MUTE);
1328 //update position of call buttons panel
1329 Label* pKeysBgLbl = static_cast<Label*>(GetControl(IDC_KEY_BG_LABEL, true));
1330 __pCallButtonsPanel->SetBounds(pKeysBgLbl->GetBounds());
1332 CallApp* pCallApp = static_cast<CallApp*>(CallApp::GetInstance());
1333 pCallApp->SetTopMostWindow(false);
1337 ActiveCallForm::OnSceneDeactivated(const SceneId& currentSceneId, const SceneId& nextSceneId)
1339 RemoveOrientationEventListener(*this);
1340 if (__pActiveCallTimer != null)
1342 __pActiveCallTimer->Cancel();
1343 delete __pActiveCallTimer;
1344 __pActiveCallTimer = null;
1346 if (__pSmallPhotoLabel != null)
1348 __pSmallPhotoLabel->SetShowState(false);
1350 //Hide "Manage conf. Call" Context menu
1351 if (__pMoreOptionsListAnchor != null)
1353 __pMoreOptionsListAnchor->SetShowState(false);
1355 if (__pMoreOptionsList != null)
1357 __pMoreOptionsList->SetShowState(false);
1359 __DtmfString.Clear();
1361 if(__pDTMFKeypad != null)
1363 __pDTMFKeypad->SetShowState(false);
1366 CallApp* pCallApp = static_cast<CallApp*>(CallApp::GetInstance());
1367 pCallApp->RemoveAppStateChangeListener(*this);
1368 if(__pAddressbook != null)
1370 __pAddressbook->SetAddressbookChangeEventListener(null);
1375 ActiveCallForm::HandleConfCallChanged(void)
1378 AppAssert((__formType == FORMTYPE_ACTIVECONFCALL) || (__formType == FORMTYPE_MULTIPLECALLS));
1379 //fetch changed conference call info
1380 AppCallInfo* pConfCallInfo = __pCallPresentor->GetConferenceCallInfoN();
1381 if (pConfCallInfo == null)
1387 //fetch participant count in conf call
1388 int participantsCount = pConfCallInfo->GetCallerListCount();
1389 //update status of join and Add call
1390 bool isEnableAddCall = false;
1391 bool isEnableJoinCall = false;
1392 if(participantsCount < IDI_MAX_CONF_CALL_PARTICIPANTS)
1394 //available only at Active conf. call or active call screen
1395 isEnableAddCall = true;
1396 //join button is available only at multiple call screen
1397 isEnableJoinCall = true;
1400 Label* pPeopleCountLbl = null;
1401 if (__pActiveCallInfo != null && __pActiveCallInfo->IsConferenceCall() == true)
1403 //Active call is conference call
1404 delete __pActiveCallInfo;
1405 __pActiveCallInfo = new (std::nothrow) AppCallInfo();
1406 *__pActiveCallInfo = *pConfCallInfo;
1408 if (__formType == FORMTYPE_MULTIPLECALLS)
1410 pPeopleCountLbl = static_cast<Label*>(GetControl(IDC_NUMBER1_LABEL));
1412 else if (__formType == FORMTYPE_ACTIVECONFCALL)
1414 pPeopleCountLbl = static_cast<Label*>(GetControl(IDC_PARTICIPANTS_LABEL));
1415 AppLog("Active conf call...(%d)", pPeopleCountLbl);
1418 else if(__pHeldCallInfo != null && __pHeldCallInfo->IsConferenceCall() == true)
1420 //Held call is conference call - this is definitely multiple call screen.
1421 delete __pHeldCallInfo;
1422 __pHeldCallInfo = new (std::nothrow) AppCallInfo();
1423 *__pHeldCallInfo = *pConfCallInfo;
1424 pPeopleCountLbl = static_cast<Label*>(GetControl(IDC_NUMBER2_LABEL));
1427 // update participant count on name Label
1428 if (pPeopleCountLbl != null)
1431 count.Append(participantsCount);
1433 count.Append(AppUtility::GetResourceString(IDS_PEOPLE_STR));
1434 pPeopleCountLbl->SetText(count);
1435 pPeopleCountLbl->Invalidate(true);
1437 //change AddCall Button status
1438 __pCallButtonsPanel->EnableAddCallButton(isEnableAddCall);
1439 //change JoinCall Button status
1440 __pCallButtonsPanel->EnableJoinCallButton(__pCallPresentor->IsEnableJoinCallButton());
1445 ActiveCallForm::OnContactsChanged(const Tizen::Base::Collection::IList& contactChangeInfoList)
1451 case FORMTYPE_OUTGOINGCALL:
1452 case FORMTYPE_ACTIVECALL:
1454 String pContactNumber;
1455 pContactNumber.Append(__pActiveCallInfo->GetContactNumber());
1456 Contact* pContact = __pCallPresentor->GetContactN(__pActiveCallInfo->GetContactNumber());
1457 if(pContact == null)
1459 __pActiveCallInfo->ResetContactNumber(null);
1460 __pActiveCallInfo->ResetContactInfo(null);
1465 __pActiveCallInfo->SetContactNumber(pContactNumber);
1466 __pActiveCallInfo->SetContactInfo(*pContact);
1468 if(pContact != null)
1473 ShowPersonDetails(pContactNumber, IDC_NUMBER1_LABEL, IDC_CALLER1_LABEL, false,__pActiveCallInfo);
1477 case FORMTYPE_EMERGENCYACTIVECALL:
1482 case FORMTYPE_MULTIPLECALLS:
1485 IListT<AppCallInfo>* pCallsList = __pCallPresentor->GetCallListN();
1486 if(pCallsList != null)
1488 int listCount = pCallsList->GetCount();
1489 for(int index = 0; index < listCount; index++)
1491 AppCallInfo callInfo;
1493 pCallsList->GetAt(index, callInfo);
1494 if(__pActiveCallInfo == null)
1496 __pActiveCallInfo = new (std::nothrow) AppCallInfo();
1498 *__pActiveCallInfo = callInfo;
1499 String contactNumber;
1500 contactNumber.Append(__pActiveCallInfo->GetContactNumber());
1501 pContact = __pCallPresentor->GetContactN(__pActiveCallInfo->GetContactNumber());
1502 if(pContact == null)
1504 __pActiveCallInfo->ResetContactNumber(null);
1505 __pActiveCallInfo->ResetContactInfo(null);
1510 __pActiveCallInfo->SetContactNumber(contactNumber);
1511 __pActiveCallInfo->SetContactInfo(*pContact);
1513 if(pContact != null)
1518 if(callInfo.IsConferenceCall() == true)
1522 if(callInfo.IsOnHold() == false)
1524 ShowPersonDetails(contactNumber, IDC_NUMBER1_LABEL, IDC_CALLER1_LABEL, false,__pActiveCallInfo);
1528 ShowPersonDetails(contactNumber, IDC_NUMBER2_LABEL, IDC_CALLER2_LABEL, true,__pActiveCallInfo);
1545 ActiveCallForm::OnCategoriesChanged(const Tizen::Base::Collection::IList& categoryChangeInfoList)
1551 ActiveCallForm::OnConfCallHoldTelephonyCallback(bool isHeld)
1553 //reset hold status and "OnHold" text
1554 SetHoldButtonStatus(!isHeld);
1555 ShowTimerInfo(IDC_CALLER1_TIME_LABEL, isHeld);
1556 if(__pActiveCallTimer != null)
1558 __pActiveCallTimer->Cancel();
1560 SetConfCallStateInProgress(false);
1564 ActiveCallForm::OnConfCallActiveTelephonyCallback(bool isActive)
1566 //reset hold status and show call timer
1567 ShowTimerInfo(IDC_CALLER1_TIME_LABEL, !isActive, __activeCallStartTime);
1568 SetHoldButtonStatus(isActive);
1569 SetConfCallStateInProgress(false);
1574 ActiveCallForm::UpdateMultipleCallScreen(Tizen::Base::Collection::IListT<AppCallInfo>& activeCallsList)
1577 if(__pActiveCallInfo != null)
1579 delete __pActiveCallInfo;
1580 __pActiveCallInfo = null;
1582 if(__pHeldCallInfo != null)
1584 delete __pHeldCallInfo;
1585 __pHeldCallInfo = null;
1588 Button* pMoreBtn = static_cast<Button*>(GetControl(IDC_CONF_CALL_MORE_BUTTON));
1589 if (pMoreBtn != null)
1591 pMoreBtn->SetShowState(false);
1594 //show caller's info.
1595 for (int index = 0; index < activeCallsList.GetCount(); index++)
1598 AppCallInfo callInfo;
1599 activeCallsList.GetAt(index, callInfo);
1602 if(callInfo.GetContactNumber().IsEmpty() == false)
1604 contactNo.Append(callInfo.GetContactNumber());
1608 contactNo.Append(AppUtility::GetResourceString(IDS_NUMBER_UNKNOWN));
1611 if (callInfo.IsOnHold() == false)
1613 __pActiveCallInfo = new (std::nothrow) AppCallInfo();
1614 *__pActiveCallInfo = callInfo;
1616 if (__pActiveCallInfo->IsConferenceCall() == false)
1618 Label* pVoiceIconLbl = static_cast<Label*>(GetControl(IDC_VOICE_CALL_ICON_LABEL));
1621 pVoiceIconLbl->SetShowState(true);
1623 if (pMoreBtn != null)
1625 pMoreBtn->SetShowState(false);
1627 ShowPersonDetails(contactNo, IDC_NUMBER1_LABEL, IDC_CALLER1_LABEL, false,__pActiveCallInfo);
1628 if(__pMoreOptionsListAnchor != null && __pMoreOptionsListAnchor->GetShowState() == true)
1630 CreateMoreOptionsMenuList();
1635 // show participant count on name Label
1636 Label* pPeopleCountLbl = static_cast<Label*>(GetControl(IDC_NUMBER1_LABEL));
1637 if (pPeopleCountLbl)
1640 count.Append(__pActiveCallInfo->GetCallerListCount());
1642 count.Append(AppUtility::GetResourceString(IDS_PEOPLE_STR));
1643 pPeopleCountLbl->SetText(count);
1645 String nameStr = AppUtility::GetResourceString(L"IDS_CONFERENCE_CALL_STRING");
1646 Label* pNameLbl = static_cast<Label*>(GetControl(IDC_CALLER1_LABEL));
1649 pNameLbl->SetText(nameStr);
1651 Label* pVoiceIconLbl = static_cast<Label*>(GetControl(IDC_VOICE_CALL_ICON_LABEL));
1654 pVoiceIconLbl->SetShowState(false);
1656 if (pMoreBtn != null)
1658 pMoreBtn->SetShowState(true);
1660 Bitmap* pPhotoBitmap = AppUtility::GetBitmapFromResourcesN(IDB_CONFERENCE_BG_ICON,W_CONFERENCE_PHOTO,H_CONFERENCE_PHOTO);
1661 if (pPhotoBitmap != null)
1663 Label* pPhotoLbl = static_cast<Label*>(GetControl(IDC_CALLER1_PHOTO_LABEL));
1666 pPhotoLbl->SetBackgroundBitmap(*pPhotoBitmap);
1667 pPhotoLbl->Invalidate(true);
1669 delete pPhotoBitmap;
1672 //show call active time using Timer
1673 //__activeCallStartTime = __pActiveCallInfo->GetCallConnectTime();
1674 __activeCallStartTime = __pActiveCallInfo->GetDurationTime();
1675 ShowTimerInfo(IDC_CALLER1_TIME_LABEL,false,__activeCallStartTime);
1679 __pHeldCallInfo = new (std::nothrow) AppCallInfo();
1680 *__pHeldCallInfo = callInfo;
1682 if (__pHeldCallInfo->IsConferenceCall() == false)
1684 ShowPersonDetails(contactNo, IDC_NUMBER2_LABEL, IDC_CALLER2_LABEL, true,__pHeldCallInfo);
1688 // show participant count on name Label
1689 Label* pPeopleCountLbl = static_cast<Label*>(GetControl(IDC_NUMBER2_LABEL));
1690 if (pPeopleCountLbl)
1693 count.Append(__pHeldCallInfo->GetCallerListCount());
1695 count.Append(AppUtility::GetResourceString(IDS_PEOPLE_STR));
1696 pPeopleCountLbl->SetText(count);
1698 String nameStr = AppUtility::GetResourceString(L"IDS_CONFERENCE_CALL_STRING");
1699 Label* pNameLbl = static_cast<Label*>(GetControl(IDC_CALLER2_LABEL));
1702 pNameLbl->SetText(nameStr);
1704 Bitmap* pPhotoBitmap = AppUtility::GetBitmapFromResourcesN(IDB_CONFERENCE_BG_ICON,W_CONFERENCE_PHOTO,H_CONFERENCE_PHOTO);
1705 if (pPhotoBitmap != null)
1707 Label* pPhotoLbl = static_cast<Label*>(GetControl(IDC_CALLER2_PHOTO_LABEL));
1710 pPhotoLbl->SetBackgroundBitmap(*pPhotoBitmap);
1711 pPhotoLbl->Invalidate(true);
1713 delete pPhotoBitmap;
1717 ShowTimerInfo(IDC_CALLER2_TIME_LABEL, true);
1721 //update JoinCall button status
1722 __pCallButtonsPanel->EnableJoinCallButton(__pCallPresentor->IsEnableJoinCallButton());
1728 ActiveCallForm::ShowPersonDetails(const String& phoneNumber, const String& contactLblName, const String& nameLblName, bool isSecondCaller, AppCallInfo* pCallInfo)
1730 result r = E_FAILURE;
1732 //call individual methods to show contact number, caller name & photo
1733 ShowPhoneNumber(phoneNumber, contactLblName);
1735 //fetch contact details based on phone number
1736 String* pDisplayName = pCallInfo->FetchLatestCallerNameN(phoneNumber);
1737 ShowCallerName(*pDisplayName, nameLblName);
1739 Bitmap* pPhotoBitmap = pCallInfo->FetchLatestCallerPhotoN(phoneNumber);
1740 ShowCallerPhoto(pPhotoBitmap, isSecondCaller);
1745 delete pDisplayName;
1746 pDisplayName = null;
1750 delete pPhotoBitmap;
1751 pPhotoBitmap = null;
1756 ActiveCallForm::ShowPhoneNumber(const String& phoneNumber, const String& contactLblName)
1758 String formattedNumber = phoneNumber;
1760 Label* pContactLbl = static_cast<Label*>(GetControl(contactLblName));
1763 pContactLbl->SetText(formattedNumber);
1764 pContactLbl->Invalidate(true);
1769 ActiveCallForm::ShowCallerName(const String& callerName, const String& nameLblName)
1771 // show display name on name Label
1772 Label* pNameLbl = static_cast<Label*>(GetControl(nameLblName));
1775 //passing an empty string to SetText fails in label,
1776 //if previously valid text has been set
1777 if (callerName.IsEmpty() == true && pNameLbl->GetText().IsEmpty() == false)
1779 String stringToBeSet(L" ");
1780 pNameLbl->SetText(stringToBeSet);
1784 pNameLbl->SetText(callerName);
1786 pNameLbl->Invalidate(true);
1791 ActiveCallForm::ShowCallerPhoto(Bitmap* pPhotoId, bool isSecondCaller)
1793 //to check if default image is to be shown
1794 bool showDefaultPhoto = false;
1795 bool showSmallPhoto = false;
1796 String photoLabel("");
1800 case FORMTYPE_OUTGOINGCALL:
1801 case FORMTYPE_ACTIVECALL:
1803 if (pPhotoId == null)
1805 //show default caller image
1806 showDefaultPhoto = true;
1810 //Check the size of photo
1811 // Now checking the condition with && but actually it should be ||
1812 //But for now keeping it as && because _pContact->GetThubNail() returns image width as
1813 // height 270 and width = 480 . So all images set thru gallery is show as small image
1814 if(pPhotoId->GetHeight() <= H_SMALL_PHOTO
1815 && pPhotoId->GetWidth() <= W_SMALL_PHOTO)
1817 showSmallPhoto = true;
1821 photoLabel.Append(IDC_CALLER1_BIGPHOTO_LABEL);
1825 case FORMTYPE_MULTIPLECALLS:
1829 photoLabel.Append(IDC_CALLER2_PHOTO_LABEL);
1833 photoLabel.Append(IDC_CALLER1_PHOTO_LABEL);
1836 if (pPhotoId == null)
1838 showDefaultPhoto = true;
1842 if (pPhotoId->GetHeight() <= H_SMALL_PHOTO
1843 && pPhotoId->GetWidth() <= W_SMALL_PHOTO)
1845 //pPhotoId->Scale(Dimension(W_CONFERENCE_PHOTO,H_CONFERENCE_PHOTO));
1846 showSmallPhoto = true;
1856 //Remove small photo label
1857 if (__pSmallPhotoLabel != null)
1859 RemoveControl(__pSmallPhotoLabel);
1860 __pSmallPhotoLabel = null;
1863 //show photo - for Big Photo Id, Animated Call Image
1864 if (!showDefaultPhoto)
1866 if(showSmallPhoto == true)
1868 ShowThumbnailImage(pPhotoId,photoLabel);
1872 Label* pPhotoLbl = static_cast<Label*>(GetControl(photoLabel));
1875 Canvas* pCanvas = new (std::nothrow) Canvas;
1876 Rectangle canvasRect(Rectangle(0, 0, pPhotoLbl->GetBounds().width, pPhotoLbl->GetBounds().height));
1877 pCanvas->Construct(canvasRect);
1878 //draw the contact bitmap
1879 pCanvas->DrawBitmap(canvasRect,*pPhotoId);
1880 Bitmap* pNewPhotoId = new Bitmap();
1881 pNewPhotoId->Construct(*pCanvas, pCanvas->GetBounds());
1884 pPhotoLbl->SetBackgroundBitmap(*pNewPhotoId);
1885 pPhotoLbl->Invalidate(true);
1892 Bitmap* pDefaultPhoto = null;
1895 case FORMTYPE_OUTGOINGCALL:
1896 case FORMTYPE_ACTIVECALL:
1897 pDefaultPhoto = AppUtility::GetBitmapFromResourcesN(IDB_ACTIVE_CALL_DEFAULT_ICON,W_CONFERENCE_PHOTO,W_CONFERENCE_PHOTO);
1900 case FORMTYPE_MULTIPLECALLS:
1901 pDefaultPhoto = AppUtility::GetBitmapFromResourcesN(IDB_MULTIPLE_CALL_DEFAULT_ICON,W_CONFERENCE_PHOTO,H_CONFERENCE_PHOTO);
1904 case FORMTYPE_ACTIVECONFCALL:
1905 pDefaultPhoto = AppUtility::GetBitmapFromResourcesN(IDB_CONFERENCE_BIG_BG_ICON,W_CONFERENCE_PHOTO,W_CONFERENCE_PHOTO);
1911 if (pDefaultPhoto != null)
1913 Label* pPhotoLbl = static_cast<Label*>(GetControl(photoLabel));
1916 pPhotoLbl->SetBackgroundBitmap(*pDefaultPhoto);
1917 pPhotoLbl->Invalidate(true);
1919 delete pDefaultPhoto;
1925 ActiveCallForm::ShowThumbnailImage(const Bitmap* pPhotoId,String& photoLabel)
1927 Label* pPhotoLbl = static_cast<Label*>(GetControl(photoLabel));
1929 if (pPhotoLbl != null && pPhotoId != null)
1931 Canvas* pCanvas = new (std::nothrow) Canvas;
1932 Bitmap* pBackground = AppUtility::GetBitmapFromResourcesN(IDB_CALL_THUMBNAIL_BACKGROUND,W_CALL_THUMBNAIL,H_CALL_THUMBNAIL);
1933 Bitmap* pShadow = AppUtility::GetBitmapFromResourcesN(IDB_CALL_THUMBNAIL_SHADOW,W_CALL_THUMBNAIL_SHADOW,H_CALL_THUMBNAIL_SHADOW);
1934 Rectangle canvasRect(Rectangle(0, 0, pPhotoLbl->GetBounds().width, pPhotoLbl->GetBounds().height));
1935 pCanvas->Construct(canvasRect);
1936 //draw the back ground
1937 pCanvas->DrawBitmap(canvasRect,*pBackground);
1938 //draw shadow (to be enabled after correct shadow image is provided )
1939 //pCanvas->DrawBitmap(Rectangle((pPhotoLbl->GetBounds().width/2)-(W_CALL_THUMBNAIL_SHADOW/2),
1940 // (pPhotoLbl->GetBounds().height/2)-(H_CALL_THUMBNAIL_SHADOW/2),W_CALL_THUMBNAIL_SHADOW,H_CALL_THUMBNAIL_SHADOW),*pShadow);
1941 //draw the contact bitmap
1942 pCanvas->DrawBitmap(Rectangle((pPhotoLbl->GetBounds().width/2)-(W_SMALL_PHOTO/2),
1943 (pPhotoLbl->GetBounds().height/2)-(H_SMALL_PHOTO/2),W_SMALL_PHOTO,H_SMALL_PHOTO),*pPhotoId);
1944 Bitmap* pNewPhotoId = new Bitmap();
1945 pNewPhotoId->Construct(*pCanvas, pCanvas->GetBounds());
1948 pPhotoLbl->SetBackgroundBitmap(*pNewPhotoId);
1949 pPhotoLbl->Invalidate(true);
1958 ActiveCallForm::ShowCallersPhotoThumbnail(const Bitmap& pPhotoId)
1960 if (__pSmallPhotoLabel != null)
1962 RemoveControl(__pSmallPhotoLabel);
1963 __pSmallPhotoLabel = null;
1965 //Draw Small Photo and show on small photo label
1966 __pSmallPhotoLabel = new (std::nothrow) Label();//static_cast<Label*>(GetControl(IDC_SMALL_PHOTO_LABEL));
1967 __pSmallPhotoLabel->Construct(Rectangle(X_PHOTO_LBL, Y_PHOTO_LBL, W_PHOTO_LBL, H_PHOTO_LBL), L"");
1968 __pSmallPhotoLabel->SetBackgroundColor(Color(0,0,0));
1969 __pSmallPhotoLabel->SetBackgroundBitmap(pPhotoId);
1970 // Add a Label to the Form
1971 AddControl(__pSmallPhotoLabel);
1972 __pSmallPhotoLabel->Invalidate(true);
1976 ActiveCallForm::ShowTimerInfo(const String& timerLblName, bool isOnHold, long long startTime)
1978 Label* pTimerLbl = static_cast<Label*>(GetControl(timerLblName));
1980 if (__pActiveCallTimer == null)
1982 __pActiveCallTimer = new (std::nothrow) Tizen::Base::Runtime::Timer();
1983 __pActiveCallTimer->Construct(*this);
1986 if (pTimerLbl != null)
1988 if (isOnHold == true)
1990 pTimerLbl->SetText(AppUtility::GetResourceString(IDS_TIMER_ON_HOLD));
1991 //update Hold button status
1992 SetHoldButtonStatus(false);
1996 //update Hold button status
1997 SetHoldButtonStatus(true);
1998 //current system time
1999 long long currTime = 0;
2000 //SystemTime::GetTicks(currTime);
2001 CallApp* pPhoneApp = static_cast<CallApp*>(CallApp::GetInstance());
2002 currTime = pPhoneApp->GetCallAppTicks();
2004 TimeSpan diffSpan(abs(startTime - currTime));
2006 String activeCallTime(L"");
2008 long long hr = diffSpan.GetHours();
2011 activeCallTime.Append("0");
2013 activeCallTime.Append(hr);
2014 activeCallTime.Append(L":");
2016 long long min = diffSpan.GetMinutes();
2019 activeCallTime.Append("0");
2021 activeCallTime.Append(min);
2022 activeCallTime.Append(L":");
2024 long long sec = diffSpan.GetSeconds();
2027 activeCallTime.Append("0");
2029 activeCallTime.Append(sec);
2031 pTimerLbl->SetText(activeCallTime);
2032 __pActiveCallTimer->StartAsRepeatable(TimeSpan::NUM_OF_TICKS_IN_SECOND);
2034 pTimerLbl->Invalidate(true);
2039 ActiveCallForm::SetHoldButtonShowState(bool showState)
2041 Label* pLblControl = static_cast<Label*>(GetControl(IDC_HOLD_LABEL));
2042 if(pLblControl != null)
2044 pLblControl->SetShowState(showState);
2046 Button* pButtonControl = static_cast<Button*>(GetControl(IDC_HOLD_BUTTON));
2047 if(pButtonControl != null)
2049 pButtonControl->SetShowState(showState);
2054 ActiveCallForm::SetShowStateOnKeypadLandscape(bool showState)
2058 case FORMTYPE_ACTIVECONFCALL:
2059 case FORMTYPE_ACTIVECALL:
2061 SetHoldButtonShowState(showState);
2065 case FORMTYPE_MULTIPLECALLS:
2067 Label* pLblControl = static_cast<Label*>(GetControl(IDC_CALLER2_LABEL));
2068 pLblControl->SetShowState(showState);
2069 pLblControl = static_cast<Label*>(GetControl(IDC_NUMBER2_LABEL));
2070 pLblControl->SetShowState(showState);
2071 pLblControl = static_cast<Label*>(GetControl(IDC_CALLER2_TIME_LABEL));
2072 pLblControl->SetShowState(showState);
2073 pLblControl = static_cast<Label*>(GetControl(IDC_SWAP_LABEL));
2074 pLblControl->SetShowState(showState);
2075 pLblControl = static_cast<Label*>(GetControl(IDC_BACKGROUND_LABEL2));
2076 pLblControl->SetShowState(showState);
2077 Button* pButtonControl = static_cast<Button*>(GetControl(IDC_SWAP_BUTTON));
2078 pButtonControl->SetShowState(showState);
2088 ActiveCallForm::SetShowStateOnKeypad(bool showState)
2090 Label* pLblControl = static_cast<Label*>(GetControl(IDC_CALLER1_LABEL));
2091 pLblControl->SetShowState(showState);
2092 pLblControl = static_cast<Label*>(GetControl(IDC_BACKGROUND_LABEL));
2093 pLblControl->SetShowState(showState);
2094 pLblControl = static_cast<Label*>(GetControl(IDC_CALLER1_TIME_LABEL));
2095 pLblControl->SetShowState(showState);
2096 if (__pSmallPhotoLabel != null)
2098 __pSmallPhotoLabel->SetShowState(showState);
2103 case FORMTYPE_ACTIVECALL:
2105 pLblControl = static_cast<Label*>(GetControl(IDC_NUMBER1_LABEL));
2106 pLblControl->SetShowState(showState);
2107 pLblControl = static_cast<Label*>(GetControl(IDC_VOICE_CALL_ICON_LABEL));
2108 pLblControl->SetShowState(showState);
2109 SetHoldButtonShowState(showState);
2113 case FORMTYPE_MULTIPLECALLS:
2115 pLblControl = static_cast<Label*>(GetControl(IDC_NUMBER1_LABEL));
2116 pLblControl->SetShowState(showState);
2117 pLblControl = static_cast<Label*>(GetControl(IDC_CALLER2_LABEL));
2118 pLblControl->SetShowState(showState);
2119 pLblControl = static_cast<Label*>(GetControl(IDC_NUMBER2_LABEL));
2120 pLblControl->SetShowState(showState);
2121 pLblControl = static_cast<Label*>(GetControl(IDC_CALLER2_TIME_LABEL));
2122 pLblControl->SetShowState(showState);
2123 pLblControl = static_cast<Label*>(GetControl(IDC_SWAP_LABEL));
2124 pLblControl->SetShowState(showState);
2125 pLblControl = static_cast<Label*>(GetControl(IDC_BACKGROUND_LABEL2));
2126 pLblControl->SetShowState(showState);
2127 if (__pActiveCallInfo != null && __pActiveCallInfo->IsConferenceCall() == false)
2129 pLblControl = static_cast<Label*>(GetControl(IDC_VOICE_CALL_ICON_LABEL));
2130 pLblControl->SetShowState(showState);
2134 Button* pButtonControl = static_cast<Button*>(GetControl(IDC_CONF_CALL_MORE_BUTTON));
2135 pButtonControl->SetShowState(showState);
2137 Button* pButtonControl = static_cast<Button*>(GetControl(IDC_SWAP_BUTTON));
2138 pButtonControl->SetShowState(showState);
2142 case FORMTYPE_ACTIVECONFCALL:
2144 pLblControl = static_cast<Label*>(GetControl(IDC_PARTICIPANTS_LABEL));
2145 pLblControl->SetShowState(showState);
2146 SetHoldButtonShowState(showState);
2147 Button* pButtonControl = static_cast<Button*>(GetControl(IDC_CONF_CALL_MORE_BUTTON));
2148 pButtonControl->SetShowState(showState);
2158 ActiveCallForm::OnTimerExpired(Tizen::Base::Runtime::Timer& timer)
2160 //Call default implementation of "Object.Equals()"
2161 //returns true, if they are pointing to same address.
2162 if (__pActiveCallTimer->Equals(timer))
2164 Label* pTimerLbl = static_cast<Label*>(GetControl(IDC_CALLER1_TIME_LABEL));
2167 String activeCallTime = pTimerLbl->GetText();
2168 // Create a StringTokenizer instance
2169 StringTokenizer strTokens(activeCallTime, L":");
2171 int count = strTokens.GetTokenCount(); // count == 3
2176 for (int index = 0; index < count; index++)
2181 strTokens.GetNextToken(token);
2182 Integer::Parse(token, hr);
2186 strTokens.GetNextToken(token);
2187 Integer::Parse(token, min);
2191 strTokens.GetNextToken(token);
2192 Integer::Parse(token, sec);
2198 if (sec == IDI_MAX_SECONDS)
2203 if (min == IDI_MAX_MINS)
2210 activeCallTime.Clear();
2213 activeCallTime.Append("0");
2215 activeCallTime.Append(hr);
2216 activeCallTime.Append(":");
2219 activeCallTime.Append("0");
2221 activeCallTime.Append(min);
2222 activeCallTime.Append(":");
2225 activeCallTime.Append("0");
2227 activeCallTime.Append(sec);
2228 //update timer label
2229 pTimerLbl->SetText(activeCallTime);
2230 pTimerLbl->Invalidate(true);
2235 ///////////////////////////////////////////////////////////
2236 /////////// Options Menu List Functionality /////////
2237 ///////////////////////////////////////////////////////////
2239 ActiveCallForm::OnListViewContextItemStateChanged(ListView& listView, int index, int elementId, ListContextItemStatus state)
2244 ActiveCallForm::OnListViewItemStateChanged(ListView& listView, int index, int elementId, ListItemStatus status)
2246 //Goto conference call list form
2247 SceneManager* pSceneManager = SceneManager::GetInstance();
2248 pSceneManager->GoForward(ForwardSceneTransition(IDSCN_SCENE_CONFCALLLIST, SCENE_TRANSITION_ANIMATION_TYPE_NONE,
2249 SCENE_HISTORY_OPTION_NO_HISTORY, SCENE_DESTROY_OPTION_KEEP), null);
2253 ActiveCallForm::OnListViewItemSwept(ListView& listView, int index, SweepDirection direction)
2258 ActiveCallForm::OnListViewItemLongPressed(ListView& listView, int index, int elementId, bool& invokeListViewItemCallback)
2263 ActiveCallForm::GetItemCount(void)
2265 return IDI_MOREOPTIONS_LIST_ITEMS;
2269 ActiveCallForm::CreateItem(int index, int itemWidth)
2271 //create 1st Menu option
2272 CustomItem* pItem = new (std::nothrow) CustomItem();
2273 pItem->Construct(IDI_OPTIONMENU_DIMEN, LIST_ANNEX_STYLE_NORMAL);
2275 //Set background 9-patch bitmap to option menu
2276 Bitmap* pBgBmp = AppUtility::GetBitmapFromResourcesN(IDB_POPUP_BG_ICON);
2277 if (pBgBmp != null && pBgBmp->IsNinePatchedBitmap())
2280 bgCanvas.Construct(Rectangle(IDI_OPTIONMENU_POS, IDI_OPTIONMENU_DIMEN));
2281 bgCanvas.DrawNinePatchedBitmap(bgCanvas.GetBounds(), *pBgBmp);
2285 pItem->SetBackgroundColor(LIST_ITEM_DRAWING_STATUS_NORMAL, Color(40, 45, 48));
2290 //Set bitmap to option menu
2291 Bitmap* pNormalConfCallBmp = AppUtility::GetBitmapFromResourcesN(IDB_MORE_MANAGE_CONFERENCE_ICON ,
2292 W_MGR_CONFCALL_BITMAP, H_MGR_CONFCALL_BITMAP);
2293 pItem->AddElement(Rectangle(16, 17, W_MGR_CONFCALL_BITMAP, H_MGR_CONFCALL_BITMAP), 1, *pNormalConfCallBmp, null, null);
2294 // Deallocate bitmaps
2295 delete pNormalConfCallBmp;
2296 pNormalConfCallBmp = null;
2298 //Set text to menu option
2299 String confCallName = AppUtility::GetResourceString(IDS_MGR_CONF_CALL_LIST_STR);
2301 TextElement* pTextElement = new (std::nothrow) TextElement();
2302 pTextElement->Construct(confCallName);
2303 pTextElement->SetTextColor(COLOR_POPUP_TEXT);
2306 font.Construct(FONT_STYLE_PLAIN, IDI_POPUP_TEXT_SIZE);
2307 pTextElement->SetFont(font);
2308 //construct Enriched text
2309 EnrichedText* pEnrichedText = new (std::nothrow) EnrichedText();
2310 FloatDimension textDimension;
2311 font.GetTextExtent(confCallName, confCallName.GetLength(), textDimension);
2312 textDimension.height = textDimension.height + font.GetDescender();
2313 pEnrichedText->Construct(textDimension);
2314 //add text element to enriched text
2315 pEnrichedText->Add(*pTextElement);
2317 //Add Enriched text to pItem
2318 FloatPoint textPos(((2 * IDI_OPTIONMENU_ITEM_SPACING) + W_MGR_CONFCALL_BITMAP), ((IDI_OPTIONMENU_DIMEN.height - textDimension.height) / 2));
2319 pItem->AddElement(FloatRectangle(textPos, textDimension), 2, *pEnrichedText);
2321 pEnrichedText->RemoveAll(true);
2322 delete pEnrichedText;
2327 ActiveCallForm::DeleteItem(int index, ListItemBase* pItem, int itemWidth)
2334 ActiveCallForm::OnForeground(void)
2336 AppLogDebug("Enter");
2337 __pCallPresentor->OnAppForeground();
2341 ActiveCallForm::OnKeyPressed(Control& source, const KeyEventInfo& keyEventInfo)
2343 AppLogDebug("Enter");
2345 if(keyEventInfo.GetKeyCode() == KEY_BACKSPACE || keyEventInfo.GetKeyCode() == KEY_DELETE)
2347 if(__pDTMFKeypad != null)
2349 EditField* pTextBox = static_cast<EditField*>(__pDTMFKeypad->GetControl(IDC_TEXTBOX));
2350 if(source.Equals(*pTextBox))
2352 AppLogDebug("Enter");