2 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
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
8 // http://floralicense.org/license/
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.
18 * @file GlFileListEditorForm.cpp
19 * @brief This is the implementation file for FileListEditorForm class.
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 "GlProgressAnimation.h"
29 #include "GlResourceManager.h"
30 #include "GlSlideSettingListener.h"
31 #include "GlSlideShowPopUp.h"
33 #include "GlVideoListEditorPanel.h"
34 #include "GlFileMoveTimer.h"
36 using namespace Tizen::App;
37 using namespace Tizen::Base;
38 using namespace Tizen::Base::Collection;
39 using namespace Tizen::Content;
40 using namespace Tizen::Graphics;
41 using namespace Tizen::System;
42 using namespace Tizen::Ui;
43 using namespace Tizen::Ui::Controls;
44 using namespace Tizen::Ui::Scenes;
45 using namespace Tizen::Base::Utility;
47 static const int GAP_W_POPUP_ITEM = 10;
48 static const int W_DELETE_POPUP = 688;
49 static const int H_DELETE_POPUP = 230;
50 static const int H_DELETE_LABEL = 80;
51 static const int Y_DELETE_BUTTON = 132;
52 static const int H_DELETE_BUTTON = 74;
53 static const int W_DELETE_BUTTON = 318;
54 static const int H_TOAST_LABEL = 48;
55 static const int Y_DELETE_LABEL = 32;
57 static const unsigned int COLOR_DELETE_BUTTON_NORMAL = Color32<208, 82, 82>::Value;
58 static const unsigned int COLOR_DELETE_BUTTON_PRESSED = Color32<194, 71, 71>::Value;
59 static const unsigned int COLOR_DELETE_BUTTON_TEXT = Color32<248, 246, 239>::Value;
61 static const String RESERVED_MEDIA_PATH = Environment::GetMediaPath();
63 FileListEditorForm::FileListEditorForm(void)
64 : __pShareContextMenu(null)
66 , __pDeletePopup(null)
67 , __morePosition(Point(0, 0))
68 , __pContentDirectoryList(null)
69 , __pContentDirectoryNameList(null)
72 , __isCopyOperation(false)
73 , __pPresentationModel(null)
74 , __isScanProgress(false)
78 _pProgressAnim = null;
79 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
82 FileListEditorForm::~FileListEditorForm(void)
85 if (__pContentDirectoryList != null)
87 __pContentDirectoryList->RemoveAll(true);
88 delete __pContentDirectoryList;
89 __pContentDirectoryList = null;
98 if (__pContentDirectoryNameList != null)
100 __pContentDirectoryNameList->RemoveAll(true);
101 delete __pContentDirectoryNameList;
102 __pContentDirectoryNameList = null;
105 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
109 FileListEditorForm::Initialize(void)
111 AppLogDebug("ENTER");
112 result r = Construct(FORM_STYLE_NORMAL | FORM_STYLE_HEADER | FORM_STYLE_FOOTER | FORM_STYLE_LANDSCAPE_INDICATOR_AUTO_HIDE | FORM_STYLE_PORTRAIT_INDICATOR_AUTO_HIDE);
114 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
120 FileListEditorForm::ShowAnimation()
122 Rectangle clientRect= GetClientAreaBounds();
123 Rectangle rect(0, 0, clientRect.width, clientRect.height);
124 _pProgressAnim = new (std::nothrow) ProgressAnimation;
125 _pProgressAnim->Construct(rect);
126 AddControl(_pProgressAnim);
127 _pProgressAnim->SetShowState(true);
128 GetFooter()->SetEnabled(false);
129 _pProgressAnim->AnimationStart();
130 _pProgressAnim->Draw();
135 FileListEditorForm::StopAnimation(void)
139 _pProgressAnim->AnimationStop();
140 _pProgressAnim->SetShowState(false);
141 RemoveControl(_pProgressAnim);
142 GetFooter()->SetEnabled(true);
143 _pProgressAnim = null;
149 FileListEditorForm::OnInitializing(void)
151 AppLogDebug("ENTER");
152 Header* pHeader = GetHeader();
153 TryReturn(pHeader != null, E_FAILURE, "[%s] fail to get the header.", GetErrorMessage(GetLastResult()));
155 SetOrientation(ORIENTATION_AUTOMATIC);
156 AddOrientationEventListener(*this);
158 __pPresentationModel = FileListPresentationModel::GetInstance();
159 __pPresentationModel->ClearThumbnailRequests();
161 pHeader->SetStyle(HEADER_STYLE_TITLE);
162 pHeader->SetTitleText(ResourceManager::GetString(L"IDS_COM_BODY_EDIT"));
164 if ((__pPresentationModel->GetAppControlMode() == APPCONTROL_MODE_PICK
165 && __pPresentationModel->GetAppControlSelectionMode() == APPCONTROL_SELECTION_MODE_SINGLE) == false)
167 Bitmap* pNormalBitmap = ResourceManager::GetBitmapN(IDB_ICON_SELECT_ALL);
168 Bitmap* pPressBitmap = ResourceManager::GetBitmapN(IDB_ICON_SELECT_ALL_PRESS);
169 ButtonItem selectAll;
170 selectAll.Construct(BUTTON_ITEM_STYLE_ICON, IDA_FILE_LIST_SELECT_ALL);
171 selectAll.SetIcon(BUTTON_ITEM_STATUS_NORMAL, pNormalBitmap);
172 selectAll.SetIcon(BUTTON_ITEM_STATUS_PRESSED, pPressBitmap);
173 pHeader->SetButton(BUTTON_POSITION_LEFT, selectAll);
174 delete pNormalBitmap;
178 pHeader->AddActionEventListener(*this);
181 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
187 FileListEditorForm::InitializeFooter(void)
189 AppLogDebug("ENTER");
190 Footer* pFooter = GetFooter();
191 TryReturn(pFooter != null, E_FAILURE, "[%s] fail to get the footer.", GetErrorMessage(GetLastResult()));
192 pFooter->RemoveAllItems();
194 result r = E_SUCCESS;
196 if (__pPresentationModel->GetAppControlMode() == APPCONTROL_MODE_PICK)
198 if (__pPresentationModel->GetAppControlSelectionMode() == APPCONTROL_SELECTION_MODE_MULTIPLE)
200 pFooter->SetStyle(FOOTER_STYLE_BUTTON_TEXT);
202 FooterItem footerConfirm;
203 footerConfirm.Construct(IDA_FOOTER_CONFIRM);
204 footerConfirm.SetText(ResourceManager::GetString(L"IDS_COM_SK_DONE"));
205 pFooter->AddItem(footerConfirm);
206 pFooter->SetItemEnabled(0, false);
207 pFooter->SetShowState(true);
208 pFooter->Invalidate(true);
212 pFooter->SetStyle(FOOTER_STYLE_SEGMENTED_TEXT);
213 pFooter->SetShowState(false);
214 pFooter->Invalidate(true);
217 SetFormBackEventListener(this);
222 pFooter->SetStyle(FOOTER_STYLE_BUTTON_ICON_TEXT);
223 SetFormMenuEventListener(this);
225 FooterItem footerShare;
226 r = footerShare.Construct(IDA_FOOTER_SHARE);
227 TryReturn(r == E_SUCCESS, r, "[%s] Unable to construct footer item", GetErrorMessage(r));
228 Bitmap* pBitmapShare = ResourceManager::GetBitmapN(IDB_CONTROLBAR_SHARE);
229 Bitmap* pBitmapShareDim = ResourceManager::GetBitmapN(IDB_CONTROLBAR_SHARE_DIM);
231 if (pBitmapShare != null && pBitmapShareDim != null)
233 footerShare.SetIcon(FOOTER_ITEM_STATUS_NORMAL, pBitmapShare);
234 footerShare.SetIcon(FOOTER_ITEM_STATUS_DISABLED, pBitmapShareDim);
237 r = pFooter->AddItem(footerShare);
239 delete pBitmapShareDim;
240 TryReturn(r == E_SUCCESS, r, "[%s] Unable to add item", GetErrorMessage(r));
242 FooterItem footerDelete;
243 r = footerDelete.Construct(IDA_FOOTER_DELETE);
244 TryReturn(r == E_SUCCESS, r, "[%s] Unable to construct footer item", GetErrorMessage(r));
245 Bitmap* pBitmapDelete = ResourceManager::GetBitmapN(IDB_CONTROLBAR_DELETE);
246 Bitmap* pBitmapDeleteDim = ResourceManager::GetBitmapN(IDB_CONTROLBAR_DELETE_DIM);
248 if (pBitmapDelete != null && pBitmapDeleteDim != null)
250 footerDelete.SetIcon(FOOTER_ITEM_STATUS_NORMAL, pBitmapDelete);
251 footerDelete.SetIcon(FOOTER_ITEM_STATUS_DISABLED, pBitmapDeleteDim);
254 r = pFooter->AddItem(footerDelete);
255 delete pBitmapDelete;
256 delete pBitmapDeleteDim;
257 TryReturn(r == E_SUCCESS, r, "[%s] Unable to add item", GetErrorMessage(r));
259 SetFormBackEventListener(this);
261 SceneManager* pSceneManager = SceneManager::GetInstance();
262 int checkedCount = 0;
264 if (pSceneManager->GetCurrentSceneId() == IDSCN_ALL_LIST_EDITOR)
266 AllListEditorPanel* pEditorPanel = dynamic_cast<AllListEditorPanel*>(pSceneManager->GetCurrentScene()->GetPanel());
267 if (pEditorPanel != null)
269 checkedCount = pEditorPanel->GetItemCheckedCount();
272 else if (pSceneManager->GetCurrentSceneId() == IDSCN_ALL_LIST_SELECTION)
274 AllListSelectionPanel* pSelectionPanel = dynamic_cast<AllListSelectionPanel*>(pSceneManager->GetCurrentScene()->GetPanel());
275 if (pSelectionPanel != null)
277 checkedCount = pSelectionPanel->GetItemCheckedCount();
281 AppLogDebug("GetItemCheckedCount(%d)", checkedCount);
283 if (__pOptionMenu != null)
285 delete __pOptionMenu;
286 __pOptionMenu = null;
289 __pOptionMenu = new (std::nothrow) OptionMenu();
290 __pOptionMenu->Construct();
291 __pOptionMenu->AddItem(ResourceManager::GetString(L"IDS_COM_BODY_MOVE"),
292 IDA_CONTEXT_MENU_MORE_MOVE);
293 __pOptionMenu->AddItem(ResourceManager::GetString(L"IDS_COM_BODY_COPY"),
294 IDA_CONTEXT_MENU_MORE_COPY);
296 if (checkedCount > 1)
298 __pOptionMenu->AddItem(ResourceManager::GetString(L"IDS_MEDIABR_OPT_SLIDESHOW"),
299 IDA_CONTEXT_MENU_MORE_SLIDE_SHOW);
302 __pOptionMenu->AddItem(ResourceManager::GetString(L"IDS_IV_OPT_ROTATE_LEFT"),IDA_CONTEXT_MENU_ROTATE_LEFT);
303 __pOptionMenu->AddItem(ResourceManager::GetString(L"IDS_IV_OPT_ROTATE_RIGHT"),IDA_CONTEXT_MENU_ROTATE_RIGHT);
305 __pOptionMenu->AddActionEventListener(*this);
307 if (__pContentDirectoryNameList != null)
309 __pContentDirectoryNameList->RemoveAll(true);
310 delete __pContentDirectoryNameList;
311 __pContentDirectoryNameList = null;
317 pFooter->AddActionEventListener(*this);
318 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
324 FileListEditorForm::GetDirecotyNameFromFullPath(const String& fullPath)const
326 AppLogDebug("ENTER");
327 if (fullPath == null)
329 AppLogDebug("EXIT 1(%s)", GetErrorMessage(GetLastResult()));
333 String delim(DIRECTORY_SEPARATOR);
334 StringTokenizer st(fullPath,delim);
336 while (st.HasMoreTokens())
338 st.GetNextToken(token);
340 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
346 FileListEditorForm::OnTerminating(void)
348 AppLogDebug("ENTER");
349 __pPresentationModel->RemoveContentEventListener(this);
351 if (__pOptionMenu != null)
353 __pOptionMenu->RemoveActionEventListener(*this);
354 delete __pOptionMenu;
355 __pOptionMenu = null;
358 if (__pShareContextMenu != null)
360 __pShareContextMenu->RemoveActionEventListener(*this);
361 delete __pShareContextMenu;
362 __pShareContextMenu = null;
365 if (__pDeletePopup != null)
367 delete __pDeletePopup;
368 __pDeletePopup = null;
371 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
377 FileListEditorForm::OnActionPerformed(const Control& source, int actionId)
379 AppLogDebug("ENTER(actionId=%d)", actionId);
380 SceneManager* pSceneManager = SceneManager::GetInstance();
381 TryReturnVoid(pSceneManager != null, "[%s] fail to get SceneManager.", GetErrorMessage(GetLastResult()));
385 case IDA_FILE_LIST_SELECT_ALL:
389 case IDA_FOOTER_SHARE:
391 if (__pShareContextMenu != NULL)
393 delete __pShareContextMenu;
394 __pShareContextMenu = null;
397 Bitmap* pBitmapEmailContextItem = null;
398 Bitmap* pBitmapMessageContextItem = null;
399 pBitmapEmailContextItem = ResourceManager::GetBitmapN(IDB_IMAGE_CONTEXT_EMAIL_ICON);
400 pBitmapMessageContextItem = ResourceManager::GetBitmapN(IDB_IMAGE_CONTEXT_MESSAGE_ICON);
402 __pShareContextMenu = new (std::nothrow) ContextMenu();
403 __pShareContextMenu->Construct(Point(GetClientAreaBounds().width/3 + 15, GetClientAreaBounds().height),
404 CONTEXT_MENU_STYLE_LIST, CONTEXT_MENU_ANCHOR_DIRECTION_UPWARD);
406 if ( pBitmapMessageContextItem != null)
408 __pShareContextMenu->AddItem(ResourceManager::GetString(L"IDS_COM_BODY_MESSAGE"),
409 IDA_CONTEXT_MENU_SHARE_MESSAGE, *pBitmapMessageContextItem, null, null);
410 delete pBitmapMessageContextItem;
413 if ( pBitmapEmailContextItem != null)
415 __pShareContextMenu->AddItem(ResourceManager::GetString(L"IDS_COM_BODY_EMAIL"),
416 IDA_CONTEXT_MENU_SHARE_EMAIL, *pBitmapEmailContextItem, null, null);
417 delete pBitmapEmailContextItem;
419 __pShareContextMenu->SetFocusable(true);
420 __pShareContextMenu->AddActionEventListener(*this);
423 Rectangle rect = source.GetBounds();
425 if (pSceneManager->GetCurrentSceneId() == IDSCN_ALL_LIST_SELECTION)
427 __pShareContextMenu->SetAnchorPosition(Point(rect.width / 8 * 3, rect.y));
431 __pShareContextMenu->SetAnchorPosition(Point(rect.width / 8 * 3, rect.y - H_TOAST_LABEL));
434 __pShareContextMenu->SetShowState(true);
435 __pShareContextMenu->Show();
440 case IDA_FOOTER_DELETE:
442 if (pSceneManager->GetCurrentSceneId() == IDSCN_ALL_LIST_EDITOR)
444 AllListEditorPanel* pEditorPanel = dynamic_cast<AllListEditorPanel*>(pSceneManager->GetCurrentScene()->GetPanel());
445 if (pEditorPanel != null && pEditorPanel->GetItemCheckedCount() > 0)
447 __pDeletePopup->SetShowState(true);
448 __pDeletePopup->Show();
452 else if (pSceneManager->GetCurrentSceneId() == IDSCN_IMAGE_LIST_EDITOR)
454 ImageListEditorPanel* pEditorPanel = dynamic_cast<ImageListEditorPanel*>(pSceneManager->GetCurrentScene()->GetPanel());
455 if (pEditorPanel != null && pEditorPanel->GetItemCheckedCount() > 0)
457 __pDeletePopup->SetShowState(true);
458 __pDeletePopup->Show();
462 else if (pSceneManager->GetCurrentSceneId() == IDSCN_VIDEO_LIST_EDITOR)
464 VideoListEditorPanel* pEditorPanel = dynamic_cast<VideoListEditorPanel*>(pSceneManager->GetCurrentScene()->GetPanel());
465 if (pEditorPanel != null && pEditorPanel->GetItemCheckedCount() > 0)
467 __pDeletePopup->SetShowState(true);
468 __pDeletePopup->Show();
472 if (pSceneManager->GetCurrentSceneId() == IDSCN_ALL_LIST_SELECTION)
474 AllListSelectionPanel* pSelectionPanel = dynamic_cast<AllListSelectionPanel*>
475 (pSceneManager->GetCurrentScene()->GetPanel());
476 if (pSelectionPanel != null && pSelectionPanel->GetItemCheckedCount() > 0)
478 __pDeletePopup->SetShowState(true);
479 __pDeletePopup->Show();
486 case IDA_CONTEXT_MENU_MORE_EDIT:
491 case IDA_CONTEXT_MENU_MORE_ADD_TAG:
496 case IDA_CONTEXT_MENU_MORE_COPY:
498 case IDA_CONTEXT_MENU_MORE_MOVE:
500 if (actionId == IDA_CONTEXT_MENU_MORE_MOVE)
502 __isCopyOperation = false;
504 else if (actionId == IDA_CONTEXT_MENU_MORE_COPY)
506 __isCopyOperation = true;
511 __pOptionMenu->SetShowState(true);
512 __pOptionMenu->Show();
518 case IDA_CONTEXT_MENU_MORE_SLIDE_SHOW:
520 if (__pPopUp != NULL)
525 __pPopUp = new (std::nothrow) SlideShowPopUp();
527 if (__pPopUp != null)
529 __pPopUp->Initialize();
530 __pPopUp->SetEventListner(this);
531 __pPopUp->SetShowState(true);
537 case IDA_CONTEXT_MENU_SHARE_MESSAGE:
539 if (pSceneManager->GetCurrentSceneId() == IDSCN_ALL_LIST_EDITOR)
541 AllListEditorPanel* pEditorPanel = dynamic_cast<AllListEditorPanel*>(pSceneManager->GetCurrentScene()->GetPanel());
542 if (pEditorPanel != null)
544 pEditorPanel->OnRequestMessage();
547 else if (pSceneManager->GetCurrentSceneId() == IDSCN_ALL_LIST_SELECTION)
549 AllListSelectionPanel* pSelectionPanel = dynamic_cast<AllListSelectionPanel*>(pSceneManager->GetCurrentScene()->GetPanel());
550 if (pSelectionPanel != null)
552 pSelectionPanel->OnRequestMessage();
558 case IDA_CONTEXT_MENU_SHARE_EMAIL:
560 if (pSceneManager->GetCurrentSceneId() == IDSCN_ALL_LIST_EDITOR)
562 AllListEditorPanel* pEditorPanel = dynamic_cast<AllListEditorPanel*>(pSceneManager->GetCurrentScene()->GetPanel());
563 if (pEditorPanel != null)
565 pEditorPanel->OnRequestEmail();
568 else if (pSceneManager->GetCurrentSceneId() == IDSCN_ALL_LIST_SELECTION)
570 AllListSelectionPanel* pSelectionPanel = dynamic_cast<AllListSelectionPanel*>(pSceneManager->GetCurrentScene()->GetPanel());
571 if (pSelectionPanel != null)
573 pSelectionPanel->OnRequestEmail();
579 case IDA_CONTEXTMENU_EDITOR_MOVE_CREATE_ALBUM:
581 if (pSceneManager->GetCurrentSceneId() == IDSCN_ALL_LIST_EDITOR)
583 AllListEditorPanel* pListEditorPanel = dynamic_cast<AllListEditorPanel*>(pSceneManager->GetCurrentScene()->GetPanel());
584 if (pListEditorPanel)
586 IList* pList = pListEditorPanel->GetItemCheckedIndexListN();
587 pList->InsertAt(new (std::nothrow) Integer(ALBUM_CREATE), ALBUM_FIRST_ELEMENT);
588 if (__isCopyOperation)
590 pList->InsertAt(new (std::nothrow) Integer(FILE_ACTION_COPY), ALBUM_SECOND_ELEMENT);
594 pList->InsertAt(new (std::nothrow) Integer(FILE_ACTION_MOVE), ALBUM_SECOND_ELEMENT);
596 pSceneManager->GoForward(ForwardSceneTransition(IDSCN_ALBUM_NAME_EDITOR), pList);
602 if (pSceneManager->GetCurrentSceneId() == IDSCN_ALL_LIST_SELECTION)
604 AllListSelectionPanel* pSelectionPanel = dynamic_cast<AllListSelectionPanel*>
605 (pSceneManager->GetCurrentScene()->GetPanel());
607 if (pSelectionPanel != null)
609 IList* pList = pSelectionPanel->GetItemCheckedIndexListN();
610 pList->InsertAt(new (std::nothrow) Integer(ALBUM_CREATE), ALBUM_FIRST_ELEMENT);
611 if (__isCopyOperation)
613 pList->InsertAt(new (std::nothrow) Integer(FILE_ACTION_COPY), ALBUM_SECOND_ELEMENT);
617 pList->InsertAt(new (std::nothrow) Integer(FILE_ACTION_MOVE), ALBUM_SECOND_ELEMENT);
619 pSceneManager->GoForward(ForwardSceneTransition(IDSCN_ALBUM_NAME_EDITOR), pList);
626 case IDA_DELETE_POPUP_DEL:
629 __pDeletePopup->SetShowState(false);
630 __pDeletePopup->Invalidate(true);
632 if (pSceneManager->GetCurrentSceneId() == IDSCN_ALL_LIST_EDITOR)
634 AllListEditorPanel* pEditorPanel = dynamic_cast<AllListEditorPanel*>(pSceneManager->GetCurrentScene()->GetPanel());
635 if (pEditorPanel != null)
637 result r = pEditorPanel->OnRequestDelete();
640 AppLogDebug("OnRequestDelete failed with %s", GetErrorMessage(r));
644 else if (pSceneManager->GetCurrentSceneId() == IDSCN_ALL_LIST_SELECTION)
646 AllListSelectionPanel* pSelectionPanel = dynamic_cast<AllListSelectionPanel*>
647 (pSceneManager->GetCurrentScene()->GetPanel());
649 if (pSelectionPanel != null)
651 result r = pSelectionPanel->OnRequestDelete();
654 AppLogDebug("OnRequestDelete failed with %s", GetErrorMessage(r));
661 case IDA_DELETE_POPUP_CANCEL:
664 __pDeletePopup->SetShowState(false);
665 __pDeletePopup->Invalidate(true);
669 case IDA_CONTEXT_MENU_ROTATE_LEFT:
671 if (pSceneManager->GetCurrentSceneId() == IDSCN_ALL_LIST_EDITOR)
673 AllListEditorPanel* pEditorPanel = dynamic_cast<AllListEditorPanel*>(pSceneManager->GetCurrentScene()->GetPanel());
674 if (pEditorPanel != null)
676 RotateMode rotateMode = ROTATE_MODE_LEFT;
677 pEditorPanel->OnRequestRotate(rotateMode);
680 else if (pSceneManager->GetCurrentSceneId() == IDSCN_ALL_LIST_SELECTION)
682 AllListSelectionPanel* pSelectionPanel = dynamic_cast<AllListSelectionPanel*>
683 (pSceneManager->GetCurrentScene()->GetPanel());
685 if (pSelectionPanel != null)
687 RotateMode rotateMode = ROTATE_MODE_LEFT;
688 pSelectionPanel->OnRotateRequested(rotateMode);
694 case IDA_CONTEXT_MENU_ROTATE_RIGHT:
696 if (pSceneManager->GetCurrentSceneId() == IDSCN_ALL_LIST_EDITOR)
698 AllListEditorPanel* pEditorPanel = dynamic_cast<AllListEditorPanel*>(pSceneManager->GetCurrentScene()->GetPanel());
699 if (pEditorPanel != null)
701 RotateMode rotateMode = ROTATE_MODE_RIGHT;
702 pEditorPanel->OnRequestRotate(rotateMode);
705 else if (pSceneManager->GetCurrentSceneId() == IDSCN_ALL_LIST_SELECTION)
708 AllListSelectionPanel* pSelectionPanel = dynamic_cast<AllListSelectionPanel*>
709 (pSceneManager->GetCurrentScene()->GetPanel());
711 if (pSelectionPanel != null)
713 RotateMode rotateMode = ROTATE_MODE_RIGHT;
714 pSelectionPanel->OnRotateRequested(rotateMode);
720 case IDA_FOOTER_CONFIRM:
722 if (pSceneManager->GetCurrentSceneId() == IDSCN_IMAGE_LIST_EDITOR)
724 ImageListEditorPanel* pEditorPanel = dynamic_cast<ImageListEditorPanel*>(pSceneManager->GetCurrentScene()->GetPanel());
725 if (pEditorPanel != null)
727 pEditorPanel->OnRequestAppExitWithMultipleSelectionAppControlResult();
730 else if (pSceneManager->GetCurrentSceneId() == IDSCN_VIDEO_LIST_EDITOR)
732 VideoListEditorPanel* pEditorPanel = dynamic_cast<VideoListEditorPanel*>(pSceneManager->GetCurrentScene()->GetPanel());
733 if (pEditorPanel != null)
735 pEditorPanel->OnRequestAppExitWithMultipleSelectionAppControlResult();
743 if (pSceneManager->GetCurrentSceneId() == IDSCN_ALL_LIST_EDITOR)
745 if ((IDA_CONTEXTMENU_EDITOR_MOVE_ALBUM_ARRAY_START <= actionId) &&
746 (actionId <= IDA_CONTEXTMENU_EDITOR_MOVE_CREATE_ALBUM + 1000))
748 if (__pContentDirectoryList == null)
752 if (__pContentDirectoryList->GetCount() > actionId - IDA_CONTEXTMENU_EDITOR_MOVE_ALBUM_ARRAY_START)
754 String* pDirectory = static_cast<String*>
755 (__pContentDirectoryList->GetAt(actionId - IDA_CONTEXTMENU_EDITOR_MOVE_ALBUM_ARRAY_START));
757 AllListEditorPanel* pEditorPanel = dynamic_cast<AllListEditorPanel*>
758 (pSceneManager->GetCurrentScene()->GetPanel());
760 if (pEditorPanel != null)
763 IList* pItemIndexList = pEditorPanel->GetItemCheckedIndexListN();
764 GetMoveFileIndexList(*pDirectory, pItemIndexList, __pPresentationModel , __isCopyOperation);
765 __pFileMove = new (std::nothrow) FileMoveTimer(*pDirectory, pItemIndexList, __pPresentationModel, this);
766 if (__isCopyOperation)
768 AppLogDebug("Rash: Setting to Copy in FileListEditorForm");
769 __pFileMove->SetCopy();
772 result r = __pFileMove->StartTimer();
777 __isCopyOperation = false;
787 else if (pSceneManager->GetCurrentSceneId() == IDSCN_ALL_LIST_SELECTION)
789 if ((IDA_CONTEXTMENU_EDITOR_MOVE_ALBUM_ARRAY_START <= actionId) &&
790 (actionId <= IDA_CONTEXTMENU_EDITOR_MOVE_CREATE_ALBUM + 1000))
792 if (__pContentDirectoryList == null)
797 if (__pContentDirectoryList->GetCount() > actionId - IDA_CONTEXTMENU_EDITOR_MOVE_ALBUM_ARRAY_START)
799 String* pDirectory = static_cast<String*>
800 (__pContentDirectoryList->GetAt(actionId - IDA_CONTEXTMENU_EDITOR_MOVE_ALBUM_ARRAY_START));
802 AllListSelectionPanel* pSelectionPanel = dynamic_cast<AllListSelectionPanel*>
803 (pSceneManager->GetCurrentScene()->GetPanel());
805 if (pSelectionPanel != null)
808 IList* pItemIndexList = pSelectionPanel->GetItemCheckedIndexListN();
809 GetMoveFileIndexList(*pDirectory, pItemIndexList, __pPresentationModel , __isCopyOperation);
810 __pFileMove = new (std::nothrow) FileMoveTimer(*pDirectory, pItemIndexList, __pPresentationModel, this);
811 if (__isCopyOperation)
813 AppLogDebug("Rash: Setting to Copy in FileListEditorForm");
814 __pFileMove->SetCopy();
816 result r = __pFileMove->StartTimer();
821 __isCopyOperation = false;
834 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
838 FileListEditorForm::OnFileOpInvalidate(enum FileActionMode actionId)
845 FileListEditorForm::OnScanDirStart()
847 AppLogDebug("ENTER");
848 GetHeader()->SetButtonEnabled(BUTTON_POSITION_RIGHT, false);
849 __isScanProgress = true;
851 AppLogDebug("ENTER");
854 FileListEditorForm::OnScanDirComplete()
856 AppLogDebug("ENTER");
857 GetHeader()->SetButtonEnabled(BUTTON_POSITION_RIGHT, true);
858 __isScanProgress = false;
860 AppLogDebug("ENTER");
865 FileListEditorForm::GetOverlayStatus(void) const
871 FileListEditorForm::OnFileOpComplete(enum FileActionMode actionId, enum FileActionCompleteRes res)
873 AppLogDebug("ENTER");
875 __pPresentationModel->SetUpdateProgressStatus(false);
876 if (res != COMPLETE_SUCCESS)
878 MessageBox messageBox;
879 messageBox.Construct(L"", ResourceManager::GetString(L"IDS_COM_BODY_OPERATION_FAILED"), MSGBOX_STYLE_OK, 3000);
882 messageBox.ShowAndWait(modalResult);
884 SceneManager* pSceneManager = SceneManager::GetInstance();
885 AppAssert(pSceneManager);
886 pSceneManager->GoForward(ForwardSceneTransition(IDSCN_ALL_LIST));
892 FileListEditorForm::OnContentUpdated()
894 AppLogDebug("ENTER");
896 SceneManager* pSceneManager = SceneManager::GetInstance();
898 if(__pDeletePopup != null)
900 if(__pDeletePopup->IsVisible() == true)
902 __pDeletePopup->Destroy();
903 __pDeletePopup = null;
909 if (pSceneManager->GetCurrentSceneId() == IDSCN_ALL_LIST_EDITOR)
911 AllListEditorPanel* pEditorPanel = dynamic_cast<AllListEditorPanel*>(pSceneManager->GetCurrentScene()->GetPanel());
912 if (pEditorPanel != null)
914 pEditorPanel->CancelUpdateProgress();
917 else if (pSceneManager->GetCurrentSceneId() == IDSCN_ALL_LIST_SELECTION)
919 AllListSelectionPanel* pSelectionPanel = dynamic_cast<AllListSelectionPanel*>(pSceneManager->GetCurrentScene()->GetPanel());
920 if (pSelectionPanel != null)
922 pSelectionPanel->CancelUpdateProgress();
926 if (__pPresentationModel->GetAppControlMode() == APPCONTROL_MODE_PICK
927 && pSceneManager->GetCurrentSceneId() == IDSCN_IMAGE_LIST_EDITOR)
929 pSceneManager->GoForward(ForwardSceneTransition(IDSCN_ALBUM_LIST, SCENE_TRANSITION_ANIMATION_TYPE_NONE,
930 SCENE_HISTORY_OPTION_NO_HISTORY, SCENE_DESTROY_OPTION_DESTROY));
933 else if (_overlayMsg == false)
935 pSceneManager->GoForward(ForwardSceneTransition(IDSCN_ALL_LIST, SCENE_TRANSITION_ANIMATION_TYPE_NONE,
936 SCENE_HISTORY_OPTION_NO_HISTORY, SCENE_DESTROY_OPTION_DESTROY));
939 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
943 FileListEditorForm::SetUpPopup(void)
945 AppLogDebug("ENTER");
946 result r = E_SUCCESS;
948 if (__pDeletePopup != null)
950 delete __pDeletePopup;
951 __pDeletePopup = null;
954 __pDeletePopup = new (std::nothrow) Popup();
955 __pDeletePopup->Construct(false, Dimension(W_DELETE_POPUP, H_DELETE_POPUP));
956 __pDeletePopup->SetPropagatedKeyEventListener(this);
958 Rectangle popupClientBounds = __pDeletePopup->GetClientAreaBounds();
960 Label* pLabelText = new (std::nothrow) Label();
961 pLabelText->Construct(Rectangle(0, Y_DELETE_LABEL, popupClientBounds.width, H_DELETE_LABEL),
962 ResourceManager::GetString(L"IDS_COM_POP_DELETE_Q"));
963 pLabelText->SetTextHorizontalAlignment(ALIGNMENT_LEFT);
964 pLabelText->SetTextConfig(34,LABEL_TEXT_STYLE_BOLD);
965 __pDeletePopup->AddControl(pLabelText);
967 Button* pDeleteButton = new (std::nothrow) Button();
968 pDeleteButton->Construct(Rectangle(popupClientBounds.width / 2 + GAP_W_POPUP_ITEM, Y_DELETE_BUTTON, W_DELETE_BUTTON, H_DELETE_BUTTON),
969 ResourceManager::GetString(L"IDS_COM_BODY_DELETE"));
970 pDeleteButton->SetColor(BUTTON_STATUS_NORMAL, COLOR_DELETE_BUTTON_NORMAL);
971 pDeleteButton->SetColor(BUTTON_STATUS_PRESSED, COLOR_DELETE_BUTTON_PRESSED);
972 pDeleteButton->SetTextColor(COLOR_DELETE_BUTTON_TEXT);
973 pDeleteButton->SetActionId(IDA_DELETE_POPUP_DEL);
974 pDeleteButton->AddActionEventListener(*this);
975 __pDeletePopup->AddControl(pDeleteButton);
977 Button* pButtonCancel = new (std::nothrow) Button();
978 pButtonCancel->Construct(Rectangle(16, Y_DELETE_BUTTON, W_DELETE_BUTTON, H_DELETE_BUTTON),
979 ResourceManager::GetString(L"IDS_COM_POP_CANCEL"));
980 pButtonCancel->SetActionId(IDA_DELETE_POPUP_CANCEL);
981 pButtonCancel->AddActionEventListener(*this);
982 __pDeletePopup->AddControl(pButtonCancel);
983 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
989 FileListEditorForm::SetTitleText(const String& titleText)
991 AppLogDebug("ENTER");
992 Header* pHeader = GetHeader();
993 TryReturnVoid(pHeader != null, "[%s] fail to get the header.", GetErrorMessage(GetLastResult()));
994 pHeader->SetTitleText(titleText);
995 pHeader->Invalidate(true);
996 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
1000 FileListEditorForm::RefreshFolderList(void)
1002 AppLogDebug("ENTER");
1003 ContentDirectory contentDirectory;
1004 IListT<ContentType>* pContentTypeList = new (std::nothrow) ArrayListT<ContentType>();
1005 pContentTypeList->Add(CONTENT_TYPE_IMAGE);
1006 pContentTypeList->Add(CONTENT_TYPE_VIDEO);
1007 result r = contentDirectory.Construct(*pContentTypeList);
1010 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
1013 delete pContentTypeList;
1015 if (__pContentDirectoryList != null)
1017 __pContentDirectoryList->RemoveAll(true);
1018 delete __pContentDirectoryList;
1019 __pContentDirectoryList = null;
1021 __pContentDirectoryList = contentDirectory.GetContentDirectoryPathListN(SORT_ORDER_NONE);
1023 if (__pContentDirectoryNameList != NULL)
1025 __pContentDirectoryNameList->RemoveAll(true);
1026 delete __pContentDirectoryNameList;
1027 __pContentDirectoryNameList = null;
1030 __pContentDirectoryNameList = new (std::nothrow) ArrayList(SingleObjectDeleter);
1031 String* pDirPath = null;
1032 String* pDirName = null;
1033 String mediaPath = RESERVED_MEDIA_PATH;
1034 int length = mediaPath.GetLength();
1035 mediaPath.Remove(length-1,1);
1037 int loopCount = __pContentDirectoryList->GetCount();
1038 for (int i = 0; i < loopCount; ++i)
1040 pDirPath = static_cast<String*>(__pContentDirectoryList->GetAt(i));
1041 pDirName = new (std::nothrow) String(GetDirecotyNameFromFullPath(*pDirPath));
1043 if (*pDirPath == mediaPath)
1045 *pDirName = ResourceManager::GetString(L"IDS_MEDIABR_POP_NO_NAME");
1046 __pContentDirectoryNameList->Add(pDirName);
1050 __pContentDirectoryNameList->Add(pDirName);
1054 __pOptionMenu->RemoveAllItems();
1055 __pOptionMenu->AddItem(ResourceManager::GetString(L"IDS_MEDIABR_OPT_CREATE_ALBUM"),
1056 IDA_CONTEXTMENU_EDITOR_MOVE_CREATE_ALBUM);
1058 loopCount = __pContentDirectoryNameList->GetCount();
1060 String dirAllAlbums = L"All albums";
1062 for (int i = 0; i < loopCount; ++i)
1064 pDirName = static_cast<String*>(__pContentDirectoryNameList->GetAt(i));
1066 if (*pDirName != __pPresentationModel->GetCurrentAlbumName() || *pDirName == dirAllAlbums)
1068 __pOptionMenu->AddItem(*(new (std::nothrow) String(*pDirName)),
1069 IDA_CONTEXTMENU_EDITOR_MOVE_ALBUM_ARRAY_START + i);
1074 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
1078 FileListEditorForm::OnFormBackRequested(Form& source)
1080 AppLogDebug("ENTER");
1082 if(__isScanProgress)
1087 SceneManager* pSceneManager = SceneManager::GetInstance();
1088 TryReturnVoid(pSceneManager != null, "[%s] fail to get SceneManager.", GetErrorMessage(GetLastResult()));
1090 if (__pPresentationModel->GetAppControlMode() == APPCONTROL_MODE_PICK)
1092 if (pSceneManager->GetCurrentSceneId() == IDSCN_IMAGE_LIST_EDITOR)
1094 pSceneManager->GoBackward(BackwardSceneTransition(IDSCN_ALBUM_LIST));
1096 else if (pSceneManager->GetCurrentSceneId() == IDSCN_VIDEO_LIST_EDITOR)
1098 pSceneManager->GoBackward(BackwardSceneTransition(IDSCN_ALBUM_LIST));
1103 if (pSceneManager->GetCurrentSceneId() == IDSCN_ALL_LIST_EDITOR)
1105 pSceneManager->GoBackward(BackwardSceneTransition(IDSCN_ALL_LIST));
1107 else if (pSceneManager->GetCurrentSceneId() == IDSCN_IMAGE_LIST_EDITOR)
1109 pSceneManager->GoBackward(BackwardSceneTransition(IDSCN_IMAGE_LIST));
1111 else if (pSceneManager->GetCurrentSceneId() == IDSCN_VIDEO_LIST_EDITOR)
1113 pSceneManager->GoBackward(BackwardSceneTransition(IDSCN_VIDEO_LIST));
1115 else if (pSceneManager->GetCurrentSceneId() == IDSCN_ALL_LIST_SELECTION)
1117 if (__pShareContextMenu != null && __pShareContextMenu->GetShowState() == true)
1119 __pShareContextMenu->SetShowState(false);
1123 AllListSelectionPanel* pSelectionPanel = dynamic_cast<AllListSelectionPanel*>
1124 (pSceneManager->GetCurrentScene()->GetPanel());
1125 if (pSelectionPanel != null)
1127 IList* pList = pSelectionPanel->GetItemCheckedIndexListN();
1130 pList = new (std::nothrow) ArrayList(SingleObjectDeleter);
1133 pSceneManager->GoForward(ForwardSceneTransition(IDSCN_ALL_LIST_EDITOR, SCENE_TRANSITION_ANIMATION_TYPE_NONE,
1134 SCENE_HISTORY_OPTION_ADD_HISTORY, SCENE_DESTROY_OPTION_DESTROY), pList);
1140 pSceneManager->GoBackward(BackwardSceneTransition(IDSCN_ALL_LIST));
1143 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
1147 FileListEditorForm::SetFooterButtonsState(const bool enableState)
1149 AppLogDebug("ENTER");
1150 Footer* pFooter = GetFooter();
1151 TryReturnVoid(pFooter != null, "[%s] fail to get the footer.", GetErrorMessage(GetLastResult()));
1153 if (__pPresentationModel->GetAppControlMode() == APPCONTROL_MODE_PICK)
1155 if (enableState == true)
1157 pFooter->SetButtonEnabled(BUTTON_POSITION_LEFT, true);
1158 pFooter->SetItemEnabled(0, true);
1162 pFooter->SetButtonEnabled(BUTTON_POSITION_LEFT, false);
1163 pFooter->SetItemEnabled(0, false);
1168 if (enableState == true)
1170 pFooter->SetItemEnabled(0, true);
1171 pFooter->SetItemEnabled(1, true);
1175 pFooter->SetItemEnabled(0, false);
1176 pFooter->SetItemEnabled(1, false);
1179 pFooter->RequestRedraw(true);
1180 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
1184 FileListEditorForm::OnOrientationChanged(const Tizen::Ui::Control &source, Tizen::Ui::OrientationStatus orientationStatus)
1186 AppLogDebug("ENTER");
1187 SceneManager* pSceneManager = SceneManager::GetInstance();
1188 pSceneManager->GetCurrentScene();
1190 if (pSceneManager->GetCurrentSceneId() == IDSCN_ALL_LIST_EDITOR)
1192 AllListEditorPanel* pEditorPanel = dynamic_cast<AllListEditorPanel*>(pSceneManager->GetCurrentScene()->GetPanel());
1193 if (pEditorPanel != null)
1195 pEditorPanel->ChangeOrientation();
1198 else if (pSceneManager->GetCurrentSceneId() == IDSCN_IMAGE_LIST_EDITOR)
1200 ImageListEditorPanel* pEditorPanel = dynamic_cast<ImageListEditorPanel*>(pSceneManager->GetCurrentScene()->GetPanel());
1201 if (pEditorPanel != null)
1203 pEditorPanel->ChangeOrientation();
1206 else if (pSceneManager->GetCurrentSceneId() == IDSCN_VIDEO_LIST_EDITOR)
1208 VideoListEditorPanel* pEditorPanel = dynamic_cast<VideoListEditorPanel*>(pSceneManager->GetCurrentScene()->GetPanel());
1209 if (pEditorPanel != null)
1211 pEditorPanel->ChangeOrientation();
1214 else if (pSceneManager->GetCurrentSceneId() == IDSCN_ALL_LIST_SELECTION)
1216 AllListSelectionPanel* pEditorPanel = dynamic_cast<AllListSelectionPanel*>(pSceneManager->GetCurrentScene()->GetPanel());
1217 if (pEditorPanel != null)
1219 pEditorPanel->ChangeOrientation();
1223 if (_pProgressAnim != null)
1225 _pProgressAnim->ChangeOrientation(Form::GetBounds());
1226 _pProgressAnim->Invalidate(true);
1229 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
1233 FileListEditorForm::OnKeyReleased(Control& source, const Tizen::Ui::KeyEventInfo& keyEventInfo)
1235 AppLogDebug("ENTER");
1237 if(keyEventInfo.GetKeyCode() == KEY_BACK || keyEventInfo.GetKeyCode() == KEY_ESC)
1239 _overlayMsg = false;
1240 __pDeletePopup->SetShowState(false);
1241 __pDeletePopup->Invalidate(true);
1243 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
1249 FileListEditorForm::MoveToAlbum(const String& destDirectory)
1251 AppLogDebug("ENTER");
1252 result r = E_FAILURE;
1253 String albumName = __pPresentationModel->ConvertToAlbumName(destDirectory);
1254 if (albumName != EMPTY_SPACE)
1256 IList* pDirectoryList = new (std::nothrow) ArrayList(SingleObjectDeleter);
1257 pDirectoryList->Add(new (std::nothrow) String(destDirectory));
1258 __pPresentationModel->SetCurrentAlbumInfo(albumName, *pDirectoryList);
1259 __pPresentationModel->SetCurrentAlbumContentType(CONTENT_TYPE_ALL);
1260 delete pDirectoryList;
1262 SceneManager* pSceneManager = SceneManager::GetInstance();
1263 pSceneManager->GoForward(ForwardSceneTransition(IDSCN_ALL_LIST));
1266 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
1272 FileListEditorForm::SelectAllPressed(void)
1274 SceneManager* pSceneManager = SceneManager::GetInstance();
1275 pSceneManager->GetCurrentScene();
1277 if (pSceneManager->GetCurrentSceneId() == IDSCN_ALL_LIST_EDITOR)
1279 AllListEditorPanel* pEditorPanel = dynamic_cast<AllListEditorPanel*>(pSceneManager->GetCurrentScene()->GetPanel());
1280 if (pEditorPanel != null)
1282 pEditorPanel->OnSelectAllPressed();
1285 else if (pSceneManager->GetCurrentSceneId() == IDSCN_IMAGE_LIST_EDITOR)
1287 ImageListEditorPanel* pEditorPanel = dynamic_cast<ImageListEditorPanel*>(pSceneManager->GetCurrentScene()->GetPanel());
1288 if (pEditorPanel != null)
1290 pEditorPanel->OnSelectAllPressed();
1293 else if (pSceneManager->GetCurrentSceneId() == IDSCN_VIDEO_LIST_EDITOR)
1295 VideoListEditorPanel* pEditorPanel = dynamic_cast<VideoListEditorPanel*>(pSceneManager->GetCurrentScene()->GetPanel());
1296 if (pEditorPanel != null)
1298 pEditorPanel->OnSelectAllPressed();
1301 else if (pSceneManager->GetCurrentSceneId() == IDSCN_ALL_LIST_SELECTION)
1303 AllListSelectionPanel* pEditorPanel = dynamic_cast<AllListSelectionPanel*>(pSceneManager->GetCurrentScene()->GetPanel());
1304 if (pEditorPanel != null)
1306 pEditorPanel->OnSelectAllPressed();
1312 FileListEditorForm::OnSlideSettingPopUpItemSelected(int index)
1314 if (__pPopUp != NULL)
1316 __pPopUp->SetShowState(false);
1319 SceneManager* pSceneManager = SceneManager::GetInstance();
1323 if (pSceneManager->GetCurrentSceneId() == IDSCN_ALL_LIST_EDITOR)
1325 AllListEditorPanel* pEditorPanel = dynamic_cast<AllListEditorPanel*>(pSceneManager->GetCurrentScene()->GetPanel());
1326 if (pEditorPanel != null)
1328 pEditorPanel->OnRequestSlideShow();
1331 else if (pSceneManager->GetCurrentSceneId() == IDSCN_ALL_LIST_SELECTION)
1333 AllListSelectionPanel* pSelectionPanel = dynamic_cast<AllListSelectionPanel*>
1334 (pSceneManager->GetCurrentScene()->GetPanel());
1336 if (pSelectionPanel != null)
1338 pSelectionPanel->OnRequestSlideShow();
1342 else if (index == 1)
1344 SceneManager* pSceneManager = SceneManager::GetInstance();
1345 TryReturnVoid(pSceneManager != null, "[%s] fail to get SceneManager", GetErrorMessage(GetLastResult()));
1347 pSceneManager->GoForward(ForwardSceneTransition(IDSCN_SETTING_MAIN));
1352 FileListEditorForm::OnSceneDeactivated(const SceneId& currentSceneId, const SceneId& nextSceneId)
1354 AppLogDebug("ENTER");
1355 __pPresentationModel->RemoveContentEventListener(this);
1356 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
1360 FileListEditorForm::OnSceneActivatedN(const SceneId& previousSceneId, const SceneId& currentSceneId, IList* pArgs)
1362 AppLogDebug("ENTER");
1363 __pPresentationModel->AddContentEventListener(this);
1364 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
1368 FileListEditorForm::OnFormMenuRequested (Tizen::Ui::Controls::Form &source)
1370 if(__isScanProgress)
1375 SceneManager* pSceneManager = SceneManager::GetInstance();
1376 int checkedCount = 0;
1378 if (pSceneManager->GetCurrentSceneId() == IDSCN_ALL_LIST_EDITOR)
1380 AllListEditorPanel* pEditorPanel = dynamic_cast<AllListEditorPanel*>(pSceneManager->GetCurrentScene()->GetPanel());
1381 if (pEditorPanel != null)
1383 checkedCount = pEditorPanel->GetItemCheckedCount();
1386 else if (pSceneManager->GetCurrentSceneId() == IDSCN_ALL_LIST_SELECTION)
1388 AllListSelectionPanel* pSelectionPanel = dynamic_cast<AllListSelectionPanel*>(pSceneManager->GetCurrentScene()->GetPanel());
1389 if (pSelectionPanel != null)
1391 checkedCount = pSelectionPanel->GetItemCheckedCount();
1395 if (__pShareContextMenu != null && __pShareContextMenu->GetShowState() == true)
1397 __pShareContextMenu->SetShowState(false);
1400 if (checkedCount > 0)
1402 if (__pOptionMenu == null)
1407 __pOptionMenu->RemoveAllItems();
1408 __pOptionMenu->AddItem(ResourceManager::GetString(L"IDS_COM_BODY_MOVE"),
1409 IDA_CONTEXT_MENU_MORE_MOVE);
1410 __pOptionMenu->AddItem(ResourceManager::GetString(L"IDS_COM_BODY_COPY"),
1411 IDA_CONTEXT_MENU_MORE_COPY);
1413 if (checkedCount > 1)
1415 __pOptionMenu->AddItem(ResourceManager::GetString(L"IDS_MEDIABR_OPT_SLIDESHOW"),
1416 IDA_CONTEXT_MENU_MORE_SLIDE_SHOW);
1419 __pOptionMenu->AddItem(ResourceManager::GetString(L"IDS_IV_OPT_ROTATE_LEFT"),IDA_CONTEXT_MENU_ROTATE_LEFT);
1420 __pOptionMenu->AddItem(ResourceManager::GetString(L"IDS_IV_OPT_ROTATE_RIGHT"),IDA_CONTEXT_MENU_ROTATE_RIGHT);
1422 __pOptionMenu->SetShowState(true);
1423 __pOptionMenu->Show();