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