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 PhnLogsDetailForm.cpp
19 * @brief Call log details form
22 #include <FGraphics.h>
25 #include "PhnPhoneApp.h"
26 #include "PhnAppUtility.h"
27 #include "PhnLogsDetailForm.h"
28 #include "PhnSceneRegister.h"
29 #include "PhnCalllogManager.h"
30 #include "PhnCallPresentationModel.h"
31 #include "PhnSettingsPresentationModel.h"
34 using namespace Tizen::App;
35 using namespace Tizen::Base;
36 using namespace Tizen::Base::Collection;
37 using namespace Tizen::Graphics;
38 using namespace Tizen::Media;
39 using namespace Tizen::Social;
40 using namespace Tizen::Ui;
41 using namespace Tizen::Ui::Controls;
42 using namespace Tizen::Ui::Scenes;
44 const wchar_t* IDL_CALL_LOG_DETAIL_FORM = L"IDL_CALL_LOG_DETAIL_FORM";
45 const wchar_t* IDC_BUTTON_CONTACT_IMAGE = L"IDC_BUTTON_CONTACT_IMAGE";
46 const wchar_t* IDC_LABEL_NAME = L"IDC_LABEL_NAME";
47 const wchar_t* IDC_LABEL_NUMBER = L"IDC_LABEL_NUMBER";
48 const wchar_t* IDC_LABEL_NUMBER_UNSAVED = L"IDC_LABEL_NUMBER_UNSAVED";
49 const wchar_t* IDC_LABEL_BLOCKED = L"IDC_LABEL_BLOCKED";
50 const wchar_t* IDC_BUTTON_MESSAGE = L"IDC_BUTTON_MESSAGE";
51 const wchar_t* IDC_SELECTALL = L"IDC_SELECTALL";
52 const wchar_t* IDC_BUTTON_CALL = L"IDC_BUTTON_CALL";
53 const wchar_t* IDC_LABEL_DETAIL_SELECTED = L"IDC_LABEL_DETAIL_SELECTED";
55 const int IDA_CALL_LOG_CALL = 201;
56 const int IDA_CALL_LOG_MESSAGE = 202;
57 const int IDA_FOOTER_BUTTON_LEFT = 203;
58 const int IDA_FOOTER_BUTTON_RIGHT = 204;
59 const int IDA_SELECT_ALL_CHECKED = 205;
60 const int IDA_SELECT_ALL_UNCHECKED = 206;
61 const int W_BUTTON = 48;
62 const int H_BUTTON = 48;
63 const int W_BLOCKED_ICON = 56;
64 const int H_BLOCKED_ICON = 56;
66 const wchar_t* FORMAT_STR = L"%ls (%d)";
68 static const unsigned int COLOR_DELAIL_LABEL_SELECTED = Color32<215, 225, 232, 255>::Value;
71 DlLogsDetailForm::DlLogsDetailForm(void)
73 __pDataProvider = new DlLogsDetailItemDataProvider();
77 __pButtonMessage = null;
78 __pButtonContactImage = null;
80 __pLabelNumber = null;
84 __isSelectAll = false;
85 __isPresentInContacts = false;
87 __selectedItemCount = 0;
88 __calllogListByNum = null;
91 __isMsgAppControlLaunched = false;
94 DlLogsDetailForm::~DlLogsDetailForm(void)
96 if (__pDataProvider != null)
98 delete __pDataProvider;
99 __pDataProvider = null;
104 DlLogsDetailForm::Initialize()
106 result r = Construct(IDL_CALL_LOG_DETAIL_FORM);
107 TryCatch(r == E_SUCCESS, , "DlLogsDetailForm::Initialize Fail to initialize Call log detail form");
115 DlLogsDetailForm::OnInitializing(void)
117 AppLog(" OnInitializing SceneManager::AddSceneEventListener()");
118 result r = E_SUCCESS;
119 Bitmap* pBitmap = null;
120 AppResource* pAppResource = App::GetInstance()->GetAppResource();
122 __pFormFooter = GetFooter();
123 if (__pFormFooter != null)
125 __pFormFooter->SetStyle(FOOTER_STYLE_BUTTON_TEXT);
126 __pFormFooter->SetBackButton();
127 __pFormFooter->AddActionEventListener(*this);
128 SetFormBackEventListener(this);
130 __pFooterItemDelete.Construct(IDA_FOOTER_BUTTON_LEFT);
131 __pFooterItemDelete.SetText(AppUtility::GetResourceString(IDS_CALLLOG_DELETE_FOOTER));
132 __pFormFooter->AddItem(__pFooterItemDelete);
134 __pFooterItemCancel.Construct(IDA_FOOTER_BUTTON_RIGHT);
135 __pFooterItemCancel.SetText(AppUtility::GetResourceString(IDS_CALLLOG_CANCEL_FOOTER));
138 __pButtonContactImage = static_cast<Button*>(GetControl(IDC_BUTTON_CONTACT_IMAGE));
139 if (__pButtonContactImage != null)
141 //todo: set image & show if present in contacts
142 __pButtonContactImage->SetShowState(false);
145 __pLabelName = static_cast<Label*>(GetControl(IDC_LABEL_NAME));
146 if (__pLabelName != null)
148 __pLabelName->SetTextColor(Color::GetColor(COLOR_ID_BLACK));
149 __pLabelName->SetTextConfig(50, LABEL_TEXT_STYLE_BOLD);
152 __pLabelNumber = static_cast<Label*>(GetControl(IDC_LABEL_NUMBER));
153 if (__pLabelNumber != null)
155 __pLabelNumber->SetTextColor(Color::GetColor(COLOR_ID_BLACK));
156 __pLabelNumber->SetTextConfig(32, LABEL_TEXT_STYLE_BOLD);
157 __pLabelNumber->SetTextColor(Color::GetColor(COLOR_ID_GREY));
160 __pLabelNumberUnsaved = static_cast<Label*>(GetControl(IDC_LABEL_NUMBER_UNSAVED));
161 if (__pLabelNumberUnsaved != null)
163 __pLabelNumberUnsaved->SetTextColor(Color::GetColor(COLOR_ID_BLACK));
164 __pLabelNumberUnsaved->SetTextConfig(50, LABEL_TEXT_STYLE_BOLD);
167 __pLabelBlocked = static_cast<Label*>(GetControl(IDC_LABEL_BLOCKED));
168 if (__pLabelBlocked != null)
170 __pLabelBlocked->SetShowState(false);
173 pBitmap = pAppResource->GetBitmapN(IDB_LOG_DETAIL_CALL_ICON ,BITMAP_PIXEL_FORMAT_ARGB8888);
174 pBitmap->Scale(Dimension(W_BUTTON, H_BUTTON));
175 __pButtonCall = static_cast<Button*>(GetControl(IDC_BUTTON_CALL));
176 if (__pButtonCall != null)
178 __pButtonCall->SetActionId(IDA_CALL_LOG_CALL);
179 __pButtonCall->SetNormalBitmap(Point(__pButtonCall->GetBounds().width / 2 - W_BUTTON / 2, __pButtonCall->GetBounds().height / 2 - H_BUTTON / 2), *pBitmap); //not working
180 __pButtonCall->SetPressedBitmap(Point(__pButtonCall->GetBounds().width / 2 - W_BUTTON / 2, __pButtonCall->GetBounds().height / 2 - H_BUTTON / 2), *pBitmap); //not working
181 __pButtonCall->AddActionEventListener(*this);
186 pBitmap = pAppResource->GetBitmapN(IDB_LOG_DETAIL_MSG_ICON ,BITMAP_PIXEL_FORMAT_ARGB8888);
187 pBitmap->Scale(Dimension(W_BUTTON, H_BUTTON));
189 __pButtonMessage = static_cast<Button*>(GetControl(IDC_BUTTON_MESSAGE));
190 if (__pButtonMessage != null)
192 __pButtonMessage->SetActionId(IDA_CALL_LOG_MESSAGE);
193 __pButtonMessage->SetNormalBitmap(Point(__pButtonMessage->GetBounds().width / 2 - W_BUTTON / 2, __pButtonMessage->GetBounds().height / 2 - H_BUTTON / 2), *pBitmap); //not working
194 __pButtonMessage->SetPressedBitmap(Point(__pButtonMessage->GetBounds().width / 2 - W_BUTTON / 2, __pButtonMessage->GetBounds().height / 2 - H_BUTTON / 2), *pBitmap); //not working
195 __pButtonMessage->AddActionEventListener(*this);
201 __pSelectAll = static_cast<CheckButton*>(GetControl(IDC_SELECTALL));
202 if(__pSelectAll != null)
204 __pSelectAll->SetActionId(IDA_SELECT_ALL_CHECKED, IDA_SELECT_ALL_UNCHECKED);
205 __pSelectAll->SetSize(GetClientAreaBounds().width, 112);
206 __pSelectAll->SetShowState(false);
207 __pSelectAll->AddActionEventListener(*this);
210 __pList = new (std::nothrow) ListView();
213 __listHeight = GetClientAreaBounds().height - __pButtonContactImage->GetBounds().height - __pButtonMessage->GetBounds().height - 40;
214 int listY = __pButtonContactImage->GetBounds().height + __pButtonMessage->GetBounds().height + 40;
215 __pList->Construct(Rectangle(0, listY, GetClientAreaBounds().width, __listHeight), true, SCROLL_STYLE_FADE_OUT);
217 r = AddControl(*__pList);
218 TryCatch(r == E_SUCCESS, , "call log detail list control not added");
221 __pSelectedLabel = static_cast<Label*>(GetControl(IDC_LABEL_DETAIL_SELECTED));
222 if(__pSelectedLabel != null)
224 SetControlAlwaysOnTop(*__pSelectedLabel,true);
225 __pSelectedLabel->SetBackgroundColor(COLOR_DELAIL_LABEL_SELECTED);
226 __pSelectedLabel->SetShowState(false);
234 DlLogsDetailForm::OnTerminating(void)
236 result r = E_SUCCESS;
242 DlLogsDetailForm::DeleteSelectedCalllog(void)
244 int checkedItemCount = 0;
245 CallLogDetails pCalllogInfo;
246 Tizen::Base::Collection::IListT<CallLogDetails>* pCalllogByNumberList;
247 //pCalllogByNumberList = __calllogListByNum->GetValuesN();
248 pCalllogByNumberList = __calllogListByNum->GetItemsN(0, __calllogListByNum->GetCount()); //to be verified
249 __calllogCount = pCalllogByNumberList->GetCount();
250 for(int index = 0; index < __calllogCount; index++)
252 pCalllogByNumberList->GetAt(index,pCalllogInfo);
253 AppLog(" info from Map list %d %d %s", pCalllogInfo.GetCalllogType(), pCalllogInfo.GetDuration(), pCalllogInfo.GetPhoneNumber());
254 if(__pList->IsItemChecked(index) == true )
257 __pCallMgr->DeleteCalllogByDbId(pCalllogInfo.GetCalllogDbId());
260 delete pCalllogByNumberList;
261 // return to call logs list if all items deleted
262 if (checkedItemCount == __calllogCount)
271 DlLogsDetailForm::OnActionPerformed(const Control& source, int actionId)
276 case IDA_CALL_LOG_CALL:
278 SceneManager* pSceneManager = SceneManager::GetInstance();
279 CallPresentationModel* pCallPresentor = CallPresentationModel::GetInstance();
280 //make an outgoing call with given number
281 String* contactTxt = new (std::nothrow) String(__number);
282 //switch to dialing outgoing call form
283 IList* pContact = new (std::nothrow) ArrayList(SingleObjectDeleter);
284 pContact->Add(contactTxt);
285 //Check if dialing an emergency call
286 bool isEmergencyCall = pCallPresentor->IsEmergencyNumber(*contactTxt, true);
289 pSceneManager->GoForward( ForwardSceneTransition( IDSCN_SCENE_OUT_EMERGENCYCALL), pContact);
293 pSceneManager->GoForward( ForwardSceneTransition(IDSCN_SCENE_OUTCALL), pContact);
298 case IDA_CALL_LOG_MESSAGE:
300 if(__isMsgAppControlLaunched == true)
302 //Message AppControl is already launched
307 __isMsgAppControlLaunched = true;
308 result r = E_SUCCESS;
310 extraData.Construct();
312 extraData.Add(new (std::nothrow) String(MESSAGE_TYPE), new (std::nothrow) String(MESSAGE_SMS_TYPE));
313 extraData.Add(new (std::nothrow) String(MESSAGE_TO), new (std::nothrow) String(__number));
315 AppControl* pAc = AppManager::FindAppControlN(PROVIDER_ID_MESSAGE, OPERATION_ID_COMPOSE);
318 r = pAc->Start(null, null, &extraData, this);
322 __isMsgAppControlLaunched = false;
326 extraData.RemoveAll(true);
330 case IDA_FOOTER_BUTTON_LEFT:
332 const wchar_t* pContact = __number.GetPointer();
333 int len = __number.GetLength() + 1;
334 char* pNumber = new (std::nothrow) char[len];
335 wcstombs(pNumber, pContact, len);
336 if (__isEditMode == false)
339 __calllogListByNum = __pCallMgr->GetCallogListByNumberFromDatabaseN(pNumber);
340 __pList->UpdateList();
341 __pList->Invalidate(false);
345 bool switchtoCallLogView = DeleteSelectedCalllog();
346 if (switchtoCallLogView == false)
348 __calllogListByNum = __pCallMgr->GetCallogListByNumberFromDatabaseN(pNumber);
355 SceneManager* pSceneManager = SceneManager::GetInstance();
356 pSceneManager->GoForward(ForwardSceneTransition(IDSCN_CALL_LOG, SCENE_TRANSITION_ANIMATION_TYPE_NONE,
357 SCENE_HISTORY_OPTION_NO_HISTORY));
365 case IDA_FOOTER_BUTTON_RIGHT:
371 case IDA_SELECT_ALL_UNCHECKED:
373 SetAllListItems(false);
374 __selectedItemCount = 0;
375 String selStr = AppUtility::GetResourceString(IDS_SELECT_CALL_LOG);
376 __pSelectedLabel->SetText(selStr);
377 __pSelectedLabel->Invalidate(false);
380 case IDA_SELECT_ALL_CHECKED:
382 SetAllListItems(true);
383 __selectedItemCount = __listItemCount;
385 String selItemStr = L"";
386 if(__selectedItemCount > 1)
388 selItemStr = AppUtility::GetResourceString(IDS_SELECTED_ITEMS_STRING);
392 selItemStr = AppUtility::GetResourceString(IDS_SELECTED_ITEM_STRING);
394 text.Format(100, selItemStr.GetPointer(), __listItemCount);
395 __pSelectedLabel->SetText(text);
396 __pSelectedLabel->Invalidate(false);
405 DlLogsDetailForm::GetUpdatedListFromDatabase(char* number)
407 if(__calllogListByNum != null)
409 AppLog(" list already present, UPDATE");
410 __calllogListByNum->RemoveAll();
411 delete __calllogListByNum;
414 __calllogListByNum = __pCallMgr->GetCallogListByNumberFromDatabaseN(number);
415 __calllogCount = __pCallMgr->GetCalllogCountByNumber();
419 DlLogsDetailForm::OnSceneActivatedN(const SceneId& previousSceneId, const SceneId& currentSceneId, IList* pArgs)
421 AppLog(" activated");
422 __pCallMgr = CallLogManager::GetInstance();
423 __isPresentInContacts = false;
424 __selectedItemCount =0;
425 __isMsgAppControlLaunched = false;
429 String* pNumberStr = static_cast<String*> (pArgs->GetAt(0));
430 __number.Append(*pNumberStr);
436 __pList->SetItemProvider(*__pDataProvider);
437 __pList->UpdateList();
442 DlLogsDetailForm::UpdateForm(void)
444 SettingsPresentationModel* pSettingsPresentationModel = SettingsPresentationModel::GetInstance();
445 bool isCallToBeRejected = pSettingsPresentationModel->IsCallToBeRejected(__number);
447 const wchar_t* pContact = __number.GetPointer();
448 int len = __number.GetLength() + 1;
449 char* pNumber = new (std::nothrow) char[len];
450 wcstombs(pNumber, pContact, len);
452 GetUpdatedListFromDatabase(pNumber);
456 Bitmap* pBitmap = null;
457 Addressbook* pAddressBook = AddressbookManager::GetInstance()->GetAddressbookN();
458 if (pAddressBook != null)
460 IList* pNumberContactsList = pAddressBook->SearchContactsByPhoneNumberN(__number);
461 if(pNumberContactsList != null)
463 Contact* pContact = static_cast<Contact*>(pNumberContactsList->GetAt(0));
466 IList* pPhoneNumberList = pContact->GetValuesN(CONTACT_MPROPERTY_ID_PHONE_NUMBERS);
467 if (pPhoneNumberList != null)
469 IEnumerator* pEnum = pPhoneNumberList->GetEnumeratorN();
470 while (E_SUCCESS == pEnum->MoveNext())
472 PhoneNumber* pPhoneNumber = (PhoneNumber*) pEnum->GetCurrent();
473 if(pPhoneNumber->GetPhoneNumber().Equals(__number) == true)
475 __isPresentInContacts = true;
480 pPhoneNumberList->RemoveAll(true);
481 delete pPhoneNumberList;
484 if(__isPresentInContacts == true)
486 __pLabelNumberUnsaved->SetShowState(false);
489 pContact->GetValue(CONTACT_PROPERTY_ID_DISPLAY_NAME, contactName);
490 //fetch person's photo
491 pBitmap = pContact->GetThumbnailN();
493 String contactNameStr;
494 contactNameStr.Format(100, FORMAT_STR,contactName.GetPointer(), __calllogCount);
495 __pLabelName->SetText(contactNameStr);
496 __pLabelName->Invalidate(false);
497 __pLabelNumber->SetText(__number);
498 __pLabelNumber->Invalidate(false);
499 __pLabelNumberUnsaved->SetShowState(false);
500 __pLabelBlocked->SetShowState(false);
501 __pLabelName->SetShowState(true);
502 __pLabelNumber->SetShowState(true);
503 //todo: set the contact button image
504 Canvas* pCanvas = null;
505 pCanvas = new (std::nothrow) Canvas();
506 pCanvas->Construct(Rectangle(0,0,__pButtonContactImage->GetBounds().width,__pButtonContactImage->GetBounds().height));
507 //set bitmap to button
510 pBitmap = AppUtility::GetBitmapFromResourcesN(L"C01-1_icon_contacts.png", W_CONTACT_BITMAP_ITEM, H_CONTACT_BITMAP_ITEM);
514 //scale bitmap to predefined size
515 pBitmap->SetScalingQuality(BITMAP_SCALING_QUALITY_MID);
516 pBitmap->Scale(Dimension(W_CONTACT_BITMAP_ITEM, H_CONTACT_BITMAP_ITEM));
519 pCanvas->DrawBitmap(Rectangle(Point(0, 0), Dimension(pBitmap->GetWidth(), pBitmap->GetHeight())), *pBitmap);
522 //TODO: chk whether the number is blocked and add icon in top right
523 if (isCallToBeRejected == true)
525 pBitmap = AppUtility::GetBitmapFromResourcesN(L"C01-4_icon_Blocked.png", W_BLOCKED_ICON, H_BLOCKED_ICON);
526 pCanvas->DrawBitmap(Rectangle(Point(86, 0), Dimension(pBitmap->GetWidth(), pBitmap->GetHeight())), *pBitmap);
530 Bitmap* pActualBgBmp = new Bitmap();
531 pActualBgBmp->Construct(*pCanvas, pCanvas->GetBounds());
532 __pButtonContactImage->SetNormalBackgroundBitmap(*pActualBgBmp);
533 __pButtonContactImage->SetShowState(true);
534 __pButtonContactImage->Invalidate(false);
539 pNumberContactsList->RemoveAll(true);
540 delete pNumberContactsList;
546 if (__isPresentInContacts == false)
548 __isPresentInContacts = false;
549 //not in contacts rearrage the icons
550 String contactNameStr;
551 contactNameStr.Format(100, FORMAT_STR,__number.GetPointer(), __calllogCount);
552 __pLabelNumberUnsaved->SetText(contactNameStr);
553 __pLabelNumberUnsaved->Invalidate(false);
554 __pLabelNumberUnsaved->SetShowState(true);
555 __pLabelName->SetShowState(false);
556 __pLabelNumber->SetShowState(false);
557 __pButtonContactImage->SetShowState(false);
559 if (isCallToBeRejected == true)
561 pBitmap = AppUtility::GetBitmapFromResourcesN(L"C01-4_icon_Blocked.png", W_BLOCKED_ICON, H_BLOCKED_ICON);
562 __pLabelBlocked->SetBackgroundBitmap(*pBitmap);
568 Canvas* pCanvas = null;
569 pCanvas = new (std::nothrow) Canvas();
570 pCanvas->Construct(Rectangle(0,0,__pLabelBlocked->GetBounds().width,__pButtonContactImage->GetBounds().height));
571 Bitmap* pActualBgBmp = new Bitmap();
572 pActualBgBmp->Construct(*pCanvas, pCanvas->GetBounds());
573 __pLabelBlocked->SetBackgroundBitmap(*pActualBgBmp);
577 __pLabelBlocked->Invalidate(false);
578 __pLabelBlocked->SetShowState(true);
580 if (__pDataProvider != null)
582 __pDataProvider->ResetDetailsList();
584 __pList->UpdateList();
585 __pList->Invalidate(false);
589 DlLogsDetailForm::OnSceneDeactivated(const SceneId& currentSceneId, const SceneId& nextSceneId)
591 if (__pDataProvider != null)
593 __pDataProvider->ResetDetailsList();
595 if (__pCallMgr != null)
603 DlLogsDetailForm::SetFormMode(bool editMode)
606 if (editMode == false)
608 __isEditMode = false;
609 __pSelectAll->SetShowState(false);
610 __pDataProvider->SetViewMode(false);
611 __pFormFooter->RemoveItemAt(1);
612 __pFormFooter->SetBackButton();
613 __pList->UpdateList();
614 if (__isPresentInContacts == false)
616 __pLabelBlocked->SetShowState(true);
617 __pLabelNumberUnsaved->SetShowState(true);
618 __pLabelName->SetShowState(false);
619 __pLabelNumber->SetShowState(false);
620 __pButtonContactImage->SetShowState(false);
624 __pLabelNumberUnsaved->SetShowState(false);
625 __pLabelBlocked->SetShowState(false);
626 __pLabelName->SetShowState(true);
627 __pLabelNumber->SetShowState(true);
628 __pButtonContactImage->SetShowState(true);
630 __pButtonCall->SetShowState(true);
631 __pButtonMessage->SetShowState(true);
632 int listY = __pButtonContactImage->GetBounds().height + __pButtonMessage->GetBounds().height + 40;
633 __pList->SetBounds(Rectangle(0, listY, GetClientAreaBounds().width, __listHeight));
634 __listItemCount = __pList->GetItemCount();
635 __pFormFooter->SetItemEnabled(0, true);
636 __pList->RemoveListViewItemEventListener(*this);
637 __pSelectAll->SetSelected(false);
638 __pSelectAll->Invalidate(false);
639 __pSelectedLabel->SetShowState(false);
640 __pSelectedLabel->Invalidate(false);
645 __pSelectAll->SetShowState(true);
646 __pDataProvider->SetViewMode(true);
647 __pFormFooter->AddItem(__pFooterItemCancel);
648 __pFormFooter->RemoveBackButton();
649 __pList->AddListViewItemEventListener(*this);
650 __pList->UpdateList();
652 if (__isPresentInContacts == false)
654 __pLabelBlocked->SetShowState(false);
655 __pLabelNumberUnsaved->SetShowState(false);
656 __pLabelName->SetShowState(false);
657 __pLabelNumber->SetShowState(false);
658 __pButtonContactImage->SetShowState(false);
662 __pLabelNumberUnsaved->SetShowState(false);
663 __pLabelBlocked->SetShowState(false);
664 __pLabelName->SetShowState(false);
665 __pLabelNumber->SetShowState(false);
666 __pButtonContactImage->SetShowState(false);
668 __pButtonCall->SetShowState(false);
669 __pButtonMessage->SetShowState(false);
670 __pList->SetBounds(GetClientAreaBounds().x, __pSelectAll->GetHeight(), GetClientAreaBounds().width, GetClientAreaBounds().height - (__pSelectAll->GetHeight()+__pSelectedLabel->GetHeight()));
671 __listItemCount = __pList->GetItemCount();
672 __pFormFooter->SetItemEnabled(0, false);
673 __selectedItemCount = 0;
674 String selStr = AppUtility::GetResourceString(IDS_SELECT_CALL_LOG);
675 __pSelectedLabel->SetText(selStr);
676 __pSelectedLabel->SetShowState(true);
677 __pSelectedLabel->Invalidate(false);
679 __pSelectAll->Invalidate(true);
684 DlLogsDetailForm::UnCheckAllItems(void)
687 for (; i <= __pList->GetItemCount(); i++)
689 __pList->SetItemChecked(i, 0);
691 __selectedItemCount = 0;
694 DlLogsDetailForm::SetAllListItems(bool checked)
697 __isSelectAll = checked;
698 for (; i <= __pList->GetItemCount(); i++)
700 __pList->SetItemChecked(i, checked);
702 __pList->UpdateList();
703 __pFormFooter->SetItemEnabled(0, checked);
704 __pFormFooter->Invalidate(false);
705 __pFormFooter->Draw();
708 DlLogsDetailForm::OnFormBackRequested(Form& source)
710 SceneManager* pSceneManager = SceneManager::GetInstance();
711 pSceneManager->GoForward(ForwardSceneTransition(IDSCN_CALL_LOG, SCENE_TRANSITION_ANIMATION_TYPE_NONE,
712 SCENE_HISTORY_OPTION_NO_HISTORY));
717 DlLogsDetailForm::OnListViewContextItemStateChanged(ListView& listView, int index, int elementId, ListContextItemStatus status)
723 DlLogsDetailForm::OnListViewItemLongPressed(ListView& listView, int index, int elementId, bool& invokeListViewItemCallback)
729 DlLogsDetailForm::OnListViewItemStateChanged(ListView& listView, int index, int elementId, ListItemStatus status)
732 if (status == LIST_ITEM_STATUS_CHECKED)
734 __selectedItemCount++;
736 else if (status == LIST_ITEM_STATUS_UNCHECKED)
738 __selectedItemCount--;
741 if (__selectedItemCount == __listItemCount)
743 __pSelectAll->SetSelected(true);
747 __pSelectAll->SetSelected(false);
749 __pSelectAll->Invalidate(false);
750 if (__selectedItemCount == 0)
752 __pFormFooter->SetItemEnabled(0, false);
753 String selStr = AppUtility::GetResourceString(IDS_SELECT_CALL_LOG);
754 __pSelectedLabel->SetText(selStr);
758 __pFormFooter->SetItemEnabled(0, true);
759 String selItemStr = L"";
760 if(__selectedItemCount > 1)
762 selItemStr = AppUtility::GetResourceString(IDS_SELECTED_ITEMS_STRING);
766 selItemStr = AppUtility::GetResourceString(IDS_SELECTED_ITEM_STRING);
768 text.Format(100, selItemStr.GetPointer(), __selectedItemCount);
769 __pSelectedLabel->SetText(text);
771 __pFormFooter->Draw();
772 __pSelectedLabel->Invalidate(false);
776 DlLogsDetailForm::OnListViewItemSwept(ListView& listView, int index, SweepDirection direction)
782 DlLogsDetailForm::OnAppControlCompleteResponseReceived(const AppId& appId, const String& operationId, AppCtrlResult appControlResult, const IMap* pExtraData)
784 if (__isMsgAppControlLaunched == true)
786 //Message AppControl request completed.
787 __isMsgAppControlLaunched = false;