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;
326 ArrayList* pArgs = null;
328 AppLogDebug("Scene History");
329 bool searchHistory = CheckSearchHistory();
330 String currentPath = FolderNavigationPresentationModel::GetCurrentPath();
333 SceneManager* pSceneManager = SceneManager::GetInstance();
335 if (CheckSearchHistory() == true)
338 parentPath = FolderNavigationPresentationModel::GetSearchPreviousPath();
339 AppLogDebug("ParentPath is %S", parentPath.GetPointer());
340 FolderNavigationPresentationModel::SetCurrentFilePath(parentPath);
341 AppLogDebug("__previousSceneName is %S", __previousSceneName.GetPointer());
343 //pSceneManager->GoBackward(BackwardSceneTransition(SCENE_TRANSITION_ANIMATION_TYPE_RIGHT), null);
346 if (parentPath == currentPath)
348 pSceneManager->GoBackward(BackwardSceneTransition(IDSCN_SEARCH_FORM, SCENE_TRANSITION_ANIMATION_TYPE_RIGHT), null);
352 if (__previousSceneName == IDSCN_SUB_DIRECTORY_FORM1 || __previousSceneName == IDSCN_SUB_DIRECTORY_FORM)
354 String searchPath = FolderNavigationPresentationModel::GetCurrentPath();
356 FolderNavigationPresentationModel::SetSearchPreviousPath(searchPath);
357 if (SceneManager::GetInstance()->IsSceneAlive(__previousSceneName))
359 r = pSceneManager->GoForward(ForwardSceneTransition(SCENE_TRANSITION_ANIMATION_TYPE_RIGHT), null);
360 AppLogDebug("result is %s", GetErrorMessage(r));
364 pSceneManager->GoForward(ForwardSceneTransition(SCENE_TRANSITION_ANIMATION_TYPE_RIGHT), null);
365 AppLogDebug("result is %s", GetErrorMessage(r));
370 r = pSceneManager->GoBackward(BackwardSceneTransition(__previousSceneName, SCENE_TRANSITION_ANIMATION_TYPE_RIGHT), null);
371 AppLogDebug("result is %s", GetErrorMessage(r));
375 if (_bIsFileEventOccured == true)
377 //Create a dummy argument list to verify occurrence of File Event
378 pArgs = new (std::nothrow)ArrayList();
381 _bIsFileEventOccured = false;
384 if (pSceneManager != null)
386 pSceneManager->GoBackward(BackwardSceneTransition(IDSCN_SEARCH_FORM, SCENE_TRANSITION_ANIMATION_TYPE_RIGHT), pArgs);
391 //ShowParentDirectoryView();
392 currentPath = FolderNavigationPresentationModel::GetCurrentPath();
393 if (currentPath == BasePresentationModel::GetMediaPath() || currentPath == BasePresentationModel::GetSdCardPath())
395 FolderNavigationPresentationModel::SetCurrentFilePath(currentPath);
400 parentPath = FolderNavigationPresentationModel::GetParentPath();
402 FolderNavigationPresentationModel::SetCurrentFilePath(parentPath);
403 if (pSceneManager != null)
404 r = pSceneManager->GoForward(ForwardSceneTransition(SCENE_TRANSITION_ANIMATION_TYPE_RIGHT), null);
410 SubFolderFileListForm::OnSceneActivatedN(const Tizen::Ui::Scenes::SceneId& previousSceneId,
411 const Tizen::Ui::Scenes::SceneId& currentSceneId, Tizen::Base::Collection::IList* pArgs)
413 AppLogDebug("OnSceneActivatedN ENTER");
415 int listViewDisplayType = VIEW_TYPE_AS_NORMAL_LIST;
417 int sourceForm = THUMBNAIL_PROVIDER_SOURCEID_SUB_FOLDER_FILE_LIST_FORM;
418 CreateItemSource createitemsource = CREATE_ITEM_SOURCE_SUB_FOLDER_FILE_LIST;
420 result r = E_SUCCESS;
422 String viewStyleKeyName(L"ListDisplayType");
428 String received_Filepath;
429 String* pReceived_Filename = null;
430 int receivedStorageType = null;
432 AppRegistry* pAppRegistry = null;
433 AppResource* pAppResource = null;
435 pAppResource = UiApp::GetInstance()->GetAppResource();
436 TryCatch(pAppResource != null, , "Failed to fetch AppResource");
440 ((MyFilesApp*) Application::GetInstance())->SetCurrentView(this);
442 pAppRegistry = UiApp::App::GetInstance()->GetAppRegistry();
444 pAppResource->GetString(L"IDS_MF_TAB_PHONE", phone);
445 pAppResource->GetString(L"IDS_MF_TAB_MEMORY_CARD", sdCard);
446 pAppResource->GetString(L"IDS_MF_TAB_EXTERNAL_STORAGE", external);
450 external.Append(L"/");
452 SceneManager::GetInstance()->AddSceneManagerEventListener(*this);
453 DeviceManager::AddDeviceEventListener(DEVICE_TYPE_STORAGE_CARD, *this);
455 SetCurrentDirectoryFlag(false);
457 if (_pBaseItemProvider != null)
459 _pBaseItemProvider->SetSourceForm(createitemsource);
462 if (_pFileManager != null)
464 _pFileManager->SetFileManagingListener(this);
467 if (previousSceneId == IDSCN_CREATE_FOLDER_FORM)
469 if (_renameOrCreate == SELECT_RENAME)
475 receivedStorageType = FolderNavigationPresentationModel::GetStorageType();
477 if (_pLabelDisplayPath != null)
479 switch (receivedStorageType)
481 case MEMORY_TYPE_PHONE:
483 _displayPath = phone;
484 _storageType = MEMORY_TYPE_PHONE;
488 case MEMORY_TYPE_SD_CARD:
490 _displayPath = sdCard;
491 _storageType = MEMORY_TYPE_SD_CARD;
495 case MEMORY_TYPE_EXTERNAL:
497 _displayPath = external;
498 _storageType = MEMORY_TYPE_EXTERNAL;
510 r = pAppRegistry->Get(viewStyleKeyName, listViewDisplayType);
511 TryCatch(r == E_SUCCESS, , "Failed to get values from AppRegistry");
513 _flagViewAsStatus = listViewDisplayType;
515 if (_pMoreContextMenu != null)
517 _pMoreContextMenu->SetShowState(false);
523 DeviceManager::AddDeviceEventListener(DEVICE_TYPE_USB_CLIENT, *this);
529 pReceived_Filename = static_cast< String* >(pArgs->GetAt(0));
531 received_Filepath = FolderNavigationPresentationModel::GetCurrentPath();
532 receivedStorageType = FolderNavigationPresentationModel::GetStorageType();
534 if (pReceived_Filename != null)
536 check.Append(*pReceived_Filename);
537 __pHeader = GetHeader();
539 if (__pHeader != null)
541 __pHeader->SetTitleText(check);
542 __pHeader->Invalidate(true);
546 __currentDirectoryPath.Clear();
547 __currentDirectoryPath.Append(received_Filepath);
549 //Get the Directory Entries for the received Filepath.
550 if (_pFolderEntryPM != null)
553 _pFolderEntryPM->SetSourceForm(CREATE_ITEM_SOURCE_SUB_FOLDER_FILE_LIST);
555 AppLogDebug("Current Scene id is : %S",currentSceneId.GetPointer());
556 if ( _pFolderEntryPM !=null)
558 if( currentSceneId.CompareTo(L"ScnSubDirectoryForm"))
560 AppLogDebug("OnSceneIdChanged : %d",CREATE_ITEM_SOURCE_SUB_FOLDER_FILE_LIST );
561 _pFolderEntryPM->SetSourceForm(CREATE_ITEM_SOURCE_SUB_FOLDER_FILE_LIST);
563 else if (currentSceneId.CompareTo(L"ScnSubDirectoryForm1"))
565 AppLogDebug("OnSceneIdChanged : %d",CREATE_ITEM_SOURCE_SUB_FOLDER_FILE_LIST_TWO );
566 _pFolderEntryPM->SetSourceForm(CREATE_ITEM_SOURCE_SUB_FOLDER_FILE_LIST_TWO);
570 _pFolderEntryPM->SetFolderEntryPath(received_Filepath);
571 _pFilenames = _pFolderEntryPM->GetFolderEntryList();
572 TryCatch(_pFilenames != null, , "Failed to allocate Memory to __pFilenames");
576 if (_pThumbnailItemProvider != null)
578 _pThumbnailItemProvider->SetCreateItemSource(sourceForm);
579 _pThumbnailItemProvider->SetFolderEntryProvider(this);
582 SetNextDisplayPath();
583 SetHeaderTitleText(__currentDirectoryPath);
588 //Empty Arguments Received.
590 __currentDirectoryPath = FolderNavigationPresentationModel::GetCurrentPath();
591 parentPath.Append(__currentDirectoryPath);
593 SetNextDisplayPath();
594 SetHeaderTitleText(__currentDirectoryPath);
596 if (_pFolderEntryPM != null)
599 _pFolderEntryPM->SetSourceForm(CREATE_ITEM_SOURCE_SUB_FOLDER_FILE_LIST);
601 AppLogDebug("Current Scene id is : %S",currentSceneId.GetPointer());
603 if ( _pFolderEntryPM !=null)
605 if( currentSceneId.CompareTo(L"ScnSubDirectoryForm"))
607 AppLogDebug("OnSceneIdChanged : %d",CREATE_ITEM_SOURCE_SUB_FOLDER_FILE_LIST );
608 _pFolderEntryPM->SetSourceForm(CREATE_ITEM_SOURCE_SUB_FOLDER_FILE_LIST);
610 else if (currentSceneId.CompareTo(L"ScnSubDirectoryForm1"))
612 AppLogDebug("OnSceneIdChanged : %d",CREATE_ITEM_SOURCE_SUB_FOLDER_FILE_LIST_TWO );
613 _pFolderEntryPM->SetSourceForm(CREATE_ITEM_SOURCE_SUB_FOLDER_FILE_LIST_TWO);
617 _pFolderEntryPM->SetFolderEntryPath(parentPath);
618 _pFilenames = _pFolderEntryPM->GetFolderEntryList();
619 TryCatch(_pFilenames != null, , "Failed to allocate Memory to Filenames ArrayList");
622 if (_pThumbnailItemProvider != null)
624 _pThumbnailItemProvider->SetCreateItemSource(sourceForm);
625 _pThumbnailItemProvider->SetFolderEntryProvider(this);
629 //_pFileListPM->SetFileEventListener(this);
630 AppLogDebug("EXIT: r = %s", GetErrorMessage(r));
635 pArgs->RemoveAll(false);
643 pArgs->RemoveAll(false);
650 SubFolderFileListForm::OnActionPerformed(const Tizen::Ui::Control& source, int actionId)
652 AppLogDebug("ENTER");
654 result r = E_SUCCESS;
655 SceneManager* pSceneManager = null;
656 pSceneManager = SceneManager::GetInstance();
662 //Navigate to the TopFolderFileListForm.
664 homeRootPath.Append(__currentDirectoryPath);
666 while ((homeRootPath != BasePresentationModel::GetMediaPath()) && (homeRootPath != BasePresentationModel::GetSdCardPath()))
668 FolderNavigationPresentationModel::SetCurrentFilePath(homeRootPath);
669 homeRootPath.Clear();
670 homeRootPath = FolderNavigationPresentationModel::GetParentPath();
673 FolderNavigationPresentationModel::SetCurrentFilePath(homeRootPath);
675 r = pSceneManager->GoBackward(BackwardSceneTransition(IDSCN_TOP_LEVEL_DIRECTORY_FORM, SCENE_TRANSITION_ANIMATION_TYPE_RIGHT, SCENE_DESTROY_OPTION_DESTROY), null);
682 bool searchHistory = CheckSearchHistory();
684 //Navigate to the ParentForm.
687 __previousSceneName = SceneManager::GetInstance()->GetCurrentSceneId();
688 AppLogDebug("__previousSceneName is %S", __previousSceneName.GetPointer());
689 previousPath = FolderNavigationPresentationModel::GetCurrentPath();
690 AppLogDebug("previousPath is %S", previousPath.GetPointer());
691 FolderNavigationPresentationModel::SetSearchPreviousPath(previousPath);
693 ShowParentDirectoryView();
697 case IDA_CONTEXT_MENU_HIDE_EXTENSION:
699 __currentDirectoryPath.Clear();
700 __currentDirectoryPath = FolderNavigationPresentationModel::GetCurrentPath();
706 case IDA_CONTEXT_MENU_SHOW_EXTENSION:
708 __currentDirectoryPath.Clear();
709 __currentDirectoryPath = FolderNavigationPresentationModel::GetCurrentPath();
717 SubBaseOnActionPerformed(source, actionId);
721 AppLogDebug("EXIT: r = %s", GetErrorMessage(r));
725 SubFolderFileListForm::OnSceneDeactivated(const Tizen::Ui::Scenes::SceneId& currentSceneId,
726 const Tizen::Ui::Scenes::SceneId& nextSceneId)
728 ((MyFilesApp*)Application::GetInstance())->SetCurrentView(null);
731 DeviceManager::RemoveAllDeviceEventListeners();
733 if (_pIconListView != null)
735 _pIconListView->RemoveGestureDetector(_pLongPressGestureDetector);
738 TryReturn(_pFolderEntryPM!=null, , "FolderEntryPresentationModel is NULL") ;
739 //_pFolderEntryPM->StopThumbnailManager(true);
740 _pFolderEntryPM->SetCurrentReqId(0);
742 if(_pFileEventManager != null)
744 _pFileEventManager->RemovePath(__currentDirectoryPath);
745 delete _pFileEventManager;
746 _pFileEventManager = null;
752 SubFolderFileListForm::OnListViewItemStateChanged(Tizen::Ui::Controls::ListView& listView, int index, int elementId, Tizen::Ui::Controls::ListItemStatus status)
754 //When state is changed, push the parent filepath to the stack and save the selected path as
755 //root path so that listview can be refreshed to this path the next time. If Up button is click in
756 //the mean time, refresh the root path to be pushed to the parent path (changed in ShowParentView())
758 AppLogDebug("ENTER");
760 String tempRootMediaPath;
761 String filePathToPush;
763 bool searchHistory = false;
764 //result r = E_FAILURE;
765 DirectoryEntry* pDirStr = null;
767 ArrayList* pArgs = new (std::nothrow) ArrayList();
771 SceneId currentSceneId;
772 SceneManager* pSceneManager = SceneManager::GetInstance();
773 if (pSceneManager != null)
774 currentSceneId = pSceneManager->GetCurrentSceneId();
776 if (_pFilenames != null)
778 pDirStr = static_cast< DirectoryEntry* >(_pFilenames->GetAt(index));
781 //temprootmediapath gives the full file path of the selected item
782 tempRootMediaPath = pDirStr->GetFullFilePath();
784 if (pDirStr->IsDirectory())
786 //Append the name of the file to the existing path
787 nextFilename = pDirStr->GetFileName();
788 _currentFileName.Clear();
789 _currentFileName = pDirStr->GetFileName();
791 //tempRootMediaPath.Append(L"/");
792 //Set the full file path as future parent filepath, changed when Up button is
794 if (__currentDirectoryPath != null)
796 __currentDirectoryPath.Clear();
797 //__currentDirectoryPath.Append(tempRootMediaPath);
798 __currentDirectoryPath = pDirStr->GetFullFilePath();
800 FolderNavigationPresentationModel::SetCurrentFilePath(__currentDirectoryPath);
802 pArgs->Add(&nextFilename);
804 searchHistory = CheckSearchHistory();
807 searchPath = FolderNavigationPresentationModel::GetParentPath();
808 FolderNavigationPresentationModel::SetSearchPreviousPath(searchPath);
810 if (pSceneManager != null)
811 pSceneManager->GoForward(ForwardSceneTransition(SCENE_TRANSITION_ANIMATION_TYPE_LEFT), pArgs);
815 _indexTracker = index; //For OnFileEventOccured (RemoveCacheEntry)
816 _pathOfSelectedFile = tempRootMediaPath;
817 //It's not a directory, Launch the AppControl.
818 if (_pathOfSelectedFile.EndsWith(L".tpk") || _pathOfSelectedFile.EndsWith(L".wgt"))
820 String* pFileUriScheme = new (std::nothrow) String(L"file://");
821 pFileUriScheme->Append(_pathOfSelectedFile);
823 AppControl::FindAndStart(L"http://tizen.org/appcontrol/operation/view", pFileUriScheme, null, null, null, null);
824 delete pFileUriScheme;
828 CustomAppControl* pCustomAppControl = CustomAppControl::GetInstance();
829 if (pCustomAppControl != null)
833 pCustomAppControl->SetAppControlListener(this);
834 fileForAppControl = _pathOfSelectedFile;
835 AppControl* pAppControlInUse = pCustomAppControl->LaunchAppControl(_pathOfSelectedFile, this);
836 if (pAppControlInUse != null)
838 CustomAppControl::SetAppControlInUse(pAppControlInUse);
839 _bBackFromAppControl = true;
852 SubFolderFileListForm::ShowHomeView(void)
854 AppLogDebug("Enter");
855 SceneManager* pSceneManager = null;
856 result r = E_SUCCESS;
857 pSceneManager = SceneManager::GetInstance();
858 if (pSceneManager != null)
860 r = pSceneManager->GoBackward(BackwardSceneTransition(IDSCN_TOP_LEVEL_DIRECTORY_FORM, SCENE_TRANSITION_ANIMATION_TYPE_RIGHT, SCENE_DESTROY_OPTION_DESTROY), null);
861 TryCatch(r == E_SUCCESS, , "scene transition failed");
865 if (_pFolderEntryPM != null)
867 _pFolderEntryPM->InitThumbnailManager();
877 SubFolderFileListForm::SetParentDisplayPath(void)
879 //Sets the display path for the parent directory using the current path.
883 String parentDisplayPath;
886 DataBindingContext* pContext = null;
887 pContext = GetDataBindingContextN();
889 if (pContext != null)
891 //Update binding on the source to fetch the current display path.
892 pContext->UpdateBinding(L"ID_DISPLAY_PATH", DATA_BINDING_DESTINATION_TYPE_SOURCE);
896 StringTokenizer tokenizer(_displayPath, delim);
898 //Use a string tokenizer to get the filepath until it's the last token, break the loop when
899 //it is the last token
900 while (tokenizer.HasMoreTokens())
902 int tokenCount = tokenizer.GetTokenCount();
906 tokenizer.GetNextToken(token);
907 parentDisplayPath.Append(token);
908 parentDisplayPath.Append(L"/");
916 //Set the display path to that of the generated filepath from the tokenizer
917 _displayPath = parentDisplayPath;
919 if (_pLabelDisplayPath != null)
921 String displayPathToAppend(L"\x200E");
922 displayPathToAppend.Append(_displayPath);
924 _pLabelDisplayPath->SetText(displayPathToAppend);
925 _pLabelDisplayPath->Invalidate(true);
928 if (pContext != null)
930 //Update Binding on the Target control to display the currently constructed path.
931 pContext->UpdateBinding(L"ID_DISPLAY_PATH", DATA_BINDING_DESTINATION_TYPE_TARGET);
934 if (pContext != null)
942 SubFolderFileListForm::ShowParentDirectoryView(void)
944 AppLogDebug("ENTER");
945 //Shows the files of the above/parent directory
949 result r = E_SUCCESS;
954 String backUpCurrentPath;
956 backUpCurrentPath = FolderNavigationPresentationModel::GetCurrentPath();
958 displayPath = defaultPhoneBody;
959 displayPath.Append("/");
962 if (backUpCurrentPath == BasePresentationModel::GetMediaPath() || backUpCurrentPath == BasePresentationModel::GetSdCardPath() || backUpCurrentPath == BasePresentationModel::GetUsbPath())
964 //It is the homeview, so call showhomeview
966 TryCatch(r == E_SUCCESS, , "scene transition failed");
971 ParentPath = FolderNavigationPresentationModel::GetParentPath();
973 //RemovePath to remove FileEventListener
974 if(_pFileEventManager != null)
976 _pFileEventManager->RemovePath(__currentDirectoryPath);
978 __currentDirectoryPath.Clear();
979 __currentDirectoryPath.Append(ParentPath);
981 //AddPath to add FileEventListener for Parent Directory Path
982 if(_pFileEventManager != null)
984 _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);
987 FolderNavigationPresentationModel::SetCurrentFilePath(__currentDirectoryPath);
989 if (_pFolderEntryPM != null)
991 _pFolderEntryPM->GetFolderEntryCount(__currentDirectoryPath, folderCount, fileCount);
994 SetParentDisplayPath();
995 SetHeaderTitleText(ParentPath);
997 //Remove the current files from the filenames list
998 if (_pFolderEntryPM != null)
1000 //__pContentManager->ClearList();
1001 _pFolderEntryPM->SetFolderEntryPath(ParentPath);
1002 _pFilenames = _pFolderEntryPM->GetFolderEntryList();
1003 TryCatch(_pFilenames != null, , "Failed to fetch ArrayList from the ContentBrowser!");
1007 _pFolderEntryPM->InitThumbnailManager();
1011 SetFooterVisibility();
1013 //Get the files in the parent path of the current view
1015 //Update the icon list to view the files of the parent directory
1016 if (_pListView != null && _pListView->IsVisible())
1018 r = _pListView->UpdateList();
1020 else if (_pIconListView != null && _pIconListView->GetShowState())
1022 r = _pIconListView->UpdateList();
1025 AppLogDebug("EXIT: r = %s", GetErrorMessage(r));
1029 FolderNavigationPresentationModel::SetCurrentFilePath(backUpCurrentPath);
1034 SubFolderFileListForm::OnNotificationReceived(Tizen::Base::Collection::ArrayList* pArgs)
1036 AppLogDebug("Enter");
1038 Integer* pFileProcessingResult = null;
1041 TryCatch(pArgs != null, , "Argument list received is invalid!");
1042 pFileProcessingResult = (Integer*) pArgs->GetAt(0);
1044 TryCatch(pFileProcessingResult != null, , "FileProcessing Result list is invalid!");
1046 if (_pFileEventManager != null)
1048 _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);
1051 switch (pFileProcessingResult->ToInt())
1053 case FILE_MANAGING_RESULT_DELETING_SUCCESS:
1055 AppLogDebug("FILE DELETION SUCCESSFUL");
1056 _bIsFileEventOccured = true;
1057 _bIsDeleteFromContextSwipe = false;
1058 HideFileProgressingPopup();
1062 case FILE_MANAGING_RESULT_DELETING_FAILED:
1064 _bIsDeleteFromContextSwipe = false;
1065 HideFileProgressingPopup();
1068 case FILE_MANAGING_RESULT_THREAD_STOP:
1070 _bIsDeleteFromContextSwipe = false;
1071 HideFileProgressingPopup();
1081 _pFolderEntryPM->RefreshFolderEntries();
1082 _pFolderEntryPM->InitThumbnailManager(); //for thumbnail issues/disappering images/defulat images etc...
1085 if (_pListView->IsVisible() == true)
1086 _pListView->UpdateList();
1087 else if (_pIconListView->GetShowState() == true)
1088 _pIconListView->UpdateList();
1090 SetFooterVisibility();
1095 pArgs->RemoveAll(true);
1101 SubFolderFileListForm::OnDataBindingSourceUpdated(const Tizen::Base::String& bindingId, const Tizen::Base::String& controlName, const Tizen::Base::String& propertyName)
1103 //Empty Implementation.
1107 SubFolderFileListForm::OnDataBindingTargetUpdated(const Tizen::Base::String& bindingId, const Tizen::Base::String& controlName, const Tizen::Base::String& propertyName)
1109 //Empty Implementation.
1113 SubFolderFileListForm::OnDataBindingValidationFailed(const Tizen::Base::String& bindingId, const Tizen::Base::String& controlName, const Tizen::Base::String& propertyName, Tizen::Ui::DataBindingDestinationType destType)
1115 //Empty Implementation.
1119 SubFolderFileListForm::OnFileEventExecuted(const Tizen::Base::String& path, const unsigned long eventId)
1121 AppLogDebug("ENTER");
1123 int badgeNumber = 0;
1124 result r = E_SUCCESS;
1126 // Tizen::Shell::NotificationManager* pNotiMgr = null;
1128 NotificationManager* pNotiMgr = null;
1129 AppResource* pAppResource = null;
1130 pAppResource = UiApp::GetInstance()->GetAppResource();
1131 TryCatch(pAppResource != null, , "Failed to fetch AppResource");
1133 pNotiMgr = new (std::nothrow) NotificationManager();
1134 TryCatch(pNotiMgr != null, , "Failed to fetch AppNotificationManager");
1136 pNotiMgr->Construct();
1137 badgeNumber = pNotiMgr->GetBadgeNumber();
1140 if (_pFolderEntryPM != null)
1142 //_pFolderEntryPM->SetFileEventListener(null);
1143 _pFilenames = _pFolderEntryPM->GetFolderEntryList();
1144 TryCatch(_pFilenames != null, , "File Names List retrieval failed");
1149 case FILE_EVENT_TYPE_CREATE:
1151 if (_pListView != null && _pListView->IsVisible())
1153 _pListView->RefreshList(_pFilenames->GetCount() - 1, LIST_REFRESH_TYPE_ITEM_ADD);
1155 else if (_pIconListView != null && _pIconListView->GetShowState())
1157 _pIconListView->RefreshList(_pFilenames->GetCount() - 1, LIST_REFRESH_TYPE_ITEM_ADD);
1163 case FILE_EVENT_TYPE_DELETE:
1165 if (_pListView != null && _pListView->IsVisible())
1167 _pListView->RefreshList(__counter, LIST_REFRESH_TYPE_ITEM_REMOVE);
1169 else if (_pIconListView != null && _pIconListView->GetShowState())
1171 if (_pThumbnailItemProvider != null)
1173 __counter = _pThumbnailItemProvider->GetPressedIndex();
1175 _pIconListView->RefreshList(__counter, LIST_REFRESH_TYPE_ITEM_REMOVE);
1181 case FILE_EVENT_TYPE_DELETE_SELF:
1194 AppLogDebug("EXIT: r = %s", GetErrorMessage(r));
1196 if (pNotiMgr != null)
1204 if (pNotiMgr != null)
1213 SubFolderFileListForm::SetHeaderTitleText(Tizen::Base::String& filePath)
1216 String parentFileName;
1217 String delimiter(L"/");
1218 StringTokenizer tokenizer(filePath, delimiter);
1220 AppResource* pAppResource = null;
1222 pAppResource = UiApp::App::GetInstance()->GetAppResource();
1224 if (filePath == BasePresentationModel::GetMediaPath())
1226 if (pAppResource != null)
1228 pAppResource->GetString(L"IDS_MF_TAB_PHONE", parentFileName);
1231 else if (filePath == BasePresentationModel::GetSdCardPath())
1233 if (pAppResource != null)
1235 pAppResource->GetString(L"IDS_MF_TAB_MEMORY_CARD", parentFileName);
1240 while (tokenizer.HasMoreTokens())
1242 int tokenCount = tokenizer.GetTokenCount();
1244 if (tokenCount == 1)
1246 tokenizer.GetNextToken(parentFileName);
1250 tokenizer.GetNextToken(token);
1255 __pHeader = GetHeader();
1256 if (__pHeader != null)
1258 if (!parentFileName.IsEmpty())
1260 __pHeader->SetTitleText(parentFileName);
1261 __pHeader->Invalidate(true);
1267 SubFolderFileListForm::OnDeviceChange(ComponentType deviceType, const Tizen::Base::String& state)
1269 bool setMediaPath = false;
1270 MemoryType currentMemoryType = MEMORY_TYPE_PHONE;
1271 String unmounted = sdCardStatusUnmounted;
1272 String removed = usbDeviceStatusRemoved;
1275 SceneManager* pSceneManager = null;
1277 if (state == unmounted || state == removed)
1279 currentPath = FolderNavigationPresentationModel::GetCurrentPath();
1280 if (state == unmounted)
1282 if (currentPath.Contains(BasePresentationModel::GetSdCardPath()))
1284 FolderNavigationPresentationModel::SetCurrentFilePath(BasePresentationModel::GetMediaPath());
1285 FolderNavigationPresentationModel::SetStorageType(currentMemoryType);
1286 setMediaPath = true;
1290 if (state == removed)
1292 if (currentPath.Contains(BasePresentationModel::GetUsbPath()))
1294 FolderNavigationPresentationModel::SetCurrentFilePath(BasePresentationModel::GetMediaPath());
1295 FolderNavigationPresentationModel::SetStorageType(currentMemoryType);
1296 setMediaPath = true;
1302 pSceneManager = SceneManager::GetInstance();
1303 if (pSceneManager != null)
1305 pSceneManager->GoBackward(BackwardSceneTransition(IDSCN_TOP_LEVEL_DIRECTORY_FORM, SCENE_TRANSITION_ANIMATION_TYPE_RIGHT, SCENE_DESTROY_OPTION_DESTROY), null);
1312 SubFolderFileListForm::OnDeviceStateChanged(Tizen::System::DeviceType deviceType, const Tizen::Base::String& state)
1314 ComponentType currentDeviceType = COMPONENT_TYPE_NONE;
1319 currentDeviceType = COMPONENT_TYPE_STORAGE_CARD;
1325 currentDeviceType = COMPONENT_TYPE_USB;
1335 OnDeviceChange(currentDeviceType, state);
1339 SubFolderFileListForm::OnSceneTransitionCompleted (const Tizen::Ui::Scenes::SceneId &previousSceneId, const Tizen::Ui::Scenes::SceneId ¤tSceneId)
1341 AppLogDebug("Enter");
1343 AppRegistry* pAppRegistry = null;
1344 String sortbyKeyName(L"SortBy");
1345 int sortStyle = SORT_BY_TYPE_DATE_RECENT;
1347 int folderCount = 0;
1349 SceneManager::GetInstance()->RemoveSceneManagerEventListener(*this);
1350 pAppRegistry = UiApp::App::GetInstance()->GetAppRegistry();
1352 _pLongPressGestureDetector->AddLongPressGestureEventListener(*this);
1354 if (_pathOfSelectedFile.IsEmpty() == false && File::IsFileExist(_pathOfSelectedFile) == false)
1356 _bIsFileEventOccured = true;
1358 if (_pIconListView != null)
1360 _pIconListView->AddGestureDetector(*_pLongPressGestureDetector);
1363 if (_pFileEventManager != null)
1365 delete _pFileEventManager;
1366 _pFileEventManager = null;
1369 _pFileEventManager = new (std::nothrow)FileEventManager();
1370 _pFileEventManager->Construct(*this);
1372 _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);
1374 _pFolderEntryPM->GetFolderEntryCount(FolderNavigationPresentationModel::GetCurrentPath(),folderCount, fileCount);
1376 if (previousSceneId == IDSCN_CREATE_FOLDER_FORM)
1378 if (_renameOrCreate == SELECT_RENAME)
1380 if (pAppRegistry != null)
1381 pAppRegistry->Get(sortbyKeyName, sortStyle);
1383 if (sortStyle == SORT_BY_TYPE_NAME_ASCENDING || sortStyle == SORT_BY_TYPE_NAME_DESCENDING
1384 || sortStyle == SORT_BY_TYPE_DATE_OLDEST || sortStyle == SORT_BY_TYPE_DATE_RECENT)
1386 _pFolderEntryPM->SetFolderEntryPath(FolderNavigationPresentationModel::GetCurrentPath());
1387 _pFilenames = _pFolderEntryPM->GetFolderEntryList();
1389 if (_pListView != null && _pListView->IsVisible())
1391 _pListView->UpdateList();
1392 _pListView->ScrollToItem(0);
1394 else if (_pIconListView != null && _pIconListView->GetShowState())
1396 _pIconListView->UpdateList();
1397 _pIconListView->ScrollToItem(0);
1399 //_pFolderEntryPM->InitThumbnailManager();
1403 if (_pListView != null && _pListView->IsVisible())
1404 _pListView->RefreshList(_renameIndex, LIST_REFRESH_TYPE_ITEM_MODIFY);
1405 else if (_pIconListView != null && _pIconListView->GetShowState())
1407 _pIconListView->RefreshList(_renameIndex, LIST_REFRESH_TYPE_ITEM_MODIFY);
1411 SetFooterVisibility();
1417 if (CheckSearchHistory())
1419 __previousSceneName = previousSceneId;
1424 SetFooterVisibility();
1426 if (_pFolderEntryPM != null)
1428 _pFolderEntryPM->InitThumbnailManager();
1433 SubFolderFileListForm::OnSceneTransitionStarted (const Tizen::Ui::Scenes::SceneId ¤tSceneId, const Tizen::Ui::Scenes::SceneId &nextSceneId)
1435 //Empty Implementation.
1439 SubFolderFileListForm::OnOrientationChanged(const Control& source, OrientationStatus orientationStatus)
1441 AppLogDebug("ENTER");
1442 switch (orientationStatus)
1444 /*case ORIENTATION_STATUS_LANDSCAPE:
1446 SceneManager* pSceneManager = null;
1447 pSceneManager = SceneManager::GetInstance();
1448 if (pSceneManager != null)
1450 pSceneManager->GoForward(ForwardSceneTransition(IDSCN_SPLIT_PANEL_FORM, SCENE_TRANSITION_ANIMATION_TYPE_NONE), null);
1460 SubFolderFileListForm::OnFileEventOccured(const unsigned long events,const Tizen::Base::String & path, const unsigned int eventId)
1462 AppLogDebug("ENTRY:SubFolderFileListForm::OnFileEventOccured");
1464 HashMap* pCacheList = null;
1465 DirectoryEntry* pCurrentEntry = null;
1466 bool cacheKeyStatus = false;
1469 _bIsFileEventOccured = true;
1470 if ((events & FILE_EVENT_TYPE_CREATE) || (events & FILE_EVENT_TYPE_MOVED_FROM) || (events & FILE_EVENT_TYPE_MOVED_TO ))
1472 if ( events & FILE_EVENT_TYPE_MOVED_FROM)
1474 AppLogDebug("Items to delete: %d", _indexTracker);
1475 pCacheList = CacheManager::GetInstance()->GetCacheHashMap();
1476 if (pCacheList != null)
1478 pCurrentEntry = static_cast<DirectoryEntry*>(_pFilenames->GetAt(_indexTracker));
1480 if (pCurrentEntry != null)
1482 cachePath = pCurrentEntry->GetFullFilePath();
1485 cacheKeyStatus = pCacheList->ContainsKey(cachePath);
1489 CacheManager::GetInstance()->RemoveCacheEntry(cachePath);
1493 if (_pFolderEntryPM!=null)
1495 if (((MyFilesApp*) Application::GetInstance())->IsAppInBackground()==false) // App is running in foreground
1497 if (events & FILE_EVENT_TYPE_MOVED_FROM ) //Only refresh the list for deleting, as the refreshing the list have been taken care by OnNotificationReceived
1499 AppLogDebug("App is running in foreground");
1500 if (_pListView != null && _pListView->IsVisible())
1502 _pListView->UpdateList();
1504 else if (_pIconListView != null && _pIconListView->GetShowState())
1506 AppLogDebug("refresh iconlist view");
1507 _pIconListView->UpdateList();
1511 else //App is running in foreground but events is not delete or moved from.
1513 AppLogDebug("Refreshing Folder Entries : AppIsInForeground, but events are not delete|movedfrom");
1514 _pFolderEntryPM->RefreshFolderEntries();
1517 else //App is running in the background, OnNotificationReceived will not come, so do RefreshFolderEntries, update list and do InitThumbnail.
1519 HideFileProgressingPopup();
1520 HideDeleteConfirmationPopup();
1523 AppLogDebug("Refreshing Folder Entries : AppIsInBackground");
1524 _pFolderEntryPM->RefreshFolderEntries();
1528 if (_pListView != null && _pListView->IsVisible())
1530 _pListView->UpdateList();
1532 else if (_pIconListView != null && _pIconListView->GetShowState())
1534 _pIconListView->UpdateList();
1537 if (_pFolderEntryPM!=null && ( (events & FILE_EVENT_TYPE_CREATE) || (events & FILE_EVENT_TYPE_MOVED_TO)))
1539 _pFolderEntryPM->InitThumbnailManager();
1542 else if ((events & FILE_EVENT_TYPE_MOVE_SELF) || (events & FILE_EVENT_TYPE_DELETE) || (events & FILE_EVENT_TYPE_DELETE_SELF))
1544 //Navigate to the ParentForm.
1545 ShowParentDirectoryView();
1548 SetFooterVisibility();
1550 AppLogDebug("OnFileEventOccured: Exit");
1554 SubFolderFileListForm::OnContentScanCompleted (RequestId reqId, const Tizen::Base::String &scanPath, result r)
1556 AppLogDebug("Enter");
1557 AppLogDebug("Exit");
1561 SubFolderFileListForm::FlipSourceForm(void)
1563 AppLogDebug("Enter");
1564 Tizen::Ui::Scenes::SceneId currentSceneId = SceneManager::GetInstance()->GetCurrentSceneId();
1565 AppLogDebug("Current Scene id is : %S",currentSceneId.GetPointer());
1566 CreateItemSource sourceForm = CREATE_ITEM_SOURCE_NONE;
1568 if ( _pFolderEntryPM !=null)
1570 sourceForm = _pFolderEntryPM->GetSourceForm();
1572 if( currentSceneId.CompareTo(IDSCN_SUB_DIRECTORY_FORM) && sourceForm == CREATE_ITEM_SOURCE_SUB_FOLDER_FILE_LIST)
1574 AppLogDebug("OnSceneIdChanged : %d",CREATE_ITEM_SOURCE_SUB_FOLDER_FILE_LIST );
1575 _pFolderEntryPM->SetSourceForm(CREATE_ITEM_SOURCE_SUB_FOLDER_FILE_LIST_TWO);
1577 else if( currentSceneId.CompareTo(IDSCN_SUB_DIRECTORY_FORM) && 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_TWO)
1584 AppLogDebug("OnSceneIdChanged : %d",CREATE_ITEM_SOURCE_SUB_FOLDER_FILE_LIST_TWO );
1585 _pFolderEntryPM->SetSourceForm(CREATE_ITEM_SOURCE_SUB_FOLDER_FILE_LIST);
1587 else if (currentSceneId.CompareTo(IDSCN_SUB_DIRECTORY_FORM1) && sourceForm == CREATE_ITEM_SOURCE_SUB_FOLDER_FILE_LIST)
1589 AppLogDebug("OnSceneIdChanged : %d",CREATE_ITEM_SOURCE_SUB_FOLDER_FILE_LIST );
1590 _pFolderEntryPM->SetSourceForm(CREATE_ITEM_SOURCE_SUB_FOLDER_FILE_LIST_TWO);
1593 AppLogDebug("Exit");