2 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
4 // Licensed under the Flora License, Version 1.0 (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
25 #include "PhnActiveCallForm.h"
26 #include "PhnCallButtonsPanel.h"
27 #include "PhnCallInfo.h"
28 #include "PhnAppUtility.h"
29 #include "PhnDtmfKeypadPanel.h"
30 #include "PhnCallPresentationModel.h"
31 #include "PhnSceneRegister.h"
34 using namespace Tizen::App;
35 using namespace Tizen::Base;
36 using namespace Tizen::Base::Collection;
37 using namespace Tizen::Base::Utility;
38 using namespace Tizen::Graphics;
39 using namespace Tizen::Media;
40 using namespace Tizen::Social;
41 using namespace Tizen::System;
42 using namespace Tizen::Ui;
43 using namespace Tizen::Ui::Controls;
44 using namespace Tizen::Ui::Scenes;
47 const int IDI_MAX_SECONDS = 60;
48 const int IDI_MAX_MINS = 60;
49 const int W_HOLD_BITMAP = 78;
50 const int H_HOLD_BITMAP = 78;
51 //for Options menu list
52 const int IDI_POPUP_TEXT_SIZE = 33;
53 const unsigned int COLOR_POPUP_TEXT = Color32<255, 255, 255, 255>::Value;
54 const int IDI_MOREOPTIONS_LIST_ITEMS = 1;
55 const int W_OPTION_ANCHOR = 72;
56 const int H_OPTION_ANCHOR = 22;
57 const int W_MGR_CONFCALL_BITMAP = 64;
58 const int H_MGR_CONFCALL_BITMAP = 64;
59 const int X_DTMF_KEYPAD = 40;
60 const int IDI_YMARGIN_DTMF_KEYPAD = 26;
61 const int X_POPUP_ANCHOR = 632;
62 const int Y_POPUP_ANCHOR = 140;
63 const int W_POPUP_ANCHOR = 72;
64 const int H_POPUP_ANCHOR = 22;
65 const int IDI_OPTIONMENU_ITEM_SPACING = 16;
66 const Point IDI_OPTIONMENU_POS(238, 162);
67 const Dimension IDI_OPTIONMENU_DIMEN(466, 99);
68 const int X_PHOTO_LBL = 166;
69 const int Y_PHOTO_LBL = 232;
70 const int W_PHOTO_LBL = 388;
71 const int H_PHOTO_LBL = 388;
72 const int W_PHOTO_LABEL = 720;
73 const int H_PHOTO_LABEL = 720;
75 static const wchar_t* IDC_CONF_CALL_MORE_BUTTON = L"IDC_CONF_CALL_MORE_BUTTON";
76 static const wchar_t* IDC_HOLD_BUTTON = L"IDC_HOLD_BUTTON";
77 static const wchar_t* IDC_SWAP_BUTTON = L"IDC_SWAP_BUTTON";
78 static const wchar_t* IDC_HOLD_LABEL = L"IDC_HOLD_LABEL";
79 static const wchar_t* IDC_TEXTBOX = L"IDC_TEXTBOX";
80 static const wchar_t* IDC_LINE_LABEL = L"IDC_LINE_LABEL";
81 static const wchar_t* IDC_CALLER1_LABEL = L"IDC_CALLER1_LABEL";
82 static const wchar_t* IDC_BACKGROUND_LABEL = L"IDC_BACKGROUND_LABEL";
83 static const wchar_t* IDC_CALLER1_TIME_LABEL = L"IDC_CALLER1_TIME_LABEL";
84 static const wchar_t* IDC_NUMBER1_LABEL = L"IDC_NUMBER1_LABEL";
85 static const wchar_t* IDC_VOICE_CALL_ICON_LABEL = L"IDC_VOICE_CALL_ICON_LABEL";
86 static const wchar_t* IDC_CALLER2_LABEL = L"IDC_CALLER2_LABEL";
87 static const wchar_t* IDC_NUMBER2_LABEL = L"IDC_NUMBER2_LABEL";
88 static const wchar_t* IDC_CALLER2_TIME_LABEL = L"IDC_CALLER2_TIME_LABEL";
89 static const wchar_t* IDC_SWAP_LABEL = L"IDC_SWAP_LABEL";
90 static const wchar_t* IDC_BACKGROUND_LABEL2 = L"IDC_BACKGROUND_LABEL2";
91 static const wchar_t* IDC_PARTICIPANTS_LABEL = L"IDC_PARTICIPANTS_LABEL";
92 static const wchar_t* IDC_DIVIDER_LABEL = L"IDC_DIVIDER_LABEL";
93 static const wchar_t* IDC_CALLER1_BIGPHOTO_LABEL = L"IDC_CALLER1_BIGPHOTO_LABEL";
94 static const wchar_t* IDC_CALLER2_PHOTO_LABEL = L"IDC_CALLER2_PHOTO_LABEL";
95 static const wchar_t* IDC_CALLER1_PHOTO_LABEL = L"IDC_CALLER1_PHOTO_LABEL";
97 ActiveCallForm::ActiveCallForm(FormType formType)
100 __pActiveCallTimer = null;
101 __pCallButtonsPanel = null;
102 __pDTMFKeypad = null;
103 __pMoreOptionsList = null;
104 __pMoreOptionsListAnchor = null;
105 __pSmallPhotoLabel = null;
106 __pActiveCallInfo = null;
107 __pHeldCallInfo = null;
110 ActiveCallForm::~ActiveCallForm(void)
112 if (__pActiveCallTimer != null)
114 __pActiveCallTimer->Cancel();
115 delete __pActiveCallTimer;
117 if (__pMoreOptionsList != null)
119 RemoveControl(*__pMoreOptionsList);
120 __pMoreOptionsList = null;
122 if (__pMoreOptionsListAnchor != null)
124 RemoveControl(*__pMoreOptionsListAnchor);
125 __pMoreOptionsListAnchor = null;
127 if (__pSmallPhotoLabel != null)
129 RemoveControl(*__pSmallPhotoLabel);
130 __pSmallPhotoLabel = null;
132 if (__pActiveCallInfo != null)
134 delete __pActiveCallInfo;
136 if (__pHeldCallInfo != null)
138 delete __pHeldCallInfo;
140 if(__pDTMFKeypad != null)
142 RemoveControl(*__pDTMFKeypad);
143 __pDTMFKeypad = null;
148 ActiveCallForm::Initialize(void)
152 case FORMTYPE_OUTGOINGCALL:
153 Construct(IDL_OUTCALL_FORM);
156 case FORMTYPE_EMERGENCYOUTGOINGCALL:
157 Construct(IDL_OUT_EMERGENCYCALL_FORM);
160 case FORMTYPE_ACTIVECALL:
161 Construct(IDL_CALL_FORM);
164 case FORMTYPE_EMERGENCYACTIVECALL:
165 Construct(IDL_EMERGENCY_CALL_FORM);
168 case FORMTYPE_MULTIPLECALLS:
169 Construct(IDL_MULTIPLE_CALL_FORM);
172 case FORMTYPE_ACTIVECONFCALL:
173 Construct(IDL_CONFCALL_FORM);
180 //Initialize keypad and buttons
181 InitializeCallButtonsPanel();
182 //Hold Button - Shown on single active/conf call scene
183 InitializeHoldButton();
184 //Swap button for multiple call screen
185 InitializeSwapButton();
186 //Initialize manage conf. call list form
187 InitializeManageConfCallButton();
191 ActiveCallForm::OnInitializing(void)
193 result r = E_SUCCESS;
195 RelativeLayout* pRelativeLayout = dynamic_cast<RelativeLayout*>(GetParent()->GetLandscapeLayoutN());
196 if (pRelativeLayout != null)
198 pRelativeLayout->SetHorizontalFitPolicy(*this, FIT_POLICY_PARENT);
199 pRelativeLayout->SetVerticalFitPolicy(*this, FIT_POLICY_PARENT);
200 delete pRelativeLayout;
202 pRelativeLayout = dynamic_cast<RelativeLayout*>(GetParent()->GetPortraitLayoutN());
203 if (pRelativeLayout != null)
205 pRelativeLayout->SetHorizontalFitPolicy(*this, FIT_POLICY_PARENT);
206 pRelativeLayout->SetVerticalFitPolicy(*this, FIT_POLICY_PARENT);
207 delete pRelativeLayout;
210 __pCallPresentor = CallPresentationModel::GetInstance();
216 ActiveCallForm::ShowDTMFKeypad(void)
218 if(__pDTMFKeypad == null)
220 Rectangle rect(X_DTMF_KEYPAD, 0, 0, 0);
221 //update rect according to client screen area
222 rect.width = GetClientAreaBounds().width - (2 * X_DTMF_KEYPAD);
223 rect.height = GetClientAreaBounds().height - __pCallButtonsPanel->GetHeight() - IDI_YMARGIN_DTMF_KEYPAD;
224 __pDTMFKeypad = new (std::nothrow) DtmfKeyPadPanel();
225 __pDTMFKeypad->Initialize(this, rect);
226 AddControl(*__pDTMFKeypad);
228 TextBox* pTextBox = static_cast<TextBox*>(__pDTMFKeypad->GetControl(IDC_TEXTBOX));
229 pTextBox->SetText(L"");
230 __pDTMFKeypad->SetShowState(true);
231 __pDTMFKeypad->Draw(true);
232 __pDTMFKeypad->Show();
236 ActiveCallForm::HideDTMFKeypad(void)
238 if(__pDTMFKeypad != null)
240 __pDTMFKeypad->SetShowState(false);
245 ActiveCallForm::InitializeCallButtonsPanel(void)
247 __pCallButtonsPanel = new (std::nothrow) CallButtonsPanel();
248 __pCallButtonsPanel->ConstructPanel(this, __formType);
250 result r = AddControl(*__pCallButtonsPanel);
255 ActiveCallForm::InitializeSwapButton(void)
257 Button* pSwapBtn = static_cast<Button*>(GetControl(IDC_SWAP_BUTTON));
260 Bitmap* pSwapBmp = AppUtility::GetBitmapFromResourcesN(IDB_SWAP_ICON_NORMAL,
261 W_HOLD_BITMAP, H_HOLD_BITMAP);
264 pSwapBtn->SetNormalBitmap(Point(0, 0), *pSwapBmp);
269 pSwapBmp = AppUtility::GetBitmapFromResourcesN(IDB_SWAP_ICON_PRESS,
270 W_HOLD_BITMAP, H_HOLD_BITMAP);
273 pSwapBtn->SetPressedBitmap(Point(0, 0), *pSwapBmp);
277 pSwapBtn->SetActionId(IDA_SWAP_CALLS);
278 pSwapBtn->AddActionEventListener(*this);
283 ActiveCallForm::InitializeManageConfCallButton(void)
285 Button* pMoreBtn = static_cast<Button*>(GetControl(IDC_CONF_CALL_MORE_BUTTON));
286 if (pMoreBtn != null)
288 pMoreBtn->SetActionId(IDA_MORE_OPTIONS_MENU);
289 pMoreBtn->AddActionEventListener(*this);
290 if (__formType == FORMTYPE_MULTIPLECALLS)
292 //Correct state will be set in OnSceneActivated based on the call
293 pMoreBtn->SetShowState(false);
294 Label* pLblControl = static_cast<Label*>(GetControl(IDC_DIVIDER_LABEL));
297 pLblControl->SetShowState(false);
300 else if (__formType == FORMTYPE_ACTIVECONFCALL)
302 pMoreBtn->SetShowState(true);
303 Label* pLblControl = static_cast<Label*>(GetControl(IDC_DIVIDER_LABEL));
306 pLblControl->SetShowState(true);
313 ActiveCallForm::InitializeHoldButton(void)
315 Button* pHoldBtn = static_cast<Button*>(GetControl(IDC_HOLD_BUTTON));
316 if (pHoldBtn != null)
318 //set status of Hold Button
319 SetHoldButtonStatus(true);
320 pHoldBtn->AddActionEventListener(*this);
325 ActiveCallForm::SetHoldButtonStatus(bool toHoldCall)
327 //background bitmap & button name
329 Bitmap* normalImg = null;
330 Bitmap* pressImg = null;
333 btnName.Append(AppUtility::GetResourceString(IDS_HOLD_BTN_NAME));
334 normalImg = AppUtility::GetBitmapFromResourcesN(IDB_HOLD_NORMAL_BUTTON_ICON,
335 W_HOLD_BITMAP, H_HOLD_BITMAP);
336 pressImg = AppUtility::GetBitmapFromResourcesN(IDB_HOLD_PRESS_BUTTON_ICON,
337 W_HOLD_BITMAP, H_HOLD_BITMAP);
341 btnName.Append(AppUtility::GetResourceString(IDS_UNHOLD_BTN_NAME));
342 normalImg = AppUtility::GetBitmapFromResourcesN(IDB_UNHOLD_NORMAL_BUTTON_ICON,
343 W_HOLD_BITMAP, H_HOLD_BITMAP);
344 pressImg = AppUtility::GetBitmapFromResourcesN(IDB_UNHOLD_PRESS_BUTTON_ICON,
345 W_HOLD_BITMAP, H_HOLD_BITMAP);
349 CommandIds cmdId = IDA_HOLD_CALL;
352 case FORMTYPE_ACTIVECALL:
354 cmdId = toHoldCall ? IDA_HOLD_CALL : IDA_UNHOLD_CALL;
358 case FORMTYPE_ACTIVECONFCALL:
360 cmdId = toHoldCall ? IDA_HOLD_CONF_CALL : IDA_UNHOLD_CONF_CALL;
368 //set background bitmap, button name & action id
369 Button* pHoldBtn = static_cast<Button*>(GetControl(IDC_HOLD_BUTTON));
370 Label* pHoldLbl = static_cast<Label*>(GetControl(IDC_HOLD_LABEL));
373 pHoldBtn->SetActionId(cmdId);
374 pHoldBtn->SetNormalBitmap(Point(0, 0),*normalImg);
375 pHoldBtn->SetPressedBitmap(Point(0, 0),*pressImg);
379 pHoldLbl->SetText(btnName);
380 pHoldLbl->Invalidate(true);
391 ActiveCallForm::CreateMoreOptionsMenuList(void)
393 //create option list anchor
394 if (__pMoreOptionsListAnchor == null)
396 Bitmap* pBgPopupArwBmp = AppUtility::GetBitmapFromResourcesN(IDB_POPUP_ARROW_ICON, W_OPTION_ANCHOR,
398 __pMoreOptionsListAnchor = new (std::nothrow) Label();
399 __pMoreOptionsListAnchor->Construct(Rectangle(X_POPUP_ANCHOR, Y_POPUP_ANCHOR, W_POPUP_ANCHOR, H_POPUP_ANCHOR), L"");
400 __pMoreOptionsListAnchor->SetBackgroundBitmap(*pBgPopupArwBmp);
402 delete pBgPopupArwBmp;
403 pBgPopupArwBmp = null;
405 // Adds a Label to the Form
406 AddControl(*__pMoreOptionsListAnchor);
409 //create options menu list
410 if (__pMoreOptionsList == null)
412 __pMoreOptionsList = new (std::nothrow) ListView();
413 __pMoreOptionsList->Construct(Rectangle(IDI_OPTIONMENU_POS, IDI_OPTIONMENU_DIMEN), false, SCROLL_STYLE_FADE_OUT);
414 __pMoreOptionsList->SetItemProvider(*this);
415 __pMoreOptionsList->AddListViewItemEventListener(*this);
416 //Add option list to the form
417 AddControl(*__pMoreOptionsList);
421 //Hide option menu list
422 DestroyMoreOptionsMenuList();
427 ActiveCallForm::DestroyMoreOptionsMenuList(void)
429 if (__pMoreOptionsListAnchor != null)
431 //removes and delete the child control
432 RemoveControl(*__pMoreOptionsListAnchor);
433 __pMoreOptionsListAnchor = null;
436 if (__pMoreOptionsList != null)
438 //removes and delete the child control
439 RemoveControl(*__pMoreOptionsList);
440 __pMoreOptionsList = null;
445 ActiveCallForm::OnTerminating(void)
447 result r = E_SUCCESS;
448 if (__pCallPresentor != null)
450 __pCallPresentor = null;
456 ActiveCallForm::OnActionPerformed(const Control& source, int actionId)
458 SceneManager* pSceneManager = SceneManager::GetInstance();
465 //End the currently active / dialing call
466 if (__pActiveCallInfo->IsConferenceCall() == false)
468 String activeContactNo;
469 activeContactNo.Append(__pActiveCallInfo->GetContactNumber());
470 //In case of if its a hidden call
471 if(__pActiveCallInfo->GetContactNumber().IsEmpty() == true)
473 __pCallPresentor->EndCall(*__pActiveCallInfo->GetCallHandle());
477 __pCallPresentor->EndCall(activeContactNo);
482 __pCallPresentor->EndConferenceCall();
487 case IDA_END_CONF_CALL:
489 AppAssert(__formType == FORMTYPE_ACTIVECONFCALL);
490 __pCallPresentor->EndConferenceCall();
494 case IDA_OPEN_NUMKEYPAD:
496 SetShowStateOnKeypad(false);
498 SetTextToDTMFTextField(L"");
499 __pCallButtonsPanel->SetKeypadButtonState(IDA_CLOSE_NUMKEYPAD);
503 case IDA_CLOSE_NUMKEYPAD:
505 SetShowStateOnKeypad(true);
507 __pCallButtonsPanel->SetKeypadButtonState(IDA_OPEN_NUMKEYPAD);
513 //switch to Dialer Form to make an call
514 if(__pCallPresentor->GetCurrentCallCount() == 1)
516 ArrayList* pArgs = new (std::nothrow) ArrayList(SingleObjectDeleter);
518 String* formType = new (std::nothrow) String();
519 formType->Append(__formType);
520 pArgs->Add(formType);
521 pSceneManager->GoForward( ForwardSceneTransition(IDSCN_DIALER, SCENE_TRANSITION_ANIMATION_TYPE_NONE,
522 SCENE_HISTORY_OPTION_NO_HISTORY), pArgs);
530 if (__pActiveCallInfo->IsConferenceCall() == false)
532 if(__pActiveCallInfo->GetCallHandle() != null)
534 success = __pCallPresentor->HoldCall(*__pActiveCallInfo->GetCallHandle());
539 success = __pCallPresentor->HoldConferenceCall();
541 //reset hold status and "OnHold" text
542 ShowTimerInfo(IDC_CALLER1_TIME_LABEL, success);
543 if(__pActiveCallTimer != null)
545 __pActiveCallTimer->Cancel();
547 SetHoldButtonStatus(!success);
551 case IDA_UNHOLD_CALL:
553 bool success = false;
554 if (__pActiveCallInfo->IsConferenceCall() == false)
556 if(__pActiveCallInfo->GetCallHandle() != null)
558 success = __pCallPresentor->UnHoldCall(*__pActiveCallInfo->GetCallHandle());
563 success = __pCallPresentor->ActivateConferenceCall();
565 //reset hold status and show call timer
566 ShowTimerInfo(IDC_CALLER1_TIME_LABEL, !success, __activeCallStartTime);
567 SetHoldButtonStatus(success);
571 case IDA_HOLD_CONF_CALL:
573 AppAssert(__formType == FORMTYPE_ACTIVECONFCALL);
574 bool success = __pCallPresentor->HoldConferenceCall();
575 //reset hold status and "OnHold" text
576 SetHoldButtonStatus(!success);
577 ShowTimerInfo(IDC_CALLER1_TIME_LABEL, success);
578 if(__pActiveCallTimer != null)
580 __pActiveCallTimer->Cancel();
585 case IDA_UNHOLD_CONF_CALL:
587 AppAssert(__formType == FORMTYPE_ACTIVECONFCALL);
588 bool success = __pCallPresentor->ActivateConferenceCall();
589 //reset hold status and show call timer
590 ShowTimerInfo(IDC_CALLER1_TIME_LABEL, !success, __activeCallStartTime);
591 SetHoldButtonStatus(success);
595 case IDA_OPEN_CONTACTS:
601 bool success = __pCallPresentor->SetMuteStatus(true);
604 __pCallButtonsPanel->SetMuteButtonState(IDA_UNMUTE);
611 bool success = __pCallPresentor->SetMuteStatus(false);
614 __pCallButtonsPanel->SetMuteButtonState(IDA_MUTE);
621 bool success = __pCallPresentor->SetSpeakerStatus(true);
624 __pCallButtonsPanel->SetSpeakerButtonState(IDA_SPEAKER_OFF);
629 case IDA_SPEAKER_OFF:
631 bool success = __pCallPresentor->SetSpeakerStatus(false);
634 __pCallButtonsPanel->SetSpeakerButtonState(IDA_SPEAKER);
641 AppAssert(__formType == FORMTYPE_MULTIPLECALLS);
642 __pCallPresentor->JoinCall();
648 AppAssert(__formType == FORMTYPE_MULTIPLECALLS);
649 __pCallPresentor->SwapCalls();
653 case IDA_MORE_OPTIONS_MENU:
655 //Show 'more' options menu
656 CreateMoreOptionsMenuList();
662 dtmfString.Append(L"0");
663 SetTextToDTMFTextField(dtmfString);
664 __pCallPresentor->SendDTMFSignal(dtmfString);
670 dtmfString.Append(L"1");
671 SetTextToDTMFTextField(dtmfString);
672 __pCallPresentor->SendDTMFSignal(dtmfString);
678 dtmfString.Append(L"2");
679 SetTextToDTMFTextField(dtmfString);
680 __pCallPresentor->SendDTMFSignal(dtmfString);
686 dtmfString.Append(L"3");
687 SetTextToDTMFTextField(dtmfString);
688 __pCallPresentor->SendDTMFSignal(dtmfString);
694 dtmfString.Append(L"4");
695 SetTextToDTMFTextField(dtmfString);
696 __pCallPresentor->SendDTMFSignal(dtmfString);
702 dtmfString.Append(L"5");
703 SetTextToDTMFTextField(dtmfString);
704 __pCallPresentor->SendDTMFSignal(dtmfString);
710 dtmfString.Append(L"6");
711 SetTextToDTMFTextField(dtmfString);
712 __pCallPresentor->SendDTMFSignal(dtmfString);
718 dtmfString.Append(L"7");
719 SetTextToDTMFTextField(dtmfString);
720 __pCallPresentor->SendDTMFSignal(dtmfString);
726 dtmfString.Append(L"8");
727 SetTextToDTMFTextField(dtmfString);
728 __pCallPresentor->SendDTMFSignal(dtmfString);
734 dtmfString.Append(L"9");
735 SetTextToDTMFTextField(dtmfString);
736 __pCallPresentor->SendDTMFSignal(dtmfString);
742 dtmfString.Append(L"*");
743 SetTextToDTMFTextField(dtmfString);
744 __pCallPresentor->SendDTMFSignal(dtmfString);
750 dtmfString.Append(L"#");
751 SetTextToDTMFTextField(dtmfString);
752 __pCallPresentor->SendDTMFSignal(dtmfString);
762 ActiveCallForm::SetTextToDTMFTextField(const String& dtmfStr)
764 if(__pDTMFKeypad != null)
766 TextBox* pTextBox = static_cast<TextBox*>(__pDTMFKeypad->GetControl(IDC_TEXTBOX));
767 pTextBox->AppendText(dtmfStr);
768 pTextBox->Invalidate(true);
773 ActiveCallForm::OnSceneActivatedN(const SceneId& previousSceneId, const SceneId& currentSceneId, IList* pArgs)
775 //set itself as listener
776 __pCallPresentor->SetTelEventListener(this);
777 if (__pActiveCallInfo != null)
779 delete __pActiveCallInfo;
780 __pActiveCallInfo = null;
782 if (__pHeldCallInfo != null)
784 delete __pHeldCallInfo;
785 __pHeldCallInfo = null;
787 DestroyMoreOptionsMenuList();
791 case FORMTYPE_OUTGOINGCALL:
794 contactNo.Append(*(static_cast<String*>(pArgs->GetAt(0))));
795 __pActiveCallInfo = new (std::nothrow) CallInfo();
796 __pActiveCallInfo->SetContactNumber(contactNo);
797 Contact* pContact = __pCallPresentor->GetContactN(contactNo);
798 if (pContact != null)
800 __pActiveCallInfo->SetContactInfo(*pContact);
803 ShowPersonDetails(contactNo, IDC_NUMBER1_LABEL, IDC_CALLER1_LABEL, false,__pActiveCallInfo);
804 //make an normal outgoing call
805 __pCallPresentor->DialCall(contactNo, false);
809 case FORMTYPE_EMERGENCYOUTGOINGCALL:
811 String* pContactNo = static_cast<String*>(pArgs->GetAt(0));
812 __pActiveCallInfo = new (std::nothrow) CallInfo();
813 long long phNumber = 0;
814 LongLong::Parse(*pContactNo, phNumber);
815 __pActiveCallInfo->SetContactNumber(*pContactNo);
816 //make an emergency call
817 __pCallPresentor->DialCall(*pContactNo, true);
821 case FORMTYPE_ACTIVECALL:
824 CallInfo* pCall = static_cast<CallInfo*>(pArgs->GetAt(0));
826 __pActiveCallInfo = new (std::nothrow) CallInfo();
827 *__pActiveCallInfo = *pCall;
828 String activeContactNo;
829 activeContactNo.Append(pCall->GetContactNumber());
830 ShowPersonDetails(activeContactNo, IDC_NUMBER1_LABEL, IDC_CALLER1_LABEL, false,__pActiveCallInfo);
832 //show call active time using Timer
833 __activeCallStartTime = pCall->GetCallConnectTime();
834 ShowTimerInfo(IDC_CALLER1_TIME_LABEL, pCall->IsOnHold(), __activeCallStartTime);
838 case FORMTYPE_EMERGENCYACTIVECALL:
841 CallInfo* pCall = static_cast<CallInfo*>(pArgs->GetAt(0));
843 __pActiveCallInfo = new (std::nothrow) CallInfo();
844 *__pActiveCallInfo = *pCall;
846 //show call active time using Timer
847 __activeCallStartTime = pCall->GetCallConnectTime();
848 ShowTimerInfo(IDC_CALLER1_TIME_LABEL, pCall->IsOnHold(), __activeCallStartTime);
852 case FORMTYPE_MULTIPLECALLS:
854 Button* pMoreBtn = static_cast<Button*>(GetControl(IDC_CONF_CALL_MORE_BUTTON));
855 if (pMoreBtn != null)
857 pMoreBtn->SetShowState(false);
859 Label* pLblControl = static_cast<Label*>(GetControl(IDC_DIVIDER_LABEL));
862 pLblControl->SetShowState(false);
864 //show caller's info.
865 for (int index = 0; index < pArgs->GetCount();index++)
868 CallInfo* pCallInfo = static_cast<CallInfo*>(pArgs->GetAt(index));
871 contactNo.Append(pCallInfo->GetContactNumber());
873 if (pCallInfo->IsOnHold() == false)
875 __pActiveCallInfo = new (std::nothrow) CallInfo();
876 *__pActiveCallInfo = *pCallInfo;
878 if (pCallInfo->IsConferenceCall() == false)
880 Label* pVoiceIconLbl = static_cast<Label*>(GetControl(IDC_VOICE_CALL_ICON_LABEL));
883 pVoiceIconLbl->SetShowState(true);
885 if (pMoreBtn != null)
887 pMoreBtn->SetShowState(false);
889 Label* pLblControl = static_cast<Label*>(GetControl(IDC_DIVIDER_LABEL));
892 pLblControl->SetShowState(false);
894 ShowPersonDetails(contactNo, IDC_NUMBER1_LABEL, IDC_CALLER1_LABEL, false,__pActiveCallInfo);
898 // show display name on name Label
899 Label* pPeopleCountLbl = static_cast<Label*>(GetControl(IDC_NUMBER1_LABEL));
903 count.Append(pCallInfo->GetCallerListCount());
905 count.Append(AppUtility::GetResourceString(IDS_PEOPLE_STR));
906 pPeopleCountLbl->SetText(count);
908 String nameStr = AppUtility::GetResourceString(L"IDS_CONFERENCE_CALL_STRING");
909 Label* pNameLbl = static_cast<Label*>(GetControl(IDC_CALLER1_LABEL));
912 pNameLbl->SetText(nameStr);
914 Label* pVoiceIconLbl = static_cast<Label*>(GetControl(IDC_VOICE_CALL_ICON_LABEL));
917 pVoiceIconLbl->SetShowState(false);
919 if (pMoreBtn != null)
921 pMoreBtn->SetShowState(true);
925 pLblControl->SetShowState(true);
927 Bitmap* pPhotoBitmap = AppUtility::GetBitmapFromResourcesN(IDB_CONFERENCE_BG_ICON,W_CONFERENCE_PHOTO,H_CONFERENCE_PHOTO);
928 if (pPhotoBitmap != null)
930 Label* pPhotoLbl = static_cast<Label*>(GetControl(IDC_CALLER1_PHOTO_LABEL));
933 pPhotoLbl->SetBackgroundBitmap(*pPhotoBitmap);
934 pPhotoLbl->Invalidate(true);
939 //show call active time using Timer
940 __activeCallStartTime = pCallInfo->GetCallConnectTime();
941 ShowTimerInfo(IDC_CALLER1_TIME_LABEL,false,__activeCallStartTime);
945 __pHeldCallInfo = new (std::nothrow) CallInfo();
946 *__pHeldCallInfo = *pCallInfo;
948 if (pCallInfo->IsConferenceCall() == false)
950 ShowPersonDetails(contactNo, IDC_NUMBER2_LABEL, IDC_CALLER2_LABEL, true,__pHeldCallInfo);
954 // show display name on name Label
955 Label* pPeopleCountLbl = static_cast<Label*>(GetControl(IDC_NUMBER2_LABEL));
959 count.Append(pCallInfo->GetCallerListCount());
961 count.Append(AppUtility::GetResourceString(IDS_PEOPLE_STR));
962 pPeopleCountLbl->SetText(count);
964 String nameStr = AppUtility::GetResourceString(L"IDS_CONFERENCE_CALL_STRING");
965 Label* pNameLbl = static_cast<Label*>(GetControl(IDC_CALLER2_LABEL));
968 pNameLbl->SetText(nameStr);
970 Bitmap* pPhotoBitmap = AppUtility::GetBitmapFromResourcesN(IDB_CONFERENCE_BG_ICON,W_CONFERENCE_PHOTO,H_CONFERENCE_PHOTO);
971 if (pPhotoBitmap != null)
973 Label* pPhotoLbl = static_cast<Label*>(GetControl(IDC_CALLER2_PHOTO_LABEL));
976 pPhotoLbl->SetBackgroundBitmap(*pPhotoBitmap);
977 pPhotoLbl->Invalidate(true);
983 ShowTimerInfo(IDC_CALLER2_TIME_LABEL, true);
989 case FORMTYPE_ACTIVECONFCALL:
992 CallInfo* pConfInfo = static_cast<CallInfo*>(pArgs->GetAt(0));
993 int participantsCount = pConfInfo->GetCallerListCount();
995 // show display name on name Label
996 Label* pPeopleCountLbl = static_cast<Label*>(GetControl(IDC_PARTICIPANTS_LABEL));
1000 count.Append(participantsCount);
1002 count.Append(AppUtility::GetResourceString(IDS_PEOPLE_STR));
1003 pPeopleCountLbl->SetText(count);
1006 if(participantsCount >= IDI_MAX_CONF_CALL_PARTICIPANTS)
1008 __pCallButtonsPanel->EnableAddCallButton(false);
1012 __pCallButtonsPanel->EnableAddCallButton(true);
1015 //show call active time using Timer
1016 __activeCallStartTime = pConfInfo->GetCallConnectTime();
1017 ShowTimerInfo(IDC_CALLER1_TIME_LABEL, pConfInfo->IsOnHold(),__activeCallStartTime);
1025 //Hide DTMFKeypad, if visible and show caller info
1027 SetShowStateOnKeypad(true);
1028 __pCallButtonsPanel->SetKeypadButtonState(IDA_OPEN_NUMKEYPAD);
1030 //Set the correct speaker status
1031 if(__pCallPresentor->IsSpeakerOn() == true)
1033 __pCallButtonsPanel->SetSpeakerButtonState(IDA_SPEAKER_OFF);
1037 __pCallButtonsPanel->SetSpeakerButtonState(IDA_SPEAKER);
1040 //Set the correct Mute status
1041 if (__pCallPresentor->IsCallMuted() == true)
1043 __pCallButtonsPanel->SetMuteButtonState(IDA_UNMUTE);
1047 __pCallButtonsPanel->SetMuteButtonState(IDA_MUTE);
1059 ActiveCallForm::OnSceneDeactivated(const SceneId& currentSceneId, const SceneId& nextSceneId)
1061 // Add your scene deactivate code here
1062 if (__pActiveCallTimer != null)
1064 __pActiveCallTimer->Cancel();
1065 delete __pActiveCallTimer;
1066 __pActiveCallTimer = null;
1068 if (__pSmallPhotoLabel != null)
1070 __pSmallPhotoLabel->SetShowState(false);
1072 //Hide "Manage conf. Call" Context menu
1073 if (__pMoreOptionsListAnchor != null)
1075 __pMoreOptionsListAnchor->SetShowState(false);
1077 if (__pMoreOptionsList != null)
1079 __pMoreOptionsList->SetShowState(false);
1084 ActiveCallForm::HandleCallSwapN(IList* pCallList)
1086 if (pCallList != null)
1088 if (__pActiveCallInfo)
1090 delete __pActiveCallInfo;
1091 __pActiveCallInfo = null;
1093 if (__pHeldCallInfo)
1095 delete __pHeldCallInfo;
1096 __pHeldCallInfo = null;
1098 //show caller's info.
1099 for (int index = 0; index < pCallList->GetCount();index++)
1102 CallInfo* pCallInfo = static_cast<CallInfo*>(pCallList->GetAt(index));
1105 contactNo.Append(pCallInfo->GetContactNumber());
1107 if (pCallInfo->IsOnHold() == false)
1109 __pActiveCallInfo = new (std::nothrow) CallInfo();
1110 *__pActiveCallInfo = *pCallInfo;
1112 if (pCallInfo->IsConferenceCall() == false)
1114 Label* pVoiceIconLbl = static_cast<Label*>(GetControl(IDC_VOICE_CALL_ICON_LABEL));
1117 pVoiceIconLbl->SetShowState(true);
1119 Button* pMoreBtn = static_cast<Button*>(GetControl(IDC_CONF_CALL_MORE_BUTTON));
1120 if (pMoreBtn != null)
1122 pMoreBtn->SetShowState(false);
1124 Label* pLblControl = static_cast<Label*>(GetControl(IDC_DIVIDER_LABEL));
1127 pLblControl->SetShowState(false);
1129 ShowPersonDetails(contactNo, IDC_NUMBER1_LABEL, IDC_CALLER1_LABEL, false,__pActiveCallInfo);
1133 Label* pVoiceIconLbl = static_cast<Label*>(GetControl(IDC_VOICE_CALL_ICON_LABEL));
1136 pVoiceIconLbl->SetShowState(false);
1138 Button* pMoreBtn = static_cast<Button*>(GetControl(IDC_CONF_CALL_MORE_BUTTON));
1139 if (pMoreBtn != null)
1141 pMoreBtn->SetShowState(true);
1143 Label* pLblControl = static_cast<Label*>(GetControl(IDC_DIVIDER_LABEL));
1146 pLblControl->SetShowState(true);
1148 // show display name on name Label
1149 Label* pPeopleCountLbl = static_cast<Label*>(GetControl(IDC_NUMBER1_LABEL));
1150 if (pPeopleCountLbl)
1153 count.Append(pCallInfo->GetCallerListCount());
1155 count.Append(AppUtility::GetResourceString(IDS_PEOPLE_STR));
1156 pPeopleCountLbl->SetText(count);
1158 String nameStr = AppUtility::GetResourceString(L"IDS_CONFERENCE_CALL_STRING");
1159 Label* pNameLbl = static_cast<Label*>(GetControl(IDC_CALLER1_LABEL));
1162 pNameLbl->SetText(nameStr);
1164 Bitmap* pPhotoBitmap = AppUtility::GetBitmapFromResourcesN(IDB_CONFERENCE_BG_ICON,W_CONFERENCE_PHOTO,H_CONFERENCE_PHOTO);
1165 if (pPhotoBitmap != null)
1167 Label* pPhotoLbl = static_cast<Label*>(GetControl(IDC_CALLER1_PHOTO_LABEL));
1170 pPhotoLbl->SetBackgroundBitmap(*pPhotoBitmap);
1172 delete pPhotoBitmap;
1175 //show call active time using Timer
1176 __activeCallStartTime = pCallInfo->GetCallConnectTime();
1177 ShowTimerInfo(IDC_CALLER1_TIME_LABEL,false,__activeCallStartTime);
1181 __pHeldCallInfo = new (std::nothrow) CallInfo();
1182 *__pHeldCallInfo = *pCallInfo;
1184 if (pCallInfo->IsConferenceCall() == false)
1186 ShowPersonDetails(contactNo, IDC_NUMBER2_LABEL, IDC_CALLER2_LABEL, true,__pHeldCallInfo);
1190 // show display name on name Label
1191 Label* pPeopleCountLbl = static_cast<Label*>(GetControl(IDC_NUMBER2_LABEL));
1192 if (pPeopleCountLbl)
1195 count.Append(pCallInfo->GetCallerListCount());
1197 count.Append(AppUtility::GetResourceString(IDS_PEOPLE_STR));
1198 pPeopleCountLbl->SetText(count);
1200 String nameStr = AppUtility::GetResourceString(L"IDS_CONFERENCE_CALL_STRING");
1201 Label* pNameLbl = static_cast<Label*>(GetControl(IDC_CALLER2_LABEL));
1204 pNameLbl->SetText(nameStr);
1206 Bitmap* pPhotoBitmap = AppUtility::GetBitmapFromResourcesN(IDB_CONFERENCE_BG_ICON,W_CONFERENCE_PHOTO,H_CONFERENCE_PHOTO);
1207 if (pPhotoBitmap != null)
1209 Label* pPhotoLbl = static_cast<Label*>(GetControl(IDC_CALLER2_PHOTO_LABEL));
1212 pPhotoLbl->SetBackgroundBitmap(*pPhotoBitmap);
1214 delete pPhotoBitmap;
1218 ShowTimerInfo(IDC_CALLER2_TIME_LABEL, true);
1226 ActiveCallForm::ShowPersonDetails(const String& phoneNumber, const String& contactLblName, const String& nameLblName, bool isSecondCaller, CallInfo* pCallInfo)
1228 //call individual methods to show contact number, caller name & photo
1229 ShowPhoneNumber(phoneNumber, contactLblName);
1231 //fetch contact details based on phone number
1232 String* pDisplayName = pCallInfo->FetchCallerNameN();
1233 ShowCallerName(*pDisplayName, nameLblName);
1235 Bitmap* pPhotoBitmap = pCallInfo->FetchCallerPhotoN();
1236 ShowCallerPhoto(pPhotoBitmap, isSecondCaller);
1241 delete pDisplayName;
1242 pDisplayName = null;
1246 delete pPhotoBitmap;
1247 pPhotoBitmap = null;
1252 ActiveCallForm::ShowPhoneNumber(const String& phoneNumber, const String& contactLblName)
1254 String formattedNumber = phoneNumber;
1256 Label* pContactLbl = static_cast<Label*>(GetControl(contactLblName));
1259 pContactLbl->SetText(formattedNumber);
1260 pContactLbl->Invalidate(true);
1265 ActiveCallForm::ShowCallerName(const String& callerName, const String& nameLblName)
1267 // show display name on name Label
1268 Label* pNameLbl = static_cast<Label*>(GetControl(nameLblName));
1271 //passing an empty string to SetText fails in label,
1272 //if previously valid text has been set
1273 if (callerName.IsEmpty() == true && pNameLbl->GetText().IsEmpty() == false)
1275 String stringToBeSet(L" ");
1276 pNameLbl->SetText(stringToBeSet);
1280 pNameLbl->SetText(callerName);
1282 pNameLbl->Invalidate(true);
1287 ActiveCallForm::ShowCallerPhoto(Bitmap* pPhotoId, bool isSecondCaller)
1289 //to check if default image is to be shown
1290 bool showDefaultPhoto = false;
1291 String photoLabel("");
1295 case FORMTYPE_OUTGOINGCALL:
1296 case FORMTYPE_ACTIVECALL:
1298 if (pPhotoId == null)
1300 //show default caller image
1301 showDefaultPhoto = true;
1303 photoLabel.Append(IDC_CALLER1_BIGPHOTO_LABEL);
1307 case FORMTYPE_MULTIPLECALLS:
1311 photoLabel.Append(IDC_CALLER2_PHOTO_LABEL);
1315 photoLabel.Append(IDC_CALLER1_PHOTO_LABEL);
1318 if (pPhotoId == null)
1320 showDefaultPhoto = true;
1324 if (pPhotoId->GetHeight() <= H_SMALL_PHOTO
1325 || pPhotoId->GetWidth() <= W_SMALL_PHOTO)
1327 pPhotoId->Scale(Dimension(W_CONFERENCE_PHOTO,H_CONFERENCE_PHOTO));
1337 //Remove small photo label
1338 if (__pSmallPhotoLabel != null)
1340 RemoveControl(*__pSmallPhotoLabel);
1341 __pSmallPhotoLabel = null;
1344 //show photo - for Big Photo Id, Animated Call Image
1345 if (!showDefaultPhoto)
1347 Label* pPhotoLbl = static_cast<Label*>(GetControl(photoLabel));
1350 Canvas* pCanvas = new (std::nothrow) Canvas;
1351 Rectangle canvasRect(Rectangle(0, 0, pPhotoLbl->GetBounds().width, pPhotoLbl->GetBounds().height));
1352 pCanvas->Construct(canvasRect);
1353 //draw the contact bitmap
1354 pCanvas->DrawBitmap(canvasRect,*pPhotoId);
1355 Bitmap* pNewPhotoId = new Bitmap();
1356 pNewPhotoId->Construct(*pCanvas, pCanvas->GetBounds());
1359 pPhotoLbl->SetBackgroundBitmap(*pNewPhotoId);
1360 pPhotoLbl->Invalidate(true);
1366 Bitmap* pDefaultPhoto = null;
1369 case FORMTYPE_OUTGOINGCALL:
1370 case FORMTYPE_ACTIVECALL:
1371 pDefaultPhoto = AppUtility::GetBitmapFromResourcesN(IDB_ACTIVE_CALL_DEFAULT_ICON,W_CONFERENCE_PHOTO,W_CONFERENCE_PHOTO);
1374 case FORMTYPE_MULTIPLECALLS:
1375 pDefaultPhoto = AppUtility::GetBitmapFromResourcesN(IDB_MULTIPLE_CALL_DEFAULT_ICON,W_CONFERENCE_PHOTO,H_CONFERENCE_PHOTO);
1378 case FORMTYPE_ACTIVECONFCALL:
1379 pDefaultPhoto = AppUtility::GetBitmapFromResourcesN(IDB_CONFERENCE_BIG_BG_ICON,W_CONFERENCE_PHOTO,W_CONFERENCE_PHOTO);
1385 if (pDefaultPhoto != null)
1387 Label* pPhotoLbl = static_cast<Label*>(GetControl(photoLabel));
1390 pPhotoLbl->SetBackgroundBitmap(*pDefaultPhoto);
1392 delete pDefaultPhoto;
1398 ActiveCallForm::ShowCallersPhotoThumbnail(const Bitmap& pPhotoId)
1400 if (__pSmallPhotoLabel != null)
1402 RemoveControl(*__pSmallPhotoLabel);
1403 __pSmallPhotoLabel = null;
1405 //Draw Small Photo and show on small photo label
1406 __pSmallPhotoLabel = new (std::nothrow) Label();//static_cast<Label*>(GetControl(IDC_SMALL_PHOTO_LABEL));
1407 __pSmallPhotoLabel->Construct(Rectangle(X_PHOTO_LBL, Y_PHOTO_LBL, W_PHOTO_LBL, H_PHOTO_LBL), L"");
1408 __pSmallPhotoLabel->SetBackgroundColor(Color(0,0,0));
1409 __pSmallPhotoLabel->SetBackgroundBitmap(pPhotoId);
1410 // Add a Label to the Form
1411 AddControl(*__pSmallPhotoLabel);
1412 __pSmallPhotoLabel->Invalidate(true);
1416 ActiveCallForm::ShowTimerInfo(const String& timerLblName, bool isOnHold, long long startTime)
1418 Label* pTimerLbl = static_cast<Label*>(GetControl(timerLblName));
1420 if (__pActiveCallTimer == null)
1422 __pActiveCallTimer = new (std::nothrow) Tizen::Base::Runtime::Timer();
1423 __pActiveCallTimer->Construct(*this);
1426 if (pTimerLbl != null)
1428 if (isOnHold == true)
1430 pTimerLbl->SetText(L"On hold");
1431 //update Hold button status
1432 SetHoldButtonStatus(false);
1436 //update Hold button status
1437 SetHoldButtonStatus(true);
1438 //current system time
1439 long long currTime = 0;
1440 SystemTime::GetTicks(currTime);
1442 TimeSpan diffSpan(abs(startTime - currTime));
1444 String activeCallTime(L"");
1446 long long hr = diffSpan.GetHours();
1449 activeCallTime.Append("0");
1451 activeCallTime.Append(hr);
1452 activeCallTime.Append(L":");
1454 long long min = diffSpan.GetMinutes();
1457 activeCallTime.Append("0");
1459 activeCallTime.Append(min);
1460 activeCallTime.Append(L":");
1462 long long sec = diffSpan.GetSeconds();
1465 activeCallTime.Append("0");
1467 activeCallTime.Append(sec);
1469 pTimerLbl->SetText(activeCallTime);
1470 __pActiveCallTimer->StartAsRepeatable(TimeSpan::NUM_OF_TICKS_IN_SECOND);
1472 pTimerLbl->Invalidate(true);
1477 ActiveCallForm::SetShowStateOnKeypad(bool showState)
1479 Label* pLblControl = static_cast<Label*>(GetControl(IDC_LINE_LABEL));
1480 pLblControl->SetShowState(showState);
1481 pLblControl = static_cast<Label*>(GetControl(IDC_CALLER1_LABEL));
1482 pLblControl->SetShowState(showState);
1483 pLblControl = static_cast<Label*>(GetControl(IDC_BACKGROUND_LABEL));
1484 pLblControl->SetShowState(showState);
1485 pLblControl = static_cast<Label*>(GetControl(IDC_CALLER1_TIME_LABEL));
1486 pLblControl->SetShowState(showState);
1487 if (__pSmallPhotoLabel != null)
1489 __pSmallPhotoLabel->SetShowState(showState);
1494 case FORMTYPE_ACTIVECALL:
1496 pLblControl = static_cast<Label*>(GetControl(IDC_NUMBER1_LABEL));
1497 pLblControl->SetShowState(showState);
1498 pLblControl = static_cast<Label*>(GetControl(IDC_VOICE_CALL_ICON_LABEL));
1499 pLblControl->SetShowState(showState);
1500 pLblControl = static_cast<Label*>(GetControl(IDC_HOLD_LABEL));
1501 pLblControl->SetShowState(showState);
1502 Button* pButtonControl = static_cast<Button*>(GetControl(IDC_HOLD_BUTTON));
1503 pButtonControl->SetShowState(showState);
1507 case FORMTYPE_MULTIPLECALLS:
1509 pLblControl = static_cast<Label*>(GetControl(IDC_NUMBER1_LABEL));
1510 pLblControl->SetShowState(showState);
1511 pLblControl = static_cast<Label*>(GetControl(IDC_CALLER2_LABEL));
1512 pLblControl->SetShowState(showState);
1513 pLblControl = static_cast<Label*>(GetControl(IDC_NUMBER2_LABEL));
1514 pLblControl->SetShowState(showState);
1515 pLblControl = static_cast<Label*>(GetControl(IDC_CALLER2_TIME_LABEL));
1516 pLblControl->SetShowState(showState);
1517 pLblControl = static_cast<Label*>(GetControl(IDC_SWAP_LABEL));
1518 pLblControl->SetShowState(showState);
1519 pLblControl = static_cast<Label*>(GetControl(IDC_BACKGROUND_LABEL2));
1520 pLblControl->SetShowState(showState);
1521 if (__pActiveCallInfo != null && __pActiveCallInfo->IsConferenceCall() == false)
1523 pLblControl = static_cast<Label*>(GetControl(IDC_VOICE_CALL_ICON_LABEL));
1524 pLblControl->SetShowState(showState);
1528 Button* pButtonControl = static_cast<Button*>(GetControl(IDC_CONF_CALL_MORE_BUTTON));
1529 pButtonControl->SetShowState(showState);
1530 pLblControl = static_cast<Label*>(GetControl(IDC_DIVIDER_LABEL));
1531 pLblControl->SetShowState(showState);
1533 Button* pButtonControl = static_cast<Button*>(GetControl(IDC_SWAP_BUTTON));
1534 pButtonControl->SetShowState(showState);
1538 case FORMTYPE_ACTIVECONFCALL:
1540 pLblControl = static_cast<Label*>(GetControl(IDC_PARTICIPANTS_LABEL));
1541 pLblControl->SetShowState(showState);
1542 pLblControl = static_cast<Label*>(GetControl(IDC_HOLD_LABEL));
1543 pLblControl->SetShowState(showState);
1544 pLblControl = static_cast<Label*>(GetControl(IDC_DIVIDER_LABEL));
1545 pLblControl->SetShowState(showState);
1546 Button* pButtonControl = static_cast<Button*>(GetControl(IDC_HOLD_BUTTON));
1547 pButtonControl->SetShowState(showState);
1548 pButtonControl = static_cast<Button*>(GetControl(IDC_CONF_CALL_MORE_BUTTON));
1549 pButtonControl->SetShowState(showState);
1559 ActiveCallForm::OnTimerExpired(Tizen::Base::Runtime::Timer& timer)
1561 //Call default implementation of "Object.Equals()"
1562 //returns true, if they are pointing to same address.
1563 if (__pActiveCallTimer->Equals(timer))
1565 Label* pTimerLbl = static_cast<Label*>(GetControl(IDC_CALLER1_TIME_LABEL));
1568 String activeCallTime = pTimerLbl->GetText();
1569 // Create a StringTokenizer instance
1570 StringTokenizer strTokens(activeCallTime, L":");
1572 int count = strTokens.GetTokenCount(); // count == 3
1577 for (int index = 0; index < count; index++)
1582 strTokens.GetNextToken(token);
1583 Integer::Parse(token, hr);
1587 strTokens.GetNextToken(token);
1588 Integer::Parse(token, min);
1592 strTokens.GetNextToken(token);
1593 Integer::Parse(token, sec);
1599 if (sec == IDI_MAX_SECONDS)
1604 if (min == IDI_MAX_MINS)
1611 activeCallTime.Clear();
1614 activeCallTime.Append("0");
1616 activeCallTime.Append(hr);
1617 activeCallTime.Append(":");
1620 activeCallTime.Append("0");
1622 activeCallTime.Append(min);
1623 activeCallTime.Append(":");
1626 activeCallTime.Append("0");
1628 activeCallTime.Append(sec);
1629 //update timer label
1630 pTimerLbl->SetText(activeCallTime);
1631 pTimerLbl->Invalidate(true);
1636 ///////////////////////////////////////////////////////////
1637 /////////// Options Menu List Functionality /////////
1638 ///////////////////////////////////////////////////////////
1640 ActiveCallForm::OnListViewContextItemStateChanged(ListView& listView, int index, int elementId, ListContextItemStatus state)
1645 ActiveCallForm::OnListViewItemStateChanged(ListView& listView, int index, int elementId, ListItemStatus status)
1647 //Goto conference call list form
1648 SceneManager* pSceneManager = SceneManager::GetInstance();
1649 pSceneManager->GoForward(ForwardSceneTransition(IDSCN_SCENE_CONFCALLLIST), null);
1653 ActiveCallForm::OnListViewItemSwept(ListView& listView, int index, SweepDirection direction)
1658 ActiveCallForm::OnListViewItemLongPressed(ListView& listView, int index, int elementId, bool& invokeListViewItemCallback)
1663 ActiveCallForm::GetItemCount(void)
1665 return IDI_MOREOPTIONS_LIST_ITEMS;
1669 ActiveCallForm::CreateItem(int index, int itemWidth)
1671 //create 1st Menu option
1672 CustomItem* pItem = new (std::nothrow) CustomItem();
1673 pItem->Construct(IDI_OPTIONMENU_DIMEN, LIST_ANNEX_STYLE_NORMAL);
1675 //Set background 9-patch bitmap to option menu
1676 Bitmap* pBgBmp = AppUtility::GetBitmapFromResourcesN(IDB_POPUP_BG_ICON);
1677 if (pBgBmp != null && pBgBmp->IsNinePatchedBitmap())
1680 bgCanvas.Construct(Rectangle(IDI_OPTIONMENU_POS, IDI_OPTIONMENU_DIMEN));
1681 bgCanvas.DrawNinePatchedBitmap(bgCanvas.GetBounds(), *pBgBmp);
1685 pItem->SetBackgroundColor(LIST_ITEM_DRAWING_STATUS_NORMAL, Color(40, 45, 48));
1690 //Set bitmap to option menu
1691 Bitmap* pNormalConfCallBmp = AppUtility::GetBitmapFromResourcesN(IDB_MORE_MANAGE_CONFERENCE_ICON ,
1692 W_MGR_CONFCALL_BITMAP, H_MGR_CONFCALL_BITMAP);
1693 pItem->AddElement(Rectangle(16, 17, W_MGR_CONFCALL_BITMAP, H_MGR_CONFCALL_BITMAP), 1, *pNormalConfCallBmp, null, null);
1694 // Deallocate bitmaps
1695 delete pNormalConfCallBmp;
1696 pNormalConfCallBmp = null;
1698 //Set text to menu option
1699 String confCallName = AppUtility::GetResourceString(IDS_MGR_CONF_CALL_LIST_STR);
1701 TextElement* pTextElement = new (std::nothrow) TextElement();
1702 pTextElement->Construct(confCallName);
1703 pTextElement->SetTextColor(COLOR_POPUP_TEXT);
1706 font.Construct(FONT_STYLE_PLAIN, IDI_POPUP_TEXT_SIZE);
1707 pTextElement->SetFont(font);
1708 //construct Enriched text
1709 EnrichedText* pEnrichedText = new (std::nothrow) EnrichedText();
1710 Dimension textDimension;
1711 font.GetTextExtent(confCallName, confCallName.GetLength(), textDimension);
1712 textDimension.height = textDimension.height + font.GetDescender();
1713 pEnrichedText->Construct(textDimension);
1714 //add text element to enriched text
1715 pEnrichedText->Add(*pTextElement);
1717 //Add Enriched text to pItem
1718 Point textPos(((2 * IDI_OPTIONMENU_ITEM_SPACING) + W_MGR_CONFCALL_BITMAP), ((IDI_OPTIONMENU_DIMEN.height - textDimension.height) / 2));
1719 pItem->AddElement(Rectangle(textPos, textDimension), 2, *pEnrichedText);
1721 pEnrichedText->RemoveAll(true);
1722 delete pEnrichedText;
1727 ActiveCallForm::DeleteItem(int index, ListItemBase* pItem, int itemWidth)