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