virtual void OnDeviceStateChanged(Tizen::System::DeviceType deviceType, const Tizen::Base::String& state);
void OnDeviceChange(ComponentType deviceType, const Tizen::Base::String& state);
+ void OnAppControlCompleted(void);
private:
void GetParentFolderPath(Tizen::Base::String* filePath);
void GetFileName(Tizen::Base::String* fileName);
//IDeviceEventListener\r
virtual void OnDeviceStateChanged(Tizen::System::DeviceType deviceType, const Tizen::Base::String& state);\r
\r
- //IDeviceNotificationListener\r
- void OnDeviceChange(ComponentType deviceType, const Tizen::Base::String& state);\r
-\r
//IFileEventListener\r
virtual void OnFileEventOccured(const unsigned long events,const Tizen::Base::String & path, const unsigned int eventId);\r
\r
* @return No Return Values.
*/
virtual void OnThumbnailReceived(ThumbRequest* pThumbReq);
- void OnAppControlCompleted(void){}
+ void OnAppControlCompleted(void);
/*! @fn OnListViewContextItemStateChanged(Tizen::Ui::Controls::ListView& listView, int index, int elementId, Tizen::Ui::Controls::ListContextItemStatus status)
* @brief Called when the state of an element in the ListContextItem is changed.
bool _bIsTopLevelDirectory;
bool _bIsDirectoryEmpty;
+ bool _bBackFromAppControl;
MemoryType _storageType;
//IContentScanListener
virtual void OnContentScanCompleted (RequestId reqId, const Tizen::Base::String &scanPath, result r);
+ void OnAppControlCompleted(void);
private:
/*
void
CategorySearch::OnFileEventOccured(const unsigned long events,const Tizen::Base::String & path, const unsigned int eventId)
{
- /*if ((events & FILE_EVENT_TYPE_CREATE) || (events & FILE_EVENT_TYPE_DELETE) || (events & FILE_EVENT_TYPE_MOVED_TO) || (events & FILE_EVENT_TYPE_MOVED_FROM))
- {
- if (_pFolderEntryPM!=null)
- {
- _pFolderEntryPM->RefreshFolderEntries();
- }
- if (_pListView != null && _pListView->IsVisible())
- {
- _pListView->UpdateList();
- }
- if (_pIconListView != null && _pIconListView->IsVisible())
- {
- _pIconListView->UpdateList();
- }
- if (_pFolderEntryPM!=null)
- {
- _pFolderEntryPM->InitThumbnailManager();
- }
- }*/
-
-
AppLogDebug("TopMostFolderFileListForm::OnFileEventOccured:%S", path.GetPointer());
//Scan the directory
- static unsigned short bRotate = 0;
HashMap* pCacheList = null;
DirectoryEntry* pCurrentEntry = null;
bool cacheKeyStatus = false;
String cachePath;
- if( !(bRotate ^ 3) )
- bRotate = 0;
AppLogDebug("ContentManager::ScanFile:%S", path.GetPointer());
if ((events & FILE_EVENT_TYPE_CREATE) || (events & FILE_EVENT_TYPE_DELETE) || (events & FILE_EVENT_TYPE_MOVED_FROM) || (events & FILE_EVENT_TYPE_MOVED_TO ))
{
- if ( (events & FILE_EVENT_TYPE_CREATE) || (events & FILE_EVENT_TYPE_MOVED_TO) )
- {
- if ( bRotate & 1)
- bRotate |= 2;
- AppLogDebug("Items were rotated afted creation: %d", bRotate);
- }
+ _bBackFromAppControl = true;
if ( (events & FILE_EVENT_TYPE_DELETE) || (events & FILE_EVENT_TYPE_MOVED_FROM))
{
- bRotate |= 1;
- AppLogDebug("Items were rotated after deletion: %d", bRotate);
-
AppLogDebug("Items to delete: %d", _indexTracker);
pCacheList = CacheManager::GetInstance()->GetCacheHashMap();
if (pCacheList != null)
{
cachePath = pCurrentEntry->GetFullFilePath();
}
-
cacheKeyStatus = pCacheList->ContainsKey(cachePath);
-
if (cacheKeyStatus)
{
CacheManager::GetInstance()->RemoveCacheEntry(cachePath);
{
_pFolderEntryPM->RefreshFolderEntries();
}
-
- if (_pListView != null && _pListView->IsVisible())
- {
- _pListView->UpdateList();
- }
-
- if (_pIconListView != null && _pIconListView->IsVisible())
- {
- _pIconListView->UpdateList();
- }
-
- if (_pFolderEntryPM!=null)
- {
- if (!(bRotate ^ 3) )
- {
- {
- AppLogDebug("Items were rotated : %d", bRotate);
- //CacheManager::GetInstance()->ClearCache();
- }
- }
- /* AppLogDebug("InitThumbnailManager");
- _pFolderEntryPM->InitThumbnailManager();*/
- }
}
}
void
CategorySearch::OnDeviceChange(ComponentType deviceType, const Tizen::Base::String& state)
{
-
-
- if (_pFolderEntryPM != null)
- {
- _pFolderEntryPM->CreateTraversalTree();
- _pFilenames = _pFolderEntryPM->GetFolderEntryList();
- }
+ if (_pFolderEntryPM != null)
+ {
+ _pFolderEntryPM->CreateTraversalTree();
+ _pFilenames = _pFolderEntryPM->GetFolderEntryList();
+ }
- if (_pFilenames != null)
+ if (_pFilenames != null)
+ {
+ if (_pFilenames->GetCount() == 0)
{
- if (_pFilenames->GetCount() == 0)
- {
- SetFooterItemsVisibility(DISABLE_FOOTER_ITEM);
- }
- else
- {
- SetFooterItemsVisibility(ENABLE_FOOTER_ITEM);
- }
+ SetFooterItemsVisibility(DISABLE_FOOTER_ITEM);
}
-
- if (_pListView != null && _pListView->IsVisible())
+ else
{
- _pListView->UpdateList();
- _pListView->Invalidate(true);
+ SetFooterItemsVisibility(ENABLE_FOOTER_ITEM);
}
+ }
- if (_pFolderEntryPM != null)
- {
- _pFolderEntryPM->InitThumbnailManager();
- }
+ if (_pListView != null && _pListView->IsVisible())
+ {
+ _pListView->UpdateList();
+ _pListView->Invalidate(true);
+ }
+
+ if (_pFolderEntryPM != null)
+ {
+ _pFolderEntryPM->InitThumbnailManager();
+ }
+}
+void
+CategorySearch::OnAppControlCompleted(void)
+{
+ SubBaseFolderEntryForm::OnAppControlCompleted();
}
result r = E_SUCCESS;
ArrayList* pArg = null;
SceneManager* pSceneManager = null;
- //int storageType = -1;
- if (__SelectedTab == MEMORY_TYPE_PHONE)
+ //SetStorageType
+ if (fullPath.Contains(BasePresentationModel::GetMediaPath()) == true)
{
FolderNavigationPresentationModel::SetStorageType(MEMORY_TYPE_PHONE);
}
- else if (__SelectedTab == MEMORY_TYPE_SD_CARD)
+ else if (fullPath.Contains(BasePresentationModel::GetSdCardPath()) == true)
{
FolderNavigationPresentationModel::SetStorageType(MEMORY_TYPE_SD_CARD);
}
-
-
+ //SetCurrentFilePath
FolderNavigationPresentationModel::SetCurrentFilePath(fullPath);
pArg = new (std::nothrow) ArrayList();
}
void
-SearchForm::OnDeviceChange(ComponentType deviceType, const Tizen::Base::String& state)
+SearchForm::OnDeviceStateChanged(Tizen::System::DeviceType deviceType, const Tizen::Base::String& state)
{
- bool setMediaPath = false;
- MemoryType currentMemoryType = MEMORY_TYPE_PHONE;
- String unmounted = sdCardStatusUnmounted;
- String removed = usbDeviceStatusRemoved;
- String currentPath;
- SceneManager* pSceneManager = null;
-
- if (state == unmounted || state == removed)
- {
- currentPath = FolderNavigationPresentationModel::GetCurrentPath();
- if (state == unmounted)
- {
- if (currentPath.Contains(BasePresentationModel::GetSdCardPath()))
- {
- FolderNavigationPresentationModel::SetCurrentFilePath(BasePresentationModel::GetMediaPath());
- FolderNavigationPresentationModel::SetStorageType(currentMemoryType);
- setMediaPath = true;
- }
- }
-
- if (state == removed)
- {
- if (currentPath.Contains(BasePresentationModel::GetUsbPath()))
- {
- FolderNavigationPresentationModel::SetCurrentFilePath(BasePresentationModel::GetMediaPath());
- FolderNavigationPresentationModel::SetStorageType(currentMemoryType);
- setMediaPath = true;
- }
- }
+ AppLogDebug("SearchForm::OnDeviceStateChanged");
- if (setMediaPath)
- {
- pSceneManager = SceneManager::GetInstance();
- if (pSceneManager != null)
- {
- pSceneManager->GoForward(ForwardSceneTransition(IDSCN_ROOT_DIRECTORY_FORM, SCENE_TRANSITION_ANIMATION_TYPE_NONE, SCENE_HISTORY_OPTION_NO_HISTORY, SCENE_DESTROY_OPTION_DESTROY), null); }
- }
- }
-}
+ __pSearchBar->SetMode(__searchBarMode);
-void
-SearchForm::OnDeviceStateChanged(Tizen::System::DeviceType deviceType, const Tizen::Base::String& state)
-{
- ComponentType currentDeviceType;
- switch (deviceType)
- {
- case StorageCard:
- {
- currentDeviceType = COMPONENT_TYPE_STORAGE_CARD;
- }
- break;
+ if (__searchText.IsEmpty() == false)
+ StartSearch();
- case UsbClient:
- {
- currentDeviceType = COMPONENT_TYPE_USB;
- }
- break;
+ if (__pListView != null)
+ __pListView->UpdateList();
- default:
- {
- //Do Nothing.
- }
- break;
- }
- OnDeviceChange(currentDeviceType, state);
}
+
void
SearchForm::OnSceneTransitionCompleted(const Tizen::Ui::Scenes::SceneId &previousSceneId,
const Tizen::Ui::Scenes::SceneId ¤tSceneId)
}
}
+
void
SearchForm::OnAppControlCompleted(void)
{
int folderCount = 0;
int itemIndex = INVALID_LIST_INDEX;
- _pFolderEntryPM->GetFolderEntryCount(_currentDirectoryPath, folderCount, fileCount);
+
+ _pFolderEntryPM->GetFolderEntryCount(FolderNavigationPresentationModel::GetCurrentPath(), folderCount, fileCount);
DirectoryEntry* pCheckedEntry = null;
String selected;
, _pMediaMetaData(null)
, _pThumbnailItemProvider(null)
, _pThumbnailManager(null)
-
+, _bBackFromAppControl(false)
{
_bIsTopLevelDirectory = false;
_bIsDirectoryEmpty = false;
{
_bIsTopLevelDirectory = isTopDirectory;
}
+void
+SubBaseFolderEntryForm::OnAppControlCompleted(void)
+{
+ AppLogDebug("Enter");
+
+ if( !_bBackFromAppControl )
+ return;
+
+ if (_pListView != null && _pListView->IsVisible())
+ {
+ _pListView->UpdateList();
+ }
+
+ if (_pIconListView != null && _pIconListView->IsVisible())
+ {
+ _pIconListView->UpdateList();
+ }
+
+ if (_pFolderEntryPM!=null)
+ {
+ _pFolderEntryPM->InitThumbnailManager();
+ }
+ _bBackFromAppControl = false;
+ AppLogDebug("Exit");
+}
// return;
// }
- if (_pFolderEntryPM != null)
- {
- _pFolderEntryPM->GetFolderEntryCount(backUpCurrentPath, folderCount, fileCount);
- }
-
displayPath = defaultPhoneBody;
displayPath.Append("/");
SetFooterVisibility(ENABLE_FOOTER_ITEM);
- if (fileCount == 0)
- {
- _pFooter = GetFooter();
- if (_pFooter)
- {
- _pFooter->SetItemEnabled(1, false);
- }
- }
if (backUpCurrentPath == BasePresentationModel::GetMediaPath() || backUpCurrentPath == BasePresentationModel::GetSdCardPath() || backUpCurrentPath == BasePresentationModel::GetUsbPath())
{
FolderNavigationPresentationModel::SetCurrentFilePath(__currentDirectoryPath);
+ if (_pFolderEntryPM != null)
+ {
+ _pFolderEntryPM->GetFolderEntryCount(__currentDirectoryPath, folderCount, fileCount);
+ }
+
SetParentDisplayPath();
SetHeaderTitleText(ParentPath);
+ SetFooterVisibility(ENABLE_FOOTER_ITEM);
+ if (fileCount == 0)
+ {
+ _pFooter = GetFooter();
+ if (_pFooter)
+ {
+ _pFooter->SetItemEnabled(1, false);
+ _pFooter->Invalidate(true);
+ }
+ }
//Remove the current files from the filenames list
if (_pFolderEntryPM != null)
{
break;
}
- SetFooterVisibility(DISABLE_FOOTER_ITEM);
+ //SetFooterVisibility(DISABLE_FOOTER_ITEM);
CATCH:
if (pArgs != null)
{
if (_pFooter)
{
_pFooter->SetItemEnabled(1, false);
+ _pFooter->Invalidate(true);
}
}
}
//Scan the directory
RequestId reqId;
- static unsigned short bRotate = 0;
HashMap* pCacheList = null;
DirectoryEntry* pCurrentEntry = null;
bool cacheKeyStatus = false;
String cachePath;
- if( !(bRotate ^ 3) )
- bRotate = 0;
-
result r = ContentManager::ScanDirectory(__currentDirectoryPath,true,null,reqId);
AppLogDebug("ContentManager::ScanDirectory:%s", GetErrorMessage(r));
if ((events & FILE_EVENT_TYPE_CREATE) || (events & FILE_EVENT_TYPE_DELETE) || (events & FILE_EVENT_TYPE_MOVED_FROM) || (events & FILE_EVENT_TYPE_MOVED_TO ))
{
- if ( (events & FILE_EVENT_TYPE_CREATE) || (events & FILE_EVENT_TYPE_MOVED_TO) )
- {
- if ( bRotate & 1)
- bRotate |= 2;
- AppLogDebug("Items were rotated afted creation: %d", bRotate);
- }
+ _bBackFromAppControl = true;
if ( (events & FILE_EVENT_TYPE_DELETE) || (events & FILE_EVENT_TYPE_MOVED_FROM))
{
- bRotate |= 1;
- AppLogDebug("Items were rotated after deletion: %d", bRotate);
-
- //if ( (events & FILE_EVENT_TYPE_DELETE) )
+ AppLogDebug("Items to delete: %d", _indexTracker);
+ pCacheList = CacheManager::GetInstance()->GetCacheHashMap();
+ if (pCacheList != null)
{
- AppLogDebug("Items to delete: %d", _indexTracker);
- pCacheList = CacheManager::GetInstance()->GetCacheHashMap();
- if (pCacheList != null)
- {
- pCurrentEntry = static_cast<DirectoryEntry*>(_pFilenames->GetAt(_indexTracker));
+ pCurrentEntry = static_cast<DirectoryEntry*>(_pFilenames->GetAt(_indexTracker));
- if (pCurrentEntry != null)
- {
- cachePath = pCurrentEntry->GetFullFilePath();
- }
+ if (pCurrentEntry != null)
+ {
+ cachePath = pCurrentEntry->GetFullFilePath();
+ }
- cacheKeyStatus = pCacheList->ContainsKey(cachePath);
+ cacheKeyStatus = pCacheList->ContainsKey(cachePath);
- if (cacheKeyStatus)
- {
- CacheManager::GetInstance()->RemoveCacheEntry(cachePath);
- }
+ if (cacheKeyStatus)
+ {
+ CacheManager::GetInstance()->RemoveCacheEntry(cachePath);
}
}
}
if (_pFolderEntryPM!=null)
{
- if (!(bRotate ^ 3) )
- {
- {
- AppLogDebug("Items were rotated : %d", bRotate);
- //CacheManager::GetInstance()->ClearCache();
- }
- }
- AppLogDebug("InitThumbnailManager");
_pFolderEntryPM->InitThumbnailManager();
}
}
AppLogDebug("Enter");
AppLogDebug("Exit");
}
+void
+SubFolderFileListForm::OnAppControlCompleted(void)
+{
+ SubBaseFolderEntryForm::OnAppControlCompleted();
+}