3 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
5 // Licensed under the Flora License, Version 1.1 (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: EditBookmarkListForm
20 *@brief: This class defines EditBookmarkListForm used to edit the bookmark
24 #include <FAppUiApp.h>
27 #include "IntBookmarkData.h"
28 #include "IntBookmarkPresentationModel.h"
29 #include "IntCommonLib.h"
30 #include "IntEditBookmarkListForm.h"
31 #include "IntFaviconManager.h"
32 #include "IntSceneRegister.h"
35 using namespace Tizen::App;
36 using namespace Tizen::Base;
37 using namespace Tizen::Base::Collection;
38 using namespace Tizen::Base::Runtime;
39 using namespace Tizen::Graphics;
40 using namespace Tizen::Ui;
41 using namespace Tizen::Ui::Controls;
42 using namespace Tizen::Ui::Scenes;
44 static const wchar_t* IDB_ICON_FOLDER_OPEN = L"I01_icon_folder_open.png";
45 static const wchar_t* IDB_ITEM = L"edit_item.png";
46 static const wchar_t* IDB_RIGHT_ARROW = L"00_circle_bg_ef.png";
47 static const wchar_t* IDB_RIGHT_ARROW_PRESS = L"00_circle_bg_ef_press.png";
50 const int EditBookmarkListForm::IDA_BUTTON_CHECKED = 101;
51 const int EditBookmarkListForm::IDA_TABBAR_ITEM_1 = 102;
52 const int EditBookmarkListForm::IDA_TABBAR_ITEM_2 = 103;
53 const int EditBookmarkListForm::IDA_DELETEITEM_CLICKED = 104;
54 const int EditBookmarkListForm::IDA_SHAREITEM_CLICKED = 105;
55 const int EditBookmarkListForm::IDA_CANCELITEM_CLICKED = 106;
56 const int EditBookmarkListForm::IDA_FORMAT_FOLDER = 107;
57 const int EditBookmarkListForm::IDA_FORMAT_SITE = 108;
58 const int EditBookmarkListForm::IDA_FORMAT_ICON = 109;
59 const int EditBookmarkListForm::IDA_FORMAT_BITMAP = 110;
60 const int EditBookmarkListForm::IDA_BUTTON_UNCHECKED = 111;
61 const int EditBookmarkListForm::IDA_FORMAT_URL = 112;
64 EditBookmarkListForm::EditBookmarkListForm(void)
72 __selectedItemCount = 0;
73 __pCheckButton = null;
74 __pConfirmationPopup = null;
75 __pSelectedList = null;
77 __pNotification = null;
80 EditBookmarkListForm::~EditBookmarkListForm(void)
84 __pData->RemoveAll(false);
87 if(__pSelectedList != null)
89 __pSelectedList->RemoveAll(false);
90 delete __pSelectedList;
92 // if(__pNotification)
93 // delete __pNotification;
97 EditBookmarkListForm::Initialize(void)
99 Construct(L"IDL_EDIT_BOOKMARK_LIST");
104 EditBookmarkListForm::OnInitializing(void)
106 result r = E_SUCCESS;
108 Rectangle rc = GetClientAreaBounds();
109 String selected = CommonUtil::GetString(L"IDS_BR_BODY_PD_ITEM_SELECTED");
111 // Setup back event listener
112 SetFormBackEventListener(this);
113 AddOrientationEventListener(*this);
115 SceneManager* pSceneManager = SceneManager::GetInstance();
117 if (pSceneManager != null)
119 pSceneManager->AddSceneEventListener(IDSCN_EDIT_BOOKMARK_LIST, *this);
122 __fontSize = CommonUtil::GetFontSize();
123 Header* pHeader = GetHeader();
129 pHeader->SetTitleText(CommonUtil::GetString(L"IDS_BR_HEADER_EDIT_BOOKMARK"));
131 __pCheckButton = static_cast< CheckButton* >(GetControl(
132 L"IDC_SELECT_CHECKBUTTON", true));
134 if (__pCheckButton == null)
139 __pCheckButton->SetActionId(IDA_BUTTON_CHECKED, IDA_BUTTON_UNCHECKED);
140 __pCheckButton->AddActionEventListener(*this);
142 __pListview = static_cast< ListView* >(GetControl("IDC_LISTVIEW1"));
144 if (__pListview == null)
149 __pListview->AddFastScrollListener(*this);
150 __pListview->AddListViewItemEventListener(*this);
151 __pListview->SetItemProvider(*this);
153 __pInfoPanel = static_cast< Panel* >(GetControl(
154 L"IDC_INFO_PANEL", true));
156 if (__pInfoPanel == null)
161 __pInfoLabel = static_cast< Label* >(GetControl(
162 L"IDC_INFO_LABEL", true));
164 if (__pInfoLabel == null)
169 // __pInfoLabel->SetBounds(Rectangle(0,0,rc.width, 48));
170 //selected.Append(L"(0)");
171 selected.Format(25, selected.GetPointer() , 0);
172 __pInfoLabel->SetText(selected);
174 __pInfoLabel->SetTextConfig(32,LABEL_TEXT_STYLE_BOLD);
175 //__pInfoLabel->SetBackgroundColor(CUSTOM_COLOR_INFO_LABEL);
176 __pInfoLabel->SetTextVerticalAlignment(ALIGNMENT_MIDDLE);
177 __pInfoLabel->SetTextHorizontalAlignment(ALIGNMENT_CENTER);
178 GetFooter()->SetItemEnabled(0,false);
179 GetFooter()->AddActionEventListener(*this);
180 __pTimer = new (std::nothrow) Timer();
181 __pTimer->Construct(*this);
183 __pSelectedList = new(std::nothrow) ArrayList();
184 __pSelectedList->Construct();
189 EditBookmarkListForm::OnActionPerformed(const Tizen::Ui::Control& source, int actionId)
191 result r = E_SUCCESS;
193 SceneManager* pSceneManager = SceneManager::GetInstance();
197 case IDA_DELETEITEM_CLICKED:
198 if(__pConfirmationPopup)
200 delete __pConfirmationPopup;
201 __pConfirmationPopup = null;
203 if (!__pConfirmationPopup)
205 String closeWarning = CommonUtil::GetString(L"IDS_BR_SK3_DELETE");
206 __pConfirmationPopup = new(std::nothrow) ConfirmationPopup();
207 __pConfirmationPopup->Initialize();
209 __pConfirmationPopup->RemoveActionListener(*this);
210 __pConfirmationPopup->AddActionListener(*this);
211 __pConfirmationPopup->setMessage(closeWarning);
212 __pConfirmationPopup->Show();
216 if(__pConfirmationPopup)
218 __pConfirmationPopup->SetShowState(false);
219 __pConfirmationPopup->Show();
220 delete __pConfirmationPopup;
221 __pConfirmationPopup = null;
228 if(__pListview == null)
232 int totalCount = __pListview->GetItemCount();
233 for (int count = 0;count < totalCount;count++)
235 if (__pListview->IsItemChecked(count))
239 BookmarkData* pBookMark = dynamic_cast< BookmarkData* >(__pData->GetAt(count));
240 if (pBookMark == null)
244 bookmarkId = pBookMark->GetBookmarkId();
245 Integer::Parse(bookmarkId,id);
247 if (pBookMark->GetBookmarkType() == BOOKMARK_TYPE_URL)
249 r = BookmarkPresentationModel::GetInstance()->DeleteBookmark(id);
250 TryCatch( r == E_SUCCESS,,"EditBookmarkListForm::OnActionPerformed BookmarkPresentationModel::GetInstance()->DeleteBookmark failed %s",GetErrorMessage(r));
254 r = BookmarkPresentationModel::GetInstance()->DeleteFolder(id);
255 TryCatch( r == E_SUCCESS,,"EditBookmarkListForm::OnActionPerformed BookmarkPresentationModel::GetInstance()->DeleteBookmark failed %s",GetErrorMessage(r));
260 if (__pListview != null)
262 count = __pListview->GetItemCount();
264 for(int index = 0; index < count ; index ++)
266 if(__pListview->IsItemChecked(index) == true )
268 __pListview->SetItemChecked(index,false);
272 __pCheckButton->SetSelected(false);
273 __pListview->UpdateList();
275 if ( __pListview->GetItemCount() == 0)
277 __pCheckButton->SetShowState(false);
278 __pCheckButton->Invalidate(true);
279 if (__pInfoPanel != null)
281 __pInfoPanel->SetShowState(false);
283 r = __pListview->SetBounds(__pListview->GetX(), 0, __pListview->GetWidth(), GetClientAreaBounds().height);
292 GetFooter()->SetItemEnabled(0,false);
293 GetFooter()->Invalidate(true);
294 // removing all the element from selected list
295 __pSelectedList->RemoveAll(false);
297 labelString.Format(25, CommonUtil::GetString(L"IDS_BR_BODY_PD_ITEM_SELECTED").GetPointer() , 0);
299 /*labelString.Append(CommonUtil::GetString(L"IDS_BR_BODY_PD_ITEM_SELECTED"));
300 labelString.Append(L"\x200E"); // LEFT-TO-RIGHT MARK
301 labelString.Append(L"(0)");*/
303 if (__pInfoPanel != null)
305 __pInfoLabel->SetText(labelString);
306 __pInfoPanel->Draw();
307 __pInfoPanel->Show();
310 // if(__pNotification)
312 //// delete __pNotification;
313 // __pNotification = null;
315 __pNotification = new (std::nothrow) NotificationPanel(*this);
316 String notification = CommonUtil::GetString(L"IDS_BR_POP_DELETED");
317 __pNotification->SetText(notification);
318 __pNotification->ShowNotification();
320 if(__pConfirmationPopup)
322 delete __pConfirmationPopup;
323 __pConfirmationPopup = null;
325 if( __pListview->GetItemCount() == 0)
327 __pTimer->Start(1000);
331 case IDA_CANCELITEM_CLICKED:
333 if ( __pTimer != NULL)
337 if(pSceneManager != NULL)
339 r = pSceneManager->GoBackward(BackwardSceneTransition());
343 AppLogDebug("EditBookmarkListForm::OnActionPerformed Failed to GoBackward %s",GetErrorMessage(r));
348 case IDA_BUTTON_CHECKED:
353 for (int count = 0;count < __pListview->GetItemCount();count++)
355 __pListview->SetItemChecked(count,true);
358 GetFooter()->SetItemEnabled(0,true);
359 GetFooter()->Invalidate(true);
361 if(__pListview->GetItemCount() >1)
363 labelString.Format(25, CommonUtil::GetString(L"IDS_BR_POP_PD_ITEMS_SELECTED").GetPointer() , __pListview->GetItemCount());
367 labelString.Format(25, CommonUtil::GetString(L"IDS_BR_BODY_PD_ITEM_SELECTED").GetPointer() , __pListview->GetItemCount());
370 __selectedItemCount = 0;
372 __pInfoLabel->SetText(labelString);
373 __pInfoPanel->Draw();
374 __pInfoPanel->Show();
376 __pSelectedList->RemoveAll();
377 int totalCount = __pData->GetCount();
378 for(int index = 0; index < totalCount; index++)
380 BookmarkData* pBookMark = dynamic_cast< BookmarkData* >(__pData->GetAt(index));
381 if (pBookMark == null)
385 String *pBookmarkId = new(std::nothrow) String();
386 if(pBookMark->GetBookmarkType() == BOOKMARK_TYPE_FOLDER)
388 pBookmarkId->Append("F");
392 pBookmarkId->Append("U");
394 pBookmarkId->Append(pBookMark->GetBookmarkId());
396 __pListview->SetItemChecked(index, true);
397 __pSelectedList->Add(pBookmarkId);
399 __pListview->Invalidate(true);
402 case IDA_BUTTON_UNCHECKED:
404 String labelString = L"";
406 for (int count = 0;count < __pListview->GetItemCount();count++)
408 __pListview->SetItemChecked(count,false);
411 /*labelString.Append(CommonUtil::GetString(L"IDS_BR_BODY_PD_ITEM_SELECTED"));
412 labelString.Append(L"\x200E"); // LEFT-TO-RIGHT MARK
413 labelString.Append(L"(0)");*/
415 labelString.Format(25, CommonUtil::GetString(L"IDS_BR_BODY_PD_ITEM_SELECTED").GetPointer() , 0);
417 __pInfoLabel->SetText(labelString);
418 __pInfoPanel->Draw();
419 __pInfoPanel->Show();
420 __pSelectedList->RemoveAll(true);
421 __pListview->Invalidate(true);
423 GetFooter()->SetItemEnabled(0,false);
424 GetFooter()->Invalidate(true);
435 EditBookmarkListForm::CreateItem(int index, int itemWidth)
437 result r = E_SUCCESS;
438 ListAnnexStyle style = LIST_ANNEX_STYLE_MARK;
439 CustomItem* pItem = null;
440 BookmarkData* pBookMark = null;
441 Bitmap* pBitmap = null;
443 const int x_Margin_Url = 104;
444 const int y_Margin_Url = 70;
445 const int height_Url = 40;
446 const int width_Url = GetClientAreaBounds().width - 104 - 120 - 16 - 48;
447 const int itemHeight = 112;
448 const int textSize = 32;
449 const int width_Title = GetClientAreaBounds().width - 104 - 120 - 16 - 48;
451 pItem = new(std::nothrow) CustomItem();
456 pBookMark = dynamic_cast< BookmarkData* >(__pData->GetAt(index));
457 if (pBookMark == null)
463 if (pBookMark->GetBookmarkType() == BOOKMARK_TYPE_FOLDER)
465 r = pItem->Construct(Tizen::Graphics::Dimension(itemWidth, 112 - 44 + __fontSize), style);
466 TryCatch( r == E_SUCCESS,,"EditBookmarkListForm::CreateItem contruct item failed %s",GetErrorMessage(r));
468 pBitmap = AppResource::GetInstance()->GetBitmapN(IDB_ICON_FOLDER_OPEN);
472 pItem->AddElement(Rectangle(16, 26+(__fontSize - 44)/2, 60, 60), IDA_FORMAT_ICON, *pBitmap, null);
476 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);
478 pBitmap = AppResource::GetInstance()->GetBitmapN(IDB_ITEM);
482 pItem->AddElement(Rectangle(GetClientAreaBounds().width - 92 - 80, 20 + (__fontSize - 44)/2, 60, 60), IDA_FORMAT_BITMAP, *pBitmap, null, null);
483 pItem->SetElementSelectionEnabled(IDA_FORMAT_BITMAP, true);
489 r = pItem->Construct(Tizen::Graphics::Dimension(itemWidth, 128 + (__fontSize - 44)), style);
490 TryCatch( r == E_SUCCESS,,"EditBookmarkListForm::CreateItem contruct item failed %s",GetErrorMessage(r));
492 pBitmap = pBookMark->GetFavIconBitmap();
496 pBitmap = FaviconManager::GetInstance()->GetDefaultFaviconN();
499 pItem->AddElement(Rectangle(16, 28 + (__fontSize - 44)/2, 72, 72), IDA_FORMAT_ICON, *pBitmap, null);
502 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);
503 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);
505 //pBitmap = AppResource::GetInstance()->GetBitmapN("I01_picker_arrow_right.png");
506 pBitmap = AppResource::GetInstance()->GetBitmapN(IDB_RIGHT_ARROW);
507 Bitmap* pPressedBitmap = AppResource::GetInstance()->GetBitmapN(IDB_RIGHT_ARROW_PRESS);
508 if (pBitmap != null && pPressedBitmap != null)
510 pItem->AddElement(Rectangle(GetClientAreaBounds().width - 92 - 84-4, 32 + (__fontSize - 44)/2-4, 72, 72), IDA_FORMAT_BITMAP, *pBitmap, pPressedBitmap, null);
511 pItem->SetElementSelectionEnabled(IDA_FORMAT_BITMAP, true);
513 delete pPressedBitmap;
525 EditBookmarkListForm::DeleteItem(int index, Tizen::Ui::Controls::ListItemBase* pItem, int itemWidth)
533 EditBookmarkListForm::GetItemCount(void)
536 result r = E_SUCCESS;
538 BookmarkPresentationModel::GetInstance()->GetFolderBookmarkCount(__parentID, count);
542 __pData->RemoveAll(true);
547 __pData = new(std::nothrow) ArrayList();
554 r = __pData->Construct();
556 TryCatch( r == E_SUCCESS,,"EditBookmarkListForm::GetItemCount __pData->Construct() failed %s",GetErrorMessage(r));
558 BookmarkPresentationModel::GetInstance()->GetFoldersBookmarks(__parentID, 0, count, *__pData);
563 if(__pCheckButton != null)
565 __pCheckButton->SetShowState(false);
567 if(__pInfoPanel != null)
569 __pInfoPanel->SetShowState(false);
571 __pListview->SetBounds(__pListview->GetX(), 0, __pListview->GetWidth(), GetClientAreaBounds().height);
576 if(__pCheckButton != null)
578 __pCheckButton->SetShowState(true);
580 if(__pInfoPanel != null)
582 __pInfoPanel->SetShowState(true);
584 if(__pCheckButton != null && __pInfoPanel != null)
585 __pListview->SetBounds(__pListview->GetX(), __pListview->GetY(), __pListview->GetWidth(), GetClientAreaBounds().height - __pCheckButton->GetHeight() - __pInfoPanel->GetHeight());
588 if(__pCheckButton != null)
590 __pCheckButton->Invalidate(true);
592 if(__pInfoPanel != null)
594 __pInfoPanel->Invalidate(false);
600 __pData->RemoveAll(true);
607 EditBookmarkListForm::OnListViewContextItemStateChanged(Tizen::Ui::Controls::ListView& listView, int index, int elementId, Tizen::Ui::Controls::ListContextItemStatus status)
613 EditBookmarkListForm::OnListViewItemLongPressed(Tizen::Ui::Controls::ListView& listView, int index, int elementId, bool& invokeListViewItemCallback)
619 EditBookmarkListForm::OnListViewItemStateChanged(Tizen::Ui::Controls::ListView& listView, int index, int elementId, Tizen::Ui::Controls::ListItemStatus status)
622 __selectedItemCount = 0;
623 result r = E_SUCCESS;
627 case IDA_FORMAT_BITMAP:
629 ArrayList* pArgList = null;
630 SceneManager* pSceneManager = SceneManager::GetInstance();
631 BookmarkData* pBookMark = dynamic_cast< BookmarkData* >(__pData->GetAt(index));
633 if(pBookMark == NULL)
638 if (pBookMark->GetBookmarkType() == BOOKMARK_TYPE_FOLDER)
640 pArgList = new(std::nothrow) ArrayList();
642 if (pArgList != null)
644 pArgList->Construct();
645 pArgList->Add(*new(std::nothrow) BookmarkData(*pBookMark));
646 if ( pSceneManager != null)
648 result r = pSceneManager->GoForward(ForwardSceneTransition(IDSCN_CREATE_BOOKMARK_FOLDER, SCENE_TRANSITION_ANIMATION_TYPE_NONE),pArgList);
651 if (pArgList != null)
653 pArgList->RemoveAll(false);
659 AppLogDebug("BookmarkListForm::CreateItem Construct failed %s",GetErrorMessage(r));
666 pArgList = new(std::nothrow) ArrayList();
668 if (pArgList != null)
670 pArgList->Construct();
671 pArgList->Add(*new(std::nothrow) String(L"1"));
672 pArgList->Add(*new(std::nothrow) BookmarkData(*pBookMark));
673 if ( pSceneManager != null)
675 result r = pSceneManager->GoForward(ForwardSceneTransition(IDSCN_ADD_BOOKMARK, SCENE_TRANSITION_ANIMATION_TYPE_NONE), pArgList);
677 if (pArgList != null)
679 pArgList->RemoveAll(false);
685 AppLogDebug("BookmarkListForm::CreateItem Construct failed %s",GetErrorMessage(r));
697 BookmarkData* pBookMark = dynamic_cast< BookmarkData* >(__pData->GetAt(index));
700 if(pBookMark == NULL)
704 String *pBookmarkId = new(std::nothrow) String();
705 if(pBookMark->GetBookmarkType() == BOOKMARK_TYPE_FOLDER)
707 pBookmarkId->Append("F");
711 pBookmarkId->Append("U");
713 pBookmarkId->Append(pBookMark->GetBookmarkId());
715 if (__pListview->IsItemChecked(index) == false)
717 __pSelectedList->Remove(*pBookmarkId);
721 __pSelectedList->Add(pBookmarkId);
725 int itemCount = __pListview->GetItemCount();
726 for (int count = 0;count < itemCount ; count++)
728 if (__pListview->IsItemChecked(count))
730 __selectedItemCount++;
734 //labelString.Append(__selectedItemCount);
735 /*labelString.Append(CommonUtil::GetString(L"IDS_BR_BODY_PD_ITEM_SELECTED"));
736 labelString.Append(L"\x200E"); // LEFT-TO-RIGHT MARK
737 labelString.Append(L"(");
738 labelString.Append(__selectedItemCount);
739 labelString.Append(L")");*/
741 if(__selectedItemCount >1)
743 labelString.Format(25, CommonUtil::GetString(L"IDS_BR_POP_PD_ITEMS_SELECTED").GetPointer() , __selectedItemCount);
747 labelString.Format(25, CommonUtil::GetString(L"IDS_BR_BODY_PD_ITEM_SELECTED").GetPointer() , __selectedItemCount);
750 __pInfoLabel->SetText(labelString);
751 __pInfoPanel->Draw();
752 __pInfoPanel->Show();
753 BookmarkPresentationModel::GetInstance()->GetFolderBookmarkCount(__parentID,count);
754 if (__selectedItemCount == count)
756 __pCheckButton->SetSelected(true);
760 __pCheckButton->SetSelected(false);
763 itemCount = __pListview->GetItemCount();
764 for (int count = 0;count < itemCount ;count++)
766 if (__pListview->IsItemChecked(count))
775 GetFooter()->SetItemEnabled(0,true);
779 GetFooter()->SetItemEnabled(0,false);
782 GetFooter()->Invalidate(true);
790 EditBookmarkListForm::OnListViewItemSwept(Tizen::Ui::Controls::ListView& listView, int index, Tizen::Ui::Controls::SweepDirection direction)
796 EditBookmarkListForm::OnFastScrollIndexSelected(Tizen::Ui::Control& source, Tizen::Base::String& index)
801 EditBookmarkListForm::OnListViewItemReordered(Tizen::Ui::Controls::ListView& listView, int indexFrom, int indexTo)
807 EditBookmarkListForm::OnSceneActivatedN(const SceneId& previousSceneId, const SceneId& currentSceneId, IList* pArgs)
809 result r = E_FAILURE;
812 BookmarkData* pBookMark = null;
817 String* pStr = dynamic_cast<String*>(pArgs->GetAt(0));
822 __parentID.Append(pStr->GetPointer());
825 __selectedItemCount = 0;
828 __pListview->UpdateList();
830 count = __pListview->GetItemCount();
833 __pTimer->Start(1000);
836 for(int index = 0 ; index < count ; index++)
838 pBookMark = dynamic_cast< BookmarkData* >(__pData->GetAt(index));
840 if(pBookMark == NULL)
844 String *pBookmarkId = new(std::nothrow) String();
845 if(pBookMark->GetBookmarkType() == BOOKMARK_TYPE_FOLDER)
847 pBookmarkId->Append("F");
851 pBookmarkId->Append("U");
853 pBookmarkId->Append(pBookMark->GetBookmarkId());
855 if(__pSelectedList->Contains(*pBookmarkId))
857 __pListview->SetItemChecked(index,true);
858 __selectedItemCount++;
862 __pListview->SetItemChecked(index,false);
871 //if(previousSceneId == IDSCN_ADD_BOOKMARK)
874 if(__selectedItemCount >1)
876 labelString.Format(25, CommonUtil::GetString(L"IDS_BR_POP_PD_ITEMS_SELECTED").GetPointer() , __selectedItemCount);
880 labelString.Format(25, CommonUtil::GetString(L"IDS_BR_BODY_PD_ITEM_SELECTED").GetPointer() , __selectedItemCount);
883 __pInfoLabel->SetText(labelString);
886 if(__selectedItemCount == 0)
888 GetFooter()->SetItemEnabled(0, false);
889 GetFooter()->Invalidate(true);
893 GetFooter()->SetItemEnabled(0, true);
894 GetFooter()->Invalidate(true);
896 if(__selectedItemCount < __pListview->GetItemCount())
898 __pCheckButton->SetSelected(false);
902 __pCheckButton->SetSelected(true);
909 EditBookmarkListForm::OnSceneDeactivated(const SceneId& currentSceneId, const SceneId& nextSceneId)
915 EditBookmarkListForm::OnFormBackRequested(Form& source)
917 SceneManager* pSceneManager = SceneManager::GetInstance();
919 if ( __pTimer != NULL)
925 if (pSceneManager != null)
927 //pSceneManager->GoBackward(BackwardSceneTransition(IDSCN_BOOKMARK_VIEW, SCENE_TRANSITION_ANIMATION_TYPE_RIGHT));
928 result r = pSceneManager->GoBackward(BackwardSceneTransition());
931 AppLogDebug("BookmarkListForm::CreateItem Construct failed %s",GetErrorMessage(r));
936 GetFooter()->Invalidate(true);
940 void EditBookmarkListForm::OnOrientationChanged(const Tizen::Ui::Control &source, Tizen::Ui::OrientationStatus orientationStatus)
943 ArrayList* pCheckedItems = NULL ;
946 __pNotification->SetShowState(false);
948 if (__pListview != null)
950 AppLog("the list Y axis is %d", __pListview->GetY());
951 pCheckedItems = new(std::nothrow) ArrayList();
952 pCheckedItems->Construct();
953 if ( __pListview->GetItemCount() == 0)
955 __pCheckButton->SetShowState(false);
956 __pInfoPanel->SetShowState(false);
957 __pListview->SetBounds(0, __pListview->GetY(), GetClientAreaBounds().width, GetClientAreaBounds().height -__pListview->GetY());
962 AppLog("EditBookmarkListForm::OnOrientationChanged 1");
963 __pCheckButton->SetShowState(true);
964 __pInfoPanel->SetShowState(true);
965 __pListview->SetBounds(__pListview->GetX(), __pListview->GetY(), __pListview->GetWidth(), GetClientAreaBounds().height - __pCheckButton->GetHeight() - __pInfoPanel->GetHeight());
966 __pInfoLabel->SetBounds(__pInfoLabel->GetX(),__pInfoLabel->GetY(), GetClientAreaBounds().width,__pInfoLabel->GetHeight());
967 __pInfoLabel->Invalidate(true);
969 __pCheckButton->Invalidate(true);
971 itemCount = __pListview->GetItemCount();
973 for (int count = 0;count < itemCount ; count++)
976 if (__pListview->IsItemChecked(count))
978 pCheckedItems->Add(* new Integer(count));
982 // __pListview->UpdateList();
984 for (int count = 0;count < itemCount ;count++)
986 if (pCheckedItems->Contains(* new Integer(count)) == true)
988 __pListview->SetItemChecked(count, true);
991 if ( pCheckedItems != NULL )
993 pCheckedItems->RemoveAll(true);
994 delete pCheckedItems;
1001 EditBookmarkListForm::OnTimerExpired(Timer& timer)
1003 SceneManager* pSceneManager = SceneManager::GetInstance();
1005 if ( pSceneManager != NULL)
1007 result r = pSceneManager->GoBackward(BackwardSceneTransition());
1010 AppLogDebug("EditBookmarkListForm::OnTimerExpired GoBackward failed %s",GetErrorMessage(r));
1016 EditBookmarkListForm::OnUserEventReceivedN (RequestId requestId, Tizen::Base::Collection::IList *pArgs)
1018 AppLog("receiving userevent for appcontrol %d",requestId);
1019 if (requestId == APPCONTROL_LAUNCH_MAX_LIMIT_REACHED)
1021 AppLog("receiving userevent for appcontrol %d ",requestId);
1022 if(__pConfirmationPopup)
1024 __pConfirmationPopup->SetShowState(false);
1025 delete __pConfirmationPopup;
1026 __pConfirmationPopup = null;