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: MfSubFolderFileListForm.cpp
19 * @brief: This file contains the implementation of SubFolderFileListForm class, which acts as a media explorer displaying a list of all the files in the sub directories of the root directory opt/Media/
20 * and defines a set of operations that can be done with the files like edit, view etc.
23 #include "MfSubFolderFileListForm.h"
24 #include "MfSearchForm.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::Content;
31 using namespace Tizen::Graphics;
32 using namespace Tizen::Io;
33 using namespace Tizen::Locales;
34 using namespace Tizen::Media;
35 using namespace Tizen::System;
36 using namespace Tizen::Ui;
37 using namespace Tizen::Ui::Controls;
38 using namespace Tizen::Ui::Scenes;
40 SubFolderFileListForm::SubFolderFileListForm(void)
48 SubFolderFileListForm::~SubFolderFileListForm(void)
50 DeviceManager::RemoveDeviceEventListener(DEVICE_TYPE_STORAGE_CARD,*this);
51 if(_pFileEventManager != null)
53 _pFileEventManager->RemovePath(__currentDirectoryPath);
54 delete _pFileEventManager;
55 _pFileEventManager = null;
58 if (__pHomeButton != null)
63 if (__pUpButton != null)
69 SubFolderFileListForm&
70 SubFolderFileListForm::operator =(const SubFolderFileListForm& pSubFolderFileListForm)
75 SubFolderFileListForm::SubFolderFileListForm(const SubFolderFileListForm& pSubFolderFileListForm)
77 __pHomeButton = pSubFolderFileListForm.__pHomeButton;
78 __pUpButton = pSubFolderFileListForm.__pUpButton;
79 __pHeader = pSubFolderFileListForm.__pHeader;
80 _pLabelDisplayPath = pSubFolderFileListForm._pLabelDisplayPath;
84 SubFolderFileListForm::Initialize(void)
86 Form::Construct(L"IDL_SUB_DIRECTORY");
91 SubFolderFileListForm::OnInitializing(void)
93 AppLogDebug("SubFolderFileListForm::Initializing");
96 int sourceForm = THUMBNAIL_PROVIDER_SOURCEID_SUB_FOLDER_FILE_LIST_FORM;
97 CreateItemSource createitemsource = CREATE_ITEM_SOURCE_SUB_FOLDER_FILE_LIST;
100 String ThumbnailProviderPath;
101 String rootParentPath;
103 String extensionVisibility;
105 SceneId currentSceneId;
106 AppResource* pAppResource = null;
107 Bitmap* pBitmapHomeButton = null;
108 Bitmap* pBitmapUpButton = null;
109 Bitmap* pBitmapHomeButtonPress = null;
110 Bitmap* pBitmapUpButtonPress = null;
113 String SubDirectorySceneOne(L"ScnSubDirectoryForm"), SubDirecorySceneTwo(L"ScnSubDirectoryForm1");
116 _renameOrCreate = SELECT_CREATE_FOLDER;
120 DataBindingContext* pContext = null;
121 Bitmap* pHomeBitmap = null;
122 Bitmap* pUpBitmap = null;
125 Color formBgColor = GetBackgroundColor();
127 ((MyFilesApp*) Application::GetInstance())->SetCurrentView(this);
129 pAppResource = UiApp::App::GetInstance()->GetAppResource();
130 TryCatch(pAppResource != null, , "Resource manager not found!");
132 //Set FormBackEvent Listener
133 SetFormBackEventListener(this);
135 //Get the label control from IDL_SUB_DIRECTORY
136 _pLabelDisplayPath = static_cast< Label* >(GetControl("IDC_LABEL_DISPLAY_PATH"));
137 TryCatch(_pLabelDisplayPath != null, , "Label is Null");
138 _pLabelDisplayPath->SetBounds(0, 0, GetClientAreaBounds().width, H_DISPLAY_PATH_LABEL);
140 //pAppResource->GetString(L"IDS_MF_BUTTON_HOME", buttonHome);
141 //pAppResource->GetString(L"IDS_MF_TAB_UP", buttonUp);
142 pAppResource->GetString(L"IDS_MF_OPT_SHOW_FILE_EXTENSION", _showExtension);
143 pAppResource->GetString(L"IDS_MF_TAB_PHONE", displayPath);
144 pAppResource->GetString(L"IDS_MF_OPT_HIDE_FILE_EXTENSION_ABB", _hideExtension);
145 pBitmapHomeButton = pAppResource->GetBitmapN(IDB_HOME_BUTTON_ICON, BITMAP_PIXEL_FORMAT_ARGB8888);
146 pBitmapUpButton = pAppResource->GetBitmapN(IDB_UP_BUTTON_ICON, BITMAP_PIXEL_FORMAT_ARGB8888);
147 pBitmapHomeButtonPress = pAppResource->GetBitmapN(IDB_HOME_BUTTON_ICON_PRESS, BITMAP_PIXEL_FORMAT_ARGB8888);
148 pBitmapUpButtonPress = pAppResource->GetBitmapN(IDB_UP_BUTTON_ICON_PRESS, BITMAP_PIXEL_FORMAT_ARGB8888);
149 extensionVisibility = fileExtenstionKeyName;
150 displayPath.Append("/");
152 __pHeader = GetHeader();
154 if (__pHeader != null)
156 __pHomeButton = new (std::nothrow) ButtonItem();
157 __pHomeButton->Construct(BUTTON_ITEM_STYLE_TEXT, IDA_BTN_HOME);
158 __pHomeButton->SetBackgroundBitmap(BUTTON_ITEM_STATUS_NORMAL, pBitmapHomeButton);
159 __pHomeButton->SetBackgroundBitmap(BUTTON_ITEM_STATUS_PRESSED, pBitmapHomeButtonPress);
161 __pUpButton = new (std::nothrow) ButtonItem();
162 __pUpButton->Construct(BUTTON_ITEM_STYLE_TEXT, IDA_BTN_UP);
163 __pUpButton->SetBackgroundBitmap(BUTTON_ITEM_STATUS_NORMAL, pBitmapUpButton);
164 __pUpButton->SetBackgroundBitmap(BUTTON_ITEM_STATUS_PRESSED, pBitmapUpButtonPress);
166 __pHeader->SetButton(BUTTON_POSITION_LEFT, *__pHomeButton);
167 __pHeader->SetButton(BUTTON_POSITION_RIGHT, *__pUpButton);
168 __pHeader->AddActionEventListener(*this);
169 __pHeader->Invalidate(true);
172 _extensionKeyName.Append(extensionVisibility);
174 //Pointer for FileListPresentationModel object
175 _pFolderEntryPM = new (std::nothrow) FolderEntryPresentationModel();
176 TryCatch(_pFolderEntryPM != null, , "Content Manager not found!");
177 _pFolderEntryPM->Construct();
179 currentSceneId = SceneManager::GetInstance()->GetCurrentSceneId();
180 AppLogDebug("Current Scene Id : %S", currentSceneId.GetPointer());
182 createitemsource = CREATE_ITEM_SOURCE_SUB_FOLDER_FILE_LIST;
184 _pFileManager = FolderEntryEditorPresentationModel::GetInstance();
185 TryCatch(_pFileManager != null, , "File Manager not found!");
187 //String that contains the path of the file to be displayed on the ListView
188 _displayPath = displayPath;
190 path = BasePresentationModel::GetMediaPath();
191 __currentDirectoryPath.Append(path);
193 //Initialize the itemprovider class for the listview inside the popup
194 if (_pCustomListViewForPopup == null)
196 _pCustomListViewForPopup = new (std::nothrow) CustomListViewForPopup();
198 TryCatch(_pCustomListViewForPopup != null, , "MfMyFilesApp::ListView For Popup not created!");
200 _pCustomListViewForPopup->SetEventListener(this);
202 _pBaseItemProvider = new (std::nothrow) BaseItemProvider();
203 TryCatch(_pBaseItemProvider != null, , "Failed to allocate base itemprovider");
204 _pBaseItemProvider->Construct();
205 _pBaseItemProvider->SetSourceForm(createitemsource);
206 _pBaseItemProvider->SetFolderEntryProvider(this);
207 _pBaseItemProvider->SetFooterItemStateChangeListener(this);
209 //Get the ListView Control from IDL_SUB_DIRECTORY and set the ItemProvider and Listener
210 _pListView = static_cast< ListView* >(GetControl("IDC_LISTVIEW"));
211 TryCatch(_pListView != null, , "__pListView is Null");
212 _pListView->AddListViewItemEventListener(*this);
213 _pListView->SetItemProvider(*_pBaseItemProvider);
214 _pListView->SetShowState(false);
216 _pFooter = GetFooter();
218 if (_pThumbnailItemProvider == null)
220 _pThumbnailItemProvider = new (std::nothrow) ThumbnailItemProviderAndListener(__currentDirectoryPath, sourceForm);
221 _pThumbnailItemProvider->SetFolderEntryProvider(this);
223 TryCatch(_pThumbnailItemProvider != null, , "Failed to allocate Memory to __pSubFolderThumbnailsProvider");
225 _pThumbnailItemProvider->SetFooterItemStateChangeListener(this);
227 _pIconListView = static_cast< IconListView* >(GetControl("IDC_ICONLISTVIEW_SUB_DIRECTORY_THUMBNAILS"));
228 TryCatch(_pIconListView != null, , "__pIconListviewSubThumbnails is Null");
229 _pIconListView->AddIconListViewItemEventListener(*_pThumbnailItemProvider);
230 _pIconListView->AddTouchEventListener(*this);
231 _pIconListView->SetItemProvider(*_pThumbnailItemProvider);
233 _pLongPressGestureDetector = new (std::nothrow) TouchLongPressGestureDetector();
234 _pLongPressGestureDetector->Construct();
237 pContext = GetDataBindingContextN();
238 TryCatch(pContext != null, , "Failed to Fetch the DataBinding Context");
240 pContext->Bind(L"ID_DISPLAY_PATH", L"IDC_LABEL_DISPLAY_PATH", L"text", _displayPath, DATA_BINDING_DATA_TYPE_STRING, DATA_BINDING_FLOW_TWO_WAY, DATA_BINDING_TRIGGER_EXPLICIT, null, null, null);
245 delete pBitmapHomeButton;
246 delete pBitmapUpButton;
247 delete pBitmapHomeButtonPress;
248 delete pBitmapUpButtonPress;
249 AppLogDebug("EXIT: r = %s", GetErrorMessage(r));
254 if (_pCustomListViewForPopup != null)
256 delete _pCustomListViewForPopup;
257 _pCustomListViewForPopup = null;
260 if (pBitmapHomeButton != null)
262 delete pBitmapHomeButton;
263 pBitmapHomeButton = null;
266 if (pBitmapUpButton != null)
268 delete pBitmapUpButton;
269 pBitmapUpButton = null;
271 if (pBitmapHomeButtonPress != null)
273 delete pBitmapHomeButtonPress;
274 pBitmapHomeButtonPress = null;
276 if (pBitmapUpButtonPress != null)
278 delete pBitmapUpButtonPress;
279 pBitmapUpButtonPress = null;
285 SubFolderFileListForm::OnTerminating(void)
287 result r = E_SUCCESS;
288 //((MfMyFilesApp*)Application::GetInstance())->SetCurrentView(null);
290 _pFooter = GetFooter();
291 if (_pFooter != null)
293 _pFooter->RemoveAllButtons();
294 _pFooter->RemoveAllItems();
297 __pHeader = GetHeader();
298 if (__pHeader != null)
300 __pHeader->RemoveAllButtons();
301 __pHeader->RemoveAllItems();
308 SubFolderFileListForm::OnFormBackRequested(Tizen::Ui::Controls::Form& source)
310 SceneManager* pSceneManager = SceneManager::GetInstance();
311 result r = E_SUCCESS;
318 AppLogDebug("Scene History");
319 bool searchHistory = CheckSearchHistory();
320 String currentPath = FolderNavigationPresentationModel::GetCurrentPath();
323 SceneManager* pSceneManager = SceneManager::GetInstance();
325 if (CheckSearchHistory() == true)
328 parentPath = FolderNavigationPresentationModel::GetSearchPreviousPath();
329 AppLogDebug("ParentPath is %S", parentPath.GetPointer());
330 FolderNavigationPresentationModel::SetCurrentFilePath(parentPath);
331 AppLogDebug("__previousSceneName is %S", __previousSceneName.GetPointer());
333 //pSceneManager->GoBackward(BackwardSceneTransition(SCENE_TRANSITION_ANIMATION_TYPE_RIGHT), null);
336 if (parentPath == currentPath)
338 pSceneManager->GoBackward(BackwardSceneTransition(IDSCN_SEARCH_FORM, SCENE_TRANSITION_ANIMATION_TYPE_RIGHT), null);
342 if (__previousSceneName == IDSCN_SUB_DIRECTORY_FORM1 || __previousSceneName == IDSCN_SUB_DIRECTORY_FORM)
344 String searchPath = FolderNavigationPresentationModel::GetCurrentPath();
346 FolderNavigationPresentationModel::SetSearchPreviousPath(searchPath);
347 if (SceneManager::GetInstance()->IsSceneAlive(__previousSceneName))
349 r = pSceneManager->GoForward(ForwardSceneTransition(SCENE_TRANSITION_ANIMATION_TYPE_RIGHT), null);
350 AppLogDebug("result is %s", GetErrorMessage(r));
354 pSceneManager->GoForward(ForwardSceneTransition(SCENE_TRANSITION_ANIMATION_TYPE_RIGHT), null);
355 AppLogDebug("result is %s", GetErrorMessage(r));
360 r = pSceneManager->GoBackward(BackwardSceneTransition(__previousSceneName, SCENE_TRANSITION_ANIMATION_TYPE_RIGHT), null);
361 AppLogDebug("result is %s", GetErrorMessage(r));
365 pSceneManager->GoBackward(BackwardSceneTransition(IDSCN_SEARCH_FORM, SCENE_TRANSITION_ANIMATION_TYPE_RIGHT), null);
369 //ShowParentDirectoryView();
370 currentPath = FolderNavigationPresentationModel::GetCurrentPath();
371 if (currentPath == BasePresentationModel::GetMediaPath() || currentPath == BasePresentationModel::GetSdCardPath())
373 FolderNavigationPresentationModel::SetCurrentFilePath(currentPath);
378 parentPath = FolderNavigationPresentationModel::GetParentPath();
380 FolderNavigationPresentationModel::SetCurrentFilePath(parentPath);
381 r = pSceneManager->GoForward(ForwardSceneTransition(SCENE_TRANSITION_ANIMATION_TYPE_RIGHT), null);
387 SubFolderFileListForm::OnSceneActivatedN(const Tizen::Ui::Scenes::SceneId& previousSceneId,
388 const Tizen::Ui::Scenes::SceneId& currentSceneId, Tizen::Base::Collection::IList* pArgs)
390 AppLogDebug("OnSceneActivatedN ENTER");
392 int listViewDisplayType = VIEW_TYPE_AS_NORMAL_LIST;
394 int sourceForm = THUMBNAIL_PROVIDER_SOURCEID_SUB_FOLDER_FILE_LIST_FORM;
395 CreateItemSource createitemsource = CREATE_ITEM_SOURCE_SUB_FOLDER_FILE_LIST;
397 result r = E_SUCCESS;
399 String viewStyleKeyName(L"ListDisplayType");
405 String received_Filepath;
406 String* pReceived_Filename = null;
407 int receivedStorageType = null;
409 AppRegistry* pAppRegistry = null;
410 AppResource* pAppResource = null;
412 pAppResource = UiApp::GetInstance()->GetAppResource();
413 TryCatch(pAppResource != null, , "Failed to fetch AppResource");
416 //Create the FooterControls of IDL_SUB_DIRECTORY
417 r = CreateFooterControls();
418 TryCatch(r == E_SUCCESS, , "Failed to create footer controls");
420 ((MyFilesApp*) Application::GetInstance())->SetCurrentView(this);
422 pAppRegistry = UiApp::App::GetInstance()->GetAppRegistry();
424 pAppResource->GetString(L"IDS_MF_TAB_PHONE", phone);
425 pAppResource->GetString(L"IDS_MF_TAB_MEMORY_CARD", sdCard);
426 pAppResource->GetString(L"IDS_MF_TAB_EXTERNAL_STORAGE", external);
430 external.Append(L"/");
432 SceneManager::GetInstance()->AddSceneManagerEventListener(*this);
433 DeviceManager::AddDeviceEventListener(DEVICE_TYPE_STORAGE_CARD, *this);
435 SetCurrentDirectoryFlag(false);
437 if (_pBaseItemProvider != null)
439 _pBaseItemProvider->SetSourceForm(createitemsource);
442 if (_pFileManager != null)
444 _pFileManager->SetFileManagingListener(this);
447 if (previousSceneId == IDSCN_CREATE_FOLDER_FORM)
449 if (_renameOrCreate == SELECT_RENAME)
455 receivedStorageType = FolderNavigationPresentationModel::GetStorageType();
457 if (_pLabelDisplayPath != null)
459 switch (receivedStorageType)
461 case MEMORY_TYPE_PHONE:
463 _displayPath = phone;
464 _storageType = MEMORY_TYPE_PHONE;
468 case MEMORY_TYPE_SD_CARD:
470 _displayPath = sdCard;
471 _storageType = MEMORY_TYPE_SD_CARD;
475 case MEMORY_TYPE_EXTERNAL:
477 _displayPath = external;
478 _storageType = MEMORY_TYPE_EXTERNAL;
490 r = pAppRegistry->Get(viewStyleKeyName, listViewDisplayType);
491 TryCatch(r == E_SUCCESS, , "Failed to get values from AppRegistry");
493 _flagViewAsStatus = listViewDisplayType;
495 if (_pMoreContextMenu != null)
497 _pMoreContextMenu->SetShowState(false);
503 DeviceManager::AddDeviceEventListener(DEVICE_TYPE_USB_CLIENT, *this);
509 pReceived_Filename = static_cast< String* >(pArgs->GetAt(0));
511 received_Filepath = FolderNavigationPresentationModel::GetCurrentPath();
512 receivedStorageType = FolderNavigationPresentationModel::GetStorageType();
514 if (pReceived_Filename != null)
516 check.Append(*pReceived_Filename);
517 __pHeader = GetHeader();
519 if (__pHeader != null)
521 __pHeader->SetTitleText(check);
522 __pHeader->Invalidate(true);
526 __currentDirectoryPath.Clear();
527 __currentDirectoryPath.Append(received_Filepath);
529 //Get the Directory Entries for the received Filepath.
530 if (_pFolderEntryPM != null)
533 _pFolderEntryPM->SetSourceForm(CREATE_ITEM_SOURCE_SUB_FOLDER_FILE_LIST);
535 AppLogDebug("Current Scene id is : %S",currentSceneId.GetPointer());
536 if ( _pFolderEntryPM !=null)
538 if( currentSceneId.CompareTo(L"ScnSubDirectoryForm"))
540 AppLogDebug("OnSceneIdChanged : %d",CREATE_ITEM_SOURCE_SUB_FOLDER_FILE_LIST );
541 _pFolderEntryPM->SetSourceForm(CREATE_ITEM_SOURCE_SUB_FOLDER_FILE_LIST);
543 else if (currentSceneId.CompareTo(L"ScnSubDirectoryForm1"))
545 AppLogDebug("OnSceneIdChanged : %d",CREATE_ITEM_SOURCE_SUB_FOLDER_FILE_LIST_TWO );
546 _pFolderEntryPM->SetSourceForm(CREATE_ITEM_SOURCE_SUB_FOLDER_FILE_LIST_TWO);
550 _pFolderEntryPM->SetFolderEntryPath(received_Filepath);
551 _pFilenames = _pFolderEntryPM->GetFolderEntryList();
552 TryCatch(_pFilenames != null, , "Failed to allocate Memory to __pFilenames");
556 if (_pThumbnailItemProvider != null)
558 _pThumbnailItemProvider->SetCreateItemSource(sourceForm);
559 _pThumbnailItemProvider->SetFolderEntryProvider(this);
562 SetNextDisplayPath();
563 SetHeaderTitleText(__currentDirectoryPath);
568 //Empty Arguments Received.
570 __currentDirectoryPath = FolderNavigationPresentationModel::GetCurrentPath();
571 parentPath.Append(__currentDirectoryPath);
573 SetNextDisplayPath();
574 SetHeaderTitleText(__currentDirectoryPath);
576 if (_pFolderEntryPM != null)
579 _pFolderEntryPM->SetSourceForm(CREATE_ITEM_SOURCE_SUB_FOLDER_FILE_LIST);
581 AppLogDebug("Current Scene id is : %S",currentSceneId.GetPointer());
583 if ( _pFolderEntryPM !=null)
585 if( currentSceneId.CompareTo(L"ScnSubDirectoryForm"))
587 AppLogDebug("OnSceneIdChanged : %d",CREATE_ITEM_SOURCE_SUB_FOLDER_FILE_LIST );
588 _pFolderEntryPM->SetSourceForm(CREATE_ITEM_SOURCE_SUB_FOLDER_FILE_LIST);
590 else if (currentSceneId.CompareTo(L"ScnSubDirectoryForm1"))
592 AppLogDebug("OnSceneIdChanged : %d",CREATE_ITEM_SOURCE_SUB_FOLDER_FILE_LIST_TWO );
593 _pFolderEntryPM->SetSourceForm(CREATE_ITEM_SOURCE_SUB_FOLDER_FILE_LIST_TWO);
597 _pFolderEntryPM->SetFolderEntryPath(parentPath);
598 _pFilenames = _pFolderEntryPM->GetFolderEntryList();
599 TryCatch(_pFilenames != null, , "Failed to allocate Memory to Filenames ArrayList");
602 if (_pThumbnailItemProvider != null)
604 _pThumbnailItemProvider->SetCreateItemSource(sourceForm);
605 _pThumbnailItemProvider->SetFolderEntryProvider(this);
609 //_pFileListPM->SetFileEventListener(this);
610 AppLogDebug("EXIT: r = %s", GetErrorMessage(r));
615 pArgs->RemoveAll(false);
623 pArgs->RemoveAll(false);
630 SubFolderFileListForm::OnActionPerformed(const Tizen::Ui::Control& source, int actionId)
632 AppLogDebug("ENTER");
634 result r = E_SUCCESS;
635 SceneManager* pSceneManager = null;
636 pSceneManager = SceneManager::GetInstance();
642 //Navigate to the TopFolderFileListForm.
644 homeRootPath.Append(__currentDirectoryPath);
646 while ((homeRootPath != BasePresentationModel::GetMediaPath()) && (homeRootPath != BasePresentationModel::GetSdCardPath()))
648 FolderNavigationPresentationModel::SetCurrentFilePath(homeRootPath);
649 homeRootPath.Clear();
650 homeRootPath = FolderNavigationPresentationModel::GetParentPath();
653 FolderNavigationPresentationModel::SetCurrentFilePath(homeRootPath);
654 if (CheckSearchHistory())
656 r = pSceneManager->GoForward(ForwardSceneTransition(IDSCN_TOP_LEVEL_DIRECTORY_FORM, SCENE_TRANSITION_ANIMATION_TYPE_RIGHT), null);
660 r = pSceneManager->GoBackward(BackwardSceneTransition(IDSCN_TOP_LEVEL_DIRECTORY_FORM, SCENE_TRANSITION_ANIMATION_TYPE_RIGHT, SCENE_DESTROY_OPTION_DESTROY), null);
667 bool searchHistory = CheckSearchHistory();
669 //Navigate to the ParentForm.
672 __previousSceneName = SceneManager::GetInstance()->GetCurrentSceneId();
673 AppLogDebug("__previousSceneName is %S", __previousSceneName.GetPointer());
674 previousPath = FolderNavigationPresentationModel::GetCurrentPath();
675 AppLogDebug("previousPath is %S", previousPath.GetPointer());
676 FolderNavigationPresentationModel::SetSearchPreviousPath(previousPath);
678 ShowParentDirectoryView();
682 case IDA_CONTEXT_MENU_HIDE_EXTENSION:
684 __currentDirectoryPath.Clear();
685 __currentDirectoryPath = FolderNavigationPresentationModel::GetCurrentPath();
691 case IDA_CONTEXT_MENU_SHOW_EXTENSION:
693 __currentDirectoryPath.Clear();
694 __currentDirectoryPath = FolderNavigationPresentationModel::GetCurrentPath();
702 SubBaseOnActionPerformed(source, actionId);
706 AppLogDebug("EXIT: r = %s", GetErrorMessage(r));
710 SubFolderFileListForm::OnSceneDeactivated(const Tizen::Ui::Scenes::SceneId& currentSceneId,
711 const Tizen::Ui::Scenes::SceneId& nextSceneId)
713 ((MyFilesApp*)Application::GetInstance())->SetCurrentView(null);
716 DeviceManager::RemoveAllDeviceEventListeners();
718 if (_pIconListView != null)
720 _pIconListView->RemoveGestureDetector(_pLongPressGestureDetector);
723 TryReturn(_pFolderEntryPM!=null, , "FolderEntryPresentationModel is NULL") ;
724 //_pFolderEntryPM->StopThumbnailManager(true);
725 _pFolderEntryPM->SetCurrentReqId(0);
727 if(_pFileEventManager != null)
729 _pFileEventManager->RemovePath(__currentDirectoryPath);
730 delete _pFileEventManager;
731 _pFileEventManager = null;
737 SubFolderFileListForm::OnListViewItemStateChanged(Tizen::Ui::Controls::ListView& listView, int index, int elementId, Tizen::Ui::Controls::ListItemStatus status)
739 //When state is changed, push the parent filepath to the stack and save the selected path as
740 //root path so that listview can be refreshed to this path the next time. If Up button is click in
741 //the mean time, refresh the root path to be pushed to the parent path (changed in ShowParentView())
743 AppLogDebug("ENTER");
745 String tempRootMediaPath;
746 String filePathToPush;
748 bool searchHistory = false;
749 //result r = E_FAILURE;
750 DirectoryEntry* pDirStr = null;
752 ArrayList* pArgs = new (std::nothrow) ArrayList();
756 SceneManager* pSceneManager = SceneManager::GetInstance();
757 SceneId currentSceneId = pSceneManager->GetCurrentSceneId();
759 if (_pFilenames != null)
761 pDirStr = static_cast< DirectoryEntry* >(_pFilenames->GetAt(index));
764 //temprootmediapath gives the full file path of the selected item
765 tempRootMediaPath = pDirStr->GetFullFilePath();
767 if (pDirStr->IsDirectory())
769 //Append the name of the file to the existing path
770 nextFilename = pDirStr->GetFileName();
771 _currentFileName.Clear();
772 _currentFileName = pDirStr->GetFileName();
774 //tempRootMediaPath.Append(L"/");
775 //Set the full file path as future parent filepath, changed when Up button is
777 if (__currentDirectoryPath != null)
779 __currentDirectoryPath.Clear();
780 //__currentDirectoryPath.Append(tempRootMediaPath);
781 __currentDirectoryPath = pDirStr->GetFullFilePath();
783 FolderNavigationPresentationModel::SetCurrentFilePath(__currentDirectoryPath);
785 pArgs->Add(&nextFilename);
787 searchHistory = CheckSearchHistory();
790 searchPath = FolderNavigationPresentationModel::GetParentPath();
791 FolderNavigationPresentationModel::SetSearchPreviousPath(searchPath);
794 pSceneManager->GoForward(ForwardSceneTransition(SCENE_TRANSITION_ANIMATION_TYPE_LEFT), pArgs);
798 _indexTracker = index; //For OnFileEventOccured (RemoveCacheEntry)
799 _pathOfSelectedFile = tempRootMediaPath;
800 //It's not a directory, Launch the AppControl.
801 if (_pathOfSelectedFile.EndsWith(L".tpk") || _pathOfSelectedFile.EndsWith(L".wgt"))
803 String* pFileUriScheme = new (std::nothrow) String(L"file://");
804 pFileUriScheme->Append(_pathOfSelectedFile);
806 AppControl::FindAndStart(L"http://tizen.org/appcontrol/operation/view", pFileUriScheme, null, null, null, null);
807 delete pFileUriScheme;
811 CustomAppControl* pCustomAppControl = CustomAppControl::GetInstance();
812 if (pCustomAppControl != null)
816 pCustomAppControl->SetAppControlListener(null);
817 fileForAppControl = _pathOfSelectedFile;
818 AppControl* pAppControlInUse = pCustomAppControl->LaunchAppControl(_pathOfSelectedFile);
819 if (pAppControlInUse != null)
820 CustomAppControl::SetAppControlInUse(pAppControlInUse);
832 SubFolderFileListForm::ShowHomeView(void)
834 AppLogDebug("Enter");
835 SceneManager* pSceneManager = null;
836 result r = E_SUCCESS;
837 pSceneManager = SceneManager::GetInstance();
838 if (pSceneManager != null)
840 if (CheckSearchHistory())
842 r = pSceneManager->GoForward(ForwardSceneTransition(IDSCN_TOP_LEVEL_DIRECTORY_FORM, SCENE_TRANSITION_ANIMATION_TYPE_RIGHT), null);
843 TryCatch(r == E_SUCCESS, , "scene transition failed");
847 r = pSceneManager->GoBackward(BackwardSceneTransition(IDSCN_TOP_LEVEL_DIRECTORY_FORM, SCENE_TRANSITION_ANIMATION_TYPE_RIGHT, SCENE_DESTROY_OPTION_DESTROY), null);
848 TryCatch(r == E_SUCCESS, , "scene transition failed");
852 if (_pFolderEntryPM != null)
854 _pFolderEntryPM->InitThumbnailManager();
864 SubFolderFileListForm::SetParentDisplayPath(void)
866 //Sets the display path for the parent directory using the current path.
870 String parentDisplayPath;
873 DataBindingContext* pContext = null;
874 pContext = GetDataBindingContextN();
876 if (pContext != null)
878 //Update binding on the source to fetch the current display path.
879 pContext->UpdateBinding(L"ID_DISPLAY_PATH", DATA_BINDING_DESTINATION_TYPE_SOURCE);
883 StringTokenizer tokenizer(_displayPath, delim);
885 //Use a string tokenizer to get the filepath until it's the last token, break the loop when
886 //it is the last token
887 while (tokenizer.HasMoreTokens())
889 int tokenCount = tokenizer.GetTokenCount();
893 tokenizer.GetNextToken(token);
894 parentDisplayPath.Append(token);
895 parentDisplayPath.Append(L"/");
903 //Set the display path to that of the generated filepath from the tokenizer
904 _displayPath = parentDisplayPath;
906 if (_pLabelDisplayPath != null)
908 _pLabelDisplayPath->SetText(_displayPath);
909 _pLabelDisplayPath->Invalidate(true);
912 if (pContext != null)
914 //Update Binding on the Target control to display the currently constructed path.
915 pContext->UpdateBinding(L"ID_DISPLAY_PATH", DATA_BINDING_DESTINATION_TYPE_TARGET);
918 if (pContext != null)
926 SubFolderFileListForm::ShowParentDirectoryView(void)
928 AppLogDebug("ENTER");
929 //Shows the files of the above/parent directory
933 result r = E_SUCCESS;
938 String backUpCurrentPath;
940 backUpCurrentPath = FolderNavigationPresentationModel::GetCurrentPath();
942 displayPath = defaultPhoneBody;
943 displayPath.Append("/");
946 if (backUpCurrentPath == BasePresentationModel::GetMediaPath() || backUpCurrentPath == BasePresentationModel::GetSdCardPath() || backUpCurrentPath == BasePresentationModel::GetUsbPath())
948 //It is the homeview, so call showhomeview
950 TryCatch(r == E_SUCCESS, , "scene transition failed");
955 ParentPath = FolderNavigationPresentationModel::GetParentPath();
957 //RemovePath to remove FileEventListener
958 if(_pFileEventManager != null)
960 _pFileEventManager->RemovePath(__currentDirectoryPath);
962 __currentDirectoryPath.Clear();
963 __currentDirectoryPath.Append(ParentPath);
965 //AddPath to add FileEventListener for Parent Directory Path
966 if(_pFileEventManager != null)
968 _pFileEventManager->AddPath(__currentDirectoryPath, FILE_EVENT_TYPE_CREATE | FILE_EVENT_TYPE_MOVED_FROM | FILE_EVENT_TYPE_MOVED_TO | FILE_EVENT_TYPE_DELETE | FILE_EVENT_TYPE_MOVE_SELF);
971 FolderNavigationPresentationModel::SetCurrentFilePath(__currentDirectoryPath);
973 if (_pFolderEntryPM != null)
975 _pFolderEntryPM->GetFolderEntryCount(__currentDirectoryPath, folderCount, fileCount);
978 SetParentDisplayPath();
979 SetHeaderTitleText(ParentPath);
981 //Remove the current files from the filenames list
982 if (_pFolderEntryPM != null)
984 //__pContentManager->ClearList();
985 _pFolderEntryPM->SetFolderEntryPath(ParentPath);
986 _pFilenames = _pFolderEntryPM->GetFolderEntryList();
987 TryCatch(_pFilenames != null, , "Failed to fetch ArrayList from the ContentBrowser!");
991 _pFolderEntryPM->InitThumbnailManager();
995 if (_pFilenames->GetCount() == 0)
997 _bIsDirectoryEmpty = true;
1001 _bIsDirectoryEmpty = false;
1003 SetFooterVisibility();
1005 //Get the files in the parent path of the current view
1007 //Update the icon list to view the files of the parent directory
1008 if (_pListView != null && _pListView->IsVisible())
1010 r = _pListView->UpdateList();
1013 if (_pIconListView != null && _pIconListView->IsVisible())
1015 r = _pIconListView->UpdateList();
1018 AppLogDebug("EXIT: r = %s", GetErrorMessage(r));
1022 FolderNavigationPresentationModel::SetCurrentFilePath(backUpCurrentPath);
1027 SubFolderFileListForm::OnNotificationReceived(Tizen::Base::Collection::ArrayList* pArgs)
1029 AppLogDebug("Enter");
1031 Integer* pFileProcessingResult = null;
1034 TryCatch(pArgs != null, , "Argument list received is invalid!");
1035 pFileProcessingResult = (Integer*) pArgs->GetAt(0);
1037 TryCatch(pFileProcessingResult != null, , "FileProcessing Result list is invalid!");
1039 switch (pFileProcessingResult->ToInt())
1041 case FILE_MANAGING_RESULT_DELETING_SUCCESS:
1043 AppLogDebug("FILE DELETION SUCCESSFUL");
1044 HideFileProgressingPopup();
1048 case FILE_MANAGING_RESULT_DELETING_FAILED:
1050 HideFileProgressingPopup();
1053 case FILE_MANAGING_RESULT_THREAD_STOP:
1055 HideFileProgressingPopup();
1065 _pFolderEntryPM->RefreshFolderEntries();
1066 _pFolderEntryPM->InitThumbnailManager(); //for thumbnail issues/disappering images/defulat images etc...
1068 if (_pFolderEntryPM->GetFolderEntryList()->GetCount() == 0)
1070 _bIsDirectoryEmpty = true;
1074 _bIsDirectoryEmpty = false;
1077 _pListView->UpdateList();
1078 SetFooterVisibility();
1083 pArgs->RemoveAll(true);
1089 SubFolderFileListForm::OnDataBindingSourceUpdated(const Tizen::Base::String& bindingId, const Tizen::Base::String& controlName, const Tizen::Base::String& propertyName)
1091 //Empty Implementation.
1095 SubFolderFileListForm::OnDataBindingTargetUpdated(const Tizen::Base::String& bindingId, const Tizen::Base::String& controlName, const Tizen::Base::String& propertyName)
1097 //Empty Implementation.
1101 SubFolderFileListForm::OnDataBindingValidationFailed(const Tizen::Base::String& bindingId, const Tizen::Base::String& controlName, const Tizen::Base::String& propertyName, Tizen::Ui::DataBindingDestinationType destType)
1103 //Empty Implementation.
1107 SubFolderFileListForm::OnFileEventExecuted(const Tizen::Base::String& path, const unsigned long eventId)
1109 AppLogDebug("ENTER");
1111 int badgeNumber = 0;
1112 result r = E_SUCCESS;
1114 // Tizen::Shell::NotificationManager* pNotiMgr = null;
1116 NotificationManager* pNotiMgr = null;
1117 AppResource* pAppResource = null;
1118 pAppResource = UiApp::GetInstance()->GetAppResource();
1119 TryCatch(pAppResource != null, , "Failed to fetch AppResource");
1121 pNotiMgr = new (std::nothrow) NotificationManager();
1122 TryCatch(pNotiMgr != null, , "Failed to fetch AppNotificationManager");
1124 pNotiMgr->Construct();
1125 badgeNumber = pNotiMgr->GetBadgeNumber();
1128 if (_pFolderEntryPM != null)
1130 //_pFolderEntryPM->SetFileEventListener(null);
1131 _pFilenames = _pFolderEntryPM->GetFolderEntryList();
1132 TryCatch(_pFilenames != null, , "File Names List retrieval failed");
1137 case FILE_EVENT_TYPE_CREATE:
1139 if (_pListView != null && _pListView->IsVisible())
1141 _pListView->RefreshList(_pFilenames->GetCount() - 1, LIST_REFRESH_TYPE_ITEM_ADD);
1143 if (_pIconListView != null && _pIconListView->IsVisible())
1145 _pIconListView->RefreshList(_pFilenames->GetCount() - 1, LIST_REFRESH_TYPE_ITEM_ADD);
1151 case FILE_EVENT_TYPE_DELETE:
1153 if (_pListView != null && _pListView->IsVisible())
1155 _pListView->RefreshList(__counter, LIST_REFRESH_TYPE_ITEM_REMOVE);
1157 if (_pIconListView != null && _pIconListView->IsVisible())
1159 if (_pThumbnailItemProvider != null)
1161 __counter = _pThumbnailItemProvider->GetPressedIndex();
1163 _pIconListView->RefreshList(__counter, LIST_REFRESH_TYPE_ITEM_REMOVE);
1169 case FILE_EVENT_TYPE_DELETE_SELF:
1182 AppLogDebug("EXIT: r = %s", GetErrorMessage(r));
1184 if (pNotiMgr != null)
1192 if (pNotiMgr != null)
1201 SubFolderFileListForm::SetHeaderTitleText(Tizen::Base::String& filePath)
1204 String parentFileName;
1205 String delimiter(L"/");
1206 StringTokenizer tokenizer(filePath, delimiter);
1208 AppResource* pAppResource = null;
1210 pAppResource = UiApp::App::GetInstance()->GetAppResource();
1212 if (filePath == BasePresentationModel::GetMediaPath())
1214 if (pAppResource != null)
1216 pAppResource->GetString(L"IDS_MF_TAB_PHONE", parentFileName);
1219 else if (filePath == BasePresentationModel::GetSdCardPath())
1221 if (pAppResource != null)
1223 pAppResource->GetString(L"IDS_MF_TAB_MEMORY_CARD", parentFileName);
1228 while (tokenizer.HasMoreTokens())
1230 int tokenCount = tokenizer.GetTokenCount();
1232 if (tokenCount == 1)
1234 tokenizer.GetNextToken(parentFileName);
1238 tokenizer.GetNextToken(token);
1243 __pHeader = GetHeader();
1244 if (__pHeader != null)
1246 if (!parentFileName.IsEmpty())
1248 __pHeader->SetTitleText(parentFileName);
1249 __pHeader->Invalidate(true);
1255 SubFolderFileListForm::OnDeviceChange(ComponentType deviceType, const Tizen::Base::String& state)
1257 bool setMediaPath = false;
1258 MemoryType currentMemoryType = MEMORY_TYPE_PHONE;
1259 String unmounted = sdCardStatusUnmounted;
1260 String removed = usbDeviceStatusRemoved;
1263 SceneManager* pSceneManager = null;
1265 if (state == unmounted || state == removed)
1267 currentPath = FolderNavigationPresentationModel::GetCurrentPath();
1268 if (state == unmounted)
1270 if (currentPath.Contains(BasePresentationModel::GetSdCardPath()))
1272 FolderNavigationPresentationModel::SetCurrentFilePath(BasePresentationModel::GetMediaPath());
1273 FolderNavigationPresentationModel::SetStorageType(currentMemoryType);
1274 setMediaPath = true;
1278 if (state == removed)
1280 if (currentPath.Contains(BasePresentationModel::GetUsbPath()))
1282 FolderNavigationPresentationModel::SetCurrentFilePath(BasePresentationModel::GetMediaPath());
1283 FolderNavigationPresentationModel::SetStorageType(currentMemoryType);
1284 setMediaPath = true;
1290 pSceneManager = SceneManager::GetInstance();
1291 if (pSceneManager != null)
1293 pSceneManager->GoBackward(BackwardSceneTransition(IDSCN_TOP_LEVEL_DIRECTORY_FORM, SCENE_TRANSITION_ANIMATION_TYPE_RIGHT, SCENE_DESTROY_OPTION_DESTROY), null);
1300 SubFolderFileListForm::OnDeviceStateChanged(Tizen::System::DeviceType deviceType, const Tizen::Base::String& state)
1302 ComponentType currentDeviceType;
1307 currentDeviceType = COMPONENT_TYPE_STORAGE_CARD;
1313 currentDeviceType = COMPONENT_TYPE_USB;
1323 OnDeviceChange(currentDeviceType, state);
1327 SubFolderFileListForm::OnSceneTransitionCompleted (const Tizen::Ui::Scenes::SceneId &previousSceneId, const Tizen::Ui::Scenes::SceneId ¤tSceneId)
1329 AppLogDebug("Enter");
1331 AppRegistry* pAppRegistry = null;
1332 String sortbyKeyName(L"SortBy");
1333 int sortStyle = SORT_BY_TYPE_DATE_RECENT;
1335 int folderCount = 0;
1337 SceneManager::GetInstance()->RemoveSceneManagerEventListener(*this);
1338 pAppRegistry = UiApp::App::GetInstance()->GetAppRegistry();
1340 _pLongPressGestureDetector->AddLongPressGestureEventListener(*this);
1341 if (_pIconListView != null)
1343 _pIconListView->AddGestureDetector(*_pLongPressGestureDetector);
1346 if (_pFileEventManager != null)
1348 delete _pFileEventManager;
1349 _pFileEventManager = null;
1352 _pFileEventManager = new (std::nothrow)FileEventManager();
1353 _pFileEventManager->Construct(*this);
1355 _pFileEventManager->AddPath(__currentDirectoryPath, FILE_EVENT_TYPE_CREATE | FILE_EVENT_TYPE_MOVED_FROM | FILE_EVENT_TYPE_MOVED_TO | FILE_EVENT_TYPE_DELETE | FILE_EVENT_TYPE_MOVE_SELF);
1357 _pFolderEntryPM->GetFolderEntryCount(FolderNavigationPresentationModel::GetCurrentPath(),folderCount, fileCount);
1359 if (previousSceneId == IDSCN_CREATE_FOLDER_FORM)
1361 if (_renameOrCreate == SELECT_RENAME)
1363 pAppRegistry->Get(sortbyKeyName, sortStyle);
1365 if (sortStyle == SORT_BY_TYPE_NAME_ASCENDING || sortStyle == SORT_BY_TYPE_NAME_DESCENDING
1366 || sortStyle == SORT_BY_TYPE_DATE_OLDEST || sortStyle == SORT_BY_TYPE_DATE_RECENT)
1368 _pFolderEntryPM->SetFolderEntryPath(FolderNavigationPresentationModel::GetCurrentPath());
1369 _pFilenames = _pFolderEntryPM->GetFolderEntryList();
1371 if (_pListView != null && _pListView->IsVisible())
1373 _pListView->UpdateList();
1374 _pListView->ScrollToItem(0);
1376 if (_pIconListView != null && _pIconListView->IsVisible())
1378 _pIconListView->UpdateList();
1379 _pIconListView->ScrollToItem(0);
1381 _pFolderEntryPM->InitThumbnailManager();
1385 if (_pListView != null && _pListView->IsVisible())
1386 _pListView->RefreshList(_renameIndex, LIST_REFRESH_TYPE_ITEM_MODIFY);
1387 if (_pIconListView != null && _pIconListView->IsVisible())
1388 _pIconListView->RefreshList(_renameIndex, LIST_REFRESH_TYPE_ITEM_MODIFY);
1391 SetFooterVisibility();
1397 if (CheckSearchHistory())
1399 __previousSceneName = previousSceneId;
1404 SetFooterVisibility();
1406 if (_pFilenames->GetCount() == 0)
1408 _bIsDirectoryEmpty = true;
1412 _bIsDirectoryEmpty = false;
1415 if (_pFolderEntryPM != null)
1417 _pFolderEntryPM->InitThumbnailManager();
1422 SubFolderFileListForm::OnSceneTransitionStarted (const Tizen::Ui::Scenes::SceneId ¤tSceneId, const Tizen::Ui::Scenes::SceneId &nextSceneId)
1424 //Empty Implementation.
1428 SubFolderFileListForm::OnOrientationChanged(const Control& source, OrientationStatus orientationStatus)
1430 AppLogDebug("ENTER");
1431 switch (orientationStatus)
1433 case ORIENTATION_STATUS_LANDSCAPE:
1435 SceneManager* pSceneManager = null;
1436 pSceneManager = SceneManager::GetInstance();
1437 if (pSceneManager != null)
1439 pSceneManager->GoForward(ForwardSceneTransition(IDSCN_SPLIT_PANEL_FORM, SCENE_TRANSITION_ANIMATION_TYPE_NONE), null);
1449 SubFolderFileListForm::OnFileEventOccured(const unsigned long events,const Tizen::Base::String & path, const unsigned int eventId)
1451 AppLogDebug("OnFileEventOccured: %S", path.GetPointer());
1453 //Scan the directory
1455 HashMap* pCacheList = null;
1456 DirectoryEntry* pCurrentEntry = null;
1457 bool cacheKeyStatus = false;
1460 //result r = ContentManager::ScanDirectory(__currentDirectoryPath,true,null,reqId);
1461 //AppLogDebug("ContentManager::ScanDirectory:%s", GetErrorMessage(r));
1463 if ((events & FILE_EVENT_TYPE_CREATE) || (events & FILE_EVENT_TYPE_DELETE) || (events & FILE_EVENT_TYPE_MOVED_FROM) || (events & FILE_EVENT_TYPE_MOVED_TO ))
1465 _bBackFromAppControl = true;
1466 if ( (events & FILE_EVENT_TYPE_DELETE) || (events & FILE_EVENT_TYPE_MOVED_FROM))
1468 AppLogDebug("Items to delete: %d", _indexTracker);
1469 pCacheList = CacheManager::GetInstance()->GetCacheHashMap();
1470 if (pCacheList != null)
1472 pCurrentEntry = static_cast<DirectoryEntry*>(_pFilenames->GetAt(_indexTracker));
1474 if (pCurrentEntry != null)
1476 cachePath = pCurrentEntry->GetFullFilePath();
1479 cacheKeyStatus = pCacheList->ContainsKey(cachePath);
1483 CacheManager::GetInstance()->RemoveCacheEntry(cachePath);
1487 if (_pFolderEntryPM!=null)
1489 /*if ( (events & FILE_EVENT_TYPE_DELETE) || (events & FILE_EVENT_TYPE_MOVED_FROM) ) // for deleting only selected file, but this will not work when files are deleted using some other app
1490 _pFilenames->RemoveAt(_indexTracker);
1493 if (((MyFilesApp*) Application::GetInstance())->IsAppInBackground()==false) // App is running in foreground
1495 if ((events & FILE_EVENT_TYPE_DELETE) || (events & FILE_EVENT_TYPE_MOVED_FROM )) //Only refresh the list for deleting, as the refreshing the list have been taken care by OnNotificationReceived
1497 AppLogDebug("App is running in foreground");
1498 if (_pListView != null && _pListView->IsVisible())
1500 _pListView->UpdateList();
1503 if (_pIconListView != null && _pIconListView->IsVisible())
1505 AppLogDebug("refresh iconlist view");
1506 _pIconListView->UpdateList();
1510 else //App is running in foreground but events is not delete or moved from.
1512 AppLogDebug("Refreshing Folder Entries : AppIsInForeground, but events are not delete|movedfrom");
1513 _pFolderEntryPM->RefreshFolderEntries();
1516 else //App is running in the background, OnNotificationReceived will not come, so do RefreshFolderEntries, update list and do InitThumbnail.
1518 AppLogDebug("Refreshing Folder Entries : AppIsInBackground");
1519 _pFolderEntryPM->RefreshFolderEntries();
1523 if (_pListView != null && _pListView->IsVisible())
1525 _pListView->UpdateList();
1528 if (_pIconListView != null && _pIconListView->IsVisible())
1530 _pIconListView->UpdateList();
1533 if (_pFolderEntryPM!=null && ( (events & FILE_EVENT_TYPE_CREATE) || (events & FILE_EVENT_TYPE_MOVED_TO)))
1535 _pFolderEntryPM->InitThumbnailManager();
1538 else if (events & FILE_EVENT_TYPE_MOVE_SELF)
1540 FolderNavigationPresentationModel::SetCurrentFilePath(FolderNavigationPresentationModel::GetParentPath());
1541 SceneManager::GetInstance()->GoBackward(BackwardSceneTransition());
1545 AppLogDebug("OnFileEventOccured: Exit");
1549 SubFolderFileListForm::OnContentScanCompleted (RequestId reqId, const Tizen::Base::String &scanPath, result r)
1551 AppLogDebug("Enter");
1552 AppLogDebug("Exit");
1556 SubFolderFileListForm::FlipSourceForm(void)
1558 AppLogDebug("Enter");
1559 Tizen::Ui::Scenes::SceneId currentSceneId = SceneManager::GetInstance()->GetCurrentSceneId();
1560 AppLogDebug("Current Scene id is : %S",currentSceneId.GetPointer());
1561 CreateItemSource sourceForm = CREATE_ITEM_SOURCE_NONE;
1563 sourceForm = _pFolderEntryPM->GetSourceForm();
1565 if ( _pFolderEntryPM !=null)
1567 if( currentSceneId.CompareTo(IDSCN_SUB_DIRECTORY_FORM) && sourceForm == CREATE_ITEM_SOURCE_SUB_FOLDER_FILE_LIST)
1569 AppLogDebug("OnSceneIdChanged : %d",CREATE_ITEM_SOURCE_SUB_FOLDER_FILE_LIST );
1570 _pFolderEntryPM->SetSourceForm(CREATE_ITEM_SOURCE_SUB_FOLDER_FILE_LIST_TWO);
1572 else if( currentSceneId.CompareTo(IDSCN_SUB_DIRECTORY_FORM) && sourceForm == CREATE_ITEM_SOURCE_SUB_FOLDER_FILE_LIST_TWO)
1574 AppLogDebug("OnSceneIdChanged : %d",CREATE_ITEM_SOURCE_SUB_FOLDER_FILE_LIST_TWO );
1575 _pFolderEntryPM->SetSourceForm(CREATE_ITEM_SOURCE_SUB_FOLDER_FILE_LIST);
1577 else if (currentSceneId.CompareTo(IDSCN_SUB_DIRECTORY_FORM1) && sourceForm == CREATE_ITEM_SOURCE_SUB_FOLDER_FILE_LIST_TWO)
1579 AppLogDebug("OnSceneIdChanged : %d",CREATE_ITEM_SOURCE_SUB_FOLDER_FILE_LIST_TWO );
1580 _pFolderEntryPM->SetSourceForm(CREATE_ITEM_SOURCE_SUB_FOLDER_FILE_LIST);
1582 else if (currentSceneId.CompareTo(IDSCN_SUB_DIRECTORY_FORM1) && sourceForm == CREATE_ITEM_SOURCE_SUB_FOLDER_FILE_LIST)
1584 AppLogDebug("OnSceneIdChanged : %d",CREATE_ITEM_SOURCE_SUB_FOLDER_FILE_LIST );
1585 _pFolderEntryPM->SetSourceForm(CREATE_ITEM_SOURCE_SUB_FOLDER_FILE_LIST_TWO);
1588 AppLogDebug("Exit");