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;
109 ConfCallerListForm::~ConfCallerListForm(void)
111 if (__pConfCallTimer != null)
113 __pConfCallTimer->Cancel();
114 delete __pConfCallTimer;
119 ConfCallerListForm::Initialize(void)
121 Construct(IDL_CONFCALL_LIST_FORM);
125 ConfCallerListForm::OnInitializing(void)
127 result r = E_SUCCESS;
128 //Add action listener to buttons
129 AddActionListener(IDC_END_CONFCALL_BUTTON, IDA_END_CONF_CALL);
130 AddActionListener(IDC_HOLD_CONFCALL_BUTTON, IDA_HOLD_CONF_CALL);
132 Footer* pFooter = GetFooter();
135 SetFormBackEventListener(this);
137 Label* pTimerLbl = static_cast<Label*>(GetControl(IDC_CALL_TIME_LABEL));
138 SetControlAlwaysOnTop(*pTimerLbl,true);
141 __pCallPresentor = CallPresentationModel::GetInstance();
146 ConfCallerListForm::CreateTableView(void)
148 __pList = static_cast <TableView*> (GetControl(IDC_CONF_CALL_LIST_TABLEVIEW));
149 __pList->SetItemProvider(this);
154 ConfCallerListForm::AddActionListener(const String& keyName, CommandIds cmdId)
156 Button* pButtonKeypad = static_cast<Button*>(GetControl(keyName));
157 if (pButtonKeypad != null)
159 pButtonKeypad->SetActionId(cmdId);
160 pButtonKeypad->AddActionEventListener(*this);
165 ConfCallerListForm::OnTerminating(void)
167 result r = E_SUCCESS;
169 if (__pCallPresentor != null)
171 __pCallPresentor = null;
174 if (__pConfCallInfo != null)
176 delete __pConfCallInfo;
177 __pConfCallInfo = null;
180 //RemoveAllControls();
185 ConfCallerListForm::OnActionPerformed(const Control& source, int actionId)
187 SceneManager* pSceneManager = SceneManager::GetInstance();
188 AppAssert(pSceneManager);
192 case IDA_END_CONF_CALL:
194 bool success = __pCallPresentor->EndConferenceCall();
197 delete __pConfCallInfo;
198 __pConfCallInfo = null;
203 case IDA_HOLD_CONF_CALL:
205 // User has pressed end conference call and we are waiting for TAPI response
206 if(__pConfCallInfo == null)
211 bool isCallOnHold = __pConfCallInfo->IsOnHold();
212 if (isCallOnHold == false)
214 success = __pCallPresentor->HoldConferenceCall();
218 success = __pCallPresentor->ActivateConferenceCall();
221 //Check if request to Hold / UnHold call is successful.
224 //If success, then invert the Hold status in conference call
225 isCallOnHold = !(isCallOnHold);
226 __pConfCallInfo->SetOnHold(isCallOnHold);
228 __pList->UpdateTableView();
229 SetHoldButtonStatus(isCallOnHold);
236 ArrayListT<AppCallInfo>* pCallList = static_cast<ArrayListT<AppCallInfo>*>(__pCallPresentor->GetCallListN());
237 int noOfCalls = pCallList->GetCount();
239 //Ownership - To be deleted in 'OnSceneActivatedN' of next form
240 ArrayList* pCallInfoList = new (std::nothrow) ArrayList(SingleObjectDeleter);
241 pCallInfoList->Construct(noOfCalls);
243 for (int index = 0; index < noOfCalls; index++)
245 //fetch call info and add to list
246 AppCallInfo callInfo;
247 result r = pCallList->GetAt(index, callInfo);
250 //copy call information to new instance
251 AppCallInfo* pCaller = new (std::nothrow) AppCallInfo();
253 pCallInfoList->Add(pCaller);
259 //single active call - goto active call form
260 pSceneManager->GoForward(ForwardSceneTransition(IDSCN_SCENE_CONFCALL,
261 SCENE_TRANSITION_ANIMATION_TYPE_NONE, SCENE_HISTORY_OPTION_NO_HISTORY,SCENE_DESTROY_OPTION_DESTROY), pCallInfoList);
265 //goto multiple active call form
266 pSceneManager->GoForward(ForwardSceneTransition(IDSCN_SCENE_MULTIPLEACTIVECALL,
267 SCENE_TRANSITION_ANIMATION_TYPE_NONE, SCENE_HISTORY_OPTION_NO_HISTORY,SCENE_DESTROY_OPTION_DESTROY), pCallInfoList);
269 pCallList->RemoveAll();
274 case IDA_SPLIT_CALLER1:
275 case IDA_SPLIT_CALLER2:
276 case IDA_SPLIT_CALLER3:
277 case IDA_SPLIT_CALLER4:
278 case IDA_SPLIT_CALLER5:
280 // User has pressed end conference call and we are waiting for TAPI response
281 if(__pConfCallInfo == null)
285 __isCallSplit = __pCallPresentor->SplitFromConference(SplitConfCallerCmdIds(actionId),__pConfCallInfo->GetCallerList());
286 if(__isCallSplit == true)
288 __pList->UpdateTableView();
293 case IDA_END_CALLER1:
294 case IDA_END_CALLER2:
295 case IDA_END_CALLER3:
296 case IDA_END_CALLER4:
297 case IDA_END_CALLER5:
299 // User has pressed end conference call and we are waiting for TAPI response
300 if(__pConfCallInfo == null)
304 __pCallPresentor->EndCallFromConference(EndConfCallerCmdIds(actionId),__pConfCallInfo->GetCallerList());
314 ConfCallerListForm::OnSceneActivatedN(const SceneId& previousSceneId, const SceneId& currentSceneId, IList* pArgs)
316 //set itself as listener
317 __pCallPresentor->SetTelEventListener(this);
318 __isCallSplit = false;
320 AppLogDebug("Enter");
322 //DisableAllControls();
323 if (__pConfCallInfo != null)
325 delete __pConfCallInfo;
326 __pConfCallInfo = null;
328 //show 1st caller's info.
329 //Fetch Conference call info from telephony manager
330 __pConfCallInfo = __pCallPresentor->GetConferenceCallInfoN();
331 AppLogDebug("Enter %x",__pConfCallInfo);
333 //show active call timer
334 ShowTimerInfo(IDC_CALL_TIME_LABEL, __pConfCallInfo->GetCallConnectTime());
336 //Set the correct bitmap to the "hold" button based on the current state of the call
337 SetHoldButtonStatus(__pConfCallInfo->IsOnHold());
338 //disable Hold Button, if 2 active calls are present,Else enable it.
339 Button* pButtonHold = static_cast<Button*>(GetControl(IDC_HOLD_CONFCALL_BUTTON));
340 if(pButtonHold != null)
342 if (__pCallPresentor->GetCurrentCallCount() == IDI_MAX_ACTIVE_CALLS)
344 pButtonHold->SetShowState(false);
348 pButtonHold->SetShowState(true);
350 pButtonHold->Invalidate(true);
353 __pList->UpdateTableView();
354 AddOrientationEventListener(*this);
358 ConfCallerListForm::OnSceneDeactivated(const SceneId& currentSceneId, const SceneId& nextSceneId)
360 RemoveOrientationEventListener(*this);
361 if (__pConfCallTimer != null)
363 __pConfCallTimer->Cancel();
364 delete __pConfCallTimer;
365 __pConfCallTimer = null;
370 ConfCallerListForm::OnDraw(void)
376 ConfCallerListForm::SetHoldButtonStatus(bool isCallOnHold)
378 Button* pButtonHold = static_cast<Button*>(GetControl(IDC_HOLD_CONFCALL_BUTTON));
379 if(pButtonHold != null)
381 Bitmap* pNormalBitmapToBeDrawn = null;
382 Bitmap* pPressBitmapToBeDrawn = null;
384 if (isCallOnHold == true)
386 pNormalBitmapToBeDrawn = AppUtility::GetBitmapFromResourcesN(IDB_UNHOLD_NORMAL_BUTTON_ICON,
387 W_HOLD_BITMAP, W_HOLD_BITMAP);
388 pPressBitmapToBeDrawn = AppUtility::GetBitmapFromResourcesN(IDB_UNHOLD_PRESS_BUTTON_ICON,
389 W_HOLD_BITMAP, W_HOLD_BITMAP);
393 pNormalBitmapToBeDrawn = AppUtility::GetBitmapFromResourcesN(IDB_HOLD_NORMAL_BUTTON_ICON,
394 W_HOLD_BITMAP, W_HOLD_BITMAP);
395 pPressBitmapToBeDrawn = AppUtility::GetBitmapFromResourcesN(IDB_HOLD_PRESS_BUTTON_ICON,
396 W_HOLD_BITMAP, W_HOLD_BITMAP);
399 if (pNormalBitmapToBeDrawn)
401 pButtonHold->SetNormalBitmap(Point(0, 0), *pNormalBitmapToBeDrawn);
403 if (pPressBitmapToBeDrawn)
405 pButtonHold->SetPressedBitmap(Point(0, 0), *pPressBitmapToBeDrawn);
408 pButtonHold->Invalidate(true);
409 delete pNormalBitmapToBeDrawn;
410 pNormalBitmapToBeDrawn = null;
411 delete pPressBitmapToBeDrawn;
412 pPressBitmapToBeDrawn = null;
417 ConfCallerListForm::HandleParticipantsChanged(void)
419 AppLogDebug("Enter");
420 AppCallInfo* pCallInfo = __pCallPresentor->GetConferenceCallInfoN();
421 if (pCallInfo == null)
425 if (__pConfCallInfo != null)
427 delete __pConfCallInfo;
428 __pConfCallInfo = null;
430 __pConfCallInfo = new (std::nothrow) AppCallInfo();
431 *__pConfCallInfo = *pCallInfo;
432 __pList->UpdateTableView();
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::CreateItemAndAddActionListener( Button& splitButton,
657 Button& endButton, Label& callerLabel, SplitConfCallerCmdIds splitCmdId,
658 EndConfCallerCmdIds EndCmdId, const String& displayName)
660 Bitmap* pNormalSplitBitmap = null;
661 Bitmap* pPressSplitBitmap = null;
662 Bitmap* pNormalEndBitmap = null;
663 Bitmap* pPressEndBitmap = null;
665 pNormalSplitBitmap = AppUtility::GetBitmapFromResourcesN(IDB_SPLIT_NORMAL_BUTTON_ICON,
666 W_SPLIT_BITMAP, H_SPLIT_BITMAP);
667 pPressSplitBitmap = AppUtility::GetBitmapFromResourcesN(IDB_SPLIT_PRESS_BUTTON_ICON,
668 W_SPLIT_BITMAP, H_SPLIT_BITMAP);
669 pNormalEndBitmap = AppUtility::GetBitmapFromResourcesN(IDB_END_NORMAL_BUTTON_ICON,
670 W_END_BITMAP, H_END_BITMAP);
671 pPressEndBitmap = AppUtility::GetBitmapFromResourcesN(IDB_END_PRESS_BUTTON_ICON,
672 W_END_BITMAP, H_END_BITMAP);
674 bool isSplitAllowed = true;
675 if ((__pCallPresentor->IsSplitAllowed() == false) || (__pConfCallInfo->IsOnHold() == true) || (__isCallSplit == true))
677 isSplitAllowed = false;
680 splitButton.SetActionId(splitCmdId);
681 splitButton.AddActionEventListener(*this);
682 splitButton.SetColor(BUTTON_STATUS_NORMAL,COLOR_SPLIT_CALL_BG);
683 splitButton.SetColor(BUTTON_STATUS_PRESSED,COLOR_SPLIT_CALL_BG_PRESS);
684 splitButton.SetNormalBitmap(Point(0, 0), *pNormalSplitBitmap);
685 splitButton.SetPressedBitmap(Point(0, 0), *pPressSplitBitmap);
688 bool isEnableEndButton = (__isCallSplit == false);
689 endButton.SetEnabled(isEnableEndButton);
690 endButton.SetActionId(EndCmdId);
691 endButton.AddActionEventListener(*this);
692 endButton.SetNormalBitmap(Point(0, 0), *pNormalEndBitmap);
693 endButton.SetColor(BUTTON_STATUS_NORMAL,COLOR_END_CALL_BG);
694 endButton.SetColor(BUTTON_STATUS_PRESSED,COLOR_END_CALL_BG_PRESS);
695 endButton.SetPressedBitmap(Point(0, 0), *pPressEndBitmap);
698 if (isSplitAllowed == false)
700 splitButton.SetShowState(false);
701 callerLabel.SetBounds(splitButton.GetBounds().x, callerLabel.GetBounds().y,
702 callerLabel.GetBounds().width, callerLabel.GetBounds().height);
706 splitButton.SetShowState(true);
707 callerLabel.SetBounds((splitButton.GetBounds().x + splitButton.GetBounds().width), callerLabel.GetBounds().y,
708 callerLabel.GetBounds().width, callerLabel.GetBounds().height);
712 callerLabel.SetTextHorizontalAlignment(ALIGNMENT_LEFT);
713 callerLabel.SetText(displayName);
714 delete pNormalEndBitmap;
715 pNormalEndBitmap = null;
716 delete pPressEndBitmap;
717 pPressEndBitmap = null;
718 delete pNormalSplitBitmap;
719 pNormalSplitBitmap = null;
720 delete pPressSplitBitmap;
721 pPressSplitBitmap = null;
725 ConfCallerListForm::GetItemCount(void)
727 IListT<AppCallInfo>* pCallList = __pConfCallInfo->GetCallerList();
728 return pCallList->GetCount();
732 ConfCallerListForm::CreateItem(int itemIndex, int itemWidth)
734 AppLogDebug("%d %x",itemWidth,__pConfCallInfo);
735 IListT<AppCallInfo>* pCallList = __pConfCallInfo->GetCallerList();
737 TableViewAnnexStyle style = TABLE_VIEW_ANNEX_STYLE_NORMAL;
738 TableViewItem* pItem = new (std::nothrow) TableViewItem();
740 pItem->Construct(Tizen::Graphics::Dimension(GetBounds().width, LIST_ITEM_HEIGHT), style);
742 Button *pSplitCallButton = new (std::nothrow) Button();
743 pSplitCallButton->Construct(Rectangle(X_SPLIT_BUTTON_MARGIN,Y_SPLIT_BUTTON_MARGIN,W_SPLIT_BITMAP,W_SPLIT_BITMAP));
745 Label *pCallLabel = new (std::nothrow)Label();
746 pCallLabel->Construct(Rectangle(X_CALLER_LABEL,Y_CALLER_LABEL,W_CALLER_LABEL,H_CALLER_LABEL),L"");
748 Button *pEndCallButton = new (std::nothrow)Button();
749 pEndCallButton->Construct(Rectangle(GetBounds().width-X_END_BUTTON_PADDING-W_SPLIT_BITMAP,Y_SPLIT_BUTTON_MARGIN,W_SPLIT_BITMAP,W_SPLIT_BITMAP));
752 AppCallInfo callInfo;
754 result r = pCallList->GetAt(itemIndex, callInfo);
756 if(callInfo.GetContactNumber().IsEmpty() == false)
758 pContactNo.Append(callInfo.GetContactNumber());
762 pContactNo.Append(AppUtility::GetResourceString(IDS_NUMBER_UNKNOWN));
764 //fetch contact details based on phone number
765 String* pDisplayName = callInfo.FetchCallerNameN();
767 if(pDisplayName != null)
769 if ((pDisplayName->IsEmpty()) || r != E_SUCCESS)
771 pDisplayName->Append(pContactNo);
777 CreateItemAndAddActionListener(*pSplitCallButton,*pEndCallButton,*pCallLabel,
778 IDA_SPLIT_CALLER1,IDA_END_CALLER1,*pDisplayName);
783 CreateItemAndAddActionListener(*pSplitCallButton,*pEndCallButton,*pCallLabel,
784 IDA_SPLIT_CALLER2,IDA_END_CALLER2,*pDisplayName);
789 CreateItemAndAddActionListener(*pSplitCallButton,*pEndCallButton,*pCallLabel,
790 IDA_SPLIT_CALLER3,IDA_END_CALLER3,*pDisplayName);
795 CreateItemAndAddActionListener(*pSplitCallButton,*pEndCallButton,*pCallLabel,
796 IDA_SPLIT_CALLER4,IDA_END_CALLER4,*pDisplayName);
801 CreateItemAndAddActionListener(*pSplitCallButton,*pEndCallButton,*pCallLabel,
802 IDA_SPLIT_CALLER5,IDA_END_CALLER5,*pDisplayName);
809 pItem->AddControl(pSplitCallButton);
810 pItem->AddControl(pCallLabel);
811 pItem->AddControl(pEndCallButton);
812 if(pDisplayName != null)
823 ConfCallerListForm::DeleteItem(int itemIndex, TableViewItem* pItem)
831 ConfCallerListForm::UpdateItem(int itemIndex, TableViewItem* pItem)
837 ConfCallerListForm::GetDefaultItemHeight(void)
839 return LIST_ITEM_HEIGHT;
843 ConfCallerListForm::OnOrientationChanged(const Control& source, OrientationStatus orientationStatus)
845 AppLogDebug("Enter");
846 __pList->UpdateTableView();