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