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_CONF_CALL_LIST_TABLEVIEW = L"IDC_CONF_CALL_LIST_TABLEVIEW";
82 const unsigned int COLOR_END_CALL_BG = Color32<180, 60, 60>::Value;
83 const unsigned int COLOR_END_CALL_BG_PRESS = Color32<61, 153, 208>::Value;
84 const unsigned int COLOR_SPLIT_CALL_BG = Color32<129, 140, 148>::Value;
85 const unsigned int COLOR_SPLIT_CALL_BG_PRESS = Color32<63, 155, 210>::Value;
86 ConfCallerListForm::ConfCallerListForm(void)
87 : BaseForm(FORMTYPE_CONFCALLLIST)
89 __pConfCallInfo = null;
90 __pConfCallTimer = null;
91 __isCallSplit = false;
92 __pAddressbook = null;
95 ConfCallerListForm::~ConfCallerListForm(void)
97 if (__pConfCallTimer != null)
99 __pConfCallTimer->Cancel();
100 delete __pConfCallTimer;
105 ConfCallerListForm::Initialize(void)
107 Construct(IDL_CONFCALL_LIST_FORM);
111 ConfCallerListForm::OnInitializing(void)
113 result r = E_SUCCESS;
114 //Add action listener to buttons
115 AddActionListener(IDC_END_CONFCALL_BUTTON, IDA_END_CONF_CALL);
116 AddActionListener(IDC_HOLD_CONFCALL_BUTTON, IDA_HOLD_CONF_CALL);
118 Footer* pFooter = GetFooter();
121 SetFormBackEventListener(this);
123 Label* pTimerLbl = static_cast<Label*>(GetControl(IDC_CALL_TIME_LABEL));
124 SetControlAlwaysOnTop(*pTimerLbl,true);
127 __pCallPresentor = CallPresentationModel::GetInstance();
132 ConfCallerListForm::CreateTableView(void)
134 __pList = static_cast <TableView*> (GetControl(IDC_CONF_CALL_LIST_TABLEVIEW));
135 __pList->SetItemProvider(this);
140 ConfCallerListForm::AddActionListener(const String& keyName, CommandIds cmdId)
142 Button* pButtonKeypad = static_cast<Button*>(GetControl(keyName));
143 if (pButtonKeypad != null)
145 pButtonKeypad->SetActionId(cmdId);
146 pButtonKeypad->AddActionEventListener(*this);
151 ConfCallerListForm::OnTerminating(void)
153 result r = E_SUCCESS;
155 if (__pCallPresentor != null)
157 __pCallPresentor = null;
160 if (__pConfCallInfo != null)
162 delete __pConfCallInfo;
163 __pConfCallInfo = null;
166 //RemoveAllControls();
171 ConfCallerListForm::OnActionPerformed(const Control& source, int actionId)
173 SceneManager* pSceneManager = SceneManager::GetInstance();
174 AppAssert(pSceneManager);
178 case IDA_END_CONF_CALL:
180 bool success = __pCallPresentor->EndConferenceCall();
183 delete __pConfCallInfo;
184 __pConfCallInfo = null;
189 case IDA_HOLD_CONF_CALL:
191 // User has pressed end conference call and we are waiting for TAPI response
192 if(__pConfCallInfo == null)
197 bool isCallOnHold = __pConfCallInfo->IsOnHold();
198 if (isCallOnHold == false)
200 success = __pCallPresentor->HoldConferenceCall();
204 success = __pCallPresentor->ActivateConferenceCall();
207 //Check if request to Hold / UnHold call is successful.
210 //If success, then invert the Hold status in conference call
211 isCallOnHold = !(isCallOnHold);
212 __pConfCallInfo->SetOnHold(isCallOnHold);
214 __pList->UpdateTableView();
215 SetHoldButtonStatus(isCallOnHold);
222 ArrayListT<AppCallInfo>* pCallList = static_cast<ArrayListT<AppCallInfo>*>(__pCallPresentor->GetCallListN());
223 int noOfCalls = pCallList->GetCount();
225 //Ownership - To be deleted in 'OnSceneActivatedN' of next form
226 ArrayList* pCallInfoList = new (std::nothrow) ArrayList(SingleObjectDeleter);
227 pCallInfoList->Construct(noOfCalls);
229 for (int index = 0; index < noOfCalls; index++)
231 //fetch call info and add to list
232 AppCallInfo callInfo;
233 result r = pCallList->GetAt(index, callInfo);
236 //copy call information to new instance
237 AppCallInfo* pCaller = new (std::nothrow) AppCallInfo();
239 pCallInfoList->Add(pCaller);
245 //single active call - goto active call form
246 pSceneManager->GoForward(ForwardSceneTransition(IDSCN_SCENE_CONFCALL,
247 SCENE_TRANSITION_ANIMATION_TYPE_NONE, SCENE_HISTORY_OPTION_NO_HISTORY,SCENE_DESTROY_OPTION_DESTROY), pCallInfoList);
251 //goto multiple active call form
252 pSceneManager->GoForward(ForwardSceneTransition(IDSCN_SCENE_MULTIPLEACTIVECALL,
253 SCENE_TRANSITION_ANIMATION_TYPE_NONE, SCENE_HISTORY_OPTION_NO_HISTORY,SCENE_DESTROY_OPTION_DESTROY), pCallInfoList);
255 pCallList->RemoveAll();
260 case IDA_SPLIT_CALLER1:
261 case IDA_SPLIT_CALLER2:
262 case IDA_SPLIT_CALLER3:
263 case IDA_SPLIT_CALLER4:
264 case IDA_SPLIT_CALLER5:
266 // User has pressed end conference call and we are waiting for TAPI response
267 if(__pConfCallInfo == null)
271 __isCallSplit = __pCallPresentor->SplitFromConference(SplitConfCallerCmdIds(actionId),__pConfCallInfo->GetCallerList());
272 if(__isCallSplit == true)
274 __pList->UpdateTableView();
279 case IDA_END_CALLER1:
280 case IDA_END_CALLER2:
281 case IDA_END_CALLER3:
282 case IDA_END_CALLER4:
283 case IDA_END_CALLER5:
285 __pList->SetEnabled(false);
286 // User has pressed end conference call and we are waiting for TAPI response
287 if(__pConfCallInfo == null)
291 __pCallPresentor->EndCallFromConference(EndConfCallerCmdIds(actionId),__pConfCallInfo->GetCallerList());
301 ConfCallerListForm::OnSceneActivatedN(const SceneId& previousSceneId, const SceneId& currentSceneId, IList* pArgs)
303 //set itself as listener
304 __pCallPresentor->SetTelEventListener(this);
305 __isCallSplit = false;
307 AppLogDebug("Enter");
309 //DisableAllControls();
310 if (__pConfCallInfo != null)
312 delete __pConfCallInfo;
313 __pConfCallInfo = null;
315 //show 1st caller's info.
316 //Fetch Conference call info from telephony manager
317 __pConfCallInfo = __pCallPresentor->GetConferenceCallInfoN();
318 AppLogDebug("Enter %x",__pConfCallInfo);
320 AddressbookManager* pAddressbookManager = AddressbookManager::GetInstance();
321 __pAddressbook = pAddressbookManager->GetAddressbookN(DEFAULT_ADDRESSBOOK_ID);
322 if(__pAddressbook != null)
324 __pAddressbook->SetAddressbookChangeEventListener(this);
327 //show active call timer
328 ShowTimerInfo(IDC_CALL_TIME_LABEL, __pConfCallInfo->GetCallConnectTime());
330 //Set the correct bitmap to the "hold" button based on the current state of the call
331 SetHoldButtonStatus(__pConfCallInfo->IsOnHold());
332 //disable Hold Button, if 2 active calls are present,Else enable it.
333 Button* pButtonHold = static_cast<Button*>(GetControl(IDC_HOLD_CONFCALL_BUTTON));
334 if(pButtonHold != null)
336 if (__pCallPresentor->GetCurrentCallCount() == IDI_MAX_ACTIVE_CALLS)
338 pButtonHold->SetShowState(false);
342 pButtonHold->SetShowState(true);
344 pButtonHold->Invalidate(true);
347 __pList->UpdateTableView();
348 __pList->SetEnabled(true);
349 AddOrientationEventListener(*this);
353 ConfCallerListForm::OnSceneDeactivated(const SceneId& currentSceneId, const SceneId& nextSceneId)
355 RemoveOrientationEventListener(*this);
356 if (__pConfCallTimer != null)
358 __pConfCallTimer->Cancel();
359 delete __pConfCallTimer;
360 __pConfCallTimer = null;
362 if(__pAddressbook != null)
364 __pAddressbook->SetAddressbookChangeEventListener(null);
369 ConfCallerListForm::OnDraw(void)
375 ConfCallerListForm::SetHoldButtonStatus(bool isCallOnHold)
377 Button* pButtonHold = static_cast<Button*>(GetControl(IDC_HOLD_CONFCALL_BUTTON));
378 if(pButtonHold != null)
380 Bitmap* pNormalBitmapToBeDrawn = null;
381 Bitmap* pPressBitmapToBeDrawn = null;
383 if (isCallOnHold == true)
385 pNormalBitmapToBeDrawn = AppUtility::GetBitmapFromResourcesN(IDB_UNHOLD_NORMAL_BUTTON_ICON,
386 W_HOLD_BITMAP, W_HOLD_BITMAP);
387 pPressBitmapToBeDrawn = AppUtility::GetBitmapFromResourcesN(IDB_UNHOLD_PRESS_BUTTON_ICON,
388 W_HOLD_BITMAP, W_HOLD_BITMAP);
392 pNormalBitmapToBeDrawn = AppUtility::GetBitmapFromResourcesN(IDB_HOLD_NORMAL_BUTTON_ICON,
393 W_HOLD_BITMAP, W_HOLD_BITMAP);
394 pPressBitmapToBeDrawn = AppUtility::GetBitmapFromResourcesN(IDB_HOLD_PRESS_BUTTON_ICON,
395 W_HOLD_BITMAP, W_HOLD_BITMAP);
398 if (pNormalBitmapToBeDrawn)
400 pButtonHold->SetNormalBitmap(Point(0, 0), *pNormalBitmapToBeDrawn);
402 if (pPressBitmapToBeDrawn)
404 pButtonHold->SetPressedBitmap(Point(0, 0), *pPressBitmapToBeDrawn);
407 pButtonHold->Invalidate(true);
408 delete pNormalBitmapToBeDrawn;
409 pNormalBitmapToBeDrawn = null;
410 delete pPressBitmapToBeDrawn;
411 pPressBitmapToBeDrawn = null;
416 ConfCallerListForm::HandleParticipantsChanged(void)
418 AppLogDebug("Enter");
419 AppCallInfo* pCallInfo = __pCallPresentor->GetConferenceCallInfoN();
420 if (pCallInfo == null)
424 if (__pConfCallInfo != null)
426 delete __pConfCallInfo;
427 __pConfCallInfo = null;
429 __pConfCallInfo = new (std::nothrow) AppCallInfo();
430 *__pConfCallInfo = *pCallInfo;
431 __pList->UpdateTableView();
432 __pList->SetEnabled(true);
436 ConfCallerListForm::DisableAllControls(void)
438 Panel* pKeysPanel = static_cast<Panel*>(GetControl(IDC_CALLER1_PANEL));
439 if (pKeysPanel != null)
441 pKeysPanel->SetShowState(false);
442 Label* pLineLabel1 = static_cast<Label*>(GetControl(IDC__LINE_LABEL1));
443 pLineLabel1->SetShowState(false);
446 pKeysPanel = static_cast<Panel*>(GetControl(IDC_CALLER2_PANEL));
447 if (pKeysPanel != null)
449 pKeysPanel->SetShowState(false);
450 Label* pLineLabel1 = static_cast<Label*>(GetControl(IDC__LINE_LABEL2));
451 pLineLabel1->SetShowState(false);
454 pKeysPanel = static_cast<Panel*>(GetControl(IDC_CALLER3_PANEL));
455 if (pKeysPanel != null)
457 pKeysPanel->SetShowState(false);
458 Label* pLineLabel1 = static_cast<Label*>(GetControl(IDC__LINE_LABEL3));
459 pLineLabel1->SetShowState(false);
462 pKeysPanel = static_cast<Panel*>(GetControl(IDC_CALLER4_PANEL));
463 if (pKeysPanel != null)
465 pKeysPanel->SetShowState(false);
466 Label* pLineLabel1 = static_cast<Label*>(GetControl(IDC__LINE_LABEL4));
467 pLineLabel1->SetShowState(false);
470 pKeysPanel = static_cast<Panel*>(GetControl(IDC_CALLER5_PANEL));
471 if (pKeysPanel != null)
473 pKeysPanel->SetShowState(false);
474 Label* pLineLabel1 = static_cast<Label*>(GetControl(IDC__LINE_LABEL5));
475 pLineLabel1->SetShowState(false);
481 ConfCallerListForm::ShowTimerInfo(const String& timerLblName, long long startTime)
483 Label* pTimerLbl = static_cast<Label*>(GetControl(timerLblName));
485 if (__pConfCallTimer == null)
487 __pConfCallTimer = new (std::nothrow) Timer();
488 __pConfCallTimer->Construct(*this);
491 if (pTimerLbl != null)
493 //current system time
494 long long currTime = 0;
495 SystemTime::GetTicks(currTime);
497 TimeSpan diffSpan(abs(startTime - currTime));
499 String activeCallTime(L"");
501 long long hr = diffSpan.GetHours();
503 activeCallTime.Append("0");
505 activeCallTime.Append(hr);
506 activeCallTime.Append(L":");
508 long long min = diffSpan.GetMinutes();
510 activeCallTime.Append("0");
512 activeCallTime.Append(min);
513 activeCallTime.Append(L":");
515 long long sec = diffSpan.GetSeconds();
517 activeCallTime.Append("0");
519 activeCallTime.Append(sec);
521 pTimerLbl->SetText(activeCallTime);
522 __pConfCallTimer->StartAsRepeatable(TimeSpan::NUM_OF_TICKS_IN_SECOND);
528 ConfCallerListForm::OnTimerExpired(Tizen::Base::Runtime::Timer& timer)
530 //Call default implementation of "Object.Equals()"
531 //returns true, if they are pointing to same address.
532 if (__pConfCallTimer->Equals(timer))
534 Label* pTimerLbl = static_cast<Label*>(GetControl(IDC_CALL_TIME_LABEL));
537 String activeCallTime = pTimerLbl->GetText();
538 // Create a StringTokenizer instance
539 StringTokenizer strTokens(activeCallTime, L":");
541 int count = strTokens.GetTokenCount(); // count == 3
546 for (int index = 0; index < count; index++)
551 strTokens.GetNextToken(token);
552 Integer::Parse(token, hr);
556 strTokens.GetNextToken(token);
557 Integer::Parse(token, min);
561 strTokens.GetNextToken(token);
562 Integer::Parse(token, sec);
568 if (sec == IDI_MAX_SECONDS)
573 if (min == IDI_MAX_MINS)
580 activeCallTime.Clear();
583 activeCallTime.Append("0");
585 activeCallTime.Append(hr);
586 activeCallTime.Append(":");
589 activeCallTime.Append("0");
591 activeCallTime.Append(min);
592 activeCallTime.Append(":");
595 activeCallTime.Append("0");
597 activeCallTime.Append(sec);
599 pTimerLbl->SetText(activeCallTime);
600 pTimerLbl->Invalidate(true);
606 ConfCallerListForm::OnFormBackRequested(Form& source)
608 //If the call is split then wait for it to automatically go back once it split is success
609 if(__isCallSplit == true)
613 SceneManager* pSceneManager = SceneManager::GetInstance();
614 AppAssert(pSceneManager);
617 ArrayListT<AppCallInfo>* pCallList = static_cast<ArrayListT<AppCallInfo>*>(__pCallPresentor->GetCallListN());
618 int noOfCalls = pCallList->GetCount();
620 //Ownership - To be deleted in 'OnSceneActivatedN' of next form
621 ArrayList* pCallInfoList = new (std::nothrow) ArrayList(SingleObjectDeleter);
622 pCallInfoList->Construct(noOfCalls);
624 for (int index = 0; index < noOfCalls; index++)
626 //fetch call info and add to list
627 AppCallInfo callInfo;
628 result r = pCallList->GetAt(index, callInfo);
631 //copy call information to new instance
632 AppCallInfo* pCaller = new (std::nothrow) AppCallInfo();
634 pCallInfoList->Add(pCaller);
640 //single active call - goto active call form
641 pSceneManager->GoForward(ForwardSceneTransition(IDSCN_SCENE_CONFCALL,
642 SCENE_TRANSITION_ANIMATION_TYPE_NONE, SCENE_HISTORY_OPTION_NO_HISTORY,SCENE_DESTROY_OPTION_DESTROY), pCallInfoList);
646 //goto multiple active call form
647 pSceneManager->GoForward(ForwardSceneTransition(IDSCN_SCENE_MULTIPLEACTIVECALL,
648 SCENE_TRANSITION_ANIMATION_TYPE_NONE, SCENE_HISTORY_OPTION_NO_HISTORY,SCENE_DESTROY_OPTION_DESTROY), pCallInfoList);
650 pCallList->RemoveAll();
656 ConfCallerListForm::OnContactsChanged(const Tizen::Base::Collection::IList& contactChangeInfoList)
658 __pList->UpdateTableView();
662 ConfCallerListForm::OnCategoriesChanged(const Tizen::Base::Collection::IList& categoryChangeInfoList)
668 ConfCallerListForm::CreateItemAndAddActionListener( Button& splitButton,
669 Button& endButton, Label& callerLabel, SplitConfCallerCmdIds splitCmdId,
670 EndConfCallerCmdIds EndCmdId, const String& displayName)
672 Bitmap* pNormalSplitBitmap = null;
673 Bitmap* pPressSplitBitmap = null;
674 Bitmap* pNormalEndBitmap = null;
675 Bitmap* pPressEndBitmap = null;
677 pNormalSplitBitmap = AppUtility::GetBitmapFromResourcesN(IDB_SPLIT_NORMAL_BUTTON_ICON,
678 W_SPLIT_BITMAP, H_SPLIT_BITMAP);
679 pPressSplitBitmap = AppUtility::GetBitmapFromResourcesN(IDB_SPLIT_PRESS_BUTTON_ICON,
680 W_SPLIT_BITMAP, H_SPLIT_BITMAP);
681 pNormalEndBitmap = AppUtility::GetBitmapFromResourcesN(IDB_END_NORMAL_BUTTON_ICON,
682 W_END_BITMAP, H_END_BITMAP);
683 pPressEndBitmap = AppUtility::GetBitmapFromResourcesN(IDB_END_PRESS_BUTTON_ICON,
684 W_END_BITMAP, H_END_BITMAP);
686 bool isSplitAllowed = true;
687 if ((__pCallPresentor->IsSplitAllowed() == false) || (__pConfCallInfo->IsOnHold() == true) || (__isCallSplit == true))
689 isSplitAllowed = false;
692 splitButton.SetActionId(splitCmdId);
693 splitButton.AddActionEventListener(*this);
694 splitButton.SetColor(BUTTON_STATUS_NORMAL,COLOR_SPLIT_CALL_BG);
695 splitButton.SetColor(BUTTON_STATUS_PRESSED,COLOR_SPLIT_CALL_BG_PRESS);
696 splitButton.SetNormalBitmap(Point(0, 0), *pNormalSplitBitmap);
697 splitButton.SetPressedBitmap(Point(0, 0), *pPressSplitBitmap);
700 bool isEnableEndButton = (__isCallSplit == false);
701 endButton.SetEnabled(isEnableEndButton);
702 endButton.SetActionId(EndCmdId);
703 endButton.AddActionEventListener(*this);
704 endButton.SetNormalBitmap(Point(0, 0), *pNormalEndBitmap);
705 endButton.SetColor(BUTTON_STATUS_NORMAL,COLOR_END_CALL_BG);
706 endButton.SetColor(BUTTON_STATUS_PRESSED,COLOR_END_CALL_BG_PRESS);
707 endButton.SetPressedBitmap(Point(0, 0), *pPressEndBitmap);
710 if (isSplitAllowed == false)
712 splitButton.SetShowState(false);
713 callerLabel.SetBounds(splitButton.GetBounds().x, callerLabel.GetBounds().y,
714 callerLabel.GetBounds().width, callerLabel.GetBounds().height);
718 splitButton.SetShowState(true);
719 callerLabel.SetBounds((splitButton.GetBounds().x + splitButton.GetBounds().width), callerLabel.GetBounds().y,
720 callerLabel.GetBounds().width, callerLabel.GetBounds().height);
724 callerLabel.SetTextHorizontalAlignment(ALIGNMENT_LEFT);
725 callerLabel.SetText(displayName);
726 delete pNormalEndBitmap;
727 pNormalEndBitmap = null;
728 delete pPressEndBitmap;
729 pPressEndBitmap = null;
730 delete pNormalSplitBitmap;
731 pNormalSplitBitmap = null;
732 delete pPressSplitBitmap;
733 pPressSplitBitmap = null;
737 ConfCallerListForm::GetItemCount(void)
739 IListT<AppCallInfo>* pCallList = __pConfCallInfo->GetCallerList();
740 return pCallList->GetCount();
744 ConfCallerListForm::CreateItem(int itemIndex, int itemWidth)
746 AppLogDebug("%d %x",itemWidth,__pConfCallInfo);
747 IListT<AppCallInfo>* pCallList = __pConfCallInfo->GetCallerList();
749 TableViewAnnexStyle style = TABLE_VIEW_ANNEX_STYLE_NORMAL;
750 TableViewItem* pItem = new (std::nothrow) TableViewItem();
752 pItem->Construct(Tizen::Graphics::Dimension(GetBounds().width, LIST_ITEM_HEIGHT), style);
754 Button *pSplitCallButton = new (std::nothrow) Button();
755 pSplitCallButton->Construct(Rectangle(X_SPLIT_BUTTON_MARGIN,Y_SPLIT_BUTTON_MARGIN,W_SPLIT_BITMAP,W_SPLIT_BITMAP));
757 Label *pCallLabel = new (std::nothrow)Label();
758 pCallLabel->Construct(Rectangle(X_CALLER_LABEL,Y_CALLER_LABEL,W_CALLER_LABEL,H_CALLER_LABEL),L"");
760 Button *pEndCallButton = new (std::nothrow)Button();
761 pEndCallButton->Construct(Rectangle(GetBounds().width-X_END_BUTTON_PADDING-W_SPLIT_BITMAP,Y_SPLIT_BUTTON_MARGIN,W_SPLIT_BITMAP,W_SPLIT_BITMAP));
764 AppCallInfo callInfo;
766 result r = pCallList->GetAt(itemIndex, callInfo);
768 if(callInfo.GetContactNumber().IsEmpty() == false)
770 pContactNo.Append(callInfo.GetContactNumber());
774 pContactNo.Append(AppUtility::GetResourceString(IDS_NUMBER_UNKNOWN));
776 //fetch contact details based on phone number
777 String* pDisplayName = callInfo.FetchLatestCallerNameN(pContactNo);
779 if(pDisplayName != null)
781 if ((pDisplayName->IsEmpty()) || r != E_SUCCESS)
783 pDisplayName->Append(pContactNo);
789 CreateItemAndAddActionListener(*pSplitCallButton,*pEndCallButton,*pCallLabel,
790 IDA_SPLIT_CALLER1,IDA_END_CALLER1,*pDisplayName);
795 CreateItemAndAddActionListener(*pSplitCallButton,*pEndCallButton,*pCallLabel,
796 IDA_SPLIT_CALLER2,IDA_END_CALLER2,*pDisplayName);
801 CreateItemAndAddActionListener(*pSplitCallButton,*pEndCallButton,*pCallLabel,
802 IDA_SPLIT_CALLER3,IDA_END_CALLER3,*pDisplayName);
807 CreateItemAndAddActionListener(*pSplitCallButton,*pEndCallButton,*pCallLabel,
808 IDA_SPLIT_CALLER4,IDA_END_CALLER4,*pDisplayName);
813 CreateItemAndAddActionListener(*pSplitCallButton,*pEndCallButton,*pCallLabel,
814 IDA_SPLIT_CALLER5,IDA_END_CALLER5,*pDisplayName);
821 pItem->AddControl(pSplitCallButton);
822 pItem->AddControl(pCallLabel);
823 pItem->AddControl(pEndCallButton);
824 if(pDisplayName != null)
835 ConfCallerListForm::DeleteItem(int itemIndex, TableViewItem* pItem)
843 ConfCallerListForm::UpdateItem(int itemIndex, TableViewItem* pItem)
849 ConfCallerListForm::GetDefaultItemHeight(void)
851 return LIST_ITEM_HEIGHT;
855 ConfCallerListForm::OnOrientationChanged(const Control& source, OrientationStatus orientationStatus)
857 AppLogDebug("Enter");
858 __pList->UpdateTableView();