Fixed issue 33526
[apps/osp/Gallery.git] / src / GlFileListEditorForm.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                GlFileListEditorForm.cpp
19  * @brief               This is the implementation file for FileListEditorForm class.
20  */
21
22 #include "GlAllListEditorPanel.h"
23 #include "GlAllListSelectionPanel.h"
24 #include "GlFileListEditorForm.h"
25 #include "GlFileListPresentationModel.h"
26 #include "GlGalleryApp.h"
27 #include "GlImageListEditorPanel.h"
28 #include "GlResourceManager.h"
29 #include "GlSlideSettingListener.h"
30 #include "GlSlideShowPopUp.h"
31 #include "GlTypes.h"
32 #include "GlVideoListEditorPanel.h"
33 #include "GlFileMoveTimer.h"
34
35 using namespace Tizen::App;
36 using namespace Tizen::Base;
37 using namespace Tizen::Base::Collection;
38 using namespace Tizen::Content;
39 using namespace Tizen::Graphics;
40 using namespace Tizen::Ui;
41 using namespace Tizen::Ui::Controls;
42 using namespace Tizen::Ui::Scenes;
43 using namespace Tizen::Base::Utility;
44
45 static const int GAP_W_POPUP_ITEM = 5;
46 static const int W_DELETE_POPUP = 600;
47 static const int H_DELETE_POPUP = 300;
48 static const int H_DELETE_LABEL = 180;
49 static const int Y_DELETE_BUTTON = 180;
50 static const int H_DELETE_BUTTON = 80;
51 static const int H_TOAST_LABEL = 48;
52
53 static const unsigned int COLOR_DELETE_BUTTON_NORMAL = Color32<208, 82, 82>::Value;
54 static const unsigned int COLOR_DELETE_BUTTON_PRESSED = Color32<194, 71, 71>::Value;
55 static const unsigned int COLOR_DELETE_BUTTON_TEXT = Color32<248, 246, 239>::Value;
56
57 FileListEditorForm::FileListEditorForm(void)
58         : __pContextMenuMore(null)
59         , __pContextMenuShare(null)
60         , __pContextEditorMenuMove(null)
61         , __pContextSelectionMenuMove(null)
62         , __pDeletePopup(null)
63         , __morePosition(Point(0, 0))
64         , __pContentDirectoryList(null)
65         , __pContentDirectoryNameList(null)
66         , __pPopUp(null)
67         , __pFileMove(null)
68         , __isCopyOperation(false)
69         , __pPresentationModel(null)
70 {
71         AppLogDebug("ENTER");
72         _overlayMsg = false;
73         AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
74 }
75
76 FileListEditorForm::~FileListEditorForm(void)
77 {
78         AppLogDebug("ENTER");
79         if (__pContentDirectoryList != null)
80         {
81                 delete __pContentDirectoryList;
82         }
83
84         if (__pContentDirectoryNameList != null)
85         {
86                 delete __pContentDirectoryNameList;
87         }
88         delete __pFileMove;
89         AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
90 }
91
92 result
93 FileListEditorForm::Initialize(void)
94 {
95         AppLogDebug("ENTER");
96         result r = Construct(FORM_STYLE_NORMAL | FORM_STYLE_HEADER | FORM_STYLE_FOOTER);
97         AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
98
99         return r;
100 }
101
102 result
103 FileListEditorForm::OnInitializing(void)
104 {
105         AppLogDebug("ENTER");
106         Header* pHeader = GetHeader();
107         TryReturn(pHeader != null, E_FAILURE, "[%s] fail to get the header.", GetErrorMessage(GetLastResult()));
108
109         __pPopUp = new (std::nothrow) SlideShowPopUp();
110
111         if (__pPopUp != null)
112         {
113                 __pPopUp->Initialize();
114                 __pPopUp->SetEventListner(this);
115                 AddControl(*__pPopUp);
116         }
117
118         __pPresentationModel = FileListPresentationModel::GetInstance();
119         __pPresentationModel->ClearThumbnailRequests();
120
121         pHeader->SetStyle(HEADER_STYLE_TITLE);
122         pHeader->SetTitleText(ResourceManager::GetString(L"IDS_COM_BODY_EDIT"));
123
124         if ((__pPresentationModel->GetAppControlMode() == APPCONTROL_MODE_PICK
125                 && __pPresentationModel->GetAppControlSelectionMode() == APPCONTROL_SELECTION_MODE_SINGLE) == false)
126         {
127                 Bitmap* pNormalBitmap = ResourceManager::GetBitmapN(IDB_ICON_SELECT_ALL);
128                 Bitmap* pPressBitmap = ResourceManager::GetBitmapN(IDB_ICON_SELECT_ALL_PRESS);
129                 ButtonItem selectAll;
130                 selectAll.Construct(BUTTON_ITEM_STYLE_ICON, IDA_FILE_LIST_SELECT_ALL);
131                 selectAll.SetIcon(BUTTON_ITEM_STATUS_NORMAL, pNormalBitmap);
132                 selectAll.SetIcon(BUTTON_ITEM_STATUS_PRESSED, pPressBitmap);
133                 pHeader->SetButton(BUTTON_POSITION_LEFT, selectAll);
134                 delete pNormalBitmap;
135                 delete pPressBitmap;
136         }
137
138         pHeader->AddActionEventListener(*this);
139
140         InitializeFooter();
141         AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
142
143         return E_SUCCESS;
144 }
145
146 result
147 FileListEditorForm::InitializeFooter(void)
148 {
149         AppLogDebug("ENTER");
150         Footer* pFooter = GetFooter();
151         TryReturn(pFooter != null, E_FAILURE, "[%s] fail to get the footer.", GetErrorMessage(GetLastResult()));
152         pFooter->RemoveAllItems();
153
154         result r = E_SUCCESS;
155
156         if (__pPresentationModel->GetAppControlMode() == APPCONTROL_MODE_PICK)
157         {
158                 if (__pPresentationModel->GetAppControlSelectionMode() == APPCONTROL_SELECTION_MODE_MULTIPLE)
159                 {
160                         pFooter->SetStyle(FOOTER_STYLE_BUTTON_TEXT);
161
162                         FooterItem footerConfirm;
163                         footerConfirm.Construct(IDA_FOOTER_CONFIRM);
164                         footerConfirm.SetText(ResourceManager::GetString(L"IDS_COM_SK_DONE"));
165                         pFooter->AddItem(footerConfirm);
166                         pFooter->SetItemEnabled(0, false);
167                 }
168                 else
169                 {
170                         pFooter->SetStyle(FOOTER_STYLE_SEGMENTED_TEXT);
171                 }
172                 pFooter->SetBackButton();
173                 SetFormBackEventListener(this);
174         }
175         else
176         {
177                 pFooter->SetStyle(FOOTER_STYLE_BUTTON_ICON_TEXT);
178
179                 ButtonItem footerMore;
180                 footerMore.Construct(BUTTON_ITEM_STYLE_ICON, IDA_FOOTER_MORE);
181                 Bitmap* pBitmapMore = ResourceManager::GetBitmapN(IDB_CONTROLBAR_MORE);
182                 Bitmap* pBitmapMoreDim = ResourceManager::GetBitmapN(IDB_CONTROLBAR_MORE_DISABLED);
183
184                 if (pBitmapMore != null && pBitmapMoreDim != NULL)
185                 {
186                         footerMore.SetIcon(BUTTON_ITEM_STATUS_NORMAL, pBitmapMore);
187                         footerMore.SetIcon(BUTTON_ITEM_STATUS_DISABLED, pBitmapMoreDim);
188                 }
189                 pFooter->SetButton(BUTTON_POSITION_LEFT,footerMore);
190
191                 delete pBitmapMore;
192                 delete pBitmapMoreDim;
193
194                 FooterItem footerShare;
195                 r = footerShare.Construct(IDA_FOOTER_SHARE);
196                 TryReturn(r == E_SUCCESS, r, "[%s] Unable to construct footer item", GetErrorMessage(r));
197                 Bitmap* pBitmapShare = ResourceManager::GetBitmapN(IDB_CONTROLBAR_SHARE);
198                 Bitmap* pBitmapShareDim = ResourceManager::GetBitmapN(IDB_CONTROLBAR_SHARE_DIM);
199
200                 if (pBitmapShare != null && pBitmapShareDim != null)
201                 {
202                         footerShare.SetIcon(FOOTER_ITEM_STATUS_NORMAL, pBitmapShare);
203                         footerShare.SetIcon(FOOTER_ITEM_STATUS_DISABLED, pBitmapShareDim);
204                 }
205
206                 r = pFooter->AddItem(footerShare);
207                 delete pBitmapShare;
208                 delete pBitmapShareDim;
209                 TryReturn(r == E_SUCCESS, r, "[%s] Unable to add item", GetErrorMessage(r));
210
211                 FooterItem footerDelete;
212                 r = footerDelete.Construct(IDA_FOOTER_DELETE);
213                 TryReturn(r == E_SUCCESS, r, "[%s] Unable to construct footer item", GetErrorMessage(r));
214                 Bitmap* pBitmapDelete = ResourceManager::GetBitmapN(IDB_CONTROLBAR_DELETE);
215                 Bitmap* pBitmapDeleteDim = ResourceManager::GetBitmapN(IDB_CONTROLBAR_DELETE_DIM);
216
217                 if (pBitmapDelete != null && pBitmapDeleteDim != null)
218                 {
219                         footerDelete.SetIcon(FOOTER_ITEM_STATUS_NORMAL, pBitmapDelete);
220                         footerDelete.SetIcon(FOOTER_ITEM_STATUS_DISABLED, pBitmapDeleteDim);
221                 }
222
223                 r = pFooter->AddItem(footerDelete);
224                 delete pBitmapDelete;
225                 delete pBitmapDeleteDim;
226                 TryReturn(r == E_SUCCESS, r, "[%s] Unable to add item", GetErrorMessage(r));
227
228                 pFooter->SetBackButton();
229                 SetFormBackEventListener(this);
230
231                 SceneManager* pSceneManager = SceneManager::GetInstance();
232                 int checkedCount = 0;
233
234                 if (pSceneManager->GetCurrentSceneId() == IDSCN_ALL_LIST_EDITOR)
235                 {
236                         AllListEditorPanel* pEditorPanel = dynamic_cast<AllListEditorPanel*>(pSceneManager->GetCurrentScene()->GetPanel());
237                         if (pEditorPanel != null)
238                         {
239                                 checkedCount = pEditorPanel->GetItemCheckedCount();
240                         }
241                 }
242                 else if (pSceneManager->GetCurrentSceneId() == IDSCN_ALL_LIST_SELECTION)
243                 {
244                         AllListSelectionPanel* pSelectionPanel = dynamic_cast<AllListSelectionPanel*>(pSceneManager->GetCurrentScene()->GetPanel());
245                         if (pSelectionPanel != null)
246                         {
247                                 checkedCount = pSelectionPanel->GetItemCheckedCount();
248                         }
249                 }
250
251                 AppLogDebug("GetItemCheckedCount(%d)", checkedCount);
252
253                 if (__pContextMenuMore != null)
254                 {
255                         delete __pContextMenuMore;
256                         __pContextMenuMore = null;
257                 }
258
259                 __pContextMenuMore = new (std::nothrow) ContextMenu();
260                 __pContextMenuMore->Construct(Point(0, 0), CONTEXT_MENU_STYLE_LIST);
261
262                 __pContextMenuMore->AddItem(ResourceManager::GetString(L"IDS_COM_BODY_MOVE"),
263                                 IDA_CONTEXT_MENU_MORE_MOVE);
264                 __pContextMenuMore->AddItem(ResourceManager::GetString(L"IDS_COM_BODY_COPY"),
265                                                 IDA_CONTEXT_MENU_MORE_COPY);
266
267                 if (checkedCount > 1)
268                 {
269                         __pContextMenuMore->AddItem(ResourceManager::GetString(L"IDS_MEDIABR_BUTTON_SLIDE_SHOW"),
270                                         IDA_CONTEXT_MENU_MORE_SLIDE_SHOW);
271                 }
272
273                 __pContextMenuMore->AddItem(ResourceManager::GetString(L"IDS_IV_OPT_ROTATE_LEFT"),IDA_CONTEXT_MENU_ROTATE_LEFT);
274                 __pContextMenuMore->AddItem(ResourceManager::GetString(L"IDS_IV_OPT_ROTATE_RIGHT"),IDA_CONTEXT_MENU_ROTATE_RIGHT);
275
276                 __pContextMenuMore->SetShowState(false);
277                 __pContextMenuMore->AddActionEventListener(*this);
278
279                 __pContextMenuShare = new (std::nothrow) ContextMenu();
280                 __pContextMenuShare->Construct(Point(0, 0), CONTEXT_MENU_STYLE_LIST);
281                 __pContextMenuShare->AddItem(ResourceManager::GetString(L"IDS_COM_BODY_MESSAGE"),
282                                 IDA_CONTEXT_MENU_SHARE_MESSAGE);
283                 __pContextMenuShare->AddItem(ResourceManager::GetString(L"IDS_COM_BODY_EMAIL"),
284                                 IDA_CONTEXT_MENU_SHARE_EMAIL);
285                 __pContextMenuShare->SetShowState(false);
286                 __pContextMenuShare->AddActionEventListener(*this);
287
288                 __pContextEditorMenuMove = new (std::nothrow) ContextMenu();
289                 __pContextEditorMenuMove->Construct(Point(0, 0), CONTEXT_MENU_STYLE_LIST);
290                 __pContextEditorMenuMove->AddActionEventListener(*this);
291
292                 __pContextSelectionMenuMove = new (std::nothrow) ContextMenu();
293                 __pContextSelectionMenuMove->Construct(Point(0, 0), CONTEXT_MENU_STYLE_LIST);
294                 __pContextSelectionMenuMove->AddActionEventListener(*this);
295
296                 if (__pContentDirectoryNameList != null)
297                 {
298                         delete __pContentDirectoryNameList;
299                         __pContentDirectoryNameList = null;
300                 }
301
302                 SetUpPopup();
303         }
304
305         pFooter->AddActionEventListener(*this);
306         AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
307
308         return r;
309 }
310
311 String
312 FileListEditorForm::GetDirecotyNameFromFullPath(const String& fullPath)const
313 {
314         AppLogDebug("ENTER");
315         if (fullPath == null)
316         {
317                 AppLogDebug("EXIT 1(%s)", GetErrorMessage(GetLastResult()));
318
319                 return null;
320         }
321         String delim(DIRECTORY_SEPARATOR);
322         StringTokenizer st(fullPath,delim);
323         String token;
324         while (st.HasMoreTokens())
325         {
326                 st.GetNextToken(token);
327         }
328         AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
329
330         return token;
331 }
332
333 result
334 FileListEditorForm::OnTerminating(void)
335 {
336         AppLogDebug("ENTER");
337
338         if (__pContextMenuMore != null)
339         {
340                 __pContextMenuMore->RemoveActionEventListener(*this);
341                 delete __pContextMenuMore;
342                 __pContextMenuMore = null;
343         }
344
345         if (__pContextMenuShare != null)
346         {
347                 __pContextMenuShare->RemoveActionEventListener(*this);
348                 delete __pContextMenuShare;
349                 __pContextMenuShare = null;
350         }
351
352         if (__pContextEditorMenuMove != null)
353         {
354                 __pContextEditorMenuMove->RemoveActionEventListener(*this);
355                 delete __pContextEditorMenuMove;
356                 __pContextEditorMenuMove = null;
357         }
358
359         if (__pContextSelectionMenuMove != null)
360         {
361                 __pContextSelectionMenuMove->RemoveActionEventListener(*this);
362                 delete __pContextSelectionMenuMove;
363                 __pContextSelectionMenuMove = null;
364         }
365
366         if (__pDeletePopup != null)
367         {
368                 delete __pDeletePopup;
369                 __pDeletePopup = null;
370         }
371         _overlayMsg = false;
372         AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
373
374         return E_SUCCESS;
375 }
376
377 void
378 FileListEditorForm::OnActionPerformed(const Control& source, int actionId)
379 {
380         AppLogDebug("ENTER(actionId=%d)", actionId);
381         SceneManager* pSceneManager = SceneManager::GetInstance();
382         TryReturnVoid(pSceneManager != null, "[%s] fail to get SceneManager.", GetErrorMessage(GetLastResult()));
383
384         switch (actionId)
385         {
386         case IDA_FILE_LIST_SELECT_ALL:
387                 SelectAllPressed();
388         break;
389
390         case IDA_FOOTER_MORE:
391         {
392                 InitializeFooter();
393
394                 if (__pContextMenuMore->GetShowState() == false)
395                 {
396                         Rectangle rect = source.GetBounds();
397                         __morePosition = Point(rect.width / 8, rect.y);
398                         if (pSceneManager->GetCurrentSceneId() == IDSCN_ALL_LIST_SELECTION)
399                         {
400                                 __pContextMenuMore->SetAnchorPosition(Point(rect.width / 10, rect.y));
401                         }
402                         else
403                         {
404                                 __pContextMenuMore->SetAnchorPosition(Point(rect.width / 10, rect.y - H_TOAST_LABEL));
405                         }
406                         __pContextMenuMore->SetShowState(true);
407                         __pContextMenuMore->Show();
408                 }
409                 else
410                 {
411                         __pContextMenuMore->SetShowState(false);
412                 }
413         }
414         break;
415
416         case IDA_FOOTER_SHARE:
417         {
418                 if (__pContextMenuShare->GetShowState() == false)
419                 {
420                         Rectangle rect = source.GetBounds();
421                         if (pSceneManager->GetCurrentSceneId() == IDSCN_ALL_LIST_SELECTION)
422                         {
423                                 __pContextMenuShare->SetAnchorPosition(Point(rect.width / 8 * 3, rect.y));
424                         }
425                         else
426                         {
427                                 __pContextMenuShare->SetAnchorPosition(Point(rect.width / 8 * 3, rect.y - H_TOAST_LABEL));
428                         }
429                         __pContextMenuShare->SetShowState(true);
430                         __pContextMenuShare->Show();
431                 }
432                 else
433                 {
434                         __pContextMenuShare->SetShowState(false);
435                 }
436         }
437         break;
438
439         case IDA_FOOTER_DELETE:
440         {
441                 if (pSceneManager->GetCurrentSceneId() == IDSCN_ALL_LIST_EDITOR)
442                 {
443                         AllListEditorPanel* pEditorPanel = dynamic_cast<AllListEditorPanel*>(pSceneManager->GetCurrentScene()->GetPanel());
444                         if (pEditorPanel != null && pEditorPanel->GetItemCheckedCount() > 0)
445                         {
446                                 __pDeletePopup->SetShowState(true);
447                                 __pDeletePopup->Show();
448                                 _overlayMsg = true;
449                         }
450                 }
451                 else if (pSceneManager->GetCurrentSceneId() == IDSCN_IMAGE_LIST_EDITOR)
452                 {
453                         ImageListEditorPanel* pEditorPanel = dynamic_cast<ImageListEditorPanel*>(pSceneManager->GetCurrentScene()->GetPanel());
454                         if (pEditorPanel != null && pEditorPanel->GetItemCheckedCount() > 0)
455                         {
456                                 __pDeletePopup->SetShowState(true);
457                                 __pDeletePopup->Show();
458                                 _overlayMsg = true;
459                         }
460                 }
461                 else if (pSceneManager->GetCurrentSceneId() == IDSCN_VIDEO_LIST_EDITOR)
462                 {
463                         VideoListEditorPanel* pEditorPanel = dynamic_cast<VideoListEditorPanel*>(pSceneManager->GetCurrentScene()->GetPanel());
464                         if (pEditorPanel != null && pEditorPanel->GetItemCheckedCount() > 0)
465                         {
466                                 __pDeletePopup->SetShowState(true);
467                                 __pDeletePopup->Show();
468                                 _overlayMsg = true;
469                         }
470                 }
471                 if (pSceneManager->GetCurrentSceneId() == IDSCN_ALL_LIST_SELECTION)
472                 {
473                         AllListSelectionPanel* pSelectionPanel = dynamic_cast<AllListSelectionPanel*>
474                         (pSceneManager->GetCurrentScene()->GetPanel());
475                         if (pSelectionPanel != null && pSelectionPanel->GetItemCheckedCount() > 0)
476                         {
477                                 __pDeletePopup->SetShowState(true);
478                                 __pDeletePopup->Show();
479                                 _overlayMsg = true;
480                         }
481                 }
482         }
483         break;
484
485         case IDA_CONTEXT_MENU_MORE_EDIT:
486         {
487                 break;
488         }
489
490         case IDA_CONTEXT_MENU_MORE_ADD_TAG:
491         {
492                 break;
493         }
494
495         case IDA_CONTEXT_MENU_MORE_COPY:
496
497         case IDA_CONTEXT_MENU_MORE_MOVE:
498         {
499                 if (actionId == IDA_CONTEXT_MENU_MORE_MOVE)
500                 {
501                         __isCopyOperation = false;
502                 }
503                 else if (actionId == IDA_CONTEXT_MENU_MORE_COPY)
504                 {
505                         __isCopyOperation = true;
506                 }
507                 RefreshFolderList();
508                 if (pSceneManager->GetCurrentSceneId() == IDSCN_ALL_LIST_EDITOR)
509                 {
510                         if (__pContextEditorMenuMove->GetShowState() == false)
511                         {
512                                 __pContextEditorMenuMove->SetAnchorPosition(__morePosition);
513                                 __pContextEditorMenuMove->SetShowState(true);
514                                 __pContextEditorMenuMove->Show();
515                         }
516                         else
517                         {
518                                 __pContextEditorMenuMove->SetShowState(false);
519                         }
520                 }
521                 else if (pSceneManager->GetCurrentSceneId() == IDSCN_ALL_LIST_SELECTION)
522                 {
523                         if (__pContextSelectionMenuMove->GetShowState() == false)
524                         {
525                                 __pContextSelectionMenuMove->SetAnchorPosition(__morePosition);
526                                 __pContextSelectionMenuMove->SetShowState(true);
527                                 __pContextSelectionMenuMove->Show();
528                         }
529                         else
530                         {
531                                 __pContextSelectionMenuMove->SetShowState(false);
532                         }
533                 }
534         }
535         break;
536
537         case IDA_CONTEXT_MENU_MORE_SLIDE_SHOW:
538         {
539                 if (__pPopUp != null)
540                 {
541                         __pPopUp->SetShowState(true);
542                         __pPopUp->Show();
543                 }
544         }
545         break;
546
547         case IDA_CONTEXT_MENU_SHARE_MESSAGE:
548         {
549                 if (pSceneManager->GetCurrentSceneId() == IDSCN_ALL_LIST_EDITOR)
550                 {
551                         AllListEditorPanel* pEditorPanel = dynamic_cast<AllListEditorPanel*>(pSceneManager->GetCurrentScene()->GetPanel());
552                         if (pEditorPanel != null)
553                         {
554                                 pEditorPanel->OnRequestMessage();
555                         }
556                 }
557                 else if (pSceneManager->GetCurrentSceneId() == IDSCN_ALL_LIST_SELECTION)
558                 {
559                         AllListSelectionPanel* pSelectionPanel = dynamic_cast<AllListSelectionPanel*>(pSceneManager->GetCurrentScene()->GetPanel());
560                         if (pSelectionPanel != null)
561                         {
562                                 pSelectionPanel->OnRequestMessage();
563                         }
564                 }
565         }
566         break;
567
568         case IDA_CONTEXT_MENU_SHARE_EMAIL:
569         {
570                 if (pSceneManager->GetCurrentSceneId() == IDSCN_ALL_LIST_EDITOR)
571                 {
572                         AllListEditorPanel* pEditorPanel = dynamic_cast<AllListEditorPanel*>(pSceneManager->GetCurrentScene()->GetPanel());
573                         if (pEditorPanel != null)
574                         {
575                                 pEditorPanel->OnRequestEmail();
576                         }
577                 }
578                 else if (pSceneManager->GetCurrentSceneId() == IDSCN_ALL_LIST_SELECTION)
579                 {
580                         AllListSelectionPanel* pSelectionPanel = dynamic_cast<AllListSelectionPanel*>(pSceneManager->GetCurrentScene()->GetPanel());
581                         if (pSelectionPanel != null)
582                         {
583                                 pSelectionPanel->OnRequestEmail();
584                         }
585                 }
586         }
587         break;
588
589         case IDA_CONTEXTMENU_EDITOR_MOVE_CREATE_ALBUM:
590         {
591                 if (pSceneManager->GetCurrentSceneId() == IDSCN_ALL_LIST_EDITOR)
592                 {
593                         AllListEditorPanel* pListEditorPanel = dynamic_cast<AllListEditorPanel*>(pSceneManager->GetCurrentScene()->GetPanel());
594                         if (pListEditorPanel)
595                         {
596                                 IList* pList = pListEditorPanel->GetItemCheckedIndexListN();
597                                 pList->InsertAt(new (std::nothrow) Integer(ALBUM_CREATE), ALBUM_FIRST_ELEMENT);
598                                 if (__isCopyOperation)
599                                 {
600                                         pList->InsertAt(new (std::nothrow) Integer(FILE_ACTION_COPY), ALBUM_SECOND_ELEMENT);
601                                 }
602                                 else
603                                 {
604                                         pList->InsertAt(new (std::nothrow) Integer(FILE_ACTION_MOVE), ALBUM_SECOND_ELEMENT);
605                                 }
606                                 pSceneManager->GoForward(ForwardSceneTransition(IDSCN_ALBUM_NAME_EDITOR), pList);
607                         }
608
609                 }
610         }
611         break;
612
613         case IDA_CONTEXTMENU_SELECTION_MOVE_CREATE_ALBUM:
614         {
615                 if (pSceneManager->GetCurrentSceneId() == IDSCN_ALL_LIST_SELECTION)
616                 {
617                         AllListSelectionPanel* pSelectionPanel = dynamic_cast<AllListSelectionPanel*>
618                         (pSceneManager->GetCurrentScene()->GetPanel());
619                         IList* pList = pSelectionPanel->GetItemCheckedIndexListN();
620                         pList->InsertAt(new (std::nothrow) Integer(ALBUM_CREATE), ALBUM_FIRST_ELEMENT);
621                         if (__isCopyOperation)
622                         {
623                                 pList->InsertAt(new (std::nothrow) Integer(FILE_ACTION_COPY), ALBUM_SECOND_ELEMENT);
624                         }
625                         else
626                         {
627                                 pList->InsertAt(new (std::nothrow) Integer(FILE_ACTION_MOVE), ALBUM_SECOND_ELEMENT);
628                         }
629                         pSceneManager->GoForward(ForwardSceneTransition(IDSCN_ALBUM_NAME_EDITOR), pList);
630                 }
631         }
632         break;
633
634         case IDA_DELETE_POPUP_DEL:
635         {
636                 _overlayMsg = false;
637                 __pDeletePopup->SetShowState(false);
638                 __pDeletePopup->Invalidate(true);
639
640                 if (pSceneManager->GetCurrentSceneId() == IDSCN_ALL_LIST_EDITOR)
641                 {
642                         AllListEditorPanel* pEditorPanel = dynamic_cast<AllListEditorPanel*>(pSceneManager->GetCurrentScene()->GetPanel());
643                         if (pEditorPanel != null)
644                         {
645                                 result r = pEditorPanel->OnRequestDelete();
646                                 if (IsFailed(r))
647                                 {
648                                         AppLogDebug("OnRequestDelete failed with %s", GetErrorMessage(r));
649                                 }
650                         }
651                 }
652                 else if (pSceneManager->GetCurrentSceneId() == IDSCN_ALL_LIST_SELECTION)
653                 {
654                         AllListSelectionPanel* pSelectionPanel = dynamic_cast<AllListSelectionPanel*>
655                         (pSceneManager->GetCurrentScene()->GetPanel());
656
657                         if (pSelectionPanel != null)
658                         {
659                                 result r = pSelectionPanel->OnRequestDelete();
660                                 if (IsFailed(r))
661                                 {
662                                         AppLogDebug("OnRequestDelete failed with %s", GetErrorMessage(r));
663                                 }
664                         }
665                 }
666         }
667         break;
668
669         case IDA_DELETE_POPUP_CANCEL:
670         {
671                 _overlayMsg = false;
672                 __pDeletePopup->SetShowState(false);
673                 __pDeletePopup->Invalidate(true);
674         }
675         break;
676
677         case IDA_CONTEXT_MENU_ROTATE_LEFT:
678         {
679                 if (pSceneManager->GetCurrentSceneId() == IDSCN_ALL_LIST_EDITOR)
680                 {
681                         AllListEditorPanel* pEditorPanel = dynamic_cast<AllListEditorPanel*>(pSceneManager->GetCurrentScene()->GetPanel());
682                         if (pEditorPanel != null)
683                         {
684                                 RotateMode rotateMode = ROTATE_MODE_LEFT;
685                                 pEditorPanel->OnRequestRotate(rotateMode);
686                         }
687                 }
688                 else if (pSceneManager->GetCurrentSceneId() == IDSCN_ALL_LIST_SELECTION)
689                 {
690                         AllListSelectionPanel* pSelectionPanel = dynamic_cast<AllListSelectionPanel*>
691                         (pSceneManager->GetCurrentScene()->GetPanel());
692
693                         if (pSelectionPanel != null)
694                         {
695                                 RotateMode rotateMode = ROTATE_MODE_LEFT;
696                                 pSelectionPanel->OnRotateRequested(rotateMode);
697                         }
698                 }
699         }
700         break;
701
702         case IDA_CONTEXT_MENU_ROTATE_RIGHT:
703         {
704                 if (pSceneManager->GetCurrentSceneId() == IDSCN_ALL_LIST_EDITOR)
705                 {
706                         AllListEditorPanel* pEditorPanel = dynamic_cast<AllListEditorPanel*>(pSceneManager->GetCurrentScene()->GetPanel());
707                         if (pEditorPanel != null)
708                         {
709                                 RotateMode rotateMode = ROTATE_MODE_RIGHT;
710                                 pEditorPanel->OnRequestRotate(rotateMode);
711                         }
712                 }
713                 else if (pSceneManager->GetCurrentSceneId() == IDSCN_ALL_LIST_SELECTION)
714                 {
715
716                         AllListSelectionPanel* pSelectionPanel = dynamic_cast<AllListSelectionPanel*>
717                         (pSceneManager->GetCurrentScene()->GetPanel());
718
719                         if (pSelectionPanel != null)
720                         {
721                                 RotateMode rotateMode = ROTATE_MODE_RIGHT;
722                                 pSelectionPanel->OnRotateRequested(rotateMode);
723                         }
724                 }
725         }
726         break;
727
728         case IDA_FOOTER_CONFIRM:
729         {
730                 if (pSceneManager->GetCurrentSceneId() == IDSCN_IMAGE_LIST_EDITOR)
731                 {
732                         ImageListEditorPanel* pEditorPanel = dynamic_cast<ImageListEditorPanel*>(pSceneManager->GetCurrentScene()->GetPanel());
733                         if (pEditorPanel != null)
734                         {
735                                 pEditorPanel->OnRequestAppExitWithMultipleSelectionAppControlResult();
736                         }
737                 }
738                 else if (pSceneManager->GetCurrentSceneId() == IDSCN_VIDEO_LIST_EDITOR)
739                 {
740                         VideoListEditorPanel* pEditorPanel = dynamic_cast<VideoListEditorPanel*>(pSceneManager->GetCurrentScene()->GetPanel());
741                         if (pEditorPanel != null)
742                         {
743                                 pEditorPanel->OnRequestAppExitWithMultipleSelectionAppControlResult();
744                         }
745                 }
746         }
747         break;
748
749         default:
750         {
751                 if (pSceneManager->GetCurrentSceneId() == IDSCN_ALL_LIST_EDITOR)
752                 {
753                         if ((IDA_CONTEXTMENU_EDITOR_MOVE_ALBUM_ARRAY_START <= actionId) &&
754                                         (actionId <= IDA_CONTEXTMENU_EDITOR_MOVE_CREATE_ALBUM + 1000))
755                         {
756                                 if (__pContentDirectoryList == null)
757                                 {
758                                         return;
759                                 }
760                                 if (__pContentDirectoryList->GetCount() > actionId - IDA_CONTEXTMENU_EDITOR_MOVE_ALBUM_ARRAY_START)
761                                 {
762                                         String* pDirectory = static_cast<String*>
763                                         (__pContentDirectoryList->GetAt(actionId - IDA_CONTEXTMENU_EDITOR_MOVE_ALBUM_ARRAY_START));
764
765                                         AllListEditorPanel* pEditorPanel = dynamic_cast<AllListEditorPanel*>
766                                         (pSceneManager->GetCurrentScene()->GetPanel());
767
768                                         if (pEditorPanel != null)
769                                         {
770                                                 delete __pFileMove;
771                                                 IList* pItemIndexList = pEditorPanel->GetItemCheckedIndexListN();
772                                                 GetMoveFileIndexList(*pDirectory, pItemIndexList, __pPresentationModel);
773                                                 __pFileMove = new (std::nothrow) FileMoveTimer(*pDirectory, pItemIndexList, __pPresentationModel, this);
774                                                 if (__isCopyOperation)
775                                                 {
776                                                         AppLogDebug("Rash: Setting to Copy in FileListEditorForm");
777                                                         __pFileMove->SetCopy();
778                                                 }
779
780                                                 result r = __pFileMove->StartTimer();
781                                                 if (IsFailed(r))
782                                                 {
783                                                         delete __pFileMove;
784                                                         __pFileMove = null;
785                                                         __isCopyOperation = false;
786                                                 }
787                                                 else
788                                                 {
789                                                         _overlayMsg = true;
790                                                 }
791                                         }
792                                 }
793                         }
794                 }
795                 else if (pSceneManager->GetCurrentSceneId() == IDSCN_ALL_LIST_SELECTION)
796                 {
797                         if ((IDA_CONTEXTMENU_SELECTION_MOVE_ALBUM_ARRAY_START <= actionId) &&
798                                         (actionId <= IDA_CONTEXTMENU_SELECTION_MOVE_CREATE_ALBUM + 1000))
799                         {
800                                 if (__pContentDirectoryList == null)
801                                 {
802
803                                         return;
804                                 }
805                                 if (__pContentDirectoryList->GetCount() > actionId - IDA_CONTEXTMENU_SELECTION_MOVE_ALBUM_ARRAY_START)
806                                 {
807                                         String* pDirectory = static_cast<String*>
808                                         (__pContentDirectoryList->GetAt(actionId - IDA_CONTEXTMENU_SELECTION_MOVE_ALBUM_ARRAY_START));
809
810                                         AllListSelectionPanel* pSelectionPanel = dynamic_cast<AllListSelectionPanel*>
811                                                 (pSceneManager->GetCurrentScene()->GetPanel());
812
813                                         if (pSelectionPanel != null)
814                                         {
815                                                 delete __pFileMove;
816                                                 IList* pItemIndexList = pSelectionPanel->GetItemCheckedIndexListN();
817                                                 GetMoveFileIndexList(*pDirectory, pItemIndexList, __pPresentationModel);
818                                                 __pFileMove = new (std::nothrow) FileMoveTimer(*pDirectory, pItemIndexList, __pPresentationModel, this);
819                                                 if (__isCopyOperation)
820                                                 {
821                                                         AppLogDebug("Rash: Setting to Copy in FileListEditorForm");
822                                                         __pFileMove->SetCopy();
823                                                 }
824                                                 result r = __pFileMove->StartTimer();
825                                                 if (IsFailed(r))
826                                                 {
827                                                         delete __pFileMove;
828                                                         __pFileMove = null;
829                                                         __isCopyOperation = false;
830                                                 }
831                                                 else
832                                                 {
833                                                         _overlayMsg = true;
834                                                 }
835                                         }
836                                 }
837                         }
838                 }
839                 break;
840         }
841         }
842         AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
843 }
844
845 void
846 FileListEditorForm::OnFileOpInvalidate(enum FileActionMode actionId)
847 {
848         Invalidate(true);
849 }
850
851 bool
852 FileListEditorForm::GetOverlayStatus(void) const
853 {
854         return _overlayMsg;
855 }
856
857 void
858 FileListEditorForm::OnFileOpComplete(enum FileActionMode actionId, enum FileActionCompleteRes res)
859 {
860         _overlayMsg = false;
861         __pPresentationModel->SetUpdateProgressStatus(false);
862         if (res != COMPLETE_SUCCESS)
863         {
864                 MessageBox messageBox;
865                 messageBox.Construct(L"", ResourceManager::GetString(L"IDS_COM_BODY_OPERATION_FAILED"), MSGBOX_STYLE_OK, 3000);
866                 int modalResult = 0;
867                 _overlayMsg = true;
868                 messageBox.ShowAndWait(modalResult);
869                 _overlayMsg = false;
870                 SceneManager* pSceneManager = SceneManager::GetInstance();
871                 AppAssert(pSceneManager);
872                 pSceneManager->GoForward(ForwardSceneTransition(IDSCN_ALL_LIST));
873         }
874 }
875
876 void
877 FileListEditorForm::OnContentUpdated()
878 {
879         AppLogDebug("ENTER");
880
881         SceneManager* pSceneManager = SceneManager::GetInstance();
882
883         if (__pPresentationModel->GetAppControlMode() == APPCONTROL_MODE_PICK
884                         && pSceneManager->GetCurrentSceneId() == IDSCN_IMAGE_LIST_EDITOR)
885         {
886                 pSceneManager->GoForward(ForwardSceneTransition(IDSCN_ALBUM_LIST));
887
888         }
889         else if (_overlayMsg == false)
890         {
891                 pSceneManager->GoForward(ForwardSceneTransition(IDSCN_ALL_LIST));
892         }
893
894         AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
895 }
896
897 result
898 FileListEditorForm::SetUpPopup(void)
899 {
900         AppLogDebug("ENTER");
901         result r = E_SUCCESS;
902
903         if (__pDeletePopup != null)
904         {
905                 delete __pDeletePopup;
906                 __pDeletePopup = null;
907         }
908
909         __pDeletePopup = new (std::nothrow) Popup();
910         __pDeletePopup->Construct(false, Dimension(W_DELETE_POPUP, H_DELETE_POPUP));
911
912         Rectangle popupClientBounds = __pDeletePopup->GetClientAreaBounds();
913
914         Label* pLabelText = new (std::nothrow) Label();
915         pLabelText->Construct(Rectangle(0, 0, popupClientBounds.width, H_DELETE_LABEL),
916                         ResourceManager::GetString(L"IDS_COM_POP_DELETE_Q"));
917         pLabelText->SetTextHorizontalAlignment(ALIGNMENT_CENTER);
918         __pDeletePopup->AddControl(*pLabelText);
919
920         Button* pDeleteButton = new (std::nothrow) Button();
921         pDeleteButton->Construct(Rectangle(0, Y_DELETE_BUTTON, popupClientBounds.width / 2 - GAP_W_POPUP_ITEM, H_DELETE_BUTTON),
922                         ResourceManager::GetString(L"IDS_COM_BODY_DELETE"));
923         pDeleteButton->SetColor(BUTTON_STATUS_NORMAL, COLOR_DELETE_BUTTON_NORMAL);
924         pDeleteButton->SetColor(BUTTON_STATUS_PRESSED, COLOR_DELETE_BUTTON_PRESSED);
925         pDeleteButton->SetTextColor(COLOR_DELETE_BUTTON_TEXT);
926         pDeleteButton->SetActionId(IDA_DELETE_POPUP_DEL);
927         pDeleteButton->AddActionEventListener(*this);
928         __pDeletePopup->AddControl(*pDeleteButton);
929
930         Button* pButtonCancel = new (std::nothrow) Button();
931         pButtonCancel->Construct(Rectangle(popupClientBounds.width / 2 + GAP_W_POPUP_ITEM, Y_DELETE_BUTTON,
932                         popupClientBounds.width / 2 - GAP_W_POPUP_ITEM, H_DELETE_BUTTON), ResourceManager::GetString(L"IDS_COM_POP_CANCEL"));
933         pButtonCancel->SetActionId(IDA_DELETE_POPUP_CANCEL);
934         pButtonCancel->AddActionEventListener(*this);
935         __pDeletePopup->AddControl(*pButtonCancel);
936         AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
937
938         return r;
939 }
940
941 void
942 FileListEditorForm::SetTitleText(const String& titleText)
943 {
944         AppLogDebug("ENTER");
945         Header* pHeader = GetHeader();
946         TryReturnVoid(pHeader != null, "[%s] fail to get the header.", GetErrorMessage(GetLastResult()));
947         pHeader->SetTitleText(titleText);
948         pHeader->Invalidate(true);
949         AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
950 }
951
952 void
953 FileListEditorForm::RefreshFolderList(void)
954 {
955         AppLogDebug("ENTER");
956         ContentDirectory contentDirectory;
957         IListT<ContentType>* pContentTypeList = new (std::nothrow) ArrayListT<ContentType>();
958         pContentTypeList->Add(CONTENT_TYPE_IMAGE);
959         pContentTypeList->Add(CONTENT_TYPE_VIDEO);
960         result r = contentDirectory.Construct(*pContentTypeList);
961         if (r != E_SUCCESS)
962         {
963                 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
964                 return;
965         }
966         delete pContentTypeList;
967
968         if (__pContentDirectoryList != null)
969         {
970                 delete __pContentDirectoryList;
971         }
972         __pContentDirectoryList = contentDirectory.GetContentDirectoryPathListN(SORT_ORDER_NONE);
973         __pContentDirectoryNameList = new (std::nothrow) ArrayList(SingleObjectDeleter);
974         String* pDirPath = null;
975         String* pDirName = null;
976
977         int loopCount = __pContentDirectoryList->GetCount();
978         for (int i = 0; i < loopCount; ++i)
979         {
980                 pDirPath = static_cast<String*>(__pContentDirectoryList->GetAt(i));
981                 pDirName = new (std::nothrow) String(GetDirecotyNameFromFullPath(*pDirPath));
982                 __pContentDirectoryNameList->Add(pDirName);
983         }
984         __pContextEditorMenuMove->RemoveAllItems();
985         __pContextEditorMenuMove->AddItem(ResourceManager::GetString(L"IDS_MEDIABR_OPT_CREATE_ALBUM"),
986                         IDA_CONTEXTMENU_EDITOR_MOVE_CREATE_ALBUM);
987         __pContextSelectionMenuMove->RemoveAllItems();
988         __pContextSelectionMenuMove->AddItem(ResourceManager::GetString(L"IDS_MEDIABR_OPT_CREATE_ALBUM"),
989                         IDA_CONTEXTMENU_SELECTION_MOVE_CREATE_ALBUM);
990
991         loopCount = __pContentDirectoryNameList->GetCount();
992         for (int i = 0; i < loopCount; ++i)
993         {
994                 pDirName = static_cast<String*>(__pContentDirectoryNameList->GetAt(i));
995                 __pContextEditorMenuMove->AddItem(*(new (std::nothrow) String(*pDirName)),
996                                 IDA_CONTEXTMENU_EDITOR_MOVE_ALBUM_ARRAY_START + i);
997                 __pContextSelectionMenuMove->AddItem(*(new (std::nothrow) String(*pDirName)),
998                                 IDA_CONTEXTMENU_SELECTION_MOVE_ALBUM_ARRAY_START + i);
999         }
1000         __pContextEditorMenuMove->SetShowState(false);
1001         __pContextSelectionMenuMove->SetShowState(false);
1002         AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
1003 }
1004
1005 void
1006 FileListEditorForm::OnFormBackRequested(Form& source)
1007 {
1008         AppLogDebug("ENTER");
1009
1010         SceneManager* pSceneManager = SceneManager::GetInstance();
1011         TryReturnVoid(pSceneManager != null, "[%s] fail to get SceneManager.", GetErrorMessage(GetLastResult()));
1012
1013         if (__pPresentationModel->GetAppControlMode() == APPCONTROL_MODE_PICK)
1014         {
1015                 if (pSceneManager->GetCurrentSceneId() == IDSCN_IMAGE_LIST_EDITOR)
1016                 {
1017                         pSceneManager->GoBackward(BackwardSceneTransition(IDSCN_ALBUM_LIST));
1018                 }
1019                 else if (pSceneManager->GetCurrentSceneId() == IDSCN_VIDEO_LIST_EDITOR)
1020                 {
1021                         pSceneManager->GoBackward(BackwardSceneTransition(IDSCN_ALBUM_LIST));
1022                 }
1023         }
1024         else
1025         {
1026                 if (pSceneManager->GetCurrentSceneId() == IDSCN_ALL_LIST_EDITOR)
1027                 {
1028                         pSceneManager->GoBackward(BackwardSceneTransition(IDSCN_ALL_LIST));
1029                 }
1030                 else if (pSceneManager->GetCurrentSceneId() == IDSCN_IMAGE_LIST_EDITOR)
1031                 {
1032                         pSceneManager->GoBackward(BackwardSceneTransition(IDSCN_IMAGE_LIST));
1033                 }
1034                 else if (pSceneManager->GetCurrentSceneId() == IDSCN_VIDEO_LIST_EDITOR)
1035                 {
1036                         pSceneManager->GoBackward(BackwardSceneTransition(IDSCN_VIDEO_LIST));
1037                 }
1038                 else if (pSceneManager->GetCurrentSceneId() == IDSCN_ALL_LIST_SELECTION)
1039                 {
1040                         AllListSelectionPanel* pSelectionPanel = dynamic_cast<AllListSelectionPanel*>
1041                                 (pSceneManager->GetCurrentScene()->GetPanel());
1042                         if (pSelectionPanel != null)
1043                         {
1044                                 IList* pList = pSelectionPanel->GetItemCheckedIndexListN();
1045                                 if (pList == null)
1046                                 {
1047                                         pList = new (std::nothrow) ArrayList(SingleObjectDeleter);
1048                                 }
1049
1050                                 pSceneManager->GoBackward(BackwardSceneTransition(IDSCN_ALL_LIST_EDITOR), pList);
1051                         }
1052                 }
1053                 else
1054                 {
1055                         pSceneManager->GoBackward(BackwardSceneTransition(IDSCN_ALL_LIST));
1056                 }
1057         }
1058         AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
1059 }
1060
1061 void
1062 FileListEditorForm::SetFooterButtonsState(const bool enableState)
1063 {
1064         AppLogDebug("ENTER");
1065         Footer* pFooter = GetFooter();
1066         TryReturnVoid(pFooter != null, "[%s] fail to get the footer.", GetErrorMessage(GetLastResult()));
1067
1068         if (__pPresentationModel->GetAppControlMode() == APPCONTROL_MODE_PICK)
1069         {
1070                 if (enableState == true)
1071                 {
1072                         pFooter->SetButtonEnabled(BUTTON_POSITION_LEFT, true);
1073                         pFooter->SetItemEnabled(0, true);
1074                 }
1075                 else
1076                 {
1077                         pFooter->SetButtonEnabled(BUTTON_POSITION_LEFT, false);
1078                         pFooter->SetItemEnabled(0, false);
1079                 }
1080
1081         }
1082         else
1083         {
1084                 if (enableState == true)
1085                 {
1086                         pFooter->SetButtonEnabled(BUTTON_POSITION_LEFT, true);
1087                         pFooter->SetItemEnabled(0, true);
1088                         pFooter->SetItemEnabled(1, true);
1089                 }
1090                 else
1091                 {
1092                         pFooter->SetButtonEnabled(BUTTON_POSITION_LEFT, false);
1093                         pFooter->SetItemEnabled(0, false);
1094                         pFooter->SetItemEnabled(1, false);
1095                 }
1096         }
1097         pFooter->RequestRedraw(true);
1098         AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
1099 }
1100
1101 result
1102 FileListEditorForm::MoveToAlbum(const String& destDirectory)
1103 {
1104         AppLogDebug("ENTER");
1105         result r = E_FAILURE;
1106         String albumName = __pPresentationModel->ConvertToAlbumName(destDirectory);
1107         if (albumName != EMPTY_SPACE)
1108         {
1109                 IList* pDirectoryList = new (std::nothrow) ArrayList(SingleObjectDeleter);
1110                 pDirectoryList->Add(new (std::nothrow) String(destDirectory));
1111                 __pPresentationModel->SetCurrentAlbumInfo(albumName, *pDirectoryList);
1112                 __pPresentationModel->SetCurrentAlbumContentType(CONTENT_TYPE_ALL);
1113                 delete pDirectoryList;
1114
1115                 SceneManager* pSceneManager = SceneManager::GetInstance();
1116                 pSceneManager->GoForward(ForwardSceneTransition(IDSCN_ALL_LIST));
1117                 r = E_SUCCESS;
1118         }
1119         AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
1120
1121         return r;
1122 }
1123
1124 void
1125 FileListEditorForm::SelectAllPressed(void)
1126 {
1127         SceneManager* pSceneManager = SceneManager::GetInstance();
1128         pSceneManager->GetCurrentScene();
1129
1130         if (pSceneManager->GetCurrentSceneId() == IDSCN_ALL_LIST_EDITOR)
1131         {
1132                 AllListEditorPanel* pEditorPanel = dynamic_cast<AllListEditorPanel*>(pSceneManager->GetCurrentScene()->GetPanel());
1133                 if (pEditorPanel != null)
1134                 {
1135                         pEditorPanel->OnSelectAllPressed();
1136                 }
1137         }
1138         else if (pSceneManager->GetCurrentSceneId() == IDSCN_IMAGE_LIST_EDITOR)
1139         {
1140                 ImageListEditorPanel* pEditorPanel = dynamic_cast<ImageListEditorPanel*>(pSceneManager->GetCurrentScene()->GetPanel());
1141                 if (pEditorPanel != null)
1142                 {
1143                         pEditorPanel->OnSelectAllPressed();
1144                 }
1145         }
1146         else if (pSceneManager->GetCurrentSceneId() == IDSCN_VIDEO_LIST_EDITOR)
1147         {
1148                 VideoListEditorPanel* pEditorPanel = dynamic_cast<VideoListEditorPanel*>(pSceneManager->GetCurrentScene()->GetPanel());
1149                 if (pEditorPanel != null)
1150                 {
1151                         pEditorPanel->OnSelectAllPressed();
1152                 }
1153         }
1154         else if (pSceneManager->GetCurrentSceneId() == IDSCN_ALL_LIST_SELECTION)
1155         {
1156                 AllListSelectionPanel* pEditorPanel = dynamic_cast<AllListSelectionPanel*>(pSceneManager->GetCurrentScene()->GetPanel());
1157                 if (pEditorPanel != null)
1158                 {
1159                         pEditorPanel->OnSelectAllPressed();
1160                 }
1161         }
1162 }
1163
1164 void
1165 FileListEditorForm::OnSlideSettingPopUpItemSelected(int index)
1166 {
1167         if (__pPopUp != NULL)
1168         {
1169                 __pPopUp->SetShowState(false);
1170         }
1171
1172         SceneManager* pSceneManager = SceneManager::GetInstance();
1173
1174         if (index == 0)
1175         {
1176                 if (pSceneManager->GetCurrentSceneId() == IDSCN_ALL_LIST_EDITOR)
1177                 {
1178                         AllListEditorPanel* pEditorPanel = dynamic_cast<AllListEditorPanel*>(pSceneManager->GetCurrentScene()->GetPanel());
1179                         if (pEditorPanel != null)
1180                         {
1181                                 pEditorPanel->OnRequestSlideShow();
1182                         }
1183                 }
1184                 else if (pSceneManager->GetCurrentSceneId() == IDSCN_ALL_LIST_SELECTION)
1185                 {
1186                         AllListSelectionPanel* pSelectionPanel = dynamic_cast<AllListSelectionPanel*>
1187                                         (pSceneManager->GetCurrentScene()->GetPanel());
1188
1189                         if (pSelectionPanel != null)
1190                         {
1191                                 pSelectionPanel->OnRequestSlideShow();
1192                         }
1193                 }
1194         }
1195         else if (index == 1)
1196         {
1197                 SceneManager* pSceneManager = SceneManager::GetInstance();
1198                 TryReturnVoid(pSceneManager != null, "[%s] fail to get SceneManager", GetErrorMessage(GetLastResult()));
1199
1200                 pSceneManager->GoForward(ForwardSceneTransition(IDSCN_SETTING_MAIN));
1201         }
1202 }
1203
1204 void
1205 FileListEditorForm::OnSceneDeactivated(const SceneId& currentSceneId, const SceneId& nextSceneId)
1206 {
1207         AppLogDebug("ENTER");
1208         __pPresentationModel->RemoveContentEventListener(this);
1209         AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
1210 }
1211
1212 void
1213 FileListEditorForm::OnSceneActivatedN(const SceneId& previousSceneId, const SceneId& currentSceneId, IList* pArgs)
1214 {
1215         AppLogDebug("ENTER");
1216         __pPresentationModel->AddContentEventListener(this);
1217         AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
1218 }
1219