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;
1092 if (__pHeldCallInfo)
1094 delete __pHeldCallInfo;
1096 //show caller's info.
1097 for (int index = 0; index < pCallList->GetCount();index++)
1100 CallInfo* pCallInfo = static_cast<CallInfo*>(pCallList->GetAt(index));
1103 contactNo.Append(pCallInfo->GetContactNumber());
1105 if (pCallInfo->IsOnHold() == false)
1107 __pActiveCallInfo = new (std::nothrow) CallInfo();
1108 *__pActiveCallInfo = *pCallInfo;
1110 if (pCallInfo->IsConferenceCall() == false)
1112 Label* pVoiceIconLbl = static_cast<Label*>(GetControl(IDC_VOICE_CALL_ICON_LABEL));
1115 pVoiceIconLbl->SetShowState(true);
1117 Button* pMoreBtn = static_cast<Button*>(GetControl(IDC_CONF_CALL_MORE_BUTTON));
1118 if (pMoreBtn != null)
1120 pMoreBtn->SetShowState(false);
1122 Label* pLblControl = static_cast<Label*>(GetControl(IDC_DIVIDER_LABEL));
1125 pLblControl->SetShowState(false);
1127 ShowPersonDetails(contactNo, IDC_NUMBER1_LABEL, IDC_CALLER1_LABEL, false,__pActiveCallInfo);
1131 Label* pVoiceIconLbl = static_cast<Label*>(GetControl(IDC_VOICE_CALL_ICON_LABEL));
1134 pVoiceIconLbl->SetShowState(false);
1136 Button* pMoreBtn = static_cast<Button*>(GetControl(IDC_CONF_CALL_MORE_BUTTON));
1137 if (pMoreBtn != null)
1139 pMoreBtn->SetShowState(true);
1141 Label* pLblControl = static_cast<Label*>(GetControl(IDC_DIVIDER_LABEL));
1144 pLblControl->SetShowState(true);
1146 // show display name on name Label
1147 Label* pPeopleCountLbl = static_cast<Label*>(GetControl(IDC_NUMBER1_LABEL));
1148 if (pPeopleCountLbl)
1151 count.Append(pCallInfo->GetCallerListCount());
1153 count.Append(AppUtility::GetResourceString(IDS_PEOPLE_STR));
1154 pPeopleCountLbl->SetText(count);
1156 String nameStr = AppUtility::GetResourceString(L"IDS_CONFERENCE_CALL_STRING");
1157 Label* pNameLbl = static_cast<Label*>(GetControl(IDC_CALLER1_LABEL));
1160 pNameLbl->SetText(nameStr);
1162 Bitmap* pPhotoBitmap = AppUtility::GetBitmapFromResourcesN(IDB_CONFERENCE_BG_ICON,W_CONFERENCE_PHOTO,H_CONFERENCE_PHOTO);
1163 if (pPhotoBitmap != null)
1165 Label* pPhotoLbl = static_cast<Label*>(GetControl(IDC_CALLER1_PHOTO_LABEL));
1168 pPhotoLbl->SetBackgroundBitmap(*pPhotoBitmap);
1170 delete pPhotoBitmap;
1173 //show call active time using Timer
1174 __activeCallStartTime = pCallInfo->GetCallConnectTime();
1175 ShowTimerInfo(IDC_CALLER1_TIME_LABEL,false,__activeCallStartTime);
1179 __pHeldCallInfo = new (std::nothrow) CallInfo();
1180 *__pHeldCallInfo = *pCallInfo;
1182 if (pCallInfo->IsConferenceCall() == false)
1184 ShowPersonDetails(contactNo, IDC_NUMBER2_LABEL, IDC_CALLER2_LABEL, true,__pHeldCallInfo);
1188 // show display name on name Label
1189 Label* pPeopleCountLbl = static_cast<Label*>(GetControl(IDC_NUMBER2_LABEL));
1190 if (pPeopleCountLbl)
1193 count.Append(pCallInfo->GetCallerListCount());
1195 count.Append(AppUtility::GetResourceString(IDS_PEOPLE_STR));
1196 pPeopleCountLbl->SetText(count);
1198 String nameStr = AppUtility::GetResourceString(L"IDS_CONFERENCE_CALL_STRING");
1199 Label* pNameLbl = static_cast<Label*>(GetControl(IDC_CALLER2_LABEL));
1202 pNameLbl->SetText(nameStr);
1204 Bitmap* pPhotoBitmap = AppUtility::GetBitmapFromResourcesN(IDB_CONFERENCE_BG_ICON,W_CONFERENCE_PHOTO,H_CONFERENCE_PHOTO);
1205 if (pPhotoBitmap != null)
1207 Label* pPhotoLbl = static_cast<Label*>(GetControl(IDC_CALLER2_PHOTO_LABEL));
1210 pPhotoLbl->SetBackgroundBitmap(*pPhotoBitmap);
1212 delete pPhotoBitmap;
1216 ShowTimerInfo(IDC_CALLER2_TIME_LABEL, true);
1224 ActiveCallForm::ShowPersonDetails(const String& phoneNumber, const String& contactLblName, const String& nameLblName, bool isSecondCaller, CallInfo* pCallInfo)
1226 //call individual methods to show contact number, caller name & photo
1227 ShowPhoneNumber(phoneNumber, contactLblName);
1229 //fetch contact details based on phone number
1230 String* pDisplayName = pCallInfo->FetchCallerNameN();
1231 ShowCallerName(*pDisplayName, nameLblName);
1233 Bitmap* pPhotoBitmap = pCallInfo->FetchCallerPhotoN();
1234 ShowCallerPhoto(pPhotoBitmap, isSecondCaller);
1239 delete pDisplayName;
1240 pDisplayName = null;
1244 delete pPhotoBitmap;
1245 pPhotoBitmap = null;
1250 ActiveCallForm::ShowPhoneNumber(const String& phoneNumber, const String& contactLblName)
1252 String formattedNumber = phoneNumber;
1254 Label* pContactLbl = static_cast<Label*>(GetControl(contactLblName));
1257 pContactLbl->SetText(formattedNumber);
1258 pContactLbl->Invalidate(true);
1263 ActiveCallForm::ShowCallerName(const String& callerName, const String& nameLblName)
1265 // show display name on name Label
1266 Label* pNameLbl = static_cast<Label*>(GetControl(nameLblName));
1269 //passing an empty string to SetText fails in label,
1270 //if previously valid text has been set
1271 if (callerName.IsEmpty() == true && pNameLbl->GetText().IsEmpty() == false)
1273 String stringToBeSet(L" ");
1274 pNameLbl->SetText(stringToBeSet);
1278 pNameLbl->SetText(callerName);
1280 pNameLbl->Invalidate(true);
1285 ActiveCallForm::ShowCallerPhoto(Bitmap* pPhotoId, bool isSecondCaller)
1287 //to check if default image is to be shown
1288 bool showDefaultPhoto = false;
1289 String photoLabel("");
1293 case FORMTYPE_OUTGOINGCALL:
1294 case FORMTYPE_ACTIVECALL:
1296 if (pPhotoId == null)
1298 //show default caller image
1299 showDefaultPhoto = true;
1301 photoLabel.Append(IDC_CALLER1_BIGPHOTO_LABEL);
1305 case FORMTYPE_MULTIPLECALLS:
1309 photoLabel.Append(IDC_CALLER2_PHOTO_LABEL);
1313 photoLabel.Append(IDC_CALLER1_PHOTO_LABEL);
1316 if (pPhotoId == null)
1318 showDefaultPhoto = true;
1322 if (pPhotoId->GetHeight() <= H_SMALL_PHOTO
1323 || pPhotoId->GetWidth() <= W_SMALL_PHOTO)
1325 pPhotoId->Scale(Dimension(W_CONFERENCE_PHOTO,H_CONFERENCE_PHOTO));
1335 //Remove small photo label
1336 if (__pSmallPhotoLabel != null)
1338 RemoveControl(*__pSmallPhotoLabel);
1339 __pSmallPhotoLabel = null;
1342 //show photo - for Big Photo Id, Animated Call Image
1343 if (!showDefaultPhoto)
1345 Label* pPhotoLbl = static_cast<Label*>(GetControl(photoLabel));
1348 pPhotoLbl->SetBackgroundBitmap(*pPhotoId);
1349 pPhotoLbl->Invalidate(true);
1354 Bitmap* pDefaultPhoto = null;
1357 case FORMTYPE_OUTGOINGCALL:
1358 case FORMTYPE_ACTIVECALL:
1359 pDefaultPhoto = AppUtility::GetBitmapFromResourcesN(IDB_ACTIVE_CALL_DEFAULT_ICON,W_CONFERENCE_PHOTO,W_CONFERENCE_PHOTO);
1362 case FORMTYPE_MULTIPLECALLS:
1363 pDefaultPhoto = AppUtility::GetBitmapFromResourcesN(IDB_MULTIPLE_CALL_DEFAULT_ICON,W_CONFERENCE_PHOTO,H_CONFERENCE_PHOTO);
1366 case FORMTYPE_ACTIVECONFCALL:
1367 pDefaultPhoto = AppUtility::GetBitmapFromResourcesN(IDB_CONFERENCE_BIG_BG_ICON,W_CONFERENCE_PHOTO,W_CONFERENCE_PHOTO);
1373 if (pDefaultPhoto != null)
1375 Label* pPhotoLbl = static_cast<Label*>(GetControl(photoLabel));
1378 pPhotoLbl->SetBackgroundBitmap(*pDefaultPhoto);
1380 delete pDefaultPhoto;
1386 ActiveCallForm::ShowCallersPhotoThumbnail(const Bitmap& pPhotoId)
1388 if (__pSmallPhotoLabel != null)
1390 RemoveControl(*__pSmallPhotoLabel);
1391 __pSmallPhotoLabel = null;
1393 //Draw Small Photo and show on small photo label
1394 __pSmallPhotoLabel = new (std::nothrow) Label();//static_cast<Label*>(GetControl(IDC_SMALL_PHOTO_LABEL));
1395 __pSmallPhotoLabel->Construct(Rectangle(X_PHOTO_LBL, Y_PHOTO_LBL, W_PHOTO_LBL, H_PHOTO_LBL), L"");
1396 __pSmallPhotoLabel->SetBackgroundColor(Color(0,0,0));
1397 __pSmallPhotoLabel->SetBackgroundBitmap(pPhotoId);
1398 // Add a Label to the Form
1399 AddControl(*__pSmallPhotoLabel);
1400 __pSmallPhotoLabel->Invalidate(true);
1404 ActiveCallForm::ShowTimerInfo(const String& timerLblName, bool isOnHold, long long startTime)
1406 Label* pTimerLbl = static_cast<Label*>(GetControl(timerLblName));
1408 if (__pActiveCallTimer == null)
1410 __pActiveCallTimer = new (std::nothrow) Tizen::Base::Runtime::Timer();
1411 __pActiveCallTimer->Construct(*this);
1414 if (pTimerLbl != null)
1416 if (isOnHold == true)
1418 pTimerLbl->SetText(L"On hold");
1419 //update Hold button status
1420 SetHoldButtonStatus(false);
1424 //update Hold button status
1425 SetHoldButtonStatus(true);
1426 //current system time
1427 long long currTime = 0;
1428 SystemTime::GetTicks(currTime);
1430 TimeSpan diffSpan(abs(startTime - currTime));
1432 String activeCallTime(L"");
1434 long long hr = diffSpan.GetHours();
1437 activeCallTime.Append("0");
1439 activeCallTime.Append(hr);
1440 activeCallTime.Append(L":");
1442 long long min = diffSpan.GetMinutes();
1445 activeCallTime.Append("0");
1447 activeCallTime.Append(min);
1448 activeCallTime.Append(L":");
1450 long long sec = diffSpan.GetSeconds();
1453 activeCallTime.Append("0");
1455 activeCallTime.Append(sec);
1457 pTimerLbl->SetText(activeCallTime);
1458 __pActiveCallTimer->StartAsRepeatable(TimeSpan::NUM_OF_TICKS_IN_SECOND);
1460 pTimerLbl->Invalidate(true);
1465 ActiveCallForm::SetShowStateOnKeypad(bool showState)
1467 Label* pLblControl = static_cast<Label*>(GetControl(IDC_LINE_LABEL));
1468 pLblControl->SetShowState(showState);
1469 pLblControl = static_cast<Label*>(GetControl(IDC_CALLER1_LABEL));
1470 pLblControl->SetShowState(showState);
1471 pLblControl = static_cast<Label*>(GetControl(IDC_BACKGROUND_LABEL));
1472 pLblControl->SetShowState(showState);
1473 pLblControl = static_cast<Label*>(GetControl(IDC_CALLER1_TIME_LABEL));
1474 pLblControl->SetShowState(showState);
1475 if (__pSmallPhotoLabel != null)
1477 __pSmallPhotoLabel->SetShowState(showState);
1482 case FORMTYPE_ACTIVECALL:
1484 pLblControl = static_cast<Label*>(GetControl(IDC_NUMBER1_LABEL));
1485 pLblControl->SetShowState(showState);
1486 pLblControl = static_cast<Label*>(GetControl(IDC_VOICE_CALL_ICON_LABEL));
1487 pLblControl->SetShowState(showState);
1488 pLblControl = static_cast<Label*>(GetControl(IDC_HOLD_LABEL));
1489 pLblControl->SetShowState(showState);
1490 Button* pButtonControl = static_cast<Button*>(GetControl(IDC_HOLD_BUTTON));
1491 pButtonControl->SetShowState(showState);
1495 case FORMTYPE_MULTIPLECALLS:
1497 pLblControl = static_cast<Label*>(GetControl(IDC_NUMBER1_LABEL));
1498 pLblControl->SetShowState(showState);
1499 pLblControl = static_cast<Label*>(GetControl(IDC_CALLER2_LABEL));
1500 pLblControl->SetShowState(showState);
1501 pLblControl = static_cast<Label*>(GetControl(IDC_NUMBER2_LABEL));
1502 pLblControl->SetShowState(showState);
1503 pLblControl = static_cast<Label*>(GetControl(IDC_CALLER2_TIME_LABEL));
1504 pLblControl->SetShowState(showState);
1505 pLblControl = static_cast<Label*>(GetControl(IDC_SWAP_LABEL));
1506 pLblControl->SetShowState(showState);
1507 pLblControl = static_cast<Label*>(GetControl(IDC_BACKGROUND_LABEL2));
1508 pLblControl->SetShowState(showState);
1509 if (__pActiveCallInfo != null && __pActiveCallInfo->IsConferenceCall() == false)
1511 pLblControl = static_cast<Label*>(GetControl(IDC_VOICE_CALL_ICON_LABEL));
1512 pLblControl->SetShowState(showState);
1516 Button* pButtonControl = static_cast<Button*>(GetControl(IDC_CONF_CALL_MORE_BUTTON));
1517 pButtonControl->SetShowState(showState);
1518 pLblControl = static_cast<Label*>(GetControl(IDC_DIVIDER_LABEL));
1519 pLblControl->SetShowState(showState);
1521 Button* pButtonControl = static_cast<Button*>(GetControl(IDC_SWAP_BUTTON));
1522 pButtonControl->SetShowState(showState);
1526 case FORMTYPE_ACTIVECONFCALL:
1528 pLblControl = static_cast<Label*>(GetControl(IDC_PARTICIPANTS_LABEL));
1529 pLblControl->SetShowState(showState);
1530 pLblControl = static_cast<Label*>(GetControl(IDC_HOLD_LABEL));
1531 pLblControl->SetShowState(showState);
1532 pLblControl = static_cast<Label*>(GetControl(IDC_DIVIDER_LABEL));
1533 pLblControl->SetShowState(showState);
1534 Button* pButtonControl = static_cast<Button*>(GetControl(IDC_HOLD_BUTTON));
1535 pButtonControl->SetShowState(showState);
1536 pButtonControl = static_cast<Button*>(GetControl(IDC_CONF_CALL_MORE_BUTTON));
1537 pButtonControl->SetShowState(showState);
1547 ActiveCallForm::OnTimerExpired(Tizen::Base::Runtime::Timer& timer)
1549 //Call default implementation of "Object.Equals()"
1550 //returns true, if they are pointing to same address.
1551 if (__pActiveCallTimer->Equals(timer))
1553 Label* pTimerLbl = static_cast<Label*>(GetControl(IDC_CALLER1_TIME_LABEL));
1556 String activeCallTime = pTimerLbl->GetText();
1557 // Create a StringTokenizer instance
1558 StringTokenizer strTokens(activeCallTime, L":");
1560 int count = strTokens.GetTokenCount(); // count == 3
1565 for (int index = 0; index < count; index++)
1570 strTokens.GetNextToken(token);
1571 Integer::Parse(token, hr);
1575 strTokens.GetNextToken(token);
1576 Integer::Parse(token, min);
1580 strTokens.GetNextToken(token);
1581 Integer::Parse(token, sec);
1587 if (sec == IDI_MAX_SECONDS)
1592 if (min == IDI_MAX_MINS)
1599 activeCallTime.Clear();
1602 activeCallTime.Append("0");
1604 activeCallTime.Append(hr);
1605 activeCallTime.Append(":");
1608 activeCallTime.Append("0");
1610 activeCallTime.Append(min);
1611 activeCallTime.Append(":");
1614 activeCallTime.Append("0");
1616 activeCallTime.Append(sec);
1617 //update timer label
1618 pTimerLbl->SetText(activeCallTime);
1619 pTimerLbl->Invalidate(true);
1624 ///////////////////////////////////////////////////////////
1625 /////////// Options Menu List Functionality /////////
1626 ///////////////////////////////////////////////////////////
1628 ActiveCallForm::OnListViewContextItemStateChanged(ListView& listView, int index, int elementId, ListContextItemStatus state)
1633 ActiveCallForm::OnListViewItemStateChanged(ListView& listView, int index, int elementId, ListItemStatus status)
1635 //Goto conference call list form
1636 SceneManager* pSceneManager = SceneManager::GetInstance();
1637 pSceneManager->GoForward(ForwardSceneTransition(IDSCN_SCENE_CONFCALLLIST), null);
1641 ActiveCallForm::OnListViewItemSwept(ListView& listView, int index, SweepDirection direction)
1646 ActiveCallForm::OnListViewItemLongPressed(ListView& listView, int index, int elementId, bool& invokeListViewItemCallback)
1651 ActiveCallForm::GetItemCount(void)
1653 return IDI_MOREOPTIONS_LIST_ITEMS;
1657 ActiveCallForm::CreateItem(int index, int itemWidth)
1659 //create 1st Menu option
1660 CustomItem* pItem = new (std::nothrow) CustomItem();
1661 pItem->Construct(IDI_OPTIONMENU_DIMEN, LIST_ANNEX_STYLE_NORMAL);
1663 //Set background 9-patch bitmap to option menu
1664 Bitmap* pBgBmp = AppUtility::GetBitmapFromResourcesN(IDB_POPUP_BG_ICON);
1665 if (pBgBmp != null && pBgBmp->IsNinePatchedBitmap())
1668 bgCanvas.Construct(Rectangle(IDI_OPTIONMENU_POS, IDI_OPTIONMENU_DIMEN));
1669 bgCanvas.DrawNinePatchedBitmap(bgCanvas.GetBounds(), *pBgBmp);
1673 pItem->SetBackgroundColor(LIST_ITEM_DRAWING_STATUS_NORMAL, Color(40, 45, 48));
1678 //Set bitmap to option menu
1679 Bitmap* pNormalConfCallBmp = AppUtility::GetBitmapFromResourcesN(IDB_MORE_MANAGE_CONFERENCE_ICON ,
1680 W_MGR_CONFCALL_BITMAP, H_MGR_CONFCALL_BITMAP);
1681 pItem->AddElement(Rectangle(16, 17, W_MGR_CONFCALL_BITMAP, H_MGR_CONFCALL_BITMAP), 1, *pNormalConfCallBmp, null, null);
1682 // Deallocate bitmaps
1683 delete pNormalConfCallBmp;
1684 pNormalConfCallBmp = null;
1686 //Set text to menu option
1687 String confCallName = AppUtility::GetResourceString(IDS_MGR_CONF_CALL_LIST_STR);
1689 TextElement* pTextElement = new (std::nothrow) TextElement();
1690 pTextElement->Construct(confCallName);
1691 pTextElement->SetTextColor(COLOR_POPUP_TEXT);
1694 font.Construct(FONT_STYLE_PLAIN, IDI_POPUP_TEXT_SIZE);
1695 pTextElement->SetFont(font);
1696 //construct Enriched text
1697 EnrichedText* pEnrichedText = new (std::nothrow) EnrichedText();
1698 Dimension textDimension;
1699 font.GetTextExtent(confCallName, confCallName.GetLength(), textDimension);
1700 textDimension.height = textDimension.height + font.GetDescender();
1701 pEnrichedText->Construct(textDimension);
1702 //add text element to enriched text
1703 pEnrichedText->Add(*pTextElement);
1705 //Add Enriched text to pItem
1706 Point textPos(((2 * IDI_OPTIONMENU_ITEM_SPACING) + W_MGR_CONFCALL_BITMAP), ((IDI_OPTIONMENU_DIMEN.height - textDimension.height) / 2));
1707 pItem->AddElement(Rectangle(textPos, textDimension), 2, *pEnrichedText);
1709 pEnrichedText->RemoveAll(true);
1710 delete pEnrichedText;
1715 ActiveCallForm::DeleteItem(int index, ListItemBase* pItem, int itemWidth)