2 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
4 // Licensed under the Flora License, Version 1.0 (the License);
5 // you may not use this file except in compliance with the License.
6 // You may obtain a copy of the License at
8 // http://floralicense.org/license/
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an AS IS BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
18 * @file GlAllListEditorPanel.cpp
19 * @brief This is the implementation file for AllListEditorPanel class.
24 #include "GlAllListEditorPanel.h"
25 #include "GlCommonUtil.h"
26 #include "GlFileListEditorForm.h"
27 #include "GlFileListPresentationModel.h"
28 #include "GlResourceManager.h"
30 #include "GlFileDeleteTimer.h"
32 using namespace Tizen::App;
33 using namespace Tizen::Base;
34 using namespace Tizen::Base::Collection;
35 using namespace Tizen::Base::Utility;
36 using namespace Tizen::Content;
37 using namespace Tizen::Graphics;
38 using namespace Tizen::Media;
39 using namespace Tizen::Ui::Controls;
40 using namespace Tizen::Ui::Scenes;
42 static const int H_COUNT_LABEL = 48;
43 static const int H_COUNT_LABEL_BUTTON = 42;
44 static const int W_COUNT_LABEL_BUTTON = 42;
45 static const int H_CONTENT_MARGIN = 9;
46 static const int W_CONTENT_MARGIN = 6;
47 static const int W_CONTENT_SPACE = 6;
48 static const int H_CONTENT_SPACE = 6;
49 static const int LENGTH_COUNT_LABEL = 256;
50 static const unsigned int COLOR_COUNT_LABEL = Color32<68, 68, 68>::Value;
51 static const unsigned int COLOR_SELECT_COUNT_FONT = Color32<255, 255, 255>::Value;
52 static const unsigned int COLOR_COUNT_LABEL_BUTTON = Color32<120, 120, 120>::Value;
53 static const Color COLOR_THUMBNAIL_DIM (Color::GetColor(COLOR_ID_BLACK));
54 static const int ALPHA_THUMBNAIL_DIM = 70;
56 static const Rectangle RECT_INITIAL (0, 0, 10, 10);
58 AllListEditorPanel::AllListEditorPanel(void)
59 : __pContentIconListView(null)
60 , __pLabelSelectCnt(null)
61 , __pButtonSelectRegion(null)
63 , __deleteInProgress(false)
64 , __pPresentationModel(null)
68 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
71 AllListEditorPanel::~AllListEditorPanel(void)
75 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
79 AllListEditorPanel::Initialize(void)
82 result r = Construct(RECT_INITIAL);
83 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
89 AllListEditorPanel::OnInitializing(void)
92 const Form* pForm = dynamic_cast<Form*>(GetParent());
93 TryReturn(pForm != null, E_FAILURE, "[%s] fail to get the form.", GetErrorMessage(GetLastResult()));
95 __pPresentationModel = FileListPresentationModel::GetInstance();
96 __pPresentationModel->ClearThumbnailRequests();
97 __pPresentationModel->AddPresentationModelListener(this);
99 Rectangle clientAreaBounds = pForm->GetClientAreaBounds();
100 SetBounds(0, 0, clientAreaBounds.width, clientAreaBounds.height);
102 __pContentIconListView = new (std::nothrow) IconListView();
103 __pContentIconListView->Construct(Rectangle(0, 0, clientAreaBounds.width, clientAreaBounds.height - H_COUNT_LABEL),
104 DIMENSION_DEFAULT_THUMBNAIL, ICON_LIST_VIEW_STYLE_MARK, ICON_LIST_VIEW_SCROLL_DIRECTION_VERTICAL);
105 Bitmap* pBitmapEmpty = ResourceManager::GetBitmapN(IDB_LISTVIEW_EMPTY);
106 if (pBitmapEmpty != null)
108 __pContentIconListView->SetBitmapOfEmptyList(pBitmapEmpty);
111 __pContentIconListView->SetTextOfEmptyList(ResourceManager::GetString(L"IDS_COM_BODY_NO_ITEMS"));
112 __pContentIconListView->SetMargin(MARGIN_TYPE_LEFT, W_CONTENT_MARGIN);
113 __pContentIconListView->SetMargin(MARGIN_TYPE_RIGHT, W_CONTENT_MARGIN);
114 __pContentIconListView->SetMargin(MARGIN_TYPE_TOP, H_CONTENT_MARGIN);
115 __pContentIconListView->SetItemSpacing(W_CONTENT_SPACE, H_CONTENT_SPACE);
116 __pContentIconListView->SetItemBorderStyle(ICON_LIST_VIEW_ITEM_BORDER_STYLE_NONE);
117 __pContentIconListView->SetItemProvider(*this);
118 __pContentIconListView->SetCheckBoxPosition(ICON_LIST_VIEW_CHECK_BOX_POSITION_TOP_LEFT);
119 __pContentIconListView->AddIconListViewItemEventListener(*this);
120 __pContentIconListView->SetTouchAnimationEnabled(false);
121 AddControl(*__pContentIconListView);
122 __pContentIconListView->SetShowState(true);
124 __pLabelSelectCnt = new (std::nothrow) Label();
126 strTmp = ResourceManager::GetString(L"IDS_ST_POP_NO_ITEMS_SELECTED").GetPointer();
127 __pLabelSelectCnt->Construct(
128 Rectangle(0, clientAreaBounds.height-H_COUNT_LABEL, clientAreaBounds.width, H_COUNT_LABEL), strTmp);
129 __pLabelSelectCnt->SetTextVerticalAlignment(ALIGNMENT_MIDDLE);
130 __pLabelSelectCnt->SetTextHorizontalAlignment(ALIGNMENT_LEFT);
131 __pLabelSelectCnt->SetBackgroundColor(COLOR_COUNT_LABEL);
132 __pLabelSelectCnt->SetTextColor(Color(COLOR_SELECT_COUNT_FONT));
133 AddControl(*__pLabelSelectCnt);
134 __pLabelSelectCnt->Invalidate(true);
136 __pButtonSelectRegion = new (std::nothrow) Button();
137 __pButtonSelectRegion->Construct(Rectangle(clientAreaBounds.width - W_COUNT_LABEL_BUTTON - 10,
138 clientAreaBounds.height - H_COUNT_LABEL_BUTTON - 4, W_COUNT_LABEL_BUTTON, H_COUNT_LABEL_BUTTON),
140 __pButtonSelectRegion->SetActionId(ACTION_ID_BUTTON_MOVE_TO_SELECTION);
141 __pButtonSelectRegion->SetColor(BUTTON_STATUS_NORMAL, COLOR_COUNT_LABEL_BUTTON);
142 Bitmap* pSelectionBitmap = ResourceManager::GetBitmapN(IDB_BUTTON_MOVE_SELECTION);
143 if (pSelectionBitmap != null)
145 Rectangle buttonRegionRect = __pButtonSelectRegion->GetBounds();
146 pSelectionBitmap->Scale(Dimension(buttonRegionRect.width, buttonRegionRect.height));
147 __pButtonSelectRegion->SetNormalBitmap(Point(buttonRegionRect.width, buttonRegionRect.height),
150 AddControl(*__pButtonSelectRegion);
152 if (pSelectionBitmap != null)
154 delete pSelectionBitmap;
156 __pButtonSelectRegion->AddActionEventListener(*this);
159 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
165 AllListEditorPanel::OnTerminating(void)
167 AppLogDebug("ENTER");
168 __pPresentationModel->RemovePresentationModelListener(*this);
169 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
175 AllListEditorPanel::UpdatePanelContent()
177 AppLogDebug("ENTER");
178 SceneManager* pSceneManager = SceneManager::GetInstance();
179 FileListEditorForm* pFileListEditorForm =
180 dynamic_cast<FileListEditorForm*>(pSceneManager->GetCurrentScene()->GetForm());
181 TryReturnVoid(pFileListEditorForm != null, "[%s] fail to get SceneManager.",
182 GetErrorMessage(GetLastResult()));
184 if (pFileListEditorForm->GetOverlayStatus() == false && __deleteInProgress == false)
186 SceneManager* pSceneManager = SceneManager::GetInstance();
187 pSceneManager->GoForward(ForwardSceneTransition(IDSCN_ALL_LIST));
188 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
193 AllListEditorPanel::OnActionPerformed(const Control& source, int actionId)
195 AppLogDebug("ENTER");
196 SceneManager* pSceneManager = SceneManager::GetInstance();
197 TryReturnVoid(pSceneManager != null, "[%s] fail to get SceneManager.", GetErrorMessage(GetLastResult()));
201 case ACTION_ID_BUTTON_CHECKED:
203 int loopCount = __pPresentationModel->GetCurrentAlbumContentInfoCount();
204 for (int i=0 ; i < loopCount; ++i)
206 if (__pContentIconListView->IsItemChecked(i) == false)
208 __pContentIconListView->SetItemChecked(i,true);
209 __pContentIconListView->RefreshList(i, LIST_REFRESH_TYPE_ITEM_MODIFY);
212 int checkedCount = GetItemCheckedCount();
215 if (checkedCount == 0)
217 strTmp = ResourceManager::GetString(L"IDS_ST_POP_NO_ITEMS_SELECTED");
219 else if (checkedCount == 1)
221 strTmp = ResourceManager::GetString(L"IDS_VR_POP_1_ITEM_SELECTED");
225 strTmp.Format(LENGTH_COUNT_LABEL,
226 ResourceManager::GetString(L"IDS_VR_POP_PD_ITEMS_SELECTED").GetPointer(), checkedCount);
229 __pLabelSelectCnt->SetText(strTmp);
230 __pLabelSelectCnt->RequestRedraw(true);
234 case ACTION_ID_BUTTON_UNCHECKED:
236 int loopCount = __pPresentationModel->GetCurrentAlbumContentInfoCount();
237 for (int i = 0; i < loopCount; ++i)
239 if (__pContentIconListView->IsItemChecked(i) == true)
241 __pContentIconListView->SetItemChecked(i,false);
244 int checkedCount = GetItemCheckedCount();
247 if (checkedCount == 0)
249 strTmp = ResourceManager::GetString(L"IDS_ST_POP_NO_ITEMS_SELECTED");
251 else if (checkedCount == 1)
253 strTmp = ResourceManager::GetString(L"IDS_VR_POP_1_ITEM_SELECTED");
257 strTmp.Format(LENGTH_COUNT_LABEL,
258 ResourceManager::GetString(L"IDS_VR_POP_PD_ITEMS_SELECTED").GetPointer(), checkedCount);
261 __pLabelSelectCnt->SetText(strTmp);
262 __pLabelSelectCnt->RequestRedraw(true);
263 __pContentIconListView->UpdateList();
267 case ACTION_ID_BUTTON_MOVE_TO_SELECTION:
269 if (pSceneManager->GetCurrentSceneId() == IDSCN_ALL_LIST_EDITOR)
271 IList* pList = GetItemCheckedIndexListN();
274 pList = new (std::nothrow) ArrayList(SingleObjectDeleter);
276 pSceneManager->GoForward(ForwardSceneTransition(IDSCN_ALL_LIST_SELECTION), pList);
280 pSceneManager->GoForward(ForwardSceneTransition(IDSCN_ALL_LIST_SELECTION));
289 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
293 AllListEditorPanel::GetItemCount(void)
295 AppLogDebug("ENTER");
296 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
302 AllListEditorPanel::CreateItem(int index)
304 AppLogDebug("ENTER : index(%d)", index);
305 IconListViewItem* pIconListviewItem;
306 Bitmap* pBitmap = null;
307 String* pItemText = null;
308 result r = __pPresentationModel->GetThumbnailInSyncCacheN(index, pItemText, pBitmap);
309 if (pBitmap == null || r == E_FAILURE)
311 __pPresentationModel->RequestThumbnail(index);
312 pBitmap = CommonUtil::GetEmptyThumbnailN();
315 if (pItemText == null)
317 pItemText = new (std::nothrow) String(ResourceManager::GetString(L"EMPTY_SPACE"));
319 else if ((*pItemText) != ResourceManager::GetString(L"EMPTY_SPACE"))
322 pItemText = new (std::nothrow) String(ResourceManager::GetString(L"EMPTY_SPACE"));
325 if (__pContentIconListView->IsItemChecked(index) == true)
329 BufferInfo bufferInfo;
330 pBitmap->Lock(bufferInfo, INFINITE);
332 Color dimColor(COLOR_THUMBNAIL_DIM);
333 dimColor.SetAlpha(ALPHA_THUMBNAIL_DIM);
336 canvas.Construct(bufferInfo);
337 canvas.FillRectangle(dimColor, canvas.GetBounds());
339 Bitmap* pSelectedBitmap = new (std::nothrow) Bitmap();
340 pSelectedBitmap->Construct(canvas, canvas.GetBounds());
341 pIconListviewItem = new (std::nothrow) IconListViewItem();
342 pIconListviewItem->Construct(*pBitmap, pItemText, pSelectedBitmap);
343 delete pSelectedBitmap;
347 AppLogDebug("EXIT 1(%s)", GetErrorMessage(GetLastResult()));
353 pIconListviewItem = new (std::nothrow) IconListViewItem();
354 pIconListviewItem->Construct(*pBitmap, pItemText);
361 if (pItemText != null)
365 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
367 return pIconListviewItem;
371 AllListEditorPanel::DeleteItem(int index, IconListViewItem* pItem)
373 AppLogDebug("ENTER");
375 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
381 AllListEditorPanel::OnIconListViewItemStateChanged(IconListView& view, int index, IconListViewItemStatus status)
383 AppLogDebug("ENTER");
384 if (status == ICON_LIST_VIEW_ITEM_CHECKED || status == ICON_LIST_VIEW_ITEM_UNCHECKED)
386 int checkedCount = GetItemCheckedCount();
389 if (checkedCount == 0)
391 strTmp = ResourceManager::GetString(L"IDS_ST_POP_NO_ITEMS_SELECTED");
393 else if (checkedCount == 1)
395 strTmp = ResourceManager::GetString(L"IDS_VR_POP_1_ITEM_SELECTED");
399 strTmp.Format(LENGTH_COUNT_LABEL,
400 ResourceManager::GetString(L"IDS_VR_POP_PD_ITEMS_SELECTED").GetPointer(), checkedCount);
403 __pLabelSelectCnt->SetText(strTmp);
404 __pLabelSelectCnt->RequestRedraw(true);
405 __pContentIconListView->RefreshList(index, LIST_REFRESH_TYPE_ITEM_MODIFY);
408 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
412 AllListEditorPanel::OnFileInfoChanged(const ContentType contentType)
414 AppLogDebug("ENTER");
415 if (contentType == CONTENT_TYPE_ALL
416 || contentType == CONTENT_TYPE_IMAGE
417 || contentType == CONTENT_TYPE_VIDEO)
419 __pPresentationModel->RefreshCurrentAlbumContentInfoList(CONTENT_TYPE_ALL);
420 __itemCount = __pPresentationModel->GetCurrentAlbumContentInfoCount();
421 __pContentIconListView->UpdateList();
423 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
427 AllListEditorPanel::OnThumbnailDecoded(const int index)
429 AppLogDebug("ENTER : index(%d)", index);
432 __pContentIconListView->RefreshList(index, LIST_REFRESH_TYPE_ITEM_MODIFY);
434 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
438 AllListEditorPanel::OnSceneActivatedN(const SceneId& previousSceneId,
439 const SceneId& currentSceneId, IList* pArgs)
441 AppLogDebug("ENTER");
442 __pPresentationModel = FileListPresentationModel::GetInstance();
444 SceneManager* pSceneManager = SceneManager::GetInstance();
445 TryReturnVoid(pSceneManager != null, "[%s] fail to get SceneManager.", GetErrorMessage(GetLastResult()));
447 if (previousSceneId == IDSCN_ALL_LIST_SELECTION)
450 if (pArgs != null && pArgs->GetCount() > 0)
452 IList* pSeletedIndexList = pArgs;
453 int loopCount = pSeletedIndexList->GetCount();
454 for (int i = 0; i < loopCount; ++i)
456 int index = static_cast<Integer*>(pSeletedIndexList->GetAt(i))->ToInt();
457 __pContentIconListView->SetItemChecked(index, true);
459 __pContentIconListView->RequestRedraw(true);
462 else if (previousSceneId == IDSCN_ALL_LIST)
469 FileListEditorForm* pFileListEditorForm =
470 dynamic_cast<FileListEditorForm*>(pSceneManager->GetCurrentScene()->GetForm());
471 TryReturnVoid(pFileListEditorForm != null, "[%s] fail to get SceneManager.",
472 GetErrorMessage(GetLastResult()));
474 pFileListEditorForm->SetTitleText(ResourceManager::GetString(L"IDS_COM_BODY_EDIT"));
476 if (pArgs != null && pArgs->GetCount() > 0 && previousSceneId != IDSCN_ALL_LIST_SELECTION)
478 String* pDirectory = static_cast<String*>(pArgs->GetAt(0));
479 if (pDirectory != null && pDirectory->GetLength() > 0)
481 pFileListEditorForm->MoveToAlbum(*pDirectory);
485 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
489 AllListEditorPanel::OnSceneDeactivated(const SceneId& currentSceneId, const SceneId& nextSceneId)
491 AppLogDebug("ENTER");
492 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
496 AllListEditorPanel::GetItemCheckedCount(void) const
498 AppLogDebug("ENTER");
500 if (__pContentIconListView != null)
502 int loopCount = __pPresentationModel->GetCurrentAlbumContentInfoCount();
503 for (int i = 0; i < loopCount; ++i)
505 if (__pContentIconListView->IsItemChecked(i))
511 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
517 AllListEditorPanel::GetItemCheckedIndexListN(void) const
519 AppLogDebug("ENTER");
520 IList* pList = new (std::nothrow) ArrayList(SingleObjectDeleter);
521 Integer* pIndex = null;
523 if (__pContentIconListView!=null)
525 int loopCount = __pPresentationModel->GetCurrentAlbumContentInfoCount();
526 for (int i = 0; i < loopCount; ++i)
528 if (__pContentIconListView->IsItemChecked(i) == true)
530 pIndex = new (std::nothrow) Integer(i);
532 AppLogDebug("checked index(%d)", i);
536 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
542 AllListEditorPanel::OnRequestDelete(void)
544 AppLogDebug("ENTER");
545 IList* pIndexList = GetItemCheckedIndexListN();
546 if (pIndexList->GetCount() <= 0)
549 AppLogDebug("EXIT 1(%s)", GetErrorMessage(GetLastResult()));
554 delete __pFileDelete;
555 __pFileDelete = new FileDeleteTimer(pIndexList, __pPresentationModel, this);
556 result r = __pFileDelete->StartTimer();
560 delete __pFileDelete;
561 __pFileDelete = null;
566 __deleteInProgress = true;
571 void AllListEditorPanel::OnFileOpInvalidate(enum FileActionMode actionId)
573 SceneManager* pSceneManager = SceneManager::GetInstance();
574 FileListEditorForm* pFileListEditorForm =
575 dynamic_cast<FileListEditorForm*>(pSceneManager->GetCurrentScene()->GetForm());
576 TryReturnVoid(pFileListEditorForm != null, "[%s] fail to get SceneManager.",
577 GetErrorMessage(GetLastResult()));
578 pFileListEditorForm->Invalidate(true);
581 void AllListEditorPanel::OnFileOpComplete(enum FileActionMode actionId, enum FileActionCompleteRes res)
583 __deleteInProgress = false;
585 __pLabelSelectCnt->SetText(ResourceManager::GetString(L"IDS_ST_POP_NO_ITEMS_SELECTED"));
586 __pLabelSelectCnt->RequestRedraw(true);
588 __pPresentationModel->RefreshCurrentAlbumContentInfoList(CONTENT_TYPE_ALL);
589 __itemCount = __pPresentationModel->GetCurrentAlbumContentInfoCount();
590 __pContentIconListView->UpdateList();
592 SceneManager* pSceneManager = SceneManager::GetInstance();
593 if (GetItemCount() > 0)
595 pSceneManager->GoForward(ForwardSceneTransition(IDSCN_ALL_LIST));
599 pSceneManager->GoForward(ForwardSceneTransition(IDSCN_ALBUM_LIST));
601 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
605 AllListEditorPanel::OnRequestMessage(void)
607 AppLogDebug("ENTER");
608 IList* pIndexList = GetItemCheckedIndexListN();
609 if (pIndexList == null || pIndexList->GetCount() <= 0)
611 AppLogDebug("EXIT 1(%s)", GetErrorMessage(GetLastResult()));
618 Integer* pIndex = null;
621 int loopCount = pIndexList->GetCount();
622 AppLogDebug("pIndexList->GetCount(%d)", loopCount);
623 for (int i = 0; i < loopCount; ++i)
625 pIndex = static_cast<Integer*>(pIndexList->GetAt(i));
628 checkedIndex = pIndex->ToInt();
629 path = __pPresentationModel->GetContentFilePath(checkedIndex);
632 if (combineText.CompareTo(EMPTY_SPACE) != 0)
634 combineText.Append(L";");
636 combineText.Append(path);
639 HashMap* pDataList = new (std::nothrow) HashMap(SingleObjectDeleter);
640 pDataList->Construct();
641 pDataList->Add(new (std::nothrow) String(APPCONTROL_KEY_TYPE), new (std::nothrow) String(APPCONTROL_DATA_MMS));
642 pDataList->Add(new (std::nothrow) String(APPCONTROL_KEY_ATTACHMENTS), new (std::nothrow) String(combineText));
644 __pPresentationModel->StartAppControl(APPCONTROL_PROVIDER_ID_MESSAGE, APPCONTROL_OPERATION_ID_COMPOSE,
646 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
652 AllListEditorPanel::OnRequestEmail(void)
654 AppLogDebug("ENTER");
655 IList* pIndexList = GetItemCheckedIndexListN();
656 if (pIndexList == null || pIndexList->GetCount() <= 0)
658 AppLogDebug("EXIT 1(%s)", GetErrorMessage(GetLastResult()));
665 Integer* pIndex = null;
668 int loopCount = pIndexList->GetCount();
669 AppLogDebug("pIndexList->GetCount(%d)", loopCount);
670 for (int i = 0; i < loopCount; ++i)
672 pIndex = static_cast<Integer*>(pIndexList->GetAt(i));
675 checkedIndex = pIndex->ToInt();
676 path = __pPresentationModel->GetContentFilePath(checkedIndex);
679 if (combineText.CompareTo(EMPTY_SPACE) != 0)
681 combineText.Append(L";");
683 combineText.Append(path);
686 HashMap* pDataList = new (std::nothrow) HashMap(SingleObjectDeleter);
687 pDataList->Construct();
688 pDataList->Add(new (std::nothrow) String(APPCONTROL_KEY_ATTACHMENTS), new (std::nothrow) String(combineText));
690 __pPresentationModel->StartAppControl(APPCONTROL_PROVIDER_ID_EMAIL, APPCONTROL_OPERATION_ID_COMPOSE,
692 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
698 AllListEditorPanel::OnRequestSlideShow(void)
700 AppLogDebug("ENTER");
701 IList* pIndexList = GetItemCheckedIndexListN();
702 if (pIndexList == null)
704 AppLogDebug("EXIT 1(%s)", GetErrorMessage(GetLastResult()));
709 HashMap* pDataList = new (std::nothrow) HashMap(SingleObjectDeleter);
710 result r = pDataList->Construct();
715 AppLogDebug("EXIT 2(%s)", GetErrorMessage(GetLastResult()));
720 pDataList->Add(new (std::nothrow) String(APPCONTROL_KEY_TYPE),
721 new (std::nothrow) String(APPCONTROL_DATA_SLIDE_SHOW));
723 Integer* pRealIndex = null;
728 int loopCount = pIndexList->GetCount();
731 for (int i = 0; i < loopCount; ++i)
733 pRealIndex = static_cast<Integer*>(pIndexList->GetAt(i));
734 if (pRealIndex != null)
736 realIndex = pRealIndex->ToInt();
739 path = __pPresentationModel->GetContentFilePath(realIndex);
740 if (combineText.CompareTo(EMPTY_SPACE) != 0)
742 combineText.Append(L";");
744 combineText.Append(path);
746 pDataList->Add(new (std::nothrow) String(APPCONTROL_KEY_PATH), new (std::nothrow) String(combineText));
751 __pPresentationModel->StartAppControl(APPCONTROL_PROVIDER_ID_IMAGE,
752 APPCONTROL_OPERATION_ID_VIEW, pDataList, null);
753 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
759 AllListEditorPanel::ResetSelection(void)
761 AppLogDebug("ENTER");
762 __pPresentationModel->RefreshCurrentAlbumContentInfoList(CONTENT_TYPE_ALL);
763 __itemCount = __pPresentationModel->GetCurrentAlbumContentInfoCount();
764 __pContentIconListView->UpdateList();
766 int checkedCount = GetItemCheckedCount();
769 if (checkedCount == 0)
771 strTmp = ResourceManager::GetString(L"IDS_ST_POP_NO_ITEMS_SELECTED");
773 else if (checkedCount == 1)
775 strTmp = ResourceManager::GetString(L"IDS_VR_POP_1_ITEM_SELECTED");
779 strTmp.Format(LENGTH_COUNT_LABEL,
780 ResourceManager::GetString(L"IDS_VR_POP_PD_ITEMS_SELECTED").GetPointer(), checkedCount);
783 __pLabelSelectCnt->SetText(strTmp);
784 __pLabelSelectCnt->RequestRedraw(true);
786 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
790 AllListEditorPanel::SetButtonState(void)
792 AppLogDebug("ENTER");
793 SceneManager* pSceneManager = SceneManager::GetInstance();
794 TryReturnVoid(pSceneManager != null, "[%s] fail to get SceneManager.", GetErrorMessage(GetLastResult()));
796 FileListEditorForm* pFileListEditorForm =
797 dynamic_cast<FileListEditorForm*>(pSceneManager->GetCurrentScene()->GetForm());
798 TryReturnVoid(pFileListEditorForm != null, "[%s] fail to get SceneManager.",
799 GetErrorMessage(GetLastResult()));
801 if (GetItemCheckedCount() > 0)
803 AppLogDebug("BUTTONSTATE : Request Enable");
804 pFileListEditorForm->SetFooterButtonsState(true);
805 __pButtonSelectRegion->SetShowState(true);
809 AppLogDebug("BUTTONSTATE : Request disable");
810 pFileListEditorForm->SetFooterButtonsState(false);
811 __pButtonSelectRegion->SetShowState(false);
813 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
817 AllListEditorPanel::SelectAllPressed(void)
819 bool needToSelectAll = true;
820 int checkedCount = GetItemCheckedCount();
821 int totalFileCount = __pPresentationModel->GetCurrentAlbumContentInfoCount();
822 if (checkedCount == totalFileCount)
824 needToSelectAll = false;
827 if (needToSelectAll == true)
829 for (int i = 0 ; i < totalFileCount; ++i)
831 if (__pContentIconListView->IsItemChecked(i) == false)
833 __pContentIconListView->SetItemChecked(i,true);
834 __pContentIconListView->RefreshList(i, LIST_REFRESH_TYPE_ITEM_MODIFY);
840 for (int i = 0 ; i < totalFileCount; ++i)
842 if (__pContentIconListView->IsItemChecked(i) == true)
844 __pContentIconListView->SetItemChecked(i, false);
845 __pContentIconListView->RefreshList(i, LIST_REFRESH_TYPE_ITEM_MODIFY);
851 if (needToSelectAll == true)
853 tempString.Format(LENGTH_COUNT_LABEL,
854 ResourceManager::GetString(L"IDS_VR_POP_PD_ITEMS_SELECTED").GetPointer(), totalFileCount);
858 tempString = ResourceManager::GetString(L"IDS_ST_POP_NO_ITEMS_SELECTED");
861 __pLabelSelectCnt->SetText(tempString);
862 __pLabelSelectCnt->RequestRedraw(true);