// Copyright (c) 2012 Samsung Electronics Co., Ltd.
//
-// Licensed under the Flora License, Version 1.0 (the License);
+// Licensed under the Flora License, Version 1.1 (the License);
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
using namespace Tizen::Ui;
using namespace Tizen::Ui::Controls;
using namespace Tizen::Ui::Scenes;
+using namespace Tizen::System;
const int EditHistoryListForm::IDA_TABBAR_ITEM_1 = 101;
const int EditHistoryListForm::IDA_TABBAR_ITEM_2 = 102;
,__pSelectedLabel(null)
,__selectedCount(0)
,__isNoHistoryPresent(true)
+,__fontSize(44)
+,__pConfirmationPopup(null)
{
}
if (__pGroupData != null)
{
AppLog("removing __pGroupData");
- __pGroupData->RemoveAll(true);
+ __pGroupData->RemoveAll(false);
delete __pGroupData;
}
}
SetFormBackEventListener(this);
AppLogDebug("EditHistoryListForm::OnInitializing");
- SetFormStyle(FORM_STYLE_NORMAL | FORM_STYLE_INDICATOR | FORM_STYLE_HEADER | FORM_STYLE_FOOTER);
+// SetFormStyle(FORM_STYLE_NORMAL | FORM_STYLE_INDICATOR | FORM_STYLE_HEADER | FORM_STYLE_FOOTER);
+
+ __fontSize = CommonUtil::GetFontSize();
Header* pHeader = GetHeader();
{
return E_FAILURE;
}
- String selectedText = CommonUtil::GetString(L"IDS_COM_OPT_SELECTED") + "(0)";
+ String selectedText;
+ //selectedText.Append(L"\x200E"); // LEFT-TO-RIGHT MARK
+ //selectedText.Append(L"(0)");
+ selectedText.Format(25, CommonUtil::GetString(L"IDS_BR_BODY_PD_ITEM_SELECTED").GetPointer() , 0);
+
__pSelectedLabel->SetText(selectedText);
__pSelectAllCheck = static_cast< CheckButton* >(GetControl(L"IDC_SELECT_ALL",true));
void
EditHistoryListForm::OnActionPerformed(const Tizen::Ui::Control& source, int actionId)
{
- String selectedText = CommonUtil::GetString(L"IDS_COM_OPT_SELECTED");
+ String selectedText;
SceneManager* pSceneManager = SceneManager::GetInstance();
if (pSceneManager == null)
__pListView->SetItemChecked(groupIndex,itemIndex,true);
}
}
+ /*selectedText.Append(L"\x200E"); // LEFT-TO-RIGHT MARK
selectedText.Append(L"(");
selectedText.Append(selectedCount);
- selectedText.Append(L")");
+ selectedText.Append(L")");*/
+
+ if (selectedCount >1)
+ {
+ selectedText.Format(25, CommonUtil::GetString(L"IDS_BR_POP_PD_ITEMS_SELECTED").GetPointer() , selectedCount);
+ }
+ else
+ {
+ selectedText.Format(25, CommonUtil::GetString(L"IDS_BR_BODY_PD_ITEM_SELECTED").GetPointer() , selectedCount);
+ }
+
__selectedCount = selectedCount;
__pSelectedLabel->SetText(selectedText);
__pSelectedLabel->Invalidate(true);
- GetFooter()->SetItemEnabled(0, true);
- GetFooter()->Invalidate(true);
+ if(__selectedCount > 0)
+ {
+ GetFooter()->SetItemEnabled(1, true);
+ GetFooter()->Invalidate(true);
+ }
__pListView->Invalidate(true);
__pListView->SetItemChecked(groupIndex,itemIndex,false);
}
}
- selectedText.Append(L"(0)");
+ //selectedText.Append(L"\x200E"); // LEFT-TO-RIGHT MARK
+ //selectedText.Append(L"(0)");
+ selectedText.Format(25, CommonUtil::GetString(L"IDS_BR_BODY_PD_ITEM_SELECTED").GetPointer() , 0);
+
__pSelectedLabel->SetText(selectedText);
__selectedCount = 0;
__pSelectedLabel->Invalidate(true);
- GetFooter()->SetItemEnabled(0, false);
+ GetFooter()->SetItemEnabled(1, false);
GetFooter()->Invalidate(true);
__pListView->Invalidate(true);
}
break;
case IDA_DELETE_HISTORY:
- {
+ if(__pConfirmationPopup)
+ {
+ delete __pConfirmationPopup;
+ __pConfirmationPopup = null;
+ }
+ if (!__pConfirmationPopup)
+ {
+ String closeWarning = CommonUtil::GetString(L"IDS_BR_SK3_DELETE");
+ __pConfirmationPopup = new(std::nothrow) ConfirmationPopup();
+ __pConfirmationPopup->Initialize();
+
+ __pConfirmationPopup->RemoveActionListener(*this);
+ __pConfirmationPopup->AddActionListener(*this);
+ __pConfirmationPopup->setMessage(closeWarning);
+ __pConfirmationPopup->Show();
+ }
+ break;
+ case IDA_BUTTON_NO:
+ if(__pConfirmationPopup)
+ {
+ __pConfirmationPopup->SetShowState(false);
+ __pConfirmationPopup->Show();
+ delete __pConfirmationPopup;
+ __pConfirmationPopup = null;
+ }
+ break;
+ case IDA_BUTTON_YES:
+ {
ArrayList* pArrayList = new(std::nothrow) ArrayList();
int itemCount = 0;
int count = 0;
}
}
-
-
__pSelectAllCheck->SetSelected(false);
- GetFooter()->SetItemEnabled(0,false);
+ GetFooter()->SetItemEnabled(1,false);
GetFooter()->Invalidate(true);
- selectedText.Append(L"(0)");
+ //selectedText.Append(L"\x200E"); // LEFT-TO-RIGHT MARK
+ // selectedText.Append(L"(0)");
+ selectedText.Format(25, CommonUtil::GetString(L"IDS_BR_BODY_PD_ITEM_SELECTED").GetPointer() , 0);
__pSelectedLabel->SetText(selectedText);
__selectedCount = 0;
__pSelectedLabel->Invalidate(true);
String notification = CommonUtil::GetString(L"IDS_BR_POP_DELETED");
pNotification->SetText(notification);
pNotification->ShowNotification();
+ if(__pConfirmationPopup)
+ {
+ delete __pConfirmationPopup;
+ __pConfirmationPopup = null;
+ }
+
}
break;
case IDA_CANCEL:
AppLogDebug("EditHistoryListForm::OnActionPerformed Failed to GoBackward %s",GetErrorMessage(r));
return;
}
-
}
break;
return;
}
+ if( __pTimer != NULL)
+ {
+ __pTimer->Cancel();
+ }
result r = pSceneManager->GoBackward(BackwardSceneTransition(IDSCN_HISTORY_LIST, SCENE_TRANSITION_ANIMATION_TYPE_RIGHT));
if (IsFailed(r))
{
if ( pGroupItemClass->__pData == null || pGroupItemClass->__pData->GetCount() == 0)
{
r = pItem->Construct(Dimension(itemWidth, 0));
+ __pListView->SetItemEnabled(groupIndex, -1, false);
}
else
{
text.Append(L" (");
int dayOfWeek = 0 ;
- if (pGroupItemClass->__titleText == L"Today" || pGroupItemClass->__titleText == L"Yesterday")
+ if (pGroupItemClass->__titleText == CommonUtil::GetString(L"IDS_COM_BODY_TODAY") || pGroupItemClass->__titleText == CommonUtil::GetString(L"IDS_COM_BODY_YESTERDAY"))
{
Calendar* pGregorianCalendar = Calendar::CreateInstanceN(CALENDAR_GREGORIAN);
if (pGregorianCalendar != NULL)
switch(dayOfWeek)
{
case 1:
- text.Append(L"Sun");
+ r = text.Append(CommonUtil::GetString(L"IDS_COM_BODY_SUN"));
+ AppLog("dayOfWeek Append Result %s",GetErrorMessage(r));
+ text.Append(L", ");
break;
case 2:
- text.Append(L"Mon");
+ r = text.Append(CommonUtil::GetString(L"IDS_COM_BODY_MON"));
+ AppLog("dayOfWeek Append Result %s",GetErrorMessage(r));
+ text.Append(L", ");
break;
case 3:
- text.Append(L"Tue");
+ r = text.Append(CommonUtil::GetString(L"IDS_COM_BODY_TUE"));
+ AppLog("dayOfWeek Append Result %s",GetErrorMessage(r));
+ text.Append(L", ");
break;
case 4:
- text.Append(L"Wed");
+ r = text.Append(CommonUtil::GetString(L"IDS_COM_BODY_WED"));
+ AppLog("dayOfWeek Append Result %s",GetErrorMessage(r));
+ text.Append(L", ");
break;
case 5:
- text.Append(L"Thu");
+ AppLog("dayOfWeek Append Result yoyo");
+ r = text.Append(CommonUtil::GetString(L"IDS_COM_BODY_THU"));
+ AppLog("dayOfWeek Append Result %s",GetErrorMessage(r));
+ text.Append(L", ");
break;
case 6:
- text.Append(L"Fri");
+ text.Append(CommonUtil::GetString(L"IDS_COM_BODY_FRI"));
+ text.Append(L", ");
break;
case 7:
- text.Append(L"Sat");
+ text.Append(CommonUtil::GetString(L"IDS_COM_BODY_SAT"));
+ text.Append(L", ");
break;
default:
break;
}
- text.Append(L", ");
+
String month = L"";
if (pGroupItemClass->__titleText != L"Older")
{
text.Append(pGroupItemClass->__startTime.GetDay());
- text.Append(L". ");
+ text.Append(L" ");
strMonth = pGroupItemClass->__startTime.GetMonth();
month = GetMonth(strMonth);
text.Append(month);
{
text.Append(L" - ");
text.Append(pGroupItemClass->__endTime.GetDay());
- text.Append(L". ");
+ text.Append(L" ");
strMonth = pGroupItemClass->__endTime.GetMonth();
month = GetMonth(strMonth);
text.Append(month);
}
- text.Append(L".)");
+ text.Append(L")");
AppLogDebug("startTime day = %d month = %d year = %d",pGroupItemClass->__startTime.GetDay(),pGroupItemClass->__startTime.GetMonth(),pGroupItemClass->__startTime.GetYear());
pItem->SetElement(text, null);
}
Bitmap* pBitmap = null;
- r = pItem->Construct(Tizen::Graphics::Dimension(itemWidth, 128), LIST_ANNEX_STYLE_MARK);
+ r = pItem->Construct(Tizen::Graphics::Dimension(itemWidth, 128 + (__fontSize - 44)), LIST_ANNEX_STYLE_MARK);
- bitmapId = pHistory->GetFaviconId();
- pBitmap = FaviconManager::GetInstance()->GetFaviconN(bitmapId);
+
+ pBitmap = pHistory->GetFavIconBitmap();
if (pBitmap == null)
{
pBitmap = FaviconManager::GetInstance()->GetDefaultFaviconN();
if (pBitmap != null)
{
- pItem->AddElement(Rectangle(16, 26, 60, 60), IDA_FORMAT_ICON, *pBitmap, null);
+ pItem->AddElement(Rectangle(16, 26 + (__fontSize - 44)/2, 60, 60), IDA_FORMAT_ICON, *pBitmap, null);
delete pBitmap;
}
- 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);
+ r = pItem->AddElement(Rectangle(92, 4, GetClientAreaBounds().width - 96 - 32 -64 -32, 60 + (__fontSize - 44)), IDA_FORMAT_TITLE, pHistory->GetHistoryTitle(), __fontSize,CUSTOM_COLOR_TRANSPARENT,CUSTOM_COLOR_TRANSPARENT,CUSTOM_COLOR_TRANSPARENT,true);
if (IsFailed(r))
{
delete pItem;
return null;
}
- 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);
+ pItem->AddElement(Rectangle(92, 68 + (__fontSize - 44), GetClientAreaBounds().width - 108 - 32 - bookmarkBtnWidth - 32, 52), IDA_FORMAT_URL, pHistory->GetHistoryUrl(),32,CUSTOM_COLOR_GREY,CUSTOM_COLOR_GREY,CUSTOM_COLOR_GREY,true);
return pItem;
}
int
EditHistoryListForm::GetGroupCount(void)
{
+ result r = E_FAILURE;
AppLogDebug("EditHistoryListForm::GetGroupCount");
__isNoHistoryPresent = true;
CreateGroupItems();
int count = 0;
- HistoryPresentationModel::GetInstance()->GetHistoryCount(count);
+ //HistoryPresentationModel::GetInstance()->GetHistoryCount(count);
+
+ DateTime startTime;
+ startTime.SetValue(0, 1, 1, 0, 0, 0);
+ DateTime endTime;
+ SystemTime::GetCurrentTime(endTime);
+ endTime.SetValue(endTime.GetYear(), endTime.GetMonth(), endTime.GetDay(), 23,59,59);
+
+ r = HistoryPresentationModel::GetInstance()->GetHistoryCountWithTimeRange(startTime ,endTime, count);
+
if(count == 0)
{
__isNoHistoryPresent = false;
if (pGroupItemClass->__pData != null)
{
- pGroupItemClass->__pData->RemoveAll(true);
+ pGroupItemClass->__pData->RemoveAll(false);
delete pGroupItemClass->__pData;
}
pGroupItemClass->__pData = new(std::nothrow) Collection::ArrayList();
AppLogDebug("EditHistoryListForm::OnSceneActivatedN");
int groupCount = 0;
int count = 0;
+ String selectedText = L"";
if(__pGroupData != null)
{
__pListView->UpdateList();
}
__pSelectAllCheck->SetSelected(false);
-
- GetFooter()->SetItemEnabled(0, false);
+ __selectedCount = 0;
+ selectedText.Format(25, CommonUtil::GetString(L"IDS_BR_BODY_PD_ITEM_SELECTED").GetPointer() , __selectedCount);
+ __pSelectedLabel->SetText(selectedText);
+ __pSelectedLabel->Invalidate(true);
+ GetFooter()->SetItemEnabled(1, false);
Invalidate(true);
}
EditHistoryListForm::OnGroupedListViewItemStateChanged(Tizen::Ui::Controls::GroupedListView& listView, int groupIndex, int itemIndex, int elementId, Tizen::Ui::Controls::ListItemStatus status)
{
AppLogDebug("EditHistoryListForm::OnGroupedListViewItemStateChanged entered");
- String selectedText = CommonUtil::GetString(L"IDS_COM_OPT_SELECTED");
+ String selectedText;
bool flag = false;
if (status == LIST_ITEM_STATUS_UNCHECKED)
if (__selectedCount == 0)
{
- GetFooter()->SetItemEnabled(0,false);
+ GetFooter()->SetItemEnabled(1,false);
}
else
{
- GetFooter()->SetItemEnabled(0,true);
+ GetFooter()->SetItemEnabled(1,true);
}
GetFooter()->Invalidate(true);
- selectedText.Append(L"(");
- selectedText.Append(__selectedCount);
- selectedText.Append(L")");
+
+ if (__selectedCount >1)
+ {
+ selectedText.Format(25, CommonUtil::GetString(L"IDS_BR_POP_PD_ITEMS_SELECTED").GetPointer() , __selectedCount);
+ }
+ else
+ {
+ selectedText.Format(25, CommonUtil::GetString(L"IDS_BR_BODY_PD_ITEM_SELECTED").GetPointer() , __selectedCount);
+ }
__pSelectedLabel->SetText(selectedText);
__pSelectedLabel->Invalidate(true);
monthValue.Append(CommonUtil::GetString(L"IDS_COM_BODY_MAR"));;
break;
case 4:
- monthValue.Append(CommonUtil::GetString(L"IDS_COM_BODY_APR"));;
+ monthValue.Append(CommonUtil::GetString(L"IDS_COM_BODY_APRIL"));;
break;
case 5:
monthValue.Append(CommonUtil::GetString(L"IDS_COM_BODY_MAY"));;
break;
case 6:
- monthValue.Append(CommonUtil::GetString(L"IDS_COM_BODY_JUN"));;
+ monthValue.Append(CommonUtil::GetString(L"IDS_COM_BODY_JUNE"));;
break;
case 7:
monthValue.Append(CommonUtil::GetString(L"IDS_COM_BODY_JUL"));;
{
case SUNDAY:
pGroupItemClass = new(std::nothrow) GroupItemClass();
- pGroupItemClass->__titleText = CommonUtil::GetString(L"IDS_EMAIL_BODY_LAST_WEEK");
+ pGroupItemClass->__titleText = CommonUtil::GetString(L"IDS_BR_BODY_LAST_WEEK");
pGroupItemClass->__endTime.SetValue(currentTime.GetYear(),currentTime.GetMonth(), currentTime.GetDay());
pGroupItemClass->__startTime.SetValue(currentTime.GetYear(),currentTime.GetMonth(), 1);
pGroupItemClass->__startTime.AddDays(currentTime.GetDay() - 6 - 1);
case MONDAY:
pGroupItemClass = new(std::nothrow) GroupItemClass();
- pGroupItemClass->__titleText = CommonUtil::GetString(L"IDS_EMAIL_BODY_LAST_WEEK");
+ pGroupItemClass->__titleText = CommonUtil::GetString(L"IDS_BR_BODY_LAST_WEEK");
pGroupItemClass->__endTime.SetValue(currentTime.GetYear(),currentTime.GetMonth(), currentTime.GetDay());
pGroupItemClass->__startTime.SetValue(currentTime.GetYear(),currentTime.GetMonth(), 1);
pGroupItemClass->__startTime.AddDays(currentTime.GetDay() - 7 - 1);
pGroupItemClass->__startTime.AddDays(currentTime.GetDay() - 1 - 1);
__pGroupData->Add(*pGroupItemClass);
pGroupItemClass = new(std::nothrow) GroupItemClass();
- pGroupItemClass->__titleText = CommonUtil::GetString(L"IDS_EMAIL_BODY_LAST_WEEK");
+ pGroupItemClass->__titleText = CommonUtil::GetString(L"IDS_BR_BODY_LAST_WEEK");
pGroupItemClass->__endTime.SetValue(currentTime.GetYear(),currentTime.GetMonth(), 1);
pGroupItemClass->__endTime.AddDays(currentTime.GetDay() - 1 - 1);
pGroupItemClass->__startTime.SetValue(currentTime.GetYear(),currentTime.GetMonth(), 1);
__pGroupData->Add(*pGroupItemClass);
pGroupItemClass = new(std::nothrow) GroupItemClass();
- pGroupItemClass->__titleText = CommonUtil::GetString(L"IDS_EMAIL_BODY_LAST_WEEK");
+ pGroupItemClass->__titleText = CommonUtil::GetString(L"IDS_BR_BODY_LAST_WEEK");
pGroupItemClass->__endTime.SetValue(currentTime.GetYear(),currentTime.GetMonth(), 1);
pGroupItemClass->__endTime.AddDays(currentTime.GetDay() - 2 - 1);
pGroupItemClass->__startTime.SetValue(currentTime.GetYear(),currentTime.GetMonth(), 1);
__pGroupData->Add(*pGroupItemClass);
pGroupItemClass = new(std::nothrow) GroupItemClass();
- pGroupItemClass->__titleText = CommonUtil::GetString(L"IDS_EMAIL_BODY_LAST_WEEK");
+ pGroupItemClass->__titleText = CommonUtil::GetString(L"IDS_BR_BODY_LAST_WEEK");
pGroupItemClass->__endTime.SetValue(currentTime.GetYear(),currentTime.GetMonth(), 1);
pGroupItemClass->__endTime.AddDays(currentTime.GetDay() - 3 - 1);
pGroupItemClass->__startTime.SetValue(currentTime.GetYear(),currentTime.GetMonth(), 1);
__pGroupData->Add(*pGroupItemClass);
pGroupItemClass = new(std::nothrow) GroupItemClass();
- pGroupItemClass->__titleText = CommonUtil::GetString(L"IDS_EMAIL_BODY_LAST_WEEK");
+ pGroupItemClass->__titleText = CommonUtil::GetString(L"IDS_BR_BODY_LAST_WEEK");
pGroupItemClass->__endTime.SetValue(currentTime.GetYear(),currentTime.GetMonth(), 1);
pGroupItemClass->__endTime.AddDays(currentTime.GetDay() - 4 - 1);
pGroupItemClass->__startTime.SetValue(currentTime.GetYear(),currentTime.GetMonth(), 1);
__pGroupData->Add(*pGroupItemClass);
pGroupItemClass = new(std::nothrow) GroupItemClass();
- pGroupItemClass->__titleText = CommonUtil::GetString(L"IDS_EMAIL_BODY_LAST_WEEK");
+ pGroupItemClass->__titleText = CommonUtil::GetString(L"IDS_BR_BODY_LAST_WEEK");
pGroupItemClass->__endTime.SetValue(currentTime.GetYear(),currentTime.GetMonth(), 1);
pGroupItemClass->__endTime.AddDays(currentTime.GetDay() - 5 - 1);
pGroupItemClass->__startTime.SetValue(currentTime.GetYear(),currentTime.GetMonth(), 1);
}
pGroupItemClass = new(std::nothrow) GroupItemClass();
- pGroupItemClass->__titleText = CommonUtil::GetString(L"IDS_EMAIL_BODY_LAST_MONTH");
+ pGroupItemClass->__titleText = CommonUtil::GetString(L"IDS_BR_BODY_LAST_MONTH");
pGroupItemClass->__endTime.SetValue(currentTime.GetYear(),currentTime.GetMonth(), 1);
pGroupItemClass->__endTime.AddDays(-1);
pGroupItemClass->__startTime.SetValue(currentTime.GetYear(), 1, 1);