2 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
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
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;
108 ConfCallerListForm::~ConfCallerListForm(void)
110 if (__pConfCallTimer != null)
112 __pConfCallTimer->Cancel();
113 delete __pConfCallTimer;
118 ConfCallerListForm::Initialize(void)
120 Construct(IDL_CONFCALL_LIST_FORM);
124 ConfCallerListForm::OnInitializing(void)
126 result r = E_SUCCESS;
127 //Add action listener to buttons
128 AddActionListener(IDC_END_CONFCALL_BUTTON, IDA_END_CONF_CALL);
129 AddActionListener(IDC_HOLD_CONFCALL_BUTTON, IDA_HOLD_CONF_CALL);
131 Footer* pFooter = GetFooter();
134 SetFormBackEventListener(this);
135 pFooter->SetBackButton();
139 __pCallPresentor = CallPresentationModel::GetInstance();
144 ConfCallerListForm::CreateTableView(void)
146 __pList = static_cast <TableView*> (GetControl(IDC_CONF_CALL_LIST_TABLEVIEW));
147 __pList->SetItemProvider(this);
148 AddControl(*__pList);
152 ConfCallerListForm::AddActionListener(const String& keyName, CommandIds cmdId)
154 Button* pButtonKeypad = static_cast<Button*>(GetControl(keyName));
155 if (pButtonKeypad != null)
157 pButtonKeypad->SetActionId(cmdId);
158 pButtonKeypad->AddActionEventListener(*this);
163 ConfCallerListForm::OnTerminating(void)
165 result r = E_SUCCESS;
167 if (__pCallPresentor != null)
169 __pCallPresentor = null;
172 if (__pConfCallInfo != null)
174 delete __pConfCallInfo;
175 __pConfCallInfo = null;
183 ConfCallerListForm::OnActionPerformed(const Control& source, int actionId)
185 SceneManager* pSceneManager = SceneManager::GetInstance();
186 AppAssert(pSceneManager);
190 case IDA_END_CONF_CALL:
192 bool success = __pCallPresentor->EndConferenceCall();
195 delete __pConfCallInfo;
196 __pConfCallInfo = null;
201 case IDA_HOLD_CONF_CALL:
203 // User has pressed end conference call and we are waiting for TAPI response
204 if(__pConfCallInfo == null)
209 bool isCallOnHold = __pConfCallInfo->IsOnHold();
210 if (isCallOnHold == false)
212 success = __pCallPresentor->HoldConferenceCall();
216 success = __pCallPresentor->ActivateConferenceCall();
219 //Check if request to Hold / UnHold call is successful.
222 //If success, then invert the Hold status in conference call
223 isCallOnHold = !(isCallOnHold);
224 __pConfCallInfo->SetOnHold(isCallOnHold);
225 //update panels and Hold button status
227 SetHoldButtonStatus(isCallOnHold);
234 ArrayListT<CallInfo>* pCallList = static_cast<ArrayListT<CallInfo>*>(__pCallPresentor->GetCallListN());
235 int noOfCalls = pCallList->GetCount();
237 //Ownership - To be deleted in 'OnSceneActivatedN' of next form
238 ArrayList* pCallInfoList = new (std::nothrow) ArrayList(SingleObjectDeleter);
239 pCallInfoList->Construct(noOfCalls);
241 for (int index = 0; index < noOfCalls; index++)
243 //fetch call info and add to list
245 result r = pCallList->GetAt(index, callInfo);
248 //copy call information to new instance
249 CallInfo* pCaller = new (std::nothrow) CallInfo();
251 pCallInfoList->Add(pCaller);
257 //single active call - goto active call form
258 pSceneManager->GoForward(ForwardSceneTransition(IDSCN_SCENE_CONFCALL), pCallInfoList);
262 //goto multiple active call form
263 pSceneManager->GoForward(ForwardSceneTransition(IDSCN_SCENE_MULTIPLEACTIVECALL), pCallInfoList);
265 pCallList->RemoveAll();
270 case IDA_SPLIT_CALLER1:
271 case IDA_SPLIT_CALLER2:
272 case IDA_SPLIT_CALLER3:
273 case IDA_SPLIT_CALLER4:
274 case IDA_SPLIT_CALLER5:
276 // User has pressed end conference call and we are waiting for TAPI response
277 if(__pConfCallInfo == null)
281 __pCallPresentor->SplitFromConference(SplitConfCallerCmdIds(actionId),__pConfCallInfo->GetCallerList());
285 case IDA_END_CALLER1:
286 case IDA_END_CALLER2:
287 case IDA_END_CALLER3:
288 case IDA_END_CALLER4:
289 case IDA_END_CALLER5:
291 // User has pressed end conference call and we are waiting for TAPI response
292 if(__pConfCallInfo == null)
296 __pCallPresentor->EndCallFromConference(EndConfCallerCmdIds(actionId),__pConfCallInfo->GetCallerList());
306 ConfCallerListForm::OnSceneActivatedN(const SceneId& previousSceneId, const SceneId& currentSceneId, IList* pArgs)
308 //set itself as listener
309 __pCallPresentor->SetTelEventListener(this);
311 AddOrientationEventListener(*this);
313 //DisableAllControls();
314 if (__pConfCallInfo != null)
316 delete __pConfCallInfo;
317 __pConfCallInfo = null;
319 //show 1st caller's info.
320 //Fetch Conference call info from telephony manager
321 __pConfCallInfo = __pCallPresentor->GetConferenceCallInfoN();
323 //show active call timer
324 ShowTimerInfo(IDC_CALL_TIME_LABEL, __pConfCallInfo->GetCallConnectTime());
326 //Set the correct bitmap to the "hold" button based on the current state of the call
327 SetHoldButtonStatus(__pConfCallInfo->IsOnHold());
328 //disable Hold Button, if 2 active calls are present,Else enable it.
329 Button* pButtonHold = static_cast<Button*>(GetControl(IDC_HOLD_CONFCALL_BUTTON));
330 if(pButtonHold != null)
332 if (__pCallPresentor->GetCurrentCallCount() == IDI_MAX_ACTIVE_CALLS)
334 pButtonHold->SetShowState(false);
338 pButtonHold->SetShowState(true);
340 pButtonHold->Invalidate(true);
343 __pList->UpdateTableView();
348 ConfCallerListForm::OnSceneDeactivated(const SceneId& currentSceneId, const SceneId& nextSceneId)
350 RemoveOrientationEventListener(*this);
351 if (__pConfCallInfo != null)
353 delete __pConfCallInfo;
354 __pConfCallInfo = null;
356 if (__pConfCallTimer != null)
358 __pConfCallTimer->Cancel();
359 delete __pConfCallTimer;
360 __pConfCallTimer = null;
365 ConfCallerListForm::OnDraw(void)
371 ConfCallerListForm::SetHoldButtonStatus(bool isCallOnHold)
373 Button* pButtonHold = static_cast<Button*>(GetControl(IDC_HOLD_CONFCALL_BUTTON));
374 if(pButtonHold != null)
376 Bitmap* pNormalBitmapToBeDrawn = null;
377 Bitmap* pPressBitmapToBeDrawn = null;
379 if (isCallOnHold == true)
381 pNormalBitmapToBeDrawn = AppUtility::GetBitmapFromResourcesN(IDB_UNHOLD_NORMAL_BUTTON_ICON,
382 W_HOLD_BITMAP, W_HOLD_BITMAP);
383 pPressBitmapToBeDrawn = AppUtility::GetBitmapFromResourcesN(IDB_UNHOLD_PRESS_BUTTON_ICON,
384 W_HOLD_BITMAP, W_HOLD_BITMAP);
388 pNormalBitmapToBeDrawn = AppUtility::GetBitmapFromResourcesN(IDB_HOLD_NORMAL_BUTTON_ICON,
389 W_HOLD_BITMAP, W_HOLD_BITMAP);
390 pPressBitmapToBeDrawn = AppUtility::GetBitmapFromResourcesN(IDB_HOLD_PRESS_BUTTON_ICON,
391 W_HOLD_BITMAP, W_HOLD_BITMAP);
394 if (pNormalBitmapToBeDrawn)
396 pButtonHold->SetNormalBitmap(Point(0, 0), *pNormalBitmapToBeDrawn);
398 if (pPressBitmapToBeDrawn)
400 pButtonHold->SetPressedBitmap(Point(0, 0), *pPressBitmapToBeDrawn);
403 pButtonHold->Invalidate(true);
404 delete pNormalBitmapToBeDrawn;
405 pNormalBitmapToBeDrawn = null;
406 delete pPressBitmapToBeDrawn;
407 pPressBitmapToBeDrawn = null;
412 ConfCallerListForm::HandleParticipantsChanged(void)
414 CallInfo* pCallInfo = __pCallPresentor->GetConferenceCallInfoN();
415 if (pCallInfo == null)
419 if (__pConfCallInfo != null)
421 delete __pConfCallInfo;
422 __pConfCallInfo = null;
424 __pConfCallInfo = new (std::nothrow) CallInfo();
425 *__pConfCallInfo = *pCallInfo;
426 //Disable all key panels and redraw with new caller list
427 //DisableAllControls();
429 __pList->UpdateTableView();
433 ConfCallerListForm::DisableAllControls(void)
435 Panel* pKeysPanel = static_cast<Panel*>(GetControl(IDC_CALLER1_PANEL));
436 if (pKeysPanel != null)
438 pKeysPanel->SetShowState(false);
439 Label* pLineLabel1 = static_cast<Label*>(GetControl(IDC__LINE_LABEL1));
440 pLineLabel1->SetShowState(false);
443 pKeysPanel = static_cast<Panel*>(GetControl(IDC_CALLER2_PANEL));
444 if (pKeysPanel != null)
446 pKeysPanel->SetShowState(false);
447 Label* pLineLabel1 = static_cast<Label*>(GetControl(IDC__LINE_LABEL2));
448 pLineLabel1->SetShowState(false);
451 pKeysPanel = static_cast<Panel*>(GetControl(IDC_CALLER3_PANEL));
452 if (pKeysPanel != null)
454 pKeysPanel->SetShowState(false);
455 Label* pLineLabel1 = static_cast<Label*>(GetControl(IDC__LINE_LABEL3));
456 pLineLabel1->SetShowState(false);
459 pKeysPanel = static_cast<Panel*>(GetControl(IDC_CALLER4_PANEL));
460 if (pKeysPanel != null)
462 pKeysPanel->SetShowState(false);
463 Label* pLineLabel1 = static_cast<Label*>(GetControl(IDC__LINE_LABEL4));
464 pLineLabel1->SetShowState(false);
467 pKeysPanel = static_cast<Panel*>(GetControl(IDC_CALLER5_PANEL));
468 if (pKeysPanel != null)
470 pKeysPanel->SetShowState(false);
471 Label* pLineLabel1 = static_cast<Label*>(GetControl(IDC__LINE_LABEL5));
472 pLineLabel1->SetShowState(false);
478 ConfCallerListForm::ActivatePanels(void)
480 IListT<CallInfo>* pCallList = __pConfCallInfo->GetCallerList();
481 int confCallCount = pCallList->GetCount();
483 for (int index = 0; index < confCallCount; index++)
487 result r = pCallList->GetAt(index, callInfo);
488 if(callInfo.GetContactNumber().IsEmpty() == false)
490 pContactNo.Append(callInfo.GetContactNumber());
494 pContactNo.Append(AppUtility::GetResourceString(IDS_NUMBER_UNKNOWN));
497 //fetch contact details based on phone number
498 String* pDisplayName = callInfo.FetchCallerNameN();
500 if ((pDisplayName->IsEmpty()) || r != E_SUCCESS)
502 pDisplayName->Append(pContactNo);
509 ActivatePanelAndAddActionListener(IDC_CALLER1_PANEL,IDC__LINE_LABEL1,IDC_SPLIT_CALLER1,IDC_END_CALLER1
510 ,IDC_CALLER1_LABEL,IDA_SPLIT_CALLER1,IDA_END_CALLER1,*pDisplayName);
516 ActivatePanelAndAddActionListener(IDC_CALLER2_PANEL,IDC__LINE_LABEL2,IDC_SPLIT_CALLER2,IDC_END_CALLER2
517 ,IDC_CALLER2_LABEL,IDA_SPLIT_CALLER2,IDA_END_CALLER2,*pDisplayName);
523 ActivatePanelAndAddActionListener(IDC_CALLER3_PANEL,IDC__LINE_LABEL3,IDC_SPLIT_CALLER3,IDC_END_CALLER3
524 ,IDC_CALLER3_LABEL,IDA_SPLIT_CALLER3,IDA_END_CALLER3,*pDisplayName);
530 ActivatePanelAndAddActionListener(IDC_CALLER4_PANEL,IDC__LINE_LABEL4,IDC_SPLIT_CALLER4,IDC_END_CALLER4
531 ,IDC_CALLER4_LABEL,IDA_SPLIT_CALLER4,IDA_END_CALLER4,*pDisplayName);
537 ActivatePanelAndAddActionListener(IDC_CALLER5_PANEL,IDC__LINE_LABEL5,IDC_SPLIT_CALLER5,IDC_END_CALLER5
538 ,IDC_CALLER5_LABEL,IDA_SPLIT_CALLER5,IDA_END_CALLER5,*pDisplayName);
552 ConfCallerListForm::ActivatePanelAndAddActionListener( const String& panelName, const String& lineLabelName, const String& splitButtonName,
553 const String& endButtonName, const String& callerLabelName, SplitConfCallerCmdIds splitCmdId,
554 EndConfCallerCmdIds EndCmdId, const String& displayName)
556 Bitmap* pNormalSplitBitmap = null;
557 Bitmap* pPressSplitBitmap = null;
560 Bitmap* pNormalEndBitmap = null;
561 Bitmap* pPressEndBitmap = null;
565 pNormalSplitBitmap = AppUtility::GetBitmapFromResourcesN(IDB_SPLIT_NORMAL_BUTTON_ICON,
566 W_SPLIT_BITMAP, H_SPLIT_BITMAP);
567 pPressSplitBitmap = AppUtility::GetBitmapFromResourcesN(IDB_SPLIT_PRESS_BUTTON_ICON,
568 W_SPLIT_BITMAP, H_SPLIT_BITMAP);
569 pNormalEndBitmap = AppUtility::GetBitmapFromResourcesN(IDB_END_NORMAL_BUTTON_ICON,
570 W_END_BITMAP, H_END_BITMAP);
571 pPressEndBitmap = AppUtility::GetBitmapFromResourcesN(IDB_END_PRESS_BUTTON_ICON,
572 W_END_BITMAP, H_END_BITMAP);
574 bool isSplitAllowed = true;
575 if ((__pCallPresentor->IsSplitAllowed() == false) || (__pConfCallInfo->IsOnHold() == true))
577 isSplitAllowed = false;
580 Panel* pKeysPanel = static_cast<Panel*>(GetControl(panelName));
581 if (pKeysPanel != null)
583 Button* pButtonSplit = static_cast<Button*>(pKeysPanel->GetControl(splitButtonName));
584 if (pButtonSplit != null)
586 pButtonSplit->SetActionId(splitCmdId);
587 pButtonSplit->AddActionEventListener(*this);
588 pButtonSplit->SetNormalBitmap(Point(0, 0), *pNormalSplitBitmap);
589 pButtonSplit->SetPressedBitmap(Point(0, 0), *pPressSplitBitmap);
591 Button* pButtonEnd = static_cast<Button*>(pKeysPanel->GetControl(endButtonName));
592 if (pButtonEnd != null)
594 pButtonEnd->SetActionId(EndCmdId);
595 pButtonEnd->AddActionEventListener(*this);
596 pButtonEnd->SetNormalBitmap(Point(0, 0), *pNormalEndBitmap);
597 pButtonEnd->SetPressedBitmap(Point(0, 0), *pPressEndBitmap);
599 Label* pNameLabel = static_cast<Label*>(pKeysPanel->GetControl(callerLabelName));
600 if (pButtonSplit != null)
602 if (isSplitAllowed == false)
604 pButtonSplit->SetShowState(false);
605 pNameLabel->SetBounds(pButtonSplit->GetBounds().x, pNameLabel->GetBounds().y,
606 pNameLabel->GetBounds().width, pNameLabel->GetBounds().height);
610 pButtonSplit->SetShowState(true);
611 pNameLabel->SetBounds((pButtonSplit->GetBounds().x + pButtonSplit->GetBounds().width), pNameLabel->GetBounds().y,
612 pNameLabel->GetBounds().width, pNameLabel->GetBounds().height);
615 pNameLabel->SetText(displayName);
617 pKeysPanel->SetShowState(true);
618 Label* pLineLabel1 = static_cast<Label*>(GetControl(lineLabelName));
619 pLineLabel1->SetShowState(true);
621 pKeysPanel->Draw(true);
625 delete pNormalEndBitmap;
626 pNormalEndBitmap = null;
627 delete pPressEndBitmap;
628 pPressEndBitmap = null;
629 delete pNormalSplitBitmap;
630 pNormalSplitBitmap = null;
631 delete pPressSplitBitmap;
632 pPressSplitBitmap = null;
636 ConfCallerListForm::ShowTimerInfo(const String& timerLblName, long long startTime)
638 Label* pTimerLbl = static_cast<Label*>(GetControl(timerLblName));
640 if (__pConfCallTimer == null)
642 __pConfCallTimer = new (std::nothrow) Timer();
643 __pConfCallTimer->Construct(*this);
646 if (pTimerLbl != null)
648 //current system time
649 long long currTime = 0;
650 SystemTime::GetTicks(currTime);
652 TimeSpan diffSpan(abs(startTime - currTime));
654 String activeCallTime(L"");
656 long long hr = diffSpan.GetHours();
658 activeCallTime.Append("0");
660 activeCallTime.Append(hr);
661 activeCallTime.Append(L":");
663 long long min = diffSpan.GetMinutes();
665 activeCallTime.Append("0");
667 activeCallTime.Append(min);
668 activeCallTime.Append(L":");
670 long long sec = diffSpan.GetSeconds();
672 activeCallTime.Append("0");
674 activeCallTime.Append(sec);
676 pTimerLbl->SetText(activeCallTime);
677 __pConfCallTimer->StartAsRepeatable(TimeSpan::NUM_OF_TICKS_IN_SECOND);
683 ConfCallerListForm::OnTimerExpired(Tizen::Base::Runtime::Timer& timer)
685 //Call default implementation of "Object.Equals()"
686 //returns true, if they are pointing to same address.
687 if (__pConfCallTimer->Equals(timer))
689 Label* pTimerLbl = static_cast<Label*>(GetControl(IDC_CALL_TIME_LABEL));
692 String activeCallTime = pTimerLbl->GetText();
693 // Create a StringTokenizer instance
694 StringTokenizer strTokens(activeCallTime, L":");
696 int count = strTokens.GetTokenCount(); // count == 3
701 for (int index = 0; index < count; index++)
706 strTokens.GetNextToken(token);
707 Integer::Parse(token, hr);
711 strTokens.GetNextToken(token);
712 Integer::Parse(token, min);
716 strTokens.GetNextToken(token);
717 Integer::Parse(token, sec);
723 if (sec == IDI_MAX_SECONDS)
728 if (min == IDI_MAX_MINS)
735 activeCallTime.Clear();
738 activeCallTime.Append("0");
740 activeCallTime.Append(hr);
741 activeCallTime.Append(":");
744 activeCallTime.Append("0");
746 activeCallTime.Append(min);
747 activeCallTime.Append(":");
750 activeCallTime.Append("0");
752 activeCallTime.Append(sec);
754 pTimerLbl->SetText(activeCallTime);
755 pTimerLbl->Invalidate(true);
761 ConfCallerListForm::OnFormBackRequested(Form& source)
763 SceneManager* pSceneManager = SceneManager::GetInstance();
764 AppAssert(pSceneManager);
766 ArrayListT<CallInfo>* pCallList = static_cast<ArrayListT<CallInfo>*>(__pCallPresentor->GetCallListN());
767 int noOfCalls = pCallList->GetCount();
769 //Ownership - To be deleted in 'OnSceneActivatedN' of next form
770 ArrayList* pCallInfoList = new (std::nothrow) ArrayList(SingleObjectDeleter);
771 pCallInfoList->Construct(noOfCalls);
773 for (int index = 0; index < noOfCalls; index++)
775 //fetch call info and add to list
777 result r = pCallList->GetAt(index, callInfo);
780 //copy call information to new instance
781 CallInfo* pCaller = new (std::nothrow) CallInfo();
783 pCallInfoList->Add(pCaller);
789 //single active call - goto active call form
790 pSceneManager->GoForward(ForwardSceneTransition(IDSCN_SCENE_CONFCALL), pCallInfoList);
794 //goto multiple active call form
795 pSceneManager->GoForward(ForwardSceneTransition(IDSCN_SCENE_MULTIPLEACTIVECALL), pCallInfoList);
797 pCallList->RemoveAll();
803 ConfCallerListForm::CreateItemAndAddActionListener( Button& splitButton,
804 Button& endButton, Label& callerLabel, SplitConfCallerCmdIds splitCmdId,
805 EndConfCallerCmdIds EndCmdId, const String& displayName)
807 Bitmap* pNormalSplitBitmap = null;
808 Bitmap* pPressSplitBitmap = null;
809 Bitmap* pNormalEndBitmap = null;
810 Bitmap* pPressEndBitmap = null;
812 pNormalSplitBitmap = AppUtility::GetBitmapFromResourcesN(IDB_SPLIT_NORMAL_BUTTON_ICON,
813 W_SPLIT_BITMAP, H_SPLIT_BITMAP);
814 pPressSplitBitmap = AppUtility::GetBitmapFromResourcesN(IDB_SPLIT_PRESS_BUTTON_ICON,
815 W_SPLIT_BITMAP, H_SPLIT_BITMAP);
816 pNormalEndBitmap = AppUtility::GetBitmapFromResourcesN(IDB_END_NORMAL_BUTTON_ICON,
817 W_END_BITMAP, H_END_BITMAP);
818 pPressEndBitmap = AppUtility::GetBitmapFromResourcesN(IDB_END_PRESS_BUTTON_ICON,
819 W_END_BITMAP, H_END_BITMAP);
821 bool isSplitAllowed = true;
822 if ((__pCallPresentor->IsSplitAllowed() == false) || (__pConfCallInfo->IsOnHold() == true))
824 isSplitAllowed = false;
827 splitButton.SetActionId(splitCmdId);
828 splitButton.AddActionEventListener(*this);
829 splitButton.SetColor(BUTTON_STATUS_NORMAL,COLOR_SPLIT_CALL_BG);
830 splitButton.SetColor(BUTTON_STATUS_PRESSED,COLOR_SPLIT_CALL_BG_PRESS);
831 splitButton.SetNormalBitmap(Point(0, 0), *pNormalSplitBitmap);
832 splitButton.SetPressedBitmap(Point(0, 0), *pPressSplitBitmap);
836 endButton.SetActionId(EndCmdId);
837 endButton.AddActionEventListener(*this);
838 endButton.SetNormalBitmap(Point(0, 0), *pNormalEndBitmap);
839 endButton.SetColor(BUTTON_STATUS_NORMAL,COLOR_END_CALL_BG);
840 endButton.SetColor(BUTTON_STATUS_PRESSED,COLOR_END_CALL_BG_PRESS);
841 endButton.SetPressedBitmap(Point(0, 0), *pPressEndBitmap);
844 if (isSplitAllowed == false)
846 splitButton.SetShowState(false);
847 callerLabel.SetBounds(splitButton.GetBounds().x, callerLabel.GetBounds().y,
848 callerLabel.GetBounds().width, callerLabel.GetBounds().height);
852 splitButton.SetShowState(true);
853 callerLabel.SetBounds((splitButton.GetBounds().x + splitButton.GetBounds().width), callerLabel.GetBounds().y,
854 callerLabel.GetBounds().width, callerLabel.GetBounds().height);
858 callerLabel.SetTextHorizontalAlignment(ALIGNMENT_LEFT);
859 callerLabel.SetText(displayName);
860 delete pNormalEndBitmap;
861 pNormalEndBitmap = null;
862 delete pPressEndBitmap;
863 pPressEndBitmap = null;
864 delete pNormalSplitBitmap;
865 pNormalSplitBitmap = null;
866 delete pPressSplitBitmap;
867 pPressSplitBitmap = null;
871 ConfCallerListForm::GetItemCount(void)
873 IListT<CallInfo>* pCallList = __pConfCallInfo->GetCallerList();
874 return pCallList->GetCount();
878 ConfCallerListForm::CreateItem(int itemIndex, int itemWidth)
880 IListT<CallInfo>* pCallList = __pConfCallInfo->GetCallerList();
882 TableViewAnnexStyle style = TABLE_VIEW_ANNEX_STYLE_NORMAL;
883 TableViewItem* pItem = new (std::nothrow) TableViewItem();
885 pItem->Construct(Tizen::Graphics::Dimension(GetBounds().width, LIST_ITEM_HEIGHT), style);
887 Button *pSplitCallButton = new (std::nothrow) Button();
888 pSplitCallButton->Construct(Rectangle(X_SPLIT_BUTTON_MARGIN,Y_SPLIT_BUTTON_MARGIN,W_SPLIT_BITMAP,W_SPLIT_BITMAP));
890 Label *pCallLabel = new (std::nothrow)Label();
891 pCallLabel->Construct(Rectangle(X_CALLER_LABEL,Y_CALLER_LABEL,W_CALLER_LABEL,H_CALLER_LABEL),L"");
893 Button *pEndCallButton = new (std::nothrow)Button();
894 pEndCallButton->Construct(Rectangle(GetBounds().width-X_END_BUTTON_PADDING-W_SPLIT_BITMAP,Y_SPLIT_BUTTON_MARGIN,W_SPLIT_BITMAP,W_SPLIT_BITMAP));
899 result r = pCallList->GetAt(itemIndex, callInfo);
901 if(callInfo.GetContactNumber().IsEmpty() == false)
903 pContactNo.Append(callInfo.GetContactNumber());
907 pContactNo.Append(AppUtility::GetResourceString(IDS_NUMBER_UNKNOWN));
909 //fetch contact details based on phone number
910 String* pDisplayName = callInfo.FetchCallerNameN();
912 if ((pDisplayName->IsEmpty()) || r != E_SUCCESS)
914 pDisplayName->Append(pContactNo);
920 CreateItemAndAddActionListener(*pSplitCallButton,*pEndCallButton,*pCallLabel,
921 IDA_SPLIT_CALLER1,IDA_END_CALLER1,*pDisplayName);
926 CreateItemAndAddActionListener(*pSplitCallButton,*pEndCallButton,*pCallLabel,
927 IDA_SPLIT_CALLER2,IDA_END_CALLER2,*pDisplayName);
932 CreateItemAndAddActionListener(*pSplitCallButton,*pEndCallButton,*pCallLabel,
933 IDA_SPLIT_CALLER3,IDA_END_CALLER3,*pDisplayName);
938 CreateItemAndAddActionListener(*pSplitCallButton,*pEndCallButton,*pCallLabel,
939 IDA_SPLIT_CALLER4,IDA_END_CALLER4,*pDisplayName);
944 CreateItemAndAddActionListener(*pSplitCallButton,*pEndCallButton,*pCallLabel,
945 IDA_SPLIT_CALLER5,IDA_END_CALLER5,*pDisplayName);
951 pItem->AddControl(*pSplitCallButton);
952 pItem->AddControl(*pCallLabel);
953 pItem->AddControl(*pEndCallButton);
960 ConfCallerListForm::DeleteItem(int itemIndex, TableViewItem* pItem)
966 ConfCallerListForm::UpdateItem(int itemIndex, TableViewItem* pItem)
972 ConfCallerListForm::GetDefaultItemHeight(void)
974 return LIST_ITEM_HEIGHT;
978 ConfCallerListForm::OnOrientationChanged(const Control& source, OrientationStatus orientationStatus)
980 AppLogDebug("Enter");
981 __pList->UpdateTableView();