1bdc61ff600a280097a816141b0d5f64067a5bf6
[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_TEXTBOX";
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         TextBox* pTextBox = static_cast<TextBox*>(__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<TextBox*>(__pDTMFKeypad->GetControl(IDC_TEXTBOX))->GetText();
275                         ShowDTMFKeypad();
276                         //get new text box.
277                         TextBox* pTextBox = static_cast<TextBox*>(__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                 TextBox* pTextBox = static_cast<TextBox*>(__pDTMFKeypad->GetControl(IDC_TEXTBOX));
842                 pTextBox->AppendText(dtmfStr);
843                 pTextBox->Invalidate(true);
844         }
845 }
846
847 void
848 ActiveCallForm::OnSceneActivatedN(const SceneId& previousSceneId, const SceneId& currentSceneId, IList* pArgs)
849 {
850         AppLog("ENTER");
851         //set itself as listener
852         __pCallPresentor->SetTelEventListener(this);
853         AddOrientationEventListener(*this);
854
855         //Initialize keypad and buttons
856         InitializeCallButtonsPanel();
857
858         if (__pActiveCallInfo != null)
859         {
860                 delete __pActiveCallInfo;
861                 __pActiveCallInfo = null;
862         }
863         if (__pHeldCallInfo != null)
864         {
865                 delete __pHeldCallInfo;
866                 __pHeldCallInfo = null;
867         }
868         DestroyMoreOptionsMenuList();
869
870         switch (__formType)
871         {
872         case FORMTYPE_OUTGOINGCALL:
873         {
874                 String contactNo;
875                 contactNo.Append(*(static_cast<String*>(pArgs->GetAt(0))));
876                 __pActiveCallInfo = new (std::nothrow) CallInfo();
877                 __pActiveCallInfo->SetContactNumber(contactNo);
878                 Contact* pContact = __pCallPresentor->GetContactN(contactNo);
879                 if (pContact != null)
880                 {
881                         __pActiveCallInfo->SetContactInfo(*pContact);
882                         delete pContact;
883                 }
884                 ShowPersonDetails(contactNo, IDC_NUMBER1_LABEL, IDC_CALLER1_LABEL, false,__pActiveCallInfo);
885                 //make an normal outgoing call
886                 __pCallPresentor->DialCall(contactNo, false);
887         }
888         break;
889
890         case FORMTYPE_EMERGENCYOUTGOINGCALL:
891         {
892                 String* pContactNo = static_cast<String*>(pArgs->GetAt(0));
893                 __pActiveCallInfo = new (std::nothrow) CallInfo();
894                 long long phNumber = 0;
895                 LongLong::Parse(*pContactNo, phNumber);
896                 __pActiveCallInfo->SetContactNumber(*pContactNo);
897                 //make an emergency call
898                 __pCallPresentor->DialCall(*pContactNo, true);
899         }
900         break;
901
902         case FORMTYPE_ACTIVECALL:
903         {
904                 //get contact number
905                 CallInfo* pCall = static_cast<CallInfo*>(pArgs->GetAt(0));
906
907                 __pActiveCallInfo = new (std::nothrow) CallInfo();
908                 *__pActiveCallInfo =  *pCall;
909                 String activeContactNo;
910                 if(pCall->GetContactNumber().IsEmpty() == false)
911                 {
912                         activeContactNo.Append(pCall->GetContactNumber());
913                 }
914                 else
915                 {
916                         activeContactNo.Append(AppUtility::GetResourceString(IDS_NUMBER_UNKNOWN));
917                 }
918                 ShowPersonDetails(activeContactNo, IDC_NUMBER1_LABEL, IDC_CALLER1_LABEL, false,__pActiveCallInfo);
919
920                 //show call active time using Timer
921                 __activeCallStartTime = pCall->GetCallConnectTime();
922                 ShowTimerInfo(IDC_CALLER1_TIME_LABEL, pCall->IsOnHold(), __activeCallStartTime);
923         }
924         break;
925
926         case FORMTYPE_EMERGENCYACTIVECALL:
927         {
928                 //get contact number
929                 CallInfo* pCall = static_cast<CallInfo*>(pArgs->GetAt(0));
930
931                 __pActiveCallInfo = new (std::nothrow) CallInfo();
932                 *__pActiveCallInfo =  *pCall;
933
934                 //show call active time using Timer
935                 __activeCallStartTime = pCall->GetCallConnectTime();
936                 ShowTimerInfo(IDC_CALLER1_TIME_LABEL, pCall->IsOnHold(), __activeCallStartTime);
937         }
938         break;
939
940         case FORMTYPE_MULTIPLECALLS:
941         {
942                 IListT<CallInfo>* pCallsList = __pCallPresentor->GetCallListN();
943                 //update calls state
944                 UpdateMultipleCallScreen(*pCallsList);
945                 delete pCallsList;
946                 pCallsList = null;
947         }
948         break;
949
950         case FORMTYPE_ACTIVECONFCALL:
951         {
952                 //get Conf call
953                 CallInfo* pConfInfo = static_cast<CallInfo*>(pArgs->GetAt(0));
954                 __pActiveCallInfo = new (std::nothrow) CallInfo();
955                 *__pActiveCallInfo =  *pConfInfo;
956
957                 int participantsCount = __pActiveCallInfo->GetCallerListCount();
958
959                 // show participant count on name Label
960                 Label* pPeopleCountLbl = static_cast<Label*>(GetControl(IDC_PARTICIPANTS_LABEL));
961                 if (pPeopleCountLbl)
962                 {
963                         String count;
964                         count.Append(participantsCount);
965                         count.Append(" ");
966                         count.Append(AppUtility::GetResourceString(IDS_PEOPLE_STR));
967                         pPeopleCountLbl->SetText(count);
968                 }
969
970                 if(participantsCount >= IDI_MAX_CONF_CALL_PARTICIPANTS)
971                 {
972                         __pCallButtonsPanel->EnableAddCallButton(false);
973                 }
974                 else
975                 {
976                         __pCallButtonsPanel->EnableAddCallButton(true);
977                 }
978
979                 //show call active time using Timer
980                 __activeCallStartTime = __pActiveCallInfo->GetCallConnectTime();
981                 ShowTimerInfo(IDC_CALLER1_TIME_LABEL, __pActiveCallInfo->IsOnHold(),__activeCallStartTime);
982         }
983         break;
984
985         default:
986                 break;
987         }
988
989         //Hide DTMFKeypad, if visible and show caller info
990         HideDTMFKeypad();
991         SetShowStateOnKeypad(true);
992         __pCallButtonsPanel->SetKeypadButtonState(IDA_OPEN_NUMKEYPAD);
993
994         //Set the correct speaker status
995         if(__pCallPresentor->IsSpeakerOn() == true)
996         {
997                 __pCallButtonsPanel->SetSpeakerButtonState(IDA_SPEAKER_OFF);
998         }
999         else
1000         {
1001                 __pCallButtonsPanel->SetSpeakerButtonState(IDA_SPEAKER);
1002         }
1003
1004         //Set the correct Mute status
1005         if (__pCallPresentor->IsCallMuted() == true)
1006         {
1007                 __pCallButtonsPanel->SetMuteButtonState(IDA_UNMUTE);
1008         }
1009         else
1010         {
1011                 __pCallButtonsPanel->SetMuteButtonState(IDA_MUTE);
1012         }
1013
1014         if (pArgs)
1015         {
1016                 pArgs->RemoveAll();
1017                 delete pArgs;
1018                 pArgs = null;
1019         }
1020 }
1021
1022 void
1023 ActiveCallForm::OnSceneDeactivated(const SceneId& currentSceneId, const SceneId& nextSceneId)
1024 {
1025         RemoveOrientationEventListener(*this);
1026         if (__pCallButtonsPanel != null)
1027         {
1028                 RemoveControl(*__pCallButtonsPanel);
1029                 __pCallButtonsPanel = null;
1030         }
1031         if (__pActiveCallTimer != null)
1032         {
1033                 __pActiveCallTimer->Cancel();
1034                 delete __pActiveCallTimer;
1035                 __pActiveCallTimer = null;
1036         }
1037         if (__pSmallPhotoLabel != null)
1038         {
1039                 __pSmallPhotoLabel->SetShowState(false);
1040         }
1041         //Hide "Manage conf. Call" Context menu
1042         if (__pMoreOptionsListAnchor != null)
1043         {
1044                 __pMoreOptionsListAnchor->SetShowState(false);
1045         }
1046         if (__pMoreOptionsList != null)
1047         {
1048                 __pMoreOptionsList->SetShowState(false);
1049         }
1050 }
1051
1052 void
1053 ActiveCallForm::HandleConfCallChanged(void)
1054 {
1055         AppLog("ENTER");
1056         AppAssert((__formType == FORMTYPE_ACTIVECONFCALL) || (__formType == FORMTYPE_MULTIPLECALLS));
1057         //fetch changed conference call info
1058         CallInfo* pConfCallInfo = __pCallPresentor->GetConferenceCallInfoN();
1059         if (pConfCallInfo == null)
1060         {
1061                 AppLog("EXIT");
1062                 return;
1063         }
1064
1065         //fetch participant count in conf call
1066         int participantsCount = pConfCallInfo->GetCallerListCount();
1067         //update status of join and Add call
1068         bool isEnableAddCall = false;
1069         bool isEnableJoinCall = false;
1070         if(participantsCount < IDI_MAX_CONF_CALL_PARTICIPANTS)
1071         {
1072                 //available only at Active conf. call or active call screen
1073                 isEnableAddCall = true;
1074                 //join button is available only at multiple call screen
1075                 isEnableJoinCall = true;
1076         }
1077
1078         Label* pPeopleCountLbl = null;
1079         if (__pActiveCallInfo != null && __pActiveCallInfo->IsConferenceCall() == true)
1080         {
1081                 //Active call is conference call
1082                 delete __pActiveCallInfo;
1083                 __pActiveCallInfo = new (std::nothrow) CallInfo();
1084                 *__pActiveCallInfo = *pConfCallInfo;
1085
1086                 if (__formType == FORMTYPE_MULTIPLECALLS)
1087                 {
1088                         pPeopleCountLbl = static_cast<Label*>(GetControl(IDC_NUMBER1_LABEL));
1089                 }
1090                 else if (__formType == FORMTYPE_ACTIVECONFCALL)
1091                 {
1092                         pPeopleCountLbl = static_cast<Label*>(GetControl(IDC_PARTICIPANTS_LABEL));
1093                         AppLog("Active conf call...(%d)", pPeopleCountLbl);
1094                 }
1095         }
1096         else if(__pHeldCallInfo != null && __pHeldCallInfo->IsConferenceCall() == true)
1097         {
1098                 //Held call is conference call - this is definitely multiple call screen.
1099                 delete __pHeldCallInfo;
1100                 __pHeldCallInfo = new (std::nothrow) CallInfo();
1101                 *__pHeldCallInfo = *pConfCallInfo;
1102                 pPeopleCountLbl = static_cast<Label*>(GetControl(IDC_NUMBER2_LABEL));
1103         }
1104
1105         // update participant count on name Label
1106         if (pPeopleCountLbl != null)
1107         {
1108                 String count;
1109                 count.Append(participantsCount);
1110                 count.Append(" ");
1111                 count.Append(AppUtility::GetResourceString(IDS_PEOPLE_STR));
1112                 pPeopleCountLbl->SetText(count);
1113                 pPeopleCountLbl->Invalidate(true);
1114         }
1115         //change AddCall Button status
1116         __pCallButtonsPanel->EnableAddCallButton(isEnableAddCall);
1117         //change JoinCall Button status
1118         __pCallButtonsPanel->EnableJoinCallButton(isEnableJoinCall);
1119         AppLog("EXIT");
1120 }
1121
1122 void
1123 ActiveCallForm::UpdateMultipleCallScreen(Tizen::Base::Collection::IListT<CallInfo>& activeCallsList)
1124 {
1125         AppLog("ENTER");
1126         if(__pActiveCallInfo != null)
1127         {
1128                 delete __pActiveCallInfo;
1129                 __pActiveCallInfo = null;
1130         }
1131         if(__pHeldCallInfo != null)
1132         {
1133                 delete __pHeldCallInfo;
1134                 __pHeldCallInfo = null;
1135         }
1136
1137         Button* pMoreBtn = static_cast<Button*>(GetControl(IDC_CONF_CALL_MORE_BUTTON));
1138         if (pMoreBtn != null)
1139         {
1140                 pMoreBtn->SetShowState(false);
1141         }
1142
1143         //show caller's info.
1144         for (int index = 0; index < activeCallsList.GetCount(); index++)
1145         {
1146                 //Fetch call info
1147                 CallInfo callInfo;
1148                 activeCallsList.GetAt(index, callInfo);
1149
1150                 String contactNo;
1151                 if(callInfo.GetContactNumber().IsEmpty() == false)
1152                 {
1153                         contactNo.Append(callInfo.GetContactNumber());
1154                 }
1155                 else
1156                 {
1157                         contactNo.Append(AppUtility::GetResourceString(IDS_NUMBER_UNKNOWN));
1158                 }
1159
1160                 if (callInfo.IsOnHold() == false)
1161                 {
1162                         __pActiveCallInfo = new (std::nothrow) CallInfo();
1163                         *__pActiveCallInfo =  callInfo;
1164
1165                         if (__pActiveCallInfo->IsConferenceCall() == false)
1166                         {
1167                                 Label* pVoiceIconLbl = static_cast<Label*>(GetControl(IDC_VOICE_CALL_ICON_LABEL));
1168                                 if (pVoiceIconLbl)
1169                                 {
1170                                         pVoiceIconLbl->SetShowState(true);
1171                                 }
1172                                 if (pMoreBtn != null)
1173                                 {
1174                                         pMoreBtn->SetShowState(false);
1175                                 }
1176                                 ShowPersonDetails(contactNo, IDC_NUMBER1_LABEL, IDC_CALLER1_LABEL, false,__pActiveCallInfo);
1177                         }
1178                         else
1179                         {
1180                                 // show participant count on name Label
1181                                 Label* pPeopleCountLbl = static_cast<Label*>(GetControl(IDC_NUMBER1_LABEL));
1182                                 if (pPeopleCountLbl)
1183                                 {
1184                                         String count;
1185                                         count.Append(__pActiveCallInfo->GetCallerListCount());
1186                                         count.Append(" ");
1187                                         count.Append(AppUtility::GetResourceString(IDS_PEOPLE_STR));
1188                                         pPeopleCountLbl->SetText(count);
1189                                 }
1190                                 String nameStr = AppUtility::GetResourceString(L"IDS_CONFERENCE_CALL_STRING");
1191                                 Label* pNameLbl = static_cast<Label*>(GetControl(IDC_CALLER1_LABEL));
1192                                 if (pNameLbl)
1193                                 {
1194                                         pNameLbl->SetText(nameStr);
1195                                 }
1196                                 Label* pVoiceIconLbl = static_cast<Label*>(GetControl(IDC_VOICE_CALL_ICON_LABEL));
1197                                 if (pVoiceIconLbl)
1198                                 {
1199                                         pVoiceIconLbl->SetShowState(false);
1200                                 }
1201                                 if (pMoreBtn != null)
1202                                 {
1203                                         pMoreBtn->SetShowState(true);
1204                                 }
1205                                 Bitmap* pPhotoBitmap = AppUtility::GetBitmapFromResourcesN(IDB_CONFERENCE_BG_ICON,W_CONFERENCE_PHOTO,H_CONFERENCE_PHOTO);
1206                                 if (pPhotoBitmap != null)
1207                                 {
1208                                         Label* pPhotoLbl = static_cast<Label*>(GetControl(IDC_CALLER1_PHOTO_LABEL));
1209                                         if (pPhotoLbl)
1210                                         {
1211                                                 pPhotoLbl->SetBackgroundBitmap(*pPhotoBitmap);
1212                                                 pPhotoLbl->Invalidate(true);
1213                                         }
1214                                         delete pPhotoBitmap;
1215                                 }
1216                         }
1217                         //show call active time using Timer
1218                         __activeCallStartTime = __pActiveCallInfo->GetCallConnectTime();
1219                         ShowTimerInfo(IDC_CALLER1_TIME_LABEL,false,__activeCallStartTime);
1220                 }
1221                 else
1222                 {
1223                         __pHeldCallInfo = new (std::nothrow) CallInfo();
1224                         *__pHeldCallInfo = callInfo;
1225
1226                         if (__pHeldCallInfo->IsConferenceCall() == false)
1227                         {
1228                                 ShowPersonDetails(contactNo, IDC_NUMBER2_LABEL, IDC_CALLER2_LABEL, true,__pHeldCallInfo);
1229                         }
1230                         else
1231                         {
1232                                 // show participant count on name Label
1233                                 Label* pPeopleCountLbl = static_cast<Label*>(GetControl(IDC_NUMBER2_LABEL));
1234                                 if (pPeopleCountLbl)
1235                                 {
1236                                         String count;
1237                                         count.Append(__pHeldCallInfo->GetCallerListCount());
1238                                         count.Append(" ");
1239                                         count.Append(AppUtility::GetResourceString(IDS_PEOPLE_STR));
1240                                         pPeopleCountLbl->SetText(count);
1241                                 }
1242                                 String nameStr = AppUtility::GetResourceString(L"IDS_CONFERENCE_CALL_STRING");
1243                                 Label* pNameLbl = static_cast<Label*>(GetControl(IDC_CALLER2_LABEL));
1244                                 if (pNameLbl)
1245                                 {
1246                                         pNameLbl->SetText(nameStr);
1247                                 }
1248                                 Bitmap* pPhotoBitmap = AppUtility::GetBitmapFromResourcesN(IDB_CONFERENCE_BG_ICON,W_CONFERENCE_PHOTO,H_CONFERENCE_PHOTO);
1249                                 if (pPhotoBitmap != null)
1250                                 {
1251                                         Label* pPhotoLbl = static_cast<Label*>(GetControl(IDC_CALLER2_PHOTO_LABEL));
1252                                         if (pPhotoLbl)
1253                                         {
1254                                                 pPhotoLbl->SetBackgroundBitmap(*pPhotoBitmap);
1255                                                 pPhotoLbl->Invalidate(true);
1256                                         }
1257                                         delete pPhotoBitmap;
1258                                 }
1259                         }
1260                         //show "On Hold"
1261                         ShowTimerInfo(IDC_CALLER2_TIME_LABEL, true);
1262                 }
1263         }
1264
1265         //update JoinCall button status
1266         bool isEnableJoinCall = true;
1267         CallInfo* pConfCallInfo = __pCallPresentor->GetConferenceCallInfoN();
1268         if(pConfCallInfo != null && pConfCallInfo->GetCallerListCount() >= IDI_MAX_CONF_CALL_PARTICIPANTS)
1269         {
1270                 isEnableJoinCall = false;
1271         }
1272         __pCallButtonsPanel->EnableJoinCallButton(isEnableJoinCall);
1273         delete pConfCallInfo;
1274         pConfCallInfo = null;
1275         Invalidate(true);
1276         AppLog("EXIT");
1277 }
1278
1279 void
1280 ActiveCallForm::ShowPersonDetails(const String& phoneNumber, const String& contactLblName, const String& nameLblName, bool isSecondCaller, CallInfo* pCallInfo)
1281 {
1282         //call individual methods to show contact number, caller name & photo
1283         ShowPhoneNumber(phoneNumber, contactLblName);
1284
1285         //fetch contact details based on phone number
1286         String* pDisplayName = pCallInfo->FetchCallerNameN();
1287         ShowCallerName(*pDisplayName, nameLblName);
1288
1289         Bitmap* pPhotoBitmap = pCallInfo->FetchCallerPhotoN();
1290         ShowCallerPhoto(pPhotoBitmap, isSecondCaller);
1291
1292         //free resources
1293         if (pDisplayName)
1294         {
1295                 delete pDisplayName;
1296                 pDisplayName = null;
1297         }
1298         if (pPhotoBitmap)
1299         {
1300                 delete pPhotoBitmap;
1301                 pPhotoBitmap = null;
1302         }
1303 }
1304
1305 void
1306 ActiveCallForm::ShowPhoneNumber(const String& phoneNumber, const String& contactLblName)
1307 {
1308         String formattedNumber = phoneNumber;
1309
1310         Label* pContactLbl = static_cast<Label*>(GetControl(contactLblName));
1311         if (pContactLbl)
1312         {
1313                 pContactLbl->SetText(formattedNumber);
1314                 pContactLbl->Invalidate(true);
1315         }
1316 }
1317
1318 void
1319 ActiveCallForm::ShowCallerName(const String& callerName, const String& nameLblName)
1320 {
1321         // show display name on name Label
1322         Label* pNameLbl = static_cast<Label*>(GetControl(nameLblName));
1323         if (pNameLbl)
1324         {
1325                 //passing an empty string to SetText fails in label,
1326                 //if previously valid text has been set
1327                 if (callerName.IsEmpty() == true && pNameLbl->GetText().IsEmpty() == false)
1328                 {
1329                         String stringToBeSet(L" ");
1330                         pNameLbl->SetText(stringToBeSet);
1331                 }
1332                 else
1333                 {
1334                         pNameLbl->SetText(callerName);
1335                 }
1336                 pNameLbl->Invalidate(true);
1337         }
1338 }
1339
1340 void
1341 ActiveCallForm::ShowCallerPhoto(Bitmap* pPhotoId, bool isSecondCaller)
1342 {
1343         //to check if default image is to be shown
1344         bool showDefaultPhoto = false;
1345         bool showSmallPhoto = false;
1346         String photoLabel("");
1347
1348         switch (__formType)
1349         {
1350         case FORMTYPE_OUTGOINGCALL:
1351         case FORMTYPE_ACTIVECALL:
1352         {
1353                 if (pPhotoId == null)
1354                 {
1355                         //show default caller image
1356                         showDefaultPhoto = true;
1357                 }
1358                 else
1359                 {
1360                         //Check the size of photo
1361                         // Now checking the condition with && but actually it should be ||
1362                         //But for now keeping it as && because _pContact->GetThubNail() returns image width as
1363                         // height 270 and width = 480 . So all images set thru gallery is show as small image
1364                         if(pPhotoId->GetHeight() <= H_SMALL_PHOTO
1365                                         && pPhotoId->GetWidth() <= W_SMALL_PHOTO)
1366                         {
1367                                 showSmallPhoto = true;
1368                         }
1369
1370                 }
1371                 photoLabel.Append(IDC_CALLER1_BIGPHOTO_LABEL);
1372         }
1373         break;
1374
1375         case FORMTYPE_MULTIPLECALLS:
1376         {
1377                 if (isSecondCaller)
1378                 {
1379                         photoLabel.Append(IDC_CALLER2_PHOTO_LABEL);
1380                 }
1381                 else
1382                 {
1383                         photoLabel.Append(IDC_CALLER1_PHOTO_LABEL);
1384                 }
1385
1386                 if (pPhotoId == null)
1387                 {
1388                         showDefaultPhoto = true;
1389                 }
1390                 else
1391                 {
1392                         if (pPhotoId->GetHeight() <= H_SMALL_PHOTO
1393                                 && pPhotoId->GetWidth() <= W_SMALL_PHOTO)
1394                         {
1395                                 //pPhotoId->Scale(Dimension(W_CONFERENCE_PHOTO,H_CONFERENCE_PHOTO));
1396                                 showSmallPhoto = true;
1397                         }
1398                 }
1399         }
1400         break;
1401
1402         default:
1403                 break;
1404         }
1405
1406         //Remove small photo label
1407         if (__pSmallPhotoLabel != null)
1408         {
1409                 RemoveControl(*__pSmallPhotoLabel);
1410                 __pSmallPhotoLabel = null;
1411         }
1412
1413         //show photo - for Big Photo Id, Animated Call Image
1414         if (!showDefaultPhoto)
1415         {
1416                 if(showSmallPhoto == true)
1417                 {
1418                         ShowThumbnailImage(pPhotoId,photoLabel);
1419                 }
1420                 else
1421                 {
1422                         Label* pPhotoLbl = static_cast<Label*>(GetControl(photoLabel));
1423                         if (pPhotoLbl)
1424                         {
1425                                 Canvas* pCanvas = new (std::nothrow) Canvas;
1426                                 Rectangle canvasRect(Rectangle(0, 0, pPhotoLbl->GetBounds().width, pPhotoLbl->GetBounds().height));
1427                                 pCanvas->Construct(canvasRect);
1428                                 //draw the contact bitmap
1429                                 pCanvas->DrawBitmap(canvasRect,*pPhotoId);
1430                                 Bitmap* pNewPhotoId = new Bitmap();
1431                                 pNewPhotoId->Construct(*pCanvas, pCanvas->GetBounds());
1432                                 delete pCanvas;
1433
1434                                 pPhotoLbl->SetBackgroundBitmap(*pNewPhotoId);
1435                                 pPhotoLbl->Invalidate(true);
1436                                 delete pNewPhotoId;
1437                         }
1438                 }
1439         }
1440         else
1441         {
1442                 Bitmap* pDefaultPhoto = null;
1443                 switch (__formType)
1444                 {
1445                 case FORMTYPE_OUTGOINGCALL:
1446                 case FORMTYPE_ACTIVECALL:
1447                         pDefaultPhoto = AppUtility::GetBitmapFromResourcesN(IDB_ACTIVE_CALL_DEFAULT_ICON,W_CONFERENCE_PHOTO,W_CONFERENCE_PHOTO);
1448                         break;
1449
1450                 case FORMTYPE_MULTIPLECALLS:
1451                         pDefaultPhoto = AppUtility::GetBitmapFromResourcesN(IDB_MULTIPLE_CALL_DEFAULT_ICON,W_CONFERENCE_PHOTO,H_CONFERENCE_PHOTO);
1452                         break;
1453
1454                 case FORMTYPE_ACTIVECONFCALL:
1455                         pDefaultPhoto = AppUtility::GetBitmapFromResourcesN(IDB_CONFERENCE_BIG_BG_ICON,W_CONFERENCE_PHOTO,W_CONFERENCE_PHOTO);
1456                         break;
1457
1458                 default:
1459                         break;
1460                 }
1461                 if (pDefaultPhoto != null)
1462                 {
1463                         Label* pPhotoLbl = static_cast<Label*>(GetControl(photoLabel));
1464                         if (pPhotoLbl)
1465                         {
1466                                 pPhotoLbl->SetBackgroundBitmap(*pDefaultPhoto);
1467                         }
1468                         delete pDefaultPhoto;
1469                 }
1470         }
1471 }
1472
1473 void
1474 ActiveCallForm::ShowThumbnailImage(const Bitmap* pPhotoId,String& photoLabel)
1475 {
1476         Label* pPhotoLbl = static_cast<Label*>(GetControl(photoLabel));
1477
1478         if (pPhotoLbl != null && pPhotoId != null)
1479         {
1480                 Canvas* pCanvas = new (std::nothrow) Canvas;
1481                 Bitmap* pBackground = AppUtility::GetBitmapFromResourcesN(IDB_CALL_THUMBNAIL_BACKGROUND,W_CALL_THUMBNAIL,H_CALL_THUMBNAIL);
1482                 Bitmap* pShadow = AppUtility::GetBitmapFromResourcesN(IDB_CALL_THUMBNAIL_SHADOW,W_CALL_THUMBNAIL_SHADOW,H_CALL_THUMBNAIL_SHADOW);
1483                 Rectangle canvasRect(Rectangle(0, 0, pPhotoLbl->GetBounds().width, pPhotoLbl->GetBounds().height));
1484                 pCanvas->Construct(canvasRect);
1485                 //draw the back ground
1486                 pCanvas->DrawBitmap(canvasRect,*pBackground);
1487                 //draw shadow (to be enabled after correct shadow image is provided )
1488                 //pCanvas->DrawBitmap(Rectangle((pPhotoLbl->GetBounds().width/2)-(W_CALL_THUMBNAIL_SHADOW/2),
1489                         //      (pPhotoLbl->GetBounds().height/2)-(H_CALL_THUMBNAIL_SHADOW/2),W_CALL_THUMBNAIL_SHADOW,H_CALL_THUMBNAIL_SHADOW),*pShadow);
1490                 //draw the contact bitmap
1491                 pCanvas->DrawBitmap(Rectangle((pPhotoLbl->GetBounds().width/2)-(W_SMALL_PHOTO/2),
1492                                 (pPhotoLbl->GetBounds().height/2)-(H_SMALL_PHOTO/2),W_SMALL_PHOTO,H_SMALL_PHOTO),*pPhotoId);
1493                 Bitmap* pNewPhotoId = new Bitmap();
1494                 pNewPhotoId->Construct(*pCanvas, pCanvas->GetBounds());
1495                 delete pCanvas;
1496
1497                 pPhotoLbl->SetBackgroundBitmap(*pNewPhotoId);
1498                 pPhotoLbl->Invalidate(true);
1499                 delete pNewPhotoId;
1500                 delete pBackground;
1501                 delete pShadow;
1502         }
1503
1504 }
1505
1506 void
1507 ActiveCallForm::ShowCallersPhotoThumbnail(const Bitmap& pPhotoId)
1508 {
1509         if (__pSmallPhotoLabel != null)
1510         {
1511                 RemoveControl(*__pSmallPhotoLabel);
1512                 __pSmallPhotoLabel = null;
1513         }
1514         //Draw Small Photo and show on small photo label
1515         __pSmallPhotoLabel  = new (std::nothrow) Label();//static_cast<Label*>(GetControl(IDC_SMALL_PHOTO_LABEL));
1516         __pSmallPhotoLabel->Construct(Rectangle(X_PHOTO_LBL, Y_PHOTO_LBL, W_PHOTO_LBL, H_PHOTO_LBL), L"");
1517         __pSmallPhotoLabel->SetBackgroundColor(Color(0,0,0));
1518         __pSmallPhotoLabel->SetBackgroundBitmap(pPhotoId);
1519         // Add a Label to the Form
1520         AddControl(*__pSmallPhotoLabel);
1521         __pSmallPhotoLabel->Invalidate(true);
1522 }
1523
1524 void
1525 ActiveCallForm::ShowTimerInfo(const String& timerLblName, bool isOnHold, long long startTime)
1526 {
1527         Label* pTimerLbl = static_cast<Label*>(GetControl(timerLblName));
1528
1529         if (__pActiveCallTimer == null)
1530         {
1531                 __pActiveCallTimer = new (std::nothrow) Tizen::Base::Runtime::Timer();
1532                 __pActiveCallTimer->Construct(*this);
1533         }
1534
1535         if (pTimerLbl != null)
1536         {
1537                 if (isOnHold == true)
1538                 {
1539                         pTimerLbl->SetText(AppUtility::GetResourceString(IDS_TIMER_ON_HOLD));
1540                         //update Hold button status
1541                         SetHoldButtonStatus(false);
1542                 }
1543                 else
1544                 {
1545                         //update Hold button status
1546                         SetHoldButtonStatus(true);
1547                         //current system time
1548                         long long currTime = 0;
1549                         SystemTime::GetTicks(currTime);
1550                         //Set call duration
1551                         TimeSpan diffSpan(abs(startTime - currTime));
1552
1553                         String activeCallTime(L"");
1554
1555                         long long hr = diffSpan.GetHours();
1556                         if (hr <= 9)
1557                         {
1558                                 activeCallTime.Append("0");
1559                         }
1560                         activeCallTime.Append(hr);
1561                         activeCallTime.Append(L":");
1562
1563                         long long min = diffSpan.GetMinutes();
1564                         if (min <= 9)
1565                         {
1566                                 activeCallTime.Append("0");
1567                         }
1568                         activeCallTime.Append(min);
1569                         activeCallTime.Append(L":");
1570
1571                         long long sec = diffSpan.GetSeconds();
1572                         if (sec <= 9)
1573                         {
1574                                 activeCallTime.Append("0");
1575                         }
1576                         activeCallTime.Append(sec);
1577
1578                         pTimerLbl->SetText(activeCallTime);
1579                         __pActiveCallTimer->StartAsRepeatable(TimeSpan::NUM_OF_TICKS_IN_SECOND);
1580                 }
1581                 pTimerLbl->Invalidate(true);
1582         }
1583 }
1584
1585 void
1586 ActiveCallForm::SetShowStateOnKeypad(bool showState)
1587 {
1588         Label* pLblControl = static_cast<Label*>(GetControl(IDC_CALLER1_LABEL));
1589         pLblControl->SetShowState(showState);
1590         pLblControl = static_cast<Label*>(GetControl(IDC_BACKGROUND_LABEL));
1591         pLblControl->SetShowState(showState);
1592         pLblControl = static_cast<Label*>(GetControl(IDC_CALLER1_TIME_LABEL));
1593         pLblControl->SetShowState(showState);
1594         if (__pSmallPhotoLabel != null)
1595         {
1596                 __pSmallPhotoLabel->SetShowState(showState);
1597         }
1598
1599         switch (__formType)
1600         {
1601         case FORMTYPE_ACTIVECALL:
1602         {
1603                 pLblControl = static_cast<Label*>(GetControl(IDC_NUMBER1_LABEL));
1604                 pLblControl->SetShowState(showState);
1605                 pLblControl = static_cast<Label*>(GetControl(IDC_VOICE_CALL_ICON_LABEL));
1606                 pLblControl->SetShowState(showState);
1607                 pLblControl = static_cast<Label*>(GetControl(IDC_HOLD_LABEL));
1608                 pLblControl->SetShowState(showState);
1609                 Button* pButtonControl = static_cast<Button*>(GetControl(IDC_HOLD_BUTTON));
1610                 pButtonControl->SetShowState(showState);
1611         }
1612         break;
1613
1614         case FORMTYPE_MULTIPLECALLS:
1615         {
1616                 pLblControl = static_cast<Label*>(GetControl(IDC_NUMBER1_LABEL));
1617                 pLblControl->SetShowState(showState);
1618                 pLblControl = static_cast<Label*>(GetControl(IDC_CALLER2_LABEL));
1619                 pLblControl->SetShowState(showState);
1620                 pLblControl = static_cast<Label*>(GetControl(IDC_NUMBER2_LABEL));
1621                 pLblControl->SetShowState(showState);
1622                 pLblControl = static_cast<Label*>(GetControl(IDC_CALLER2_TIME_LABEL));
1623                 pLblControl->SetShowState(showState);
1624                 pLblControl = static_cast<Label*>(GetControl(IDC_SWAP_LABEL));
1625                 pLblControl->SetShowState(showState);
1626                 pLblControl = static_cast<Label*>(GetControl(IDC_BACKGROUND_LABEL2));
1627                 pLblControl->SetShowState(showState);
1628                 if (__pActiveCallInfo != null && __pActiveCallInfo->IsConferenceCall() == false)
1629                 {
1630                         pLblControl = static_cast<Label*>(GetControl(IDC_VOICE_CALL_ICON_LABEL));
1631                         pLblControl->SetShowState(showState);
1632                 }
1633                 else
1634                 {
1635                         Button* pButtonControl = static_cast<Button*>(GetControl(IDC_CONF_CALL_MORE_BUTTON));
1636                         pButtonControl->SetShowState(showState);
1637                 }
1638                 Button* pButtonControl = static_cast<Button*>(GetControl(IDC_SWAP_BUTTON));
1639                 pButtonControl->SetShowState(showState);
1640         }
1641         break;
1642
1643         case FORMTYPE_ACTIVECONFCALL:
1644         {
1645                 pLblControl = static_cast<Label*>(GetControl(IDC_PARTICIPANTS_LABEL));
1646                 pLblControl->SetShowState(showState);
1647                 pLblControl = static_cast<Label*>(GetControl(IDC_HOLD_LABEL));
1648                 pLblControl->SetShowState(showState);
1649                 Button* pButtonControl = static_cast<Button*>(GetControl(IDC_HOLD_BUTTON));
1650                 pButtonControl->SetShowState(showState);
1651                 pButtonControl = static_cast<Button*>(GetControl(IDC_CONF_CALL_MORE_BUTTON));
1652                 pButtonControl->SetShowState(showState);
1653         }
1654         break;
1655
1656         default:
1657                 break;
1658         }
1659 }
1660
1661 void
1662 ActiveCallForm::OnTimerExpired(Tizen::Base::Runtime::Timer& timer)
1663 {
1664         //Call default implementation of "Object.Equals()"
1665         //returns true, if they are pointing to same address.
1666         if (__pActiveCallTimer->Equals(timer))
1667         {
1668                 Label* pTimerLbl = static_cast<Label*>(GetControl(IDC_CALLER1_TIME_LABEL));
1669                 if (pTimerLbl)
1670                 {
1671                         String activeCallTime = pTimerLbl->GetText();
1672                         // Create a StringTokenizer instance
1673                         StringTokenizer strTokens(activeCallTime, L":");
1674
1675                         int count = strTokens.GetTokenCount(); // count == 3
1676                         String token;
1677                         int sec = 0;
1678                         int min = 0;
1679                         int hr = 0;
1680                         for (int index = 0; index < count; index++)
1681                         {
1682                                 switch (index)
1683                                 {
1684                                 case 0:
1685                                         strTokens.GetNextToken(token);
1686                                         Integer::Parse(token, hr);
1687                                         break;
1688
1689                                 case 1:
1690                                         strTokens.GetNextToken(token);
1691                                         Integer::Parse(token, min);
1692                                         break;
1693
1694                                 case 2:
1695                                         strTokens.GetNextToken(token);
1696                                         Integer::Parse(token, sec);
1697                                         break;
1698                                 }
1699                         }
1700                         //update all values
1701                         sec = sec + 1;
1702                         if (sec == IDI_MAX_SECONDS)
1703                         {
1704                                 sec = 0;
1705                                 min = min + 1;
1706                         }
1707                         if (min == IDI_MAX_MINS)
1708                         {
1709                                 min = 0;
1710                                 hr = hr + 1;
1711                         }
1712
1713                         //replace string
1714                         activeCallTime.Clear();
1715                         if (hr <= 9)
1716                         {
1717                                 activeCallTime.Append("0");
1718                         }
1719                         activeCallTime.Append(hr);
1720                         activeCallTime.Append(":");
1721                         if (min <= 9)
1722                         {
1723                                 activeCallTime.Append("0");
1724                         }
1725                         activeCallTime.Append(min);
1726                         activeCallTime.Append(":");
1727                         if (sec <= 9)
1728                         {
1729                                 activeCallTime.Append("0");
1730                         }
1731                         activeCallTime.Append(sec);
1732                         //update timer label
1733                         pTimerLbl->SetText(activeCallTime);
1734                         pTimerLbl->Invalidate(true);
1735                 }
1736         }
1737 }
1738
1739 ///////////////////////////////////////////////////////////
1740 ///////////     Options Menu List Functionality   /////////
1741 ///////////////////////////////////////////////////////////
1742 void
1743 ActiveCallForm::OnListViewContextItemStateChanged(ListView& listView, int index, int elementId, ListContextItemStatus state)
1744 {
1745 }
1746
1747 void
1748 ActiveCallForm::OnListViewItemStateChanged(ListView& listView, int index, int elementId, ListItemStatus status)
1749 {
1750         //Goto conference call list form
1751         SceneManager* pSceneManager = SceneManager::GetInstance();
1752         pSceneManager->GoForward(ForwardSceneTransition(IDSCN_SCENE_CONFCALLLIST), null);
1753 }
1754
1755 void
1756 ActiveCallForm::OnListViewItemSwept(ListView& listView, int index, SweepDirection direction)
1757 {
1758 }
1759
1760 void
1761 ActiveCallForm::OnListViewItemLongPressed(ListView& listView, int index, int elementId, bool& invokeListViewItemCallback)
1762 {
1763 }
1764
1765 int
1766 ActiveCallForm::GetItemCount(void)
1767 {
1768         return IDI_MOREOPTIONS_LIST_ITEMS;
1769 }
1770
1771 ListItemBase*
1772 ActiveCallForm::CreateItem(int index, int itemWidth)
1773 {
1774         //create 1st Menu option
1775         CustomItem* pItem = new (std::nothrow) CustomItem();
1776         pItem->Construct(IDI_OPTIONMENU_DIMEN, LIST_ANNEX_STYLE_NORMAL);
1777
1778         //Set background 9-patch bitmap to option menu
1779         Bitmap* pBgBmp = AppUtility::GetBitmapFromResourcesN(IDB_POPUP_BG_ICON);
1780         if (pBgBmp != null && pBgBmp->IsNinePatchedBitmap())
1781         {
1782                 Canvas bgCanvas;
1783                 bgCanvas.Construct(Rectangle(IDI_OPTIONMENU_POS, IDI_OPTIONMENU_DIMEN));
1784                 bgCanvas.DrawNinePatchedBitmap(bgCanvas.GetBounds(), *pBgBmp);
1785         }
1786         else
1787         {
1788                 pItem->SetBackgroundColor(LIST_ITEM_DRAWING_STATUS_NORMAL, Color(40, 45, 48));
1789         }
1790         delete pBgBmp;
1791         pBgBmp = null;
1792
1793         //Set bitmap to option menu
1794         Bitmap* pNormalConfCallBmp = AppUtility::GetBitmapFromResourcesN(IDB_MORE_MANAGE_CONFERENCE_ICON ,
1795                                                                                                                                          W_MGR_CONFCALL_BITMAP, H_MGR_CONFCALL_BITMAP);
1796         pItem->AddElement(Rectangle(16, 17, W_MGR_CONFCALL_BITMAP, H_MGR_CONFCALL_BITMAP), 1, *pNormalConfCallBmp, null, null);
1797         // Deallocate bitmaps
1798         delete pNormalConfCallBmp;
1799         pNormalConfCallBmp = null;
1800
1801         //Set text to menu option
1802         String confCallName = AppUtility::GetResourceString(IDS_MGR_CONF_CALL_LIST_STR);
1803
1804         TextElement* pTextElement = new (std::nothrow) TextElement();
1805         pTextElement->Construct(confCallName);
1806         pTextElement->SetTextColor(COLOR_POPUP_TEXT);
1807         //create font
1808         Font font;
1809         font.Construct(FONT_STYLE_PLAIN, IDI_POPUP_TEXT_SIZE);
1810         pTextElement->SetFont(font);
1811         //construct Enriched text
1812         EnrichedText* pEnrichedText = new (std::nothrow) EnrichedText();
1813         Dimension textDimension;
1814         font.GetTextExtent(confCallName, confCallName.GetLength(), textDimension);
1815         textDimension.height = textDimension.height + font.GetDescender();
1816         pEnrichedText->Construct(textDimension);
1817         //add text element to enriched text
1818         pEnrichedText->Add(*pTextElement);
1819
1820         //Add Enriched text to pItem
1821         Point textPos(((2 * IDI_OPTIONMENU_ITEM_SPACING) + W_MGR_CONFCALL_BITMAP), ((IDI_OPTIONMENU_DIMEN.height - textDimension.height) / 2));
1822         pItem->AddElement(Rectangle(textPos, textDimension), 2, *pEnrichedText);
1823         // Cleans up
1824         pEnrichedText->RemoveAll(true);
1825         delete pEnrichedText;
1826         return pItem;
1827 }
1828
1829 bool
1830 ActiveCallForm::DeleteItem(int index, ListItemBase* pItem, int itemWidth)
1831 {
1832         delete pItem;
1833         return true;
1834 }