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 __pFileMove = new (std::nothrow) FileMoveTimer(*pDirectory, pItemIndexList, __pPresentationModel, this);
765 if (__isCopyOperation)
767 __pFileMove->SetCopy();
770 result r = __pFileMove->StartTimer();
775 __isCopyOperation = false;
785 else if (pSceneManager->GetCurrentSceneId() == IDSCN_ALL_LIST_SELECTION)
787 if ((IDA_CONTEXTMENU_EDITOR_MOVE_ALBUM_ARRAY_START <= actionId) &&
788 (actionId <= IDA_CONTEXTMENU_EDITOR_MOVE_CREATE_ALBUM + 1000))
790 if (__pContentDirectoryList == null)
795 if (__pContentDirectoryList->GetCount() > actionId - IDA_CONTEXTMENU_EDITOR_MOVE_ALBUM_ARRAY_START)
797 String* pDirectory = static_cast<String*>
798 (__pContentDirectoryList->GetAt(actionId - IDA_CONTEXTMENU_EDITOR_MOVE_ALBUM_ARRAY_START));
800 AllListSelectionPanel* pSelectionPanel = dynamic_cast<AllListSelectionPanel*>
801 (pSceneManager->GetCurrentScene()->GetPanel());
803 if (pSelectionPanel != null)
806 IList* pItemIndexList = pSelectionPanel->GetItemCheckedIndexListN();
807 __pFileMove = new (std::nothrow) FileMoveTimer(*pDirectory, pItemIndexList, __pPresentationModel, this);
808 if (__isCopyOperation)
810 __pFileMove->SetCopy();
812 result r = __pFileMove->StartTimer();
817 __isCopyOperation = false;
830 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
834 FileListEditorForm::OnFileOpInvalidate(enum FileActionMode actionId)
841 FileListEditorForm::OnScanDirStart()
843 AppLogDebug("ENTER");
844 GetHeader()->SetButtonEnabled(BUTTON_POSITION_RIGHT, false);
845 __isScanProgress = true;
847 AppLogDebug("ENTER");
850 FileListEditorForm::OnScanDirComplete()
852 AppLogDebug("ENTER");
853 GetHeader()->SetButtonEnabled(BUTTON_POSITION_RIGHT, true);
854 __isScanProgress = false;
856 AppLogDebug("ENTER");
861 FileListEditorForm::GetOverlayStatus(void) const
867 FileListEditorForm::OnFileOpComplete(enum FileActionMode actionId, enum FileActionCompleteRes res)
869 AppLogDebug("ENTER");
871 __pPresentationModel->SetUpdateProgressStatus(false);
872 if (res != COMPLETE_SUCCESS)
874 MessageBox messageBox;
875 messageBox.Construct(L"", ResourceManager::GetString(L"IDS_COM_BODY_OPERATION_FAILED"), MSGBOX_STYLE_OK, 3000);
878 messageBox.ShowAndWait(modalResult);
880 SceneManager* pSceneManager = SceneManager::GetInstance();
881 AppAssert(pSceneManager);
882 pSceneManager->GoForward(ForwardSceneTransition(IDSCN_ALL_LIST));
888 FileListEditorForm::OnContentUpdated()
890 AppLogDebug("ENTER");
892 SceneManager* pSceneManager = SceneManager::GetInstance();
894 if(__pDeletePopup != null)
896 if(__pDeletePopup->IsVisible() == true)
898 __pDeletePopup->Destroy();
899 __pDeletePopup = null;
905 if (pSceneManager->GetCurrentSceneId() == IDSCN_ALL_LIST_EDITOR)
907 AllListEditorPanel* pEditorPanel = dynamic_cast<AllListEditorPanel*>(pSceneManager->GetCurrentScene()->GetPanel());
908 if (pEditorPanel != null)
910 pEditorPanel->CancelUpdateProgress();
913 else if (pSceneManager->GetCurrentSceneId() == IDSCN_ALL_LIST_SELECTION)
915 AllListSelectionPanel* pSelectionPanel = dynamic_cast<AllListSelectionPanel*>(pSceneManager->GetCurrentScene()->GetPanel());
916 if (pSelectionPanel != null)
918 pSelectionPanel->CancelUpdateProgress();
922 if (__pPresentationModel->GetAppControlMode() == APPCONTROL_MODE_PICK
923 && pSceneManager->GetCurrentSceneId() == IDSCN_IMAGE_LIST_EDITOR)
925 pSceneManager->GoForward(ForwardSceneTransition(IDSCN_ALBUM_LIST, SCENE_TRANSITION_ANIMATION_TYPE_NONE,
926 SCENE_HISTORY_OPTION_NO_HISTORY, SCENE_DESTROY_OPTION_DESTROY));
929 else if (_overlayMsg == false)
931 pSceneManager->GoForward(ForwardSceneTransition(IDSCN_ALL_LIST, SCENE_TRANSITION_ANIMATION_TYPE_NONE,
932 SCENE_HISTORY_OPTION_NO_HISTORY, SCENE_DESTROY_OPTION_DESTROY));
935 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
939 FileListEditorForm::SetUpPopup(void)
941 AppLogDebug("ENTER");
942 result r = E_SUCCESS;
944 if (__pDeletePopup != null)
946 delete __pDeletePopup;
947 __pDeletePopup = null;
950 __pDeletePopup = new (std::nothrow) Popup();
951 __pDeletePopup->Construct(false, Dimension(W_DELETE_POPUP, H_DELETE_POPUP));
952 __pDeletePopup->SetPropagatedKeyEventListener(this);
954 Rectangle popupClientBounds = __pDeletePopup->GetClientAreaBounds();
956 Label* pLabelText = new (std::nothrow) Label();
957 pLabelText->Construct(Rectangle(0, Y_DELETE_LABEL, popupClientBounds.width, H_DELETE_LABEL),
958 ResourceManager::GetString(L"IDS_COM_POP_DELETE_Q"));
959 pLabelText->SetTextHorizontalAlignment(ALIGNMENT_LEFT);
960 pLabelText->SetTextConfig(34,LABEL_TEXT_STYLE_BOLD);
961 __pDeletePopup->AddControl(pLabelText);
963 Button* pDeleteButton = new (std::nothrow) Button();
964 pDeleteButton->Construct(Rectangle(popupClientBounds.width / 2 + GAP_W_POPUP_ITEM, Y_DELETE_BUTTON, W_DELETE_BUTTON, H_DELETE_BUTTON),
965 ResourceManager::GetString(L"IDS_COM_BODY_DELETE"));
966 pDeleteButton->SetColor(BUTTON_STATUS_NORMAL, COLOR_DELETE_BUTTON_NORMAL);
967 pDeleteButton->SetColor(BUTTON_STATUS_PRESSED, COLOR_DELETE_BUTTON_PRESSED);
968 pDeleteButton->SetTextColor(COLOR_DELETE_BUTTON_TEXT);
969 pDeleteButton->SetActionId(IDA_DELETE_POPUP_DEL);
970 pDeleteButton->AddActionEventListener(*this);
971 __pDeletePopup->AddControl(pDeleteButton);
973 Button* pButtonCancel = new (std::nothrow) Button();
974 pButtonCancel->Construct(Rectangle(16, Y_DELETE_BUTTON, W_DELETE_BUTTON, H_DELETE_BUTTON),
975 ResourceManager::GetString(L"IDS_COM_POP_CANCEL"));
976 pButtonCancel->SetActionId(IDA_DELETE_POPUP_CANCEL);
977 pButtonCancel->AddActionEventListener(*this);
978 __pDeletePopup->AddControl(pButtonCancel);
979 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
985 FileListEditorForm::SetTitleText(const String& titleText)
987 AppLogDebug("ENTER");
988 Header* pHeader = GetHeader();
989 TryReturnVoid(pHeader != null, "[%s] fail to get the header.", GetErrorMessage(GetLastResult()));
990 pHeader->SetTitleText(titleText);
991 pHeader->Invalidate(true);
992 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
996 FileListEditorForm::RefreshFolderList(void)
998 AppLogDebug("ENTER");
999 ContentDirectory contentDirectory;
1000 IListT<ContentType>* pContentTypeList = new (std::nothrow) ArrayListT<ContentType>();
1001 pContentTypeList->Add(CONTENT_TYPE_IMAGE);
1002 pContentTypeList->Add(CONTENT_TYPE_VIDEO);
1003 result r = contentDirectory.Construct(*pContentTypeList);
1006 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
1009 delete pContentTypeList;
1011 if (__pContentDirectoryList != null)
1013 __pContentDirectoryList->RemoveAll(true);
1014 delete __pContentDirectoryList;
1015 __pContentDirectoryList = null;
1017 __pContentDirectoryList = contentDirectory.GetContentDirectoryPathListN(SORT_ORDER_NONE);
1019 if (__pContentDirectoryNameList != NULL)
1021 __pContentDirectoryNameList->RemoveAll(true);
1022 delete __pContentDirectoryNameList;
1023 __pContentDirectoryNameList = null;
1026 __pContentDirectoryNameList = new (std::nothrow) ArrayList(SingleObjectDeleter);
1027 String* pDirPath = null;
1028 String* pDirName = null;
1029 String mediaPath = RESERVED_MEDIA_PATH;
1030 int length = mediaPath.GetLength();
1031 mediaPath.Remove(length-1,1);
1033 int loopCount = __pContentDirectoryList->GetCount();
1034 for (int i = 0; i < loopCount; ++i)
1036 pDirPath = static_cast<String*>(__pContentDirectoryList->GetAt(i));
1037 pDirName = new (std::nothrow) String(GetDirecotyNameFromFullPath(*pDirPath));
1039 if (*pDirPath == mediaPath)
1041 *pDirName = ResourceManager::GetString(L"IDS_MEDIABR_POP_NO_NAME");
1042 __pContentDirectoryNameList->Add(pDirName);
1046 __pContentDirectoryNameList->Add(pDirName);
1050 __pOptionMenu->RemoveAllItems();
1051 __pOptionMenu->AddItem(ResourceManager::GetString(L"IDS_MEDIABR_OPT_CREATE_ALBUM"),
1052 IDA_CONTEXTMENU_EDITOR_MOVE_CREATE_ALBUM);
1054 loopCount = __pContentDirectoryNameList->GetCount();
1056 String dirAllAlbums = L"All albums";
1058 for (int i = 0; i < loopCount; ++i)
1060 pDirName = static_cast<String*>(__pContentDirectoryNameList->GetAt(i));
1062 if (*pDirName != __pPresentationModel->GetCurrentAlbumName() || *pDirName == dirAllAlbums)
1064 __pOptionMenu->AddItem(*(new (std::nothrow) String(*pDirName)),
1065 IDA_CONTEXTMENU_EDITOR_MOVE_ALBUM_ARRAY_START + i);
1070 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
1074 FileListEditorForm::OnFormBackRequested(Form& source)
1076 AppLogDebug("ENTER");
1078 if(__isScanProgress)
1083 SceneManager* pSceneManager = SceneManager::GetInstance();
1084 TryReturnVoid(pSceneManager != null, "[%s] fail to get SceneManager.", GetErrorMessage(GetLastResult()));
1086 if (__pPresentationModel->GetAppControlMode() == APPCONTROL_MODE_PICK)
1088 if (pSceneManager->GetCurrentSceneId() == IDSCN_IMAGE_LIST_EDITOR)
1090 pSceneManager->GoBackward(BackwardSceneTransition(IDSCN_ALBUM_LIST));
1092 else if (pSceneManager->GetCurrentSceneId() == IDSCN_VIDEO_LIST_EDITOR)
1094 pSceneManager->GoBackward(BackwardSceneTransition(IDSCN_ALBUM_LIST));
1099 if (pSceneManager->GetCurrentSceneId() == IDSCN_ALL_LIST_EDITOR)
1101 pSceneManager->GoBackward(BackwardSceneTransition(IDSCN_ALL_LIST));
1103 else if (pSceneManager->GetCurrentSceneId() == IDSCN_IMAGE_LIST_EDITOR)
1105 pSceneManager->GoBackward(BackwardSceneTransition(IDSCN_IMAGE_LIST));
1107 else if (pSceneManager->GetCurrentSceneId() == IDSCN_VIDEO_LIST_EDITOR)
1109 pSceneManager->GoBackward(BackwardSceneTransition(IDSCN_VIDEO_LIST));
1111 else if (pSceneManager->GetCurrentSceneId() == IDSCN_ALL_LIST_SELECTION)
1113 if (__pShareContextMenu != null && __pShareContextMenu->GetShowState() == true)
1115 __pShareContextMenu->SetShowState(false);
1119 AllListSelectionPanel* pSelectionPanel = dynamic_cast<AllListSelectionPanel*>
1120 (pSceneManager->GetCurrentScene()->GetPanel());
1121 if (pSelectionPanel != null)
1123 IList* pList = pSelectionPanel->GetItemCheckedIndexListN();
1126 pList = new (std::nothrow) ArrayList(SingleObjectDeleter);
1129 pSceneManager->GoForward(ForwardSceneTransition(IDSCN_ALL_LIST_EDITOR, SCENE_TRANSITION_ANIMATION_TYPE_NONE,
1130 SCENE_HISTORY_OPTION_ADD_HISTORY, SCENE_DESTROY_OPTION_DESTROY), pList);
1136 pSceneManager->GoBackward(BackwardSceneTransition(IDSCN_ALL_LIST));
1139 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
1143 FileListEditorForm::SetFooterButtonsState(const bool enableState)
1145 AppLogDebug("ENTER");
1146 Footer* pFooter = GetFooter();
1147 TryReturnVoid(pFooter != null, "[%s] fail to get the footer.", GetErrorMessage(GetLastResult()));
1149 if (__pPresentationModel->GetAppControlMode() == APPCONTROL_MODE_PICK)
1151 if (enableState == true)
1153 pFooter->SetButtonEnabled(BUTTON_POSITION_LEFT, true);
1154 pFooter->SetItemEnabled(0, true);
1158 pFooter->SetButtonEnabled(BUTTON_POSITION_LEFT, false);
1159 pFooter->SetItemEnabled(0, false);
1164 if (enableState == true)
1166 pFooter->SetItemEnabled(0, true);
1167 pFooter->SetItemEnabled(1, true);
1171 pFooter->SetItemEnabled(0, false);
1172 pFooter->SetItemEnabled(1, false);
1175 pFooter->RequestRedraw(true);
1176 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
1180 FileListEditorForm::OnOrientationChanged(const Tizen::Ui::Control &source, Tizen::Ui::OrientationStatus orientationStatus)
1182 AppLogDebug("ENTER");
1183 SceneManager* pSceneManager = SceneManager::GetInstance();
1184 pSceneManager->GetCurrentScene();
1186 if (pSceneManager->GetCurrentSceneId() == IDSCN_ALL_LIST_EDITOR)
1188 AllListEditorPanel* pEditorPanel = dynamic_cast<AllListEditorPanel*>(pSceneManager->GetCurrentScene()->GetPanel());
1189 if (pEditorPanel != null)
1191 pEditorPanel->ChangeOrientation();
1194 else if (pSceneManager->GetCurrentSceneId() == IDSCN_IMAGE_LIST_EDITOR)
1196 ImageListEditorPanel* pEditorPanel = dynamic_cast<ImageListEditorPanel*>(pSceneManager->GetCurrentScene()->GetPanel());
1197 if (pEditorPanel != null)
1199 pEditorPanel->ChangeOrientation();
1202 else if (pSceneManager->GetCurrentSceneId() == IDSCN_VIDEO_LIST_EDITOR)
1204 VideoListEditorPanel* pEditorPanel = dynamic_cast<VideoListEditorPanel*>(pSceneManager->GetCurrentScene()->GetPanel());
1205 if (pEditorPanel != null)
1207 pEditorPanel->ChangeOrientation();
1210 else if (pSceneManager->GetCurrentSceneId() == IDSCN_ALL_LIST_SELECTION)
1212 AllListSelectionPanel* pEditorPanel = dynamic_cast<AllListSelectionPanel*>(pSceneManager->GetCurrentScene()->GetPanel());
1213 if (pEditorPanel != null)
1215 pEditorPanel->ChangeOrientation();
1219 if (_pProgressAnim != null)
1221 _pProgressAnim->ChangeOrientation(Form::GetBounds());
1222 _pProgressAnim->Invalidate(true);
1225 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
1229 FileListEditorForm::OnKeyReleased(Control& source, const Tizen::Ui::KeyEventInfo& keyEventInfo)
1231 AppLogDebug("ENTER");
1233 if(keyEventInfo.GetKeyCode() == KEY_BACK || keyEventInfo.GetKeyCode() == KEY_ESC)
1235 _overlayMsg = false;
1236 __pDeletePopup->SetShowState(false);
1237 __pDeletePopup->Invalidate(true);
1239 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
1245 FileListEditorForm::MoveToAlbum(const String& destDirectory)
1247 AppLogDebug("ENTER");
1248 result r = E_FAILURE;
1249 String albumName = __pPresentationModel->ConvertToAlbumName(destDirectory);
1250 if (albumName != EMPTY_SPACE)
1252 IList* pDirectoryList = new (std::nothrow) ArrayList(SingleObjectDeleter);
1253 pDirectoryList->Add(new (std::nothrow) String(destDirectory));
1254 __pPresentationModel->SetCurrentAlbumInfo(albumName, *pDirectoryList);
1255 __pPresentationModel->SetCurrentAlbumContentType(CONTENT_TYPE_ALL);
1256 delete pDirectoryList;
1258 SceneManager* pSceneManager = SceneManager::GetInstance();
1259 pSceneManager->GoForward(ForwardSceneTransition(IDSCN_ALL_LIST));
1262 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
1268 FileListEditorForm::SelectAllPressed(void)
1270 SceneManager* pSceneManager = SceneManager::GetInstance();
1271 pSceneManager->GetCurrentScene();
1273 if (pSceneManager->GetCurrentSceneId() == IDSCN_ALL_LIST_EDITOR)
1275 AllListEditorPanel* pEditorPanel = dynamic_cast<AllListEditorPanel*>(pSceneManager->GetCurrentScene()->GetPanel());
1276 if (pEditorPanel != null)
1278 pEditorPanel->OnSelectAllPressed();
1281 else if (pSceneManager->GetCurrentSceneId() == IDSCN_IMAGE_LIST_EDITOR)
1283 ImageListEditorPanel* pEditorPanel = dynamic_cast<ImageListEditorPanel*>(pSceneManager->GetCurrentScene()->GetPanel());
1284 if (pEditorPanel != null)
1286 pEditorPanel->OnSelectAllPressed();
1289 else if (pSceneManager->GetCurrentSceneId() == IDSCN_VIDEO_LIST_EDITOR)
1291 VideoListEditorPanel* pEditorPanel = dynamic_cast<VideoListEditorPanel*>(pSceneManager->GetCurrentScene()->GetPanel());
1292 if (pEditorPanel != null)
1294 pEditorPanel->OnSelectAllPressed();
1297 else if (pSceneManager->GetCurrentSceneId() == IDSCN_ALL_LIST_SELECTION)
1299 AllListSelectionPanel* pEditorPanel = dynamic_cast<AllListSelectionPanel*>(pSceneManager->GetCurrentScene()->GetPanel());
1300 if (pEditorPanel != null)
1302 pEditorPanel->OnSelectAllPressed();
1308 FileListEditorForm::OnSlideSettingPopUpItemSelected(int index)
1310 if (__pPopUp != NULL)
1312 __pPopUp->SetShowState(false);
1315 SceneManager* pSceneManager = SceneManager::GetInstance();
1319 if (pSceneManager->GetCurrentSceneId() == IDSCN_ALL_LIST_EDITOR)
1321 AllListEditorPanel* pEditorPanel = dynamic_cast<AllListEditorPanel*>(pSceneManager->GetCurrentScene()->GetPanel());
1322 if (pEditorPanel != null)
1324 pEditorPanel->OnRequestSlideShow();
1327 else if (pSceneManager->GetCurrentSceneId() == IDSCN_ALL_LIST_SELECTION)
1329 AllListSelectionPanel* pSelectionPanel = dynamic_cast<AllListSelectionPanel*>
1330 (pSceneManager->GetCurrentScene()->GetPanel());
1332 if (pSelectionPanel != null)
1334 pSelectionPanel->OnRequestSlideShow();
1338 else if (index == 1)
1340 SceneManager* pSceneManager = SceneManager::GetInstance();
1341 TryReturnVoid(pSceneManager != null, "[%s] fail to get SceneManager", GetErrorMessage(GetLastResult()));
1343 pSceneManager->GoForward(ForwardSceneTransition(IDSCN_SETTING_MAIN));
1348 FileListEditorForm::OnSceneDeactivated(const SceneId& currentSceneId, const SceneId& nextSceneId)
1350 AppLogDebug("ENTER");
1351 __pPresentationModel->RemoveContentEventListener(this);
1352 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
1356 FileListEditorForm::OnSceneActivatedN(const SceneId& previousSceneId, const SceneId& currentSceneId, IList* pArgs)
1358 AppLogDebug("ENTER");
1359 __pPresentationModel->AddContentEventListener(this);
1360 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
1364 FileListEditorForm::OnFormMenuRequested (Tizen::Ui::Controls::Form &source)
1366 if(__isScanProgress)
1371 SceneManager* pSceneManager = SceneManager::GetInstance();
1372 int checkedCount = 0;
1374 if (pSceneManager->GetCurrentSceneId() == IDSCN_ALL_LIST_EDITOR)
1376 AllListEditorPanel* pEditorPanel = dynamic_cast<AllListEditorPanel*>(pSceneManager->GetCurrentScene()->GetPanel());
1377 if (pEditorPanel != null)
1379 checkedCount = pEditorPanel->GetItemCheckedCount();
1382 else if (pSceneManager->GetCurrentSceneId() == IDSCN_ALL_LIST_SELECTION)
1384 AllListSelectionPanel* pSelectionPanel = dynamic_cast<AllListSelectionPanel*>(pSceneManager->GetCurrentScene()->GetPanel());
1385 if (pSelectionPanel != null)
1387 checkedCount = pSelectionPanel->GetItemCheckedCount();
1391 if (__pShareContextMenu != null && __pShareContextMenu->GetShowState() == true)
1393 __pShareContextMenu->SetShowState(false);
1396 if (checkedCount > 0)
1398 if (__pOptionMenu == null)
1403 __pOptionMenu->RemoveAllItems();
1404 __pOptionMenu->AddItem(ResourceManager::GetString(L"IDS_COM_BODY_MOVE"),
1405 IDA_CONTEXT_MENU_MORE_MOVE);
1406 __pOptionMenu->AddItem(ResourceManager::GetString(L"IDS_COM_BODY_COPY"),
1407 IDA_CONTEXT_MENU_MORE_COPY);
1409 if (checkedCount > 1)
1411 __pOptionMenu->AddItem(ResourceManager::GetString(L"IDS_MEDIABR_OPT_SLIDESHOW"),
1412 IDA_CONTEXT_MENU_MORE_SLIDE_SHOW);
1415 __pOptionMenu->AddItem(ResourceManager::GetString(L"IDS_IV_OPT_ROTATE_LEFT"),IDA_CONTEXT_MENU_ROTATE_LEFT);
1416 __pOptionMenu->AddItem(ResourceManager::GetString(L"IDS_IV_OPT_ROTATE_RIGHT"),IDA_CONTEXT_MENU_ROTATE_RIGHT);
1418 __pOptionMenu->SetShowState(true);
1419 __pOptionMenu->Show();