// 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
//
static const wchar_t* IDB_ICON_FOLDER_OPEN = L"I01_icon_folder_open.png";
static const wchar_t* IDB_ITEM = L"edit_item.png";
-static const wchar_t* IDB_RIGHT_ARROW = L"I01_right_arrow.png";
+static const wchar_t* IDB_RIGHT_ARROW = L"00_circle_bg_ef.png";
+static const wchar_t* IDB_RIGHT_ARROW_PRESS = L"00_circle_bg_ef_press.png";
const int EditBookmarkListForm::IDA_BUTTON_CHECKED = 101;
__pListview = null;
__pData = null;
__pTimer = null;
- __parentID = L"-1";
+ __parentID = L"0";
__pInfoPanel = null;
__pInfoLabel = null;
__selectedItemCount = 0;
__pCheckButton = null;
__pConfirmationPopup = null;
__pSelectedList = null;
+ __fontSize = 44;
}
EditBookmarkListForm::~EditBookmarkListForm(void)
result r = E_SUCCESS;
Rectangle rc = GetClientAreaBounds();
- String selected = CommonUtil::GetString(L"IDS_COM_OPT_SELECTED");
+ String selected = CommonUtil::GetString(L"IDS_BR_BODY_PD_ITEM_SELECTED");
// Setup back event listener
SetFormBackEventListener(this);
pSceneManager->AddSceneEventListener(IDSCN_EDIT_BOOKMARK_LIST, *this);
}
+ __fontSize = CommonUtil::GetFontSize();
Header* pHeader = GetHeader();
if (pHeader == NULL)
return E_FAILURE;
}
-// __pListview->SetBounds(__pListview->GetX(), __pListview->GetY(), __pListview->GetWidth(), rc.height - 112 - 48);
__pListview->AddFastScrollListener(*this);
__pListview->AddListViewItemEventListener(*this);
__pListview->SetItemProvider(*this);
-
__pInfoPanel = static_cast< Panel* >(GetControl(
L"IDC_INFO_PANEL", true));
return E_FAILURE;
}
-// __pInfoPanel->SetBounds(Rectangle(0,rc.height - 48, rc.width, 48));
-
- //SetControlAlwaysOnTop(*__pInfoPanel, true);
-
__pInfoLabel = static_cast< Label* >(GetControl(
L"IDC_INFO_LABEL", true));
}
// __pInfoLabel->SetBounds(Rectangle(0,0,rc.width, 48));
- selected.Append(L"(0)");
+ //selected.Append(L"(0)");
+ selected.Format(25, selected.GetPointer() , 0);
__pInfoLabel->SetText(selected);
__pInfoLabel->SetTextConfig(32,LABEL_TEXT_STYLE_BOLD);
switch (actionId)
{
case IDA_DELETEITEM_CLICKED:
+ 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:
{
String labelString;
int count = 0;
GetFooter()->Invalidate(true);
// removing all the element from selected list
__pSelectedList->RemoveAll(false);
- labelString.Append(CommonUtil::GetString(L"IDS_COM_OPT_SELECTED"));
- labelString.Append(L"(0)");
+
+ labelString.Format(25, CommonUtil::GetString(L"IDS_BR_BODY_PD_ITEM_SELECTED").GetPointer() , 0);
+
+ /*labelString.Append(CommonUtil::GetString(L"IDS_BR_BODY_PD_ITEM_SELECTED"));
+ labelString.Append(L"\x200E"); // LEFT-TO-RIGHT MARK
+ labelString.Append(L"(0)");*/
if (__pInfoPanel != null)
{
pNotification->SetText(notification);
pNotification->ShowNotification();
-
+ if(__pConfirmationPopup)
+ {
+ delete __pConfirmationPopup;
+ __pConfirmationPopup = null;
+ }
if( __pListview->GetItemCount() == 0)
{
__pTimer->Start(1000);
GetFooter()->SetItemEnabled(0,true);
GetFooter()->Invalidate(true);
- labelString.Append(CommonUtil::GetString(L"IDS_COM_OPT_SELECTED"));
- labelString.Append(L"(");
- labelString.Append(__pListview->GetItemCount());
- labelString.Append(L")");
+ if(__pListview->GetItemCount() >1)
+ {
+ labelString.Format(25, CommonUtil::GetString(L"IDS_BR_POP_PD_ITEMS_SELECTED").GetPointer() , __pListview->GetItemCount());
+ }
+ else
+ {
+ labelString.Format(25, CommonUtil::GetString(L"IDS_BR_BODY_PD_ITEM_SELECTED").GetPointer() , __pListview->GetItemCount());
+ }
+
+ __selectedItemCount = 0;
__pInfoLabel->SetText(labelString);
__pInfoPanel->Draw();
__pInfoPanel->Show();
+ __pSelectedList->RemoveAll();
int totalCount = __pData->GetCount();
for(int index = 0; index < totalCount; index++)
{
BookmarkData* pBookMark = dynamic_cast< BookmarkData* >(__pData->GetAt(index));
if (pBookMark == null)
{
-
+ continue;
}
String *pBookmarkId = new(std::nothrow) String();
if(pBookMark->GetBookmarkType() == BOOKMARK_TYPE_FOLDER)
__pListview->SetItemChecked(count,false);
}
- labelString.Append(CommonUtil::GetString(L"IDS_COM_OPT_SELECTED"));
- labelString.Append(L"(0)");
+ /*labelString.Append(CommonUtil::GetString(L"IDS_BR_BODY_PD_ITEM_SELECTED"));
+ labelString.Append(L"\x200E"); // LEFT-TO-RIGHT MARK
+ labelString.Append(L"(0)");*/
+
+ labelString.Format(25, CommonUtil::GetString(L"IDS_BR_BODY_PD_ITEM_SELECTED").GetPointer() , 0);
+
__pInfoLabel->SetText(labelString);
__pInfoPanel->Draw();
__pInfoPanel->Show();
}
if (pBookMark->GetBookmarkType() == BOOKMARK_TYPE_FOLDER)
{
- r = pItem->Construct(Tizen::Graphics::Dimension(itemWidth, 112), style);
+ r = pItem->Construct(Tizen::Graphics::Dimension(itemWidth, 112 - 44 + __fontSize), style);
TryCatch( r == E_SUCCESS,,"EditBookmarkListForm::CreateItem contruct item failed %s",GetErrorMessage(r));
pBitmap = AppResource::GetInstance()->GetBitmapN(IDB_ICON_FOLDER_OPEN);
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;
}
- pItem->AddElement(Rectangle(92, 8, width_Title/*__pListview->GetWidth() - 92 - 80*/, 112), IDA_FORMAT_FOLDER, pBookMark->GetBookmarkTitle(), true);
-
+ pItem->AddElement(Rectangle(92, 8, width_Title/*__pListview->GetWidth() - 92 - 80*/, 112 + (__fontSize - 44)), IDA_FORMAT_FOLDER, pBookMark->GetBookmarkTitle(),__fontSize, CUSTOM_COLOR_TRANSPARENT,CUSTOM_COLOR_TRANSPARENT,CUSTOM_COLOR_TRANSPARENT,true);
pBitmap = AppResource::GetInstance()->GetBitmapN(IDB_ITEM);
if (pBitmap != null)
{
- pItem->AddElement(Rectangle(GetClientAreaBounds().width - 92 - 80, 20, 60, 60), IDA_FORMAT_BITMAP, *pBitmap, null, null);
+ pItem->AddElement(Rectangle(GetClientAreaBounds().width - 92 - 80, 20 + (__fontSize - 44)/2, 60, 60), IDA_FORMAT_BITMAP, *pBitmap, null, null);
pItem->SetElementSelectionEnabled(IDA_FORMAT_BITMAP, true);
delete pBitmap;
}
}
else
{
- r = pItem->Construct(Tizen::Graphics::Dimension(itemWidth, 128), style);
+ r = pItem->Construct(Tizen::Graphics::Dimension(itemWidth, 128 + (__fontSize - 44)), style);
TryCatch( r == E_SUCCESS,,"EditBookmarkListForm::CreateItem contruct item failed %s",GetErrorMessage(r));
pBitmap = pBookMark->GetFavIconBitmap();
pBitmap = FaviconManager::GetInstance()->GetDefaultFaviconN();
}
- pItem->AddElement(Rectangle(16, 28, 72, 72), IDA_FORMAT_ICON, *pBitmap, null);
+ pItem->AddElement(Rectangle(16, 28 + (__fontSize - 44)/2, 72, 72), IDA_FORMAT_ICON, *pBitmap, null);
delete pBitmap;
- pItem->AddElement(Rectangle(104, 10, width_Title, itemHeight - height_Url), IDA_FORMAT_SITE, pBookMark->GetBookmarkTitle(), true);
- pItem->AddElement(Rectangle(x_Margin_Url, y_Margin_Url, width_Url, height_Url), IDA_FORMAT_URL, pBookMark->GetUrl(),textSize,CUSTOM_COLOR_GREY,CUSTOM_COLOR_GREY,CUSTOM_COLOR_GREY,true);
+ pItem->AddElement(Rectangle(104, 10, width_Title, itemHeight - height_Url + (__fontSize - 44)), IDA_FORMAT_SITE, pBookMark->GetBookmarkTitle(),__fontSize,CUSTOM_COLOR_TRANSPARENT,CUSTOM_COLOR_TRANSPARENT,CUSTOM_COLOR_TRANSPARENT,true);
+ pItem->AddElement(Rectangle(x_Margin_Url, y_Margin_Url + (__fontSize - 44), width_Url, height_Url), IDA_FORMAT_URL, pBookMark->GetUrl(),textSize,CUSTOM_COLOR_GREY,CUSTOM_COLOR_LISTVIEW_TEXT,CUSTOM_COLOR_LISTVIEW_TEXT,true);
//pBitmap = AppResource::GetInstance()->GetBitmapN("I01_picker_arrow_right.png");
pBitmap = AppResource::GetInstance()->GetBitmapN(IDB_RIGHT_ARROW);
- if (pBitmap != null)
+ Bitmap* pPressedBitmap = AppResource::GetInstance()->GetBitmapN(IDB_RIGHT_ARROW_PRESS);
+ if (pBitmap != null && pPressedBitmap != null)
{
- pItem->AddElement(Rectangle(GetClientAreaBounds().width - 92 - 84, 32, 64, 64), IDA_FORMAT_BITMAP, *pBitmap, null, null);
+ pItem->AddElement(Rectangle(GetClientAreaBounds().width - 92 - 84-4, 32 + (__fontSize - 44)/2-4, 72, 72), IDA_FORMAT_BITMAP, *pBitmap, pPressedBitmap, null);
pItem->SetElementSelectionEnabled(IDA_FORMAT_BITMAP, true);
delete pBitmap;
+ delete pPressedBitmap;
}
}
return pItem;
SceneManager* pSceneManager = SceneManager::GetInstance();
BookmarkData* pBookMark = dynamic_cast< BookmarkData* >(__pData->GetAt(index));
-
if(pBookMark == NULL)
{
return;
}
- String *pBookmarkId = new(std::nothrow) String();
- if(pBookMark->GetBookmarkType() == BOOKMARK_TYPE_FOLDER)
- {
- pBookmarkId->Append("F");
- }
- else
- {
- pBookmarkId->Append("U");
- }
- pBookmarkId->Append(pBookMark->GetBookmarkId());
-
-// if (__pListview->IsItemChecked(index) == true)
-// {
-// __pListview->SetItemChecked(index, false);
-// __pSelectedList->Remove(*pBookmarkId);
-// }
-// else
-// {
-// __pListview->SetItemChecked(index, true);
-// __pSelectedList->Add(pBookmarkId);
-// }
if (pBookMark->GetBookmarkType() == BOOKMARK_TYPE_FOLDER)
{
}
//labelString.Append(__selectedItemCount);
- labelString.Append(CommonUtil::GetString(L"IDS_COM_OPT_SELECTED"));
+ /*labelString.Append(CommonUtil::GetString(L"IDS_BR_BODY_PD_ITEM_SELECTED"));
+ labelString.Append(L"\x200E"); // LEFT-TO-RIGHT MARK
labelString.Append(L"(");
labelString.Append(__selectedItemCount);
- labelString.Append(L")");
+ labelString.Append(L")");*/
+
+ if(__selectedItemCount >1)
+ {
+ labelString.Format(25, CommonUtil::GetString(L"IDS_BR_POP_PD_ITEMS_SELECTED").GetPointer() , __selectedItemCount);
+ }
+ else
+ {
+ labelString.Format(25, CommonUtil::GetString(L"IDS_BR_BODY_PD_ITEM_SELECTED").GetPointer() , __selectedItemCount);
+ }
+
__pInfoLabel->SetText(labelString);
__pInfoPanel->Draw();
__pInfoPanel->Show();
__selectedItemCount = 0;
- labelString.Append(CommonUtil::GetString(L"IDS_COM_OPT_SELECTED"));
- labelString.Append(L"(");
- labelString.Append(__pSelectedList->GetCount());
- labelString.Append(L")");
- __pInfoLabel->SetText(labelString);
+
__pListview->UpdateList();
count = __pListview->GetItemCount();
+ if(count == 0)
+ {
+ __pTimer->Start(1000);
+ }
for(int index = 0 ; index < count ; index++)
{
}
pBookmarkId->Append(pBookMark->GetBookmarkId());
- AppLog("BookmarkId: %ls", pBookmarkId->GetPointer());
-
if(__pSelectedList->Contains(*pBookmarkId))
{
__pListview->SetItemChecked(index,true);
{
__pListview->SetItemChecked(index,false);
}
+ if (pBookmarkId)
+ {
+ delete pBookmarkId;
+ pBookmarkId = null;
+ }
}
- if(__selectedItemCount < __pListview->GetItemCount())
+
+ //if(previousSceneId == IDSCN_ADD_BOOKMARK)
+ // return;
+
+ if(__selectedItemCount >1)
+ {
+ labelString.Format(25, CommonUtil::GetString(L"IDS_BR_POP_PD_ITEMS_SELECTED").GetPointer() , __selectedItemCount);
+ }
+ else
+ {
+ labelString.Format(25, CommonUtil::GetString(L"IDS_BR_BODY_PD_ITEM_SELECTED").GetPointer() , __selectedItemCount);
+ }
+
+ __pInfoLabel->SetText(labelString);
+
+
+ if(__selectedItemCount == 0)
{
- __pCheckButton->SetSelected(false);
GetFooter()->SetItemEnabled(0, false);
GetFooter()->Invalidate(true);
}
else
{
- __pCheckButton->SetSelected(true);
GetFooter()->SetItemEnabled(0, true);
GetFooter()->Invalidate(true);
}
-
-
- __pInfoPanel->Draw();
- __pInfoPanel->Show();
-
+ if(__selectedItemCount < __pListview->GetItemCount())
+ {
+ __pCheckButton->SetSelected(false);
+ }
+ else
+ {
+ __pCheckButton->SetSelected(true);
+ }
+
Invalidate(true);
-
}
void
if ( __pTimer != NULL)
{
__pTimer->Cancel();
+ delete __pTimer;
}
if (pSceneManager != null)
}
}
}
+
+void
+EditBookmarkListForm::OnUserEventReceivedN (RequestId requestId, Tizen::Base::Collection::IList *pArgs)
+{
+ AppLog("receiving userevent for appcontrol %d",requestId);
+ if (requestId == APPCONTROL_LAUNCH_MAX_LIMIT_REACHED)
+ {
+ AppLog("receiving userevent for appcontrol %d ",requestId);
+ if(__pConfirmationPopup)
+ {
+ __pConfirmationPopup->SetShowState(false);
+ delete __pConfirmationPopup;
+ __pConfirmationPopup = null;
+ }
+ }
+}