3 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
5 // Licensed under the Flora License, Version 1.0 (the License);
6 // you may not use this file except in compliance with the License.
7 // You may obtain a copy of the License at
9 // http://floralicense.org/license/
11 // Unless required by applicable law or agreed to in writing, software
12 // distributed under the License is distributed on an AS IS BASIS,
13 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 // See the License for the specific language governing permissions and
15 // limitations under the License.
19 /*@file: IntEditHistoryListForm
20 *@brief: This class defines EditHistoryListForm used to edit the history scene
24 #include <FAppUiApp.h>
26 #include "IntCommonLib.h"
27 #include "IntEditHistoryListForm.h"
28 #include "IntFaviconManager.h"
29 #include "IntHistoryPresentationModel.h"
30 #include "IntNotificationPanel.h"
31 #include "IntSceneRegister.h"
34 using namespace Tizen::App;
35 using namespace Tizen::Base;
36 using namespace Tizen::Base::Collection;
37 using namespace Tizen::Base::Runtime;
38 using namespace Tizen::Locales;
39 using namespace Tizen::Graphics;
40 using namespace Tizen::Ui;
41 using namespace Tizen::Ui::Controls;
42 using namespace Tizen::Ui::Scenes;
44 const int EditHistoryListForm::IDA_TABBAR_ITEM_1 = 101;
45 const int EditHistoryListForm::IDA_TABBAR_ITEM_2 = 102;
46 const int EditHistoryListForm::IDA_BUTTON_NEXT_FORM = 103;
47 const int EditHistoryListForm::IDA_FORMAT_ICON = 104;
48 const int EditHistoryListForm::IDA_FORMAT_TITLE = 105;
49 const int EditHistoryListForm::IDA_FORMAT_URL = 106;
50 const int EditHistoryListForm::IDA_SELECT_ALL_CHECKED = 107;
51 const int EditHistoryListForm::IDA_SELECT_ALL_UNCHECKED = 108;
52 const int EditHistoryListForm::IDA_DELETE_HISTORY = 109;
53 const int EditHistoryListForm::IDA_CANCEL = 110;
56 EditHistoryListForm::EditHistoryListForm(void)
60 ,__pSelectAllCheck(null)
61 ,__pSelectedLabel(null)
63 ,__isNoHistoryPresent(true)
67 EditHistoryListForm::~EditHistoryListForm(void)
69 AppLog("EditHistoryListForm::~EditHistoryListForm called");
71 if (__pGroupData != null)
73 AppLog("removing __pGroupData");
74 __pGroupData->RemoveAll(true);
80 EditHistoryListForm::Initialize(void)
82 Construct(L"IDL_EDIT_HISTORY_LIST");
88 EditHistoryListForm::OnInitializing(void)
92 SetFormBackEventListener(this);
94 AppLogDebug("EditHistoryListForm::OnInitializing");
95 SetFormStyle(FORM_STYLE_NORMAL | FORM_STYLE_INDICATOR | FORM_STYLE_HEADER | FORM_STYLE_FOOTER);
97 Header* pHeader = GetHeader();
104 pHeader->SetTitleText(CommonUtil::GetString("IDS_BR_SK_DELETE_ABB"));
106 GetFooter()->AddActionEventListener(*this);
107 AddOrientationEventListener(*this);
109 SceneManager::GetInstance()->AddSceneEventListener(IDSCN_EDIT_HISTORY_LIST, *this);
110 __pSelectedLabel = static_cast< Label* >(GetControl(L"IDC_LABEL1"));
112 if (__pSelectedLabel == null)
116 String selectedText = CommonUtil::GetString(L"IDS_COM_OPT_SELECTED") + "(0)";
117 __pSelectedLabel->SetText(selectedText);
119 __pSelectAllCheck = static_cast< CheckButton* >(GetControl(L"IDC_SELECT_ALL",true));
121 if (__pSelectAllCheck != null)
123 __pSelectAllCheck->SetActionId(IDA_SELECT_ALL_CHECKED, IDA_SELECT_ALL_UNCHECKED);
124 __pSelectAllCheck->AddActionEventListener(*this);
131 __pListView = static_cast< GroupedListView* >(GetControl(L"IDC_GROUPEDLISTVIEW1"));
132 if( __pListView != NULL)
134 __pListView->SetItemProvider(*this);
135 __pListView->AddGroupedListViewItemEventListener(*this);
142 __pTimer = new (std::nothrow) Timer();
143 r = __pTimer->Construct(*this);
149 EditHistoryListForm::OnTerminating(void)
151 result r = E_SUCCESS;
157 EditHistoryListForm::OnActionPerformed(const Tizen::Ui::Control& source, int actionId)
159 String selectedText = CommonUtil::GetString(L"IDS_COM_OPT_SELECTED");
160 SceneManager* pSceneManager = SceneManager::GetInstance();
162 if (pSceneManager == null)
169 case IDA_TABBAR_ITEM_1:
171 result r = pSceneManager->GoBackward(BackwardSceneTransition());
174 AppLogDebug("EditHistoryListForm::OnActionPerformed Failed to GoBackward %s",GetErrorMessage(r));
180 case IDA_SELECT_ALL_CHECKED:
182 int selectedCount = 0;
183 for (int groupIndex = 0 ; __pGroupData != null && groupIndex < __pGroupData->GetCount() ; groupIndex ++)
185 GroupItemClass* pGClass = dynamic_cast< GroupItemClass* >(__pGroupData->GetAt(groupIndex));
190 for (int itemIndex = 0 ; itemIndex < pGClass->__pData->GetCount() ; itemIndex ++)
193 __pListView->SetItemChecked(groupIndex,itemIndex,true);
196 selectedText.Append(L"(");
197 selectedText.Append(selectedCount);
198 selectedText.Append(L")");
199 __selectedCount = selectedCount;
201 __pSelectedLabel->SetText(selectedText);
202 __pSelectedLabel->Invalidate(true);
204 GetFooter()->SetItemEnabled(0, true);
205 GetFooter()->Invalidate(true);
207 __pListView->Invalidate(true);
211 case IDA_SELECT_ALL_UNCHECKED:
213 for (int groupIndex = 0 ; __pGroupData != null && groupIndex < __pGroupData->GetCount() ; groupIndex ++)
215 GroupItemClass* pGroupItemClass = dynamic_cast< GroupItemClass* >(__pGroupData->GetAt(groupIndex));
216 if(pGroupItemClass == null)
220 for (int itemIndex = 0 ; itemIndex < pGroupItemClass->__pData->GetCount() ; itemIndex ++)
222 __pListView->SetItemChecked(groupIndex,itemIndex,false);
225 selectedText.Append(L"(0)");
226 __pSelectedLabel->SetText(selectedText);
228 __pSelectedLabel->Invalidate(true);
230 GetFooter()->SetItemEnabled(0, false);
231 GetFooter()->Invalidate(true);
233 __pListView->Invalidate(true);
236 case IDA_DELETE_HISTORY:
239 ArrayList* pArrayList = new(std::nothrow) ArrayList();
244 pArrayList->Construct();
245 for (int groupIndex = 0 ; __pGroupData != null && groupIndex < __pGroupData->GetCount() ; groupIndex ++)
247 GroupItemClass* pGroupItemClass = dynamic_cast< GroupItemClass* >(__pGroupData->GetAt(groupIndex));
249 if (pGroupItemClass == null || pGroupItemClass->__pData == null)
251 AppLogDebug(" pGroupItemClass || __pData is null");
254 itemCount = pGroupItemClass->__pData->GetCount();
255 for (int itemIndex = 0 ; itemIndex < itemCount ; itemIndex++)
257 bool ret = __pListView->IsItemChecked(groupIndex,itemIndex);
262 AppLog("deleting history for groupId %d, item %d",groupIndex,itemIndex);
264 History* pHistory = dynamic_cast< History* >(pGroupItemClass->__pData->GetAt(itemIndex));
269 pArrayList->Add(*new(std::nothrow) String(pHistory->GetHistoryId()));
274 HistoryPresentationModel::GetInstance()->DeleteMultipleHistory(pArrayList);
276 if (pArrayList != null)
278 pArrayList->RemoveAll(true);
282 if(__pGroupData != null)
284 groupCount = __pGroupData->GetCount();
286 for(int groupIndex = 0 ; groupIndex < groupCount ; groupIndex ++ )
288 counter = __pListView->GetItemCountAt(groupIndex);
290 for(int index = 0 ; index < counter ; index++)
292 if(__pListView->IsItemChecked( groupIndex,index ) == true)
294 __pListView->SetItemChecked(groupIndex,index,false);
302 __pSelectAllCheck->SetSelected(false);
304 GetFooter()->SetItemEnabled(0,false);
305 GetFooter()->Invalidate(true);
306 selectedText.Append(L"(0)");
307 __pSelectedLabel->SetText(selectedText);
309 __pSelectedLabel->Invalidate(true);
310 if (__pListView != null)
312 __pListView->UpdateList();
315 NotificationPanel* pNotification = new (std::nothrow) NotificationPanel(*this);
316 String notification = CommonUtil::GetString(L"IDS_BR_POP_DELETED");
317 pNotification->SetText(notification);
318 pNotification->ShowNotification();
323 if( __pTimer != NULL)
327 result r = pSceneManager->GoBackward(BackwardSceneTransition(IDSCN_HISTORY_LIST, SCENE_TRANSITION_ANIMATION_TYPE_RIGHT));
330 AppLogDebug("EditHistoryListForm::OnActionPerformed Failed to GoBackward %s",GetErrorMessage(r));
343 EditHistoryListForm::OnFormBackRequested(Tizen::Ui::Controls::Form& source)
345 SceneManager* pSceneManager = SceneManager::GetInstance();
347 if (pSceneManager == null)
352 result r = pSceneManager->GoBackward(BackwardSceneTransition(IDSCN_HISTORY_LIST, SCENE_TRANSITION_ANIMATION_TYPE_RIGHT));
355 AppLogDebug("EditHistoryListForm::OnFormBackRequested Failed to GoBackward %s",GetErrorMessage(r));
361 EditHistoryListForm::CreateGroupItem(int groupIndex, int itemWidth)
363 AppLogDebug("EditHistoryListForm::CreateGroupItem");
364 result r = E_FAILURE;
368 GroupItem* pItem = null;
371 GroupItemClass* pGroupItemClass = dynamic_cast< GroupItemClass* >(__pGroupData->GetAt(groupIndex));
372 if(pGroupItemClass == null)
374 pItem = new(std::nothrow) GroupItem();
381 if ( pGroupItemClass->__pData == null || pGroupItemClass->__pData->GetCount() == 0)
383 r = pItem->Construct(Dimension(itemWidth, 0));
387 r = pItem->Construct(Dimension(itemWidth, 48));
390 text = pGroupItemClass->__titleText;
394 if (pGroupItemClass->__titleText == L"Today" || pGroupItemClass->__titleText == L"Yesterday")
396 Calendar* pGregorianCalendar = Calendar::CreateInstanceN(CALENDAR_GREGORIAN);
397 if (pGregorianCalendar != NULL)
399 pGregorianCalendar->SetTimeField(TIME_FIELD_YEAR, pGroupItemClass->__startTime.GetYear());
400 pGregorianCalendar->SetTimeField(TIME_FIELD_MONTH, pGroupItemClass->__startTime.GetMonth());
401 pGregorianCalendar->SetTimeField(TIME_FIELD_DAY_OF_MONTH, pGroupItemClass->__startTime.GetDay());
402 dayOfWeek = pGregorianCalendar->GetTimeField(TIME_FIELD_DAY_OF_WEEK);
404 if (pGregorianCalendar != NULL)
406 delete pGregorianCalendar;
440 if (pGroupItemClass->__titleText != L"Older")
442 text.Append(pGroupItemClass->__startTime.GetDay());
444 strMonth = pGroupItemClass->__startTime.GetMonth();
445 month = GetMonth(strMonth);
453 if (pGroupItemClass->__titleText == L"Last week" || pGroupItemClass->__titleText == L"Two weeks ago" || pGroupItemClass->__titleText == L"Three weeks ago" || pGroupItemClass->__titleText == L"Four weeks ago" || pGroupItemClass->__titleText == L"Last month" || pGroupItemClass->__titleText == L"Older")
456 text.Append(pGroupItemClass->__endTime.GetDay());
458 strMonth = pGroupItemClass->__endTime.GetMonth();
459 month = GetMonth(strMonth);
464 AppLogDebug("startTime day = %d month = %d year = %d",pGroupItemClass->__startTime.GetDay(),pGroupItemClass->__startTime.GetMonth(),pGroupItemClass->__startTime.GetYear());
466 pItem->SetElement(text, null);
467 pItem->SetTextSize(32);
473 EditHistoryListForm::CreateItem(int groupIndex, int itemIndex, int itemWidth)
475 AppLogDebug("EditHistoryListForm::CreateItem");
476 result r = E_FAILURE;
477 const int bookmarkBtnWidth = 64;
479 if (__pGroupData == null)
484 CustomItem* pItem = new(std::nothrow) CustomItem();
489 GroupItemClass* pGroupItemClass = dynamic_cast< GroupItemClass* >(__pGroupData->GetAt(groupIndex));
491 if (pGroupItemClass == null)
497 History* pHistory = dynamic_cast< History* >(pGroupItemClass->__pData->GetAt(itemIndex));
498 if ( pHistory == NULL )
503 Bitmap* pBitmap = null;
505 r = pItem->Construct(Tizen::Graphics::Dimension(itemWidth, 128), LIST_ANNEX_STYLE_MARK);
507 bitmapId = pHistory->GetFaviconId();
509 pBitmap = FaviconManager::GetInstance()->GetFaviconN(bitmapId);
512 pBitmap = FaviconManager::GetInstance()->GetDefaultFaviconN();
517 pItem->AddElement(Rectangle(16, 26, 60, 60), IDA_FORMAT_ICON, *pBitmap, null);
520 r = pItem->AddElement(Rectangle(92, 4, GetClientAreaBounds().width - 96 - 32 -64 -32, 60), IDA_FORMAT_TITLE, pHistory->GetHistoryTitle(), 44,CUSTOM_COLOR_TRANSPARENT,CUSTOM_COLOR_TRANSPARENT,CUSTOM_COLOR_TRANSPARENT,true);
524 AppLogException("CreateItem failed with %s", GetErrorMessage(r));
528 pItem->AddElement(Rectangle(92, 68, GetClientAreaBounds().width - 108 - 32 - bookmarkBtnWidth - 32, 52), IDA_FORMAT_URL, pHistory->GetHistoryUrl(),32,CUSTOM_COLOR_GREY,CUSTOM_COLOR_GREY,CUSTOM_COLOR_GREY,true);
534 EditHistoryListForm::DeleteGroupItem(int groupIndex, GroupItem* pItem, int itemWidth)
537 AppLogDebug("EditHistoryListForm::DeleteGroupItem");
539 if (__pGroupData == null)
552 EditHistoryListForm::DeleteItem(int groupIndex, int itemIndex, ListItemBase* pItem, int itemWidth)
555 if (__pGroupData == null)
560 GroupItemClass* pGroupItemClass = dynamic_cast< GroupItemClass* >(__pGroupData->GetAt(groupIndex));
561 if (pGroupItemClass == null)
572 EditHistoryListForm::GetGroupCount(void)
574 AppLogDebug("EditHistoryListForm::GetGroupCount");
576 __isNoHistoryPresent = true;
581 HistoryPresentationModel::GetInstance()->GetHistoryCount(count);
584 __isNoHistoryPresent = false;
585 AppLogDebug("the value of isNoHistoryPresent %d",__isNoHistoryPresent);
586 __pTimer->Start(1000);
587 __pSelectAllCheck->SetShowState(false);
588 __pSelectedLabel->SetShowState(false);
592 __isNoHistoryPresent = true;
593 __pSelectAllCheck->SetShowState(true);
594 __pSelectedLabel->SetShowState(true);
596 __pSelectAllCheck->Invalidate(true);
597 __pSelectedLabel->Invalidate(false);
598 GetFooter()->Invalidate(true);
600 if (__pGroupData != null)
602 AppLogDebug("GetGroupCount returning %d",__pGroupData->GetCount());
603 count = __pGroupData->GetCount();
607 AppLogDebug("GetGroupCount returning 0");
615 EditHistoryListForm::GetItemCount(int groupIndex)
617 AppLogDebug("EditHistoryListForm::GetItemCount");
618 result r = E_FAILURE;
621 if (__pGroupData == null)
623 AppLogDebug("EditHistoryListForm::GetItemCount returning 0");
627 GroupItemClass* pGroupItemClass = dynamic_cast< GroupItemClass* >(__pGroupData->GetAt(groupIndex));
629 if (pGroupItemClass == null)
631 AppLogDebug("EditHistoryListForm::GetItemCount returning 0");
636 r = HistoryPresentationModel::GetInstance()->GetHistoryCountWithTimeRange(pGroupItemClass->__startTime,pGroupItemClass->__endTime,count);
640 AppLogDebug("EditHistoryListForm::GetItemCount returning 0");
644 if (pGroupItemClass->__pData != null)
646 pGroupItemClass->__pData->RemoveAll(true);
647 delete pGroupItemClass->__pData;
649 pGroupItemClass->__pData = new(std::nothrow) Collection::ArrayList();
650 pGroupItemClass->__pData->Construct();
651 AppLog("Starttime %ls endtime %ls",pGroupItemClass->__startTime.ToString().GetPointer(),pGroupItemClass->__endTime.ToString().GetPointer());
652 HistoryPresentationModel::GetInstance()->GetHistoryWithTimeRange(pGroupItemClass->__startTime,pGroupItemClass->__endTime, 0, count, *pGroupItemClass->__pData);
653 AppLogDebug("Count = %d ", count);
655 if (__pGroupData == null)
657 AppLogDebug("EditHistoryListForm::GetItemCount returning 0");
663 if (pGroupItemClass == null || pGroupItemClass->__pData == null)
665 AppLogDebug("EditHistoryListForm::GetItemCount returning 0");
670 AppLogDebug("EditHistoryListForm::GetItemCount returning %d for %d title %ls",pGroupItemClass->__pData->GetCount(),groupIndex,pGroupItemClass->__titleText.GetPointer());
671 return pGroupItemClass->__pData->GetCount();
676 EditHistoryListForm::OnSceneActivatedN(const Tizen::Ui::Scenes::SceneId& previousSceneId,
677 const Tizen::Ui::Scenes::SceneId& currentSceneId, Tizen::Base::Collection::IList* pArgs)
679 AppLogDebug("EditHistoryListForm::OnSceneActivatedN");
683 if(__pGroupData != null)
685 groupCount = __pGroupData->GetCount();
687 for(int groupIndex = 0 ; groupIndex < groupCount ; groupIndex ++ )
689 count = __pListView->GetItemCountAt(groupIndex);
691 for(int index = 0 ; index < count ; index++)
693 if(__pListView->IsItemChecked( groupIndex,index ) == true)
695 __pListView->SetItemChecked(groupIndex,index,false);
700 if (__pListView != null)
702 __pListView->UpdateList();
704 __pSelectAllCheck->SetSelected(false);
706 GetFooter()->SetItemEnabled(0, false);
711 EditHistoryListForm::OnSceneDeactivated(const Tizen::Ui::Scenes::SceneId& currentSceneId,
712 const Tizen::Ui::Scenes::SceneId& nextSceneId)
714 AppLogDebug("EditHistoryListForm::OnSceneDeactivated");
718 EditHistoryListForm::OnGroupedListViewContextItemStateChanged(Tizen::Ui::Controls::GroupedListView& listView, int groupIndex, int itemIndex, int elementId, Tizen::Ui::Controls::ListContextItemStatus status)
724 EditHistoryListForm::OnGroupedListViewItemStateChanged(Tizen::Ui::Controls::GroupedListView& listView, int groupIndex, int itemIndex, int elementId, Tizen::Ui::Controls::ListItemStatus status)
726 AppLogDebug("EditHistoryListForm::OnGroupedListViewItemStateChanged entered");
727 String selectedText = CommonUtil::GetString(L"IDS_COM_OPT_SELECTED");
730 if (status == LIST_ITEM_STATUS_UNCHECKED)
739 if (__selectedCount == 0)
741 GetFooter()->SetItemEnabled(0,false);
745 GetFooter()->SetItemEnabled(0,true);
747 GetFooter()->Invalidate(true);
749 selectedText.Append(L"(");
750 selectedText.Append(__selectedCount);
751 selectedText.Append(L")");
753 __pSelectedLabel->SetText(selectedText);
754 __pSelectedLabel->Invalidate(true);
756 if (status == LIST_ITEM_STATUS_UNCHECKED)
758 __pSelectAllCheck->SetSelected(false);
760 else if (status == LIST_ITEM_STATUS_CHECKED && __pSelectAllCheck->IsSelected() == false && __pGroupData != null)
762 int itemCount = __pGroupData->GetCount();
763 for (int groupIndex = 0 ; groupIndex < itemCount ; groupIndex ++)
765 GroupItemClass* pGClass = (dynamic_cast< GroupItemClass* >(__pGroupData->GetAt(groupIndex)));
770 for (int itemIndex = 0 ; itemIndex < pGClass->__pData->GetCount() ; itemIndex ++)
772 bool ret = __pListView->IsItemChecked(groupIndex,itemIndex);
776 __pSelectAllCheck->SetSelected(false);
781 __pSelectAllCheck->SetSelected(true);
787 EditHistoryListForm::OnGroupedListViewItemSwept(Tizen::Ui::Controls::GroupedListView& listView, int groupIndex, int itemIndex, Tizen::Ui::Controls::SweepDirection direction)
793 EditHistoryListForm::GetMonth(int month)
799 monthValue.Append(CommonUtil::GetString(L"IDS_COM_BODY_JAN"));;
802 monthValue.Append(CommonUtil::GetString(L"IDS_COM_BODY_FEB"));;
805 monthValue.Append(CommonUtil::GetString(L"IDS_COM_BODY_MAR"));;
808 monthValue.Append(CommonUtil::GetString(L"IDS_COM_BODY_APR"));;
811 monthValue.Append(CommonUtil::GetString(L"IDS_COM_BODY_MAY"));;
814 monthValue.Append(CommonUtil::GetString(L"IDS_COM_BODY_JUN"));;
817 monthValue.Append(CommonUtil::GetString(L"IDS_COM_BODY_JUL"));;
820 monthValue.Append(CommonUtil::GetString(L"IDS_COM_BODY_AUG"));;
823 monthValue.Append(CommonUtil::GetString(L"IDS_COM_BODY_SEP"));;
826 monthValue.Append(CommonUtil::GetString(L"IDS_COM_BODY_OCT"));;
829 monthValue.Append(CommonUtil::GetString(L"IDS_COM_BODY_NOV"));;
832 monthValue.Append(CommonUtil::GetString(L"IDS_COM_BODY_DEC"));;
842 EditHistoryListForm::CreateGroupItems(void)
844 AppLogDebug("EditHistoryListForm::createGroupItems entered");
845 if (__pGroupData != null)
847 __pGroupData->RemoveAll(true);
852 if (__pGroupData == null)
854 __pGroupData = new(std::nothrow) Collection::ArrayList();
855 __pGroupData->Construct();
858 DateTime currentTime;
860 HistoryPresentationModel::GetCurrentDateTime(currentTime);
861 GroupItemClass* pGroupItemClass = new(std::nothrow) GroupItemClass();
862 pGroupItemClass->__titleText = CommonUtil::GetString(L"IDS_COM_BODY_TODAY");
863 pGroupItemClass->__endTime = currentTime;
864 pGroupItemClass->__startTime.SetValue(currentTime.GetYear(),currentTime.GetMonth(), currentTime.GetDay());
865 __pGroupData->Add(*pGroupItemClass);
867 Calendar* pGregorianCalendar = Calendar::CreateInstanceN(CALENDAR_GREGORIAN);
869 if (pGregorianCalendar != NULL)
871 pGregorianCalendar->SetTimeField(TIME_FIELD_YEAR, currentTime.GetYear());
872 pGregorianCalendar->SetTimeField(TIME_FIELD_MONTH, currentTime.GetMonth());
873 pGregorianCalendar->SetTimeField(TIME_FIELD_DAY_OF_MONTH, currentTime.GetDay());
874 dayOfWeek = pGregorianCalendar->GetTimeField(TIME_FIELD_DAY_OF_WEEK);
875 delete pGregorianCalendar;
882 pGroupItemClass = new(std::nothrow) GroupItemClass();
883 pGroupItemClass->__titleText = CommonUtil::GetString(L"IDS_EMAIL_BODY_LAST_WEEK");
884 pGroupItemClass->__endTime.SetValue(currentTime.GetYear(),currentTime.GetMonth(), currentTime.GetDay());
885 pGroupItemClass->__startTime.SetValue(currentTime.GetYear(),currentTime.GetMonth(), 1);
886 pGroupItemClass->__startTime.AddDays(currentTime.GetDay() - 6 - 1);
887 __pGroupData->Add(*pGroupItemClass);
891 pGroupItemClass = new(std::nothrow) GroupItemClass();
892 pGroupItemClass->__titleText = CommonUtil::GetString(L"IDS_EMAIL_BODY_LAST_WEEK");
893 pGroupItemClass->__endTime.SetValue(currentTime.GetYear(),currentTime.GetMonth(), currentTime.GetDay());
894 pGroupItemClass->__startTime.SetValue(currentTime.GetYear(),currentTime.GetMonth(), 1);
895 pGroupItemClass->__startTime.AddDays(currentTime.GetDay() - 7 - 1);
896 __pGroupData->Add(*pGroupItemClass);
900 pGroupItemClass = new(std::nothrow) GroupItemClass();
901 pGroupItemClass->__titleText = CommonUtil::GetString(L"IDS_COM_BODY_YESTERDAY");
902 pGroupItemClass->__endTime.SetValue(currentTime.GetYear(),currentTime.GetMonth(), currentTime.GetDay());
903 pGroupItemClass->__startTime.SetValue(currentTime.GetYear(),currentTime.GetMonth(), 1);
904 pGroupItemClass->__startTime.AddDays(currentTime.GetDay() - 1 - 1);
905 __pGroupData->Add(*pGroupItemClass);
906 pGroupItemClass = new(std::nothrow) GroupItemClass();
907 pGroupItemClass->__titleText = CommonUtil::GetString(L"IDS_EMAIL_BODY_LAST_WEEK");
908 pGroupItemClass->__endTime.SetValue(currentTime.GetYear(),currentTime.GetMonth(), 1);
909 pGroupItemClass->__endTime.AddDays(currentTime.GetDay() - 1 - 1);
910 pGroupItemClass->__startTime.SetValue(currentTime.GetYear(),currentTime.GetMonth(), 1);
911 pGroupItemClass->__startTime.AddDays(currentTime.GetDay() - 8 - 1);
912 __pGroupData->Add(*pGroupItemClass);
916 pGroupItemClass = new(std::nothrow) GroupItemClass();
917 pGroupItemClass->__titleText = CommonUtil::GetString(L"IDS_COM_BODY_YESTERDAY");
918 pGroupItemClass->__endTime.SetValue(currentTime.GetYear(),currentTime.GetMonth(), currentTime.GetDay());
919 pGroupItemClass->__startTime.SetValue(currentTime.GetYear(),currentTime.GetMonth(), 1);
920 pGroupItemClass->__startTime.AddDays(currentTime.GetDay() - 1 - 1);
921 __pGroupData->Add(*pGroupItemClass);
923 pGroupItemClass = new(std::nothrow) GroupItemClass();
924 pGroupItemClass->__titleText = CommonUtil::GetString(L"IDS_COM_BODY_MON");
925 pGroupItemClass->__endTime.SetValue(currentTime.GetYear(),currentTime.GetMonth(), 1);
926 pGroupItemClass->__endTime.AddDays(currentTime.GetDay() - 1 - 1);
927 pGroupItemClass->__startTime.SetValue(currentTime.GetYear(),currentTime.GetMonth(), 1);
928 pGroupItemClass->__startTime.AddDays(currentTime.GetDay() - 2 - 1);
929 __pGroupData->Add(*pGroupItemClass);
931 pGroupItemClass = new(std::nothrow) GroupItemClass();
932 pGroupItemClass->__titleText = CommonUtil::GetString(L"IDS_EMAIL_BODY_LAST_WEEK");
933 pGroupItemClass->__endTime.SetValue(currentTime.GetYear(),currentTime.GetMonth(), 1);
934 pGroupItemClass->__endTime.AddDays(currentTime.GetDay() - 2 - 1);
935 pGroupItemClass->__startTime.SetValue(currentTime.GetYear(),currentTime.GetMonth(), 1);
936 pGroupItemClass->__startTime.AddDays(currentTime.GetDay() - 9 - 1);
937 __pGroupData->Add(*pGroupItemClass);
941 pGroupItemClass = new(std::nothrow) GroupItemClass();
942 pGroupItemClass->__titleText = CommonUtil::GetString(L"IDS_COM_BODY_YESTERDAY");
943 pGroupItemClass->__endTime.SetValue(currentTime.GetYear(),currentTime.GetMonth(), currentTime.GetDay());
944 pGroupItemClass->__startTime.SetValue(currentTime.GetYear(),currentTime.GetMonth(), 1);
945 pGroupItemClass->__startTime.AddDays(currentTime.GetDay() - 1 - 1);
946 __pGroupData->Add(*pGroupItemClass);
948 pGroupItemClass = new(std::nothrow) GroupItemClass();
949 pGroupItemClass->__titleText = CommonUtil::GetString(L"IDS_COM_BODY_TUE");
950 pGroupItemClass->__endTime.SetValue(currentTime.GetYear(),currentTime.GetMonth(), 1);
951 pGroupItemClass->__endTime.AddDays(currentTime.GetDay() - 1 - 1);
952 pGroupItemClass->__startTime.SetValue(currentTime.GetYear(),currentTime.GetMonth(), 1);
953 pGroupItemClass->__startTime.AddDays(currentTime.GetDay() - 2 - 1);
954 __pGroupData->Add(*pGroupItemClass);
956 pGroupItemClass = new(std::nothrow) GroupItemClass();
957 pGroupItemClass->__titleText = CommonUtil::GetString(L"IDS_COM_BODY_MON");
958 pGroupItemClass->__endTime.SetValue(currentTime.GetYear(),currentTime.GetMonth(), 1);
959 pGroupItemClass->__endTime.AddDays(currentTime.GetDay() - 2 - 1);
960 pGroupItemClass->__startTime.SetValue(currentTime.GetYear(),currentTime.GetMonth(), 1);
961 pGroupItemClass->__startTime.AddDays(currentTime.GetDay() - 3 - 1);
962 __pGroupData->Add(*pGroupItemClass);
964 pGroupItemClass = new(std::nothrow) GroupItemClass();
965 pGroupItemClass->__titleText = CommonUtil::GetString(L"IDS_EMAIL_BODY_LAST_WEEK");
966 pGroupItemClass->__endTime.SetValue(currentTime.GetYear(),currentTime.GetMonth(), 1);
967 pGroupItemClass->__endTime.AddDays(currentTime.GetDay() - 3 - 1);
968 pGroupItemClass->__startTime.SetValue(currentTime.GetYear(),currentTime.GetMonth(), 1);
969 pGroupItemClass->__startTime.AddDays(currentTime.GetDay() - 10 - 1);
970 __pGroupData->Add(*pGroupItemClass);
974 pGroupItemClass = new(std::nothrow) GroupItemClass();
975 pGroupItemClass->__titleText = CommonUtil::GetString(L"IDS_COM_BODY_YESTERDAY");
976 pGroupItemClass->__endTime.SetValue(currentTime.GetYear(),currentTime.GetMonth(), currentTime.GetDay());
977 pGroupItemClass->__startTime.SetValue(currentTime.GetYear(),currentTime.GetMonth(), 1);
978 pGroupItemClass->__startTime.AddDays(currentTime.GetDay() - 1 - 1);
979 __pGroupData->Add(*pGroupItemClass);
981 pGroupItemClass = new(std::nothrow) GroupItemClass();
982 pGroupItemClass->__titleText = CommonUtil::GetString(L"IDS_COM_BODY_WED");
983 pGroupItemClass->__endTime.SetValue(currentTime.GetYear(),currentTime.GetMonth(), 1);
984 pGroupItemClass->__endTime.AddDays(currentTime.GetDay() - 1 - 1);
985 pGroupItemClass->__startTime.SetValue(currentTime.GetYear(),currentTime.GetMonth(), 1);
986 pGroupItemClass->__startTime.AddDays(currentTime.GetDay() - 2 - 1);
987 __pGroupData->Add(*pGroupItemClass);
989 pGroupItemClass = new(std::nothrow) GroupItemClass();
990 pGroupItemClass->__titleText = CommonUtil::GetString(L"IDS_COM_BODY_TUE");
991 pGroupItemClass->__endTime.SetValue(currentTime.GetYear(),currentTime.GetMonth(), 1);
992 pGroupItemClass->__endTime.AddDays(currentTime.GetDay() - 2 - 1);
993 pGroupItemClass->__startTime.SetValue(currentTime.GetYear(),currentTime.GetMonth(), 1);
994 pGroupItemClass->__startTime.AddDays(currentTime.GetDay() - 3 - 1);
995 __pGroupData->Add(*pGroupItemClass);
997 pGroupItemClass = new(std::nothrow) GroupItemClass();
998 pGroupItemClass->__titleText = CommonUtil::GetString(L"IDS_COM_BODY_MON");
999 pGroupItemClass->__endTime.SetValue(currentTime.GetYear(),currentTime.GetMonth(), 1);
1000 pGroupItemClass->__endTime.AddDays(currentTime.GetDay() - 3 - 1);
1001 pGroupItemClass->__startTime.SetValue(currentTime.GetYear(),currentTime.GetMonth(), 1);
1002 pGroupItemClass->__startTime.AddDays(currentTime.GetDay() - 4 - 1);
1003 __pGroupData->Add(*pGroupItemClass);
1005 pGroupItemClass = new(std::nothrow) GroupItemClass();
1006 pGroupItemClass->__titleText = CommonUtil::GetString(L"IDS_EMAIL_BODY_LAST_WEEK");
1007 pGroupItemClass->__endTime.SetValue(currentTime.GetYear(),currentTime.GetMonth(), 1);
1008 pGroupItemClass->__endTime.AddDays(currentTime.GetDay() - 4 - 1);
1009 pGroupItemClass->__startTime.SetValue(currentTime.GetYear(),currentTime.GetMonth(), 1);
1010 pGroupItemClass->__startTime.AddDays(currentTime.GetDay() - 11 - 1);
1011 __pGroupData->Add(*pGroupItemClass);
1015 pGroupItemClass = new(std::nothrow) GroupItemClass();
1016 pGroupItemClass->__titleText = CommonUtil::GetString(L"IDS_COM_BODY_YESTERDAY");
1017 pGroupItemClass->__endTime.SetValue(currentTime.GetYear(),currentTime.GetMonth(), currentTime.GetDay());
1018 pGroupItemClass->__startTime.SetValue(currentTime.GetYear(),currentTime.GetMonth(), 1);
1019 pGroupItemClass->__startTime.AddDays(currentTime.GetDay() - 1 - 1);
1020 __pGroupData->Add(*pGroupItemClass);
1022 pGroupItemClass = new(std::nothrow) GroupItemClass();
1023 pGroupItemClass->__titleText = CommonUtil::GetString(L"IDS_COM_BODY_THU");
1024 pGroupItemClass->__endTime.SetValue(currentTime.GetYear(),currentTime.GetMonth(), 1);
1025 pGroupItemClass->__endTime.AddDays(currentTime.GetDay() - 1 - 1);
1026 pGroupItemClass->__startTime.SetValue(currentTime.GetYear(),currentTime.GetMonth(), 1);
1027 pGroupItemClass->__startTime.AddDays(currentTime.GetDay() - 2 - 1);
1028 __pGroupData->Add(*pGroupItemClass);
1030 pGroupItemClass = new(std::nothrow) GroupItemClass();
1031 pGroupItemClass->__titleText = CommonUtil::GetString(L"IDS_COM_BODY_WED");
1032 pGroupItemClass->__endTime.SetValue(currentTime.GetYear(),currentTime.GetMonth(), 1);
1033 pGroupItemClass->__endTime.AddDays(currentTime.GetDay() - 2 - 1);
1034 pGroupItemClass->__startTime.SetValue(currentTime.GetYear(),currentTime.GetMonth(), 1);
1035 pGroupItemClass->__startTime.AddDays(currentTime.GetDay() - 3 - 1);
1036 __pGroupData->Add(*pGroupItemClass);
1038 pGroupItemClass = new(std::nothrow) GroupItemClass();
1039 pGroupItemClass->__titleText = CommonUtil::GetString(L"IDS_COM_BODY_TUE");
1040 pGroupItemClass->__endTime.SetValue(currentTime.GetYear(),currentTime.GetMonth(), 1);
1041 pGroupItemClass->__endTime.AddDays(currentTime.GetDay() - 3 - 1);
1042 pGroupItemClass->__startTime.SetValue(currentTime.GetYear(),currentTime.GetMonth(), 1);
1043 pGroupItemClass->__startTime.AddDays(currentTime.GetDay() - 4 - 1);
1044 __pGroupData->Add(*pGroupItemClass);
1046 pGroupItemClass = new(std::nothrow) GroupItemClass();
1047 pGroupItemClass->__titleText = CommonUtil::GetString(L"IDS_COM_BODY_MON");
1048 pGroupItemClass->__endTime.SetValue(currentTime.GetYear(),currentTime.GetMonth(), 1);
1049 pGroupItemClass->__endTime.AddDays(currentTime.GetDay() - 4 - 1);
1050 pGroupItemClass->__startTime.SetValue(currentTime.GetYear(),currentTime.GetMonth(), 1);
1051 pGroupItemClass->__startTime.AddDays(currentTime.GetDay() - 5 - 1);
1052 __pGroupData->Add(*pGroupItemClass);
1054 pGroupItemClass = new(std::nothrow) GroupItemClass();
1055 pGroupItemClass->__titleText = CommonUtil::GetString(L"IDS_EMAIL_BODY_LAST_WEEK");
1056 pGroupItemClass->__endTime.SetValue(currentTime.GetYear(),currentTime.GetMonth(), 1);
1057 pGroupItemClass->__endTime.AddDays(currentTime.GetDay() - 5 - 1);
1058 pGroupItemClass->__startTime.SetValue(currentTime.GetYear(),currentTime.GetMonth(), 1);
1059 pGroupItemClass->__startTime.AddDays(currentTime.GetDay() - 12 - 1);
1060 __pGroupData->Add(*pGroupItemClass);
1066 int day = currentTime.GetDay();
1070 pGroupItemClass = new(std::nothrow) GroupItemClass();
1071 pGroupItemClass->__titleText = L"Two weeks ago";
1072 pGroupItemClass->__endTime.SetValue(currentTime.GetYear(),currentTime.GetMonth(), 1);
1073 pGroupItemClass->__endTime.AddDays(currentTime.GetDay() - 7 - dayOfWeek + 2 - 1);
1074 pGroupItemClass->__startTime.SetValue(currentTime.GetYear(),currentTime.GetMonth(), 1);
1075 pGroupItemClass->__startTime.AddDays(currentTime.GetDay() - 14 - dayOfWeek + 2 - 1);
1076 __pGroupData->Add(*pGroupItemClass);
1080 pGroupItemClass = new(std::nothrow) GroupItemClass();
1081 pGroupItemClass->__titleText = L"Two weeks ago";
1082 pGroupItemClass->__endTime.SetValue(currentTime.GetYear(),currentTime.GetMonth(), 1);
1083 pGroupItemClass->__endTime.AddDays(currentTime.GetDay() - 7 - dayOfWeek + 2 - 1);
1084 pGroupItemClass->__startTime.SetValue(currentTime.GetYear(),currentTime.GetMonth(), 1);
1085 pGroupItemClass->__startTime.AddDays(currentTime.GetDay() - 14 - dayOfWeek + 2 - 1);
1086 __pGroupData->Add(*pGroupItemClass);
1088 pGroupItemClass = new(std::nothrow) GroupItemClass();
1089 pGroupItemClass->__titleText = L"Three weeks ago";
1090 pGroupItemClass->__endTime.SetValue(currentTime.GetYear(),currentTime.GetMonth(), 1);
1091 pGroupItemClass->__endTime.AddDays(currentTime.GetDay() - 14 - dayOfWeek + 2 - 1);
1092 pGroupItemClass->__startTime.SetValue(currentTime.GetYear(),currentTime.GetMonth(), 1);
1093 pGroupItemClass->__startTime.AddDays(currentTime.GetDay() - 21 - dayOfWeek + 2 - 1);
1094 __pGroupData->Add(*pGroupItemClass);
1098 pGroupItemClass = new(std::nothrow) GroupItemClass();
1099 pGroupItemClass->__titleText = L"Two weeks ago";
1100 pGroupItemClass->__endTime.SetValue(currentTime.GetYear(),currentTime.GetMonth(), 1);
1101 pGroupItemClass->__endTime.AddDays(currentTime.GetDay() - 7 - dayOfWeek + 2 - 1);
1102 pGroupItemClass->__startTime.SetValue(currentTime.GetYear(),currentTime.GetMonth(), 1);
1103 pGroupItemClass->__startTime.AddDays(currentTime.GetDay() - 14 - dayOfWeek + 2 - 1);
1104 __pGroupData->Add(*pGroupItemClass);
1106 pGroupItemClass = new(std::nothrow) GroupItemClass();
1107 pGroupItemClass->__titleText = L"Three weeks ago";
1108 pGroupItemClass->__endTime.SetValue(currentTime.GetYear(),currentTime.GetMonth(), 1);
1109 pGroupItemClass->__endTime.AddDays(currentTime.GetDay() - 14 - dayOfWeek + 2 - 1);
1110 pGroupItemClass->__startTime.SetValue(currentTime.GetYear(),currentTime.GetMonth(), 1);
1111 pGroupItemClass->__startTime.AddDays(currentTime.GetDay() - 21 - dayOfWeek + 2 - 1);
1112 __pGroupData->Add(*pGroupItemClass);
1114 pGroupItemClass = new(std::nothrow) GroupItemClass();
1115 pGroupItemClass->__titleText = CommonUtil::GetString(L"IDS_BR_EARLIER_THIS_MONTH");
1116 pGroupItemClass->__endTime.SetValue(currentTime.GetYear(),currentTime.GetMonth(), 1);
1117 pGroupItemClass->__endTime.AddDays(currentTime.GetDay() - 21 - dayOfWeek + 2 - 1);
1118 pGroupItemClass->__startTime.SetValue(currentTime.GetYear(),currentTime.GetMonth(), 1);
1119 __pGroupData->Add(*pGroupItemClass);
1125 pGroupItemClass = new(std::nothrow) GroupItemClass();
1126 pGroupItemClass->__titleText = CommonUtil::GetString(L"IDS_EMAIL_BODY_LAST_MONTH");
1127 pGroupItemClass->__endTime.SetValue(currentTime.GetYear(),currentTime.GetMonth(), 1);
1128 pGroupItemClass->__endTime.AddDays(-1);
1129 pGroupItemClass->__startTime.SetValue(currentTime.GetYear(), 1, 1);
1130 pGroupItemClass->__startTime.AddMonths(currentTime.GetMonth() - 1 - 1);
1131 __pGroupData->Add(*pGroupItemClass);
1133 pGroupItemClass = new(std::nothrow) GroupItemClass();
1134 pGroupItemClass->__titleText = CommonUtil::GetString(L"IDS_BR_BODY_OLDER");
1135 pGroupItemClass->__endTime.SetValue(currentTime.GetYear(),1, 1);
1136 pGroupItemClass->__endTime.AddMonths(currentTime.GetMonth() - 2);
1137 pGroupItemClass->__endTime.AddDays(-1);
1138 pGroupItemClass->__startTime.SetValue(0, 0, 0);
1139 __pGroupData->Add(*pGroupItemClass);
1142 void EditHistoryListForm::OnOrientationChanged(const Tizen::Ui::Control& source, Tizen::Ui::OrientationStatus orientationStatus)
1144 if (__pListView != null)
1146 __pListView->UpdateList();
1151 EditHistoryListForm::OnTimerExpired(Timer& timer)
1153 SceneManager* pSceneManager = SceneManager::GetInstance();
1155 if ( pSceneManager != NULL)
1157 pSceneManager->GoBackward(BackwardSceneTransition());