, public Tizen::Ui::IKeypadEventListener
, public Tizen::Ui::ITextEventListener
, public Tizen::Ui::ITouchEventListener
+ , public Tizen::Io::IFileEventListener
{
public:
//Constructor of the class.
// Call back is called On Changes in Device Status
void OnDeviceChange(ComponentType deviceType, const Tizen::Base::String& state);
+ //IFileEventListener
+ virtual void OnFileEventOccured(const unsigned long events,const Tizen::Base::String & path, const unsigned int eventId);
+
private:
// Copy Constructor of the class.
CreateFolderForm(const CreateFolderForm& createFolderForm);
Tizen::Ui::Controls::HeaderItem* __pHeaderSave;
Tizen::Ui::Controls::EditField* __pEditFieldFolderName;
Tizen::Ui::Controls::Header* __pHeader;
+ Tizen::Io::FileEventManager* __pFileEventManager;
Tizen::Ui::Controls::Popup* _pFileProgressingPopup;
Tizen::Ui::Controls::Button* _pFileProgressingCancelButton;
Tizen::Base::Collection::ArrayList* __pFileHeaderDetailList;\r
\r
Tizen::Base::String __fileFullPath;\r
+ Tizen::Base::String __previousSceneId;\r
\r
Tizen::Ui::Controls::GroupedListView* __pGroupedDetailListView;\r
\r
extern const wchar_t* IDB_UNKNOWN;
extern const wchar_t* IDB_TPK;
extern const wchar_t* IDB_VCARD;
+extern const wchar_t* IDB_VCALENDAR;
//Category Icon
//extern const wchar_t* IDB_CATEGORY_ICON_BG;
CategorySearch::~CategorySearch(void)
{
+ DeviceManager::RemoveDeviceEventListener(DEVICE_TYPE_STORAGE_CARD,*this);
if (__pHomeButton != null)
{
delete __pHomeButton;
if(_pFileEventManager != null)
_pFileEventManager->RemovePath(_pathOfSelectedFile);
+ DeviceManager::RemoveAllDeviceEventListeners();
+
if (_pIconListView != null)
{
_pIconListView->RemoveGestureDetector(*_pLongPressGestureDetector);
SceneManager::GetInstance()->RemoveSceneManagerEventListener(*this);
CreateItemSource sourceForm = CREATE_ITEM_SOURCE_CATEGORY_SEARCH_FORM;
((MyFilesApp*) Application::GetInstance())->SetCurrentView(this);
+ FolderNavigationPresentationModel::SetStorageType(MEMORY_TYPE_NONE);
if (_pFolderEntryPM != null)
{
, __pHeaderSave(null)
, __pEditFieldFolderName(null)
, __pHeader(null)
+, __pFileEventManager(null)
, _pFileProgressingPopup(null)
{
entryIsDirectory = 0;
{
delete _pFileProgressingPopup;
}
+
+ if(__pFileEventManager != null)
+ {
+ __pFileEventManager->RemovePath(FolderNavigationPresentationModel::GetCurrentPath());
+ delete __pFileEventManager;
+ __pFileEventManager = null;
+ }
}
CreateFolderForm::CreateFolderForm(const CreateFolderForm& createFolderForm)
__previousFormPath = FolderNavigationPresentationModel::GetCurrentPath();
__previousFormTab = FolderNavigationPresentationModel::GetStorageType();
- __previousSceneId = SceneManager::GetInstance()->GetCurrentSceneId();
__pFooter = GetFooter();
if (__pFooter != null)
__pFileManager = FolderEntryEditorPresentationModel::GetInstance();
TryCatch(__pFileManager != null, , "Failed to allocate file manager");
+ if(__pFileEventManager == null)
+ {
+ __pFileEventManager = new (std::nothrow)FileEventManager();
+ __pFileEventManager->Construct(*this);
+
+ __pFileEventManager->AddPath(FolderNavigationPresentationModel::GetCurrentPath(),FILE_EVENT_TYPE_DELETE);
+ AppLogDebug("AddListener:%s:%S", GetErrorMessage(GetLastResult()), FolderNavigationPresentationModel::GetCurrentPath().GetPointer());
+
+ }
return r;
CATCH:
String msgString;
//String invalidCharacterString;
AppResource::GetInstance()->GetString(L"IDS_CREATE_FOLDER_FAILED", msgString);
- errorMessage.Construct(L"", msgString, MSGBOX_STYLE_NONE, 1000);
+ errorMessage.Construct(L"", msgString, MSGBOX_STYLE_NONE, ID_MESSAGE_BOX_TIMEOUT_ONE_SECOND);
}
FolderNavigationPresentationModel::SetCurrentFilePath(filePath);
TransitionScene();
AppResource::GetInstance()->GetString(L"IDS_NAME_CANT_EMPTY", messageString);
}
- messageBox.Construct(L"", messageString, MSGBOX_STYLE_YESNO, 0);
+ messageBox.Construct(L"", messageString, MSGBOX_STYLE_NONE, ID_MESSAGE_BOX_TIMEOUT_ONE_SECOND);
// Call ShowAndWait - draw, show itself and process events
AppResource::GetInstance()->GetString(L"IDS_NAME_CANT_EMPTY", messageString);
}
- messageBox.Construct(L"", messageString, MSGBOX_STYLE_YESNO, 0);
+ messageBox.Construct(L"", messageString, MSGBOX_STYLE_NONE, ID_MESSAGE_BOX_TIMEOUT_ONE_SECOND);
// Call ShowAndWait - draw, show itself and process events
const Tizen::Ui::Scenes::SceneId& nextSceneId)
{
DeviceManager::RemoveAllDeviceEventListeners();
+ if(__pFileEventManager != null)
+ {
+ __pFileEventManager->RemovePath(FolderNavigationPresentationModel::GetCurrentPath());
+ delete __pFileEventManager;
+ __pFileEventManager = null;
+ }
}
void
void
CreateFolderForm::OnDeviceChange(ComponentType deviceType, const Tizen::Base::String& state)
{
+ AppLogDebug("CreateFolderForm::OnDeviceChange");
bool setMediaPath = false;
bool searchHistoryStatus = false;
MemoryType currentMemoryType = MEMORY_TYPE_PHONE;
if (state == unmounted || state == removed)
{
+ if (__previousSceneId == IDSCN_CATEGORY_SEARCH_FORM)
+ {
+ SceneManager::GetInstance()->GoBackward(BackwardSceneTransition(SCENE_TRANSITION_ANIMATION_TYPE_RIGHT));
+ return;
+ }
currentPath = FolderNavigationPresentationModel::GetCurrentPath();
if (state == unmounted)
{
CreateFolderForm::OnSceneTransitionCompleted(const Tizen::Ui::Scenes::SceneId &previousSceneId,
const Tizen::Ui::Scenes::SceneId ¤tSceneId)
{
+ __previousSceneId = previousSceneId;
SceneManager::GetInstance()->RemoveSceneManagerEventListener(*this);
}
AppLogDebug("EXIT");
}
+
+void
+CreateFolderForm::OnFileEventOccured(const unsigned long events,const Tizen::Base::String & path, const unsigned int eventId)
+{
+ AppLogDebug("Enter");
+ SceneManager::GetInstance()->GoForward(ForwardSceneTransition(IDSCN_TOP_LEVEL_DIRECTORY_FORM, SCENE_TRANSITION_ANIMATION_TYPE_RIGHT, SCENE_HISTORY_OPTION_NO_HISTORY, SCENE_DESTROY_OPTION_DESTROY), null);
+ AppLogDebug("Exit");
+}
__pFileHeaderDetailList = new (std::nothrow) ArrayList();
r = __pFileHeaderDetailList->Construct();
+ __previousSceneId = L"";
+
return true;
}
const Tizen::Ui::Scenes::SceneId ¤tSceneId)
{
SceneManager::GetInstance()->RemoveSceneManagerEventListener(*this);
-
+ __previousSceneId = previousSceneId;
if (__pGroupedDetailListView != null)
{
__pGroupedDetailListView->UpdateList();
void
DetailsForm::OnDeviceChange(ComponentType deviceType, const Tizen::Base::String& state)
{
- AppLogDebug("DetailsForm::OnDeviceChange");
+ AppLogDebug("DetailsForm::OnDeviceChange:%S", __previousSceneId.GetPointer());
bool setMediaPath = false;
bool searchHistoryStatus = false;
if (state == unmounted || state == removed)
{
+ if (__previousSceneId == IDSCN_CATEGORY_SEARCH_FORM)
+ {
+ SceneManager::GetInstance()->GoBackward(BackwardSceneTransition(SCENE_TRANSITION_ANIMATION_TYPE_RIGHT));
+ return;
+ }
currentPath = FolderNavigationPresentationModel::GetCurrentPath();
if (state == unmounted)
{
_pFileEventManager = new (std::nothrow)FileEventManager();
_pFileEventManager->Construct(*this);
}
- AppLogDebug("current path is %ls",FolderNavigationPresentationModel::GetCurrentPath().GetPointer());
- r = _pFileEventManager->AddPath(FolderNavigationPresentationModel::GetCurrentPath(),FILE_EVENT_TYPE_DELETE | FILE_EVENT_TYPE_MOVED_FROM);
+ _pFileEventManager->AddPath(FolderNavigationPresentationModel::GetCurrentPath(),FILE_EVENT_TYPE_DELETE | FILE_EVENT_TYPE_MOVED_FROM);
+
AppLogDebug("Exit %s", GetErrorMessage(r));
return;
FileManageForm::OnSceneDeactivated(const Tizen::Ui::Scenes::SceneId& currentSceneId,
const Tizen::Ui::Scenes::SceneId& nextSceneId)
{
+ AppLogDebug("Enter");
DeviceManager::RemoveAllDeviceEventListeners();
+ if(_pFileEventManager != null)
+ {
+ _pFileEventManager->RemovePath(FolderNavigationPresentationModel::GetCurrentPath());
+ delete _pFileEventManager;
+ _pFileEventManager = null;
+ }
+
((MyFilesApp*)Application::GetInstance())->SetCurrentView(null);
_pFolderEntryPM->StopThumbnailManager(true);
}
void
FileManageForm::OnFileManagingStop(FileManagingResult fileManagingResult)
{
+ AppLogDebug("FileManageForm::OnFileManagingStop");
HideFileProgressingPopup();
switch (fileManagingResult)
}
if(_pFileEventManager != null)
{
+ _pFileEventManager->RemovePath(FolderNavigationPresentationModel::GetCurrentPath());
delete _pFileEventManager;
_pFileEventManager = null;
}
{
if (_pFileManager->GetCheckedListCount() > 0)
{
- _pFileEventManager->RemovePath(FolderNavigationPresentationModel::GetCurrentPath());
+ if (_pFileEventManager != null)
+ {
+ _pFileEventManager->RemovePath(FolderNavigationPresentationModel::GetCurrentPath());
+ delete _pFileEventManager;
+ _pFileEventManager = null;
+ }
AppLogDebug("remove path result %s",GetErrorMessage(GetLastResult()));
SetFooterVisibility(DISABLE_FOOTER_ITEM);
ShowFileProgressingPopup();
{
listView.SetItemChecked(index, false);
}
-
- _pFileEventManager->RemovePath(FolderNavigationPresentationModel::GetCurrentPath());
- delete _pFileEventManager;
- _pFileEventManager = null;
+ if (_pFileEventManager != null)
+ {
+ _pFileEventManager->RemovePath(FolderNavigationPresentationModel::GetCurrentPath());
+ delete _pFileEventManager;
+ _pFileEventManager = null;
+ }
LoadRenameForm(index);
return;
case FILE_MANAGING_RESULT_DELETING_SUCCESS:
{
HideFileProgressingPopup();
- _pFileEventManager->AddPath(FolderNavigationPresentationModel::GetCurrentPath(),FILE_EVENT_TYPE_DELETE);
+ if(_pFileEventManager == null)
+ {
+ _pFileEventManager = new (std::nothrow)FileEventManager();
+ _pFileEventManager->Construct(*this);
+
+ _pFileEventManager->AddPath(FolderNavigationPresentationModel::GetCurrentPath(),FILE_EVENT_TYPE_DELETE);
+
+ }
+
if (_pFileManager != null)
_pFileManager->ClearCheckedList();
case FILE_MANAGING_RESULT_DELETING_FAILED:
{
HideFileProgressingPopup();
- _pFileEventManager->AddPath(FolderNavigationPresentationModel::GetCurrentPath(),FILE_EVENT_TYPE_DELETE);
+ if(_pFileEventManager == null)
+ {
+ _pFileEventManager = new (std::nothrow)FileEventManager();
+ _pFileEventManager->Construct(*this);
+
+ _pFileEventManager->AddPath(FolderNavigationPresentationModel::GetCurrentPath(),FILE_EVENT_TYPE_DELETE);
+
+ }
String deleteFailed;
AppResource* pAppResource = null;
pAppResource = Application::GetInstance()->GetAppResource();
}
if (_pFolderEntryPM!=null)
{
- _pFolderEntryPM->RefreshFolderEntries();
+ if ( (events & FILE_EVENT_TYPE_DELETE) || (events & FILE_EVENT_TYPE_MOVED_FROM) )
+ _pFilenames->RemoveAt(_indexTracker);
+ else
+ _pFolderEntryPM->RefreshFolderEntries();
}
if (_pListView != null && _pListView->IsVisible())
pBitmapToMerge = null;
}
+ AppLogDebug("Exit [%s]:", GetErrorMessage(r));
return thumbMgrRes;
+
CATCH:
- AppLogDebug("Exit [%s]:", GetErrorMessage(r));
+
+ AppLogDebug("Exit Error Message[%s]:", GetErrorMessage(r));
if (pRequest != null)
{
break;
case CONTENT_TYPE_OTHER:
{
+ makeThumbnail = false;
+ bVideo = false;
if (FilePath.EndsWith(L"pdf") || FilePath.EndsWith(L"PDF"))
{
pixelFormat = BITMAP_PIXEL_FORMAT_ARGB8888;
pTempBitmap = pAppResource->GetBitmapN(IDB_PDF, pixelFormat);
- makeThumbnail = false;
return pTempBitmap;
}
else if (FilePath.EndsWith(L"doc") || FilePath.EndsWith(L"DOC"))
{
pixelFormat = BITMAP_PIXEL_FORMAT_ARGB8888;
pTempBitmap = pAppResource->GetBitmapN(IDB_MS_WORD, pixelFormat);
- makeThumbnail = false;
return pTempBitmap;
}
else if (FilePath.EndsWith(L"docx") || FilePath.EndsWith(L"DOCX"))
{
pixelFormat = BITMAP_PIXEL_FORMAT_ARGB8888;
pTempBitmap = pAppResource->GetBitmapN(IDB_MS_WORD, pixelFormat);
- makeThumbnail = false;
return pTempBitmap;
}
else if (FilePath.EndsWith(L"xls") || FilePath.EndsWith(L"XLS"))
{
pixelFormat = BITMAP_PIXEL_FORMAT_ARGB8888;
pTempBitmap = pAppResource->GetBitmapN(IDB_MS_EXCEL, pixelFormat);
- makeThumbnail = false;
return pTempBitmap;
}
else if (FilePath.EndsWith(L"xlsx") || FilePath.EndsWith(L"XLSX"))
{
pixelFormat = BITMAP_PIXEL_FORMAT_ARGB8888;
pTempBitmap = pAppResource->GetBitmapN(IDB_MS_EXCEL, pixelFormat);
- makeThumbnail = false;
return pTempBitmap;
}
else if (FilePath.EndsWith(L"ppt") || FilePath.EndsWith(L"PPT"))
{
pixelFormat = BITMAP_PIXEL_FORMAT_ARGB8888;
pTempBitmap = pAppResource->GetBitmapN(IDB_MS_PPT, pixelFormat);
- makeThumbnail = false;
return pTempBitmap;
}
else if (FilePath.EndsWith(L"pptx") || FilePath.EndsWith(L"PPTX"))
{
pixelFormat = BITMAP_PIXEL_FORMAT_ARGB8888;
pTempBitmap = pAppResource->GetBitmapN(IDB_MS_PPT, pixelFormat);
- makeThumbnail = false;
return pTempBitmap;
}
else if (FilePath.EndsWith(L"html") || FilePath.EndsWith(L"HTML") || FilePath.EndsWith(L"htm") ||
FilePath.EndsWith(L"HTM") || FilePath.EndsWith(L"JS") || FilePath.EndsWith(L"js"))
{
pixelFormat = BITMAP_PIXEL_FORMAT_ARGB8888;
- makeThumbnail = false;
pTempBitmap = pAppResource->GetBitmapN(IDB_HTML, pixelFormat);
return pTempBitmap;
}
else if (FilePath.EndsWith(L"rss") || FilePath.EndsWith(L"RSS"))
{
pixelFormat = BITMAP_PIXEL_FORMAT_ARGB8888;
- makeThumbnail = false;
pTempBitmap = pAppResource->GetBitmapN(IDB_RSS, pixelFormat);
return pTempBitmap;
}
else if (FilePath.EndsWith(L"txt") || FilePath.EndsWith(L"TXT"))
{
pixelFormat = BITMAP_PIXEL_FORMAT_ARGB8888;
- makeThumbnail = false;
pTempBitmap = pAppResource->GetBitmapN(IDB_TEXT, pixelFormat);
return pTempBitmap;
}
{
pixelFormat = BITMAP_PIXEL_FORMAT_ARGB8888;
pTempBitmap = pAppResource->GetBitmapN(IDB_SVG, pixelFormat);
- makeThumbnail = false;
return pTempBitmap;
}
else if (FilePath.EndsWith(L"swf") || FilePath.EndsWith(L"SWF"))
{
pixelFormat = BITMAP_PIXEL_FORMAT_ARGB8888;
- makeThumbnail = false;
pTempBitmap = pAppResource->GetBitmapN(IDB_SWF, pixelFormat);
return pTempBitmap;
}
else if (FilePath.EndsWith(L"tpk") || FilePath.EndsWith(L"TPK"))
{
pixelFormat = BITMAP_PIXEL_FORMAT_ARGB8888;
- makeThumbnail = false;
pTempBitmap = pAppResource->GetBitmapN(IDB_TPK, pixelFormat);
return pTempBitmap;
}
else if (FilePath.EndsWith(L"VCF") || FilePath.EndsWith(L"vcf"))
{
pixelFormat = BITMAP_PIXEL_FORMAT_ARGB8888;
- makeThumbnail = false;
pTempBitmap = pAppResource->GetBitmapN(IDB_VCARD, pixelFormat);
return pTempBitmap;
}
+ else if (FilePath.EndsWith(L"vcs") || FilePath.EndsWith(L"VCS"))
+ {
+ pixelFormat = BITMAP_PIXEL_FORMAT_ARGB8888;
+ pTempBitmap = pAppResource->GetBitmapN(IDB_VCALENDAR, pixelFormat);
+ return pTempBitmap;
+ }
else
{
pixelFormat = BITMAP_PIXEL_FORMAT_ARGB8888;
- makeThumbnail = false;
pTempBitmap = pAppResource->GetBitmapN(IDB_UNKNOWN, pixelFormat);
return pTempBitmap;
}
delete pTempBitmap;
pTempBitmap = null;
}
+ AppLogDebug("EXIT: Error Message [%s]", GetErrorMessage(r));
return null;
}
result
const wchar_t* IDB_UNKNOWN = L"U01_icon_unkown.png";
const wchar_t* IDB_TPK = L"U01_list_icon_tpk-file.png";
const wchar_t* IDB_VCARD = L"U01_list_icon_Vcard.png";
+const wchar_t* IDB_VCALENDAR = L"U01_list_icon_Vcalendar.png";
//Category Icon
const wchar_t* IDB_POPUP_SORTBY_ICON = L"U01_popup_icon_sort_by.png";