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(false);
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");
117 selectedText.Append(L"\x200E"); // LEFT-TO-RIGHT MARK
118 selectedText.Append(L"(0)");
119 __pSelectedLabel->SetText(selectedText);
121 __pSelectAllCheck = static_cast< CheckButton* >(GetControl(L"IDC_SELECT_ALL",true));
123 if (__pSelectAllCheck != null)
125 __pSelectAllCheck->SetActionId(IDA_SELECT_ALL_CHECKED, IDA_SELECT_ALL_UNCHECKED);
126 __pSelectAllCheck->AddActionEventListener(*this);
133 __pListView = static_cast< GroupedListView* >(GetControl(L"IDC_GROUPEDLISTVIEW1"));
134 if( __pListView != NULL)
136 __pListView->SetItemProvider(*this);
137 __pListView->AddGroupedListViewItemEventListener(*this);
144 __pTimer = new (std::nothrow) Timer();
145 r = __pTimer->Construct(*this);
151 EditHistoryListForm::OnTerminating(void)
153 result r = E_SUCCESS;
159 EditHistoryListForm::OnActionPerformed(const Tizen::Ui::Control& source, int actionId)
161 String selectedText = CommonUtil::GetString(L"IDS_COM_OPT_SELECTED");
162 SceneManager* pSceneManager = SceneManager::GetInstance();
164 if (pSceneManager == null)
171 case IDA_TABBAR_ITEM_1:
173 result r = pSceneManager->GoBackward(BackwardSceneTransition());
176 AppLogDebug("EditHistoryListForm::OnActionPerformed Failed to GoBackward %s",GetErrorMessage(r));
182 case IDA_SELECT_ALL_CHECKED:
184 int selectedCount = 0;
185 for (int groupIndex = 0 ; __pGroupData != null && groupIndex < __pGroupData->GetCount() ; groupIndex ++)
187 GroupItemClass* pGClass = dynamic_cast< GroupItemClass* >(__pGroupData->GetAt(groupIndex));
192 for (int itemIndex = 0 ; itemIndex < pGClass->__pData->GetCount() ; itemIndex ++)
195 __pListView->SetItemChecked(groupIndex,itemIndex,true);
198 selectedText.Append(L"\x200E"); // LEFT-TO-RIGHT MARK
199 selectedText.Append(L"(");
200 selectedText.Append(selectedCount);
201 selectedText.Append(L")");
202 __selectedCount = selectedCount;
204 __pSelectedLabel->SetText(selectedText);
205 __pSelectedLabel->Invalidate(true);
207 GetFooter()->SetItemEnabled(0, true);
208 GetFooter()->Invalidate(true);
210 __pListView->Invalidate(true);
214 case IDA_SELECT_ALL_UNCHECKED:
216 for (int groupIndex = 0 ; __pGroupData != null && groupIndex < __pGroupData->GetCount() ; groupIndex ++)
218 GroupItemClass* pGroupItemClass = dynamic_cast< GroupItemClass* >(__pGroupData->GetAt(groupIndex));
219 if(pGroupItemClass == null)
223 for (int itemIndex = 0 ; itemIndex < pGroupItemClass->__pData->GetCount() ; itemIndex ++)
225 __pListView->SetItemChecked(groupIndex,itemIndex,false);
228 selectedText.Append(L"\x200E"); // LEFT-TO-RIGHT MARK
229 selectedText.Append(L"(0)");
230 __pSelectedLabel->SetText(selectedText);
232 __pSelectedLabel->Invalidate(true);
234 GetFooter()->SetItemEnabled(0, false);
235 GetFooter()->Invalidate(true);
237 __pListView->Invalidate(true);
240 case IDA_DELETE_HISTORY:
243 ArrayList* pArrayList = new(std::nothrow) ArrayList();
248 pArrayList->Construct();
249 for (int groupIndex = 0 ; __pGroupData != null && groupIndex < __pGroupData->GetCount() ; groupIndex ++)
251 GroupItemClass* pGroupItemClass = dynamic_cast< GroupItemClass* >(__pGroupData->GetAt(groupIndex));
253 if (pGroupItemClass == null || pGroupItemClass->__pData == null)
255 AppLogDebug(" pGroupItemClass || __pData is null");
258 itemCount = pGroupItemClass->__pData->GetCount();
259 for (int itemIndex = 0 ; itemIndex < itemCount ; itemIndex++)
261 bool ret = __pListView->IsItemChecked(groupIndex,itemIndex);
266 AppLog("deleting history for groupId %d, item %d",groupIndex,itemIndex);
268 History* pHistory = dynamic_cast< History* >(pGroupItemClass->__pData->GetAt(itemIndex));
273 pArrayList->Add(*new(std::nothrow) String(pHistory->GetHistoryId()));
278 HistoryPresentationModel::GetInstance()->DeleteMultipleHistory(pArrayList);
280 if (pArrayList != null)
282 pArrayList->RemoveAll(true);
286 if(__pGroupData != null)
288 groupCount = __pGroupData->GetCount();
290 for(int groupIndex = 0 ; groupIndex < groupCount ; groupIndex ++ )
292 counter = __pListView->GetItemCountAt(groupIndex);
294 for(int index = 0 ; index < counter ; index++)
296 if(__pListView->IsItemChecked( groupIndex,index ) == true)
298 __pListView->SetItemChecked(groupIndex,index,false);
306 __pSelectAllCheck->SetSelected(false);
308 GetFooter()->SetItemEnabled(0,false);
309 GetFooter()->Invalidate(true);
310 selectedText.Append(L"\x200E"); // LEFT-TO-RIGHT MARK
311 selectedText.Append(L"(0)");
312 __pSelectedLabel->SetText(selectedText);
314 __pSelectedLabel->Invalidate(true);
315 if (__pListView != null)
317 __pListView->UpdateList();
320 NotificationPanel* pNotification = new (std::nothrow) NotificationPanel(*this);
321 String notification = CommonUtil::GetString(L"IDS_BR_POP_DELETED");
322 pNotification->SetText(notification);
323 pNotification->ShowNotification();
328 if( __pTimer != NULL)
332 result r = pSceneManager->GoBackward(BackwardSceneTransition(IDSCN_HISTORY_LIST, SCENE_TRANSITION_ANIMATION_TYPE_RIGHT));
335 AppLogDebug("EditHistoryListForm::OnActionPerformed Failed to GoBackward %s",GetErrorMessage(r));
348 EditHistoryListForm::OnFormBackRequested(Tizen::Ui::Controls::Form& source)
350 SceneManager* pSceneManager = SceneManager::GetInstance();
352 if (pSceneManager == null)
357 result r = pSceneManager->GoBackward(BackwardSceneTransition(IDSCN_HISTORY_LIST, SCENE_TRANSITION_ANIMATION_TYPE_RIGHT));
360 AppLogDebug("EditHistoryListForm::OnFormBackRequested Failed to GoBackward %s",GetErrorMessage(r));
366 EditHistoryListForm::CreateGroupItem(int groupIndex, int itemWidth)
368 AppLogDebug("EditHistoryListForm::CreateGroupItem");
369 result r = E_FAILURE;
373 GroupItem* pItem = null;
376 GroupItemClass* pGroupItemClass = dynamic_cast< GroupItemClass* >(__pGroupData->GetAt(groupIndex));
377 if(pGroupItemClass == null)
379 pItem = new(std::nothrow) GroupItem();
386 if ( pGroupItemClass->__pData == null || pGroupItemClass->__pData->GetCount() == 0)
388 r = pItem->Construct(Dimension(itemWidth, 0));
392 r = pItem->Construct(Dimension(itemWidth, 48));
395 text = pGroupItemClass->__titleText;
399 if (pGroupItemClass->__titleText == L"Today" || pGroupItemClass->__titleText == L"Yesterday")
401 Calendar* pGregorianCalendar = Calendar::CreateInstanceN(CALENDAR_GREGORIAN);
402 if (pGregorianCalendar != NULL)
404 pGregorianCalendar->SetTimeField(TIME_FIELD_YEAR, pGroupItemClass->__startTime.GetYear());
405 pGregorianCalendar->SetTimeField(TIME_FIELD_MONTH, pGroupItemClass->__startTime.GetMonth());
406 pGregorianCalendar->SetTimeField(TIME_FIELD_DAY_OF_MONTH, pGroupItemClass->__startTime.GetDay());
407 dayOfWeek = pGregorianCalendar->GetTimeField(TIME_FIELD_DAY_OF_WEEK);
409 if (pGregorianCalendar != NULL)
411 delete pGregorianCalendar;
445 if (pGroupItemClass->__titleText != L"Older")
447 text.Append(pGroupItemClass->__startTime.GetDay());
449 strMonth = pGroupItemClass->__startTime.GetMonth();
450 month = GetMonth(strMonth);
458 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")
461 text.Append(pGroupItemClass->__endTime.GetDay());
463 strMonth = pGroupItemClass->__endTime.GetMonth();
464 month = GetMonth(strMonth);
469 AppLogDebug("startTime day = %d month = %d year = %d",pGroupItemClass->__startTime.GetDay(),pGroupItemClass->__startTime.GetMonth(),pGroupItemClass->__startTime.GetYear());
471 pItem->SetElement(text, null);
472 pItem->SetTextSize(32);
478 EditHistoryListForm::CreateItem(int groupIndex, int itemIndex, int itemWidth)
480 AppLogDebug("EditHistoryListForm::CreateItem");
481 result r = E_FAILURE;
482 const int bookmarkBtnWidth = 64;
484 if (__pGroupData == null)
489 CustomItem* pItem = new(std::nothrow) CustomItem();
494 GroupItemClass* pGroupItemClass = dynamic_cast< GroupItemClass* >(__pGroupData->GetAt(groupIndex));
496 if (pGroupItemClass == null)
502 History* pHistory = dynamic_cast< History* >(pGroupItemClass->__pData->GetAt(itemIndex));
503 if ( pHistory == NULL )
508 Bitmap* pBitmap = null;
510 r = pItem->Construct(Tizen::Graphics::Dimension(itemWidth, 128), LIST_ANNEX_STYLE_MARK);
514 pBitmap = pHistory->GetFavIconBitmap();
517 pBitmap = FaviconManager::GetInstance()->GetDefaultFaviconN();
522 pItem->AddElement(Rectangle(16, 26, 60, 60), IDA_FORMAT_ICON, *pBitmap, null);
525 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);
529 AppLogException("CreateItem failed with %s", GetErrorMessage(r));
533 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);
539 EditHistoryListForm::DeleteGroupItem(int groupIndex, GroupItem* pItem, int itemWidth)
542 AppLogDebug("EditHistoryListForm::DeleteGroupItem");
544 if (__pGroupData == null)
557 EditHistoryListForm::DeleteItem(int groupIndex, int itemIndex, ListItemBase* pItem, int itemWidth)
560 if (__pGroupData == null)
565 GroupItemClass* pGroupItemClass = dynamic_cast< GroupItemClass* >(__pGroupData->GetAt(groupIndex));
566 if (pGroupItemClass == null)
577 EditHistoryListForm::GetGroupCount(void)
579 AppLogDebug("EditHistoryListForm::GetGroupCount");
581 __isNoHistoryPresent = true;
586 HistoryPresentationModel::GetInstance()->GetHistoryCount(count);
589 __isNoHistoryPresent = false;
590 AppLogDebug("the value of isNoHistoryPresent %d",__isNoHistoryPresent);
591 __pTimer->Start(1000);
592 __pSelectAllCheck->SetShowState(false);
593 __pSelectedLabel->SetShowState(false);
597 __isNoHistoryPresent = true;
598 __pSelectAllCheck->SetShowState(true);
599 __pSelectedLabel->SetShowState(true);
601 __pSelectAllCheck->Invalidate(true);
602 __pSelectedLabel->Invalidate(false);
603 GetFooter()->Invalidate(true);
605 if (__pGroupData != null)
607 AppLogDebug("GetGroupCount returning %d",__pGroupData->GetCount());
608 count = __pGroupData->GetCount();
612 AppLogDebug("GetGroupCount returning 0");
620 EditHistoryListForm::GetItemCount(int groupIndex)
622 AppLogDebug("EditHistoryListForm::GetItemCount");
623 result r = E_FAILURE;
626 if (__pGroupData == null)
628 AppLogDebug("EditHistoryListForm::GetItemCount returning 0");
632 GroupItemClass* pGroupItemClass = dynamic_cast< GroupItemClass* >(__pGroupData->GetAt(groupIndex));
634 if (pGroupItemClass == null)
636 AppLogDebug("EditHistoryListForm::GetItemCount returning 0");
641 r = HistoryPresentationModel::GetInstance()->GetHistoryCountWithTimeRange(pGroupItemClass->__startTime,pGroupItemClass->__endTime,count);
645 AppLogDebug("EditHistoryListForm::GetItemCount returning 0");
649 if (pGroupItemClass->__pData != null)
651 pGroupItemClass->__pData->RemoveAll(false);
652 delete pGroupItemClass->__pData;
654 pGroupItemClass->__pData = new(std::nothrow) Collection::ArrayList();
655 pGroupItemClass->__pData->Construct();
656 AppLog("Starttime %ls endtime %ls",pGroupItemClass->__startTime.ToString().GetPointer(),pGroupItemClass->__endTime.ToString().GetPointer());
657 HistoryPresentationModel::GetInstance()->GetHistoryWithTimeRange(pGroupItemClass->__startTime,pGroupItemClass->__endTime, 0, count, *pGroupItemClass->__pData);
658 AppLogDebug("Count = %d ", count);
660 if (__pGroupData == null)
662 AppLogDebug("EditHistoryListForm::GetItemCount returning 0");
668 if (pGroupItemClass == null || pGroupItemClass->__pData == null)
670 AppLogDebug("EditHistoryListForm::GetItemCount returning 0");
675 AppLogDebug("EditHistoryListForm::GetItemCount returning %d for %d title %ls",pGroupItemClass->__pData->GetCount(),groupIndex,pGroupItemClass->__titleText.GetPointer());
676 return pGroupItemClass->__pData->GetCount();
681 EditHistoryListForm::OnSceneActivatedN(const Tizen::Ui::Scenes::SceneId& previousSceneId,
682 const Tizen::Ui::Scenes::SceneId& currentSceneId, Tizen::Base::Collection::IList* pArgs)
684 AppLogDebug("EditHistoryListForm::OnSceneActivatedN");
688 if(__pGroupData != null)
690 groupCount = __pGroupData->GetCount();
692 for(int groupIndex = 0 ; groupIndex < groupCount ; groupIndex ++ )
694 count = __pListView->GetItemCountAt(groupIndex);
696 for(int index = 0 ; index < count ; index++)
698 if(__pListView->IsItemChecked( groupIndex,index ) == true)
700 __pListView->SetItemChecked(groupIndex,index,false);
705 if (__pListView != null)
707 __pListView->UpdateList();
709 __pSelectAllCheck->SetSelected(false);
711 GetFooter()->SetItemEnabled(0, false);
716 EditHistoryListForm::OnSceneDeactivated(const Tizen::Ui::Scenes::SceneId& currentSceneId,
717 const Tizen::Ui::Scenes::SceneId& nextSceneId)
719 AppLogDebug("EditHistoryListForm::OnSceneDeactivated");
723 EditHistoryListForm::OnGroupedListViewContextItemStateChanged(Tizen::Ui::Controls::GroupedListView& listView, int groupIndex, int itemIndex, int elementId, Tizen::Ui::Controls::ListContextItemStatus status)
729 EditHistoryListForm::OnGroupedListViewItemStateChanged(Tizen::Ui::Controls::GroupedListView& listView, int groupIndex, int itemIndex, int elementId, Tizen::Ui::Controls::ListItemStatus status)
731 AppLogDebug("EditHistoryListForm::OnGroupedListViewItemStateChanged entered");
732 String selectedText = CommonUtil::GetString(L"IDS_COM_OPT_SELECTED");
735 if (status == LIST_ITEM_STATUS_UNCHECKED)
744 if (__selectedCount == 0)
746 GetFooter()->SetItemEnabled(0,false);
750 GetFooter()->SetItemEnabled(0,true);
752 GetFooter()->Invalidate(true);
754 selectedText.Append(L"\x200E"); // LEFT-TO-RIGHT MARK
755 selectedText.Append(L"(");
756 selectedText.Append(__selectedCount);
757 selectedText.Append(L")");
759 __pSelectedLabel->SetText(selectedText);
760 __pSelectedLabel->Invalidate(true);
762 if (status == LIST_ITEM_STATUS_UNCHECKED)
764 __pSelectAllCheck->SetSelected(false);
766 else if (status == LIST_ITEM_STATUS_CHECKED && __pSelectAllCheck->IsSelected() == false && __pGroupData != null)
768 int itemCount = __pGroupData->GetCount();
769 for (int groupIndex = 0 ; groupIndex < itemCount ; groupIndex ++)
771 GroupItemClass* pGClass = (dynamic_cast< GroupItemClass* >(__pGroupData->GetAt(groupIndex)));
776 for (int itemIndex = 0 ; itemIndex < pGClass->__pData->GetCount() ; itemIndex ++)
778 bool ret = __pListView->IsItemChecked(groupIndex,itemIndex);
782 __pSelectAllCheck->SetSelected(false);
787 __pSelectAllCheck->SetSelected(true);
793 EditHistoryListForm::OnGroupedListViewItemSwept(Tizen::Ui::Controls::GroupedListView& listView, int groupIndex, int itemIndex, Tizen::Ui::Controls::SweepDirection direction)
799 EditHistoryListForm::GetMonth(int month)
805 monthValue.Append(CommonUtil::GetString(L"IDS_COM_BODY_JAN"));;
808 monthValue.Append(CommonUtil::GetString(L"IDS_COM_BODY_FEB"));;
811 monthValue.Append(CommonUtil::GetString(L"IDS_COM_BODY_MAR"));;
814 monthValue.Append(CommonUtil::GetString(L"IDS_COM_BODY_APR"));;
817 monthValue.Append(CommonUtil::GetString(L"IDS_COM_BODY_MAY"));;
820 monthValue.Append(CommonUtil::GetString(L"IDS_COM_BODY_JUN"));;
823 monthValue.Append(CommonUtil::GetString(L"IDS_COM_BODY_JUL"));;
826 monthValue.Append(CommonUtil::GetString(L"IDS_COM_BODY_AUG"));;
829 monthValue.Append(CommonUtil::GetString(L"IDS_COM_BODY_SEP"));;
832 monthValue.Append(CommonUtil::GetString(L"IDS_COM_BODY_OCT"));;
835 monthValue.Append(CommonUtil::GetString(L"IDS_COM_BODY_NOV"));;
838 monthValue.Append(CommonUtil::GetString(L"IDS_COM_BODY_DEC"));;
848 EditHistoryListForm::CreateGroupItems(void)
850 AppLogDebug("EditHistoryListForm::createGroupItems entered");
851 if (__pGroupData != null)
853 __pGroupData->RemoveAll(true);
858 if (__pGroupData == null)
860 __pGroupData = new(std::nothrow) Collection::ArrayList();
861 __pGroupData->Construct();
864 DateTime currentTime;
866 HistoryPresentationModel::GetCurrentDateTime(currentTime);
867 GroupItemClass* pGroupItemClass = new(std::nothrow) GroupItemClass();
868 pGroupItemClass->__titleText = CommonUtil::GetString(L"IDS_COM_BODY_TODAY");
869 pGroupItemClass->__endTime = currentTime;
870 pGroupItemClass->__startTime.SetValue(currentTime.GetYear(),currentTime.GetMonth(), currentTime.GetDay());
871 __pGroupData->Add(*pGroupItemClass);
873 Calendar* pGregorianCalendar = Calendar::CreateInstanceN(CALENDAR_GREGORIAN);
875 if (pGregorianCalendar != NULL)
877 pGregorianCalendar->SetTimeField(TIME_FIELD_YEAR, currentTime.GetYear());
878 pGregorianCalendar->SetTimeField(TIME_FIELD_MONTH, currentTime.GetMonth());
879 pGregorianCalendar->SetTimeField(TIME_FIELD_DAY_OF_MONTH, currentTime.GetDay());
880 dayOfWeek = pGregorianCalendar->GetTimeField(TIME_FIELD_DAY_OF_WEEK);
881 delete pGregorianCalendar;
888 pGroupItemClass = new(std::nothrow) GroupItemClass();
889 pGroupItemClass->__titleText = CommonUtil::GetString(L"IDS_EMAIL_BODY_LAST_WEEK");
890 pGroupItemClass->__endTime.SetValue(currentTime.GetYear(),currentTime.GetMonth(), currentTime.GetDay());
891 pGroupItemClass->__startTime.SetValue(currentTime.GetYear(),currentTime.GetMonth(), 1);
892 pGroupItemClass->__startTime.AddDays(currentTime.GetDay() - 6 - 1);
893 __pGroupData->Add(*pGroupItemClass);
897 pGroupItemClass = new(std::nothrow) GroupItemClass();
898 pGroupItemClass->__titleText = CommonUtil::GetString(L"IDS_EMAIL_BODY_LAST_WEEK");
899 pGroupItemClass->__endTime.SetValue(currentTime.GetYear(),currentTime.GetMonth(), currentTime.GetDay());
900 pGroupItemClass->__startTime.SetValue(currentTime.GetYear(),currentTime.GetMonth(), 1);
901 pGroupItemClass->__startTime.AddDays(currentTime.GetDay() - 7 - 1);
902 __pGroupData->Add(*pGroupItemClass);
906 pGroupItemClass = new(std::nothrow) GroupItemClass();
907 pGroupItemClass->__titleText = CommonUtil::GetString(L"IDS_COM_BODY_YESTERDAY");
908 pGroupItemClass->__endTime.SetValue(currentTime.GetYear(),currentTime.GetMonth(), currentTime.GetDay());
909 pGroupItemClass->__startTime.SetValue(currentTime.GetYear(),currentTime.GetMonth(), 1);
910 pGroupItemClass->__startTime.AddDays(currentTime.GetDay() - 1 - 1);
911 __pGroupData->Add(*pGroupItemClass);
912 pGroupItemClass = new(std::nothrow) GroupItemClass();
913 pGroupItemClass->__titleText = CommonUtil::GetString(L"IDS_EMAIL_BODY_LAST_WEEK");
914 pGroupItemClass->__endTime.SetValue(currentTime.GetYear(),currentTime.GetMonth(), 1);
915 pGroupItemClass->__endTime.AddDays(currentTime.GetDay() - 1 - 1);
916 pGroupItemClass->__startTime.SetValue(currentTime.GetYear(),currentTime.GetMonth(), 1);
917 pGroupItemClass->__startTime.AddDays(currentTime.GetDay() - 8 - 1);
918 __pGroupData->Add(*pGroupItemClass);
922 pGroupItemClass = new(std::nothrow) GroupItemClass();
923 pGroupItemClass->__titleText = CommonUtil::GetString(L"IDS_COM_BODY_YESTERDAY");
924 pGroupItemClass->__endTime.SetValue(currentTime.GetYear(),currentTime.GetMonth(), currentTime.GetDay());
925 pGroupItemClass->__startTime.SetValue(currentTime.GetYear(),currentTime.GetMonth(), 1);
926 pGroupItemClass->__startTime.AddDays(currentTime.GetDay() - 1 - 1);
927 __pGroupData->Add(*pGroupItemClass);
929 pGroupItemClass = new(std::nothrow) GroupItemClass();
930 pGroupItemClass->__titleText = CommonUtil::GetString(L"IDS_COM_BODY_MON");
931 pGroupItemClass->__endTime.SetValue(currentTime.GetYear(),currentTime.GetMonth(), 1);
932 pGroupItemClass->__endTime.AddDays(currentTime.GetDay() - 1 - 1);
933 pGroupItemClass->__startTime.SetValue(currentTime.GetYear(),currentTime.GetMonth(), 1);
934 pGroupItemClass->__startTime.AddDays(currentTime.GetDay() - 2 - 1);
935 __pGroupData->Add(*pGroupItemClass);
937 pGroupItemClass = new(std::nothrow) GroupItemClass();
938 pGroupItemClass->__titleText = CommonUtil::GetString(L"IDS_EMAIL_BODY_LAST_WEEK");
939 pGroupItemClass->__endTime.SetValue(currentTime.GetYear(),currentTime.GetMonth(), 1);
940 pGroupItemClass->__endTime.AddDays(currentTime.GetDay() - 2 - 1);
941 pGroupItemClass->__startTime.SetValue(currentTime.GetYear(),currentTime.GetMonth(), 1);
942 pGroupItemClass->__startTime.AddDays(currentTime.GetDay() - 9 - 1);
943 __pGroupData->Add(*pGroupItemClass);
947 pGroupItemClass = new(std::nothrow) GroupItemClass();
948 pGroupItemClass->__titleText = CommonUtil::GetString(L"IDS_COM_BODY_YESTERDAY");
949 pGroupItemClass->__endTime.SetValue(currentTime.GetYear(),currentTime.GetMonth(), currentTime.GetDay());
950 pGroupItemClass->__startTime.SetValue(currentTime.GetYear(),currentTime.GetMonth(), 1);
951 pGroupItemClass->__startTime.AddDays(currentTime.GetDay() - 1 - 1);
952 __pGroupData->Add(*pGroupItemClass);
954 pGroupItemClass = new(std::nothrow) GroupItemClass();
955 pGroupItemClass->__titleText = CommonUtil::GetString(L"IDS_COM_BODY_TUE");
956 pGroupItemClass->__endTime.SetValue(currentTime.GetYear(),currentTime.GetMonth(), 1);
957 pGroupItemClass->__endTime.AddDays(currentTime.GetDay() - 1 - 1);
958 pGroupItemClass->__startTime.SetValue(currentTime.GetYear(),currentTime.GetMonth(), 1);
959 pGroupItemClass->__startTime.AddDays(currentTime.GetDay() - 2 - 1);
960 __pGroupData->Add(*pGroupItemClass);
962 pGroupItemClass = new(std::nothrow) GroupItemClass();
963 pGroupItemClass->__titleText = CommonUtil::GetString(L"IDS_COM_BODY_MON");
964 pGroupItemClass->__endTime.SetValue(currentTime.GetYear(),currentTime.GetMonth(), 1);
965 pGroupItemClass->__endTime.AddDays(currentTime.GetDay() - 2 - 1);
966 pGroupItemClass->__startTime.SetValue(currentTime.GetYear(),currentTime.GetMonth(), 1);
967 pGroupItemClass->__startTime.AddDays(currentTime.GetDay() - 3 - 1);
968 __pGroupData->Add(*pGroupItemClass);
970 pGroupItemClass = new(std::nothrow) GroupItemClass();
971 pGroupItemClass->__titleText = CommonUtil::GetString(L"IDS_EMAIL_BODY_LAST_WEEK");
972 pGroupItemClass->__endTime.SetValue(currentTime.GetYear(),currentTime.GetMonth(), 1);
973 pGroupItemClass->__endTime.AddDays(currentTime.GetDay() - 3 - 1);
974 pGroupItemClass->__startTime.SetValue(currentTime.GetYear(),currentTime.GetMonth(), 1);
975 pGroupItemClass->__startTime.AddDays(currentTime.GetDay() - 10 - 1);
976 __pGroupData->Add(*pGroupItemClass);
980 pGroupItemClass = new(std::nothrow) GroupItemClass();
981 pGroupItemClass->__titleText = CommonUtil::GetString(L"IDS_COM_BODY_YESTERDAY");
982 pGroupItemClass->__endTime.SetValue(currentTime.GetYear(),currentTime.GetMonth(), currentTime.GetDay());
983 pGroupItemClass->__startTime.SetValue(currentTime.GetYear(),currentTime.GetMonth(), 1);
984 pGroupItemClass->__startTime.AddDays(currentTime.GetDay() - 1 - 1);
985 __pGroupData->Add(*pGroupItemClass);
987 pGroupItemClass = new(std::nothrow) GroupItemClass();
988 pGroupItemClass->__titleText = CommonUtil::GetString(L"IDS_COM_BODY_WED");
989 pGroupItemClass->__endTime.SetValue(currentTime.GetYear(),currentTime.GetMonth(), 1);
990 pGroupItemClass->__endTime.AddDays(currentTime.GetDay() - 1 - 1);
991 pGroupItemClass->__startTime.SetValue(currentTime.GetYear(),currentTime.GetMonth(), 1);
992 pGroupItemClass->__startTime.AddDays(currentTime.GetDay() - 2 - 1);
993 __pGroupData->Add(*pGroupItemClass);
995 pGroupItemClass = new(std::nothrow) GroupItemClass();
996 pGroupItemClass->__titleText = CommonUtil::GetString(L"IDS_COM_BODY_TUE");
997 pGroupItemClass->__endTime.SetValue(currentTime.GetYear(),currentTime.GetMonth(), 1);
998 pGroupItemClass->__endTime.AddDays(currentTime.GetDay() - 2 - 1);
999 pGroupItemClass->__startTime.SetValue(currentTime.GetYear(),currentTime.GetMonth(), 1);
1000 pGroupItemClass->__startTime.AddDays(currentTime.GetDay() - 3 - 1);
1001 __pGroupData->Add(*pGroupItemClass);
1003 pGroupItemClass = new(std::nothrow) GroupItemClass();
1004 pGroupItemClass->__titleText = CommonUtil::GetString(L"IDS_COM_BODY_MON");
1005 pGroupItemClass->__endTime.SetValue(currentTime.GetYear(),currentTime.GetMonth(), 1);
1006 pGroupItemClass->__endTime.AddDays(currentTime.GetDay() - 3 - 1);
1007 pGroupItemClass->__startTime.SetValue(currentTime.GetYear(),currentTime.GetMonth(), 1);
1008 pGroupItemClass->__startTime.AddDays(currentTime.GetDay() - 4 - 1);
1009 __pGroupData->Add(*pGroupItemClass);
1011 pGroupItemClass = new(std::nothrow) GroupItemClass();
1012 pGroupItemClass->__titleText = CommonUtil::GetString(L"IDS_EMAIL_BODY_LAST_WEEK");
1013 pGroupItemClass->__endTime.SetValue(currentTime.GetYear(),currentTime.GetMonth(), 1);
1014 pGroupItemClass->__endTime.AddDays(currentTime.GetDay() - 4 - 1);
1015 pGroupItemClass->__startTime.SetValue(currentTime.GetYear(),currentTime.GetMonth(), 1);
1016 pGroupItemClass->__startTime.AddDays(currentTime.GetDay() - 11 - 1);
1017 __pGroupData->Add(*pGroupItemClass);
1021 pGroupItemClass = new(std::nothrow) GroupItemClass();
1022 pGroupItemClass->__titleText = CommonUtil::GetString(L"IDS_COM_BODY_YESTERDAY");
1023 pGroupItemClass->__endTime.SetValue(currentTime.GetYear(),currentTime.GetMonth(), currentTime.GetDay());
1024 pGroupItemClass->__startTime.SetValue(currentTime.GetYear(),currentTime.GetMonth(), 1);
1025 pGroupItemClass->__startTime.AddDays(currentTime.GetDay() - 1 - 1);
1026 __pGroupData->Add(*pGroupItemClass);
1028 pGroupItemClass = new(std::nothrow) GroupItemClass();
1029 pGroupItemClass->__titleText = CommonUtil::GetString(L"IDS_COM_BODY_THU");
1030 pGroupItemClass->__endTime.SetValue(currentTime.GetYear(),currentTime.GetMonth(), 1);
1031 pGroupItemClass->__endTime.AddDays(currentTime.GetDay() - 1 - 1);
1032 pGroupItemClass->__startTime.SetValue(currentTime.GetYear(),currentTime.GetMonth(), 1);
1033 pGroupItemClass->__startTime.AddDays(currentTime.GetDay() - 2 - 1);
1034 __pGroupData->Add(*pGroupItemClass);
1036 pGroupItemClass = new(std::nothrow) GroupItemClass();
1037 pGroupItemClass->__titleText = CommonUtil::GetString(L"IDS_COM_BODY_WED");
1038 pGroupItemClass->__endTime.SetValue(currentTime.GetYear(),currentTime.GetMonth(), 1);
1039 pGroupItemClass->__endTime.AddDays(currentTime.GetDay() - 2 - 1);
1040 pGroupItemClass->__startTime.SetValue(currentTime.GetYear(),currentTime.GetMonth(), 1);
1041 pGroupItemClass->__startTime.AddDays(currentTime.GetDay() - 3 - 1);
1042 __pGroupData->Add(*pGroupItemClass);
1044 pGroupItemClass = new(std::nothrow) GroupItemClass();
1045 pGroupItemClass->__titleText = CommonUtil::GetString(L"IDS_COM_BODY_TUE");
1046 pGroupItemClass->__endTime.SetValue(currentTime.GetYear(),currentTime.GetMonth(), 1);
1047 pGroupItemClass->__endTime.AddDays(currentTime.GetDay() - 3 - 1);
1048 pGroupItemClass->__startTime.SetValue(currentTime.GetYear(),currentTime.GetMonth(), 1);
1049 pGroupItemClass->__startTime.AddDays(currentTime.GetDay() - 4 - 1);
1050 __pGroupData->Add(*pGroupItemClass);
1052 pGroupItemClass = new(std::nothrow) GroupItemClass();
1053 pGroupItemClass->__titleText = CommonUtil::GetString(L"IDS_COM_BODY_MON");
1054 pGroupItemClass->__endTime.SetValue(currentTime.GetYear(),currentTime.GetMonth(), 1);
1055 pGroupItemClass->__endTime.AddDays(currentTime.GetDay() - 4 - 1);
1056 pGroupItemClass->__startTime.SetValue(currentTime.GetYear(),currentTime.GetMonth(), 1);
1057 pGroupItemClass->__startTime.AddDays(currentTime.GetDay() - 5 - 1);
1058 __pGroupData->Add(*pGroupItemClass);
1060 pGroupItemClass = new(std::nothrow) GroupItemClass();
1061 pGroupItemClass->__titleText = CommonUtil::GetString(L"IDS_EMAIL_BODY_LAST_WEEK");
1062 pGroupItemClass->__endTime.SetValue(currentTime.GetYear(),currentTime.GetMonth(), 1);
1063 pGroupItemClass->__endTime.AddDays(currentTime.GetDay() - 5 - 1);
1064 pGroupItemClass->__startTime.SetValue(currentTime.GetYear(),currentTime.GetMonth(), 1);
1065 pGroupItemClass->__startTime.AddDays(currentTime.GetDay() - 12 - 1);
1066 __pGroupData->Add(*pGroupItemClass);
1072 int day = currentTime.GetDay();
1076 pGroupItemClass = new(std::nothrow) GroupItemClass();
1077 pGroupItemClass->__titleText = L"Two weeks ago";
1078 pGroupItemClass->__endTime.SetValue(currentTime.GetYear(),currentTime.GetMonth(), 1);
1079 pGroupItemClass->__endTime.AddDays(currentTime.GetDay() - 7 - dayOfWeek + 2 - 1);
1080 pGroupItemClass->__startTime.SetValue(currentTime.GetYear(),currentTime.GetMonth(), 1);
1081 pGroupItemClass->__startTime.AddDays(currentTime.GetDay() - 14 - dayOfWeek + 2 - 1);
1082 __pGroupData->Add(*pGroupItemClass);
1086 pGroupItemClass = new(std::nothrow) GroupItemClass();
1087 pGroupItemClass->__titleText = L"Two weeks ago";
1088 pGroupItemClass->__endTime.SetValue(currentTime.GetYear(),currentTime.GetMonth(), 1);
1089 pGroupItemClass->__endTime.AddDays(currentTime.GetDay() - 7 - dayOfWeek + 2 - 1);
1090 pGroupItemClass->__startTime.SetValue(currentTime.GetYear(),currentTime.GetMonth(), 1);
1091 pGroupItemClass->__startTime.AddDays(currentTime.GetDay() - 14 - dayOfWeek + 2 - 1);
1092 __pGroupData->Add(*pGroupItemClass);
1094 pGroupItemClass = new(std::nothrow) GroupItemClass();
1095 pGroupItemClass->__titleText = L"Three weeks ago";
1096 pGroupItemClass->__endTime.SetValue(currentTime.GetYear(),currentTime.GetMonth(), 1);
1097 pGroupItemClass->__endTime.AddDays(currentTime.GetDay() - 14 - dayOfWeek + 2 - 1);
1098 pGroupItemClass->__startTime.SetValue(currentTime.GetYear(),currentTime.GetMonth(), 1);
1099 pGroupItemClass->__startTime.AddDays(currentTime.GetDay() - 21 - dayOfWeek + 2 - 1);
1100 __pGroupData->Add(*pGroupItemClass);
1104 pGroupItemClass = new(std::nothrow) GroupItemClass();
1105 pGroupItemClass->__titleText = L"Two weeks ago";
1106 pGroupItemClass->__endTime.SetValue(currentTime.GetYear(),currentTime.GetMonth(), 1);
1107 pGroupItemClass->__endTime.AddDays(currentTime.GetDay() - 7 - dayOfWeek + 2 - 1);
1108 pGroupItemClass->__startTime.SetValue(currentTime.GetYear(),currentTime.GetMonth(), 1);
1109 pGroupItemClass->__startTime.AddDays(currentTime.GetDay() - 14 - dayOfWeek + 2 - 1);
1110 __pGroupData->Add(*pGroupItemClass);
1112 pGroupItemClass = new(std::nothrow) GroupItemClass();
1113 pGroupItemClass->__titleText = L"Three weeks ago";
1114 pGroupItemClass->__endTime.SetValue(currentTime.GetYear(),currentTime.GetMonth(), 1);
1115 pGroupItemClass->__endTime.AddDays(currentTime.GetDay() - 14 - dayOfWeek + 2 - 1);
1116 pGroupItemClass->__startTime.SetValue(currentTime.GetYear(),currentTime.GetMonth(), 1);
1117 pGroupItemClass->__startTime.AddDays(currentTime.GetDay() - 21 - dayOfWeek + 2 - 1);
1118 __pGroupData->Add(*pGroupItemClass);
1120 pGroupItemClass = new(std::nothrow) GroupItemClass();
1121 pGroupItemClass->__titleText = CommonUtil::GetString(L"IDS_BR_EARLIER_THIS_MONTH");
1122 pGroupItemClass->__endTime.SetValue(currentTime.GetYear(),currentTime.GetMonth(), 1);
1123 pGroupItemClass->__endTime.AddDays(currentTime.GetDay() - 21 - dayOfWeek + 2 - 1);
1124 pGroupItemClass->__startTime.SetValue(currentTime.GetYear(),currentTime.GetMonth(), 1);
1125 __pGroupData->Add(*pGroupItemClass);
1131 pGroupItemClass = new(std::nothrow) GroupItemClass();
1132 pGroupItemClass->__titleText = CommonUtil::GetString(L"IDS_EMAIL_BODY_LAST_MONTH");
1133 pGroupItemClass->__endTime.SetValue(currentTime.GetYear(),currentTime.GetMonth(), 1);
1134 pGroupItemClass->__endTime.AddDays(-1);
1135 pGroupItemClass->__startTime.SetValue(currentTime.GetYear(), 1, 1);
1136 pGroupItemClass->__startTime.AddMonths(currentTime.GetMonth() - 1 - 1);
1137 __pGroupData->Add(*pGroupItemClass);
1139 pGroupItemClass = new(std::nothrow) GroupItemClass();
1140 pGroupItemClass->__titleText = CommonUtil::GetString(L"IDS_BR_BODY_OLDER");
1141 pGroupItemClass->__endTime.SetValue(currentTime.GetYear(),1, 1);
1142 pGroupItemClass->__endTime.AddMonths(currentTime.GetMonth() - 2);
1143 pGroupItemClass->__endTime.AddDays(-1);
1144 pGroupItemClass->__startTime.SetValue(0, 0, 0);
1145 __pGroupData->Add(*pGroupItemClass);
1148 void EditHistoryListForm::OnOrientationChanged(const Tizen::Ui::Control& source, Tizen::Ui::OrientationStatus orientationStatus)
1150 if (__pListView != null)
1152 __pListView->UpdateList();
1157 EditHistoryListForm::OnTimerExpired(Timer& timer)
1159 SceneManager* pSceneManager = SceneManager::GetInstance();
1161 if ( pSceneManager != NULL)
1163 pSceneManager->GoBackward(BackwardSceneTransition());