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
23 #include "CallConfCallerListForm.h"
24 #include "CallAppUtility.h"
25 #include "CallPresentationModel.h"
26 #include "CallSceneRegister.h"
28 using namespace Tizen::App;
29 using namespace Tizen::Base;
30 using namespace Tizen::Base::Collection;
31 using namespace Tizen::Base::Runtime;
32 using namespace Tizen::Base::Utility;
33 using namespace Tizen::Graphics;
34 using namespace Tizen::System;
35 using namespace Tizen::Ui;
36 using namespace Tizen::Ui::Controls;
37 using namespace Tizen::Ui::Scenes;
40 const int W_HOLD_BITMAP = 78;
41 const int H_HOLD_BITMAP = 78;
42 const int W_BACK_BITMAP = 56;
43 const int H_BACK_BITMAP = 56;
44 const int X_BACK_BITMAP = 8;
45 const int Y_BACK_BITMAP = 8;
46 const int W_SPLIT_BITMAP = 74;
47 const int H_SPLIT_BITMAP = 74;
48 const int W_END_BITMAP = 80;
49 const int H_END_BITMAP = 74;
50 const int IDI_MAX_SECONDS = 60;
51 const int IDI_MAX_MINS = 60;
52 const int LIST_ITEM_HEIGHT = 112;
53 const int X_SPLIT_BUTTON_MARGIN = 26;
54 const int Y_SPLIT_BUTTON_MARGIN = 19;
55 const int X_END_BUTTON_PADDING = 26;
56 const int X_CALLER_LABEL = 116;
57 const int Y_CALLER_LABEL = 0;
58 const int W_CALLER_LABEL = 488;
59 const int H_CALLER_LABEL = 112;
62 static const wchar_t* IDL_CONFCALL_LIST_FORM = L"IDL_CONFCALL_LIST_FORM";
63 static const wchar_t* IDC_CALL_TIME_LABEL = L"IDC_CALL_TIME_LABEL";
64 static const wchar_t* IDB_SPLIT_NORMAL_BUTTON_ICON = L"C01-1_conference_split.png";
65 static const wchar_t* IDB_SPLIT_PRESS_BUTTON_ICON = L"C01-1_conference_split_press.png";
66 static const wchar_t* IDB_END_NORMAL_BUTTON_ICON = L"C01-1_conference_end.png";
67 static const wchar_t* IDB_END_PRESS_BUTTON_ICON = L"C01-1_conference_end_press.png";
68 static const wchar_t* IDC_END_CONFCALL_BUTTON = L"IDC_END_CONFCALL_BUTTON";
69 static const wchar_t* IDC_HOLD_CONFCALL_BUTTON = L"IDC_HOLD_CONFCALL_BUTTON";
70 static const wchar_t* IDC_CALLER1_PANEL = L"IDC_CALLER1_PANEL";
71 static const wchar_t* IDC__LINE_LABEL1 = L"IDC__LINE_LABEL1";
72 static const wchar_t* IDC_CALLER2_PANEL = L"IDC_CALLER2_PANEL";
73 static const wchar_t* IDC__LINE_LABEL2 = L"IDC__LINE_LABEL2";
74 static const wchar_t* IDC_CALLER3_PANEL = L"IDC_CALLER3_PANEL";
75 static const wchar_t* IDC__LINE_LABEL3 = L"IDC__LINE_LABEL3";
76 static const wchar_t* IDC_CALLER4_PANEL = L"IDC_CALLER4_PANEL";
77 static const wchar_t* IDC__LINE_LABEL4 = L"IDC__LINE_LABEL4";
78 static const wchar_t* IDC_CALLER5_PANEL = L"IDC_CALLER5_PANEL";
79 static const wchar_t* IDC__LINE_LABEL5 = L"IDC__LINE_LABEL5";
80 static const wchar_t* IDC_CONF_CALL_LIST_TABLEVIEW = L"IDC_CONF_CALL_LIST_TABLEVIEW";
83 const unsigned int COLOR_END_CALL_BG = Color32<180, 60, 60>::Value;
84 const unsigned int COLOR_END_CALL_BG_PRESS = Color32<61, 153, 208>::Value;
85 const unsigned int COLOR_SPLIT_CALL_BG = Color32<129, 140, 148>::Value;
86 const unsigned int COLOR_SPLIT_CALL_BG_PRESS = Color32<63, 155, 210>::Value;
87 ConfCallerListForm::ConfCallerListForm(void)
88 : BaseForm(FORMTYPE_CONFCALLLIST)
90 __pConfCallInfo = null;
91 __pConfCallTimer = null;
92 __isCallSplit = false;
93 __pAddressbook = null;
96 ConfCallerListForm::~ConfCallerListForm(void)
98 if (__pConfCallTimer != null)
100 __pConfCallTimer->Cancel();
101 delete __pConfCallTimer;
106 ConfCallerListForm::Initialize(void)
108 Construct(IDL_CONFCALL_LIST_FORM);
112 ConfCallerListForm::OnInitializing(void)
114 result r = E_SUCCESS;
115 //Add action listener to buttons
116 AddActionListener(IDC_END_CONFCALL_BUTTON, IDA_END_CONF_CALL);
117 AddActionListener(IDC_HOLD_CONFCALL_BUTTON, IDA_HOLD_CONF_CALL);
119 Footer* pFooter = GetFooter();
122 SetFormBackEventListener(this);
124 Label* pTimerLbl = static_cast<Label*>(GetControl(IDC_CALL_TIME_LABEL));
125 SetControlAlwaysOnTop(*pTimerLbl,true);
128 __pCallPresentor = CallPresentationModel::GetInstance();
133 ConfCallerListForm::CreateTableView(void)
135 __pList = static_cast <TableView*> (GetControl(IDC_CONF_CALL_LIST_TABLEVIEW));
136 __pList->SetItemProvider(this);
141 ConfCallerListForm::AddActionListener(const String& keyName, CommandIds cmdId)
143 Button* pButtonKeypad = static_cast<Button*>(GetControl(keyName));
144 if (pButtonKeypad != null)
146 pButtonKeypad->SetActionId(cmdId);
147 pButtonKeypad->AddActionEventListener(*this);
152 ConfCallerListForm::OnTerminating(void)
154 result r = E_SUCCESS;
156 if (__pCallPresentor != null)
158 __pCallPresentor = null;
161 if (__pConfCallInfo != null)
163 delete __pConfCallInfo;
164 __pConfCallInfo = null;
167 //RemoveAllControls();
172 ConfCallerListForm::OnActionPerformed(const Control& source, int actionId)
174 SceneManager* pSceneManager = SceneManager::GetInstance();
175 AppAssert(pSceneManager);
179 case IDA_END_CONF_CALL:
181 bool success = __pCallPresentor->EndConferenceCall();
184 delete __pConfCallInfo;
185 __pConfCallInfo = null;
190 case IDA_HOLD_CONF_CALL:
192 // User has pressed end conference call and we are waiting for TAPI response
193 if(__pConfCallInfo == null)
198 bool isCallOnHold = __pConfCallInfo->IsOnHold();
199 if (isCallOnHold == false)
201 success = __pCallPresentor->HoldConferenceCall();
205 success = __pCallPresentor->ActivateConferenceCall();
208 //Check if request to Hold / UnHold call is successful.
211 //If success, then invert the Hold status in conference call
212 isCallOnHold = !(isCallOnHold);
213 __pConfCallInfo->SetOnHold(isCallOnHold);
215 __pList->UpdateTableView();
216 SetHoldButtonStatus(isCallOnHold);
223 ArrayListT<AppCallInfo>* pCallList = static_cast<ArrayListT<AppCallInfo>*>(__pCallPresentor->GetCallListN());
224 int noOfCalls = pCallList->GetCount();
226 //Ownership - To be deleted in 'OnSceneActivatedN' of next form
227 ArrayList* pCallInfoList = new (std::nothrow) ArrayList(SingleObjectDeleter);
228 pCallInfoList->Construct(noOfCalls);
230 for (int index = 0; index < noOfCalls; index++)
232 //fetch call info and add to list
233 AppCallInfo callInfo;
234 result r = pCallList->GetAt(index, callInfo);
237 //copy call information to new instance
238 AppCallInfo* pCaller = new (std::nothrow) AppCallInfo();
240 pCallInfoList->Add(pCaller);
246 //single active call - goto active call form
247 pSceneManager->GoForward(ForwardSceneTransition(IDSCN_SCENE_CONFCALL,
248 SCENE_TRANSITION_ANIMATION_TYPE_NONE, SCENE_HISTORY_OPTION_NO_HISTORY,SCENE_DESTROY_OPTION_DESTROY), pCallInfoList);
252 //goto multiple active call form
253 pSceneManager->GoForward(ForwardSceneTransition(IDSCN_SCENE_MULTIPLEACTIVECALL,
254 SCENE_TRANSITION_ANIMATION_TYPE_NONE, SCENE_HISTORY_OPTION_NO_HISTORY,SCENE_DESTROY_OPTION_DESTROY), pCallInfoList);
256 pCallList->RemoveAll();
261 case IDA_SPLIT_CALLER1:
262 case IDA_SPLIT_CALLER2:
263 case IDA_SPLIT_CALLER3:
264 case IDA_SPLIT_CALLER4:
265 case IDA_SPLIT_CALLER5:
267 // User has pressed end conference call and we are waiting for TAPI response
268 if(__pConfCallInfo == null)
272 __isCallSplit = __pCallPresentor->SplitFromConference(SplitConfCallerCmdIds(actionId),__pConfCallInfo->GetCallerList());
273 if(__isCallSplit == true)
275 __pList->UpdateTableView();
280 case IDA_END_CALLER1:
281 case IDA_END_CALLER2:
282 case IDA_END_CALLER3:
283 case IDA_END_CALLER4:
284 case IDA_END_CALLER5:
286 __pList->SetEnabled(false);
287 // User has pressed end conference call and we are waiting for TAPI response
288 if(__pConfCallInfo == null)
292 __pCallPresentor->EndCallFromConference(EndConfCallerCmdIds(actionId),__pConfCallInfo->GetCallerList());
302 ConfCallerListForm::OnSceneActivatedN(const SceneId& previousSceneId, const SceneId& currentSceneId, IList* pArgs)
304 //set itself as listener
305 __pCallPresentor->SetTelEventListener(this);
306 __isCallSplit = false;
308 AppLogDebug("Enter");
310 //DisableAllControls();
311 if (__pConfCallInfo != null)
313 delete __pConfCallInfo;
314 __pConfCallInfo = null;
316 //show 1st caller's info.
317 //Fetch Conference call info from telephony manager
318 __pConfCallInfo = __pCallPresentor->GetConferenceCallInfoN();
319 AppLogDebug("Enter %x",__pConfCallInfo);
321 AddressbookManager* pAddressbookManager = AddressbookManager::GetInstance();
322 __pAddressbook = pAddressbookManager->GetAddressbookN(DEFAULT_ADDRESSBOOK_ID);
323 if(__pAddressbook != null)
325 __pAddressbook->SetAddressbookChangeEventListener(this);
328 //show active call timer
329 // ShowTimerInfo(IDC_CALL_TIME_LABEL, __pConfCallInfo->GetCallConnectTime());
330 ShowTimerInfo(IDC_CALL_TIME_LABEL, __pConfCallInfo->GetDurationTime());
332 //Set the correct bitmap to the "hold" button based on the current state of the call
333 SetHoldButtonStatus(__pConfCallInfo->IsOnHold());
334 //disable Hold Button, if 2 active calls are present,Else enable it.
335 Button* pButtonHold = static_cast<Button*>(GetControl(IDC_HOLD_CONFCALL_BUTTON));
336 if(pButtonHold != null)
338 if (__pCallPresentor->GetCurrentCallCount() == IDI_MAX_ACTIVE_CALLS)
340 pButtonHold->SetShowState(false);
344 pButtonHold->SetShowState(true);
346 pButtonHold->Invalidate(true);
349 __pList->UpdateTableView();
350 __pList->SetEnabled(true);
351 AddOrientationEventListener(*this);
355 ConfCallerListForm::OnSceneDeactivated(const SceneId& currentSceneId, const SceneId& nextSceneId)
357 RemoveOrientationEventListener(*this);
358 if (__pConfCallTimer != null)
360 __pConfCallTimer->Cancel();
361 delete __pConfCallTimer;
362 __pConfCallTimer = null;
364 if(__pAddressbook != null)
366 __pAddressbook->SetAddressbookChangeEventListener(null);
371 ConfCallerListForm::OnDraw(void)
377 ConfCallerListForm::SetHoldButtonStatus(bool isCallOnHold)
379 Button* pButtonHold = static_cast<Button*>(GetControl(IDC_HOLD_CONFCALL_BUTTON));
380 if(pButtonHold != null)
382 Bitmap* pNormalBitmapToBeDrawn = null;
383 Bitmap* pPressBitmapToBeDrawn = null;
385 if (isCallOnHold == true)
387 pNormalBitmapToBeDrawn = AppUtility::GetBitmapFromResourcesN(IDB_UNHOLD_NORMAL_BUTTON_ICON,
388 W_HOLD_BITMAP, W_HOLD_BITMAP);
389 pPressBitmapToBeDrawn = AppUtility::GetBitmapFromResourcesN(IDB_UNHOLD_PRESS_BUTTON_ICON,
390 W_HOLD_BITMAP, W_HOLD_BITMAP);
394 pNormalBitmapToBeDrawn = AppUtility::GetBitmapFromResourcesN(IDB_HOLD_NORMAL_BUTTON_ICON,
395 W_HOLD_BITMAP, W_HOLD_BITMAP);
396 pPressBitmapToBeDrawn = AppUtility::GetBitmapFromResourcesN(IDB_HOLD_PRESS_BUTTON_ICON,
397 W_HOLD_BITMAP, W_HOLD_BITMAP);
400 if (pNormalBitmapToBeDrawn)
402 pButtonHold->SetNormalBitmap(Point(0, 0), *pNormalBitmapToBeDrawn);
404 if (pPressBitmapToBeDrawn)
406 pButtonHold->SetPressedBitmap(Point(0, 0), *pPressBitmapToBeDrawn);
409 pButtonHold->Invalidate(true);
410 delete pNormalBitmapToBeDrawn;
411 pNormalBitmapToBeDrawn = null;
412 delete pPressBitmapToBeDrawn;
413 pPressBitmapToBeDrawn = null;
418 ConfCallerListForm::HandleParticipantsChanged(void)
420 AppLogDebug("Enter");
421 AppCallInfo* pCallInfo = __pCallPresentor->GetConferenceCallInfoN();
422 if (pCallInfo == null)
426 if (__pConfCallInfo != null)
428 delete __pConfCallInfo;
429 __pConfCallInfo = null;
431 __pConfCallInfo = new (std::nothrow) AppCallInfo();
432 *__pConfCallInfo = *pCallInfo;
433 __pList->UpdateTableView();
434 __pList->SetEnabled(true);
438 ConfCallerListForm::DisableAllControls(void)
440 Panel* pKeysPanel = static_cast<Panel*>(GetControl(IDC_CALLER1_PANEL));
441 if (pKeysPanel != null)
443 pKeysPanel->SetShowState(false);
444 Label* pLineLabel1 = static_cast<Label*>(GetControl(IDC__LINE_LABEL1));
445 pLineLabel1->SetShowState(false);
448 pKeysPanel = static_cast<Panel*>(GetControl(IDC_CALLER2_PANEL));
449 if (pKeysPanel != null)
451 pKeysPanel->SetShowState(false);
452 Label* pLineLabel1 = static_cast<Label*>(GetControl(IDC__LINE_LABEL2));
453 pLineLabel1->SetShowState(false);
456 pKeysPanel = static_cast<Panel*>(GetControl(IDC_CALLER3_PANEL));
457 if (pKeysPanel != null)
459 pKeysPanel->SetShowState(false);
460 Label* pLineLabel1 = static_cast<Label*>(GetControl(IDC__LINE_LABEL3));
461 pLineLabel1->SetShowState(false);
464 pKeysPanel = static_cast<Panel*>(GetControl(IDC_CALLER4_PANEL));
465 if (pKeysPanel != null)
467 pKeysPanel->SetShowState(false);
468 Label* pLineLabel1 = static_cast<Label*>(GetControl(IDC__LINE_LABEL4));
469 pLineLabel1->SetShowState(false);
472 pKeysPanel = static_cast<Panel*>(GetControl(IDC_CALLER5_PANEL));
473 if (pKeysPanel != null)
475 pKeysPanel->SetShowState(false);
476 Label* pLineLabel1 = static_cast<Label*>(GetControl(IDC__LINE_LABEL5));
477 pLineLabel1->SetShowState(false);
483 ConfCallerListForm::ShowTimerInfo(const String& timerLblName, long long startTime)
485 Label* pTimerLbl = static_cast<Label*>(GetControl(timerLblName));
487 if (__pConfCallTimer == null)
489 __pConfCallTimer = new (std::nothrow) Timer();
490 __pConfCallTimer->Construct(*this);
493 if (pTimerLbl != null)
495 //current system time
496 long long currTime = 0;
497 //SystemTime::GetTicks(currTime);
498 CallApp* pPhoneApp = static_cast<CallApp*>(CallApp::GetInstance());
499 currTime = pPhoneApp->GetCallAppTicks();
501 TimeSpan diffSpan(abs(startTime - currTime));
503 String activeCallTime(L"");
505 long long hr = diffSpan.GetHours();
507 activeCallTime.Append("0");
509 activeCallTime.Append(hr);
510 activeCallTime.Append(L":");
512 long long min = diffSpan.GetMinutes();
514 activeCallTime.Append("0");
516 activeCallTime.Append(min);
517 activeCallTime.Append(L":");
519 long long sec = diffSpan.GetSeconds();
521 activeCallTime.Append("0");
523 activeCallTime.Append(sec);
525 pTimerLbl->SetText(activeCallTime);
526 __pConfCallTimer->StartAsRepeatable(TimeSpan::NUM_OF_TICKS_IN_SECOND);
532 ConfCallerListForm::OnTimerExpired(Tizen::Base::Runtime::Timer& timer)
534 //Call default implementation of "Object.Equals()"
535 //returns true, if they are pointing to same address.
536 if (__pConfCallTimer->Equals(timer))
538 Label* pTimerLbl = static_cast<Label*>(GetControl(IDC_CALL_TIME_LABEL));
541 String activeCallTime = pTimerLbl->GetText();
542 // Create a StringTokenizer instance
543 StringTokenizer strTokens(activeCallTime, L":");
545 int count = strTokens.GetTokenCount(); // count == 3
550 for (int index = 0; index < count; index++)
555 strTokens.GetNextToken(token);
556 Integer::Parse(token, hr);
560 strTokens.GetNextToken(token);
561 Integer::Parse(token, min);
565 strTokens.GetNextToken(token);
566 Integer::Parse(token, sec);
572 if (sec == IDI_MAX_SECONDS)
577 if (min == IDI_MAX_MINS)
584 activeCallTime.Clear();
587 activeCallTime.Append("0");
589 activeCallTime.Append(hr);
590 activeCallTime.Append(":");
593 activeCallTime.Append("0");
595 activeCallTime.Append(min);
596 activeCallTime.Append(":");
599 activeCallTime.Append("0");
601 activeCallTime.Append(sec);
603 pTimerLbl->SetText(activeCallTime);
604 pTimerLbl->Invalidate(true);
610 ConfCallerListForm::OnFormBackRequested(Form& source)
612 //If the call is split then wait for it to automatically go back once it split is success
613 if(__isCallSplit == true)
617 SceneManager* pSceneManager = SceneManager::GetInstance();
618 AppAssert(pSceneManager);
621 ArrayListT<AppCallInfo>* pCallList = static_cast<ArrayListT<AppCallInfo>*>(__pCallPresentor->GetCallListN());
622 int noOfCalls = pCallList->GetCount();
624 //Ownership - To be deleted in 'OnSceneActivatedN' of next form
625 ArrayList* pCallInfoList = new (std::nothrow) ArrayList(SingleObjectDeleter);
626 pCallInfoList->Construct(noOfCalls);
628 for (int index = 0; index < noOfCalls; index++)
630 //fetch call info and add to list
631 AppCallInfo callInfo;
632 result r = pCallList->GetAt(index, callInfo);
635 //copy call information to new instance
636 AppCallInfo* pCaller = new (std::nothrow) AppCallInfo();
638 pCallInfoList->Add(pCaller);
644 //single active call - goto active call form
645 pSceneManager->GoForward(ForwardSceneTransition(IDSCN_SCENE_CONFCALL,
646 SCENE_TRANSITION_ANIMATION_TYPE_NONE, SCENE_HISTORY_OPTION_NO_HISTORY,SCENE_DESTROY_OPTION_DESTROY), pCallInfoList);
650 //goto multiple active call form
651 pSceneManager->GoForward(ForwardSceneTransition(IDSCN_SCENE_MULTIPLEACTIVECALL,
652 SCENE_TRANSITION_ANIMATION_TYPE_NONE, SCENE_HISTORY_OPTION_NO_HISTORY,SCENE_DESTROY_OPTION_DESTROY), pCallInfoList);
654 pCallList->RemoveAll();
660 ConfCallerListForm::OnContactsChanged(const Tizen::Base::Collection::IList& contactChangeInfoList)
662 __pList->UpdateTableView();
666 ConfCallerListForm::OnCategoriesChanged(const Tizen::Base::Collection::IList& categoryChangeInfoList)
672 ConfCallerListForm::CreateItemAndAddActionListener( Button& splitButton,
673 Button& endButton, Label& callerLabel, SplitConfCallerCmdIds splitCmdId,
674 EndConfCallerCmdIds EndCmdId, const String& displayName)
676 Bitmap* pNormalSplitBitmap = null;
677 Bitmap* pPressSplitBitmap = null;
678 Bitmap* pNormalEndBitmap = null;
679 Bitmap* pPressEndBitmap = null;
681 pNormalSplitBitmap = AppUtility::GetBitmapFromResourcesN(IDB_SPLIT_NORMAL_BUTTON_ICON,
682 W_SPLIT_BITMAP, H_SPLIT_BITMAP);
683 pPressSplitBitmap = AppUtility::GetBitmapFromResourcesN(IDB_SPLIT_PRESS_BUTTON_ICON,
684 W_SPLIT_BITMAP, H_SPLIT_BITMAP);
685 pNormalEndBitmap = AppUtility::GetBitmapFromResourcesN(IDB_END_NORMAL_BUTTON_ICON,
686 W_END_BITMAP, H_END_BITMAP);
687 pPressEndBitmap = AppUtility::GetBitmapFromResourcesN(IDB_END_PRESS_BUTTON_ICON,
688 W_END_BITMAP, H_END_BITMAP);
690 bool isSplitAllowed = true;
691 if ((__pCallPresentor->IsSplitAllowed() == false) || (__pConfCallInfo->IsOnHold() == true) || (__isCallSplit == true))
693 isSplitAllowed = false;
696 splitButton.SetActionId(splitCmdId);
697 splitButton.AddActionEventListener(*this);
698 splitButton.SetColor(BUTTON_STATUS_NORMAL,COLOR_SPLIT_CALL_BG);
699 splitButton.SetColor(BUTTON_STATUS_PRESSED,COLOR_SPLIT_CALL_BG_PRESS);
700 splitButton.SetNormalBitmap(Point(0, 0), *pNormalSplitBitmap);
701 splitButton.SetPressedBitmap(Point(0, 0), *pPressSplitBitmap);
704 bool isEnableEndButton = (__isCallSplit == false);
705 endButton.SetEnabled(isEnableEndButton);
706 endButton.SetActionId(EndCmdId);
707 endButton.AddActionEventListener(*this);
708 endButton.SetNormalBitmap(Point(0, 0), *pNormalEndBitmap);
709 endButton.SetColor(BUTTON_STATUS_NORMAL,COLOR_END_CALL_BG);
710 endButton.SetColor(BUTTON_STATUS_PRESSED,COLOR_END_CALL_BG_PRESS);
711 endButton.SetPressedBitmap(Point(0, 0), *pPressEndBitmap);
714 if (isSplitAllowed == false)
716 splitButton.SetShowState(false);
717 callerLabel.SetBounds(splitButton.GetBounds().x, callerLabel.GetBounds().y,
718 callerLabel.GetBounds().width, callerLabel.GetBounds().height);
722 splitButton.SetShowState(true);
723 callerLabel.SetBounds((splitButton.GetBounds().x + splitButton.GetBounds().width), callerLabel.GetBounds().y,
724 callerLabel.GetBounds().width, callerLabel.GetBounds().height);
728 callerLabel.SetTextHorizontalAlignment(ALIGNMENT_LEFT);
729 callerLabel.SetText(displayName);
730 delete pNormalEndBitmap;
731 pNormalEndBitmap = null;
732 delete pPressEndBitmap;
733 pPressEndBitmap = null;
734 delete pNormalSplitBitmap;
735 pNormalSplitBitmap = null;
736 delete pPressSplitBitmap;
737 pPressSplitBitmap = null;
741 ConfCallerListForm::GetItemCount(void)
743 IListT<AppCallInfo>* pCallList = __pConfCallInfo->GetCallerList();
744 return pCallList->GetCount();
748 ConfCallerListForm::CreateItem(int itemIndex, int itemWidth)
750 AppLogDebug("%d %x",itemWidth,__pConfCallInfo);
751 IListT<AppCallInfo>* pCallList = __pConfCallInfo->GetCallerList();
753 TableViewAnnexStyle style = TABLE_VIEW_ANNEX_STYLE_NORMAL;
754 TableViewItem* pItem = new (std::nothrow) TableViewItem();
756 pItem->Construct(Tizen::Graphics::Dimension(GetBounds().width, LIST_ITEM_HEIGHT), style);
758 Button *pSplitCallButton = new (std::nothrow) Button();
759 pSplitCallButton->Construct(Rectangle(X_SPLIT_BUTTON_MARGIN,Y_SPLIT_BUTTON_MARGIN,W_SPLIT_BITMAP,W_SPLIT_BITMAP));
761 Label *pCallLabel = new (std::nothrow)Label();
762 pCallLabel->Construct(Rectangle(X_CALLER_LABEL,Y_CALLER_LABEL,W_CALLER_LABEL,H_CALLER_LABEL),L"");
764 Button *pEndCallButton = new (std::nothrow)Button();
765 pEndCallButton->Construct(Rectangle(GetBounds().width-X_END_BUTTON_PADDING-W_SPLIT_BITMAP,Y_SPLIT_BUTTON_MARGIN,W_SPLIT_BITMAP,W_SPLIT_BITMAP));
768 AppCallInfo callInfo;
770 result r = pCallList->GetAt(itemIndex, callInfo);
772 if(callInfo.GetContactNumber().IsEmpty() == false)
774 pContactNo.Append(callInfo.GetContactNumber());
778 pContactNo.Append(AppUtility::GetResourceString(IDS_NUMBER_UNKNOWN));
780 //fetch contact details based on phone number
781 String* pDisplayName = callInfo.FetchLatestCallerNameN(pContactNo);
783 if(pDisplayName != null)
785 if ((pDisplayName->IsEmpty()) || r != E_SUCCESS)
787 pDisplayName->Append(pContactNo);
793 CreateItemAndAddActionListener(*pSplitCallButton,*pEndCallButton,*pCallLabel,
794 IDA_SPLIT_CALLER1,IDA_END_CALLER1,*pDisplayName);
799 CreateItemAndAddActionListener(*pSplitCallButton,*pEndCallButton,*pCallLabel,
800 IDA_SPLIT_CALLER2,IDA_END_CALLER2,*pDisplayName);
805 CreateItemAndAddActionListener(*pSplitCallButton,*pEndCallButton,*pCallLabel,
806 IDA_SPLIT_CALLER3,IDA_END_CALLER3,*pDisplayName);
811 CreateItemAndAddActionListener(*pSplitCallButton,*pEndCallButton,*pCallLabel,
812 IDA_SPLIT_CALLER4,IDA_END_CALLER4,*pDisplayName);
817 CreateItemAndAddActionListener(*pSplitCallButton,*pEndCallButton,*pCallLabel,
818 IDA_SPLIT_CALLER5,IDA_END_CALLER5,*pDisplayName);
825 pItem->AddControl(pSplitCallButton);
826 pItem->AddControl(pCallLabel);
827 pItem->AddControl(pEndCallButton);
828 if(pDisplayName != null)
839 ConfCallerListForm::DeleteItem(int itemIndex, TableViewItem* pItem)
847 ConfCallerListForm::UpdateItem(int itemIndex, TableViewItem* pItem)
853 ConfCallerListForm::GetDefaultItemHeight(void)
855 return LIST_ITEM_HEIGHT;
859 ConfCallerListForm::OnOrientationChanged(const Control& source, OrientationStatus orientationStatus)
861 AppLogDebug("Enter");
862 __pList->UpdateTableView();