2 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
4 // Licensed under the Flora License, Version 1.1 (the License);
5 // you may not use this file except in compliance with the License.
6 // You may obtain a copy of the License at
8 // http://floralicense.org/license/
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an AS IS BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
18 * @file CallConfCallerListForm.cpp
19 * @brief Conference caller list form
22 #include "CallConfCallerListForm.h"
23 #include "CallAppUtility.h"
24 #include "CallPresentationModel.h"
25 #include "CallSceneRegister.h"
27 using namespace Tizen::App;
28 using namespace Tizen::Base;
29 using namespace Tizen::Base::Collection;
30 using namespace Tizen::Base::Runtime;
31 using namespace Tizen::Base::Utility;
32 using namespace Tizen::Graphics;
33 using namespace Tizen::System;
34 using namespace Tizen::Ui;
35 using namespace Tizen::Ui::Controls;
36 using namespace Tizen::Ui::Scenes;
39 const int W_HOLD_BITMAP = 78;
40 const int H_HOLD_BITMAP = 78;
41 const int W_BACK_BITMAP = 56;
42 const int H_BACK_BITMAP = 56;
43 const int X_BACK_BITMAP = 8;
44 const int Y_BACK_BITMAP = 8;
45 const int W_SPLIT_BITMAP = 74;
46 const int H_SPLIT_BITMAP = 74;
47 const int W_END_BITMAP = 80;
48 const int H_END_BITMAP = 74;
49 const int IDI_MAX_SECONDS = 60;
50 const int IDI_MAX_MINS = 60;
51 const int LIST_ITEM_HEIGHT = 112;
52 const int X_SPLIT_BUTTON_MARGIN = 26;
53 const int Y_SPLIT_BUTTON_MARGIN = 19;
54 const int X_END_BUTTON_PADDING = 26;
55 const int X_CALLER_LABEL = 116;
56 const int Y_CALLER_LABEL = 0;
57 const int W_CALLER_LABEL = 488;
58 const int H_CALLER_LABEL = 112;
61 static const wchar_t* IDL_CONFCALL_LIST_FORM = L"IDL_CONFCALL_LIST_FORM";
62 static const wchar_t* IDC_CALL_TIME_LABEL = L"IDC_CALL_TIME_LABEL";
63 static const wchar_t* IDB_SPLIT_NORMAL_BUTTON_ICON = L"C01-1_conference_split.png";
64 static const wchar_t* IDB_SPLIT_PRESS_BUTTON_ICON = L"C01-1_conference_split_press.png";
65 static const wchar_t* IDB_END_NORMAL_BUTTON_ICON = L"C01-1_conference_end.png";
66 static const wchar_t* IDB_END_PRESS_BUTTON_ICON = L"C01-1_conference_end_press.png";
67 static const wchar_t* IDC_END_CONFCALL_BUTTON = L"IDC_END_CONFCALL_BUTTON";
68 static const wchar_t* IDC_HOLD_CONFCALL_BUTTON = L"IDC_HOLD_CONFCALL_BUTTON";
69 static const wchar_t* IDC_CALLER1_PANEL = L"IDC_CALLER1_PANEL";
70 static const wchar_t* IDC__LINE_LABEL1 = L"IDC__LINE_LABEL1";
71 static const wchar_t* IDC_CALLER2_PANEL = L"IDC_CALLER2_PANEL";
72 static const wchar_t* IDC__LINE_LABEL2 = L"IDC__LINE_LABEL2";
73 static const wchar_t* IDC_CALLER3_PANEL = L"IDC_CALLER3_PANEL";
74 static const wchar_t* IDC__LINE_LABEL3 = L"IDC__LINE_LABEL3";
75 static const wchar_t* IDC_CALLER4_PANEL = L"IDC_CALLER4_PANEL";
76 static const wchar_t* IDC__LINE_LABEL4 = L"IDC__LINE_LABEL4";
77 static const wchar_t* IDC_CALLER5_PANEL = L"IDC_CALLER5_PANEL";
78 static const wchar_t* IDC__LINE_LABEL5 = L"IDC__LINE_LABEL5";
79 static const wchar_t* IDC_END_CALLER1 = L"IDC_END_CALLER1";
80 static const wchar_t* IDC_SPLIT_CALLER1 = L"IDC_SPLIT_CALLER1";
81 static const wchar_t* IDC_CALLER1_LABEL = L"IDC_CALLER1_LABEL";
82 static const wchar_t* IDC_END_CALLER2 = L"IDC_END_CALLER2";
83 static const wchar_t* IDC_SPLIT_CALLER2 = L"IDC_SPLIT_CALLER2";
84 static const wchar_t* IDC_CALLER2_LABEL = L"IDC_CALLER2_LABEL";
85 static const wchar_t* IDC_END_CALLER3 = L"IDC_END_CALLER3";
86 static const wchar_t* IDC_SPLIT_CALLER3 = L"IDC_SPLIT_CALLER3";
87 static const wchar_t* IDC_CALLER3_LABEL = L"IDC_CALLER3_LABEL";
88 static const wchar_t* IDC_END_CALLER4 = L"IDC_END_CALLER4";
89 static const wchar_t* IDC_SPLIT_CALLER4 = L"IDC_SPLIT_CALLER4";
90 static const wchar_t* IDC_CALLER4_LABEL = L"IDC_CALLER4_LABEL";
91 static const wchar_t* IDC_END_CALLER5 = L"IDC_END_CALLER5";
92 static const wchar_t* IDC_SPLIT_CALLER5 = L"IDC_SPLIT_CALLER5";
93 static const wchar_t* IDC_CALLER5_LABEL = L"IDC_CALLER5_LABEL";
94 static const wchar_t* IDC_CONF_CALL_LIST_TABLEVIEW = L"IDC_CONF_CALL_LIST_TABLEVIEW";
97 const unsigned int COLOR_END_CALL_BG = Color32<180, 60, 60>::Value;
98 const unsigned int COLOR_END_CALL_BG_PRESS = Color32<61, 153, 208>::Value;
99 const unsigned int COLOR_SPLIT_CALL_BG = Color32<129, 140, 148>::Value;
100 const unsigned int COLOR_SPLIT_CALL_BG_PRESS = Color32<63, 155, 210>::Value;
101 ConfCallerListForm::ConfCallerListForm(void)
102 : BaseForm(FORMTYPE_CONFCALLLIST)
104 __pConfCallInfo = null;
105 __pConfCallTimer = null;
106 __isCallSplit = false;
107 __pAddressbook = null;
110 ConfCallerListForm::~ConfCallerListForm(void)
112 if (__pConfCallTimer != null)
114 __pConfCallTimer->Cancel();
115 delete __pConfCallTimer;
120 ConfCallerListForm::Initialize(void)
122 Construct(IDL_CONFCALL_LIST_FORM);
126 ConfCallerListForm::OnInitializing(void)
128 result r = E_SUCCESS;
129 //Add action listener to buttons
130 AddActionListener(IDC_END_CONFCALL_BUTTON, IDA_END_CONF_CALL);
131 AddActionListener(IDC_HOLD_CONFCALL_BUTTON, IDA_HOLD_CONF_CALL);
133 Footer* pFooter = GetFooter();
136 SetFormBackEventListener(this);
138 Label* pTimerLbl = static_cast<Label*>(GetControl(IDC_CALL_TIME_LABEL));
139 SetControlAlwaysOnTop(*pTimerLbl,true);
142 __pCallPresentor = CallPresentationModel::GetInstance();
147 ConfCallerListForm::CreateTableView(void)
149 __pList = static_cast <TableView*> (GetControl(IDC_CONF_CALL_LIST_TABLEVIEW));
150 __pList->SetItemProvider(this);
155 ConfCallerListForm::AddActionListener(const String& keyName, CommandIds cmdId)
157 Button* pButtonKeypad = static_cast<Button*>(GetControl(keyName));
158 if (pButtonKeypad != null)
160 pButtonKeypad->SetActionId(cmdId);
161 pButtonKeypad->AddActionEventListener(*this);
166 ConfCallerListForm::OnTerminating(void)
168 result r = E_SUCCESS;
170 if (__pCallPresentor != null)
172 __pCallPresentor = null;
175 if (__pConfCallInfo != null)
177 delete __pConfCallInfo;
178 __pConfCallInfo = null;
181 //RemoveAllControls();
186 ConfCallerListForm::OnActionPerformed(const Control& source, int actionId)
188 SceneManager* pSceneManager = SceneManager::GetInstance();
189 AppAssert(pSceneManager);
193 case IDA_END_CONF_CALL:
195 bool success = __pCallPresentor->EndConferenceCall();
198 delete __pConfCallInfo;
199 __pConfCallInfo = null;
204 case IDA_HOLD_CONF_CALL:
206 // User has pressed end conference call and we are waiting for TAPI response
207 if(__pConfCallInfo == null)
212 bool isCallOnHold = __pConfCallInfo->IsOnHold();
213 if (isCallOnHold == false)
215 success = __pCallPresentor->HoldConferenceCall();
219 success = __pCallPresentor->ActivateConferenceCall();
222 //Check if request to Hold / UnHold call is successful.
225 //If success, then invert the Hold status in conference call
226 isCallOnHold = !(isCallOnHold);
227 __pConfCallInfo->SetOnHold(isCallOnHold);
229 __pList->UpdateTableView();
230 SetHoldButtonStatus(isCallOnHold);
237 ArrayListT<AppCallInfo>* pCallList = static_cast<ArrayListT<AppCallInfo>*>(__pCallPresentor->GetCallListN());
238 int noOfCalls = pCallList->GetCount();
240 //Ownership - To be deleted in 'OnSceneActivatedN' of next form
241 ArrayList* pCallInfoList = new (std::nothrow) ArrayList(SingleObjectDeleter);
242 pCallInfoList->Construct(noOfCalls);
244 for (int index = 0; index < noOfCalls; index++)
246 //fetch call info and add to list
247 AppCallInfo callInfo;
248 result r = pCallList->GetAt(index, callInfo);
251 //copy call information to new instance
252 AppCallInfo* pCaller = new (std::nothrow) AppCallInfo();
254 pCallInfoList->Add(pCaller);
260 //single active call - goto active call form
261 pSceneManager->GoForward(ForwardSceneTransition(IDSCN_SCENE_CONFCALL,
262 SCENE_TRANSITION_ANIMATION_TYPE_NONE, SCENE_HISTORY_OPTION_NO_HISTORY,SCENE_DESTROY_OPTION_DESTROY), pCallInfoList);
266 //goto multiple active call form
267 pSceneManager->GoForward(ForwardSceneTransition(IDSCN_SCENE_MULTIPLEACTIVECALL,
268 SCENE_TRANSITION_ANIMATION_TYPE_NONE, SCENE_HISTORY_OPTION_NO_HISTORY,SCENE_DESTROY_OPTION_DESTROY), pCallInfoList);
270 pCallList->RemoveAll();
275 case IDA_SPLIT_CALLER1:
276 case IDA_SPLIT_CALLER2:
277 case IDA_SPLIT_CALLER3:
278 case IDA_SPLIT_CALLER4:
279 case IDA_SPLIT_CALLER5:
281 // User has pressed end conference call and we are waiting for TAPI response
282 if(__pConfCallInfo == null)
286 __isCallSplit = __pCallPresentor->SplitFromConference(SplitConfCallerCmdIds(actionId),__pConfCallInfo->GetCallerList());
287 if(__isCallSplit == true)
289 __pList->UpdateTableView();
294 case IDA_END_CALLER1:
295 case IDA_END_CALLER2:
296 case IDA_END_CALLER3:
297 case IDA_END_CALLER4:
298 case IDA_END_CALLER5:
300 // User has pressed end conference call and we are waiting for TAPI response
301 if(__pConfCallInfo == null)
305 __pCallPresentor->EndCallFromConference(EndConfCallerCmdIds(actionId),__pConfCallInfo->GetCallerList());
315 ConfCallerListForm::OnSceneActivatedN(const SceneId& previousSceneId, const SceneId& currentSceneId, IList* pArgs)
317 //set itself as listener
318 __pCallPresentor->SetTelEventListener(this);
319 __isCallSplit = false;
321 AppLogDebug("Enter");
323 //DisableAllControls();
324 if (__pConfCallInfo != null)
326 delete __pConfCallInfo;
327 __pConfCallInfo = null;
329 //show 1st caller's info.
330 //Fetch Conference call info from telephony manager
331 __pConfCallInfo = __pCallPresentor->GetConferenceCallInfoN();
332 AppLogDebug("Enter %x",__pConfCallInfo);
334 AddressbookManager* pAddressbookManager = AddressbookManager::GetInstance();
335 __pAddressbook = pAddressbookManager->GetAddressbookN(DEFAULT_ADDRESSBOOK_ID);
336 if(__pAddressbook != null)
338 __pAddressbook->SetAddressbookChangeEventListener(this);
341 //show active call timer
342 ShowTimerInfo(IDC_CALL_TIME_LABEL, __pConfCallInfo->GetCallConnectTime());
344 //Set the correct bitmap to the "hold" button based on the current state of the call
345 SetHoldButtonStatus(__pConfCallInfo->IsOnHold());
346 //disable Hold Button, if 2 active calls are present,Else enable it.
347 Button* pButtonHold = static_cast<Button*>(GetControl(IDC_HOLD_CONFCALL_BUTTON));
348 if(pButtonHold != null)
350 if (__pCallPresentor->GetCurrentCallCount() == IDI_MAX_ACTIVE_CALLS)
352 pButtonHold->SetShowState(false);
356 pButtonHold->SetShowState(true);
358 pButtonHold->Invalidate(true);
361 __pList->UpdateTableView();
362 AddOrientationEventListener(*this);
366 ConfCallerListForm::OnSceneDeactivated(const SceneId& currentSceneId, const SceneId& nextSceneId)
368 RemoveOrientationEventListener(*this);
369 if (__pConfCallTimer != null)
371 __pConfCallTimer->Cancel();
372 delete __pConfCallTimer;
373 __pConfCallTimer = null;
375 if(__pAddressbook != null)
377 __pAddressbook->SetAddressbookChangeEventListener(null);
382 ConfCallerListForm::OnDraw(void)
388 ConfCallerListForm::SetHoldButtonStatus(bool isCallOnHold)
390 Button* pButtonHold = static_cast<Button*>(GetControl(IDC_HOLD_CONFCALL_BUTTON));
391 if(pButtonHold != null)
393 Bitmap* pNormalBitmapToBeDrawn = null;
394 Bitmap* pPressBitmapToBeDrawn = null;
396 if (isCallOnHold == true)
398 pNormalBitmapToBeDrawn = AppUtility::GetBitmapFromResourcesN(IDB_UNHOLD_NORMAL_BUTTON_ICON,
399 W_HOLD_BITMAP, W_HOLD_BITMAP);
400 pPressBitmapToBeDrawn = AppUtility::GetBitmapFromResourcesN(IDB_UNHOLD_PRESS_BUTTON_ICON,
401 W_HOLD_BITMAP, W_HOLD_BITMAP);
405 pNormalBitmapToBeDrawn = AppUtility::GetBitmapFromResourcesN(IDB_HOLD_NORMAL_BUTTON_ICON,
406 W_HOLD_BITMAP, W_HOLD_BITMAP);
407 pPressBitmapToBeDrawn = AppUtility::GetBitmapFromResourcesN(IDB_HOLD_PRESS_BUTTON_ICON,
408 W_HOLD_BITMAP, W_HOLD_BITMAP);
411 if (pNormalBitmapToBeDrawn)
413 pButtonHold->SetNormalBitmap(Point(0, 0), *pNormalBitmapToBeDrawn);
415 if (pPressBitmapToBeDrawn)
417 pButtonHold->SetPressedBitmap(Point(0, 0), *pPressBitmapToBeDrawn);
420 pButtonHold->Invalidate(true);
421 delete pNormalBitmapToBeDrawn;
422 pNormalBitmapToBeDrawn = null;
423 delete pPressBitmapToBeDrawn;
424 pPressBitmapToBeDrawn = null;
429 ConfCallerListForm::HandleParticipantsChanged(void)
431 AppLogDebug("Enter");
432 AppCallInfo* pCallInfo = __pCallPresentor->GetConferenceCallInfoN();
433 if (pCallInfo == null)
437 if (__pConfCallInfo != null)
439 delete __pConfCallInfo;
440 __pConfCallInfo = null;
442 __pConfCallInfo = new (std::nothrow) AppCallInfo();
443 *__pConfCallInfo = *pCallInfo;
444 __pList->UpdateTableView();
448 ConfCallerListForm::DisableAllControls(void)
450 Panel* pKeysPanel = static_cast<Panel*>(GetControl(IDC_CALLER1_PANEL));
451 if (pKeysPanel != null)
453 pKeysPanel->SetShowState(false);
454 Label* pLineLabel1 = static_cast<Label*>(GetControl(IDC__LINE_LABEL1));
455 pLineLabel1->SetShowState(false);
458 pKeysPanel = static_cast<Panel*>(GetControl(IDC_CALLER2_PANEL));
459 if (pKeysPanel != null)
461 pKeysPanel->SetShowState(false);
462 Label* pLineLabel1 = static_cast<Label*>(GetControl(IDC__LINE_LABEL2));
463 pLineLabel1->SetShowState(false);
466 pKeysPanel = static_cast<Panel*>(GetControl(IDC_CALLER3_PANEL));
467 if (pKeysPanel != null)
469 pKeysPanel->SetShowState(false);
470 Label* pLineLabel1 = static_cast<Label*>(GetControl(IDC__LINE_LABEL3));
471 pLineLabel1->SetShowState(false);
474 pKeysPanel = static_cast<Panel*>(GetControl(IDC_CALLER4_PANEL));
475 if (pKeysPanel != null)
477 pKeysPanel->SetShowState(false);
478 Label* pLineLabel1 = static_cast<Label*>(GetControl(IDC__LINE_LABEL4));
479 pLineLabel1->SetShowState(false);
482 pKeysPanel = static_cast<Panel*>(GetControl(IDC_CALLER5_PANEL));
483 if (pKeysPanel != null)
485 pKeysPanel->SetShowState(false);
486 Label* pLineLabel1 = static_cast<Label*>(GetControl(IDC__LINE_LABEL5));
487 pLineLabel1->SetShowState(false);
493 ConfCallerListForm::ShowTimerInfo(const String& timerLblName, long long startTime)
495 Label* pTimerLbl = static_cast<Label*>(GetControl(timerLblName));
497 if (__pConfCallTimer == null)
499 __pConfCallTimer = new (std::nothrow) Timer();
500 __pConfCallTimer->Construct(*this);
503 if (pTimerLbl != null)
505 //current system time
506 long long currTime = 0;
507 SystemTime::GetTicks(currTime);
509 TimeSpan diffSpan(abs(startTime - currTime));
511 String activeCallTime(L"");
513 long long hr = diffSpan.GetHours();
515 activeCallTime.Append("0");
517 activeCallTime.Append(hr);
518 activeCallTime.Append(L":");
520 long long min = diffSpan.GetMinutes();
522 activeCallTime.Append("0");
524 activeCallTime.Append(min);
525 activeCallTime.Append(L":");
527 long long sec = diffSpan.GetSeconds();
529 activeCallTime.Append("0");
531 activeCallTime.Append(sec);
533 pTimerLbl->SetText(activeCallTime);
534 __pConfCallTimer->StartAsRepeatable(TimeSpan::NUM_OF_TICKS_IN_SECOND);
540 ConfCallerListForm::OnTimerExpired(Tizen::Base::Runtime::Timer& timer)
542 //Call default implementation of "Object.Equals()"
543 //returns true, if they are pointing to same address.
544 if (__pConfCallTimer->Equals(timer))
546 Label* pTimerLbl = static_cast<Label*>(GetControl(IDC_CALL_TIME_LABEL));
549 String activeCallTime = pTimerLbl->GetText();
550 // Create a StringTokenizer instance
551 StringTokenizer strTokens(activeCallTime, L":");
553 int count = strTokens.GetTokenCount(); // count == 3
558 for (int index = 0; index < count; index++)
563 strTokens.GetNextToken(token);
564 Integer::Parse(token, hr);
568 strTokens.GetNextToken(token);
569 Integer::Parse(token, min);
573 strTokens.GetNextToken(token);
574 Integer::Parse(token, sec);
580 if (sec == IDI_MAX_SECONDS)
585 if (min == IDI_MAX_MINS)
592 activeCallTime.Clear();
595 activeCallTime.Append("0");
597 activeCallTime.Append(hr);
598 activeCallTime.Append(":");
601 activeCallTime.Append("0");
603 activeCallTime.Append(min);
604 activeCallTime.Append(":");
607 activeCallTime.Append("0");
609 activeCallTime.Append(sec);
611 pTimerLbl->SetText(activeCallTime);
612 pTimerLbl->Invalidate(true);
618 ConfCallerListForm::OnFormBackRequested(Form& source)
620 //If the call is split then wait for it to automatically go back once it split is success
621 if(__isCallSplit == true)
625 SceneManager* pSceneManager = SceneManager::GetInstance();
626 AppAssert(pSceneManager);
629 ArrayListT<AppCallInfo>* pCallList = static_cast<ArrayListT<AppCallInfo>*>(__pCallPresentor->GetCallListN());
630 int noOfCalls = pCallList->GetCount();
632 //Ownership - To be deleted in 'OnSceneActivatedN' of next form
633 ArrayList* pCallInfoList = new (std::nothrow) ArrayList(SingleObjectDeleter);
634 pCallInfoList->Construct(noOfCalls);
636 for (int index = 0; index < noOfCalls; index++)
638 //fetch call info and add to list
639 AppCallInfo callInfo;
640 result r = pCallList->GetAt(index, callInfo);
643 //copy call information to new instance
644 AppCallInfo* pCaller = new (std::nothrow) AppCallInfo();
646 pCallInfoList->Add(pCaller);
652 //single active call - goto active call form
653 pSceneManager->GoForward(ForwardSceneTransition(IDSCN_SCENE_CONFCALL,
654 SCENE_TRANSITION_ANIMATION_TYPE_NONE, SCENE_HISTORY_OPTION_NO_HISTORY,SCENE_DESTROY_OPTION_DESTROY), pCallInfoList);
658 //goto multiple active call form
659 pSceneManager->GoForward(ForwardSceneTransition(IDSCN_SCENE_MULTIPLEACTIVECALL,
660 SCENE_TRANSITION_ANIMATION_TYPE_NONE, SCENE_HISTORY_OPTION_NO_HISTORY,SCENE_DESTROY_OPTION_DESTROY), pCallInfoList);
662 pCallList->RemoveAll();
668 ConfCallerListForm::OnContactsChanged(const Tizen::Base::Collection::IList& contactChangeInfoList)
670 __pList->UpdateTableView();
674 ConfCallerListForm::OnCategoriesChanged(const Tizen::Base::Collection::IList& categoryChangeInfoList)
680 ConfCallerListForm::CreateItemAndAddActionListener( Button& splitButton,
681 Button& endButton, Label& callerLabel, SplitConfCallerCmdIds splitCmdId,
682 EndConfCallerCmdIds EndCmdId, const String& displayName)
684 Bitmap* pNormalSplitBitmap = null;
685 Bitmap* pPressSplitBitmap = null;
686 Bitmap* pNormalEndBitmap = null;
687 Bitmap* pPressEndBitmap = null;
689 pNormalSplitBitmap = AppUtility::GetBitmapFromResourcesN(IDB_SPLIT_NORMAL_BUTTON_ICON,
690 W_SPLIT_BITMAP, H_SPLIT_BITMAP);
691 pPressSplitBitmap = AppUtility::GetBitmapFromResourcesN(IDB_SPLIT_PRESS_BUTTON_ICON,
692 W_SPLIT_BITMAP, H_SPLIT_BITMAP);
693 pNormalEndBitmap = AppUtility::GetBitmapFromResourcesN(IDB_END_NORMAL_BUTTON_ICON,
694 W_END_BITMAP, H_END_BITMAP);
695 pPressEndBitmap = AppUtility::GetBitmapFromResourcesN(IDB_END_PRESS_BUTTON_ICON,
696 W_END_BITMAP, H_END_BITMAP);
698 bool isSplitAllowed = true;
699 if ((__pCallPresentor->IsSplitAllowed() == false) || (__pConfCallInfo->IsOnHold() == true) || (__isCallSplit == true))
701 isSplitAllowed = false;
704 splitButton.SetActionId(splitCmdId);
705 splitButton.AddActionEventListener(*this);
706 splitButton.SetColor(BUTTON_STATUS_NORMAL,COLOR_SPLIT_CALL_BG);
707 splitButton.SetColor(BUTTON_STATUS_PRESSED,COLOR_SPLIT_CALL_BG_PRESS);
708 splitButton.SetNormalBitmap(Point(0, 0), *pNormalSplitBitmap);
709 splitButton.SetPressedBitmap(Point(0, 0), *pPressSplitBitmap);
712 bool isEnableEndButton = (__isCallSplit == false);
713 endButton.SetEnabled(isEnableEndButton);
714 endButton.SetActionId(EndCmdId);
715 endButton.AddActionEventListener(*this);
716 endButton.SetNormalBitmap(Point(0, 0), *pNormalEndBitmap);
717 endButton.SetColor(BUTTON_STATUS_NORMAL,COLOR_END_CALL_BG);
718 endButton.SetColor(BUTTON_STATUS_PRESSED,COLOR_END_CALL_BG_PRESS);
719 endButton.SetPressedBitmap(Point(0, 0), *pPressEndBitmap);
722 if (isSplitAllowed == false)
724 splitButton.SetShowState(false);
725 callerLabel.SetBounds(splitButton.GetBounds().x, callerLabel.GetBounds().y,
726 callerLabel.GetBounds().width, callerLabel.GetBounds().height);
730 splitButton.SetShowState(true);
731 callerLabel.SetBounds((splitButton.GetBounds().x + splitButton.GetBounds().width), callerLabel.GetBounds().y,
732 callerLabel.GetBounds().width, callerLabel.GetBounds().height);
736 callerLabel.SetTextHorizontalAlignment(ALIGNMENT_LEFT);
737 callerLabel.SetText(displayName);
738 delete pNormalEndBitmap;
739 pNormalEndBitmap = null;
740 delete pPressEndBitmap;
741 pPressEndBitmap = null;
742 delete pNormalSplitBitmap;
743 pNormalSplitBitmap = null;
744 delete pPressSplitBitmap;
745 pPressSplitBitmap = null;
749 ConfCallerListForm::GetItemCount(void)
751 IListT<AppCallInfo>* pCallList = __pConfCallInfo->GetCallerList();
752 return pCallList->GetCount();
756 ConfCallerListForm::CreateItem(int itemIndex, int itemWidth)
758 AppLogDebug("%d %x",itemWidth,__pConfCallInfo);
759 IListT<AppCallInfo>* pCallList = __pConfCallInfo->GetCallerList();
761 TableViewAnnexStyle style = TABLE_VIEW_ANNEX_STYLE_NORMAL;
762 TableViewItem* pItem = new (std::nothrow) TableViewItem();
764 pItem->Construct(Tizen::Graphics::Dimension(GetBounds().width, LIST_ITEM_HEIGHT), style);
766 Button *pSplitCallButton = new (std::nothrow) Button();
767 pSplitCallButton->Construct(Rectangle(X_SPLIT_BUTTON_MARGIN,Y_SPLIT_BUTTON_MARGIN,W_SPLIT_BITMAP,W_SPLIT_BITMAP));
769 Label *pCallLabel = new (std::nothrow)Label();
770 pCallLabel->Construct(Rectangle(X_CALLER_LABEL,Y_CALLER_LABEL,W_CALLER_LABEL,H_CALLER_LABEL),L"");
772 Button *pEndCallButton = new (std::nothrow)Button();
773 pEndCallButton->Construct(Rectangle(GetBounds().width-X_END_BUTTON_PADDING-W_SPLIT_BITMAP,Y_SPLIT_BUTTON_MARGIN,W_SPLIT_BITMAP,W_SPLIT_BITMAP));
776 AppCallInfo callInfo;
778 result r = pCallList->GetAt(itemIndex, callInfo);
780 if(callInfo.GetContactNumber().IsEmpty() == false)
782 pContactNo.Append(callInfo.GetContactNumber());
786 pContactNo.Append(AppUtility::GetResourceString(IDS_NUMBER_UNKNOWN));
788 //fetch contact details based on phone number
789 String* pDisplayName = callInfo.FetchLatestCallerNameN(pContactNo);
791 if(pDisplayName != null)
793 if ((pDisplayName->IsEmpty()) || r != E_SUCCESS)
795 pDisplayName->Append(pContactNo);
801 CreateItemAndAddActionListener(*pSplitCallButton,*pEndCallButton,*pCallLabel,
802 IDA_SPLIT_CALLER1,IDA_END_CALLER1,*pDisplayName);
807 CreateItemAndAddActionListener(*pSplitCallButton,*pEndCallButton,*pCallLabel,
808 IDA_SPLIT_CALLER2,IDA_END_CALLER2,*pDisplayName);
813 CreateItemAndAddActionListener(*pSplitCallButton,*pEndCallButton,*pCallLabel,
814 IDA_SPLIT_CALLER3,IDA_END_CALLER3,*pDisplayName);
819 CreateItemAndAddActionListener(*pSplitCallButton,*pEndCallButton,*pCallLabel,
820 IDA_SPLIT_CALLER4,IDA_END_CALLER4,*pDisplayName);
825 CreateItemAndAddActionListener(*pSplitCallButton,*pEndCallButton,*pCallLabel,
826 IDA_SPLIT_CALLER5,IDA_END_CALLER5,*pDisplayName);
833 pItem->AddControl(pSplitCallButton);
834 pItem->AddControl(pCallLabel);
835 pItem->AddControl(pEndCallButton);
836 if(pDisplayName != null)
847 ConfCallerListForm::DeleteItem(int itemIndex, TableViewItem* pItem)
855 ConfCallerListForm::UpdateItem(int itemIndex, TableViewItem* pItem)
861 ConfCallerListForm::GetDefaultItemHeight(void)
863 return LIST_ITEM_HEIGHT;
867 ConfCallerListForm::OnOrientationChanged(const Control& source, OrientationStatus orientationStatus)
869 AppLogDebug("Enter");
870 __pList->UpdateTableView();