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 //Get the label control from IDL_SUB_DIRECTORY
133 _pLabelDisplayPath = static_cast< Label* >(GetControl("IDC_LABEL_DISPLAY_PATH"));
134 TryCatch(_pLabelDisplayPath != null, , "Label is Null");
135 _pLabelDisplayPath->SetBounds(0, 0, GetClientAreaBounds().width, H_DISPLAY_PATH_LABEL);
137 //pAppResource->GetString(L"IDS_MF_BUTTON_HOME", buttonHome);
138 //pAppResource->GetString(L"IDS_MF_TAB_UP", buttonUp);
139 pAppResource->GetString(L"IDS_MF_OPT_SHOW_FILE_EXTENSION", _showExtension);
140 pAppResource->GetString(L"IDS_MF_TAB_PHONE", displayPath);
141 pAppResource->GetString(L"IDS_MF_OPT_HIDE_FILE_EXTENSION_ABB", _hideExtension);
142 pBitmapHomeButton = pAppResource->GetBitmapN(IDB_HOME_BUTTON_ICON, BITMAP_PIXEL_FORMAT_ARGB8888);
143 pBitmapUpButton = pAppResource->GetBitmapN(IDB_UP_BUTTON_ICON, BITMAP_PIXEL_FORMAT_ARGB8888);
144 pBitmapHomeButtonPress = pAppResource->GetBitmapN(IDB_HOME_BUTTON_ICON_PRESS, BITMAP_PIXEL_FORMAT_ARGB8888);
145 pBitmapUpButtonPress = pAppResource->GetBitmapN(IDB_UP_BUTTON_ICON_PRESS, BITMAP_PIXEL_FORMAT_ARGB8888);
146 extensionVisibility = fileExtenstionKeyName;
147 displayPath.Append("/");
149 SetFormMenuEventListener(this);
150 //Set FormBackEvent Listener
151 SetFormBackEventListener(this);
153 //Create the FooterControls of IDL_SUB_DIRECTORY
154 r = CreateFooterControls();
155 TryCatch(r == E_SUCCESS, , "Failed to create footer controls");
157 __pHeader = GetHeader();
159 if (__pHeader != null)
161 __pHomeButton = new (std::nothrow) ButtonItem();
162 __pHomeButton->Construct(BUTTON_ITEM_STYLE_TEXT, IDA_BTN_HOME);
163 __pHomeButton->SetBackgroundBitmap(BUTTON_ITEM_STATUS_NORMAL, pBitmapHomeButton);
164 __pHomeButton->SetBackgroundBitmap(BUTTON_ITEM_STATUS_PRESSED, pBitmapHomeButtonPress);
165 __pHomeButton->SetBackgroundBitmap(BUTTON_ITEM_STATUS_HIGHLIGHTED, pBitmapHomeButtonPress);
167 __pUpButton = new (std::nothrow) ButtonItem();
168 __pUpButton->Construct(BUTTON_ITEM_STYLE_TEXT, IDA_BTN_UP);
169 __pUpButton->SetBackgroundBitmap(BUTTON_ITEM_STATUS_NORMAL, pBitmapUpButton);
170 __pUpButton->SetBackgroundBitmap(BUTTON_ITEM_STATUS_PRESSED, pBitmapUpButtonPress);
171 __pUpButton->SetBackgroundBitmap(BUTTON_ITEM_STATUS_HIGHLIGHTED, pBitmapUpButtonPress);
173 __pHeader->SetButton(BUTTON_POSITION_LEFT, *__pHomeButton);
174 __pHeader->SetButton(BUTTON_POSITION_RIGHT, *__pUpButton);
175 __pHeader->AddActionEventListener(*this);
176 __pHeader->Invalidate(true);
179 _extensionKeyName.Append(extensionVisibility);
181 //Pointer for FileListPresentationModel object
182 _pFolderEntryPM = new (std::nothrow) FolderEntryPresentationModel();
183 TryCatch(_pFolderEntryPM != null, , "Content Manager not found!");
184 _pFolderEntryPM->Construct();
186 currentSceneId = SceneManager::GetInstance()->GetCurrentSceneId();
187 AppLogDebug("Current Scene Id : %S", currentSceneId.GetPointer());
189 createitemsource = CREATE_ITEM_SOURCE_SUB_FOLDER_FILE_LIST;
191 _pFileManager = FolderEntryEditorPresentationModel::GetInstance();
192 TryCatch(_pFileManager != null, , "File Manager not found!");
194 //String that contains the path of the file to be displayed on the ListView
195 _displayPath = displayPath;
197 path = BasePresentationModel::GetMediaPath();
198 __currentDirectoryPath.Append(path);
200 //Initialize the itemprovider class for the listview inside the popup
201 if (_pCustomListViewForPopup == null)
203 _pCustomListViewForPopup = new (std::nothrow) CustomListViewForPopup();
205 TryCatch(_pCustomListViewForPopup != null, , "MfMyFilesApp::ListView For Popup not created!");
207 _pCustomListViewForPopup->SetEventListener(this);
209 _pBaseItemProvider = new (std::nothrow) BaseItemProvider();
210 TryCatch(_pBaseItemProvider != null, , "Failed to allocate base itemprovider");
211 _pBaseItemProvider->Construct();
212 _pBaseItemProvider->SetSourceForm(createitemsource);
213 _pBaseItemProvider->SetFolderEntryProvider(this);
214 _pBaseItemProvider->SetFooterItemStateChangeListener(this);
216 //Get the ListView Control from IDL_SUB_DIRECTORY and set the ItemProvider and Listener
217 _pListView = static_cast< ListView* >(GetControl("IDC_LISTVIEW"));
218 TryCatch(_pListView != null, , "__pListView is Null");
219 _pListView->AddListViewItemEventListener(*this);
220 _pListView->SetItemProvider(*_pBaseItemProvider);
221 _pListView->SetShowState(false);
223 if (_pThumbnailItemProvider == null)
225 _pThumbnailItemProvider = new (std::nothrow) ThumbnailItemProviderAndListener(__currentDirectoryPath, sourceForm);
226 _pThumbnailItemProvider->SetFolderEntryProvider(this);
228 TryCatch(_pThumbnailItemProvider != null, , "Failed to allocate Memory to __pSubFolderThumbnailsProvider");
230 _pThumbnailItemProvider->SetFooterItemStateChangeListener(this);
232 _pIconListView = static_cast< IconListView* >(GetControl("IDC_ICONLISTVIEW_SUB_DIRECTORY_THUMBNAILS"));
233 TryCatch(_pIconListView != null, , "__pIconListviewSubThumbnails is Null");
234 _pIconListView->AddIconListViewItemEventListener(*_pThumbnailItemProvider);
235 _pIconListView->AddTouchEventListener(*this);
236 _pIconListView->SetItemProvider(*_pThumbnailItemProvider);
237 _pIconListView->SetShowState(false);
240 _pLongPressGestureDetector = new (std::nothrow) TouchLongPressGestureDetector();
241 _pLongPressGestureDetector->Construct();
244 pContext = GetDataBindingContextN();
245 TryCatch(pContext != null, , "Failed to Fetch the DataBinding Context");
247 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);
252 delete pBitmapHomeButton;
253 delete pBitmapUpButton;
254 delete pBitmapHomeButtonPress;
255 delete pBitmapUpButtonPress;
256 AppLogDebug("EXIT: r = %s", GetErrorMessage(r));
261 if (_pCustomListViewForPopup != null)
263 delete _pCustomListViewForPopup;
264 _pCustomListViewForPopup = null;
267 if (pBitmapHomeButton != null)
269 delete pBitmapHomeButton;
270 pBitmapHomeButton = null;
273 if (pBitmapUpButton != null)
275 delete pBitmapUpButton;
276 pBitmapUpButton = null;
278 if (pBitmapHomeButtonPress != null)
280 delete pBitmapHomeButtonPress;
281 pBitmapHomeButtonPress = null;
283 if (pBitmapUpButtonPress != null)
285 delete pBitmapUpButtonPress;
286 pBitmapUpButtonPress = null;
292 SubFolderFileListForm::OnTerminating(void)
294 result r = E_SUCCESS;
295 //((MfMyFilesApp*)Application::GetInstance())->SetCurrentView(null);
297 _pFooter = GetFooter();
298 if (_pFooter != null)
300 _pFooter->RemoveAllButtons();
301 _pFooter->RemoveAllItems();
304 __pHeader = GetHeader();
305 if (__pHeader != null)
307 __pHeader->RemoveAllButtons();
308 __pHeader->RemoveAllItems();
315 SubFolderFileListForm::OnFormBackRequested(Tizen::Ui::Controls::Form& source)
317 AppLogDebug("Enter");
319 SceneManager* pSceneManager = SceneManager::GetInstance();
320 result r = E_SUCCESS;
327 AppLogDebug("Scene History");
328 bool searchHistory = CheckSearchHistory();
329 String currentPath = FolderNavigationPresentationModel::GetCurrentPath();
332 SceneManager* pSceneManager = SceneManager::GetInstance();
334 if (CheckSearchHistory() == true)
337 parentPath = FolderNavigationPresentationModel::GetSearchPreviousPath();
338 AppLogDebug("ParentPath is %S", parentPath.GetPointer());
339 FolderNavigationPresentationModel::SetCurrentFilePath(parentPath);
340 AppLogDebug("__previousSceneName is %S", __previousSceneName.GetPointer());
342 //pSceneManager->GoBackward(BackwardSceneTransition(SCENE_TRANSITION_ANIMATION_TYPE_RIGHT), null);
345 if (parentPath == currentPath)
347 pSceneManager->GoBackward(BackwardSceneTransition(IDSCN_SEARCH_FORM, SCENE_TRANSITION_ANIMATION_TYPE_RIGHT), null);
351 if (__previousSceneName == IDSCN_SUB_DIRECTORY_FORM1 || __previousSceneName == IDSCN_SUB_DIRECTORY_FORM)
353 String searchPath = FolderNavigationPresentationModel::GetCurrentPath();
355 FolderNavigationPresentationModel::SetSearchPreviousPath(searchPath);
356 if (SceneManager::GetInstance()->IsSceneAlive(__previousSceneName))
358 r = pSceneManager->GoForward(ForwardSceneTransition(SCENE_TRANSITION_ANIMATION_TYPE_RIGHT), null);
359 AppLogDebug("result is %s", GetErrorMessage(r));
363 pSceneManager->GoForward(ForwardSceneTransition(SCENE_TRANSITION_ANIMATION_TYPE_RIGHT), null);
364 AppLogDebug("result is %s", GetErrorMessage(r));
369 r = pSceneManager->GoBackward(BackwardSceneTransition(__previousSceneName, SCENE_TRANSITION_ANIMATION_TYPE_RIGHT), null);
370 AppLogDebug("result is %s", GetErrorMessage(r));
374 if (pSceneManager != null)
375 pSceneManager->GoBackward(BackwardSceneTransition(IDSCN_SEARCH_FORM, SCENE_TRANSITION_ANIMATION_TYPE_RIGHT), null);
379 //ShowParentDirectoryView();
380 currentPath = FolderNavigationPresentationModel::GetCurrentPath();
381 if (currentPath == BasePresentationModel::GetMediaPath() || currentPath == BasePresentationModel::GetSdCardPath())
383 FolderNavigationPresentationModel::SetCurrentFilePath(currentPath);
388 parentPath = FolderNavigationPresentationModel::GetParentPath();
390 FolderNavigationPresentationModel::SetCurrentFilePath(parentPath);
391 if (pSceneManager != null)
392 r = pSceneManager->GoForward(ForwardSceneTransition(SCENE_TRANSITION_ANIMATION_TYPE_RIGHT), null);
398 SubFolderFileListForm::OnSceneActivatedN(const Tizen::Ui::Scenes::SceneId& previousSceneId,
399 const Tizen::Ui::Scenes::SceneId& currentSceneId, Tizen::Base::Collection::IList* pArgs)
401 AppLogDebug("OnSceneActivatedN ENTER");
403 int listViewDisplayType = VIEW_TYPE_AS_NORMAL_LIST;
405 int sourceForm = THUMBNAIL_PROVIDER_SOURCEID_SUB_FOLDER_FILE_LIST_FORM;
406 CreateItemSource createitemsource = CREATE_ITEM_SOURCE_SUB_FOLDER_FILE_LIST;
408 result r = E_SUCCESS;
410 String viewStyleKeyName(L"ListDisplayType");
416 String received_Filepath;
417 String* pReceived_Filename = null;
418 int receivedStorageType = null;
420 AppRegistry* pAppRegistry = null;
421 AppResource* pAppResource = null;
423 pAppResource = UiApp::GetInstance()->GetAppResource();
424 TryCatch(pAppResource != null, , "Failed to fetch AppResource");
428 ((MyFilesApp*) Application::GetInstance())->SetCurrentView(this);
430 pAppRegistry = UiApp::App::GetInstance()->GetAppRegistry();
432 pAppResource->GetString(L"IDS_MF_TAB_PHONE", phone);
433 pAppResource->GetString(L"IDS_MF_TAB_MEMORY_CARD", sdCard);
434 pAppResource->GetString(L"IDS_MF_TAB_EXTERNAL_STORAGE", external);
438 external.Append(L"/");
440 SceneManager::GetInstance()->AddSceneManagerEventListener(*this);
441 DeviceManager::AddDeviceEventListener(DEVICE_TYPE_STORAGE_CARD, *this);
443 SetCurrentDirectoryFlag(false);
445 if (_pBaseItemProvider != null)
447 _pBaseItemProvider->SetSourceForm(createitemsource);
450 if (_pFileManager != null)
452 _pFileManager->SetFileManagingListener(this);
455 if (previousSceneId == IDSCN_CREATE_FOLDER_FORM)
457 if (_renameOrCreate == SELECT_RENAME)
463 receivedStorageType = FolderNavigationPresentationModel::GetStorageType();
465 if (_pLabelDisplayPath != null)
467 switch (receivedStorageType)
469 case MEMORY_TYPE_PHONE:
471 _displayPath = phone;
472 _storageType = MEMORY_TYPE_PHONE;
476 case MEMORY_TYPE_SD_CARD:
478 _displayPath = sdCard;
479 _storageType = MEMORY_TYPE_SD_CARD;
483 case MEMORY_TYPE_EXTERNAL:
485 _displayPath = external;
486 _storageType = MEMORY_TYPE_EXTERNAL;
498 r = pAppRegistry->Get(viewStyleKeyName, listViewDisplayType);
499 TryCatch(r == E_SUCCESS, , "Failed to get values from AppRegistry");
501 _flagViewAsStatus = listViewDisplayType;
503 if (_pMoreContextMenu != null)
505 _pMoreContextMenu->SetShowState(false);
511 DeviceManager::AddDeviceEventListener(DEVICE_TYPE_USB_CLIENT, *this);
517 pReceived_Filename = static_cast< String* >(pArgs->GetAt(0));
519 received_Filepath = FolderNavigationPresentationModel::GetCurrentPath();
520 receivedStorageType = FolderNavigationPresentationModel::GetStorageType();
522 if (pReceived_Filename != null)
524 check.Append(*pReceived_Filename);
525 __pHeader = GetHeader();
527 if (__pHeader != null)
529 __pHeader->SetTitleText(check);
530 __pHeader->Invalidate(true);
534 __currentDirectoryPath.Clear();
535 __currentDirectoryPath.Append(received_Filepath);
537 //Get the Directory Entries for the received Filepath.
538 if (_pFolderEntryPM != null)
541 _pFolderEntryPM->SetSourceForm(CREATE_ITEM_SOURCE_SUB_FOLDER_FILE_LIST);
543 AppLogDebug("Current Scene id is : %S",currentSceneId.GetPointer());
544 if ( _pFolderEntryPM !=null)
546 if( currentSceneId.CompareTo(L"ScnSubDirectoryForm"))
548 AppLogDebug("OnSceneIdChanged : %d",CREATE_ITEM_SOURCE_SUB_FOLDER_FILE_LIST );
549 _pFolderEntryPM->SetSourceForm(CREATE_ITEM_SOURCE_SUB_FOLDER_FILE_LIST);
551 else if (currentSceneId.CompareTo(L"ScnSubDirectoryForm1"))
553 AppLogDebug("OnSceneIdChanged : %d",CREATE_ITEM_SOURCE_SUB_FOLDER_FILE_LIST_TWO );
554 _pFolderEntryPM->SetSourceForm(CREATE_ITEM_SOURCE_SUB_FOLDER_FILE_LIST_TWO);
558 _pFolderEntryPM->SetFolderEntryPath(received_Filepath);
559 _pFilenames = _pFolderEntryPM->GetFolderEntryList();
560 TryCatch(_pFilenames != null, , "Failed to allocate Memory to __pFilenames");
564 if (_pThumbnailItemProvider != null)
566 _pThumbnailItemProvider->SetCreateItemSource(sourceForm);
567 _pThumbnailItemProvider->SetFolderEntryProvider(this);
570 SetNextDisplayPath();
571 SetHeaderTitleText(__currentDirectoryPath);
576 //Empty Arguments Received.
578 __currentDirectoryPath = FolderNavigationPresentationModel::GetCurrentPath();
579 parentPath.Append(__currentDirectoryPath);
581 SetNextDisplayPath();
582 SetHeaderTitleText(__currentDirectoryPath);
584 if (_pFolderEntryPM != null)
587 _pFolderEntryPM->SetSourceForm(CREATE_ITEM_SOURCE_SUB_FOLDER_FILE_LIST);
589 AppLogDebug("Current Scene id is : %S",currentSceneId.GetPointer());
591 if ( _pFolderEntryPM !=null)
593 if( currentSceneId.CompareTo(L"ScnSubDirectoryForm"))
595 AppLogDebug("OnSceneIdChanged : %d",CREATE_ITEM_SOURCE_SUB_FOLDER_FILE_LIST );
596 _pFolderEntryPM->SetSourceForm(CREATE_ITEM_SOURCE_SUB_FOLDER_FILE_LIST);
598 else if (currentSceneId.CompareTo(L"ScnSubDirectoryForm1"))
600 AppLogDebug("OnSceneIdChanged : %d",CREATE_ITEM_SOURCE_SUB_FOLDER_FILE_LIST_TWO );
601 _pFolderEntryPM->SetSourceForm(CREATE_ITEM_SOURCE_SUB_FOLDER_FILE_LIST_TWO);
605 _pFolderEntryPM->SetFolderEntryPath(parentPath);
606 _pFilenames = _pFolderEntryPM->GetFolderEntryList();
607 TryCatch(_pFilenames != null, , "Failed to allocate Memory to Filenames ArrayList");
610 if (_pThumbnailItemProvider != null)
612 _pThumbnailItemProvider->SetCreateItemSource(sourceForm);
613 _pThumbnailItemProvider->SetFolderEntryProvider(this);
617 //_pFileListPM->SetFileEventListener(this);
618 AppLogDebug("EXIT: r = %s", GetErrorMessage(r));
623 pArgs->RemoveAll(false);
631 pArgs->RemoveAll(false);
638 SubFolderFileListForm::OnActionPerformed(const Tizen::Ui::Control& source, int actionId)
640 AppLogDebug("ENTER");
642 result r = E_SUCCESS;
643 SceneManager* pSceneManager = null;
644 pSceneManager = SceneManager::GetInstance();
650 //Navigate to the TopFolderFileListForm.
652 homeRootPath.Append(__currentDirectoryPath);
654 while ((homeRootPath != BasePresentationModel::GetMediaPath()) && (homeRootPath != BasePresentationModel::GetSdCardPath()))
656 FolderNavigationPresentationModel::SetCurrentFilePath(homeRootPath);
657 homeRootPath.Clear();
658 homeRootPath = FolderNavigationPresentationModel::GetParentPath();
661 FolderNavigationPresentationModel::SetCurrentFilePath(homeRootPath);
663 r = pSceneManager->GoBackward(BackwardSceneTransition(IDSCN_TOP_LEVEL_DIRECTORY_FORM, SCENE_TRANSITION_ANIMATION_TYPE_RIGHT, SCENE_DESTROY_OPTION_DESTROY), null);
670 bool searchHistory = CheckSearchHistory();
672 //Navigate to the ParentForm.
675 __previousSceneName = SceneManager::GetInstance()->GetCurrentSceneId();
676 AppLogDebug("__previousSceneName is %S", __previousSceneName.GetPointer());
677 previousPath = FolderNavigationPresentationModel::GetCurrentPath();
678 AppLogDebug("previousPath is %S", previousPath.GetPointer());
679 FolderNavigationPresentationModel::SetSearchPreviousPath(previousPath);
681 ShowParentDirectoryView();
685 case IDA_CONTEXT_MENU_HIDE_EXTENSION:
687 __currentDirectoryPath.Clear();
688 __currentDirectoryPath = FolderNavigationPresentationModel::GetCurrentPath();
694 case IDA_CONTEXT_MENU_SHOW_EXTENSION:
696 __currentDirectoryPath.Clear();
697 __currentDirectoryPath = FolderNavigationPresentationModel::GetCurrentPath();
705 SubBaseOnActionPerformed(source, actionId);
709 AppLogDebug("EXIT: r = %s", GetErrorMessage(r));
713 SubFolderFileListForm::OnSceneDeactivated(const Tizen::Ui::Scenes::SceneId& currentSceneId,
714 const Tizen::Ui::Scenes::SceneId& nextSceneId)
716 ((MyFilesApp*)Application::GetInstance())->SetCurrentView(null);
719 DeviceManager::RemoveAllDeviceEventListeners();
721 if (_pIconListView != null)
723 _pIconListView->RemoveGestureDetector(_pLongPressGestureDetector);
726 TryReturn(_pFolderEntryPM!=null, , "FolderEntryPresentationModel is NULL") ;
727 //_pFolderEntryPM->StopThumbnailManager(true);
728 _pFolderEntryPM->SetCurrentReqId(0);
730 if(_pFileEventManager != null)
732 _pFileEventManager->RemovePath(__currentDirectoryPath);
733 delete _pFileEventManager;
734 _pFileEventManager = null;
740 SubFolderFileListForm::OnListViewItemStateChanged(Tizen::Ui::Controls::ListView& listView, int index, int elementId, Tizen::Ui::Controls::ListItemStatus status)
742 //When state is changed, push the parent filepath to the stack and save the selected path as
743 //root path so that listview can be refreshed to this path the next time. If Up button is click in
744 //the mean time, refresh the root path to be pushed to the parent path (changed in ShowParentView())
746 AppLogDebug("ENTER");
748 String tempRootMediaPath;
749 String filePathToPush;
751 bool searchHistory = false;
752 //result r = E_FAILURE;
753 DirectoryEntry* pDirStr = null;
755 ArrayList* pArgs = new (std::nothrow) ArrayList();
759 SceneId currentSceneId;
760 SceneManager* pSceneManager = SceneManager::GetInstance();
761 if (pSceneManager != null)
762 currentSceneId = pSceneManager->GetCurrentSceneId();
764 if (_pFilenames != null)
766 pDirStr = static_cast< DirectoryEntry* >(_pFilenames->GetAt(index));
769 //temprootmediapath gives the full file path of the selected item
770 tempRootMediaPath = pDirStr->GetFullFilePath();
772 if (pDirStr->IsDirectory())
774 //Append the name of the file to the existing path
775 nextFilename = pDirStr->GetFileName();
776 _currentFileName.Clear();
777 _currentFileName = pDirStr->GetFileName();
779 //tempRootMediaPath.Append(L"/");
780 //Set the full file path as future parent filepath, changed when Up button is
782 if (__currentDirectoryPath != null)
784 __currentDirectoryPath.Clear();
785 //__currentDirectoryPath.Append(tempRootMediaPath);
786 __currentDirectoryPath = pDirStr->GetFullFilePath();
788 FolderNavigationPresentationModel::SetCurrentFilePath(__currentDirectoryPath);
790 pArgs->Add(&nextFilename);
792 searchHistory = CheckSearchHistory();
795 searchPath = FolderNavigationPresentationModel::GetParentPath();
796 FolderNavigationPresentationModel::SetSearchPreviousPath(searchPath);
798 if (pSceneManager != null)
799 pSceneManager->GoForward(ForwardSceneTransition(SCENE_TRANSITION_ANIMATION_TYPE_LEFT), pArgs);
803 _indexTracker = index; //For OnFileEventOccured (RemoveCacheEntry)
804 _pathOfSelectedFile = tempRootMediaPath;
805 //It's not a directory, Launch the AppControl.
806 if (_pathOfSelectedFile.EndsWith(L".tpk") || _pathOfSelectedFile.EndsWith(L".wgt"))
808 String* pFileUriScheme = new (std::nothrow) String(L"file://");
809 pFileUriScheme->Append(_pathOfSelectedFile);
811 AppControl::FindAndStart(L"http://tizen.org/appcontrol/operation/view", pFileUriScheme, null, null, null, null);
812 delete pFileUriScheme;
816 CustomAppControl* pCustomAppControl = CustomAppControl::GetInstance();
817 if (pCustomAppControl != null)
821 pCustomAppControl->SetAppControlListener(this);
822 fileForAppControl = _pathOfSelectedFile;
823 AppControl* pAppControlInUse = pCustomAppControl->LaunchAppControl(_pathOfSelectedFile, this);
824 if (pAppControlInUse != null)
826 CustomAppControl::SetAppControlInUse(pAppControlInUse);
827 _bBackFromAppControl = true;
840 SubFolderFileListForm::ShowHomeView(void)
842 AppLogDebug("Enter");
843 SceneManager* pSceneManager = null;
844 result r = E_SUCCESS;
845 pSceneManager = SceneManager::GetInstance();
846 if (pSceneManager != null)
848 r = pSceneManager->GoBackward(BackwardSceneTransition(IDSCN_TOP_LEVEL_DIRECTORY_FORM, SCENE_TRANSITION_ANIMATION_TYPE_RIGHT, SCENE_DESTROY_OPTION_DESTROY), null);
849 TryCatch(r == E_SUCCESS, , "scene transition failed");
853 if (_pFolderEntryPM != null)
855 _pFolderEntryPM->InitThumbnailManager();
865 SubFolderFileListForm::SetParentDisplayPath(void)
867 //Sets the display path for the parent directory using the current path.
871 String parentDisplayPath;
874 DataBindingContext* pContext = null;
875 pContext = GetDataBindingContextN();
877 if (pContext != null)
879 //Update binding on the source to fetch the current display path.
880 pContext->UpdateBinding(L"ID_DISPLAY_PATH", DATA_BINDING_DESTINATION_TYPE_SOURCE);
884 StringTokenizer tokenizer(_displayPath, delim);
886 //Use a string tokenizer to get the filepath until it's the last token, break the loop when
887 //it is the last token
888 while (tokenizer.HasMoreTokens())
890 int tokenCount = tokenizer.GetTokenCount();
894 tokenizer.GetNextToken(token);
895 parentDisplayPath.Append(token);
896 parentDisplayPath.Append(L"/");
904 //Set the display path to that of the generated filepath from the tokenizer
905 _displayPath = parentDisplayPath;
907 if (_pLabelDisplayPath != null)
909 String displayPathToAppend(L"\x200E");
910 displayPathToAppend.Append(_displayPath);
912 _pLabelDisplayPath->SetText(displayPathToAppend);
913 _pLabelDisplayPath->Invalidate(true);
916 if (pContext != null)
918 //Update Binding on the Target control to display the currently constructed path.
919 pContext->UpdateBinding(L"ID_DISPLAY_PATH", DATA_BINDING_DESTINATION_TYPE_TARGET);
922 if (pContext != null)
930 SubFolderFileListForm::ShowParentDirectoryView(void)
932 AppLogDebug("ENTER");
933 //Shows the files of the above/parent directory
937 result r = E_SUCCESS;
942 String backUpCurrentPath;
944 backUpCurrentPath = FolderNavigationPresentationModel::GetCurrentPath();
946 displayPath = defaultPhoneBody;
947 displayPath.Append("/");
950 if (backUpCurrentPath == BasePresentationModel::GetMediaPath() || backUpCurrentPath == BasePresentationModel::GetSdCardPath() || backUpCurrentPath == BasePresentationModel::GetUsbPath())
952 //It is the homeview, so call showhomeview
954 TryCatch(r == E_SUCCESS, , "scene transition failed");
959 ParentPath = FolderNavigationPresentationModel::GetParentPath();
961 //RemovePath to remove FileEventListener
962 if(_pFileEventManager != null)
964 _pFileEventManager->RemovePath(__currentDirectoryPath);
966 __currentDirectoryPath.Clear();
967 __currentDirectoryPath.Append(ParentPath);
969 //AddPath to add FileEventListener for Parent Directory Path
970 if(_pFileEventManager != null)
972 _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 | FILE_EVENT_TYPE_DELETE_SELF);
975 FolderNavigationPresentationModel::SetCurrentFilePath(__currentDirectoryPath);
977 if (_pFolderEntryPM != null)
979 _pFolderEntryPM->GetFolderEntryCount(__currentDirectoryPath, folderCount, fileCount);
982 SetParentDisplayPath();
983 SetHeaderTitleText(ParentPath);
985 //Remove the current files from the filenames list
986 if (_pFolderEntryPM != null)
988 //__pContentManager->ClearList();
989 _pFolderEntryPM->SetFolderEntryPath(ParentPath);
990 _pFilenames = _pFolderEntryPM->GetFolderEntryList();
991 TryCatch(_pFilenames != null, , "Failed to fetch ArrayList from the ContentBrowser!");
995 _pFolderEntryPM->InitThumbnailManager();
999 SetFooterVisibility();
1001 //Get the files in the parent path of the current view
1003 //Update the icon list to view the files of the parent directory
1004 if (_pListView != null && _pListView->IsVisible())
1006 r = _pListView->UpdateList();
1008 else if (_pIconListView != null && _pIconListView->GetShowState())
1010 r = _pIconListView->UpdateList();
1013 AppLogDebug("EXIT: r = %s", GetErrorMessage(r));
1017 FolderNavigationPresentationModel::SetCurrentFilePath(backUpCurrentPath);
1022 SubFolderFileListForm::OnNotificationReceived(Tizen::Base::Collection::ArrayList* pArgs)
1024 AppLogDebug("Enter");
1026 Integer* pFileProcessingResult = null;
1029 TryCatch(pArgs != null, , "Argument list received is invalid!");
1030 pFileProcessingResult = (Integer*) pArgs->GetAt(0);
1032 TryCatch(pFileProcessingResult != null, , "FileProcessing Result list is invalid!");
1034 if (_pFileEventManager != null)
1036 _pFileEventManager->AddPath(FolderNavigationPresentationModel::GetCurrentPath(), FILE_EVENT_TYPE_CREATE | FILE_EVENT_TYPE_MOVED_FROM | FILE_EVENT_TYPE_MOVED_TO | FILE_EVENT_TYPE_DELETE | FILE_EVENT_TYPE_MOVE_SELF | FILE_EVENT_TYPE_DELETE_SELF);
1039 switch (pFileProcessingResult->ToInt())
1041 case FILE_MANAGING_RESULT_DELETING_SUCCESS:
1043 AppLogDebug("FILE DELETION SUCCESSFUL");
1044 _bIsDeleteFromContextSwipe = false;
1045 HideFileProgressingPopup();
1049 case FILE_MANAGING_RESULT_DELETING_FAILED:
1051 _bIsDeleteFromContextSwipe = false;
1052 HideFileProgressingPopup();
1055 case FILE_MANAGING_RESULT_THREAD_STOP:
1057 _bIsDeleteFromContextSwipe = false;
1058 HideFileProgressingPopup();
1068 _pFolderEntryPM->RefreshFolderEntries();
1069 _pFolderEntryPM->InitThumbnailManager(); //for thumbnail issues/disappering images/defulat images etc...
1072 if (_pListView->IsVisible() == true)
1073 _pListView->UpdateList();
1074 else if (_pIconListView->GetShowState() == true)
1075 _pIconListView->UpdateList();
1077 SetFooterVisibility();
1082 pArgs->RemoveAll(true);
1088 SubFolderFileListForm::OnDataBindingSourceUpdated(const Tizen::Base::String& bindingId, const Tizen::Base::String& controlName, const Tizen::Base::String& propertyName)
1090 //Empty Implementation.
1094 SubFolderFileListForm::OnDataBindingTargetUpdated(const Tizen::Base::String& bindingId, const Tizen::Base::String& controlName, const Tizen::Base::String& propertyName)
1096 //Empty Implementation.
1100 SubFolderFileListForm::OnDataBindingValidationFailed(const Tizen::Base::String& bindingId, const Tizen::Base::String& controlName, const Tizen::Base::String& propertyName, Tizen::Ui::DataBindingDestinationType destType)
1102 //Empty Implementation.
1106 SubFolderFileListForm::OnFileEventExecuted(const Tizen::Base::String& path, const unsigned long eventId)
1108 AppLogDebug("ENTER");
1110 int badgeNumber = 0;
1111 result r = E_SUCCESS;
1113 // Tizen::Shell::NotificationManager* pNotiMgr = null;
1115 NotificationManager* pNotiMgr = null;
1116 AppResource* pAppResource = null;
1117 pAppResource = UiApp::GetInstance()->GetAppResource();
1118 TryCatch(pAppResource != null, , "Failed to fetch AppResource");
1120 pNotiMgr = new (std::nothrow) NotificationManager();
1121 TryCatch(pNotiMgr != null, , "Failed to fetch AppNotificationManager");
1123 pNotiMgr->Construct();
1124 badgeNumber = pNotiMgr->GetBadgeNumber();
1127 if (_pFolderEntryPM != null)
1129 //_pFolderEntryPM->SetFileEventListener(null);
1130 _pFilenames = _pFolderEntryPM->GetFolderEntryList();
1131 TryCatch(_pFilenames != null, , "File Names List retrieval failed");
1136 case FILE_EVENT_TYPE_CREATE:
1138 if (_pListView != null && _pListView->IsVisible())
1140 _pListView->RefreshList(_pFilenames->GetCount() - 1, LIST_REFRESH_TYPE_ITEM_ADD);
1142 else if (_pIconListView != null && _pIconListView->GetShowState())
1144 _pIconListView->RefreshList(_pFilenames->GetCount() - 1, LIST_REFRESH_TYPE_ITEM_ADD);
1150 case FILE_EVENT_TYPE_DELETE:
1152 if (_pListView != null && _pListView->IsVisible())
1154 _pListView->RefreshList(__counter, LIST_REFRESH_TYPE_ITEM_REMOVE);
1156 else if (_pIconListView != null && _pIconListView->GetShowState())
1158 if (_pThumbnailItemProvider != null)
1160 __counter = _pThumbnailItemProvider->GetPressedIndex();
1162 _pIconListView->RefreshList(__counter, LIST_REFRESH_TYPE_ITEM_REMOVE);
1168 case FILE_EVENT_TYPE_DELETE_SELF:
1181 AppLogDebug("EXIT: r = %s", GetErrorMessage(r));
1183 if (pNotiMgr != null)
1191 if (pNotiMgr != null)
1200 SubFolderFileListForm::SetHeaderTitleText(Tizen::Base::String& filePath)
1203 String parentFileName;
1204 String delimiter(L"/");
1205 StringTokenizer tokenizer(filePath, delimiter);
1207 AppResource* pAppResource = null;
1209 pAppResource = UiApp::App::GetInstance()->GetAppResource();
1211 if (filePath == BasePresentationModel::GetMediaPath())
1213 if (pAppResource != null)
1215 pAppResource->GetString(L"IDS_MF_TAB_PHONE", parentFileName);
1218 else if (filePath == BasePresentationModel::GetSdCardPath())
1220 if (pAppResource != null)
1222 pAppResource->GetString(L"IDS_MF_TAB_MEMORY_CARD", parentFileName);
1227 while (tokenizer.HasMoreTokens())
1229 int tokenCount = tokenizer.GetTokenCount();
1231 if (tokenCount == 1)
1233 tokenizer.GetNextToken(parentFileName);
1237 tokenizer.GetNextToken(token);
1242 __pHeader = GetHeader();
1243 if (__pHeader != null)
1245 if (!parentFileName.IsEmpty())
1247 __pHeader->SetTitleText(parentFileName);
1248 __pHeader->Invalidate(true);
1254 SubFolderFileListForm::OnDeviceChange(ComponentType deviceType, const Tizen::Base::String& state)
1256 bool setMediaPath = false;
1257 MemoryType currentMemoryType = MEMORY_TYPE_PHONE;
1258 String unmounted = sdCardStatusUnmounted;
1259 String removed = usbDeviceStatusRemoved;
1262 SceneManager* pSceneManager = null;
1264 if (state == unmounted || state == removed)
1266 currentPath = FolderNavigationPresentationModel::GetCurrentPath();
1267 if (state == unmounted)
1269 if (currentPath.Contains(BasePresentationModel::GetSdCardPath()))
1271 FolderNavigationPresentationModel::SetCurrentFilePath(BasePresentationModel::GetMediaPath());
1272 FolderNavigationPresentationModel::SetStorageType(currentMemoryType);
1273 setMediaPath = true;
1277 if (state == removed)
1279 if (currentPath.Contains(BasePresentationModel::GetUsbPath()))
1281 FolderNavigationPresentationModel::SetCurrentFilePath(BasePresentationModel::GetMediaPath());
1282 FolderNavigationPresentationModel::SetStorageType(currentMemoryType);
1283 setMediaPath = true;
1289 pSceneManager = SceneManager::GetInstance();
1290 if (pSceneManager != null)
1292 pSceneManager->GoBackward(BackwardSceneTransition(IDSCN_TOP_LEVEL_DIRECTORY_FORM, SCENE_TRANSITION_ANIMATION_TYPE_RIGHT, SCENE_DESTROY_OPTION_DESTROY), null);
1299 SubFolderFileListForm::OnDeviceStateChanged(Tizen::System::DeviceType deviceType, const Tizen::Base::String& state)
1301 ComponentType currentDeviceType = COMPONENT_TYPE_NONE;
1306 currentDeviceType = COMPONENT_TYPE_STORAGE_CARD;
1312 currentDeviceType = COMPONENT_TYPE_USB;
1322 OnDeviceChange(currentDeviceType, state);
1326 SubFolderFileListForm::OnSceneTransitionCompleted (const Tizen::Ui::Scenes::SceneId &previousSceneId, const Tizen::Ui::Scenes::SceneId ¤tSceneId)
1328 AppLogDebug("Enter");
1330 AppRegistry* pAppRegistry = null;
1331 String sortbyKeyName(L"SortBy");
1332 int sortStyle = SORT_BY_TYPE_DATE_RECENT;
1334 int folderCount = 0;
1336 SceneManager::GetInstance()->RemoveSceneManagerEventListener(*this);
1337 pAppRegistry = UiApp::App::GetInstance()->GetAppRegistry();
1339 _pLongPressGestureDetector->AddLongPressGestureEventListener(*this);
1340 if (_pIconListView != null)
1342 _pIconListView->AddGestureDetector(*_pLongPressGestureDetector);
1345 if (_pFileEventManager != null)
1347 delete _pFileEventManager;
1348 _pFileEventManager = null;
1351 _pFileEventManager = new (std::nothrow)FileEventManager();
1352 _pFileEventManager->Construct(*this);
1354 _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 | FILE_EVENT_TYPE_DELETE_SELF);
1356 _pFolderEntryPM->GetFolderEntryCount(FolderNavigationPresentationModel::GetCurrentPath(),folderCount, fileCount);
1358 if (previousSceneId == IDSCN_CREATE_FOLDER_FORM)
1360 if (_renameOrCreate == SELECT_RENAME)
1362 if (pAppRegistry != null)
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 else if (_pIconListView != null && _pIconListView->GetShowState())
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 else if (_pIconListView != null && _pIconListView->GetShowState())
1389 _pIconListView->RefreshList(_renameIndex, LIST_REFRESH_TYPE_ITEM_MODIFY);
1393 SetFooterVisibility();
1399 if (CheckSearchHistory())
1401 __previousSceneName = previousSceneId;
1406 SetFooterVisibility();
1408 if (_pFolderEntryPM != null)
1410 _pFolderEntryPM->InitThumbnailManager();
1415 SubFolderFileListForm::OnSceneTransitionStarted (const Tizen::Ui::Scenes::SceneId ¤tSceneId, const Tizen::Ui::Scenes::SceneId &nextSceneId)
1417 //Empty Implementation.
1421 SubFolderFileListForm::OnOrientationChanged(const Control& source, OrientationStatus orientationStatus)
1423 AppLogDebug("ENTER");
1424 switch (orientationStatus)
1426 /*case ORIENTATION_STATUS_LANDSCAPE:
1428 SceneManager* pSceneManager = null;
1429 pSceneManager = SceneManager::GetInstance();
1430 if (pSceneManager != null)
1432 pSceneManager->GoForward(ForwardSceneTransition(IDSCN_SPLIT_PANEL_FORM, SCENE_TRANSITION_ANIMATION_TYPE_NONE), null);
1442 SubFolderFileListForm::OnFileEventOccured(const unsigned long events,const Tizen::Base::String & path, const unsigned int eventId)
1444 AppLogDebug("ENTRY:SubFolderFileListForm::OnFileEventOccured");
1446 HashMap* pCacheList = null;
1447 DirectoryEntry* pCurrentEntry = null;
1448 bool cacheKeyStatus = false;
1451 if ((events & FILE_EVENT_TYPE_CREATE) || (events & FILE_EVENT_TYPE_MOVED_FROM) || (events & FILE_EVENT_TYPE_MOVED_TO ))
1453 if ( events & FILE_EVENT_TYPE_MOVED_FROM)
1455 AppLogDebug("Items to delete: %d", _indexTracker);
1456 pCacheList = CacheManager::GetInstance()->GetCacheHashMap();
1457 if (pCacheList != null)
1459 pCurrentEntry = static_cast<DirectoryEntry*>(_pFilenames->GetAt(_indexTracker));
1461 if (pCurrentEntry != null)
1463 cachePath = pCurrentEntry->GetFullFilePath();
1466 cacheKeyStatus = pCacheList->ContainsKey(cachePath);
1470 CacheManager::GetInstance()->RemoveCacheEntry(cachePath);
1474 if (_pFolderEntryPM!=null)
1476 if (((MyFilesApp*) Application::GetInstance())->IsAppInBackground()==false) // App is running in foreground
1478 if (events & FILE_EVENT_TYPE_MOVED_FROM ) //Only refresh the list for deleting, as the refreshing the list have been taken care by OnNotificationReceived
1480 AppLogDebug("App is running in foreground");
1481 if (_pListView != null && _pListView->IsVisible())
1483 _pListView->UpdateList();
1485 else if (_pIconListView != null && _pIconListView->GetShowState())
1487 AppLogDebug("refresh iconlist view");
1488 _pIconListView->UpdateList();
1492 else //App is running in foreground but events is not delete or moved from.
1494 AppLogDebug("Refreshing Folder Entries : AppIsInForeground, but events are not delete|movedfrom");
1495 _pFolderEntryPM->RefreshFolderEntries();
1498 else //App is running in the background, OnNotificationReceived will not come, so do RefreshFolderEntries, update list and do InitThumbnail.
1500 HideFileProgressingPopup();
1501 HideDeleteConfirmationPopup();
1504 AppLogDebug("Refreshing Folder Entries : AppIsInBackground");
1505 _pFolderEntryPM->RefreshFolderEntries();
1509 if (_pListView != null && _pListView->IsVisible())
1511 _pListView->UpdateList();
1513 else if (_pIconListView != null && _pIconListView->GetShowState())
1515 _pIconListView->UpdateList();
1518 if (_pFolderEntryPM!=null && ( (events & FILE_EVENT_TYPE_CREATE) || (events & FILE_EVENT_TYPE_MOVED_TO)))
1520 _pFolderEntryPM->InitThumbnailManager();
1523 else if ((events & FILE_EVENT_TYPE_MOVE_SELF) || (events & FILE_EVENT_TYPE_DELETE) || (events & FILE_EVENT_TYPE_DELETE_SELF))
1525 //Navigate to the ParentForm.
1526 ShowParentDirectoryView();
1529 SetFooterVisibility();
1531 AppLogDebug("OnFileEventOccured: Exit");
1535 SubFolderFileListForm::OnContentScanCompleted (RequestId reqId, const Tizen::Base::String &scanPath, result r)
1537 AppLogDebug("Enter");
1538 AppLogDebug("Exit");
1542 SubFolderFileListForm::FlipSourceForm(void)
1544 AppLogDebug("Enter");
1545 Tizen::Ui::Scenes::SceneId currentSceneId = SceneManager::GetInstance()->GetCurrentSceneId();
1546 AppLogDebug("Current Scene id is : %S",currentSceneId.GetPointer());
1547 CreateItemSource sourceForm = CREATE_ITEM_SOURCE_NONE;
1549 if ( _pFolderEntryPM !=null)
1551 sourceForm = _pFolderEntryPM->GetSourceForm();
1553 if( currentSceneId.CompareTo(IDSCN_SUB_DIRECTORY_FORM) && sourceForm == CREATE_ITEM_SOURCE_SUB_FOLDER_FILE_LIST)
1555 AppLogDebug("OnSceneIdChanged : %d",CREATE_ITEM_SOURCE_SUB_FOLDER_FILE_LIST );
1556 _pFolderEntryPM->SetSourceForm(CREATE_ITEM_SOURCE_SUB_FOLDER_FILE_LIST_TWO);
1558 else if( currentSceneId.CompareTo(IDSCN_SUB_DIRECTORY_FORM) && sourceForm == CREATE_ITEM_SOURCE_SUB_FOLDER_FILE_LIST_TWO)
1560 AppLogDebug("OnSceneIdChanged : %d",CREATE_ITEM_SOURCE_SUB_FOLDER_FILE_LIST_TWO );
1561 _pFolderEntryPM->SetSourceForm(CREATE_ITEM_SOURCE_SUB_FOLDER_FILE_LIST);
1563 else if (currentSceneId.CompareTo(IDSCN_SUB_DIRECTORY_FORM1) && sourceForm == CREATE_ITEM_SOURCE_SUB_FOLDER_FILE_LIST_TWO)
1565 AppLogDebug("OnSceneIdChanged : %d",CREATE_ITEM_SOURCE_SUB_FOLDER_FILE_LIST_TWO );
1566 _pFolderEntryPM->SetSourceForm(CREATE_ITEM_SOURCE_SUB_FOLDER_FILE_LIST);
1568 else if (currentSceneId.CompareTo(IDSCN_SUB_DIRECTORY_FORM1) && sourceForm == CREATE_ITEM_SOURCE_SUB_FOLDER_FILE_LIST)
1570 AppLogDebug("OnSceneIdChanged : %d",CREATE_ITEM_SOURCE_SUB_FOLDER_FILE_LIST );
1571 _pFolderEntryPM->SetSourceForm(CREATE_ITEM_SOURCE_SUB_FOLDER_FILE_LIST_TWO);
1574 AppLogDebug("Exit");