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