Remove ini file
[apps/osp/Gallery.git] / src / GlAllListSelectionPanel.cpp
1 //
2 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
3 //
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
7 //
8 //     http://floralicense.org/license/
9 //
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.
15 //
16
17 /**
18  * @file                GlAllListSelectionPanel.cpp
19  * @brief               This is the implementation file for AllListSelectionPanel class.
20  */
21
22 #include <FContent.h>
23 #include <FMedia.h>
24 #include "GlAllListSelectionPanel.h"
25 #include "GlCommonUtil.h"
26 #include "GlFileListEditorForm.h"
27 #include "GlFileListPresentationModel.h"
28 #include "GlResourceManager.h"
29 #include "GlTypes.h"
30 #include "GlFileDeleteTimer.h"
31
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;
41
42 static const int LENGTH_COUNT_LABEL = 256;
43 static const int H_CONTENT_MARGIN = 9;
44 static const int W_CONTENT_MARGIN = 6;
45 static const int W_CONTENT_SPACE = 6;
46 static const int H_CONTENT_SPACE = 6;
47 static const Color COLOR_THUMBNAIL_DIM (Color::GetColor(COLOR_ID_BLACK));
48 static const int ALPHA_THUMBNAIL_DIM = 70;
49
50 static const Rectangle RECT_INITIAL (0, 0, 10, 10);
51
52 AllListSelectionPanel::AllListSelectionPanel(void)
53         : __pContentIconListView(null)
54         , __pSeletedIndexList(null)
55         , __itemCount(0)
56         , __deleteInProgress(false)
57         , __pPresentationModel(null)
58         , __pFileDelete(null)
59 {
60         AppLogDebug("ENTER");
61         AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
62 }
63
64 AllListSelectionPanel::~AllListSelectionPanel(void)
65 {
66         AppLogDebug("ENTER");
67         delete __pFileDelete;
68         AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
69 }
70
71 result
72 AllListSelectionPanel::Initialize(void)
73 {
74         AppLogDebug("ENTER");
75         AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
76
77         return Construct(RECT_INITIAL); // Should be set proper area at OnInitializing()
78 }
79
80 result
81 AllListSelectionPanel::OnInitializing(void)
82 {
83         AppLogDebug("ENTER");
84         const Form* pForm = dynamic_cast<Form*>(GetParent());
85         TryReturn(pForm != null, E_FAILURE, "[%s] fail to get the form.", GetErrorMessage(GetLastResult()));
86
87         __pPresentationModel = FileListPresentationModel::GetInstance();
88         __pPresentationModel->ClearThumbnailRequests();
89         __pPresentationModel->AddPresentationModelListener(this);
90
91         Rectangle clientAreaBounds = pForm->GetClientAreaBounds();
92         clientAreaBounds.x = clientAreaBounds.y = 0;
93         result r = SetBounds(clientAreaBounds);
94
95         __pContentIconListView = new (std::nothrow) IconListView();
96         __pContentIconListView->Construct(Rectangle(0, 0, clientAreaBounds.width, clientAreaBounds.height),
97                         DIMENSION_DEFAULT_THUMBNAIL, ICON_LIST_VIEW_STYLE_MARK, ICON_LIST_VIEW_SCROLL_DIRECTION_VERTICAL);
98         Bitmap* pBitmapEmpty = ResourceManager::GetBitmapN(IDB_LISTVIEW_EMPTY);
99         if (pBitmapEmpty != null)
100         {
101                 __pContentIconListView->SetBitmapOfEmptyList(pBitmapEmpty);
102                 delete pBitmapEmpty;
103         }
104         __pContentIconListView->SetTextOfEmptyList(ResourceManager::GetString(L"IDS_COM_BODY_NO_ITEMS"));
105         __pContentIconListView->SetMargin(MARGIN_TYPE_LEFT, W_CONTENT_MARGIN);
106         __pContentIconListView->SetMargin(MARGIN_TYPE_RIGHT, W_CONTENT_MARGIN);
107         __pContentIconListView->SetMargin(MARGIN_TYPE_TOP, H_CONTENT_MARGIN);
108         __pContentIconListView->SetItemSpacing(W_CONTENT_SPACE, H_CONTENT_SPACE);
109         __pContentIconListView->SetItemBorderStyle(ICON_LIST_VIEW_ITEM_BORDER_STYLE_NONE);
110         __pContentIconListView->SetItemProvider(*this);
111         __pContentIconListView->SetCheckBoxPosition(ICON_LIST_VIEW_CHECK_BOX_POSITION_TOP_LEFT);
112         __pContentIconListView->AddIconListViewItemEventListener(*this);
113         __pContentIconListView->SetTouchAnimationEnabled(false);
114         AddControl(*__pContentIconListView);
115         __pContentIconListView->SetShowState(true);
116
117         __itemCount = 0;
118         AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
119
120         return r;
121 }
122
123 void
124 AllListSelectionPanel::OnUpdateContentList()
125 {
126         AppLogDebug("ENTER");
127         SceneManager* pSceneManager = SceneManager::GetInstance();
128         FileListEditorForm* pFileListEditorForm =
129                         dynamic_cast<FileListEditorForm*>(pSceneManager->GetCurrentScene()->GetForm());
130         TryReturnVoid(pFileListEditorForm != null, "[%s] fail to get SceneManager.",
131                         GetErrorMessage(GetLastResult()));
132
133         if ( pFileListEditorForm->GetOverlayStatus() == false && __deleteInProgress == false )
134         {
135                 SceneManager* pSceneManager = SceneManager::GetInstance();
136                 pSceneManager->GoForward(ForwardSceneTransition(IDSCN_ALL_LIST));
137         }
138         AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
139 }
140
141 result
142 AllListSelectionPanel::OnTerminating(void)
143 {
144         AppLogDebug("ENTER");
145         result r = E_SUCCESS;
146         __pPresentationModel->RemovePresentationModelListener(*this);
147         if (__pSeletedIndexList != null)
148         {
149                 delete __pSeletedIndexList;
150                 __pSeletedIndexList = null;
151         }
152         AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
153
154         return r;
155 }
156
157 int
158 AllListSelectionPanel::GetItemCount(void)
159 {
160         AppLogDebug("ENTER");
161         AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
162
163         return __itemCount;
164 }
165
166 IconListViewItem*
167 AllListSelectionPanel::CreateItem(int index)
168 {
169         AppLogDebug("ENTER : index(%d)", index);
170         IconListViewItem* pIconListviewItem;
171         Bitmap* pBitmap = null;
172         String* pItemText = null;
173
174         int realIndex = GetRealindexFromVirtualIndex(index);
175         result r = __pPresentationModel->GetThumbnailInSyncCacheN(realIndex, pItemText, pBitmap);
176         if (pBitmap == null || r == E_FAILURE)
177         {
178                 __pPresentationModel->RequestThumbnail(realIndex);
179                 pBitmap = CommonUtil::GetEmptyThumbnailN();
180         }
181
182         if (pItemText == null)
183         {
184                 pItemText = new (std::nothrow) String(ResourceManager::GetString(L"EMPTY_SPACE"));
185         }
186         else if ((*pItemText) != ResourceManager::GetString(L"EMPTY_SPACE"))
187         {
188                 delete pItemText;
189                 pItemText = new (std::nothrow) String(ResourceManager::GetString(L"EMPTY_SPACE"));
190         }
191
192         if (__pContentIconListView->IsItemChecked(index) == true)
193         {
194                 if (pBitmap != null)
195                 {
196                         BufferInfo bufferInfo;
197                         pBitmap->Lock(bufferInfo, INFINITE);
198                         pBitmap->Unlock();
199
200                         Color dimColor(COLOR_THUMBNAIL_DIM);
201                         dimColor.SetAlpha(ALPHA_THUMBNAIL_DIM);
202
203                         Canvas canvas;
204                         canvas.Construct(bufferInfo);
205                         canvas.FillRectangle(dimColor, canvas.GetBounds());
206
207                         Bitmap* pSelectedBitmap = new (std::nothrow) Bitmap();
208                         pSelectedBitmap->Construct(canvas, canvas.GetBounds());
209                         pIconListviewItem = new (std::nothrow) IconListViewItem();
210                         pIconListviewItem->Construct(*pBitmap, pItemText, pSelectedBitmap);
211                         delete pSelectedBitmap;
212                 }
213                 else
214                 {
215                         AppLogDebug("EXIT 1(%s)", GetErrorMessage(GetLastResult()));
216                         return null;
217                 }
218
219         }
220         else
221         {
222                 pIconListviewItem = new (std::nothrow) IconListViewItem();
223                 pIconListviewItem->Construct(*pBitmap, pItemText);
224         }
225
226         if (pBitmap != null)
227         {
228                 delete pBitmap;
229         }
230         if (pItemText != null)
231         {
232                 delete pItemText;
233         }
234         AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
235
236         return pIconListviewItem;
237 }
238
239 bool
240 AllListSelectionPanel::DeleteItem(int index, IconListViewItem* pItem)
241 {
242         AppLogDebug("ENTER");
243         delete pItem;
244         AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
245
246         return true;
247 }
248
249 void
250 AllListSelectionPanel::OnIconListViewItemStateChanged(IconListView& view, int index, IconListViewItemStatus status)
251 {
252         AppLogDebug("ENTER");
253         if (status == ICON_LIST_VIEW_ITEM_CHECKED || status == ICON_LIST_VIEW_ITEM_UNCHECKED)
254         {
255                 SceneManager* pSceneManager = SceneManager::GetInstance();
256                 TryReturnVoid(pSceneManager != null, "[%s] fail to get SceneManager.", GetErrorMessage(GetLastResult()));
257
258                 FileListEditorForm* pFileListEditorForm =
259                                 dynamic_cast<FileListEditorForm*>(pSceneManager->GetCurrentScene()->GetForm());
260                 TryReturnVoid(pFileListEditorForm != null, "[%s] fail to get FileListEditorForm.",
261                                 GetErrorMessage(GetLastResult()));
262
263                 String strTmp;
264                 strTmp.Format(LENGTH_COUNT_LABEL, L"%ls (%d)",
265                                 ResourceManager::GetString(L"IDS_COM_BODY_SELECTED").GetPointer(), GetItemCheckedCount());
266                 pFileListEditorForm->SetTitleText(strTmp);
267                 __pContentIconListView->RefreshList(index, LIST_REFRESH_TYPE_ITEM_MODIFY);
268         }
269
270         SetButtonState();
271         AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
272 }
273
274 void
275 AllListSelectionPanel::OnFileInfoChanged(const ContentType contentType)
276 {
277         AppLogDebug("ENTER");
278         AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
279 }
280
281 void
282 AllListSelectionPanel::OnThumbnailDecoded(const int index)
283 {
284         AppLogDebug("ENTER : index(%d)", index);
285         if (index >= 0)
286         {
287                 int virtualIndex = -1;
288                 int loopCount = __pSeletedIndexList->GetCount();
289                 for (int i = 0; i < loopCount; ++i)
290                 {
291                         virtualIndex = GetVirtualIndexFromRealIndex(index);
292                         if (virtualIndex >= 0)
293                         {
294                                 __pContentIconListView->RefreshList(virtualIndex, LIST_REFRESH_TYPE_ITEM_MODIFY);
295                                 break;
296                         }
297                 }
298         }
299         AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
300 }
301
302 void
303 AllListSelectionPanel::OnSceneActivatedN(const SceneId& previousSceneId,
304                 const SceneId& currentSceneId, IList* pArgs)
305 {
306         AppLogDebug("ENTER");
307         __pPresentationModel = FileListPresentationModel::GetInstance();
308
309         SceneManager* pSceneManager = SceneManager::GetInstance();
310         TryReturnVoid(pSceneManager != null, "[%s] fail to get SceneManager.", GetErrorMessage(GetLastResult()));
311
312         if (previousSceneId == IDSCN_ALL_LIST_EDITOR)
313         {
314                 if (pArgs != null)
315                 {
316                         __pSeletedIndexList = pArgs;
317                         pArgs = null;
318                 }
319                 ResetSelection();
320                 int loopCount = __pSeletedIndexList->GetCount();
321                 for (int i = 0; i < loopCount; ++i)
322                 {
323                         __pContentIconListView->SetItemChecked(i, true);
324                         __pContentIconListView->RequestRedraw(true);
325                 }
326         }
327         SetButtonState();
328         FileListEditorForm* pFileListEditorForm =
329                         dynamic_cast<FileListEditorForm*>(pSceneManager->GetCurrentScene()->GetForm());
330         TryReturnVoid(pFileListEditorForm != null, "[%s] fail to get FileListEditorForm.",
331                         GetErrorMessage(GetLastResult()));
332
333         if (pArgs != null && pArgs->GetCount() > 0)
334         {
335                 String* pDirectory = static_cast<String*>(pArgs->GetAt(0));
336                 if (pDirectory != null && pDirectory->GetLength() > 0)
337                 {
338                         pFileListEditorForm->MoveToAlbum(*pDirectory);
339                 }
340         }
341         AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
342 }
343
344 void
345 AllListSelectionPanel::OnSceneDeactivated(const SceneId& currentSceneId,
346                 const SceneId& nextSceneId)
347 {
348         AppLogDebug("ENTER");
349         AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
350 }
351
352 int
353 AllListSelectionPanel::GetItemCheckedCount(void) const
354 {
355         AppLogDebug("ENTER");
356         int count = 0;
357         if (__pContentIconListView != null && __pSeletedIndexList != null)
358         {
359                 int loopCount = __pSeletedIndexList->GetCount();
360                 for (int i = 0; i < loopCount; ++i)
361                 {
362                         if (__pContentIconListView->IsItemChecked(i))
363                         {
364                                 ++count;
365                         }
366                 }
367         }
368         AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
369
370         return count;
371 }
372
373 IList*
374 AllListSelectionPanel::GetItemCheckedIndexListN(void)
375 {
376         AppLogDebug("ENTER");
377         IList* pList = new (std::nothrow) ArrayList(SingleObjectDeleter);
378         Integer* pIndex=null;
379
380         if (__pContentIconListView!=null)
381         {
382                 int realIndex = -1;
383                 int loopCount = __pSeletedIndexList->GetCount();
384                 for (int i = 0; i < loopCount; ++i)
385                 {
386                         if (__pContentIconListView->IsItemChecked(i))
387                         {
388                                 realIndex = GetRealindexFromVirtualIndex(i);
389                                 pIndex = new (std::nothrow) Integer(realIndex);
390                                 pList->Add(pIndex);
391                         }
392                 }
393         }
394         AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
395
396         return pList;
397 }
398
399 int
400 AllListSelectionPanel::GetRealindexFromVirtualIndex(int virtualIndex)
401 {
402         if (__pSeletedIndexList == null || __pSeletedIndexList->GetCount() == 0)
403         {
404                 AppLogDebug("EXIT 1(%s)", GetErrorMessage(GetLastResult()));
405
406                 return -1;
407         }
408
409         Integer* pRealIndex = static_cast<Integer*>(__pSeletedIndexList->GetAt(virtualIndex));
410         int realIndex = -1;
411         if (pRealIndex != null)
412         {
413                 realIndex = pRealIndex->ToInt();
414         }
415         AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
416
417         return realIndex;
418 }
419
420 int
421 AllListSelectionPanel::GetVirtualIndexFromRealIndex(int realIndex)
422 {
423         int returnValue = -1;
424         int loopCount = __pSeletedIndexList->GetCount();
425         for (int i = 0; i < loopCount; ++i)
426         {
427                 Integer* pRealIndex = static_cast<Integer*>(__pSeletedIndexList->GetAt(i));
428                 int index = -1;
429                 if (pRealIndex != null)
430                 {
431                         index = pRealIndex->ToInt();
432                 }
433
434                 if (index == realIndex)
435                 {
436                         returnValue = i;
437                         break;
438                 }
439         }
440         AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
441
442         return returnValue;
443 }
444
445 result
446 AllListSelectionPanel::OnRequestDelete(void)
447 {
448         AppLogDebug("ENTER");
449         IList* pIndexList = GetItemCheckedIndexListN();
450         if (pIndexList->GetCount() <= 0)
451         {
452                 AppLogDebug("EXIT 1(%s)", GetErrorMessage(GetLastResult()));
453
454                 return E_FAILURE;
455         }
456
457         delete __pFileDelete;
458         __pFileDelete = new FileDeleteTimer(pIndexList,
459                         __pPresentationModel,
460                         this );
461         result r = __pFileDelete->StartTimer();
462
463         if (IsFailed(r))
464         {
465                 delete __pFileDelete;
466                 __pFileDelete = null;
467                 return E_FAILURE;
468         }
469         else
470         {
471                 __deleteInProgress = true;
472         }
473
474         return E_SUCCESS;
475 }
476
477 void AllListSelectionPanel::OnFileOpInvalidate(enum FileActionMode actionId)
478 {
479         SceneManager* pSceneManager = SceneManager::GetInstance();
480         FileListEditorForm* pFileListEditorForm =
481                                 dynamic_cast<FileListEditorForm*>(pSceneManager->GetCurrentScene()->GetForm());
482         TryReturnVoid(pFileListEditorForm != null, "[%s] fail to get SceneManager.",
483                         GetErrorMessage(GetLastResult()));
484         pFileListEditorForm->Invalidate(true);
485 }
486
487 void AllListSelectionPanel::OnFileOpComplete(enum FileActionMode actionId, enum FileActionCompleteRes res)
488 {
489         __deleteInProgress = false;
490         SceneManager* pSceneManager = SceneManager::GetInstance();
491         TryReturnVoid(pSceneManager != null, "[%s] fail to get SceneManager.",
492                         GetErrorMessage(GetLastResult()));
493
494         FileListEditorForm* pFileListEditorForm =
495                         dynamic_cast<FileListEditorForm*>(pSceneManager->GetCurrentScene()->GetForm());
496         TryReturnVoid(pFileListEditorForm != null, "[%s] fail to get SceneManager.",
497                         GetErrorMessage(GetLastResult()));
498
499         String strTmp;
500         String selectString = ResourceManager::GetString(L"IDS_COM_BODY_SELECTED");
501         strTmp.Format(LENGTH_COUNT_LABEL, L"%ls (%d)", selectString.GetPointer(), 0);
502         pFileListEditorForm->SetTitleText(strTmp);
503
504         __pPresentationModel->RefreshCurrentAlbumContentInfoList(CONTENT_TYPE_ALL);
505         __itemCount = __pPresentationModel->GetCurrentAlbumContentInfoCount();
506         __pContentIconListView->UpdateList();
507
508         if (GetItemCount() > 0)
509         {
510                 pSceneManager->GoForward(ForwardSceneTransition(IDSCN_ALL_LIST));
511         }
512         else
513         {
514                 pSceneManager->GoForward(ForwardSceneTransition(IDSCN_ALBUM_LIST));
515         }
516         AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
517 }
518
519 result
520 AllListSelectionPanel::OnRequestMessage(void)
521 {
522         AppLogDebug("ENTER");
523         IList* pIndexList = GetItemCheckedIndexListN();
524         if (pIndexList == null || pIndexList->GetCount() <= 0)
525         {
526                 AppLogDebug("EXIT 1(%s)", GetErrorMessage(GetLastResult()));
527
528                 return E_FAILURE;
529         }
530
531         String combineText;
532         String path;
533         Integer* pIndex = null;
534         int checkedIndex;
535
536         int loopCount = pIndexList->GetCount();
537         AppLogDebug("pIndexList->GetCount(%d)", loopCount);
538         for (int i = 0; i < loopCount; ++i)
539         {
540                 pIndex = static_cast<Integer*>(pIndexList->GetAt(i));
541                 if (pIndex != null)
542                 {
543                         checkedIndex = pIndex->ToInt();
544                         path = __pPresentationModel->GetContentFilePath(checkedIndex);
545                 }
546
547                 if (combineText.CompareTo(EMPTY_SPACE) != 0)
548                 {
549                         combineText.Append(L";");
550                 }
551                 combineText.Append(path);
552         }
553         HashMap* pDataList = new (std::nothrow) HashMap(SingleObjectDeleter);
554         pDataList->Construct();
555         pDataList->Add(new (std::nothrow) String(APPCONTROL_KEY_TYPE), new (std::nothrow) String(APPCONTROL_DATA_MMS));
556         pDataList->Add(new (std::nothrow) String(APPCONTROL_KEY_ATTACHMENTS), new (std::nothrow) String(combineText));
557
558         __pPresentationModel->StartAppControl(APPCONTROL_PROVIDER_ID_MESSAGE, APPCONTROL_OPERATION_ID_COMPOSE,
559                         pDataList, null);
560         AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
561
562         return E_SUCCESS;
563 }
564
565 result
566 AllListSelectionPanel::OnRequestEmail(void)
567 {
568         AppLogDebug("ENTER");
569         IList* pIndexList = GetItemCheckedIndexListN();
570         if (pIndexList == null || pIndexList->GetCount() <= 0)
571         {
572                 AppLogDebug("EXIT 1(%s)", GetErrorMessage(GetLastResult()));
573
574                 return E_FAILURE;
575         }
576
577         String combineText;
578         String path;
579         Integer* pIndex = null;
580         int checkedIndex;
581
582         int loopCount = pIndexList->GetCount();
583         AppLogDebug("pIndexList->GetCount(%d)", loopCount);
584         for (int i = 0; i < loopCount; ++i)
585         {
586                 pIndex = static_cast<Integer*>(pIndexList->GetAt(i));
587                 if (pIndex != null)
588                 {
589                         checkedIndex = pIndex->ToInt();
590                         path = __pPresentationModel->GetContentFilePath(checkedIndex);
591                 }
592
593                 if (combineText.CompareTo(EMPTY_SPACE) != 0)
594                 {
595                         combineText.Append(L";");
596                 }
597                 combineText.Append(path);
598         }
599         HashMap* pDataList = new (std::nothrow) HashMap(SingleObjectDeleter);
600         pDataList->Construct();
601         pDataList->Add(new (std::nothrow) String(APPCONTROL_KEY_ATTACHMENTS), new (std::nothrow) String(combineText));
602
603         __pPresentationModel->StartAppControl(APPCONTROL_PROVIDER_ID_EMAIL,
604                         APPCONTROL_OPERATION_ID_COMPOSE, pDataList, null);
605         AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
606
607         return E_SUCCESS;
608 }
609
610 result
611 AllListSelectionPanel::OnRequestSlideShow(void)
612 {
613         AppLogDebug("ENTER");
614         IList* pIndexList = GetItemCheckedIndexListN();
615         if (pIndexList == null)
616         {
617                 AppLogDebug("EXIT 1(%s)", GetErrorMessage(GetLastResult()));
618
619                 return E_FAILURE;
620         }
621
622         HashMap* pDataList = new (std::nothrow) HashMap(SingleObjectDeleter);
623         result r = pDataList->Construct();
624         if (r != E_SUCCESS)
625         {
626                 delete pDataList;
627                 delete pIndexList;
628                 AppLogDebug("EXIT 2(%s)", GetErrorMessage(GetLastResult()));
629
630                 return E_FAILURE;
631         }
632
633         pDataList->Add(new (std::nothrow) String(APPCONTROL_KEY_TYPE),
634                         new (std::nothrow) String(APPCONTROL_DATA_SLIDE_SHOW));
635
636         Integer* pRealIndex = null;
637         int realIndex = -1;
638         String combineText;
639         String path;
640
641         int loopCount = pIndexList->GetCount();
642         if (loopCount > 0)
643         {
644                 for (int i = 0; i < loopCount; ++i)
645                 {
646                         pRealIndex = static_cast<Integer*>(pIndexList->GetAt(i));
647                         if (pRealIndex != null)
648                         {
649                                 realIndex = pRealIndex->ToInt();
650                         }
651
652                         path = __pPresentationModel->GetContentFilePath(realIndex);
653                         if (combineText.CompareTo(EMPTY_SPACE) != 0)
654                         {
655                                 combineText.Append(L";");
656                         }
657                         combineText.Append(path);
658                 }
659                 pDataList->Add(new (std::nothrow) String(APPCONTROL_KEY_PATH),
660                                 new (std::nothrow) String(combineText));
661         }
662
663         delete pIndexList;
664
665         __pPresentationModel->StartAppControl(APPCONTROL_PROVIDER_ID_IMAGE,
666                         APPCONTROL_OPERATION_ID_VIEW, pDataList, null);
667         AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
668
669         return E_SUCCESS;
670 }
671
672 void
673 AllListSelectionPanel::ResetSelection(void)
674 {
675         AppLogDebug("ENTER");
676         __pPresentationModel->RefreshCurrentAlbumContentInfoList(CONTENT_TYPE_ALL);
677         if (__pSeletedIndexList == null)
678         {
679                 __itemCount = 0;
680         }
681         else
682         {
683                 __itemCount = __pSeletedIndexList->GetCount();
684         }
685
686         SceneManager* pSceneManager = SceneManager::GetInstance();
687         TryReturnVoid(pSceneManager != null, "[%s] fail to get SceneManager.", GetErrorMessage(GetLastResult()));
688
689         FileListEditorForm* pFileListEditorForm = dynamic_cast<FileListEditorForm*>(pSceneManager->GetCurrentScene()->GetForm());
690         TryReturnVoid(pFileListEditorForm != null, "[%s] fail to get FileListEditorForm.", GetErrorMessage(GetLastResult()));
691
692         String strTmp;
693         String bodyText = ResourceManager::GetString(L"IDS_COM_BODY_SELECTED");
694         strTmp.Format(LENGTH_COUNT_LABEL, L"%ls (%d)", bodyText.GetPointer(), __itemCount);
695         pFileListEditorForm->SetTitleText(strTmp);
696         if (__pContentIconListView != null)
697         {
698                 __pContentIconListView->UpdateList();
699         }
700         SetButtonState();
701         AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
702 }
703
704 void
705 AllListSelectionPanel::SetButtonState(void)
706 {
707         AppLogDebug("ENTER");
708         SceneManager* pSceneManager = SceneManager::GetInstance();
709         TryReturnVoid(pSceneManager != null, "[%s] fail to get SceneManager.", GetErrorMessage(GetLastResult()));
710
711         FileListEditorForm* pFileListEditorForm = dynamic_cast<FileListEditorForm*>(pSceneManager->GetCurrentScene()->GetForm());
712         TryReturnVoid(pFileListEditorForm != null, "[%s] fail to get FileListEditorForm.", GetErrorMessage(GetLastResult()));
713
714         if (GetItemCheckedCount() > 0)
715         {
716                 AppLogDebug("BUTTONSTATE : Request Enable");
717                 pFileListEditorForm->SetFooterButtonsState(true);
718         }
719         else
720         {
721                 AppLogDebug("BUTTONSTATE : Request disable");
722                 pFileListEditorForm->SetFooterButtonsState(false);
723         }
724         AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
725 }
726
727