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: MfSubFolderMoveCopy.cpp
19 * @brief: This file contains the implementation SubFolderMoveCopy class, which loads the form which implements the Copy
20 * and Move Functionalities on the SubDirectoryForm.
23 #include "MfSubFolderMoveCopy.h"
26 using namespace Tizen::App;
27 using namespace Tizen::Base;
28 using namespace Tizen::Base::Collection;
29 using namespace Tizen::Base::Utility;
30 using namespace Tizen::Graphics;
31 using namespace Tizen::Io;
32 using namespace Tizen::Locales;
33 using namespace Tizen::Media;
34 using namespace Tizen::System;
35 using namespace Tizen::Ui;
36 using namespace Tizen::Ui::Controls;
37 using namespace Tizen::Ui::Scenes;
40 SubFolderMoveCopy::SubFolderMoveCopy(void)
41 : _pBaseItemProvider(null)
42 , _pFolderEntryPM(null)
44 , _pThumbnailItemProvider(null)
45 , _pThumbnailManager(null)
47 , _pFileProgressingCancelButton(null)
50 , _pMoreContextMenu(null)
53 , _pCreateFolder(null)
57 , _pIconListView(null)
58 , _pDisplayPathLabel(null)
59 , _pFileProgressingHeaderLabel(null)
60 , _pFileProgressingLabel(null)
62 , _pFileProgressingPopup(null)
63 , _pFileProgressingProgress(null)
65 __updateFooterCheck = false;
66 __fileManagedCount = 0;
67 __storageType = MEMORY_TYPE_NONE;
72 SubFolderMoveCopy::~SubFolderMoveCopy(void)
74 if (__pHomeButton != null)
79 if (__pUpButton != null)
86 SubFolderMoveCopy::Initialize(void)
88 Form::Construct(L"IDL_SUB_FOLDER_MOVE_COPY");
93 SubFolderMoveCopy::OnInitializing(void)
99 Color formBgColor = GetBackgroundColor();
101 AppResource* pAppResource = null;
102 Bitmap* pBitmapHomeButton = null;
103 Bitmap* pBitmapUpButton = null;
104 Bitmap* pBitmapHomeButtonPress = null;
105 Bitmap* pBitmapUpButtonPress = null;
107 __fileManagedCount = 0;
108 __updateFooterCheck = false;
110 ((MyFilesApp*) Application::GetInstance())->SetCurrentView(this);
112 int sourceForm = THUMBNAIL_PROVIDER_SOURCEID_SUB_MOVE_COPY_FORM;
113 CreateItemSource createitemsource = CREATE_ITEM_SOURCE_SUB_BASE_MOVE_COPY;
115 pAppResource = UiApp::GetInstance()->GetAppResource();
116 TryCatch(pAppResource != null, , "Resource manager not found!");
118 pBitmapHomeButton = pAppResource->GetBitmapN(IDB_HOME_BUTTON_ICON, BITMAP_PIXEL_FORMAT_ARGB8888);
119 pBitmapUpButton = pAppResource->GetBitmapN(IDB_UP_BUTTON_ICON, BITMAP_PIXEL_FORMAT_ARGB8888);
120 pBitmapHomeButtonPress = pAppResource->GetBitmapN(IDB_HOME_BUTTON_ICON_PRESS, BITMAP_PIXEL_FORMAT_ARGB8888);
121 pBitmapUpButtonPress = pAppResource->GetBitmapN(IDB_UP_BUTTON_ICON_PRESS, BITMAP_PIXEL_FORMAT_ARGB8888);
123 pAppResource->GetString(L"IDS_MF_BUTTON_HOME", btnHome);
124 pAppResource->GetString(L"IDS_MF_TAB_UP", btnUp);
125 __pHeader = GetHeader();
126 if (__pHeader != null)
128 __pHomeButton = new (std::nothrow) ButtonItem();
129 __pHomeButton->Construct(BUTTON_ITEM_STYLE_TEXT, IDA_BTN_HOME);
130 __pHomeButton->SetBackgroundBitmap(BUTTON_ITEM_STATUS_NORMAL, pBitmapHomeButton);
131 __pHomeButton->SetBackgroundBitmap(BUTTON_ITEM_STATUS_PRESSED, pBitmapHomeButtonPress);
133 __pUpButton = new (std::nothrow) ButtonItem();
134 __pUpButton->Construct(BUTTON_ITEM_STYLE_TEXT, IDA_BTN_UP);
135 __pUpButton->SetBackgroundBitmap(BUTTON_ITEM_STATUS_NORMAL, pBitmapUpButton);
136 __pUpButton->SetBackgroundBitmap(BUTTON_ITEM_STATUS_PRESSED, pBitmapUpButtonPress);
138 __pHeader->SetButton(BUTTON_POSITION_LEFT, *__pHomeButton);
139 __pHeader->SetButton(BUTTON_POSITION_RIGHT, *__pUpButton);
140 __pHeader->AddActionEventListener(*this);
143 _pFolderEntryPM = new (std::nothrow) FolderEntryPresentationModel();
144 TryCatch(_pFolderEntryPM != null, , "__pContentManager not found!");
145 _pFolderEntryPM->Construct();
146 _pFolderEntryPM->SetSourceForm(createitemsource);
148 _pFileManager = FolderEntryEditorPresentationModel::GetInstance();
149 TryCatch(_pFileManager != null, , "File Manager not found!");
151 if (_pThumbnailItemProvider == null)
153 _pThumbnailItemProvider = new (std::nothrow) ThumbnailItemProviderAndListener(_rootPath, sourceForm);
154 TryCatch(_pThumbnailItemProvider != null, , "Failed to allocate memory to thumbnail provider");
155 _pThumbnailItemProvider->SetFolderEntryProvider(this);
156 _pThumbnailItemProvider->SetFooterItemStateChangeListener(this);
160 _pDisplayPathLabel = static_cast< Label* >(GetControl("IDC_LABEL_DISPLAY_PATH"));
161 TryCatch(_pDisplayPathLabel != null, , "__pDisplayPathLabel is null");
163 _pBaseItemProvider = new (std::nothrow) BaseItemProvider();
164 TryCatch(_pBaseItemProvider != null, , "Failed to allocate base itemprovider");
165 _pBaseItemProvider->Construct();
166 _pBaseItemProvider->SetSourceForm(createitemsource);
167 _pBaseItemProvider->SetFolderEntryProvider(this);
169 _pListView = static_cast< ListView* >(GetControl("IDC_LISTVIEW1"));
170 TryCatch(_pListView != null, , "list view is null");
171 _pListView->AddListViewItemEventListener(*this);
172 _pListView->SetItemProvider(*_pBaseItemProvider);
174 _pIconListView = static_cast< IconListView* >(GetControl(L"IDC_ICONLISTVIEW_SUB_THUMBNAILS"));
175 if (_pIconListView != null)
177 _pIconListView->SetShowState(false);
178 r = _pIconListView->SetItemProvider(*_pThumbnailItemProvider);
179 _pIconListView->AddIconListViewItemEventListener(*_pThumbnailItemProvider);
183 DataBindingContext* pContext = null;
185 pContext = GetDataBindingContextN();
186 pContext->Bind(L"ID_DISPLAY_PATH", L"IDC_LABEL_DISPLAY_PATH", L"text", __displayPath, DATA_BINDING_DATA_TYPE_STRING, DATA_BINDING_FLOW_ONE_WAY, DATA_BINDING_TRIGGER_EXPLICIT, this, null, null);
191 delete pBitmapHomeButton;
192 delete pBitmapUpButton;
193 delete pBitmapHomeButtonPress;
194 delete pBitmapUpButtonPress;
195 AppLogDebug("EXIT: r = %s", GetErrorMessage(GetLastResult()));
200 if (__pHomeButton != null)
202 delete __pHomeButton;
203 __pHomeButton = null;
206 if (__pUpButton != null)
212 if (_pDisplayPathLabel != null)
214 delete _pDisplayPathLabel;
215 _pDisplayPathLabel = null;
218 if (_pListView != null)
224 if (pBitmapHomeButton != null)
226 delete pBitmapHomeButton;
227 pBitmapHomeButton = null;
230 if (pBitmapUpButton != null)
232 delete pBitmapUpButton;
233 pBitmapUpButton = null;
235 if (pBitmapHomeButtonPress != null)
237 delete pBitmapHomeButtonPress;
238 pBitmapHomeButtonPress = null;
240 if (pBitmapUpButtonPress != null)
242 delete pBitmapUpButtonPress;
243 pBitmapUpButtonPress = null;
249 SubFolderMoveCopy::OnActionPerformed(const Tizen::Ui::Control& source, int actionId)
251 AppLogDebug("ENTER");
252 Bitmap* pBitmapCreateFolderContextItem = null;
253 String btnCreateFoler;
254 AppResource* pAppResource = null;
255 pAppResource = UiApp::GetInstance()->GetAppResource();
257 if (pAppResource != null)
259 pAppResource->GetString(L"IDS_COM_BODY_CREATE_FOLDER", btnCreateFoler);
260 pBitmapCreateFolderContextItem = pAppResource->GetBitmapN(IDB_POPUP_CREATE_FOLDER_ICON, BITMAP_PIXEL_FORMAT_ARGB8888);
278 ((MyFilesApp*) Application::GetInstance())->SetNotifyListener(this);
279 _rootPath = FolderNavigationPresentationModel::GetCurrentPath();
280 _pFileManager->CopyFolderEntries(FILE_EXISTING_OPERATIONID_NONE);
286 ((MyFilesApp*) Application::GetInstance())->SetNotifyListener(this);
287 _rootPath = FolderNavigationPresentationModel::GetCurrentPath();
288 _pFileManager->MoveFolderEntries(FILE_EXISTING_OPERATIONID_NONE);
291 case IDA_BTN_CREATE_FOLDER:
293 LoadCreateFolderForm();
298 _pMoreContextMenu->RemoveAllItems();
299 _pMoreContextMenu->SetItemTextColor(CONTEXT_MENU_ITEM_STATUS_NORMAL, Color::GetColor(COLOR_ID_WHITE));
300 _pMoreContextMenu->SetItemTextColor(CONTEXT_MENU_ITEM_STATUS_PRESSED, Color::GetColor(COLOR_ID_WHITE));
301 _pMoreContextMenu->AddItem(btnCreateFoler, IDA_BTN_CREATE_FOLDER, *pBitmapCreateFolderContextItem, null, null);
302 _pMoreContextMenu->SetShowState(true);
303 _pMoreContextMenu->Show();
306 case IDA_BTN_ANIMATION_POPUP_CANCEL:
308 //HideFileProgressingPopup();
309 _pFileManager->ForceStopWorkerThread();
314 //SubBaseOnActionPerformed(source, actionId);
322 SubFolderMoveCopy::OnListViewItemStateChanged(Tizen::Ui::Controls::ListView& listView, int index, int elementId, Tizen::Ui::Controls::ListItemStatus status)
324 AppLogDebug("ENTER");
325 DirectoryEntry* pDirStr = null;
327 SceneManager* pSceneManager = SceneManager::GetInstance();
328 result r = E_SUCCESS;
329 String backupRootPath = FolderNavigationPresentationModel::GetCurrentPath();
330 if (_pFileNames != null)
332 pDirStr = static_cast< DirectoryEntry* >(_pFileNames->GetAt(index));
333 TryCatch(pDirStr != null, , " Failed to retrieve pDirStr");
336 _rootPath.Append(pDirStr->GetFullFilePath());
337 if (pDirStr->IsDirectory())
339 FolderNavigationPresentationModel::SetCurrentFilePath(_rootPath);
341 String oldLabelText = _pDisplayPathLabel->GetText();
344 newLabelText.Append(oldLabelText);
345 newLabelText.Append(pDirStr->GetFileName());
346 newLabelText.Append(L"/");
348 __displayPath = newLabelText;
350 //Get the header and set the title to the current Directory Name.
351 __pHeader = GetHeader();
352 if (__pHeader != null)
354 if (!fileName.IsEmpty())
356 __pHeader->SetTitleText(fileName);
357 __pHeader->Invalidate(true);
361 ArrayList* pArg = null;
362 pArg = new (std::nothrow) ArrayList();
364 pArg->Add(new (std::nothrow) Integer(sourceFormOption));
365 pSceneManager->GoForward(ForwardSceneTransition(SCENE_TRANSITION_ANIMATION_TYPE_LEFT), pArg);
366 TryCatch(r == E_SUCCESS, , "scene transition failed");
370 AppLogDebug("EXIT: r = %s", GetErrorMessage(GetLastResult()));
374 FolderNavigationPresentationModel::SetCurrentFilePath(backupRootPath);
375 if (_pFolderEntryPM != null)
377 delete _pFolderEntryPM;
384 SubFolderMoveCopy::OnSceneActivatedN(const Tizen::Ui::Scenes::SceneId& previousSceneId,
385 const Tizen::Ui::Scenes::SceneId& currentSceneId, Tizen::Base::Collection::IList* pArgs)
387 AppLogDebug("ENTER");
388 result r = E_SUCCESS;
390 ((MyFilesApp*) Application::GetInstance())->SetCurrentView(this);
392 AppResource* pAppResource = null;
393 AppRegistry* pAppRegistry = null;
394 String viewStyleKeyName(L"ListDisplayType");
397 String externalStorage;
398 pAppRegistry = UiApp::App::GetInstance()->GetAppRegistry();
399 int listViewDisplayType = VIEW_TYPE_AS_NORMAL_LIST;
400 int sourceForm = THUMBNAIL_PROVIDER_SOURCEID_SUB_MOVE_COPY_FORM;
402 r = pAppRegistry->Get(viewStyleKeyName, listViewDisplayType);
403 AppLogDebug("AppRegistry Get Result: %s", GetErrorMessage(r));
405 __viewType = listViewDisplayType;
407 DeviceManager::AddDeviceEventListener(DEVICE_TYPE_STORAGE_CARD, *this);
408 DeviceManager::GetState(DEVICE_TYPE_STORAGE_CARD,deviceState);
410 DeviceManager::AddDeviceEventListener(DEVICE_TYPE_USB_CLIENT, *this);
413 pAppResource = UiApp::GetInstance()->GetAppResource();
414 TryCatch(pAppResource != null, , "Failed to fetch AppResource");
415 pAppResource->GetString(L"IDS_MF_TAB_PHONE", phone);
416 pAppResource->GetString(L"IDS_MF_TAB_MEMORY_CARD", sdCard);
417 pAppResource->GetString(L"IDS_MF_TAB_EXTERNAL_STORAGE", externalStorage);
420 externalStorage.Append(L"/");
422 SceneManager::GetInstance()->AddSceneManagerEventListener(*this);
424 if (_pThumbnailItemProvider != null)
426 _pThumbnailItemProvider->SetCreateItemSource(sourceForm);
431 sourceFormOption = *(static_cast< Integer* >(pArgs->GetAt(0)));
433 pArgs->RemoveAll(true);
438 _rootPath = FolderNavigationPresentationModel::GetCurrentPath();
439 __receivedStorageType = FolderNavigationPresentationModel::GetStorageType();
441 SetHeaderTitleText(_rootPath);
443 switch (__receivedStorageType.ToInt())
445 case MEMORY_TYPE_PHONE:
447 __storageType = MEMORY_TYPE_PHONE;
448 __displayPath = phone;
452 case MEMORY_TYPE_SD_CARD:
454 __storageType = MEMORY_TYPE_SD_CARD;
456 __displayPath = sdCard;
460 case MEMORY_TYPE_EXTERNAL:
462 __storageType = MEMORY_TYPE_EXTERNAL;
463 __displayPath = externalStorage;
475 //Call SetNextDisplayPath to Append the right path to the label.
476 SetNextDisplayPath();
478 _pFileManager->SetFileManagingListener(this);
480 if (_pFolderEntryPM != null)
482 _pFolderEntryPM->SetFolderEntryPath(_rootPath);
483 //__pFileListPM->SetFileEventListener(this);
484 _pFileNames = _pFolderEntryPM->GetFolderEntryList();
485 TryCatch(_pFileNames != null, , "Failed to allocate Memory to Filenames ArrayList");
489 AppLogDebug("Filenames Count %d", _pFileNames->GetCount());
491 _pThumbnailItemProvider->SetSourceFromOption(sourceFormOption.ToInt());
493 _pFooter = GetFooter();
494 if (_pFooter != null)
496 _pFooter->RemoveAllButtons();
497 _pFooter->RemoveAllItems();
501 _pFolderEntryPM->InitThumbnailManager();
502 AppLogDebug("EXIT: r = %s", GetErrorMessage(GetLastResult()));
509 SubFolderMoveCopy::OnSceneDeactivated(const Tizen::Ui::Scenes::SceneId& currentSceneId,
510 const Tizen::Ui::Scenes::SceneId& nextSceneId)
512 ((MyFilesApp*)Application::GetInstance())->SetCurrentView(null);
513 DeviceManager::RemoveAllDeviceEventListeners();
514 _pFolderEntryPM->StopThumbnailManager(true);
518 SubFolderMoveCopy::LoadParentForm(void)
520 AppLogDebug("ENTER");
521 SceneManager* pSceneManager = SceneManager::GetInstance();
522 result r = E_SUCCESS;
523 _rootPath = FolderNavigationPresentationModel::GetCurrentPath();
524 String previousParentPath = GetParentDirectoryName();
526 //FolderNavigationPresentationModel::SetCurrentFilePath(previousParentPath);
528 if (_rootPath == BasePresentationModel::GetMediaPath() || _rootPath == BasePresentationModel::GetSdCardPath() || _rootPath == BasePresentationModel::GetUsbPath())
531 __rootPath.Append(previousParentPath);
532 ArrayList* pArgs = new (std::nothrow) ArrayList();
533 r = pArgs->Construct();
534 Integer* pSourceFromOption = new (std::nothrow) Integer(sourceFormOption);
535 pArgs->Add(pSourceFromOption);
536 pSceneManager->GoForward(ForwardSceneTransition(IDSCN_TOP_LEVEL_DIRECTORY_COPY_MOVE_FORM, SCENE_TRANSITION_ANIMATION_TYPE_RIGHT, SCENE_HISTORY_OPTION_NO_HISTORY, SCENE_DESTROY_OPTION_DESTROY), pArgs);
540 FolderNavigationPresentationModel::SetCurrentFilePath(previousParentPath);
542 _rootPath.Append(previousParentPath);
544 SetParentDisplayPath();
545 SetHeaderTitleText(_rootPath);
547 if (_pFolderEntryPM != null)
549 //__pContentManager->ClearList();
550 _pFolderEntryPM->SetFolderEntryPath(_rootPath);
551 _pFileNames = _pFolderEntryPM->GetFolderEntryList();
553 _pFolderEntryPM->InitThumbnailManager();
554 TryCatch(_pFileNames != null, , "Failed to allocate Memory to __pFilenames");
559 if (_pListView != null && _pListView->IsVisible())
561 //Call UpdateList on __pListView
562 r = _pListView->UpdateList();
565 if (_pIconListView != null && _pIconListView->IsVisible())
567 _pIconListView->UpdateList();
570 AppLogDebug("EXIT: r = %s", GetErrorMessage(GetLastResult()));
578 SubFolderMoveCopy::GetParentDirectoryName(void)
580 String pPreviousParentPath;
581 pPreviousParentPath = FolderNavigationPresentationModel::GetParentPath();
582 return pPreviousParentPath;
586 SubFolderMoveCopy::SetNextDisplayPath(void)
588 AppLogDebug("ENTER");
592 String newDisplayPath;
597 String externalStorage;
598 AppResource* pAppResource = null;
599 pAppResource = UiApp::GetInstance()->GetAppResource();
600 if (pAppResource != null)
602 pAppResource->GetString(L"IDS_MF_TAB_PHONE", phone);
603 pAppResource->GetString(L"IDS_MF_TAB_MEMORY_CARD", sdCard);
604 pAppResource->GetString(L"IDS_MF_TAB_EXTERNAL_STORAGE", externalStorage);
607 externalStorage.Append(L"/");
609 _rootPath = FolderNavigationPresentationModel::GetCurrentPath();
610 StringTokenizer StrTok(_rootPath, delim);
613 switch (__storageType)
615 case MEMORY_TYPE_PHONE:
618 __displayPath = phone;
622 case MEMORY_TYPE_SD_CARD:
625 __displayPath = sdCard;
629 case MEMORY_TYPE_EXTERNAL:
632 __displayPath = externalStorage;
641 //Use a string tokenizer to get the filepath until it's the last token, break the loop when
642 //it is the last token
643 while (StrTok.HasMoreTokens())
648 StrTok.GetNextToken(token);
652 StrTok.GetNextToken(token);
653 dislayPath.Append(token);
654 dislayPath.Append(L"/");
658 newDisplayPath = __displayPath;
659 newDisplayPath.Append(dislayPath);
660 __displayPath = newDisplayPath;
663 DataBindingContext* pContext = GetDataBindingContextN();
664 if (pContext != null)
666 pContext->UpdateBinding(L"ID_DISPLAY_PATH", DATA_BINDING_DESTINATION_TYPE_TARGET);
672 if (_pDisplayPathLabel != null)
674 _pDisplayPathLabel->SetText(__displayPath);
675 _pDisplayPathLabel->Invalidate(true);
677 AppLogDebug("EXIT: r = %s", GetErrorMessage(GetLastResult()));
681 SubFolderMoveCopy::SetParentDisplayPath(void)
683 AppLogDebug("ENTER");
686 String parentDisplayPath;
689 if (_pDisplayPathLabel != null)
691 dislayPath = _pDisplayPathLabel->GetText();
694 StringTokenizer StrTok(dislayPath, delim);
696 //Use a string tokenizer to get the filepath until it's the last token, break the loop when
697 //it is the last token
698 while (StrTok.HasMoreTokens())
700 int tokenCount = StrTok.GetTokenCount();
704 StrTok.GetNextToken(token);
705 parentDisplayPath.Append(token);
706 parentDisplayPath.Append(L"/");
714 __displayPath = parentDisplayPath;
717 DataBindingContext* pContext = GetDataBindingContextN();
718 pContext->UpdateBinding(L"ID_DISPLAY_PATH", DATA_BINDING_DESTINATION_TYPE_TARGET);
722 if (_pDisplayPathLabel != null)
724 _pDisplayPathLabel->SetText(__displayPath);
725 _pDisplayPathLabel->Invalidate(true);
728 AppLogDebug("EXIT: r = %s", GetErrorMessage(GetLastResult()));
732 SubFolderMoveCopy::OnDataBindingSourceUpdated(const String& bindingId, const String& controlName, const Tizen::Base::String& propertyName)
734 //Empty Implementation.
738 SubFolderMoveCopy::OnDataBindingTargetUpdated(const String& bindingId, const String& controlName, const Tizen::Base::String& propertyName)
740 //Empty Implementation.
743 SubFolderMoveCopy::OnDataBindingValidationFailed(const Tizen::Base::String& bindingId, const Tizen::Base::String& controlName, const Tizen::Base::String& propertyName, Tizen::Ui::DataBindingDestinationType destType)
745 //Empty Implementation.
749 SubFolderMoveCopy::ShowHomeView(void)
752 AppLogDebug("Entry");
753 Integer* pSourceForm = null;
754 SceneManager* pSceneManager = SceneManager::GetInstance();
755 ArrayList* pArgs = null;
757 pArgs = new (std::nothrow) ArrayList();
758 //TryCatch(pArgs != null, , "pArgs is null.");
759 pSourceForm = new (std::nothrow) Integer(sourceFormOption);
761 //__pFolderEntryPM->SetFileEventListener(null);
765 pArgs->Add(pSourceForm);
767 //TryCatch(pSceneManager != null, , "SceneManager is null.");
769 /*if (__rootPath == BasePresentationModel::GetMediaPath() || __rootPath == BasePresentationModel::GetSdCardPath())
771 pSceneManager->GoForward(ForwardSceneTransition(IDSCN_ROOT_DIRECTORY_MOVE_COPY_FORM, SCENE_TRANSITION_ANIMATION_TYPE_RIGHT), pArgs);
775 pSceneManager->GoForward(ForwardSceneTransition(IDSCN_SUB_DIRECTORY_MOVE_COPY_FORM, SCENE_TRANSITION_ANIMATION_TYPE_RIGHT), pArgs);
778 //pSceneManager->GoForward(ForwardSceneTransition(IDSCN_SUB_DIRECTORY_MOVE_COPY_FORM, SCENE_TRANSITION_ANIMATION_TYPE_RIGHT), pArgs);
779 pSceneManager->GoForward(ForwardSceneTransition(IDSCN_TOP_LEVEL_DIRECTORY_COPY_MOVE_FORM, SCENE_TRANSITION_ANIMATION_TYPE_RIGHT, SCENE_HISTORY_OPTION_ADD_HISTORY, SCENE_DESTROY_OPTION_DESTROY),pArgs);
784 SubFolderMoveCopy::SetHeaderTitleText(Tizen::Base::String& filePath)
787 String parentFileName;
788 String delimiter(L"/");
789 StringTokenizer tokenizer(filePath, delimiter);
790 AppResource* pAppResource = null;
792 pAppResource = UiApp::App::GetInstance()->GetAppResource();
794 if (filePath == BasePresentationModel::GetMediaPath())
796 if (pAppResource != null)
798 pAppResource->GetString(L"IDS_MF_TAB_PHONE", parentFileName);
801 else if (filePath == BasePresentationModel::GetSdCardPath())
803 if (pAppResource != null)
805 pAppResource->GetString(L"IDS_MF_TAB_MEMORY_CARD", parentFileName);
810 while (tokenizer.HasMoreTokens())
812 int tokenCount = tokenizer.GetTokenCount();
816 tokenizer.GetNextToken(parentFileName);
820 tokenizer.GetNextToken(token);
824 __pHeader = GetHeader();
826 if (__pHeader != null)
828 if (!parentFileName.IsEmpty())
830 __pHeader->SetTitleText(parentFileName);
831 __pHeader->Invalidate(true);
832 __pHeader->Invalidate(true);
838 SubFolderMoveCopy::OnDeviceChange(ComponentType deviceType, const Tizen::Base::String& state)
840 bool setMediaPath = false;
841 MemoryType currentMemoryType = MEMORY_TYPE_PHONE;
842 String unmounted = sdCardStatusUnmounted;
843 String removed = usbDeviceStatusRemoved;
846 if (state == unmounted || state == removed)
848 currentPath = FolderNavigationPresentationModel::GetCurrentPath();
849 if (state == unmounted)
851 if (currentPath.Contains(BasePresentationModel::GetSdCardPath()))
853 FolderNavigationPresentationModel::SetCurrentFilePath(BasePresentationModel::GetMediaPath());
854 FolderNavigationPresentationModel::SetStorageType(currentMemoryType);
859 if (state == removed)
861 if (currentPath.Contains(BasePresentationModel::GetUsbPath()))
863 FolderNavigationPresentationModel::SetCurrentFilePath(BasePresentationModel::GetMediaPath());
864 FolderNavigationPresentationModel::SetStorageType(currentMemoryType);
871 SceneManager::GetInstance()->GoBackward(BackwardSceneTransition(IDSCN_TOP_LEVEL_DIRECTORY_COPY_MOVE_FORM, SCENE_TRANSITION_ANIMATION_TYPE_RIGHT, SCENE_DESTROY_OPTION_DESTROY), null);
876 SubFolderMoveCopy::OnDeviceStateChanged(Tizen::System::DeviceType deviceType, const Tizen::Base::String& state)
879 ComponentType currentDeviceType;
884 currentDeviceType = COMPONENT_TYPE_STORAGE_CARD;
890 currentDeviceType = COMPONENT_TYPE_USB;
900 OnDeviceChange(currentDeviceType, state);
904 SubFolderMoveCopy::OnSceneTransitionCompleted(const Tizen::Ui::Scenes::SceneId &previousSceneId,
905 const Tizen::Ui::Scenes::SceneId ¤tSceneId)
907 AppLogDebug("Enter");
909 result r = E_SUCCESS;
911 int listViewDisplayType = VIEW_TYPE_AS_NORMAL_LIST;
912 String viewStyleKeyName(L"ListDisplayType");
914 AppRegistry* pAppRegistry = null;
915 pAppRegistry = UiApp::App::GetInstance()->GetAppRegistry();
917 r = pAppRegistry->Get(viewStyleKeyName, listViewDisplayType);
918 AppLogDebug("AppRegistry Get Result: %s", GetErrorMessage(r));
920 SceneManager::GetInstance()->RemoveSceneManagerEventListener(*this);
922 switch (listViewDisplayType)
924 case VIEW_TYPE_AS_DETAILED_LIST:
926 if (_pIconListView != null && _pIconListView->IsVisible())
928 _pIconListView->SetShowState(false);
931 if (_pListView != null)
933 _pListView->ScrollToItem(0);
934 _pListView->UpdateList();
935 _pListView->SetShowState(true);
941 case VIEW_TYPE_AS_NORMAL_LIST:
943 if (_pIconListView != null && _pIconListView->IsVisible())
945 _pIconListView->SetShowState(false);
948 if (_pListView != null)
950 _pListView->ScrollToItem(0);
951 _pListView->UpdateList();
952 _pListView->SetShowState(true);
958 case VIEW_TYPE_AS_THUMBNAILS:
960 if (_pListView != null && _pListView->IsVisible())
962 _pListView->SetShowState(false);
965 if (_pIconListView != null)
967 _pIconListView->ScrollToItem(0);
968 _pIconListView->UpdateList();
969 _pIconListView->SetShowState(true);
977 __viewType = VIEW_TYPE_AS_NORMAL_LIST;
978 if (_pListView != null)
980 _pListView->ScrollToItem(0);
981 _pListView->UpdateList();
990 SubFolderMoveCopy::OnSceneTransitionStarted(const Tizen::Ui::Scenes::SceneId ¤tSceneId,
991 const Tizen::Ui::Scenes::SceneId &nextSceneId)
993 //Empty Implementation.
997 SubFolderMoveCopy::CreateFooterItems(void)
999 AppLogDebug("ENTER");
1000 result r = E_SUCCESS;
1001 _pFooter = GetFooter();
1002 int xPos = 0, yPos = 0;
1007 String btnPasteHere;
1008 //String btnCreateFolder;
1010 ButtonItem footerItemMenu;
1012 Bitmap* pBitmap = null;
1013 Bitmap* pBitmapPress = null;
1014 Bitmap* pBitmapDisabled = null;
1016 AppResource* pAppResource = null;
1017 pAppResource = Application::GetInstance()->GetAppResource();
1018 TryCatch(pAppResource != null, , "Resource manager not found!");
1020 pAppResource->GetString(L"IDS_MF_SK3_MOVE_HERE", btnMoveHere);
1021 pAppResource->GetString(L"IDS_MF_SK3_PASTE_HERE", btnPasteHere);
1022 //pAppResource->GetString(L"IDS_MF_OPT_CREATE_FOLDER", btnCreateFolder);
1024 footerItemMenu.Construct(BUTTON_ITEM_STYLE_ICON, IDA_BTN_MORE);
1025 _pFooter = GetFooter();
1027 pBitmap = pAppResource->GetBitmapN(IDB_MORE, BITMAP_PIXEL_FORMAT_ARGB8888);
1028 pBitmapDisabled = pAppResource->GetBitmapN(IDB_MORE_DISABLED, BITMAP_PIXEL_FORMAT_ARGB8888);
1029 pBitmapPress = pAppResource->GetBitmapN(IDB_MORE_PRESS, BITMAP_PIXEL_FORMAT_ARGB8888);
1031 if (pBitmap != null)
1033 pBitmap->Scale(Dimension(H_FOOTER_BUTTON_MORE, W_FOOTER_BUTTON_MORE));
1034 footerItemMenu.SetIcon(BUTTON_ITEM_STATUS_NORMAL, pBitmap);
1036 if (pBitmapPress != null)
1038 pBitmapPress->Scale(Dimension(H_FOOTER_BUTTON_MORE, W_FOOTER_BUTTON_MORE));
1039 footerItemMenu.SetIcon(BUTTON_ITEM_STATUS_PRESSED, pBitmapPress);
1041 if (pBitmapDisabled != null)
1043 pBitmapDisabled->Scale(Dimension(H_FOOTER_BUTTON_MORE, W_FOOTER_BUTTON_MORE));
1044 footerItemMenu.SetIcon(BUTTON_ITEM_STATUS_DISABLED, pBitmapDisabled);
1046 if (_pFooter != null)
1048 _pFooter->SetStyle(FOOTER_STYLE_BUTTON_TEXT);
1051 if (sourceFormOption.ToInt() == SELECT_MOVE_BUTTON)
1055 _pMove = new (std::nothrow) FooterItem();
1056 r = _pMove->Construct(IDA_BTN_MOVE);
1057 _pMove->SetText(btnMoveHere);
1059 if (_pFooter != null)
1061 r = _pFooter->AddItem(*_pMove);
1066 if (_pPaste == null)
1068 _pPaste = new (std::nothrow) FooterItem();
1069 r = _pPaste->Construct(IDA_BTN_PASTE);
1070 _pPaste->SetText(btnPasteHere);
1072 if (_pFooter != null)
1074 r = _pFooter->AddItem(*_pPaste);
1078 /* if (_pCreateFolder == null)
1080 _pCreateFolder = new (std::nothrow) FooterItem();
1081 r = _pCreateFolder->Construct(IDA_BTN_CREATE_FOLDER);
1082 _pCreateFolder->SetText(btnCreateFolder);
1084 /* if (_pFooter != null)
1086 r = _pFooter->AddItem(*_pCreateFolder);
1089 if (_pFooter != null)
1091 _pFooter->AddActionEventListener(*this);
1092 _pFooter->SetBackButton();
1093 _pFooter->SetBackButtonEnabled(true);
1094 _pFooter->SetShowState(true);
1095 _pFooter->Invalidate(true);
1096 SetFormBackEventListener(this);
1097 _pFooter->SetButton(BUTTON_POSITION_LEFT, footerItemMenu);
1098 _pFooter->GetPosition(xPos, yPos);
1100 _pMoreContextMenu = new (std::nothrow) ContextMenu();
1101 _pMoreContextMenu->Construct(Point(0, yPos), CONTEXT_MENU_STYLE_LIST);
1102 _pMoreContextMenu->AddActionEventListener(*this);
1105 delete pBitmapPress;
1106 delete pBitmapDisabled;
1107 AppLogDebug("EXIT: r = %s", GetErrorMessage(r));
1110 if (_pFooter != null)
1112 _pFooter->RemoveAllItems();
1115 AppLogDebug("CreateFooterCustomControls--");
1118 FolderEntryPresentationModel*
1119 SubFolderMoveCopy::GetFolderEntryPresentationModel(void)
1121 return _pFolderEntryPM;
1125 SubFolderMoveCopy::OnNotificationReceived(ArrayList* pArgs)
1127 AppLogDebug("ENTER");
1129 int fileProcessingResult = 0;
1130 Integer* pfileProcessingResult = null;
1132 TryCatch(pArgs != null, , "Argument list received is invalid");
1134 pfileProcessingResult = (Integer*) pArgs->GetAt(0);
1135 if (pfileProcessingResult != null)
1137 //TryCatch(pArgs!=null ,,"Argument list received is invalid");
1138 fileProcessingResult = pfileProcessingResult->ToInt();
1140 delete pfileProcessingResult;
1142 switch (fileProcessingResult)
1144 case FILE_MANAGING_RESULT_COPYING_SUCCESS:
1146 HideFileProgressingPopup();
1147 LoadDirectoryForm();
1151 case FILE_MANAGING_RESULT_MOVING_SUCCESS:
1153 HideFileProgressingPopup();
1154 LoadDirectoryForm();
1158 case FILE_MANAGING_RESULT_DUPLICITY:
1160 HideFileProgressingPopup();
1161 //ShowFileExistingPopup();
1165 case FILE_MANAGING_RESULT_SOURCE_SAME_AS_DESTINATION:
1167 HideFileProgressingPopup();
1168 MessageBox messageBox;
1169 String moveFailedErrorMessage;
1170 String copyFailedErrorMessage;
1172 AppResource::GetInstance()->GetString(L"IDS_MF_POP_UNABLE_TO_MOVE_DESTINATION_FOLDER_SAME_AS_SOURCE_FOLDER", moveFailedErrorMessage);
1173 AppResource::GetInstance()->GetString(L"IDS_MF_POP_UNABLE_TO_COPY_DESTINATION_FOLDER_SAME_AS_SOURCE_FOLDER", copyFailedErrorMessage);
1175 if (sourceFormOption.ToInt() == SELECT_MOVE_BUTTON)
1177 messageBox.Construct(L"", moveFailedErrorMessage, MSGBOX_STYLE_NONE, ID_MESSAGE_BOX_TIMEOUT_ONE_SECOND);
1181 messageBox.Construct(L"", copyFailedErrorMessage, MSGBOX_STYLE_NONE, ID_MESSAGE_BOX_TIMEOUT_ONE_SECOND);
1184 // Call ShowAndWait - draw, show itself and process events
1185 int modalResult = 0;
1186 messageBox.ShowAndWait(modalResult);
1190 case FILE_MANAGING_RESULT_CURRENT_STATUS:
1192 String movingLabelText;
1193 String copyingLabelText;
1194 Integer* percentage = null;
1196 AppResource* pAppResource = null;
1197 pAppResource = Application::GetInstance()->GetAppResource();
1199 pAppResource->GetString("IDS_COM_POP_MOVING", movingLabelText);
1200 pAppResource->GetString("IDS_MF_POP_COPYING", copyingLabelText);
1202 String strFileProcessCount(L"");
1203 if (pArgs->GetCount() > 1)
1205 Integer* pCurrentStatus = (Integer*) pArgs->GetAt(1);
1206 Integer* pTotalFileCount = (Integer*) pArgs->GetAt(2);
1207 HashMap* pCacheList = null;
1208 const HashMap* pSelectedItemsList = null;
1209 int deleteItemcount = 0;
1211 DirectoryEntry* pCurrentEntry = null;
1212 bool cacheKeyStatus = false;
1215 AppLogDebug("items deleted %d",pCurrentStatus->ToInt());
1216 deleteItemcount = pCurrentStatus->ToInt();
1217 pCacheList = CacheManager::GetInstance()->GetCacheHashMap();
1218 pSelectedItemsList = FolderEntryEditorPresentationModel::GetInstance()->GetCheckedList();
1220 if (pCacheList != null && pSelectedItemsList != null)
1222 for (filesCount=0;filesCount<deleteItemcount;filesCount++)
1224 Integer currentKeyIndex = filesCount;
1225 pCurrentEntry = const_cast< DirectoryEntry* >(static_cast< const DirectoryEntry* >(pSelectedItemsList->GetValue(currentKeyIndex)));
1227 if (pCurrentEntry != null)
1229 cachePath = pCurrentEntry->GetFullFilePath();
1232 cacheKeyStatus = pCacheList->ContainsKey(cachePath);
1236 CacheManager::GetInstance()->RemoveCacheEntry(cachePath);
1241 percentage = (Integer *)pArgs->GetAt(3);
1242 value = percentage->ToInt();
1243 AppLogDebug("precentage vlaue is %d",value);
1244 if (pTotalFileCount != null)
1246 //value = (__fileManagedCount * 100) / (pTotalFileCount->ToInt());
1248 __fileManagedCount = pCurrentStatus->ToInt();
1249 strFileProcessCount.Append(__fileManagedCount);
1250 strFileProcessCount.Append(L"/");
1251 strFileProcessCount.Append(pTotalFileCount->ToInt());
1252 delete pCurrentStatus;
1253 delete pTotalFileCount;
1256 if (_pFileProgressingPopup != null)
1258 if (_pFileProgressingHeaderLabel != null)
1260 if (sourceFormOption.ToInt() == SELECT_MOVE_BUTTON)
1262 _pFileProgressingHeaderLabel->SetText(movingLabelText);
1263 _pFileProgressingHeaderLabel->Invalidate(true);
1266 if (sourceFormOption.ToInt() == SELECT_COPY_BUTTON)
1268 _pFileProgressingHeaderLabel->SetText(copyingLabelText);
1269 _pFileProgressingHeaderLabel->Invalidate(true);
1272 if (_pFileProgressingProgress != null)
1274 _pFileProgressingProgress->SetValue(value);
1275 _pFileProgressingProgress->Invalidate(true);
1278 if (_pFileProgressingLabel != null)
1280 _pFileProgressingLabel->SetText(strFileProcessCount);
1281 _pFileProgressingLabel->Invalidate(true);
1289 case FILE_MANAGING_RESULT_COPYING_FAILED:
1291 String copyingFailed;
1292 AppResource* pAppResource = null;
1293 pAppResource = Application::GetInstance()->GetAppResource();
1294 pAppResource->GetString("IDS_COPY_FAILED_MESSAGE", copyingFailed);
1296 HideFileProgressingPopup();
1298 MessageBox messageBox;
1299 //messageBox.Construct(L"", L"Not enough memory.\n Delete some items and try again", MSGBOX_STYLE_NONE, 1000);
1300 messageBox.Construct(L"", copyingFailed, MSGBOX_STYLE_NONE, ID_MESSAGE_BOX_TIMEOUT_ONE_SECOND);
1301 // Call ShowAndWait - draw, show itself and process events
1302 int modalResult = 0;
1303 messageBox.ShowAndWait(modalResult);
1305 String tempDeviceState;
1307 DeviceManager::GetState(DEVICE_TYPE_STORAGE_CARD,tempDeviceState);
1308 if(tempDeviceState == sdCardStatusUnmounted && deviceState == sdCardStatusMounted)
1310 SceneManager::GetInstance()->GoForward(ForwardSceneTransition(IDSCN_TOP_LEVEL_DIRECTORY_FORM, SCENE_TRANSITION_ANIMATION_TYPE_RIGHT, SCENE_HISTORY_OPTION_NO_HISTORY, SCENE_DESTROY_OPTION_DESTROY), null);
1314 LoadDirectoryForm();
1320 case FILE_MANAGING_RESULT_MOVING_FAILED:
1322 String movingFailed;
1323 AppResource* pAppResource = null;
1324 pAppResource = Application::GetInstance()->GetAppResource();
1325 pAppResource->GetString("IDS_COM_POP_MOVING_FAILED", movingFailed);
1327 HideFileProgressingPopup();
1329 MessageBox messageBox;
1330 //messageBox.Construct(L"", L"Not enough memory.\n Delete some items and try again", MSGBOX_STYLE_NONE, 1000);
1331 messageBox.Construct(L"", movingFailed, MSGBOX_STYLE_NONE, ID_MESSAGE_BOX_TIMEOUT_ONE_SECOND);
1332 // Call ShowAndWait - draw, show itself and process events
1333 int modalResult = 0;
1334 messageBox.ShowAndWait(modalResult);
1336 String tempDeviceState;
1337 DeviceManager::GetState(DEVICE_TYPE_STORAGE_CARD,tempDeviceState);
1338 AppLogDebug("cureent %ls",tempDeviceState.GetPointer());
1339 AppLogDebug("old device %ls",deviceState.GetPointer());
1340 if(tempDeviceState == sdCardStatusUnmounted && deviceState == sdCardStatusMounted)
1342 SceneManager::GetInstance()->GoForward(ForwardSceneTransition(IDSCN_TOP_LEVEL_DIRECTORY_FORM, SCENE_TRANSITION_ANIMATION_TYPE_RIGHT, SCENE_HISTORY_OPTION_NO_HISTORY, SCENE_DESTROY_OPTION_DESTROY), null);
1346 LoadDirectoryForm();
1351 case FILE_MANAGING_RESULT_STORAGE_FULL:
1354 AppResource* pAppResource = null;
1355 pAppResource = Application::GetInstance()->GetAppResource();
1356 pAppResource->GetString("IDS_STORAGE_FULL", storageFull);
1358 HideFileProgressingPopup();
1359 MessageBox messageBox;
1360 //messageBox.Construct(L"", L"Not enough memory.\n Delete some items and try again", MSGBOX_STYLE_NONE, 1000);
1361 messageBox.Construct(L"", storageFull, MSGBOX_STYLE_NONE, ID_MESSAGE_BOX_TIMEOUT_ONE_SECOND);
1362 // Call ShowAndWait - draw, show itself and process events
1363 int modalResult = 0;
1364 messageBox.ShowAndWait(modalResult);
1366 LoadDirectoryForm();
1377 pArgs->RemoveAll(false);
1382 AppLogDebug("EXIT");
1386 SubFolderMoveCopy::CreateFileProgressingPopup(void)
1388 AppLogDebug("Entry");
1389 result r = E_SUCCESS;
1390 _pFileProgressingPopup = new (std::nothrow) Popup();
1391 _pFileProgressingPopup->Construct(L"IDL_FILE_PROGRESSING_POPUP");
1392 if (_pFileProgressingPopup != null)
1394 //_pFileProgressingPopup->SetTitleText(L"FileProcessing");
1396 _pFileProgressingCancelButton = static_cast< Button* >(_pFileProgressingPopup->GetControl(L"IDC_CANCEL_BUTTON", true));
1397 if (_pFileProgressingCancelButton != null)
1399 _pFileProgressingCancelButton->SetActionId(IDA_BTN_ANIMATION_POPUP_CANCEL);
1400 _pFileProgressingCancelButton->AddActionEventListener(*this);
1401 _pFileProgressingCancelButton->SetShowState(true);
1404 _pFileProgressingProgress = static_cast< Progress* >(_pFileProgressingPopup->GetControl(L"IDC_PROGRESS_BAR", true));
1405 if (_pFileProgressingProgress != null)
1407 _pFileProgressingProgress->SetValue(0);
1410 _pFileProgressingHeaderLabel = static_cast< Label* >(_pFileProgressingPopup->GetControl(L"IDC_ANIMATION_HEADER", true));
1411 if (_pFileProgressingHeaderLabel != null)
1413 _pFileProgressingHeaderLabel->SetShowState(true);
1416 _pFileProgressingLabel = static_cast< Label* >(_pFileProgressingPopup->GetControl(L"IDC_ANIMATION_LABEL", true));
1417 if (_pFileProgressingLabel != null)
1419 _pFileProgressingLabel->SetShowState(true);
1422 AppLogDebug("EXIT: r = %s", GetErrorMessage(r));
1427 SubFolderMoveCopy::ShowFileProgressingPopup(void)
1429 String movingLabelText;
1430 String copyingLabelText;
1431 AppResource* pAppResource = null;
1432 pAppResource = Application::GetInstance()->GetAppResource();
1434 pAppResource->GetString("IDS_COM_POP_MOVING", movingLabelText);
1435 pAppResource->GetString("IDS_MF_POP_COPYING", copyingLabelText);
1437 CreateFileProgressingPopup();
1439 if (_pFileProgressingPopup != null)
1442 if (_pFileProgressingHeaderLabel != null)
1444 if (sourceFormOption.ToInt() == SELECT_MOVE_BUTTON)
1446 _pFileProgressingHeaderLabel->SetText(movingLabelText);
1447 _pFileProgressingHeaderLabel->Invalidate(true);
1450 if (sourceFormOption.ToInt() == SELECT_COPY_BUTTON)
1452 _pFileProgressingHeaderLabel->SetText(copyingLabelText);
1453 _pFileProgressingHeaderLabel->Invalidate(true);
1457 _pFileProgressingPopup->SetShowState(true);
1458 _pFileProgressingPopup->Show();
1463 SubFolderMoveCopy::HideFileProgressingPopup(void)
1465 if (_pFileProgressingPopup != null && _pFileProgressingPopup->IsVisible())
1467 _pFileProgressingPopup->SetShowState(false);
1469 delete _pFileProgressingPopup;
1470 _pFileProgressingPopup = null;
1475 SubFolderMoveCopy::LoadDirectoryForm(void)
1477 AppLogDebug("ENTER");
1478 result r = E_SUCCESS;
1479 ArrayList* pArg = null;
1481 SceneManager* pSceneManager = null;
1482 pSceneManager = SceneManager::GetInstance();
1484 FolderNavigationPresentationModel::SetCurrentFilePath(_rootPath);
1485 //if (_moveCopySource == MOVE_COPY_SOURCE_SUB_FOLDER)
1489 StringTokenizer strTok(_rootPath, delim);
1490 while (strTok.HasMoreTokens())
1492 strTok.GetNextToken(token);
1494 fileName.Append(token);
1495 pArg = new (std::nothrow) ArrayList();
1496 r = pArg->Construct();
1497 pArg->Add(&fileName);
1500 r = pSceneManager->GoForward(ForwardSceneTransition(IDSCN_SUB_DIRECTORY_FORM, SCENE_TRANSITION_ANIMATION_TYPE_LEFT, SCENE_HISTORY_OPTION_NO_HISTORY, SCENE_DESTROY_OPTION_DESTROY), pArg);
1501 AppLogDebug("EXIT: r = %s", GetErrorMessage(r));
1506 SubFolderMoveCopy::OnFileManagingStart(void)
1508 ShowFileProgressingPopup();
1512 SubFolderMoveCopy::OnFileManagingStop(FileManagingResult fileProcessingResult)
1518 SubFolderMoveCopy::OnFormBackRequested(Form& source)
1520 SceneManager* pSceneManager = SceneManager::GetInstance();
1521 ArrayList* pArgs = null;
1523 pArgs = new (std::nothrow) ArrayList();
1526 pArgs->Add(* new (std::nothrow) Integer(FILE_MANAGE_EDIT));
1528 if (pSceneManager != null)
1530 pSceneManager->GoBackward(BackwardSceneTransition(IDSCN_EDIT_FORM, SCENE_TRANSITION_ANIMATION_TYPE_LEFT, SCENE_DESTROY_OPTION_DESTROY), pArgs);
1536 SubFolderMoveCopy::LoadCreateFolderForm(void)
1538 //Load the CreateFolder view in the current directory.
1539 AppLogDebug("ENTER");
1540 result r = E_SUCCESS;
1541 ArrayList* pArg = null;
1542 Integer* pSourceSelected = null;
1543 SceneManager* pSceneManager = null;
1545 pSceneManager = SceneManager::GetInstance();
1546 //TryCatch(pSceneManager != null, , "failed to Get SceneManager instance");
1548 pArg = new (std::nothrow) ArrayList();
1549 r = pArg->Construct();
1551 pSourceSelected = new (std::nothrow) Integer(SELECT_CREATE_FOLDER);
1552 pArg->Add(pSourceSelected);
1554 pSceneManager->GoForward(ForwardSceneTransition(IDSCN_CREATE_FOLDER_FORM, SCENE_TRANSITION_ANIMATION_TYPE_LEFT), pArg);
1555 AppLogDebug("EXIT: r = %s", GetErrorMessage(r));
1561 SubFolderMoveCopy::OnThumbnailReceived(ThumbRequest* pThumbReq)
1563 result res = E_SUCCESS;
1564 ArrayList* pFileList = null;
1565 AppLogDebug("Enter");
1570 if (_pFolderEntryPM)
1572 pFileList = _pFolderEntryPM->GetFolderEntryList();
1573 if (pThumbReq != null)
1575 if (pThumbReq->GetCurrentSourceForm() != _pFolderEntryPM->GetSourceForm())
1577 if (pThumbReq->pBitmap != null)
1579 AppLogDebug("This Bitmap is not requested from same form");
1580 delete pThumbReq->pBitmap;
1588 if (pThumbReq->iRquestId < pFileList->GetCount())
1591 _pFolderEntryPM->OnThumbnailResponseReceived(pThumbReq->pBitmap, pThumbReq->iRquestId);
1593 if (_pListView && _pListView->IsVisible())
1595 res = _pListView->RefreshList(pThumbReq->iRquestId, LIST_REFRESH_TYPE_ITEM_MODIFY);
1597 else if (_pIconListView && _pIconListView->IsVisible())
1599 res = _pIconListView->RefreshList(pThumbReq->iRquestId, LIST_REFRESH_TYPE_ITEM_MODIFY);
1605 _pFolderEntryPM->OnThumbnailResponseFailed();
1608 AppLogDebug("Exit %s", GetErrorMessage(res));