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_SELECTALL_REGION = 112;
43 static const int H_COUNT_LABEL = 48;
44 static const int H_COUNT_LABEL_BUTTON = 42;
45 static const int W_COUNT_LABEL_BUTTON = 42;
46 static const int H_CONTENT_MARGIN = 9;
47 static const int W_CONTENT_MARGIN = 6;
48 static const int W_CONTENT_SPACE = 6;
49 static const int H_CONTENT_SPACE = 6;
50 static const int LENGTH_COUNT_LABEL = 256;
51 static const unsigned int COLOR_COUNT_LABEL = Color32<68, 68, 68>::Value;
52 static const unsigned int COLOR_SELECT_COUNT_FONT = Color32<255, 255, 255>::Value;
53 static const unsigned int COLOR_COUNT_LABEL_BUTTON = Color32<120, 120, 120>::Value;
54 static const unsigned int COLOR_SELECTALL_REGION = Color32<0x2A, 0x36, 0x4A>::Value;
55 static const Color COLOR_THUMBNAIL_DIM (Color::GetColor(COLOR_ID_BLACK));
56 static const int ALPHA_THUMBNAIL_DIM = 70;
58 static const Rectangle RECT_INITIAL (0, 0, 10, 10);
60 AllListEditorPanel::AllListEditorPanel(void)
61 : __pContentIconListView(null)
62 , __pCheckButton(null)
63 , __pLabelSelectCnt(null)
64 , __pButtonSelectRegion(null)
66 , __deleteInProgress(false)
67 , __pPresentationModel(null)
71 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
74 AllListEditorPanel::~AllListEditorPanel(void)
78 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
82 AllListEditorPanel::Initialize(void)
85 result r = Construct(RECT_INITIAL);
86 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
92 AllListEditorPanel::OnInitializing(void)
95 const Form* pForm = dynamic_cast<Form*>(GetParent());
96 TryReturn(pForm != null, E_FAILURE, "[%s] fail to get the form.", GetErrorMessage(GetLastResult()));
98 __pPresentationModel = FileListPresentationModel::GetInstance();
99 __pPresentationModel->ClearThumbnailRequests();
100 __pPresentationModel->AddPresentationModelListener(this);
102 Rectangle clientAreaBounds = pForm->GetClientAreaBounds();
103 clientAreaBounds.x = clientAreaBounds.y = 0;
104 result r = SetBounds(clientAreaBounds);
106 Panel* pCheckPanel = new (std::nothrow) Panel();
107 pCheckPanel->Construct(Rectangle(0, 0, clientAreaBounds.width, H_SELECTALL_REGION));
108 pCheckPanel->SetBackgroundColor(COLOR_SELECTALL_REGION);
109 __pCheckButton = new (std::nothrow) CheckButton();
110 __pCheckButton->Construct(pCheckPanel->GetBounds(), CHECK_BUTTON_STYLE_MARK, BACKGROUND_STYLE_DEFAULT, false,
111 ResourceManager::GetString(L"IDS_COM_BODY_SELECT_ALL"));
112 __pCheckButton->SetActionId(ACTION_ID_BUTTON_CHECKED, ACTION_ID_BUTTON_UNCHECKED);
113 __pCheckButton->AddActionEventListener(*this);
114 pCheckPanel->AddControl(*__pCheckButton);
115 AddControl(*pCheckPanel);
117 __pContentIconListView = new (std::nothrow) IconListView();
118 __pContentIconListView->Construct(Rectangle(0, H_SELECTALL_REGION, clientAreaBounds.width,
119 clientAreaBounds.height - H_COUNT_LABEL - H_SELECTALL_REGION), DIMENSION_DEFAULT_THUMBNAIL,
120 ICON_LIST_VIEW_STYLE_MARK, ICON_LIST_VIEW_SCROLL_DIRECTION_VERTICAL);
121 Bitmap* pBitmapEmpty = ResourceManager::GetBitmapN(IDB_LISTVIEW_EMPTY);
122 if (pBitmapEmpty != null)
124 __pContentIconListView->SetBitmapOfEmptyList(pBitmapEmpty);
128 __pContentIconListView->SetTextOfEmptyList(ResourceManager::GetString(L"IDS_COM_BODY_NO_ITEMS"));
129 __pContentIconListView->SetMargin(MARGIN_TYPE_LEFT, W_CONTENT_MARGIN);
130 __pContentIconListView->SetMargin(MARGIN_TYPE_RIGHT, W_CONTENT_MARGIN);
131 __pContentIconListView->SetMargin(MARGIN_TYPE_TOP, H_CONTENT_MARGIN);
132 __pContentIconListView->SetItemSpacing(W_CONTENT_SPACE, H_CONTENT_SPACE);
133 __pContentIconListView->SetItemBorderStyle(ICON_LIST_VIEW_ITEM_BORDER_STYLE_NONE);
134 __pContentIconListView->SetItemProvider(*this);
135 __pContentIconListView->SetCheckBoxPosition(ICON_LIST_VIEW_CHECK_BOX_POSITION_TOP_LEFT);
136 __pContentIconListView->AddIconListViewItemEventListener(*this);
137 __pContentIconListView->SetTouchAnimationEnabled(false);
138 AddControl(*__pContentIconListView);
139 __pContentIconListView->SetShowState(true);
141 __pLabelSelectCnt = new (std::nothrow) Label();
143 strTmp = ResourceManager::GetString(L"IDS_ST_POP_NO_ITEMS_SELECTED").GetPointer();
144 __pLabelSelectCnt->Construct(
145 Rectangle(0, clientAreaBounds.height-H_COUNT_LABEL, clientAreaBounds.width, H_COUNT_LABEL), strTmp);
146 __pLabelSelectCnt->SetTextVerticalAlignment(ALIGNMENT_MIDDLE);
147 __pLabelSelectCnt->SetTextHorizontalAlignment(ALIGNMENT_LEFT);
148 __pLabelSelectCnt->SetBackgroundColor(COLOR_COUNT_LABEL);
149 __pLabelSelectCnt->SetTextColor(Color(COLOR_SELECT_COUNT_FONT));
150 AddControl(*__pLabelSelectCnt);
151 __pLabelSelectCnt->Invalidate(true);
153 __pButtonSelectRegion = new (std::nothrow) Button();
154 __pButtonSelectRegion->Construct(Rectangle(clientAreaBounds.width - W_COUNT_LABEL_BUTTON - 10,
155 clientAreaBounds.height - H_COUNT_LABEL_BUTTON - 4, W_COUNT_LABEL_BUTTON, H_COUNT_LABEL_BUTTON),
157 __pButtonSelectRegion->SetActionId(ACTION_ID_BUTTON_MOVE_TO_SELECTION);
158 __pButtonSelectRegion->SetColor(BUTTON_STATUS_NORMAL, COLOR_COUNT_LABEL_BUTTON);
159 Bitmap* pSelectionBitmap = ResourceManager::GetBitmapN(IDB_BUTTON_MOVE_SELECTION);
160 if (pSelectionBitmap != null)
162 Rectangle buttonRegionRect = __pButtonSelectRegion->GetBounds();
163 pSelectionBitmap->Scale(Dimension(buttonRegionRect.width, buttonRegionRect.height));
164 __pButtonSelectRegion->SetNormalBitmap(Point(buttonRegionRect.width, buttonRegionRect.height),
167 AddControl(*__pButtonSelectRegion);
169 if (pSelectionBitmap != null)
171 delete pSelectionBitmap;
172 pSelectionBitmap = null;
174 __pButtonSelectRegion->AddActionEventListener(*this);
177 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
183 AllListEditorPanel::OnTerminating(void)
185 AppLogDebug("ENTER");
186 __pPresentationModel->RemovePresentationModelListener(*this);
187 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
193 AllListEditorPanel::UpdatePanelContent()
195 AppLogDebug("ENTER");
196 SceneManager* pSceneManager = SceneManager::GetInstance();
197 FileListEditorForm* pFileListEditorForm =
198 dynamic_cast<FileListEditorForm*>(pSceneManager->GetCurrentScene()->GetForm());
199 TryReturnVoid(pFileListEditorForm != null, "[%s] fail to get SceneManager.",
200 GetErrorMessage(GetLastResult()));
202 if ( pFileListEditorForm->GetOverlayStatus() == false && __deleteInProgress == false )
204 SceneManager* pSceneManager = SceneManager::GetInstance();
205 pSceneManager->GoForward(ForwardSceneTransition(IDSCN_ALL_LIST));
206 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
211 AllListEditorPanel::OnActionPerformed(const Control& source, int actionId)
213 AppLogDebug("ENTER");
214 SceneManager* pSceneManager = SceneManager::GetInstance();
215 TryReturnVoid(pSceneManager != null, "[%s] fail to get SceneManager.", GetErrorMessage(GetLastResult()));
219 case ACTION_ID_BUTTON_CHECKED:
221 int loopCount = __pPresentationModel->GetCurrentAlbumContentInfoCount();
222 for (int i=0 ; i < loopCount; ++i)
224 if (__pContentIconListView->IsItemChecked(i) == false)
226 __pContentIconListView->SetItemChecked(i,true);
227 __pContentIconListView->RefreshList(i, LIST_REFRESH_TYPE_ITEM_MODIFY);
230 int checkedCount = GetItemCheckedCount();
233 if (checkedCount == 0)
235 strTmp = ResourceManager::GetString(L"IDS_ST_POP_NO_ITEMS_SELECTED");
237 else if (checkedCount == 1)
239 strTmp = ResourceManager::GetString(L"IDS_VR_POP_1_ITEM_SELECTED");
243 strTmp.Format(LENGTH_COUNT_LABEL,
244 ResourceManager::GetString(L"IDS_VR_POP_PD_ITEMS_SELECTED").GetPointer(), checkedCount);
247 __pLabelSelectCnt->SetText(strTmp);
248 __pLabelSelectCnt->RequestRedraw(true);
252 case ACTION_ID_BUTTON_UNCHECKED:
254 int loopCount = __pPresentationModel->GetCurrentAlbumContentInfoCount();
255 for (int i = 0; i < loopCount; ++i)
257 if (__pContentIconListView->IsItemChecked(i) == true)
259 __pContentIconListView->SetItemChecked(i,false);
262 int checkedCount = GetItemCheckedCount();
265 if (checkedCount == 0)
267 strTmp = ResourceManager::GetString(L"IDS_ST_POP_NO_ITEMS_SELECTED");
269 else if (checkedCount == 1)
271 strTmp = ResourceManager::GetString(L"IDS_VR_POP_1_ITEM_SELECTED");
275 strTmp.Format(LENGTH_COUNT_LABEL,
276 ResourceManager::GetString(L"IDS_VR_POP_PD_ITEMS_SELECTED").GetPointer(), checkedCount);
279 __pLabelSelectCnt->SetText(strTmp);
280 __pLabelSelectCnt->RequestRedraw(true);
281 __pContentIconListView->UpdateList();
285 case ACTION_ID_BUTTON_MOVE_TO_SELECTION:
287 if (pSceneManager->GetCurrentSceneId() == IDSCN_ALL_LIST_EDITOR)
289 IList* pList = GetItemCheckedIndexListN();
292 pList = new (std::nothrow) ArrayList(SingleObjectDeleter);
294 pSceneManager->GoForward(ForwardSceneTransition(IDSCN_ALL_LIST_SELECTION), pList);
298 pSceneManager->GoForward(ForwardSceneTransition(IDSCN_ALL_LIST_SELECTION));
307 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
311 AllListEditorPanel::GetItemCount(void)
313 AppLogDebug("ENTER");
314 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
320 AllListEditorPanel::CreateItem(int index)
322 AppLogDebug("ENTER : index(%d)", index);
323 IconListViewItem* pIconListviewItem;
324 Bitmap* pBitmap = null;
325 String* pItemText = null;
326 result r = __pPresentationModel->GetThumbnailInSyncCacheN(index, pItemText, pBitmap);
327 if (pBitmap == null || r == E_FAILURE)
329 __pPresentationModel->RequestThumbnail(index);
330 pBitmap = CommonUtil::GetEmptyThumbnailN();
333 if (pItemText == null)
335 pItemText = new (std::nothrow) String(ResourceManager::GetString(L"EMPTY_SPACE"));
337 else if ((*pItemText) != ResourceManager::GetString(L"EMPTY_SPACE"))
340 pItemText = new (std::nothrow) String(ResourceManager::GetString(L"EMPTY_SPACE"));
343 if (__pContentIconListView->IsItemChecked(index) == true)
347 BufferInfo bufferInfo;
348 pBitmap->Lock(bufferInfo, INFINITE);
350 Color dimColor(COLOR_THUMBNAIL_DIM);
351 dimColor.SetAlpha(ALPHA_THUMBNAIL_DIM);
354 canvas.Construct(bufferInfo);
355 canvas.FillRectangle(dimColor, canvas.GetBounds());
357 Bitmap* pSelectedBitmap = new (std::nothrow) Bitmap();
358 pSelectedBitmap->Construct(canvas, canvas.GetBounds());
359 pIconListviewItem = new (std::nothrow) IconListViewItem();
360 pIconListviewItem->Construct(*pBitmap, pItemText, pSelectedBitmap);
361 delete pSelectedBitmap;
362 pSelectedBitmap = null;
366 AppLogDebug("EXIT 1(%s)", GetErrorMessage(GetLastResult()));
372 pIconListviewItem = new (std::nothrow) IconListViewItem();
373 pIconListviewItem->Construct(*pBitmap, pItemText);
381 if (pItemText != null)
386 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
388 return pIconListviewItem;
392 AllListEditorPanel::DeleteItem(int index, IconListViewItem* pItem)
394 AppLogDebug("ENTER");
396 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
402 AllListEditorPanel::OnIconListViewItemStateChanged(IconListView& view, int index, IconListViewItemStatus status)
404 AppLogDebug("ENTER");
405 if (status == ICON_LIST_VIEW_ITEM_CHECKED || status == ICON_LIST_VIEW_ITEM_UNCHECKED)
407 int checkedCount = GetItemCheckedCount();
410 if (checkedCount == 0)
412 strTmp = ResourceManager::GetString(L"IDS_ST_POP_NO_ITEMS_SELECTED");
414 else if (checkedCount == 1)
416 strTmp = ResourceManager::GetString(L"IDS_VR_POP_1_ITEM_SELECTED");
420 strTmp.Format(LENGTH_COUNT_LABEL,
421 ResourceManager::GetString(L"IDS_VR_POP_PD_ITEMS_SELECTED").GetPointer(), checkedCount);
424 __pLabelSelectCnt->SetText(strTmp);
425 __pLabelSelectCnt->RequestRedraw(true);
426 if (__pCheckButton->IsSelected() == true)
428 __pCheckButton->SetSelected(false);
432 if (checkedCount != 0 && checkedCount == __pPresentationModel->GetCurrentAlbumContentInfoCount())
434 __pCheckButton->SetSelected(true);
437 __pContentIconListView->RefreshList(index, LIST_REFRESH_TYPE_ITEM_MODIFY);
440 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
444 AllListEditorPanel::OnFileInfoChanged(const ContentType contentType)
446 AppLogDebug("ENTER");
447 if (contentType == CONTENT_TYPE_ALL
448 || contentType == CONTENT_TYPE_IMAGE
449 || contentType == CONTENT_TYPE_VIDEO)
451 __pPresentationModel->RefreshCurrentAlbumContentInfoList(CONTENT_TYPE_ALL);
452 __itemCount = __pPresentationModel->GetCurrentAlbumContentInfoCount();
453 __pContentIconListView->UpdateList();
455 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
459 AllListEditorPanel::OnThumbnailDecoded(const int index)
461 AppLogDebug("ENTER : index(%d)", index);
464 __pContentIconListView->RefreshList(index, LIST_REFRESH_TYPE_ITEM_MODIFY);
466 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
470 AllListEditorPanel::OnSceneActivatedN(const SceneId& previousSceneId,
471 const SceneId& currentSceneId, IList* pArgs)
473 AppLogDebug("ENTER");
474 __pPresentationModel = FileListPresentationModel::GetInstance();
476 SceneManager* pSceneManager = SceneManager::GetInstance();
477 TryReturnVoid(pSceneManager != null, "[%s] fail to get SceneManager.", GetErrorMessage(GetLastResult()));
479 if (previousSceneId == IDSCN_ALL_LIST_SELECTION)
483 else if (previousSceneId == IDSCN_ALL_LIST)
490 FileListEditorForm* pFileListEditorForm =
491 dynamic_cast<FileListEditorForm*>(pSceneManager->GetCurrentScene()->GetForm());
492 TryReturnVoid(pFileListEditorForm != null, "[%s] fail to get SceneManager.",
493 GetErrorMessage(GetLastResult()));
495 pFileListEditorForm->SetTitleText(ResourceManager::GetString(L"IDS_COM_BODY_EDIT"));
497 if (pArgs != null && pArgs->GetCount() > 0)
499 String* pDirectory = static_cast<String*>(pArgs->GetAt(0));
500 if (pDirectory != null && pDirectory->GetLength() > 0)
502 pFileListEditorForm->MoveToAlbum(*pDirectory);
506 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
510 AllListEditorPanel::OnSceneDeactivated(const SceneId& currentSceneId, const SceneId& nextSceneId)
512 AppLogDebug("ENTER");
513 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
517 AllListEditorPanel::GetItemCheckedCount(void) const
519 AppLogDebug("ENTER");
521 if (__pContentIconListView != null)
523 int loopCount = __pPresentationModel->GetCurrentAlbumContentInfoCount();
524 for (int i = 0; i < loopCount; ++i)
526 if (__pContentIconListView->IsItemChecked(i))
532 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
538 AllListEditorPanel::GetItemCheckedIndexListN(void) const
540 AppLogDebug("ENTER");
541 IList* pList = new (std::nothrow) ArrayList(SingleObjectDeleter);
542 Integer* pIndex = null;
544 if (__pContentIconListView!=null)
546 int loopCount = __pPresentationModel->GetCurrentAlbumContentInfoCount();
547 for (int i = 0; i < loopCount; ++i)
549 if (__pContentIconListView->IsItemChecked(i) == true)
551 pIndex = new (std::nothrow) Integer(i);
553 AppLogDebug("checked index(%d)", i);
557 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
563 AllListEditorPanel::OnRequestDelete(void)
565 AppLogDebug("ENTER");
566 IList* pIndexList = GetItemCheckedIndexListN();
567 if (pIndexList->GetCount() <= 0)
570 AppLogDebug("EXIT 1(%s)", GetErrorMessage(GetLastResult()));
575 delete __pFileDelete;
576 __pFileDelete = new FileDeleteTimer(pIndexList,
577 __pPresentationModel,
579 result r = __pFileDelete->StartTimer();
583 delete __pFileDelete;
584 __pFileDelete = null;
589 __deleteInProgress = true;
594 void AllListEditorPanel::OnFileOpInvalidate(enum FileActionMode actionId)
596 SceneManager* pSceneManager = SceneManager::GetInstance();
597 FileListEditorForm* pFileListEditorForm =
598 dynamic_cast<FileListEditorForm*>(pSceneManager->GetCurrentScene()->GetForm());
599 TryReturnVoid(pFileListEditorForm != null, "[%s] fail to get SceneManager.",
600 GetErrorMessage(GetLastResult()));
601 pFileListEditorForm->Invalidate(true);
604 void AllListEditorPanel::OnFileOpComplete(enum FileActionMode actionId, enum FileActionCompleteRes res)
606 __pCheckButton->SetSelected(false);
607 __deleteInProgress = false;
609 __pLabelSelectCnt->SetText(ResourceManager::GetString(L"IDS_ST_POP_NO_ITEMS_SELECTED"));
610 __pLabelSelectCnt->RequestRedraw(true);
612 __pPresentationModel->RefreshCurrentAlbumContentInfoList(CONTENT_TYPE_ALL);
613 __itemCount = __pPresentationModel->GetCurrentAlbumContentInfoCount();
614 __pContentIconListView->UpdateList();
616 SceneManager* pSceneManager = SceneManager::GetInstance();
617 if (GetItemCount() > 0)
619 pSceneManager->GoForward(ForwardSceneTransition(IDSCN_ALL_LIST));
623 pSceneManager->GoForward(ForwardSceneTransition(IDSCN_ALBUM_LIST));
625 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
629 AllListEditorPanel::OnRequestMessage(void)
631 AppLogDebug("ENTER");
632 IList* pIndexList = GetItemCheckedIndexListN();
633 if (pIndexList == null || pIndexList->GetCount() <= 0)
635 AppLogDebug("EXIT 1(%s)", GetErrorMessage(GetLastResult()));
642 Integer* pIndex = null;
645 int loopCount = pIndexList->GetCount();
646 AppLogDebug("pIndexList->GetCount(%d)", loopCount);
647 for (int i = 0; i < loopCount; ++i)
649 pIndex = static_cast<Integer*>(pIndexList->GetAt(i));
652 checkedIndex = pIndex->ToInt();
653 path = __pPresentationModel->GetContentFilePath(checkedIndex);
656 if (combineText.CompareTo(EMPTY_SPACE) != 0)
658 combineText.Append(L";");
660 combineText.Append(path);
663 HashMap* pDataList = new (std::nothrow) HashMap(SingleObjectDeleter);
664 pDataList->Construct();
665 pDataList->Add(new (std::nothrow) String(APPCONTROL_KEY_TYPE), new (std::nothrow) String(APPCONTROL_DATA_MMS));
666 pDataList->Add(new (std::nothrow) String(APPCONTROL_KEY_ATTACHMENTS), new (std::nothrow) String(combineText));
668 __pPresentationModel->StartAppControl(APPCONTROL_PROVIDER_ID_MESSAGE, APPCONTROL_OPERATION_ID_COMPOSE,
670 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
676 AllListEditorPanel::OnRequestEmail(void)
678 AppLogDebug("ENTER");
679 IList* pIndexList = GetItemCheckedIndexListN();
680 if (pIndexList == null || pIndexList->GetCount() <= 0)
682 AppLogDebug("EXIT 1(%s)", GetErrorMessage(GetLastResult()));
689 Integer* pIndex = null;
692 int loopCount = pIndexList->GetCount();
693 AppLogDebug("pIndexList->GetCount(%d)", loopCount);
694 for (int i = 0; i < loopCount; ++i)
696 pIndex = static_cast<Integer*>(pIndexList->GetAt(i));
699 checkedIndex = pIndex->ToInt();
700 path = __pPresentationModel->GetContentFilePath(checkedIndex);
703 if (combineText.CompareTo(EMPTY_SPACE) != 0)
705 combineText.Append(L";");
707 combineText.Append(path);
710 HashMap* pDataList = new (std::nothrow) HashMap(SingleObjectDeleter);
711 pDataList->Construct();
712 pDataList->Add(new (std::nothrow) String(APPCONTROL_KEY_ATTACHMENTS), new (std::nothrow) String(combineText));
714 __pPresentationModel->StartAppControl(APPCONTROL_PROVIDER_ID_EMAIL, APPCONTROL_OPERATION_ID_COMPOSE,
716 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
722 AllListEditorPanel::OnRequestSlideShow(void)
724 AppLogDebug("ENTER");
725 IList* pIndexList = GetItemCheckedIndexListN();
726 if (pIndexList == null)
728 AppLogDebug("EXIT 1(%s)", GetErrorMessage(GetLastResult()));
733 HashMap* pDataList = new (std::nothrow) HashMap(SingleObjectDeleter);
734 result r = pDataList->Construct();
741 AppLogDebug("EXIT 2(%s)", GetErrorMessage(GetLastResult()));
746 pDataList->Add(new (std::nothrow) String(APPCONTROL_KEY_TYPE),
747 new (std::nothrow) String(APPCONTROL_DATA_SLIDE_SHOW));
749 Integer* pRealIndex = null;
754 int loopCount = pIndexList->GetCount();
757 for (int i = 0; i < loopCount; ++i)
759 pRealIndex = static_cast<Integer*>(pIndexList->GetAt(i));
760 if (pRealIndex != null)
762 realIndex = pRealIndex->ToInt();
765 path = __pPresentationModel->GetContentFilePath(realIndex);
766 if (combineText.CompareTo(EMPTY_SPACE) != 0)
768 combineText.Append(L";");
770 combineText.Append(path);
772 pDataList->Add(new (std::nothrow) String(APPCONTROL_KEY_PATH), new (std::nothrow) String(combineText));
777 __pPresentationModel->StartAppControl(APPCONTROL_PROVIDER_ID_IMAGE,
778 APPCONTROL_OPERATION_ID_VIEW, pDataList, null);
779 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
785 AllListEditorPanel::ResetSelection(void)
787 AppLogDebug("ENTER");
788 __pPresentationModel->RefreshCurrentAlbumContentInfoList(CONTENT_TYPE_ALL);
789 __itemCount = __pPresentationModel->GetCurrentAlbumContentInfoCount();
790 __pContentIconListView->UpdateList();
792 int checkedCount = GetItemCheckedCount();
795 if (checkedCount == 0)
797 strTmp = ResourceManager::GetString(L"IDS_ST_POP_NO_ITEMS_SELECTED");
799 else if (checkedCount == 1)
801 strTmp = ResourceManager::GetString(L"IDS_VR_POP_1_ITEM_SELECTED");
805 strTmp.Format(LENGTH_COUNT_LABEL,
806 ResourceManager::GetString(L"IDS_VR_POP_PD_ITEMS_SELECTED").GetPointer(), checkedCount);
809 __pLabelSelectCnt->SetText(strTmp);
810 __pLabelSelectCnt->RequestRedraw(true);
811 __pCheckButton->SetSelected(false);
813 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
817 AllListEditorPanel::SetButtonState(void)
819 AppLogDebug("ENTER");
820 SceneManager* pSceneManager = SceneManager::GetInstance();
821 TryReturnVoid(pSceneManager != null, "[%s] fail to get SceneManager.", GetErrorMessage(GetLastResult()));
823 FileListEditorForm* pFileListEditorForm =
824 dynamic_cast<FileListEditorForm*>(pSceneManager->GetCurrentScene()->GetForm());
825 TryReturnVoid(pFileListEditorForm != null, "[%s] fail to get SceneManager.",
826 GetErrorMessage(GetLastResult()));
828 if (GetItemCheckedCount() > 0)
830 AppLogDebug("BUTTONSTATE : Request Enable");
831 pFileListEditorForm->SetFooterButtonsState(true);
832 __pButtonSelectRegion->SetShowState(true);
836 AppLogDebug("BUTTONSTATE : Request disable");
837 pFileListEditorForm->SetFooterButtonsState(false);
838 __pButtonSelectRegion->SetShowState(false);
840 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));