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 "GlResourceManager.h"
29 #include "GlSlideSettingListener.h"
30 #include "GlSlideShowPopUp.h"
32 #include "GlVideoListEditorPanel.h"
33 #include "GlFileMoveTimer.h"
35 using namespace Tizen::App;
36 using namespace Tizen::Base;
37 using namespace Tizen::Base::Collection;
38 using namespace Tizen::Content;
39 using namespace Tizen::Graphics;
40 using namespace Tizen::System;
41 using namespace Tizen::Ui;
42 using namespace Tizen::Ui::Controls;
43 using namespace Tizen::Ui::Scenes;
44 using namespace Tizen::Base::Utility;
46 static const int GAP_W_POPUP_ITEM = 5;
47 static const int W_DELETE_POPUP = 600;
48 static const int H_DELETE_POPUP = 300;
49 static const int H_DELETE_LABEL = 180;
50 static const int Y_DELETE_BUTTON = 180;
51 static const int H_DELETE_BUTTON = 80;
52 static const int H_TOAST_LABEL = 48;
54 static const unsigned int COLOR_DELETE_BUTTON_NORMAL = Color32<208, 82, 82>::Value;
55 static const unsigned int COLOR_DELETE_BUTTON_PRESSED = Color32<194, 71, 71>::Value;
56 static const unsigned int COLOR_DELETE_BUTTON_TEXT = Color32<248, 246, 239>::Value;
58 static const String RESERVED_MEDIA_PATH = Environment::GetMediaPath();
60 FileListEditorForm::FileListEditorForm(void)
61 : __pContextMenuMore(null)
62 , __pContextMenuShare(null)
63 , __pContextEditorMenuMove(null)
64 , __pContextSelectionMenuMove(null)
66 , __pDeletePopup(null)
67 , __morePosition(Point(0, 0))
68 , __pContentDirectoryList(null)
69 , __pContentDirectoryNameList(null)
72 , __isCopyOperation(false)
73 , __isHWBackButtonExist(false)
74 , __pPresentationModel(null)
78 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
81 FileListEditorForm::~FileListEditorForm(void)
84 if (__pContentDirectoryList != null)
86 delete __pContentDirectoryList;
89 if (__pContentDirectoryNameList != null)
91 delete __pContentDirectoryNameList;
94 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
98 FileListEditorForm::Initialize(void)
100 AppLogDebug("ENTER");
101 result r = Construct(FORM_STYLE_NORMAL | FORM_STYLE_HEADER | FORM_STYLE_FOOTER);
102 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
108 FileListEditorForm::OnInitializing(void)
110 AppLogDebug("ENTER");
111 Header* pHeader = GetHeader();
112 TryReturn(pHeader != null, E_FAILURE, "[%s] fail to get the header.", GetErrorMessage(GetLastResult()));
114 __pPopUp = new (std::nothrow) SlideShowPopUp();
116 if (__pPopUp != null)
118 __pPopUp->Initialize();
119 __pPopUp->SetEventListner(this);
120 AddControl(__pPopUp);
123 GalleryApp* pApp = static_cast<GalleryApp*>(GalleryApp::GetInstance());
124 __isHWBackButtonExist = pApp->IsHwKeySupported();
126 SetFormMenuEventListener(this);
127 __pPresentationModel = FileListPresentationModel::GetInstance();
128 __pPresentationModel->ClearThumbnailRequests();
130 pHeader->SetStyle(HEADER_STYLE_TITLE);
131 pHeader->SetTitleText(ResourceManager::GetString(L"IDS_COM_BODY_EDIT"));
133 if ((__pPresentationModel->GetAppControlMode() == APPCONTROL_MODE_PICK
134 && __pPresentationModel->GetAppControlSelectionMode() == APPCONTROL_SELECTION_MODE_SINGLE) == false)
136 Bitmap* pNormalBitmap = ResourceManager::GetBitmapN(IDB_ICON_SELECT_ALL);
137 Bitmap* pPressBitmap = ResourceManager::GetBitmapN(IDB_ICON_SELECT_ALL_PRESS);
138 ButtonItem selectAll;
139 selectAll.Construct(BUTTON_ITEM_STYLE_ICON, IDA_FILE_LIST_SELECT_ALL);
140 selectAll.SetIcon(BUTTON_ITEM_STATUS_NORMAL, pNormalBitmap);
141 selectAll.SetIcon(BUTTON_ITEM_STATUS_PRESSED, pPressBitmap);
142 pHeader->SetButton(BUTTON_POSITION_LEFT, selectAll);
143 delete pNormalBitmap;
147 pHeader->AddActionEventListener(*this);
150 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
156 FileListEditorForm::InitializeFooter(void)
158 AppLogDebug("ENTER");
159 Footer* pFooter = GetFooter();
160 TryReturn(pFooter != null, E_FAILURE, "[%s] fail to get the footer.", GetErrorMessage(GetLastResult()));
161 pFooter->RemoveAllItems();
163 result r = E_SUCCESS;
165 if (__pPresentationModel->GetAppControlMode() == APPCONTROL_MODE_PICK)
167 if (__pPresentationModel->GetAppControlSelectionMode() == APPCONTROL_SELECTION_MODE_MULTIPLE)
169 pFooter->SetStyle(FOOTER_STYLE_BUTTON_TEXT);
171 FooterItem footerConfirm;
172 footerConfirm.Construct(IDA_FOOTER_CONFIRM);
173 footerConfirm.SetText(ResourceManager::GetString(L"IDS_COM_SK_DONE"));
174 pFooter->AddItem(footerConfirm);
175 pFooter->SetItemEnabled(0, false);
179 pFooter->SetStyle(FOOTER_STYLE_SEGMENTED_TEXT);
181 pFooter->SetBackButton();
182 SetFormBackEventListener(this);
186 pFooter->SetStyle(FOOTER_STYLE_BUTTON_ICON_TEXT);
188 if (__isHWBackButtonExist == false)
190 ButtonItem footerMore;
191 footerMore.Construct(BUTTON_ITEM_STYLE_ICON, IDA_FOOTER_MORE);
192 Bitmap* pBitmapMore = ResourceManager::GetBitmapN(IDB_CONTROLBAR_MORE);
193 Bitmap* pBitmapMoreDim = ResourceManager::GetBitmapN(IDB_CONTROLBAR_MORE_DISABLED);
194 Bitmap* pBitmapMorePressed = ResourceManager::GetBitmapN(IDB_CONTROLBAR_MORE_PRESSED);
196 if (pBitmapMore != null && pBitmapMoreDim != NULL && pBitmapMorePressed != null)
198 footerMore.SetIcon(BUTTON_ITEM_STATUS_NORMAL, pBitmapMore);
199 footerMore.SetIcon(BUTTON_ITEM_STATUS_DISABLED, pBitmapMoreDim);
200 footerMore.SetIcon(BUTTON_ITEM_STATUS_PRESSED, pBitmapMorePressed);
202 pFooter->SetButton(BUTTON_POSITION_LEFT,footerMore);
205 delete pBitmapMoreDim;
206 delete pBitmapMorePressed;
209 FooterItem footerShare;
210 r = footerShare.Construct(IDA_FOOTER_SHARE);
211 TryReturn(r == E_SUCCESS, r, "[%s] Unable to construct footer item", GetErrorMessage(r));
212 Bitmap* pBitmapShare = ResourceManager::GetBitmapN(IDB_CONTROLBAR_SHARE);
213 Bitmap* pBitmapShareDim = ResourceManager::GetBitmapN(IDB_CONTROLBAR_SHARE_DIM);
215 if (pBitmapShare != null && pBitmapShareDim != null)
217 footerShare.SetIcon(FOOTER_ITEM_STATUS_NORMAL, pBitmapShare);
218 footerShare.SetIcon(FOOTER_ITEM_STATUS_DISABLED, pBitmapShareDim);
221 r = pFooter->AddItem(footerShare);
223 delete pBitmapShareDim;
224 TryReturn(r == E_SUCCESS, r, "[%s] Unable to add item", GetErrorMessage(r));
226 FooterItem footerDelete;
227 r = footerDelete.Construct(IDA_FOOTER_DELETE);
228 TryReturn(r == E_SUCCESS, r, "[%s] Unable to construct footer item", GetErrorMessage(r));
229 Bitmap* pBitmapDelete = ResourceManager::GetBitmapN(IDB_CONTROLBAR_DELETE);
230 Bitmap* pBitmapDeleteDim = ResourceManager::GetBitmapN(IDB_CONTROLBAR_DELETE_DIM);
232 if (pBitmapDelete != null && pBitmapDeleteDim != null)
234 footerDelete.SetIcon(FOOTER_ITEM_STATUS_NORMAL, pBitmapDelete);
235 footerDelete.SetIcon(FOOTER_ITEM_STATUS_DISABLED, pBitmapDeleteDim);
238 r = pFooter->AddItem(footerDelete);
239 delete pBitmapDelete;
240 delete pBitmapDeleteDim;
241 TryReturn(r == E_SUCCESS, r, "[%s] Unable to add item", GetErrorMessage(r));
243 pFooter->SetBackButton();
244 SetFormBackEventListener(this);
246 SceneManager* pSceneManager = SceneManager::GetInstance();
247 int checkedCount = 0;
249 if (pSceneManager->GetCurrentSceneId() == IDSCN_ALL_LIST_EDITOR)
251 AllListEditorPanel* pEditorPanel = dynamic_cast<AllListEditorPanel*>(pSceneManager->GetCurrentScene()->GetPanel());
252 if (pEditorPanel != null)
254 checkedCount = pEditorPanel->GetItemCheckedCount();
257 else if (pSceneManager->GetCurrentSceneId() == IDSCN_ALL_LIST_SELECTION)
259 AllListSelectionPanel* pSelectionPanel = dynamic_cast<AllListSelectionPanel*>(pSceneManager->GetCurrentScene()->GetPanel());
260 if (pSelectionPanel != null)
262 checkedCount = pSelectionPanel->GetItemCheckedCount();
266 AppLogDebug("GetItemCheckedCount(%d)", checkedCount);
268 if (__isHWBackButtonExist == false)
270 if (__pContextMenuMore != null)
272 delete __pContextMenuMore;
273 __pContextMenuMore = null;
276 __pContextMenuMore = new (std::nothrow) ContextMenu();
277 __pContextMenuMore->Construct(Point(0, 0), CONTEXT_MENU_STYLE_LIST);
279 __pContextMenuMore->AddItem(ResourceManager::GetString(L"IDS_COM_BODY_MOVE"),
280 IDA_CONTEXT_MENU_MORE_MOVE);
281 __pContextMenuMore->AddItem(ResourceManager::GetString(L"IDS_COM_BODY_COPY"),
282 IDA_CONTEXT_MENU_MORE_COPY);
284 if (checkedCount > 1)
286 __pContextMenuMore->AddItem(ResourceManager::GetString(L"IDS_MEDIABR_OPT_SLIDESHOW"),
287 IDA_CONTEXT_MENU_MORE_SLIDE_SHOW);
290 __pContextMenuMore->AddItem(ResourceManager::GetString(L"IDS_IV_OPT_ROTATE_LEFT"),IDA_CONTEXT_MENU_ROTATE_LEFT);
291 __pContextMenuMore->AddItem(ResourceManager::GetString(L"IDS_IV_OPT_ROTATE_RIGHT"),IDA_CONTEXT_MENU_ROTATE_RIGHT);
293 __pContextMenuMore->SetShowState(false);
294 __pContextMenuMore->AddActionEventListener(*this);
296 __pContextEditorMenuMove = new (std::nothrow) ContextMenu();
297 __pContextEditorMenuMove->Construct(Point(0, 0), CONTEXT_MENU_STYLE_LIST);
298 __pContextEditorMenuMove->AddActionEventListener(*this);
300 __pContextSelectionMenuMove = new (std::nothrow) ContextMenu();
301 __pContextSelectionMenuMove->Construct(Point(0, 0), CONTEXT_MENU_STYLE_LIST);
302 __pContextSelectionMenuMove->AddActionEventListener(*this);
308 if (__pOptionMenu != null)
310 delete __pOptionMenu;
311 __pOptionMenu = null;
314 __pOptionMenu = new (std::nothrow) OptionMenu();
315 __pOptionMenu->Construct();
316 __pOptionMenu->AddItem(ResourceManager::GetString(L"IDS_COM_BODY_MOVE"),
317 IDA_CONTEXT_MENU_MORE_MOVE);
318 __pOptionMenu->AddItem(ResourceManager::GetString(L"IDS_COM_BODY_COPY"),
319 IDA_CONTEXT_MENU_MORE_COPY);
321 if (checkedCount > 1)
323 __pOptionMenu->AddItem(ResourceManager::GetString(L"IDS_MEDIABR_OPT_SLIDESHOW"),
324 IDA_CONTEXT_MENU_MORE_SLIDE_SHOW);
327 __pOptionMenu->AddItem(ResourceManager::GetString(L"IDS_IV_OPT_ROTATE_LEFT"),IDA_CONTEXT_MENU_ROTATE_LEFT);
328 __pOptionMenu->AddItem(ResourceManager::GetString(L"IDS_IV_OPT_ROTATE_RIGHT"),IDA_CONTEXT_MENU_ROTATE_RIGHT);
330 __pOptionMenu->AddActionEventListener(*this);
334 __pContextMenuShare = new (std::nothrow) ContextMenu();
335 __pContextMenuShare->Construct(Point(0, 0), CONTEXT_MENU_STYLE_LIST);
336 __pContextMenuShare->AddItem(ResourceManager::GetString(L"IDS_COM_BODY_MESSAGE"),
337 IDA_CONTEXT_MENU_SHARE_MESSAGE);
338 __pContextMenuShare->AddItem(ResourceManager::GetString(L"IDS_COM_BODY_EMAIL"),
339 IDA_CONTEXT_MENU_SHARE_EMAIL);
340 __pContextMenuShare->SetShowState(false);
341 __pContextMenuShare->AddActionEventListener(*this);
345 if (__pContentDirectoryNameList != null)
347 delete __pContentDirectoryNameList;
348 __pContentDirectoryNameList = null;
354 pFooter->AddActionEventListener(*this);
355 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
361 FileListEditorForm::GetDirecotyNameFromFullPath(const String& fullPath)const
363 AppLogDebug("ENTER");
364 if (fullPath == null)
366 AppLogDebug("EXIT 1(%s)", GetErrorMessage(GetLastResult()));
370 String delim(DIRECTORY_SEPARATOR);
371 StringTokenizer st(fullPath,delim);
373 while (st.HasMoreTokens())
375 st.GetNextToken(token);
377 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
383 FileListEditorForm::OnTerminating(void)
385 AppLogDebug("ENTER");
386 __pPresentationModel->RemoveContentEventListener(this);
387 if (__pContextMenuMore != null)
389 __pContextMenuMore->RemoveActionEventListener(*this);
390 delete __pContextMenuMore;
391 __pContextMenuMore = null;
394 if (__pContextMenuShare != null)
396 __pContextMenuShare->RemoveActionEventListener(*this);
397 delete __pContextMenuShare;
398 __pContextMenuShare = null;
401 if (__pContextEditorMenuMove != null)
403 __pContextEditorMenuMove->RemoveActionEventListener(*this);
404 delete __pContextEditorMenuMove;
405 __pContextEditorMenuMove = null;
408 if (__pContextSelectionMenuMove != null)
410 __pContextSelectionMenuMove->RemoveActionEventListener(*this);
411 delete __pContextSelectionMenuMove;
412 __pContextSelectionMenuMove = null;
415 if (__pDeletePopup != null)
417 delete __pDeletePopup;
418 __pDeletePopup = null;
421 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
427 FileListEditorForm::OnActionPerformed(const Control& source, int actionId)
429 AppLogDebug("ENTER(actionId=%d)", actionId);
430 SceneManager* pSceneManager = SceneManager::GetInstance();
431 TryReturnVoid(pSceneManager != null, "[%s] fail to get SceneManager.", GetErrorMessage(GetLastResult()));
435 case IDA_FILE_LIST_SELECT_ALL:
439 case IDA_FOOTER_MORE:
443 if (__pContextMenuMore->GetShowState() == false)
445 Rectangle rect = source.GetBounds();
446 __morePosition = Point(rect.width / 8, rect.y);
447 if (pSceneManager->GetCurrentSceneId() == IDSCN_ALL_LIST_SELECTION)
449 __pContextMenuMore->SetAnchorPosition(Point(rect.width / 10, rect.y));
453 __pContextMenuMore->SetAnchorPosition(Point(rect.width / 10, rect.y - H_TOAST_LABEL));
455 __pContextMenuMore->SetShowState(true);
456 __pContextMenuMore->Show();
460 __pContextMenuMore->SetShowState(false);
465 case IDA_FOOTER_SHARE:
467 if (__pContextMenuShare->GetShowState() == false)
469 Rectangle rect = source.GetBounds();
470 if (pSceneManager->GetCurrentSceneId() == IDSCN_ALL_LIST_SELECTION)
472 __pContextMenuShare->SetAnchorPosition(Point(rect.width / 8 * 3, rect.y));
476 __pContextMenuShare->SetAnchorPosition(Point(rect.width / 8 * 3, rect.y - H_TOAST_LABEL));
478 __pContextMenuShare->SetShowState(true);
479 __pContextMenuShare->Show();
483 __pContextMenuShare->SetShowState(false);
488 case IDA_FOOTER_DELETE:
490 if (pSceneManager->GetCurrentSceneId() == IDSCN_ALL_LIST_EDITOR)
492 AllListEditorPanel* pEditorPanel = dynamic_cast<AllListEditorPanel*>(pSceneManager->GetCurrentScene()->GetPanel());
493 if (pEditorPanel != null && pEditorPanel->GetItemCheckedCount() > 0)
495 __pDeletePopup->SetShowState(true);
496 __pDeletePopup->Show();
500 else if (pSceneManager->GetCurrentSceneId() == IDSCN_IMAGE_LIST_EDITOR)
502 ImageListEditorPanel* pEditorPanel = dynamic_cast<ImageListEditorPanel*>(pSceneManager->GetCurrentScene()->GetPanel());
503 if (pEditorPanel != null && pEditorPanel->GetItemCheckedCount() > 0)
505 __pDeletePopup->SetShowState(true);
506 __pDeletePopup->Show();
510 else if (pSceneManager->GetCurrentSceneId() == IDSCN_VIDEO_LIST_EDITOR)
512 VideoListEditorPanel* pEditorPanel = dynamic_cast<VideoListEditorPanel*>(pSceneManager->GetCurrentScene()->GetPanel());
513 if (pEditorPanel != null && pEditorPanel->GetItemCheckedCount() > 0)
515 __pDeletePopup->SetShowState(true);
516 __pDeletePopup->Show();
520 if (pSceneManager->GetCurrentSceneId() == IDSCN_ALL_LIST_SELECTION)
522 AllListSelectionPanel* pSelectionPanel = dynamic_cast<AllListSelectionPanel*>
523 (pSceneManager->GetCurrentScene()->GetPanel());
524 if (pSelectionPanel != null && pSelectionPanel->GetItemCheckedCount() > 0)
526 __pDeletePopup->SetShowState(true);
527 __pDeletePopup->Show();
534 case IDA_CONTEXT_MENU_MORE_EDIT:
539 case IDA_CONTEXT_MENU_MORE_ADD_TAG:
544 case IDA_CONTEXT_MENU_MORE_COPY:
546 case IDA_CONTEXT_MENU_MORE_MOVE:
548 if (actionId == IDA_CONTEXT_MENU_MORE_MOVE)
550 __isCopyOperation = false;
552 else if (actionId == IDA_CONTEXT_MENU_MORE_COPY)
554 __isCopyOperation = true;
558 if ( __isHWBackButtonExist == false )
561 if (pSceneManager->GetCurrentSceneId() == IDSCN_ALL_LIST_EDITOR)
563 if (__pContextEditorMenuMove->GetShowState() == false)
565 __pContextEditorMenuMove->SetAnchorPosition(Point(__morePosition.x, __morePosition.y - 48));
566 __pContextEditorMenuMove->SetShowState(true);
567 __pContextEditorMenuMove->Show();
571 __pContextEditorMenuMove->SetShowState(false);
574 else if (pSceneManager->GetCurrentSceneId() == IDSCN_ALL_LIST_SELECTION)
576 if (__pContextSelectionMenuMove->GetShowState() == false)
578 __pContextSelectionMenuMove->SetAnchorPosition(__morePosition);
579 __pContextSelectionMenuMove->SetShowState(true);
580 __pContextSelectionMenuMove->Show();
584 __pContextSelectionMenuMove->SetShowState(false);
590 __pOptionMenu->SetShowState(true);
591 __pOptionMenu->Show();
597 case IDA_CONTEXT_MENU_MORE_SLIDE_SHOW:
599 if (__pPopUp != null)
601 __pPopUp->SetShowState(true);
607 case IDA_CONTEXT_MENU_SHARE_MESSAGE:
609 if (pSceneManager->GetCurrentSceneId() == IDSCN_ALL_LIST_EDITOR)
611 AllListEditorPanel* pEditorPanel = dynamic_cast<AllListEditorPanel*>(pSceneManager->GetCurrentScene()->GetPanel());
612 if (pEditorPanel != null)
614 pEditorPanel->OnRequestMessage();
617 else if (pSceneManager->GetCurrentSceneId() == IDSCN_ALL_LIST_SELECTION)
619 AllListSelectionPanel* pSelectionPanel = dynamic_cast<AllListSelectionPanel*>(pSceneManager->GetCurrentScene()->GetPanel());
620 if (pSelectionPanel != null)
622 pSelectionPanel->OnRequestMessage();
628 case IDA_CONTEXT_MENU_SHARE_EMAIL:
630 if (pSceneManager->GetCurrentSceneId() == IDSCN_ALL_LIST_EDITOR)
632 AllListEditorPanel* pEditorPanel = dynamic_cast<AllListEditorPanel*>(pSceneManager->GetCurrentScene()->GetPanel());
633 if (pEditorPanel != null)
635 pEditorPanel->OnRequestEmail();
638 else if (pSceneManager->GetCurrentSceneId() == IDSCN_ALL_LIST_SELECTION)
640 AllListSelectionPanel* pSelectionPanel = dynamic_cast<AllListSelectionPanel*>(pSceneManager->GetCurrentScene()->GetPanel());
641 if (pSelectionPanel != null)
643 pSelectionPanel->OnRequestEmail();
649 case IDA_CONTEXTMENU_EDITOR_MOVE_CREATE_ALBUM:
651 if (pSceneManager->GetCurrentSceneId() == IDSCN_ALL_LIST_EDITOR)
653 AllListEditorPanel* pListEditorPanel = dynamic_cast<AllListEditorPanel*>(pSceneManager->GetCurrentScene()->GetPanel());
654 if (pListEditorPanel)
656 IList* pList = pListEditorPanel->GetItemCheckedIndexListN();
657 pList->InsertAt(new (std::nothrow) Integer(ALBUM_CREATE), ALBUM_FIRST_ELEMENT);
658 if (__isCopyOperation)
660 pList->InsertAt(new (std::nothrow) Integer(FILE_ACTION_COPY), ALBUM_SECOND_ELEMENT);
664 pList->InsertAt(new (std::nothrow) Integer(FILE_ACTION_MOVE), ALBUM_SECOND_ELEMENT);
666 pSceneManager->GoForward(ForwardSceneTransition(IDSCN_ALBUM_NAME_EDITOR), pList);
672 if (pSceneManager->GetCurrentSceneId() == IDSCN_ALL_LIST_SELECTION)
674 AllListSelectionPanel* pSelectionPanel = dynamic_cast<AllListSelectionPanel*>
675 (pSceneManager->GetCurrentScene()->GetPanel());
677 if (pSelectionPanel != null)
679 IList* pList = pSelectionPanel->GetItemCheckedIndexListN();
680 pList->InsertAt(new (std::nothrow) Integer(ALBUM_CREATE), ALBUM_FIRST_ELEMENT);
681 if (__isCopyOperation)
683 pList->InsertAt(new (std::nothrow) Integer(FILE_ACTION_COPY), ALBUM_SECOND_ELEMENT);
687 pList->InsertAt(new (std::nothrow) Integer(FILE_ACTION_MOVE), ALBUM_SECOND_ELEMENT);
689 pSceneManager->GoForward(ForwardSceneTransition(IDSCN_ALBUM_NAME_EDITOR), pList);
696 case IDA_DELETE_POPUP_DEL:
699 __pDeletePopup->SetShowState(false);
700 __pDeletePopup->Invalidate(true);
702 if (pSceneManager->GetCurrentSceneId() == IDSCN_ALL_LIST_EDITOR)
704 AllListEditorPanel* pEditorPanel = dynamic_cast<AllListEditorPanel*>(pSceneManager->GetCurrentScene()->GetPanel());
705 if (pEditorPanel != null)
707 result r = pEditorPanel->OnRequestDelete();
710 AppLogDebug("OnRequestDelete failed with %s", GetErrorMessage(r));
714 else if (pSceneManager->GetCurrentSceneId() == IDSCN_ALL_LIST_SELECTION)
716 AllListSelectionPanel* pSelectionPanel = dynamic_cast<AllListSelectionPanel*>
717 (pSceneManager->GetCurrentScene()->GetPanel());
719 if (pSelectionPanel != null)
721 result r = pSelectionPanel->OnRequestDelete();
724 AppLogDebug("OnRequestDelete failed with %s", GetErrorMessage(r));
731 case IDA_DELETE_POPUP_CANCEL:
734 __pDeletePopup->SetShowState(false);
735 __pDeletePopup->Invalidate(true);
739 case IDA_CONTEXT_MENU_ROTATE_LEFT:
741 if (pSceneManager->GetCurrentSceneId() == IDSCN_ALL_LIST_EDITOR)
743 AllListEditorPanel* pEditorPanel = dynamic_cast<AllListEditorPanel*>(pSceneManager->GetCurrentScene()->GetPanel());
744 if (pEditorPanel != null)
746 RotateMode rotateMode = ROTATE_MODE_LEFT;
747 pEditorPanel->OnRequestRotate(rotateMode);
750 else if (pSceneManager->GetCurrentSceneId() == IDSCN_ALL_LIST_SELECTION)
752 AllListSelectionPanel* pSelectionPanel = dynamic_cast<AllListSelectionPanel*>
753 (pSceneManager->GetCurrentScene()->GetPanel());
755 if (pSelectionPanel != null)
757 RotateMode rotateMode = ROTATE_MODE_LEFT;
758 pSelectionPanel->OnRotateRequested(rotateMode);
764 case IDA_CONTEXT_MENU_ROTATE_RIGHT:
766 if (pSceneManager->GetCurrentSceneId() == IDSCN_ALL_LIST_EDITOR)
768 AllListEditorPanel* pEditorPanel = dynamic_cast<AllListEditorPanel*>(pSceneManager->GetCurrentScene()->GetPanel());
769 if (pEditorPanel != null)
771 RotateMode rotateMode = ROTATE_MODE_RIGHT;
772 pEditorPanel->OnRequestRotate(rotateMode);
775 else if (pSceneManager->GetCurrentSceneId() == IDSCN_ALL_LIST_SELECTION)
778 AllListSelectionPanel* pSelectionPanel = dynamic_cast<AllListSelectionPanel*>
779 (pSceneManager->GetCurrentScene()->GetPanel());
781 if (pSelectionPanel != null)
783 RotateMode rotateMode = ROTATE_MODE_RIGHT;
784 pSelectionPanel->OnRotateRequested(rotateMode);
790 case IDA_FOOTER_CONFIRM:
792 if (pSceneManager->GetCurrentSceneId() == IDSCN_IMAGE_LIST_EDITOR)
794 ImageListEditorPanel* pEditorPanel = dynamic_cast<ImageListEditorPanel*>(pSceneManager->GetCurrentScene()->GetPanel());
795 if (pEditorPanel != null)
797 pEditorPanel->OnRequestAppExitWithMultipleSelectionAppControlResult();
800 else if (pSceneManager->GetCurrentSceneId() == IDSCN_VIDEO_LIST_EDITOR)
802 VideoListEditorPanel* pEditorPanel = dynamic_cast<VideoListEditorPanel*>(pSceneManager->GetCurrentScene()->GetPanel());
803 if (pEditorPanel != null)
805 pEditorPanel->OnRequestAppExitWithMultipleSelectionAppControlResult();
813 if (pSceneManager->GetCurrentSceneId() == IDSCN_ALL_LIST_EDITOR)
815 if ((IDA_CONTEXTMENU_EDITOR_MOVE_ALBUM_ARRAY_START <= actionId) &&
816 (actionId <= IDA_CONTEXTMENU_EDITOR_MOVE_CREATE_ALBUM + 1000))
818 if (__pContentDirectoryList == null)
822 if (__pContentDirectoryList->GetCount() > actionId - IDA_CONTEXTMENU_EDITOR_MOVE_ALBUM_ARRAY_START)
824 String* pDirectory = static_cast<String*>
825 (__pContentDirectoryList->GetAt(actionId - IDA_CONTEXTMENU_EDITOR_MOVE_ALBUM_ARRAY_START));
827 AllListEditorPanel* pEditorPanel = dynamic_cast<AllListEditorPanel*>
828 (pSceneManager->GetCurrentScene()->GetPanel());
830 if (pEditorPanel != null)
833 IList* pItemIndexList = pEditorPanel->GetItemCheckedIndexListN();
834 GetMoveFileIndexList(*pDirectory, pItemIndexList, __pPresentationModel);
835 __pFileMove = new (std::nothrow) FileMoveTimer(*pDirectory, pItemIndexList, __pPresentationModel, this);
836 if (__isCopyOperation)
838 AppLogDebug("Rash: Setting to Copy in FileListEditorForm");
839 __pFileMove->SetCopy();
842 result r = __pFileMove->StartTimer();
847 __isCopyOperation = false;
857 else if (pSceneManager->GetCurrentSceneId() == IDSCN_ALL_LIST_SELECTION)
859 if ((IDA_CONTEXTMENU_SELECTION_MOVE_ALBUM_ARRAY_START <= actionId) &&
860 (actionId <= IDA_CONTEXTMENU_EDITOR_MOVE_CREATE_ALBUM + 1000))
862 if (__pContentDirectoryList == null)
867 if (__pContentDirectoryList->GetCount() > actionId - IDA_CONTEXTMENU_SELECTION_MOVE_ALBUM_ARRAY_START)
869 String* pDirectory = static_cast<String*>
870 (__pContentDirectoryList->GetAt(actionId - IDA_CONTEXTMENU_SELECTION_MOVE_ALBUM_ARRAY_START));
872 AllListSelectionPanel* pSelectionPanel = dynamic_cast<AllListSelectionPanel*>
873 (pSceneManager->GetCurrentScene()->GetPanel());
875 if (pSelectionPanel != null)
878 IList* pItemIndexList = pSelectionPanel->GetItemCheckedIndexListN();
879 GetMoveFileIndexList(*pDirectory, pItemIndexList, __pPresentationModel);
880 __pFileMove = new (std::nothrow) FileMoveTimer(*pDirectory, pItemIndexList, __pPresentationModel, this);
881 if (__isCopyOperation)
883 AppLogDebug("Rash: Setting to Copy in FileListEditorForm");
884 __pFileMove->SetCopy();
886 result r = __pFileMove->StartTimer();
891 __isCopyOperation = false;
904 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
908 FileListEditorForm::OnFileOpInvalidate(enum FileActionMode actionId)
914 FileListEditorForm::GetOverlayStatus(void) const
920 FileListEditorForm::OnFileOpComplete(enum FileActionMode actionId, enum FileActionCompleteRes res)
923 __pPresentationModel->SetUpdateProgressStatus(false);
924 if (res != COMPLETE_SUCCESS)
926 MessageBox messageBox;
927 messageBox.Construct(L"", ResourceManager::GetString(L"IDS_COM_BODY_OPERATION_FAILED"), MSGBOX_STYLE_OK, 3000);
930 messageBox.ShowAndWait(modalResult);
932 SceneManager* pSceneManager = SceneManager::GetInstance();
933 AppAssert(pSceneManager);
934 pSceneManager->GoForward(ForwardSceneTransition(IDSCN_ALL_LIST));
939 FileListEditorForm::OnContentUpdated()
941 AppLogDebug("ENTER");
943 SceneManager* pSceneManager = SceneManager::GetInstance();
945 if(__pDeletePopup != null)
947 if(__pDeletePopup->IsVisible() == true)
949 __pDeletePopup->Destroy();
950 __pDeletePopup = null;
956 if (pSceneManager->GetCurrentSceneId() == IDSCN_ALL_LIST_EDITOR)
958 AllListEditorPanel* pEditorPanel = dynamic_cast<AllListEditorPanel*>(pSceneManager->GetCurrentScene()->GetPanel());
959 if (pEditorPanel != null)
961 pEditorPanel->CancelUpdateProgress();
964 else if (pSceneManager->GetCurrentSceneId() == IDSCN_ALL_LIST_SELECTION)
966 AllListSelectionPanel* pSelectionPanel = dynamic_cast<AllListSelectionPanel*>(pSceneManager->GetCurrentScene()->GetPanel());
967 if (pSelectionPanel != null)
969 pSelectionPanel->CancelUpdateProgress();
973 if (__pPresentationModel->GetAppControlMode() == APPCONTROL_MODE_PICK
974 && pSceneManager->GetCurrentSceneId() == IDSCN_IMAGE_LIST_EDITOR)
976 pSceneManager->GoForward(ForwardSceneTransition(IDSCN_ALBUM_LIST, SCENE_TRANSITION_ANIMATION_TYPE_NONE,
977 SCENE_HISTORY_OPTION_NO_HISTORY, SCENE_DESTROY_OPTION_DESTROY));
980 else if (_overlayMsg == false)
982 pSceneManager->GoForward(ForwardSceneTransition(IDSCN_ALL_LIST, SCENE_TRANSITION_ANIMATION_TYPE_NONE,
983 SCENE_HISTORY_OPTION_NO_HISTORY, SCENE_DESTROY_OPTION_DESTROY));
986 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
990 FileListEditorForm::SetUpPopup(void)
992 AppLogDebug("ENTER");
993 result r = E_SUCCESS;
995 if (__pDeletePopup != null)
997 delete __pDeletePopup;
998 __pDeletePopup = null;
1001 __pDeletePopup = new (std::nothrow) Popup();
1002 __pDeletePopup->Construct(false, Dimension(W_DELETE_POPUP, H_DELETE_POPUP));
1004 Rectangle popupClientBounds = __pDeletePopup->GetClientAreaBounds();
1006 Label* pLabelText = new (std::nothrow) Label();
1007 pLabelText->Construct(Rectangle(0, 0, popupClientBounds.width, H_DELETE_LABEL),
1008 ResourceManager::GetString(L"IDS_COM_POP_DELETE_Q"));
1009 pLabelText->SetTextHorizontalAlignment(ALIGNMENT_LEFT);
1010 pLabelText->SetTextConfig(34,LABEL_TEXT_STYLE_BOLD);
1011 __pDeletePopup->AddControl(pLabelText);
1013 Button* pDeleteButton = new (std::nothrow) Button();
1014 pDeleteButton->Construct(Rectangle(0, Y_DELETE_BUTTON, popupClientBounds.width / 2 - GAP_W_POPUP_ITEM, H_DELETE_BUTTON),
1015 ResourceManager::GetString(L"IDS_COM_BODY_DELETE"));
1016 pDeleteButton->SetColor(BUTTON_STATUS_NORMAL, COLOR_DELETE_BUTTON_NORMAL);
1017 pDeleteButton->SetColor(BUTTON_STATUS_PRESSED, COLOR_DELETE_BUTTON_PRESSED);
1018 pDeleteButton->SetTextColor(COLOR_DELETE_BUTTON_TEXT);
1019 pDeleteButton->SetActionId(IDA_DELETE_POPUP_DEL);
1020 pDeleteButton->AddActionEventListener(*this);
1021 __pDeletePopup->AddControl(pDeleteButton);
1023 Button* pButtonCancel = new (std::nothrow) Button();
1024 pButtonCancel->Construct(Rectangle(popupClientBounds.width / 2 + GAP_W_POPUP_ITEM, Y_DELETE_BUTTON,
1025 popupClientBounds.width / 2 - GAP_W_POPUP_ITEM, H_DELETE_BUTTON), ResourceManager::GetString(L"IDS_COM_POP_CANCEL"));
1026 pButtonCancel->SetActionId(IDA_DELETE_POPUP_CANCEL);
1027 pButtonCancel->AddActionEventListener(*this);
1028 __pDeletePopup->AddControl(pButtonCancel);
1029 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
1035 FileListEditorForm::SetTitleText(const String& titleText)
1037 AppLogDebug("ENTER");
1038 Header* pHeader = GetHeader();
1039 TryReturnVoid(pHeader != null, "[%s] fail to get the header.", GetErrorMessage(GetLastResult()));
1040 pHeader->SetTitleText(titleText);
1041 pHeader->Invalidate(true);
1042 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
1046 FileListEditorForm::RefreshFolderList(void)
1048 AppLogDebug("ENTER");
1049 ContentDirectory contentDirectory;
1050 IListT<ContentType>* pContentTypeList = new (std::nothrow) ArrayListT<ContentType>();
1051 pContentTypeList->Add(CONTENT_TYPE_IMAGE);
1052 pContentTypeList->Add(CONTENT_TYPE_VIDEO);
1053 result r = contentDirectory.Construct(*pContentTypeList);
1056 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
1059 delete pContentTypeList;
1061 if (__pContentDirectoryList != null)
1063 delete __pContentDirectoryList;
1065 __pContentDirectoryList = contentDirectory.GetContentDirectoryPathListN(SORT_ORDER_NONE);
1066 __pContentDirectoryNameList = new (std::nothrow) ArrayList(SingleObjectDeleter);
1067 String* pDirPath = null;
1068 String* pDirName = null;
1069 String mediaPath = RESERVED_MEDIA_PATH;
1070 int length = mediaPath.GetLength();
1071 mediaPath.Remove(length-1,1);
1073 int loopCount = __pContentDirectoryList->GetCount();
1074 for (int i = 0; i < loopCount; ++i)
1076 pDirPath = static_cast<String*>(__pContentDirectoryList->GetAt(i));
1077 pDirName = new (std::nothrow) String(GetDirecotyNameFromFullPath(*pDirPath));
1079 if ( *pDirPath == mediaPath)
1081 *pDirName = ResourceManager::GetString(L"IDS_MEDIABR_POP_NO_NAME");
1082 __pContentDirectoryNameList->Add(pDirName);
1086 __pContentDirectoryNameList->Add(pDirName);
1090 if (__isHWBackButtonExist == false)
1092 __pContextEditorMenuMove->RemoveAllItems();
1093 __pContextEditorMenuMove->AddItem(ResourceManager::GetString(L"IDS_MEDIABR_OPT_CREATE_ALBUM"),
1094 IDA_CONTEXTMENU_EDITOR_MOVE_CREATE_ALBUM);
1095 __pContextSelectionMenuMove->RemoveAllItems();
1096 __pContextSelectionMenuMove->AddItem(ResourceManager::GetString(L"IDS_MEDIABR_OPT_CREATE_ALBUM"),
1097 IDA_CONTEXTMENU_EDITOR_MOVE_CREATE_ALBUM);
1099 loopCount = __pContentDirectoryNameList->GetCount();
1100 for (int i = 0; i < loopCount; ++i)
1102 pDirName = static_cast<String*>(__pContentDirectoryNameList->GetAt(i));
1104 if ( *pDirName != __pPresentationModel->GetCurrentAlbumName())
1106 __pContextEditorMenuMove->AddItem(*(new (std::nothrow) String(*pDirName)),
1107 IDA_CONTEXTMENU_EDITOR_MOVE_ALBUM_ARRAY_START + i);
1108 __pContextSelectionMenuMove->AddItem(*(new (std::nothrow) String(*pDirName)),
1109 IDA_CONTEXTMENU_SELECTION_MOVE_ALBUM_ARRAY_START + i);
1112 __pContextEditorMenuMove->SetShowState(false);
1113 __pContextSelectionMenuMove->SetShowState(false);
1117 __pOptionMenu->RemoveAllItems();
1118 __pOptionMenu->AddItem(ResourceManager::GetString(L"IDS_MEDIABR_OPT_CREATE_ALBUM"),
1119 IDA_CONTEXTMENU_EDITOR_MOVE_CREATE_ALBUM);
1121 loopCount = __pContentDirectoryNameList->GetCount();
1122 for (int i = 0; i < loopCount; ++i)
1124 pDirName = static_cast<String*>(__pContentDirectoryNameList->GetAt(i));
1126 if ( *pDirName != __pPresentationModel->GetCurrentAlbumName())
1128 __pOptionMenu->AddItem(*(new (std::nothrow) String(*pDirName)),
1129 IDA_CONTEXTMENU_EDITOR_MOVE_ALBUM_ARRAY_START + i);
1134 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
1138 FileListEditorForm::OnFormBackRequested(Form& source)
1140 AppLogDebug("ENTER");
1142 SceneManager* pSceneManager = SceneManager::GetInstance();
1143 TryReturnVoid(pSceneManager != null, "[%s] fail to get SceneManager.", GetErrorMessage(GetLastResult()));
1145 if (__pPresentationModel->GetAppControlMode() == APPCONTROL_MODE_PICK)
1147 if (pSceneManager->GetCurrentSceneId() == IDSCN_IMAGE_LIST_EDITOR)
1149 pSceneManager->GoBackward(BackwardSceneTransition(IDSCN_ALBUM_LIST));
1151 else if (pSceneManager->GetCurrentSceneId() == IDSCN_VIDEO_LIST_EDITOR)
1153 pSceneManager->GoBackward(BackwardSceneTransition(IDSCN_ALBUM_LIST));
1158 if (pSceneManager->GetCurrentSceneId() == IDSCN_ALL_LIST_EDITOR)
1160 pSceneManager->GoBackward(BackwardSceneTransition(IDSCN_ALL_LIST));
1162 else if (pSceneManager->GetCurrentSceneId() == IDSCN_IMAGE_LIST_EDITOR)
1164 pSceneManager->GoBackward(BackwardSceneTransition(IDSCN_IMAGE_LIST));
1166 else if (pSceneManager->GetCurrentSceneId() == IDSCN_VIDEO_LIST_EDITOR)
1168 pSceneManager->GoBackward(BackwardSceneTransition(IDSCN_VIDEO_LIST));
1170 else if (pSceneManager->GetCurrentSceneId() == IDSCN_ALL_LIST_SELECTION)
1172 AllListSelectionPanel* pSelectionPanel = dynamic_cast<AllListSelectionPanel*>
1173 (pSceneManager->GetCurrentScene()->GetPanel());
1174 if (pSelectionPanel != null)
1176 IList* pList = pSelectionPanel->GetItemCheckedIndexListN();
1179 pList = new (std::nothrow) ArrayList(SingleObjectDeleter);
1182 pSceneManager->GoForward(ForwardSceneTransition(IDSCN_ALL_LIST_EDITOR, SCENE_TRANSITION_ANIMATION_TYPE_NONE,
1183 SCENE_HISTORY_OPTION_ADD_HISTORY, SCENE_DESTROY_OPTION_DESTROY), pList);
1188 pSceneManager->GoBackward(BackwardSceneTransition(IDSCN_ALL_LIST));
1191 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
1195 FileListEditorForm::SetFooterButtonsState(const bool enableState)
1197 AppLogDebug("ENTER");
1198 Footer* pFooter = GetFooter();
1199 TryReturnVoid(pFooter != null, "[%s] fail to get the footer.", GetErrorMessage(GetLastResult()));
1201 if (__pPresentationModel->GetAppControlMode() == APPCONTROL_MODE_PICK)
1203 if (enableState == true)
1205 pFooter->SetButtonEnabled(BUTTON_POSITION_LEFT, true);
1206 pFooter->SetItemEnabled(0, true);
1210 pFooter->SetButtonEnabled(BUTTON_POSITION_LEFT, false);
1211 pFooter->SetItemEnabled(0, false);
1216 if (enableState == true)
1218 pFooter->SetButtonEnabled(BUTTON_POSITION_LEFT, true);
1219 pFooter->SetItemEnabled(0, true);
1220 pFooter->SetItemEnabled(1, true);
1224 pFooter->SetButtonEnabled(BUTTON_POSITION_LEFT, false);
1225 pFooter->SetItemEnabled(0, false);
1226 pFooter->SetItemEnabled(1, false);
1229 pFooter->RequestRedraw(true);
1230 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
1234 FileListEditorForm::MoveToAlbum(const String& destDirectory)
1236 AppLogDebug("ENTER");
1237 result r = E_FAILURE;
1238 String albumName = __pPresentationModel->ConvertToAlbumName(destDirectory);
1239 if (albumName != EMPTY_SPACE)
1241 IList* pDirectoryList = new (std::nothrow) ArrayList(SingleObjectDeleter);
1242 pDirectoryList->Add(new (std::nothrow) String(destDirectory));
1243 __pPresentationModel->SetCurrentAlbumInfo(albumName, *pDirectoryList);
1244 __pPresentationModel->SetCurrentAlbumContentType(CONTENT_TYPE_ALL);
1245 delete pDirectoryList;
1247 SceneManager* pSceneManager = SceneManager::GetInstance();
1248 pSceneManager->GoForward(ForwardSceneTransition(IDSCN_ALL_LIST));
1251 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
1257 FileListEditorForm::SelectAllPressed(void)
1259 SceneManager* pSceneManager = SceneManager::GetInstance();
1260 pSceneManager->GetCurrentScene();
1262 if (pSceneManager->GetCurrentSceneId() == IDSCN_ALL_LIST_EDITOR)
1264 AllListEditorPanel* pEditorPanel = dynamic_cast<AllListEditorPanel*>(pSceneManager->GetCurrentScene()->GetPanel());
1265 if (pEditorPanel != null)
1267 pEditorPanel->OnSelectAllPressed();
1270 else if (pSceneManager->GetCurrentSceneId() == IDSCN_IMAGE_LIST_EDITOR)
1272 ImageListEditorPanel* pEditorPanel = dynamic_cast<ImageListEditorPanel*>(pSceneManager->GetCurrentScene()->GetPanel());
1273 if (pEditorPanel != null)
1275 pEditorPanel->OnSelectAllPressed();
1278 else if (pSceneManager->GetCurrentSceneId() == IDSCN_VIDEO_LIST_EDITOR)
1280 VideoListEditorPanel* pEditorPanel = dynamic_cast<VideoListEditorPanel*>(pSceneManager->GetCurrentScene()->GetPanel());
1281 if (pEditorPanel != null)
1283 pEditorPanel->OnSelectAllPressed();
1286 else if (pSceneManager->GetCurrentSceneId() == IDSCN_ALL_LIST_SELECTION)
1288 AllListSelectionPanel* pEditorPanel = dynamic_cast<AllListSelectionPanel*>(pSceneManager->GetCurrentScene()->GetPanel());
1289 if (pEditorPanel != null)
1291 pEditorPanel->OnSelectAllPressed();
1297 FileListEditorForm::OnSlideSettingPopUpItemSelected(int index)
1299 if (__pPopUp != NULL)
1301 __pPopUp->SetShowState(false);
1304 SceneManager* pSceneManager = SceneManager::GetInstance();
1308 if (pSceneManager->GetCurrentSceneId() == IDSCN_ALL_LIST_EDITOR)
1310 AllListEditorPanel* pEditorPanel = dynamic_cast<AllListEditorPanel*>(pSceneManager->GetCurrentScene()->GetPanel());
1311 if (pEditorPanel != null)
1313 pEditorPanel->OnRequestSlideShow();
1316 else if (pSceneManager->GetCurrentSceneId() == IDSCN_ALL_LIST_SELECTION)
1318 AllListSelectionPanel* pSelectionPanel = dynamic_cast<AllListSelectionPanel*>
1319 (pSceneManager->GetCurrentScene()->GetPanel());
1321 if (pSelectionPanel != null)
1323 pSelectionPanel->OnRequestSlideShow();
1327 else if (index == 1)
1329 SceneManager* pSceneManager = SceneManager::GetInstance();
1330 TryReturnVoid(pSceneManager != null, "[%s] fail to get SceneManager", GetErrorMessage(GetLastResult()));
1332 pSceneManager->GoForward(ForwardSceneTransition(IDSCN_SETTING_MAIN));
1337 FileListEditorForm::OnSceneDeactivated(const SceneId& currentSceneId, const SceneId& nextSceneId)
1339 AppLogDebug("ENTER");
1340 __pPresentationModel->RemoveContentEventListener(this);
1341 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
1345 FileListEditorForm::OnSceneActivatedN(const SceneId& previousSceneId, const SceneId& currentSceneId, IList* pArgs)
1347 AppLogDebug("ENTER");
1348 __pPresentationModel->AddContentEventListener(this);
1349 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
1353 FileListEditorForm::OnFormMenuRequested (Tizen::Ui::Controls::Form &source)
1356 SceneManager* pSceneManager = SceneManager::GetInstance();
1357 int checkedCount = 0;
1359 if (pSceneManager->GetCurrentSceneId() == IDSCN_ALL_LIST_EDITOR)
1361 AllListEditorPanel* pEditorPanel = dynamic_cast<AllListEditorPanel*>(pSceneManager->GetCurrentScene()->GetPanel());
1362 if (pEditorPanel != null)
1364 checkedCount = pEditorPanel->GetItemCheckedCount();
1367 else if (pSceneManager->GetCurrentSceneId() == IDSCN_ALL_LIST_SELECTION)
1369 AllListSelectionPanel* pSelectionPanel = dynamic_cast<AllListSelectionPanel*>(pSceneManager->GetCurrentScene()->GetPanel());
1370 if (pSelectionPanel != null)
1372 checkedCount = pSelectionPanel->GetItemCheckedCount();
1376 if (__pContextMenuShare != null && __pContextMenuShare->GetShowState() == true )
1378 __pContextMenuShare->SetShowState(false);
1381 if ( checkedCount > 0)
1383 if ( __pOptionMenu == null )
1388 __pOptionMenu->RemoveAllItems();
1389 __pOptionMenu->AddItem(ResourceManager::GetString(L"IDS_COM_BODY_MOVE"),
1390 IDA_CONTEXT_MENU_MORE_MOVE);
1391 __pOptionMenu->AddItem(ResourceManager::GetString(L"IDS_COM_BODY_COPY"),
1392 IDA_CONTEXT_MENU_MORE_COPY);
1394 if (checkedCount > 1)
1396 __pOptionMenu->AddItem(ResourceManager::GetString(L"IDS_MEDIABR_OPT_SLIDESHOW"),
1397 IDA_CONTEXT_MENU_MORE_SLIDE_SHOW);
1400 __pOptionMenu->AddItem(ResourceManager::GetString(L"IDS_IV_OPT_ROTATE_LEFT"),IDA_CONTEXT_MENU_ROTATE_LEFT);
1401 __pOptionMenu->AddItem(ResourceManager::GetString(L"IDS_IV_OPT_ROTATE_RIGHT"),IDA_CONTEXT_MENU_ROTATE_RIGHT);
1403 __pOptionMenu->SetShowState(true);
1404 __pOptionMenu->Show();