1.Landscape support for incoming call
[apps/osp/Call.git] / src / CallActiveCallForm.cpp
1 //
2 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
3 //
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
7 //
8 //     http://floralicense.org/license/
9 //
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.
15 //
16
17 /**
18  * @file        PhnActiveCallForm.cpp
19  * @brief       Active Call Form class
20  */
21 #include <FApp.h>
22 #include <FUi.h>
23 #include <FMedia.h>
24 #include <FSystem.h>
25 #include "CallActiveCallForm.h"
26 #include "CallButtonsPanel.h"
27 #include "CallInfo.h"
28 #include "CallAppUtility.h"
29 #include "CallDtmfKeypadPanel.h"
30 #include "CallPresentationModel.h"
31 #include "CallSceneRegister.h"
32 #include "CallTypes.h"
33
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;
45
46 //constants
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_POPUP_ANCHOR = 632;
60 const int Y_POPUP_ANCHOR = 140;
61 const int W_POPUP_ANCHOR = 72;
62 const int H_POPUP_ANCHOR = 22;
63 const int IDI_OPTIONMENU_ITEM_SPACING = 16;
64 const Point IDI_OPTIONMENU_POS(238, 162);
65 const Dimension IDI_OPTIONMENU_DIMEN(466, 99);
66 const int X_PHOTO_LBL = 166;
67 const int Y_PHOTO_LBL = 232;
68 const int W_PHOTO_LBL = 388;
69 const int H_PHOTO_LBL = 388;
70 const int W_PHOTO_LABEL = 720;
71 const int H_PHOTO_LABEL = 720;
72 const int W_RIGHT_MORE_ICON_MARGIN = 24;
73 const int W_MORE_LABEL = 466;
74 const int H_MORE_LABEL = 162;
75 const int W_MORE_ICON = 70;
76
77 static const wchar_t* IDC_CONF_CALL_MORE_BUTTON = L"IDC_CONF_CALL_MORE_BUTTON";
78 static const wchar_t* IDC_HOLD_BUTTON = L"IDC_HOLD_BUTTON";
79 static const wchar_t* IDC_SWAP_BUTTON = L"IDC_SWAP_BUTTON";
80 static const wchar_t* IDC_HOLD_LABEL = L"IDC_HOLD_LABEL";
81 static const wchar_t* IDC_TEXTBOX = L"IDC_NUM_EDITFIELD";
82 static const wchar_t* IDC_CALLER1_LABEL = L"IDC_CALLER1_LABEL";
83 static const wchar_t* IDC_BACKGROUND_LABEL = L"IDC_BACKGROUND_LABEL";
84 static const wchar_t* IDC_CALLER1_TIME_LABEL = L"IDC_CALLER1_TIME_LABEL";
85 static const wchar_t* IDC_NUMBER1_LABEL = L"IDC_NUMBER1_LABEL";
86 static const wchar_t* IDC_VOICE_CALL_ICON_LABEL = L"IDC_VOICE_CALL_ICON_LABEL";
87 static const wchar_t* IDC_CALLER2_LABEL = L"IDC_CALLER2_LABEL";
88 static const wchar_t* IDC_NUMBER2_LABEL = L"IDC_NUMBER2_LABEL";
89 static const wchar_t* IDC_CALLER2_TIME_LABEL = L"IDC_CALLER2_TIME_LABEL";
90 static const wchar_t* IDC_SWAP_LABEL = L"IDC_SWAP_LABEL";
91 static const wchar_t* IDC_BACKGROUND_LABEL2 = L"IDC_BACKGROUND_LABEL2";
92 static const wchar_t* IDC_PARTICIPANTS_LABEL = L"IDC_PARTICIPANTS_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";
96 static const wchar_t* IDC_KEY_BG_LABEL = L"IDC_KEY_BG_LABEL";
97
98 ActiveCallForm::ActiveCallForm(FormType formType)
99         : BaseForm(formType)
100 {
101         __pActiveCallTimer = null;
102         __pCallButtonsPanel = null;
103         __pDTMFKeypad = null;
104         __pMoreOptionsList = null;
105         __pMoreOptionsListAnchor = null;
106         __pSmallPhotoLabel = null;
107         __pActiveCallInfo = null;
108         __pHeldCallInfo = null;
109 }
110
111 ActiveCallForm::~ActiveCallForm(void)
112 {
113         if (__pActiveCallTimer != null)
114         {
115                 __pActiveCallTimer->Cancel();
116                 delete __pActiveCallTimer;
117         }
118         if (__pMoreOptionsList != null)
119         {
120                 RemoveControl(*__pMoreOptionsList);
121                 __pMoreOptionsList = null;
122         }
123         if (__pMoreOptionsListAnchor != null)
124         {
125                 RemoveControl(*__pMoreOptionsListAnchor);
126                 __pMoreOptionsListAnchor = null;
127         }
128         if (__pSmallPhotoLabel != null)
129         {
130                 RemoveControl(*__pSmallPhotoLabel);
131                 __pSmallPhotoLabel = null;
132         }
133         if (__pActiveCallInfo != null)
134         {
135                 delete __pActiveCallInfo;
136         }
137         if (__pHeldCallInfo != null)
138         {
139                 delete __pHeldCallInfo;
140         }
141         if(__pDTMFKeypad != null)
142         {
143                 RemoveControl(*__pDTMFKeypad);
144                 __pDTMFKeypad = null;
145         }
146 }
147
148 void
149 ActiveCallForm::Initialize(void)
150 {
151         switch (__formType)
152         {
153         case FORMTYPE_OUTGOINGCALL:
154                 Construct(IDL_OUTCALL_FORM);
155                 break;
156
157         case FORMTYPE_EMERGENCYOUTGOINGCALL:
158                 Construct(IDL_OUT_EMERGENCYCALL_FORM);
159                 break;
160
161         case FORMTYPE_ACTIVECALL:
162                 Construct(IDL_CALL_FORM);
163                 break;
164
165         case FORMTYPE_EMERGENCYACTIVECALL:
166                 Construct(IDL_EMERGENCY_CALL_FORM);
167                 break;
168
169         case FORMTYPE_MULTIPLECALLS:
170                 Construct(IDL_MULTIPLE_CALL_FORM);
171                 break;
172
173         case FORMTYPE_ACTIVECONFCALL:
174                 Construct(IDL_CONFCALL_FORM);
175                 break;
176
177         default:
178                 break;
179         }
180 }
181
182 result
183 ActiveCallForm::OnInitializing(void)
184 {
185         result r = E_SUCCESS;
186
187         //Hold Button - Shown on single active/conf call scene
188         InitializeHoldButton();
189         //Swap button for multiple call screen
190         InitializeSwapButton();
191         //Initialize manage conf. call list form
192         InitializeManageConfCallButton();
193
194         __pCallPresentor = CallPresentationModel::GetInstance();
195         return r;
196 }
197
198 void
199 ActiveCallForm::ShowDTMFKeypad(void)
200 {
201         if(__pDTMFKeypad != null)
202         {
203                 RemoveControl(*__pDTMFKeypad);
204                 __pDTMFKeypad = null;
205         }
206
207         if(__pDTMFKeypad == null)
208         {
209                 //update rect according to client screen area
210                 Rectangle rect(0, 0, 0, 0);
211                 if (GetOrientationStatus() == ORIENTATION_STATUS_PORTRAIT)
212                 {
213                         rect.width = GetClientAreaBounds().width;
214                         rect.height = GetClientAreaBounds().height - __pCallButtonsPanel->GetHeight();
215                 }
216                 else if (GetOrientationStatus() == ORIENTATION_STATUS_LANDSCAPE)
217                 {
218                         rect.height = GetClientAreaBounds().height;
219                         rect.width = GetClientAreaBounds().width - __pCallButtonsPanel->GetWidth();
220                 }
221
222                 AppLog("rect(%d,%d,%d,%d)",rect.x,rect.y,rect.width,rect.height);
223                 __pDTMFKeypad = new (std::nothrow) DtmfKeyPadPanel();
224                 __pDTMFKeypad->Initialize(this, rect);
225                 AddControl(*__pDTMFKeypad);
226         }
227         EditField* pTextBox = static_cast<EditField*>(__pDTMFKeypad->GetControl(IDC_TEXTBOX));
228         pTextBox->SetText(L"");
229         __pDTMFKeypad->SetShowState(true);
230         __pDTMFKeypad->Draw(true);
231         __pDTMFKeypad->Show();
232 }
233
234 void
235 ActiveCallForm::OnOrientationChanged(const Tizen::Ui::Control& source, Tizen::Ui::OrientationStatus orientationStatus)
236 {
237         AppLog("ENTER");
238
239         if (__pCallButtonsPanel != null)
240         {
241                 //update position of call buttons panel
242                 Label* pKeysBgLbl = static_cast<Label*>(GetControl(IDC_KEY_BG_LABEL, true));
243                 __pCallButtonsPanel->SetBounds(pKeysBgLbl->GetBounds());
244
245                 //bring button on top
246                 __pCallButtonsPanel->SetButtonPosition();
247
248                 RelativeLayout* pRelativeLayout = dynamic_cast<RelativeLayout*>(GetPortraitLayoutN());
249                 if (pRelativeLayout != null)
250                 {
251                         pRelativeLayout->SetRelation(*__pCallButtonsPanel, *pKeysBgLbl, RECT_EDGE_RELATION_BOTTOM_TO_BOTTOM);
252                 }
253
254                 pRelativeLayout = dynamic_cast<RelativeLayout*>(GetLandscapeLayoutN());
255                 if (pRelativeLayout != null)
256                 {
257                         pRelativeLayout->SetRelation(*__pCallButtonsPanel, *pKeysBgLbl, RECT_EDGE_RELATION_LEFT_TO_LEFT);
258                         pRelativeLayout->SetRelation(*__pCallButtonsPanel, *pKeysBgLbl, RECT_EDGE_RELATION_RIGHT_TO_RIGHT);
259                 }
260
261                 //change orientation of DTMF Keypad, if it is visible.
262                 if (__pDTMFKeypad != null)
263                 {
264                         if (orientationStatus == ORIENTATION_STATUS_LANDSCAPE)
265                         {
266                                 //in landscape mode, caller info is visible.
267                                 SetShowStateOnKeypad(true);
268                         }
269                         else if (orientationStatus == ORIENTATION_STATUS_PORTRAIT)
270                         {
271                                 //in Portrait mode it is hidden beneath DTMF Keypad.
272                                 SetShowStateOnKeypad(false);
273                         }
274                         String dtmfText = static_cast<EditField*>(__pDTMFKeypad->GetControl(IDC_TEXTBOX))->GetText();
275                         ShowDTMFKeypad();
276                         //get new text box.
277                         EditField* pTextBox = static_cast<EditField*>(__pDTMFKeypad->GetControl(IDC_TEXTBOX));
278                         pTextBox->SetText(dtmfText);
279                 }
280         }
281 }
282
283 void
284 ActiveCallForm::HideDTMFKeypad(void)
285 {
286         if(__pDTMFKeypad != null)
287         {
288                 RemoveControl(*__pDTMFKeypad);
289                 __pDTMFKeypad = null;
290         }
291 }
292
293 result
294 ActiveCallForm::InitializeCallButtonsPanel(void)
295 {
296         result r = E_SUCCESS;
297         //Set background bitmap for call keypad
298         Label* pKeysBgLbl = static_cast<Label*>(GetControl(IDC_KEY_BG_LABEL, true));
299         Bitmap* pBgBitmap = AppUtility::GetBitmapFromResourcesN(IDB_BACKGROUND_BITMAP, pKeysBgLbl->GetWidth(), pKeysBgLbl->GetHeight());
300         if (pBgBitmap != null)
301         {
302                 pKeysBgLbl->SetBackgroundBitmap(*pBgBitmap);
303         }
304
305         if (__pCallButtonsPanel == null)
306         {
307                 __pCallButtonsPanel = new (std::nothrow) CallButtonsPanel();
308                 __pCallButtonsPanel->ConstructPanel(this, __formType);
309                 __pCallButtonsPanel->SetBounds(pKeysBgLbl->GetBounds());
310                 r = AddControl(*__pCallButtonsPanel);
311         }
312
313         RelativeLayout* pRelativeLayout = dynamic_cast<RelativeLayout*>(GetPortraitLayoutN());
314         if (pRelativeLayout != null)
315         {
316                 pRelativeLayout->SetRelation(*__pCallButtonsPanel, *pKeysBgLbl, RECT_EDGE_RELATION_BOTTOM_TO_BOTTOM);
317         }
318         pRelativeLayout = dynamic_cast<RelativeLayout*>(GetLandscapeLayoutN());
319         if (pRelativeLayout != null)
320         {
321                 pRelativeLayout->SetRelation(*__pCallButtonsPanel, *pKeysBgLbl, RECT_EDGE_RELATION_LEFT_TO_LEFT);
322                 pRelativeLayout->SetRelation(*__pCallButtonsPanel, *pKeysBgLbl, RECT_EDGE_RELATION_RIGHT_TO_RIGHT);
323         }
324
325         return r;
326 }
327
328 void
329 ActiveCallForm::InitializeSwapButton(void)
330 {
331         Button* pSwapBtn = static_cast<Button*>(GetControl(IDC_SWAP_BUTTON));
332         if (pSwapBtn)
333         {
334                 Bitmap* pSwapBmp = AppUtility::GetBitmapFromResourcesN(IDB_SWAP_ICON_NORMAL,
335                                                                                                                            W_HOLD_BITMAP, H_HOLD_BITMAP);
336                 if (pSwapBmp)
337                 {
338                         pSwapBtn->SetNormalBitmap(Point(0, 0), *pSwapBmp);
339                 }
340                 delete pSwapBmp;
341                 pSwapBmp = null;
342
343                 pSwapBmp = AppUtility::GetBitmapFromResourcesN(IDB_SWAP_ICON_PRESS,
344                                                                                                            W_HOLD_BITMAP, H_HOLD_BITMAP);
345                 if (pSwapBmp)
346                 {
347                         pSwapBtn->SetPressedBitmap(Point(0, 0), *pSwapBmp);
348                 }
349                 delete pSwapBmp;
350                 pSwapBmp = null;
351                 pSwapBtn->SetActionId(IDA_SWAP_CALLS);
352                 pSwapBtn->AddActionEventListener(*this);
353         }
354 }
355
356 void
357 ActiveCallForm::InitializeManageConfCallButton(void)
358 {
359         Button* pMoreBtn = static_cast<Button*>(GetControl(IDC_CONF_CALL_MORE_BUTTON));
360         if (pMoreBtn != null)
361         {
362                 pMoreBtn->SetActionId(IDA_MORE_OPTIONS_MENU);
363                 pMoreBtn->AddActionEventListener(*this);
364                 if (__formType == FORMTYPE_MULTIPLECALLS)
365                 {
366                         //Correct state will be set in OnSceneActivated based on the call
367                         pMoreBtn->SetShowState(false);
368                 }
369                 else if (__formType == FORMTYPE_ACTIVECONFCALL)
370                 {
371                         pMoreBtn->SetShowState(true);
372                 }
373         }
374 }
375
376 void
377 ActiveCallForm::InitializeHoldButton(void)
378 {
379         Button* pHoldBtn = static_cast<Button*>(GetControl(IDC_HOLD_BUTTON));
380         if (pHoldBtn != null)
381         {
382                 //set status of Hold Button
383                 SetHoldButtonStatus(true);
384                 pHoldBtn->AddActionEventListener(*this);
385         }
386 }
387
388 void
389 ActiveCallForm::SetHoldButtonStatus(bool toHoldCall)
390 {
391         //background bitmap & button name
392         String btnName("");
393         Bitmap* normalImg = null;
394         Bitmap* pressImg = null;
395         if (toHoldCall)
396         {
397                 btnName.Append(AppUtility::GetResourceString(IDS_HOLD_BTN_NAME));
398                 normalImg = AppUtility::GetBitmapFromResourcesN(IDB_HOLD_NORMAL_BUTTON_ICON,
399                                                                                                                 W_HOLD_BITMAP, H_HOLD_BITMAP);
400                 pressImg = AppUtility::GetBitmapFromResourcesN(IDB_HOLD_PRESS_BUTTON_ICON,
401                                                                                                            W_HOLD_BITMAP, H_HOLD_BITMAP);
402         }
403         else
404         {
405                 btnName.Append(AppUtility::GetResourceString(IDS_UNHOLD_BTN_NAME));
406                 normalImg = AppUtility::GetBitmapFromResourcesN(IDB_UNHOLD_NORMAL_BUTTON_ICON,
407                                                                                                                 W_HOLD_BITMAP, H_HOLD_BITMAP);
408                 pressImg = AppUtility::GetBitmapFromResourcesN(IDB_UNHOLD_PRESS_BUTTON_ICON,
409                                                                                                            W_HOLD_BITMAP, H_HOLD_BITMAP);
410         }
411
412         //Action id
413         CommandIds cmdId = IDA_HOLD_CALL;
414         switch (__formType)
415         {
416         case FORMTYPE_ACTIVECALL:
417         {
418                 cmdId = toHoldCall ? IDA_HOLD_CALL : IDA_UNHOLD_CALL;
419         }
420         break;
421
422         case FORMTYPE_ACTIVECONFCALL:
423         {
424                 cmdId = toHoldCall ? IDA_HOLD_CONF_CALL : IDA_UNHOLD_CONF_CALL;
425         }
426         break;
427
428         default:
429                 break;
430         }
431
432         //set background bitmap, button name & action id
433         Button* pHoldBtn = static_cast<Button*>(GetControl(IDC_HOLD_BUTTON));
434         Label* pHoldLbl = static_cast<Label*>(GetControl(IDC_HOLD_LABEL));
435         if (pHoldBtn)
436         {
437                 pHoldBtn->SetActionId(cmdId);
438                 pHoldBtn->SetNormalBitmap(Point(0, 0),*normalImg);
439                 pHoldBtn->SetPressedBitmap(Point(0, 0),*pressImg);
440         }
441         if (pHoldLbl)
442         {
443                 pHoldLbl->SetText(btnName);
444                 pHoldLbl->Invalidate(true);
445         }
446
447         //free the resources
448         delete normalImg;
449         normalImg = null;
450         delete pressImg;
451         pressImg = null;
452 }
453
454 void
455 ActiveCallForm::CreateMoreOptionsMenuList(void)
456 {
457         //create option list anchor
458         if (__pMoreOptionsListAnchor == null)
459         {
460                 Bitmap* pBgPopupArwBmp = AppUtility::GetBitmapFromResourcesN(IDB_POPUP_ARROW_ICON, W_OPTION_ANCHOR,
461                                                                                                                                          H_OPTION_ANCHOR);
462                 __pMoreOptionsListAnchor = new (std::nothrow) Label();
463                 __pMoreOptionsListAnchor->Construct(Rectangle(GetWidth()-W_RIGHT_MORE_ICON_MARGIN - W_MORE_ICON, Y_POPUP_ANCHOR, W_POPUP_ANCHOR, H_POPUP_ANCHOR), L"");
464                 __pMoreOptionsListAnchor->SetBackgroundBitmap(*pBgPopupArwBmp);
465
466                 delete pBgPopupArwBmp;
467                 pBgPopupArwBmp = null;
468
469                 // Adds a Label to the Form
470                 AddControl(*__pMoreOptionsListAnchor);
471         }
472
473         //create options menu list
474         if (__pMoreOptionsList == null)
475         {
476                 __pMoreOptionsList = new (std::nothrow) ListView();
477                 __pMoreOptionsList->Construct(Rectangle(Point(GetWidth()-W_RIGHT_MORE_ICON_MARGIN - W_MORE_LABEL,H_MORE_LABEL), IDI_OPTIONMENU_DIMEN), false, SCROLL_STYLE_FADE_OUT);
478                 __pMoreOptionsList->SetItemProvider(*this);
479                 __pMoreOptionsList->AddListViewItemEventListener(*this);
480                 //Add option list to the form
481                 AddControl(*__pMoreOptionsList);
482         }
483         else
484         {
485                 //Hide option menu list
486                 DestroyMoreOptionsMenuList();
487         }
488 }
489
490 void
491 ActiveCallForm::DestroyMoreOptionsMenuList(void)
492 {
493         if (__pMoreOptionsListAnchor != null)
494         {
495                 //removes and delete the child control
496                 RemoveControl(*__pMoreOptionsListAnchor);
497                 __pMoreOptionsListAnchor = null;
498         }
499
500         if (__pMoreOptionsList != null)
501         {
502                 //removes and delete the child control
503                 RemoveControl(*__pMoreOptionsList);
504                 __pMoreOptionsList = null;
505         }
506 }
507
508 result
509 ActiveCallForm::OnTerminating(void)
510 {
511         result r = E_SUCCESS;
512         if (__pCallPresentor != null)
513         {
514                 __pCallPresentor = null;
515         }
516         return r;
517 }
518
519 void
520 ActiveCallForm::OnActionPerformed(const Control& source, int actionId)
521 {
522
523         String dtmfString;
524         switch (actionId)
525         {
526         case IDA_END_CALL:
527         {
528                 //End the currently active / dialing call
529                 if (__pActiveCallInfo->IsConferenceCall() == false)
530                 {
531                         String activeContactNo;
532                         activeContactNo.Append(__pActiveCallInfo->GetContactNumber());
533                         //Check if it is call is in dialing state, then
534                         if (__formType == FORMTYPE_EMERGENCYOUTGOINGCALL || __formType == FORMTYPE_OUTGOINGCALL)
535                         {
536                                 __pCallPresentor->EndDialingCall(activeContactNo);
537                         }
538                         else
539                         {
540                                 //end active calls
541                                 __pCallPresentor->EndActiveCall(*__pActiveCallInfo->GetCallHandle());
542                         }
543                 }
544                 else
545                 {
546                         __pCallPresentor->EndConferenceCall();
547                 }
548         }
549         break;
550
551         case IDA_END_CONF_CALL:
552         {
553                 AppAssert(__formType == FORMTYPE_ACTIVECONFCALL);
554                 __pCallPresentor->EndConferenceCall();
555         }
556         break;
557
558         case IDA_OPEN_NUMKEYPAD:
559         {
560                 if (GetOrientationStatus() == ORIENTATION_STATUS_PORTRAIT)
561                 {
562                         //hide only in portrait mode.
563                 SetShowStateOnKeypad(false);
564                 }
565                 ShowDTMFKeypad();
566                 SetTextToDTMFTextField(L"");
567                 __pCallButtonsPanel->SetKeypadButtonState(IDA_CLOSE_NUMKEYPAD);
568         }
569         break;
570
571         case IDA_CLOSE_NUMKEYPAD:
572         {
573                 SetShowStateOnKeypad(true);
574                 HideDTMFKeypad();
575                 __pCallButtonsPanel->SetKeypadButtonState(IDA_OPEN_NUMKEYPAD);
576         }
577         break;
578
579         case IDA_ADD_CALL:
580         {
581                 //switch to Dialer Form to make an call
582                 if(__pCallPresentor->GetCurrentCallCount() == 1)
583                 {
584 /*              ArrayList* pArgs = new (std::nothrow) ArrayList(SingleObjectDeleter);
585                 pArgs->Construct();
586                 String* formType = new (std::nothrow) String();
587                 formType->Append(__formType);
588                 pArgs->Add(formType);
589                 pSceneManager->GoForward( ForwardSceneTransition(IDSCN_DIALER, SCENE_TRANSITION_ANIMATION_TYPE_NONE,
590                                 SCENE_HISTORY_OPTION_NO_HISTORY), pArgs);*/
591                         __pCallPresentor->LaunchDialAppControl();
592
593                 }
594         }
595         break;
596
597         case IDA_HOLD_CALL:
598         {
599                 bool success = true;
600                 if (__pActiveCallInfo->IsConferenceCall() == false)
601                 {
602                         if(__pActiveCallInfo->GetCallHandle() != null)
603                         {
604                                 success = __pCallPresentor->HoldCall(*__pActiveCallInfo->GetCallHandle());
605                         }
606                 }
607                 else
608                 {
609                         success = __pCallPresentor->HoldConferenceCall();
610                 }
611                 //reset hold status and "OnHold" text
612                 ShowTimerInfo(IDC_CALLER1_TIME_LABEL, success);
613                 if(__pActiveCallTimer != null)
614                 {
615                         __pActiveCallTimer->Cancel();
616                 }
617                 SetHoldButtonStatus(!success);
618         }
619         break;
620
621         case IDA_UNHOLD_CALL:
622         {
623                 bool success = false;
624                 if (__pActiveCallInfo->IsConferenceCall() == false)
625                 {
626                         if(__pActiveCallInfo->GetCallHandle() != null)
627                         {
628                                 success = __pCallPresentor->UnHoldCall(*__pActiveCallInfo->GetCallHandle());
629                         }
630                 }
631                 else
632                 {
633                         success = __pCallPresentor->ActivateConferenceCall();
634                 }
635                 //reset hold status and show call timer
636                 ShowTimerInfo(IDC_CALLER1_TIME_LABEL, !success, __activeCallStartTime);
637                 SetHoldButtonStatus(success);
638         }
639         break;
640
641         case IDA_HOLD_CONF_CALL:
642         {
643                 AppAssert(__formType == FORMTYPE_ACTIVECONFCALL);
644                 bool success = __pCallPresentor->HoldConferenceCall();
645                 //reset hold status and "OnHold" text
646                 SetHoldButtonStatus(!success);
647                 ShowTimerInfo(IDC_CALLER1_TIME_LABEL, success);
648                 if(__pActiveCallTimer != null)
649                 {
650                         __pActiveCallTimer->Cancel();
651                 }
652         }
653         break;
654
655         case IDA_UNHOLD_CONF_CALL:
656         {
657                 AppAssert(__formType == FORMTYPE_ACTIVECONFCALL);
658                 bool success = __pCallPresentor->ActivateConferenceCall();
659                 //reset hold status and show call timer
660                 ShowTimerInfo(IDC_CALLER1_TIME_LABEL, !success, __activeCallStartTime);
661                 SetHoldButtonStatus(success);
662         }
663         break;
664
665         case IDA_OPEN_CONTACTS:
666         {
667                 //Open Contacts APP
668                 //Launch call application
669                 AppManager* pAppManager = AppManager::GetInstance();
670                 pAppManager->LaunchApplication(PROVIDER_ID_CONTACTS);
671         }
672                 break;
673
674         case IDA_MUTE:
675         {
676                 bool success = __pCallPresentor->SetMuteStatus(true);
677                 if (success)
678                 {
679                         __pCallButtonsPanel->SetMuteButtonState(IDA_UNMUTE);
680                 }
681         }
682         break;
683
684         case IDA_UNMUTE:
685         {
686                 bool success = __pCallPresentor->SetMuteStatus(false);
687                 if (success)
688                 {
689                         __pCallButtonsPanel->SetMuteButtonState(IDA_MUTE);
690                 }
691         }
692         break;
693
694         case IDA_SPEAKER:
695         {
696                 bool success = __pCallPresentor->SetSpeakerStatus(true);
697                 if (success)
698                 {
699                         __pCallButtonsPanel->SetSpeakerButtonState(IDA_SPEAKER_OFF);
700                 }
701         }
702         break;
703
704         case IDA_SPEAKER_OFF:
705         {
706                 bool success = __pCallPresentor->SetSpeakerStatus(false);
707                 if (success)
708                 {
709                         __pCallButtonsPanel->SetSpeakerButtonState(IDA_SPEAKER);
710                 }
711         }
712         break;
713
714         case IDA_JOIN_CALL:
715         {
716                 AppAssert(__formType == FORMTYPE_MULTIPLECALLS);
717                 __pCallPresentor->JoinCall();
718         }
719         break;
720
721         case IDA_SWAP_CALLS:
722         {
723                 AppAssert(__formType == FORMTYPE_MULTIPLECALLS);
724                 __pCallPresentor->SwapCalls();
725         }
726         break;
727
728         case IDA_MORE_OPTIONS_MENU:
729         {
730                 //Show 'more' options menu
731                 CreateMoreOptionsMenuList();
732         }
733         break;
734
735         case NUM_KEY0:
736         {
737                 dtmfString.Append(L"0");
738                 SetTextToDTMFTextField(dtmfString);
739                 __pCallPresentor->SendDTMFSignal(dtmfString);
740         }
741         break;
742
743         case NUM_KEY1:
744         {
745                 dtmfString.Append(L"1");
746                 SetTextToDTMFTextField(dtmfString);
747                 __pCallPresentor->SendDTMFSignal(dtmfString);
748         }
749         break;
750
751         case NUM_KEY2:
752         {
753                 dtmfString.Append(L"2");
754                 SetTextToDTMFTextField(dtmfString);
755                 __pCallPresentor->SendDTMFSignal(dtmfString);
756         }
757         break;
758
759         case NUM_KEY3:
760         {
761                 dtmfString.Append(L"3");
762                 SetTextToDTMFTextField(dtmfString);
763                 __pCallPresentor->SendDTMFSignal(dtmfString);
764         }
765         break;
766
767         case NUM_KEY4:
768         {
769                 dtmfString.Append(L"4");
770                 SetTextToDTMFTextField(dtmfString);
771                 __pCallPresentor->SendDTMFSignal(dtmfString);
772         }
773         break;
774
775         case NUM_KEY5:
776         {
777                 dtmfString.Append(L"5");
778                 SetTextToDTMFTextField(dtmfString);
779                 __pCallPresentor->SendDTMFSignal(dtmfString);
780         }
781         break;
782
783         case NUM_KEY6:
784         {
785                 dtmfString.Append(L"6");
786                 SetTextToDTMFTextField(dtmfString);
787                 __pCallPresentor->SendDTMFSignal(dtmfString);
788         }
789         break;
790
791         case NUM_KEY7:
792         {
793                 dtmfString.Append(L"7");
794                 SetTextToDTMFTextField(dtmfString);
795                 __pCallPresentor->SendDTMFSignal(dtmfString);
796         }
797         break;
798
799         case NUM_KEY8:
800         {
801                 dtmfString.Append(L"8");
802                 SetTextToDTMFTextField(dtmfString);
803                 __pCallPresentor->SendDTMFSignal(dtmfString);
804         }
805         break;
806
807         case NUM_KEY9:
808         {
809                 dtmfString.Append(L"9");
810                 SetTextToDTMFTextField(dtmfString);
811                 __pCallPresentor->SendDTMFSignal(dtmfString);
812         }
813         break;
814
815         case PAUSE_KEY:
816         {
817                 dtmfString.Append(L"*");
818                 SetTextToDTMFTextField(dtmfString);
819                 __pCallPresentor->SendDTMFSignal(dtmfString);
820         }
821         break;
822
823         case HASH_KEY:
824         {
825                 dtmfString.Append(L"#");
826                 SetTextToDTMFTextField(dtmfString);
827                 __pCallPresentor->SendDTMFSignal(dtmfString);
828         }
829         break;
830
831         default:
832                 break;
833         }
834 }
835
836 void
837 ActiveCallForm::SetTextToDTMFTextField(const String& dtmfStr)
838 {
839         if(__pDTMFKeypad != null)
840         {
841                 EditField* pTextBox = static_cast<EditField*>(__pDTMFKeypad->GetControl(IDC_TEXTBOX));
842
843                 int startpos=-1,endpos=-1;
844                 pTextBox->GetBlockRange(startpos,endpos);
845                 if(startpos != -1)
846                 {
847                         pTextBox->Remove();
848                         pTextBox->ReleaseBlock();
849                 }
850
851                 pTextBox->InsertTextAtCursorPosition(dtmfStr);
852                 //pTextBox->AppendText(dtmfStr);
853                 pTextBox->SetFocus();
854                 pTextBox->Invalidate(true);
855         }
856 }
857
858 void
859 ActiveCallForm::OnSceneActivatedN(const SceneId& previousSceneId, const SceneId& currentSceneId, IList* pArgs)
860 {
861         AppLog("ENTER");
862         //set itself as listener
863         __pCallPresentor->SetTelEventListener(this);
864         AddOrientationEventListener(*this);
865
866         //Initialize keypad and buttons
867         InitializeCallButtonsPanel();
868
869         if (__pActiveCallInfo != null)
870         {
871                 delete __pActiveCallInfo;
872                 __pActiveCallInfo = null;
873         }
874         if (__pHeldCallInfo != null)
875         {
876                 delete __pHeldCallInfo;
877                 __pHeldCallInfo = null;
878         }
879         DestroyMoreOptionsMenuList();
880
881         switch (__formType)
882         {
883         case FORMTYPE_OUTGOINGCALL:
884         {
885                 String contactNo;
886                 contactNo.Append(*(static_cast<String*>(pArgs->GetAt(0))));
887                 __pActiveCallInfo = new (std::nothrow) CallInfo();
888                 __pActiveCallInfo->SetContactNumber(contactNo);
889                 Contact* pContact = __pCallPresentor->GetContactN(contactNo);
890                 if (pContact != null)
891                 {
892                         __pActiveCallInfo->SetContactInfo(*pContact);
893                         delete pContact;
894                 }
895                 ShowPersonDetails(contactNo, IDC_NUMBER1_LABEL, IDC_CALLER1_LABEL, false,__pActiveCallInfo);
896                 //make an normal outgoing call
897                 __pCallPresentor->DialCall(contactNo, false);
898         }
899         break;
900
901         case FORMTYPE_EMERGENCYOUTGOINGCALL:
902         {
903                 String* pContactNo = static_cast<String*>(pArgs->GetAt(0));
904                 __pActiveCallInfo = new (std::nothrow) CallInfo();
905                 long long phNumber = 0;
906                 LongLong::Parse(*pContactNo, phNumber);
907                 __pActiveCallInfo->SetContactNumber(*pContactNo);
908                 //make an emergency call
909                 __pCallPresentor->DialCall(*pContactNo, true);
910         }
911         break;
912
913         case FORMTYPE_ACTIVECALL:
914         {
915                 //get contact number
916                 CallInfo* pCall = static_cast<CallInfo*>(pArgs->GetAt(0));
917
918                 __pActiveCallInfo = new (std::nothrow) CallInfo();
919                 *__pActiveCallInfo =  *pCall;
920                 String activeContactNo;
921                 if(pCall->GetContactNumber().IsEmpty() == false)
922                 {
923                         activeContactNo.Append(pCall->GetContactNumber());
924                 }
925                 else
926                 {
927                         activeContactNo.Append(AppUtility::GetResourceString(IDS_NUMBER_UNKNOWN));
928                 }
929                 ShowPersonDetails(activeContactNo, IDC_NUMBER1_LABEL, IDC_CALLER1_LABEL, false,__pActiveCallInfo);
930
931                 //show call active time using Timer
932                 __activeCallStartTime = pCall->GetCallConnectTime();
933                 ShowTimerInfo(IDC_CALLER1_TIME_LABEL, pCall->IsOnHold(), __activeCallStartTime);
934         }
935         break;
936
937         case FORMTYPE_EMERGENCYACTIVECALL:
938         {
939                 //get contact number
940                 CallInfo* pCall = static_cast<CallInfo*>(pArgs->GetAt(0));
941
942                 __pActiveCallInfo = new (std::nothrow) CallInfo();
943                 *__pActiveCallInfo =  *pCall;
944
945                 //show call active time using Timer
946                 __activeCallStartTime = pCall->GetCallConnectTime();
947                 ShowTimerInfo(IDC_CALLER1_TIME_LABEL, pCall->IsOnHold(), __activeCallStartTime);
948         }
949         break;
950
951         case FORMTYPE_MULTIPLECALLS:
952         {
953                 IListT<CallInfo>* pCallsList = __pCallPresentor->GetCallListN();
954                 //update calls state
955                 UpdateMultipleCallScreen(*pCallsList);
956                 delete pCallsList;
957                 pCallsList = null;
958         }
959         break;
960
961         case FORMTYPE_ACTIVECONFCALL:
962         {
963                 //get Conf call
964                 CallInfo* pConfInfo = static_cast<CallInfo*>(pArgs->GetAt(0));
965                 __pActiveCallInfo = new (std::nothrow) CallInfo();
966                 *__pActiveCallInfo =  *pConfInfo;
967
968                 int participantsCount = __pActiveCallInfo->GetCallerListCount();
969
970                 // show participant count on name Label
971                 Label* pPeopleCountLbl = static_cast<Label*>(GetControl(IDC_PARTICIPANTS_LABEL));
972                 if (pPeopleCountLbl)
973                 {
974                         String count;
975                         count.Append(participantsCount);
976                         count.Append(" ");
977                         count.Append(AppUtility::GetResourceString(IDS_PEOPLE_STR));
978                         pPeopleCountLbl->SetText(count);
979                 }
980
981                 if(participantsCount >= IDI_MAX_CONF_CALL_PARTICIPANTS)
982                 {
983                         __pCallButtonsPanel->EnableAddCallButton(false);
984                 }
985                 else
986                 {
987                         __pCallButtonsPanel->EnableAddCallButton(true);
988                 }
989
990                 //show call active time using Timer
991                 __activeCallStartTime = __pActiveCallInfo->GetCallConnectTime();
992                 ShowTimerInfo(IDC_CALLER1_TIME_LABEL, __pActiveCallInfo->IsOnHold(),__activeCallStartTime);
993         }
994         break;
995
996         default:
997                 break;
998         }
999
1000         //Hide DTMFKeypad, if visible and show caller info
1001         HideDTMFKeypad();
1002         SetShowStateOnKeypad(true);
1003         __pCallButtonsPanel->SetKeypadButtonState(IDA_OPEN_NUMKEYPAD);
1004
1005         //Set the correct speaker status
1006         if(__pCallPresentor->IsSpeakerOn() == true)
1007         {
1008                 __pCallButtonsPanel->SetSpeakerButtonState(IDA_SPEAKER_OFF);
1009         }
1010         else
1011         {
1012                 __pCallButtonsPanel->SetSpeakerButtonState(IDA_SPEAKER);
1013         }
1014
1015         //Set the correct Mute status
1016         if (__pCallPresentor->IsCallMuted() == true)
1017         {
1018                 __pCallButtonsPanel->SetMuteButtonState(IDA_UNMUTE);
1019         }
1020         else
1021         {
1022                 __pCallButtonsPanel->SetMuteButtonState(IDA_MUTE);
1023         }
1024
1025         if (pArgs)
1026         {
1027                 pArgs->RemoveAll();
1028                 delete pArgs;
1029                 pArgs = null;
1030         }
1031 }
1032
1033 void
1034 ActiveCallForm::OnSceneDeactivated(const SceneId& currentSceneId, const SceneId& nextSceneId)
1035 {
1036         RemoveOrientationEventListener(*this);
1037         if (__pCallButtonsPanel != null)
1038         {
1039                 RemoveControl(*__pCallButtonsPanel);
1040                 __pCallButtonsPanel = null;
1041         }
1042         if (__pActiveCallTimer != null)
1043         {
1044                 __pActiveCallTimer->Cancel();
1045                 delete __pActiveCallTimer;
1046                 __pActiveCallTimer = null;
1047         }
1048         if (__pSmallPhotoLabel != null)
1049         {
1050                 __pSmallPhotoLabel->SetShowState(false);
1051         }
1052         //Hide "Manage conf. Call" Context menu
1053         if (__pMoreOptionsListAnchor != null)
1054         {
1055                 __pMoreOptionsListAnchor->SetShowState(false);
1056         }
1057         if (__pMoreOptionsList != null)
1058         {
1059                 __pMoreOptionsList->SetShowState(false);
1060         }
1061 }
1062
1063 void
1064 ActiveCallForm::HandleConfCallChanged(void)
1065 {
1066         AppLog("ENTER");
1067         AppAssert((__formType == FORMTYPE_ACTIVECONFCALL) || (__formType == FORMTYPE_MULTIPLECALLS));
1068         //fetch changed conference call info
1069         CallInfo* pConfCallInfo = __pCallPresentor->GetConferenceCallInfoN();
1070         if (pConfCallInfo == null)
1071         {
1072                 AppLog("EXIT");
1073                 return;
1074         }
1075
1076         //fetch participant count in conf call
1077         int participantsCount = pConfCallInfo->GetCallerListCount();
1078         //update status of join and Add call
1079         bool isEnableAddCall = false;
1080         bool isEnableJoinCall = false;
1081         if(participantsCount < IDI_MAX_CONF_CALL_PARTICIPANTS)
1082         {
1083                 //available only at Active conf. call or active call screen
1084                 isEnableAddCall = true;
1085                 //join button is available only at multiple call screen
1086                 isEnableJoinCall = true;
1087         }
1088
1089         Label* pPeopleCountLbl = null;
1090         if (__pActiveCallInfo != null && __pActiveCallInfo->IsConferenceCall() == true)
1091         {
1092                 //Active call is conference call
1093                 delete __pActiveCallInfo;
1094                 __pActiveCallInfo = new (std::nothrow) CallInfo();
1095                 *__pActiveCallInfo = *pConfCallInfo;
1096
1097                 if (__formType == FORMTYPE_MULTIPLECALLS)
1098                 {
1099                         pPeopleCountLbl = static_cast<Label*>(GetControl(IDC_NUMBER1_LABEL));
1100                 }
1101                 else if (__formType == FORMTYPE_ACTIVECONFCALL)
1102                 {
1103                         pPeopleCountLbl = static_cast<Label*>(GetControl(IDC_PARTICIPANTS_LABEL));
1104                         AppLog("Active conf call...(%d)", pPeopleCountLbl);
1105                 }
1106         }
1107         else if(__pHeldCallInfo != null && __pHeldCallInfo->IsConferenceCall() == true)
1108         {
1109                 //Held call is conference call - this is definitely multiple call screen.
1110                 delete __pHeldCallInfo;
1111                 __pHeldCallInfo = new (std::nothrow) CallInfo();
1112                 *__pHeldCallInfo = *pConfCallInfo;
1113                 pPeopleCountLbl = static_cast<Label*>(GetControl(IDC_NUMBER2_LABEL));
1114         }
1115
1116         // update participant count on name Label
1117         if (pPeopleCountLbl != null)
1118         {
1119                 String count;
1120                 count.Append(participantsCount);
1121                 count.Append(" ");
1122                 count.Append(AppUtility::GetResourceString(IDS_PEOPLE_STR));
1123                 pPeopleCountLbl->SetText(count);
1124                 pPeopleCountLbl->Invalidate(true);
1125         }
1126         //change AddCall Button status
1127         __pCallButtonsPanel->EnableAddCallButton(isEnableAddCall);
1128         //change JoinCall Button status
1129         __pCallButtonsPanel->EnableJoinCallButton(isEnableJoinCall);
1130         AppLog("EXIT");
1131 }
1132
1133 void
1134 ActiveCallForm::UpdateMultipleCallScreen(Tizen::Base::Collection::IListT<CallInfo>& activeCallsList)
1135 {
1136         AppLog("ENTER");
1137         if(__pActiveCallInfo != null)
1138         {
1139                 delete __pActiveCallInfo;
1140                 __pActiveCallInfo = null;
1141         }
1142         if(__pHeldCallInfo != null)
1143         {
1144                 delete __pHeldCallInfo;
1145                 __pHeldCallInfo = null;
1146         }
1147
1148         Button* pMoreBtn = static_cast<Button*>(GetControl(IDC_CONF_CALL_MORE_BUTTON));
1149         if (pMoreBtn != null)
1150         {
1151                 pMoreBtn->SetShowState(false);
1152         }
1153
1154         //show caller's info.
1155         for (int index = 0; index < activeCallsList.GetCount(); index++)
1156         {
1157                 //Fetch call info
1158                 CallInfo callInfo;
1159                 activeCallsList.GetAt(index, callInfo);
1160
1161                 String contactNo;
1162                 if(callInfo.GetContactNumber().IsEmpty() == false)
1163                 {
1164                         contactNo.Append(callInfo.GetContactNumber());
1165                 }
1166                 else
1167                 {
1168                         contactNo.Append(AppUtility::GetResourceString(IDS_NUMBER_UNKNOWN));
1169                 }
1170
1171                 if (callInfo.IsOnHold() == false)
1172                 {
1173                         __pActiveCallInfo = new (std::nothrow) CallInfo();
1174                         *__pActiveCallInfo =  callInfo;
1175
1176                         if (__pActiveCallInfo->IsConferenceCall() == false)
1177                         {
1178                                 Label* pVoiceIconLbl = static_cast<Label*>(GetControl(IDC_VOICE_CALL_ICON_LABEL));
1179                                 if (pVoiceIconLbl)
1180                                 {
1181                                         pVoiceIconLbl->SetShowState(true);
1182                                 }
1183                                 if (pMoreBtn != null)
1184                                 {
1185                                         pMoreBtn->SetShowState(false);
1186                                 }
1187                                 ShowPersonDetails(contactNo, IDC_NUMBER1_LABEL, IDC_CALLER1_LABEL, false,__pActiveCallInfo);
1188                         }
1189                         else
1190                         {
1191                                 // show participant count on name Label
1192                                 Label* pPeopleCountLbl = static_cast<Label*>(GetControl(IDC_NUMBER1_LABEL));
1193                                 if (pPeopleCountLbl)
1194                                 {
1195                                         String count;
1196                                         count.Append(__pActiveCallInfo->GetCallerListCount());
1197                                         count.Append(" ");
1198                                         count.Append(AppUtility::GetResourceString(IDS_PEOPLE_STR));
1199                                         pPeopleCountLbl->SetText(count);
1200                                 }
1201                                 String nameStr = AppUtility::GetResourceString(L"IDS_CONFERENCE_CALL_STRING");
1202                                 Label* pNameLbl = static_cast<Label*>(GetControl(IDC_CALLER1_LABEL));
1203                                 if (pNameLbl)
1204                                 {
1205                                         pNameLbl->SetText(nameStr);
1206                                 }
1207                                 Label* pVoiceIconLbl = static_cast<Label*>(GetControl(IDC_VOICE_CALL_ICON_LABEL));
1208                                 if (pVoiceIconLbl)
1209                                 {
1210                                         pVoiceIconLbl->SetShowState(false);
1211                                 }
1212                                 if (pMoreBtn != null)
1213                                 {
1214                                         pMoreBtn->SetShowState(true);
1215                                 }
1216                                 Bitmap* pPhotoBitmap = AppUtility::GetBitmapFromResourcesN(IDB_CONFERENCE_BG_ICON,W_CONFERENCE_PHOTO,H_CONFERENCE_PHOTO);
1217                                 if (pPhotoBitmap != null)
1218                                 {
1219                                         Label* pPhotoLbl = static_cast<Label*>(GetControl(IDC_CALLER1_PHOTO_LABEL));
1220                                         if (pPhotoLbl)
1221                                         {
1222                                                 pPhotoLbl->SetBackgroundBitmap(*pPhotoBitmap);
1223                                                 pPhotoLbl->Invalidate(true);
1224                                         }
1225                                         delete pPhotoBitmap;
1226                                 }
1227                         }
1228                         //show call active time using Timer
1229                         __activeCallStartTime = __pActiveCallInfo->GetCallConnectTime();
1230                         ShowTimerInfo(IDC_CALLER1_TIME_LABEL,false,__activeCallStartTime);
1231                 }
1232                 else
1233                 {
1234                         __pHeldCallInfo = new (std::nothrow) CallInfo();
1235                         *__pHeldCallInfo = callInfo;
1236
1237                         if (__pHeldCallInfo->IsConferenceCall() == false)
1238                         {
1239                                 ShowPersonDetails(contactNo, IDC_NUMBER2_LABEL, IDC_CALLER2_LABEL, true,__pHeldCallInfo);
1240                         }
1241                         else
1242                         {
1243                                 // show participant count on name Label
1244                                 Label* pPeopleCountLbl = static_cast<Label*>(GetControl(IDC_NUMBER2_LABEL));
1245                                 if (pPeopleCountLbl)
1246                                 {
1247                                         String count;
1248                                         count.Append(__pHeldCallInfo->GetCallerListCount());
1249                                         count.Append(" ");
1250                                         count.Append(AppUtility::GetResourceString(IDS_PEOPLE_STR));
1251                                         pPeopleCountLbl->SetText(count);
1252                                 }
1253                                 String nameStr = AppUtility::GetResourceString(L"IDS_CONFERENCE_CALL_STRING");
1254                                 Label* pNameLbl = static_cast<Label*>(GetControl(IDC_CALLER2_LABEL));
1255                                 if (pNameLbl)
1256                                 {
1257                                         pNameLbl->SetText(nameStr);
1258                                 }
1259                                 Bitmap* pPhotoBitmap = AppUtility::GetBitmapFromResourcesN(IDB_CONFERENCE_BG_ICON,W_CONFERENCE_PHOTO,H_CONFERENCE_PHOTO);
1260                                 if (pPhotoBitmap != null)
1261                                 {
1262                                         Label* pPhotoLbl = static_cast<Label*>(GetControl(IDC_CALLER2_PHOTO_LABEL));
1263                                         if (pPhotoLbl)
1264                                         {
1265                                                 pPhotoLbl->SetBackgroundBitmap(*pPhotoBitmap);
1266                                                 pPhotoLbl->Invalidate(true);
1267                                         }
1268                                         delete pPhotoBitmap;
1269                                 }
1270                         }
1271                         //show "On Hold"
1272                         ShowTimerInfo(IDC_CALLER2_TIME_LABEL, true);
1273                 }
1274         }
1275
1276         //update JoinCall button status
1277         bool isEnableJoinCall = true;
1278         CallInfo* pConfCallInfo = __pCallPresentor->GetConferenceCallInfoN();
1279         if(pConfCallInfo != null && pConfCallInfo->GetCallerListCount() >= IDI_MAX_CONF_CALL_PARTICIPANTS)
1280         {
1281                 isEnableJoinCall = false;
1282         }
1283         __pCallButtonsPanel->EnableJoinCallButton(isEnableJoinCall);
1284         delete pConfCallInfo;
1285         pConfCallInfo = null;
1286         Invalidate(true);
1287         AppLog("EXIT");
1288 }
1289
1290 void
1291 ActiveCallForm::ShowPersonDetails(const String& phoneNumber, const String& contactLblName, const String& nameLblName, bool isSecondCaller, CallInfo* pCallInfo)
1292 {
1293         //call individual methods to show contact number, caller name & photo
1294         ShowPhoneNumber(phoneNumber, contactLblName);
1295
1296         //fetch contact details based on phone number
1297         String* pDisplayName = pCallInfo->FetchCallerNameN();
1298         ShowCallerName(*pDisplayName, nameLblName);
1299
1300         Bitmap* pPhotoBitmap = pCallInfo->FetchCallerPhotoN();
1301         ShowCallerPhoto(pPhotoBitmap, isSecondCaller);
1302
1303         //free resources
1304         if (pDisplayName)
1305         {
1306                 delete pDisplayName;
1307                 pDisplayName = null;
1308         }
1309         if (pPhotoBitmap)
1310         {
1311                 delete pPhotoBitmap;
1312                 pPhotoBitmap = null;
1313         }
1314 }
1315
1316 void
1317 ActiveCallForm::ShowPhoneNumber(const String& phoneNumber, const String& contactLblName)
1318 {
1319         String formattedNumber = phoneNumber;
1320
1321         Label* pContactLbl = static_cast<Label*>(GetControl(contactLblName));
1322         if (pContactLbl)
1323         {
1324                 pContactLbl->SetText(formattedNumber);
1325                 pContactLbl->Invalidate(true);
1326         }
1327 }
1328
1329 void
1330 ActiveCallForm::ShowCallerName(const String& callerName, const String& nameLblName)
1331 {
1332         // show display name on name Label
1333         Label* pNameLbl = static_cast<Label*>(GetControl(nameLblName));
1334         if (pNameLbl)
1335         {
1336                 //passing an empty string to SetText fails in label,
1337                 //if previously valid text has been set
1338                 if (callerName.IsEmpty() == true && pNameLbl->GetText().IsEmpty() == false)
1339                 {
1340                         String stringToBeSet(L" ");
1341                         pNameLbl->SetText(stringToBeSet);
1342                 }
1343                 else
1344                 {
1345                         pNameLbl->SetText(callerName);
1346                 }
1347                 pNameLbl->Invalidate(true);
1348         }
1349 }
1350
1351 void
1352 ActiveCallForm::ShowCallerPhoto(Bitmap* pPhotoId, bool isSecondCaller)
1353 {
1354         //to check if default image is to be shown
1355         bool showDefaultPhoto = false;
1356         bool showSmallPhoto = false;
1357         String photoLabel("");
1358
1359         switch (__formType)
1360         {
1361         case FORMTYPE_OUTGOINGCALL:
1362         case FORMTYPE_ACTIVECALL:
1363         {
1364                 if (pPhotoId == null)
1365                 {
1366                         //show default caller image
1367                         showDefaultPhoto = true;
1368                 }
1369                 else
1370                 {
1371                         //Check the size of photo
1372                         // Now checking the condition with && but actually it should be ||
1373                         //But for now keeping it as && because _pContact->GetThubNail() returns image width as
1374                         // height 270 and width = 480 . So all images set thru gallery is show as small image
1375                         if(pPhotoId->GetHeight() <= H_SMALL_PHOTO
1376                                         && pPhotoId->GetWidth() <= W_SMALL_PHOTO)
1377                         {
1378                                 showSmallPhoto = true;
1379                         }
1380
1381                 }
1382                 photoLabel.Append(IDC_CALLER1_BIGPHOTO_LABEL);
1383         }
1384         break;
1385
1386         case FORMTYPE_MULTIPLECALLS:
1387         {
1388                 if (isSecondCaller)
1389                 {
1390                         photoLabel.Append(IDC_CALLER2_PHOTO_LABEL);
1391                 }
1392                 else
1393                 {
1394                         photoLabel.Append(IDC_CALLER1_PHOTO_LABEL);
1395                 }
1396
1397                 if (pPhotoId == null)
1398                 {
1399                         showDefaultPhoto = true;
1400                 }
1401                 else
1402                 {
1403                         if (pPhotoId->GetHeight() <= H_SMALL_PHOTO
1404                                 && pPhotoId->GetWidth() <= W_SMALL_PHOTO)
1405                         {
1406                                 //pPhotoId->Scale(Dimension(W_CONFERENCE_PHOTO,H_CONFERENCE_PHOTO));
1407                                 showSmallPhoto = true;
1408                         }
1409                 }
1410         }
1411         break;
1412
1413         default:
1414                 break;
1415         }
1416
1417         //Remove small photo label
1418         if (__pSmallPhotoLabel != null)
1419         {
1420                 RemoveControl(*__pSmallPhotoLabel);
1421                 __pSmallPhotoLabel = null;
1422         }
1423
1424         //show photo - for Big Photo Id, Animated Call Image
1425         if (!showDefaultPhoto)
1426         {
1427                 if(showSmallPhoto == true)
1428                 {
1429                         ShowThumbnailImage(pPhotoId,photoLabel);
1430                 }
1431                 else
1432                 {
1433                         Label* pPhotoLbl = static_cast<Label*>(GetControl(photoLabel));
1434                         if (pPhotoLbl)
1435                         {
1436                                 Canvas* pCanvas = new (std::nothrow) Canvas;
1437                                 Rectangle canvasRect(Rectangle(0, 0, pPhotoLbl->GetBounds().width, pPhotoLbl->GetBounds().height));
1438                                 pCanvas->Construct(canvasRect);
1439                                 //draw the contact bitmap
1440                                 pCanvas->DrawBitmap(canvasRect,*pPhotoId);
1441                                 Bitmap* pNewPhotoId = new Bitmap();
1442                                 pNewPhotoId->Construct(*pCanvas, pCanvas->GetBounds());
1443                                 delete pCanvas;
1444
1445                                 pPhotoLbl->SetBackgroundBitmap(*pNewPhotoId);
1446                                 pPhotoLbl->Invalidate(true);
1447                                 delete pNewPhotoId;
1448                         }
1449                 }
1450         }
1451         else
1452         {
1453                 Bitmap* pDefaultPhoto = null;
1454                 switch (__formType)
1455                 {
1456                 case FORMTYPE_OUTGOINGCALL:
1457                 case FORMTYPE_ACTIVECALL:
1458                         pDefaultPhoto = AppUtility::GetBitmapFromResourcesN(IDB_ACTIVE_CALL_DEFAULT_ICON,W_CONFERENCE_PHOTO,W_CONFERENCE_PHOTO);
1459                         break;
1460
1461                 case FORMTYPE_MULTIPLECALLS:
1462                         pDefaultPhoto = AppUtility::GetBitmapFromResourcesN(IDB_MULTIPLE_CALL_DEFAULT_ICON,W_CONFERENCE_PHOTO,H_CONFERENCE_PHOTO);
1463                         break;
1464
1465                 case FORMTYPE_ACTIVECONFCALL:
1466                         pDefaultPhoto = AppUtility::GetBitmapFromResourcesN(IDB_CONFERENCE_BIG_BG_ICON,W_CONFERENCE_PHOTO,W_CONFERENCE_PHOTO);
1467                         break;
1468
1469                 default:
1470                         break;
1471                 }
1472                 if (pDefaultPhoto != null)
1473                 {
1474                         Label* pPhotoLbl = static_cast<Label*>(GetControl(photoLabel));
1475                         if (pPhotoLbl)
1476                         {
1477                                 pPhotoLbl->SetBackgroundBitmap(*pDefaultPhoto);
1478                         }
1479                         delete pDefaultPhoto;
1480                 }
1481         }
1482 }
1483
1484 void
1485 ActiveCallForm::ShowThumbnailImage(const Bitmap* pPhotoId,String& photoLabel)
1486 {
1487         Label* pPhotoLbl = static_cast<Label*>(GetControl(photoLabel));
1488
1489         if (pPhotoLbl != null && pPhotoId != null)
1490         {
1491                 Canvas* pCanvas = new (std::nothrow) Canvas;
1492                 Bitmap* pBackground = AppUtility::GetBitmapFromResourcesN(IDB_CALL_THUMBNAIL_BACKGROUND,W_CALL_THUMBNAIL,H_CALL_THUMBNAIL);
1493                 Bitmap* pShadow = AppUtility::GetBitmapFromResourcesN(IDB_CALL_THUMBNAIL_SHADOW,W_CALL_THUMBNAIL_SHADOW,H_CALL_THUMBNAIL_SHADOW);
1494                 Rectangle canvasRect(Rectangle(0, 0, pPhotoLbl->GetBounds().width, pPhotoLbl->GetBounds().height));
1495                 pCanvas->Construct(canvasRect);
1496                 //draw the back ground
1497                 pCanvas->DrawBitmap(canvasRect,*pBackground);
1498                 //draw shadow (to be enabled after correct shadow image is provided )
1499                 //pCanvas->DrawBitmap(Rectangle((pPhotoLbl->GetBounds().width/2)-(W_CALL_THUMBNAIL_SHADOW/2),
1500                         //      (pPhotoLbl->GetBounds().height/2)-(H_CALL_THUMBNAIL_SHADOW/2),W_CALL_THUMBNAIL_SHADOW,H_CALL_THUMBNAIL_SHADOW),*pShadow);
1501                 //draw the contact bitmap
1502                 pCanvas->DrawBitmap(Rectangle((pPhotoLbl->GetBounds().width/2)-(W_SMALL_PHOTO/2),
1503                                 (pPhotoLbl->GetBounds().height/2)-(H_SMALL_PHOTO/2),W_SMALL_PHOTO,H_SMALL_PHOTO),*pPhotoId);
1504                 Bitmap* pNewPhotoId = new Bitmap();
1505                 pNewPhotoId->Construct(*pCanvas, pCanvas->GetBounds());
1506                 delete pCanvas;
1507
1508                 pPhotoLbl->SetBackgroundBitmap(*pNewPhotoId);
1509                 pPhotoLbl->Invalidate(true);
1510                 delete pNewPhotoId;
1511                 delete pBackground;
1512                 delete pShadow;
1513         }
1514
1515 }
1516
1517 void
1518 ActiveCallForm::ShowCallersPhotoThumbnail(const Bitmap& pPhotoId)
1519 {
1520         if (__pSmallPhotoLabel != null)
1521         {
1522                 RemoveControl(*__pSmallPhotoLabel);
1523                 __pSmallPhotoLabel = null;
1524         }
1525         //Draw Small Photo and show on small photo label
1526         __pSmallPhotoLabel  = new (std::nothrow) Label();//static_cast<Label*>(GetControl(IDC_SMALL_PHOTO_LABEL));
1527         __pSmallPhotoLabel->Construct(Rectangle(X_PHOTO_LBL, Y_PHOTO_LBL, W_PHOTO_LBL, H_PHOTO_LBL), L"");
1528         __pSmallPhotoLabel->SetBackgroundColor(Color(0,0,0));
1529         __pSmallPhotoLabel->SetBackgroundBitmap(pPhotoId);
1530         // Add a Label to the Form
1531         AddControl(*__pSmallPhotoLabel);
1532         __pSmallPhotoLabel->Invalidate(true);
1533 }
1534
1535 void
1536 ActiveCallForm::ShowTimerInfo(const String& timerLblName, bool isOnHold, long long startTime)
1537 {
1538         Label* pTimerLbl = static_cast<Label*>(GetControl(timerLblName));
1539
1540         if (__pActiveCallTimer == null)
1541         {
1542                 __pActiveCallTimer = new (std::nothrow) Tizen::Base::Runtime::Timer();
1543                 __pActiveCallTimer->Construct(*this);
1544         }
1545
1546         if (pTimerLbl != null)
1547         {
1548                 if (isOnHold == true)
1549                 {
1550                         pTimerLbl->SetText(AppUtility::GetResourceString(IDS_TIMER_ON_HOLD));
1551                         //update Hold button status
1552                         SetHoldButtonStatus(false);
1553                 }
1554                 else
1555                 {
1556                         //update Hold button status
1557                         SetHoldButtonStatus(true);
1558                         //current system time
1559                         long long currTime = 0;
1560                         SystemTime::GetTicks(currTime);
1561                         //Set call duration
1562                         TimeSpan diffSpan(abs(startTime - currTime));
1563
1564                         String activeCallTime(L"");
1565
1566                         long long hr = diffSpan.GetHours();
1567                         if (hr <= 9)
1568                         {
1569                                 activeCallTime.Append("0");
1570                         }
1571                         activeCallTime.Append(hr);
1572                         activeCallTime.Append(L":");
1573
1574                         long long min = diffSpan.GetMinutes();
1575                         if (min <= 9)
1576                         {
1577                                 activeCallTime.Append("0");
1578                         }
1579                         activeCallTime.Append(min);
1580                         activeCallTime.Append(L":");
1581
1582                         long long sec = diffSpan.GetSeconds();
1583                         if (sec <= 9)
1584                         {
1585                                 activeCallTime.Append("0");
1586                         }
1587                         activeCallTime.Append(sec);
1588
1589                         pTimerLbl->SetText(activeCallTime);
1590                         __pActiveCallTimer->StartAsRepeatable(TimeSpan::NUM_OF_TICKS_IN_SECOND);
1591                 }
1592                 pTimerLbl->Invalidate(true);
1593         }
1594 }
1595
1596 void
1597 ActiveCallForm::SetShowStateOnKeypad(bool showState)
1598 {
1599         Label* pLblControl = static_cast<Label*>(GetControl(IDC_CALLER1_LABEL));
1600         pLblControl->SetShowState(showState);
1601         pLblControl = static_cast<Label*>(GetControl(IDC_BACKGROUND_LABEL));
1602         pLblControl->SetShowState(showState);
1603         pLblControl = static_cast<Label*>(GetControl(IDC_CALLER1_TIME_LABEL));
1604         pLblControl->SetShowState(showState);
1605         if (__pSmallPhotoLabel != null)
1606         {
1607                 __pSmallPhotoLabel->SetShowState(showState);
1608         }
1609
1610         switch (__formType)
1611         {
1612         case FORMTYPE_ACTIVECALL:
1613         {
1614                 pLblControl = static_cast<Label*>(GetControl(IDC_NUMBER1_LABEL));
1615                 pLblControl->SetShowState(showState);
1616                 pLblControl = static_cast<Label*>(GetControl(IDC_VOICE_CALL_ICON_LABEL));
1617                 pLblControl->SetShowState(showState);
1618                 pLblControl = static_cast<Label*>(GetControl(IDC_HOLD_LABEL));
1619                 pLblControl->SetShowState(showState);
1620                 Button* pButtonControl = static_cast<Button*>(GetControl(IDC_HOLD_BUTTON));
1621                 pButtonControl->SetShowState(showState);
1622         }
1623         break;
1624
1625         case FORMTYPE_MULTIPLECALLS:
1626         {
1627                 pLblControl = static_cast<Label*>(GetControl(IDC_NUMBER1_LABEL));
1628                 pLblControl->SetShowState(showState);
1629                 pLblControl = static_cast<Label*>(GetControl(IDC_CALLER2_LABEL));
1630                 pLblControl->SetShowState(showState);
1631                 pLblControl = static_cast<Label*>(GetControl(IDC_NUMBER2_LABEL));
1632                 pLblControl->SetShowState(showState);
1633                 pLblControl = static_cast<Label*>(GetControl(IDC_CALLER2_TIME_LABEL));
1634                 pLblControl->SetShowState(showState);
1635                 pLblControl = static_cast<Label*>(GetControl(IDC_SWAP_LABEL));
1636                 pLblControl->SetShowState(showState);
1637                 pLblControl = static_cast<Label*>(GetControl(IDC_BACKGROUND_LABEL2));
1638                 pLblControl->SetShowState(showState);
1639                 if (__pActiveCallInfo != null && __pActiveCallInfo->IsConferenceCall() == false)
1640                 {
1641                         pLblControl = static_cast<Label*>(GetControl(IDC_VOICE_CALL_ICON_LABEL));
1642                         pLblControl->SetShowState(showState);
1643                 }
1644                 else
1645                 {
1646                         Button* pButtonControl = static_cast<Button*>(GetControl(IDC_CONF_CALL_MORE_BUTTON));
1647                         pButtonControl->SetShowState(showState);
1648                 }
1649                 Button* pButtonControl = static_cast<Button*>(GetControl(IDC_SWAP_BUTTON));
1650                 pButtonControl->SetShowState(showState);
1651         }
1652         break;
1653
1654         case FORMTYPE_ACTIVECONFCALL:
1655         {
1656                 pLblControl = static_cast<Label*>(GetControl(IDC_PARTICIPANTS_LABEL));
1657                 pLblControl->SetShowState(showState);
1658                 pLblControl = static_cast<Label*>(GetControl(IDC_HOLD_LABEL));
1659                 pLblControl->SetShowState(showState);
1660                 Button* pButtonControl = static_cast<Button*>(GetControl(IDC_HOLD_BUTTON));
1661                 pButtonControl->SetShowState(showState);
1662                 pButtonControl = static_cast<Button*>(GetControl(IDC_CONF_CALL_MORE_BUTTON));
1663                 pButtonControl->SetShowState(showState);
1664         }
1665         break;
1666
1667         default:
1668                 break;
1669         }
1670 }
1671
1672 void
1673 ActiveCallForm::OnTimerExpired(Tizen::Base::Runtime::Timer& timer)
1674 {
1675         //Call default implementation of "Object.Equals()"
1676         //returns true, if they are pointing to same address.
1677         if (__pActiveCallTimer->Equals(timer))
1678         {
1679                 Label* pTimerLbl = static_cast<Label*>(GetControl(IDC_CALLER1_TIME_LABEL));
1680                 if (pTimerLbl)
1681                 {
1682                         String activeCallTime = pTimerLbl->GetText();
1683                         // Create a StringTokenizer instance
1684                         StringTokenizer strTokens(activeCallTime, L":");
1685
1686                         int count = strTokens.GetTokenCount(); // count == 3
1687                         String token;
1688                         int sec = 0;
1689                         int min = 0;
1690                         int hr = 0;
1691                         for (int index = 0; index < count; index++)
1692                         {
1693                                 switch (index)
1694                                 {
1695                                 case 0:
1696                                         strTokens.GetNextToken(token);
1697                                         Integer::Parse(token, hr);
1698                                         break;
1699
1700                                 case 1:
1701                                         strTokens.GetNextToken(token);
1702                                         Integer::Parse(token, min);
1703                                         break;
1704
1705                                 case 2:
1706                                         strTokens.GetNextToken(token);
1707                                         Integer::Parse(token, sec);
1708                                         break;
1709                                 }
1710                         }
1711                         //update all values
1712                         sec = sec + 1;
1713                         if (sec == IDI_MAX_SECONDS)
1714                         {
1715                                 sec = 0;
1716                                 min = min + 1;
1717                         }
1718                         if (min == IDI_MAX_MINS)
1719                         {
1720                                 min = 0;
1721                                 hr = hr + 1;
1722                         }
1723
1724                         //replace string
1725                         activeCallTime.Clear();
1726                         if (hr <= 9)
1727                         {
1728                                 activeCallTime.Append("0");
1729                         }
1730                         activeCallTime.Append(hr);
1731                         activeCallTime.Append(":");
1732                         if (min <= 9)
1733                         {
1734                                 activeCallTime.Append("0");
1735                         }
1736                         activeCallTime.Append(min);
1737                         activeCallTime.Append(":");
1738                         if (sec <= 9)
1739                         {
1740                                 activeCallTime.Append("0");
1741                         }
1742                         activeCallTime.Append(sec);
1743                         //update timer label
1744                         pTimerLbl->SetText(activeCallTime);
1745                         pTimerLbl->Invalidate(true);
1746                 }
1747         }
1748 }
1749
1750 ///////////////////////////////////////////////////////////
1751 ///////////     Options Menu List Functionality   /////////
1752 ///////////////////////////////////////////////////////////
1753 void
1754 ActiveCallForm::OnListViewContextItemStateChanged(ListView& listView, int index, int elementId, ListContextItemStatus state)
1755 {
1756 }
1757
1758 void
1759 ActiveCallForm::OnListViewItemStateChanged(ListView& listView, int index, int elementId, ListItemStatus status)
1760 {
1761         //Goto conference call list form
1762         SceneManager* pSceneManager = SceneManager::GetInstance();
1763         pSceneManager->GoForward(ForwardSceneTransition(IDSCN_SCENE_CONFCALLLIST), null);
1764 }
1765
1766 void
1767 ActiveCallForm::OnListViewItemSwept(ListView& listView, int index, SweepDirection direction)
1768 {
1769 }
1770
1771 void
1772 ActiveCallForm::OnListViewItemLongPressed(ListView& listView, int index, int elementId, bool& invokeListViewItemCallback)
1773 {
1774 }
1775
1776 int
1777 ActiveCallForm::GetItemCount(void)
1778 {
1779         return IDI_MOREOPTIONS_LIST_ITEMS;
1780 }
1781
1782 ListItemBase*
1783 ActiveCallForm::CreateItem(int index, int itemWidth)
1784 {
1785         //create 1st Menu option
1786         CustomItem* pItem = new (std::nothrow) CustomItem();
1787         pItem->Construct(IDI_OPTIONMENU_DIMEN, LIST_ANNEX_STYLE_NORMAL);
1788
1789         //Set background 9-patch bitmap to option menu
1790         Bitmap* pBgBmp = AppUtility::GetBitmapFromResourcesN(IDB_POPUP_BG_ICON);
1791         if (pBgBmp != null && pBgBmp->IsNinePatchedBitmap())
1792         {
1793                 Canvas bgCanvas;
1794                 bgCanvas.Construct(Rectangle(IDI_OPTIONMENU_POS, IDI_OPTIONMENU_DIMEN));
1795                 bgCanvas.DrawNinePatchedBitmap(bgCanvas.GetBounds(), *pBgBmp);
1796         }
1797         else
1798         {
1799                 pItem->SetBackgroundColor(LIST_ITEM_DRAWING_STATUS_NORMAL, Color(40, 45, 48));
1800         }
1801         delete pBgBmp;
1802         pBgBmp = null;
1803
1804         //Set bitmap to option menu
1805         Bitmap* pNormalConfCallBmp = AppUtility::GetBitmapFromResourcesN(IDB_MORE_MANAGE_CONFERENCE_ICON ,
1806                                                                                                                                          W_MGR_CONFCALL_BITMAP, H_MGR_CONFCALL_BITMAP);
1807         pItem->AddElement(Rectangle(16, 17, W_MGR_CONFCALL_BITMAP, H_MGR_CONFCALL_BITMAP), 1, *pNormalConfCallBmp, null, null);
1808         // Deallocate bitmaps
1809         delete pNormalConfCallBmp;
1810         pNormalConfCallBmp = null;
1811
1812         //Set text to menu option
1813         String confCallName = AppUtility::GetResourceString(IDS_MGR_CONF_CALL_LIST_STR);
1814
1815         TextElement* pTextElement = new (std::nothrow) TextElement();
1816         pTextElement->Construct(confCallName);
1817         pTextElement->SetTextColor(COLOR_POPUP_TEXT);
1818         //create font
1819         Font font;
1820         font.Construct(FONT_STYLE_PLAIN, IDI_POPUP_TEXT_SIZE);
1821         pTextElement->SetFont(font);
1822         //construct Enriched text
1823         EnrichedText* pEnrichedText = new (std::nothrow) EnrichedText();
1824         Dimension textDimension;
1825         font.GetTextExtent(confCallName, confCallName.GetLength(), textDimension);
1826         textDimension.height = textDimension.height + font.GetDescender();
1827         pEnrichedText->Construct(textDimension);
1828         //add text element to enriched text
1829         pEnrichedText->Add(*pTextElement);
1830
1831         //Add Enriched text to pItem
1832         Point textPos(((2 * IDI_OPTIONMENU_ITEM_SPACING) + W_MGR_CONFCALL_BITMAP), ((IDI_OPTIONMENU_DIMEN.height - textDimension.height) / 2));
1833         pItem->AddElement(Rectangle(textPos, textDimension), 2, *pEnrichedText);
1834         // Cleans up
1835         pEnrichedText->RemoveAll(true);
1836         delete pEnrichedText;
1837         return pItem;
1838 }
1839
1840 bool
1841 ActiveCallForm::DeleteItem(int index, ListItemBase* pItem, int itemWidth)
1842 {
1843         delete pItem;
1844         return true;
1845 }