rotate progress bar implementation
authorDivya Darshini <d.darshini@samsung.com>
Mon, 8 Apr 2013 11:45:20 +0000 (17:15 +0530)
committerDivya Darshini <d.darshini@samsung.com>
Mon, 8 Apr 2013 11:45:20 +0000 (17:15 +0530)
Change-Id: Ifec79614dc27314cd9c40d6ec788a6aef0fc7d33

26 files changed:
inc/GlAlbumListEditorForm.h
inc/GlAlbumListPresentationModel.h
inc/GlAllListEditorPanel.h
inc/GlAllListSelectionPanel.h
inc/GlFileListPresentationModel.h
inc/GlFileMoveTimer.h
inc/GlFileUpdateTimer.h [moved from inc/GlFileDeleteTimer.h with 58% similarity]
inc/GlIContentFileUpdateManager.h [moved from inc/GlIContentFileDeleteManager.h with 68% similarity]
inc/GlImageListEditorPanel.h
inc/GlTimerBase.h
inc/GlTypes.h
inc/GlVideoListEditorPanel.h
src/GlAlbumListEditorForm.cpp
src/GlAlbumListPresentationModel.cpp
src/GlAlbumNameEditorForm.cpp
src/GlAllListEditorPanel.cpp
src/GlAllListSelectionPanel.cpp
src/GlFileDeleteTimer.cpp [deleted file]
src/GlFileListEditorForm.cpp
src/GlFileListPresentationModel.cpp
src/GlFileMoveTimer.cpp
src/GlFileUpdateTimer.cpp [new file with mode: 0644]
src/GlImageListEditorPanel.cpp
src/GlProgressBar.cpp
src/GlTimerBase.cpp
src/GlVideoListEditorPanel.cpp

index 4078e92..b5262a1 100644 (file)
@@ -32,7 +32,7 @@
 #include <FUi.h>
 #include "GlAlbumEventListener.h"
 #include "GlFormContentUpdateEventListener.h"
-#include "GlFileDeleteTimer.h"
+#include "GlFileUpdateTimer.h"
 
 class AlbumListPresentationModel;
 class AlbumListEditorForm
@@ -104,7 +104,7 @@ private:
        Tizen::Ui::Controls::IconListView* __pEditorFolderIconList;
        Tizen::Ui::Controls::ContextMenu* __pShareContextMenu;
        Tizen::Ui::Controls::Popup* __pDeletePopup;
-       FileDeleteTimer* __pFileDeleteTimer;
+       FileUpdateTimer* __pFileUpdateTimer;
        AlbumListPresentationModel* __pPresentationModel;
 };
 
index 5b7f81b..14e5180 100644 (file)
@@ -32,7 +32,7 @@
 #include <FUi.h>
 #include "GlAlbumEventListener.h"
 #include "GlFormContentUpdateEventListener.h"
-#include "GlIContentFileDeleteManager.h"
+#include "GlIContentFileUpdateManager.h"
 #include "GlResourceManager.h"
 #include "GlThumbnailEventListener.h"
 #include "GlThumbnailProvider.h"
@@ -45,7 +45,7 @@ class AlbumListPresentationModel
        : public Tizen::Base::Object
        , public Tizen::Content::IContentScanListener
        , public Tizen::System::IDeviceEventListener
-       , public IContentFileDeleteManager
+       , public IContentFileUpdateManager
        , public IThumbnailEventListener
 {
 public:
@@ -58,6 +58,8 @@ public:
        static void AddContentEventListener(const IFormContentUpdateEventListener* listener);
        static void RemoveContentEventListener(const IFormContentUpdateEventListener& listener);
 
+       virtual result RotateImage(int index, RotateMode rotateMode);
+       virtual void RequestThumbnail(int index){};
        void RequestThumbnail(const int folderIndex, int pathIndex);
        void CancelThumbnailRequest(const int folderIndex);
        void ClearThumbnailRequests(bool appTerminating = false);
index 822c7cb..d6b3330 100644 (file)
@@ -31,7 +31,7 @@
 #include "GlThumbnailEventListener.h"
 
 class FileListPresentationModel;
-class FileDeleteTimer;
+class FileUpdateTimer;
 
 class AllListEditorPanel
        : public Tizen::Ui::Controls::Panel
@@ -76,7 +76,7 @@ public:
        virtual result OnRequestMessage(void);
        virtual result OnRequestEmail(void);
        virtual result OnRequestSlideShow(void);
-       void OnRotateRequested(RotateMode rotateMode);
+       result OnRequestRotate(RotateMode rotateMode);
 
        virtual void OnFileOpInvalidate(enum FileActionMode __actionId);
        virtual void OnFileOpComplete(enum FileActionMode __actionId, enum FileActionCompleteRes);
@@ -91,7 +91,7 @@ private:
        Tizen::Ui::Controls::Button* __pButtonSelectRegion;
        int __itemCount;
        bool __deleteInProgress;
-       FileDeleteTimer* __pFileDelete;
+       FileUpdateTimer* __pFileUpdateTimer;
        FileListEditorForm* __pFileListEditorForm;
        FileListPresentationModel* __pPresentationModel;
 };
index 3626d34..c4dad7a 100644 (file)
@@ -32,7 +32,7 @@
 #include "GlFileOpInvalidateListener.h"
 
 class FileListPresentationModel;
-class FileDeleteTimer;
+class FileUpdateTimer;
 
 class AllListSelectionPanel
        : public Tizen::Ui::Controls::Panel
@@ -57,7 +57,7 @@ public:
        result OnRequestEmail(void);
        result OnRequestMoveTo(Tizen::Base::String& destDirectory);
        result OnRequestSlideShow(void);
-       void OnRotateRequested(RotateMode rotateMode);
+       result OnRotateRequested(RotateMode rotateMode);
 
        virtual result OnInitializing(void);
        virtual result OnTerminating(void);
@@ -91,7 +91,7 @@ private:
        Tizen::Base::Collection::IList* __pSeletedIndexList;
        int __itemCount;
        FileListEditorForm* __pFileListEditorForm;
-       FileDeleteTimer* __pFileDelete;
+       FileUpdateTimer* __pFileUpdateTimer;
        FileListPresentationModel* __pPresentationModel;
 };
 
index fbc4adf..cd0d651 100644 (file)
@@ -31,7 +31,7 @@
 #include "GlAlbumEventListener.h"
 #include "GlFormContentUpdateEventListener.h"
 #include "GlCommonUtil.h"
-#include "GlIContentFileDeleteManager.h"
+#include "GlIContentFileUpdateManager.h"
 #include "GlResourceManager.h"
 #include "GlThumbnailEventListener.h"
 #include "GlTypes.h"
@@ -42,7 +42,7 @@ class ThumbnailEvent;
 
 class FileListPresentationModel
        : public Tizen::Base::Object
-       , public IContentFileDeleteManager
+       , public IContentFileUpdateManager
        , public IThumbnailEventListener
 {
 public:
@@ -53,7 +53,7 @@ public:
                        Tizen::Graphics::Bitmap*& pThumbnail);
        result GetThumbnailVideoInSyncCacheN(const int index, Tizen::Base::String*& pName,
                        Tizen::Graphics::Bitmap*& pThumbnail, Tizen::Base::String*& pDuration);
-       void RequestThumbnail(const int index);
+       virtual void RequestThumbnail(const int index);
        void CancelThumbnailRequest(const int index);
        void ClearThumbnailRequests(bool appTerminating = false);
 
@@ -97,7 +97,7 @@ public:
        void OnContentUpdated(Tizen::Content::ContentId contentId, Tizen::Content::ContentType contentType, result r);
        void OnContentDeleted(Tizen::Content::ContentId contentId, Tizen::Content::ContentType contentType, result r);
 
-       void RotateImage(Tizen::Base::String& filePath, RotateMode rotateMode);
+       virtual result RotateImage(int index, RotateMode rotateMode);
 private:
        FileListPresentationModel(void);
        virtual ~FileListPresentationModel(void);
@@ -153,7 +153,7 @@ private:
        bool __updateProgressStatus;
 
        friend class FileMoveTimer;
-       friend class FileDeleteTimer;
+       friend class FileUpdateTimer;
 };
 
 #endif /* _GL_FILE_LIST_PRESENTATION_MODEL_H_ */
index 2365bc1..5403074 100644 (file)
@@ -38,7 +38,7 @@ public :
 
 private:
        virtual Tizen::Base::Collection::IList * TimerStart(void);
-       virtual result TimerExpired(const ContentId& contentId);
+       virtual result TimerExpired(const Object* contentId);
        virtual void TimerCancel(int, enum FileActionCancelRes res);
        virtual void TimerComplete(int, enum FileActionCompleteRes res);
 
similarity index 58%
rename from inc/GlFileDeleteTimer.h
rename to inc/GlFileUpdateTimer.h
index 917b185..e732f87 100644 (file)
 //
 
 /**
- * @file               FileDeleteTimer.h
- * @brief              This is the header file for FileDeleteTimer class.
+ * @file               FileUpdateTimer.h
+ * @brief              This is the header file for FileUpdateTimer class.
  */
-#ifndef _GL_FILE_DELETE_TIMER_H_
-#define _GL_FILE_DELETE_TIMER_H_
+#ifndef _GL_FILE_UPDATE_TIMER_H_
+#define _GL_FILE_UPDATE_TIMER_H_
 
-#include "GlIContentFileDeleteManager.h"
+#include "GlIContentFileUpdateManager.h"
 #include "GlTimerBase.h"
 
 class FileListPresentationModel;
 
-class FileDeleteTimer
+class FileUpdateTimer
        : public GlTimerBase
 {
 public:
-       FileDeleteTimer(Tizen::Base::Collection::IList*, IContentFileDeleteManager*, IFileOpInvalidateListener*);
-       virtual ~FileDeleteTimer(void);
+       FileUpdateTimer(Tizen::Base::Collection::IList*, IContentFileUpdateManager*, IFileOpInvalidateListener*, FileActionMode, RotateMode rotateMode = ROTATE_MODE_RIGHT);
+       virtual ~FileUpdateTimer(void);
 
 private:
        virtual Tizen::Base::Collection::IList * TimerStart(void);
-       virtual result TimerExpired(const ContentId& contentId);
+       virtual result TimerExpired(const Object* contentId);
        virtual void TimerCancel(int, enum FileActionCancelRes res);
        virtual void TimerComplete(int, enum FileActionCompleteRes res);
 
 private :
-       Tizen::Base::Collection::IList* __pDeleteIndexList;
-       IContentFileDeleteManager* __pFileDeleteManager;
+       Tizen::Base::Collection::IList* __pUpdateIndexList;
+       IContentFileUpdateManager* __pFileUpdateManager;
+       RotateMode __rotateMode;
 };
 
-#endif // _GL_FILE_DELETE_TIMER_H_
+#endif // _GL_FILE_UPDATE_TIMER_H_
similarity index 68%
rename from inc/GlIContentFileDeleteManager.h
rename to inc/GlIContentFileUpdateManager.h
index d850ad6..42a3836 100644 (file)
 //
 
 /**
- * @file               GlIContentFileDeleteManager.h
+ * @file               GlIContentFileUpdateManager.h
  * @brief              This is the header file for IContentFileDeleteManager class.
  */
 
-#ifndef _GL_ICONTENT_FILE_DELETE_MANAGER_H_
-#define _GL_ICONTENT_FILE_DELETE_MANAGER_H_
+#ifndef _GL_ICONTENT_FILE_UPDATE_MANAGER_H_
+#define _GL_ICONTENT_FILE_UPDATE_MANAGER_H_
 
 #include <FBase.h>
+#include "GlTypes.h"
 
-class IContentFileDeleteManager
+class IContentFileUpdateManager
 {
 public:
-       IContentFileDeleteManager(){}
-       virtual ~IContentFileDeleteManager(){}
+       IContentFileUpdateManager(){}
+       virtual ~IContentFileUpdateManager(){}
+
        virtual Tizen::Base::Collection::IList* GetContentIdListAtIndexN(const Tizen::Base::Collection::IList& indexList) = 0;
        virtual result DeleteContentFile(const Tizen::Content::ContentId& contentId) = 0;
+       virtual result RotateImage(int index, RotateMode rotateMode) = 0;
+       virtual void RequestThumbnail(const int index) = 0;
 };
 
-#endif /* _GL_ICONTENT_FILE_DELETE_MANAGER_H_ */
+#endif /* _GL_ICONTENT_FILE_UPDATE_MANAGER_H_ */
index 28a7ba6..d3d12c6 100644 (file)
@@ -30,7 +30,7 @@
 #include "GlFileListEditorForm.h"
 
 class FileListPresentationModel;
-class FileDeleteTimer;
+class FileUpdateTimer;
 
 class ImageListEditorPanel
        : public Tizen::Ui::Controls::Panel
@@ -81,7 +81,7 @@ private:
        Tizen::Ui::Controls::Label* __pLabelSelectCnt;
        int __itemCount;
        FileListPresentationModel* __pPresentationModel;
-       FileDeleteTimer* __pFileDelete;
+       FileUpdateTimer* __pFileDelete;
        FileListEditorForm* __pFileListEditorForm;
 };
 
index 3f96b5b..de333a7 100644 (file)
@@ -51,7 +51,7 @@ public:
 
 protected:
        virtual Tizen::Base::Collection::IList * TimerStart(void) = 0;
-       virtual result TimerExpired(const ContentId&) = 0;
+       virtual result TimerExpired(const Object*) = 0;
        virtual void TimerCancel(int, enum FileActionCancelRes res) = 0;
        virtual void TimerComplete(int, enum FileActionCompleteRes res) = 0;
 
@@ -59,13 +59,14 @@ private:
        void OnOpComplete(enum FileActionCompleteRes);
        void OnOpCancelled(enum FileActionCancelRes res);
 
+protected:
+       enum FileActionMode __actionId;
 private:
        Timer __moveTimer;
        Tizen::Base::Collection::IList * __pContentIdList;
        int __moveToCount;
        GlProgressBar* __pMoveProBar;
        IFileOpInvalidateListener* __pInvalidate;
-       enum FileActionMode __actionId;
  };
 
 #endif //__GL_TIMER_BASE_H_
index 608ab5c..b090beb 100644 (file)
@@ -112,8 +112,9 @@ enum FileActionMode
 {
        FILE_DELETE_ACTION,
        FILE_MOVE_ACTION,
+       FILE_COPY_ACTION,
        FILE_RENAME_ACTION,
-       FILE_COPY_ACTION
+       FILE_ROTATE_ACTION
 };
 
 enum FileActionCancelRes
index be41898..6d8f522 100644 (file)
@@ -29,7 +29,7 @@
 #include "GlFileOpInvalidateListener.h"
 
 class FileListPresentationModel;
-class FileDeleteTimer;
+class FileUpdateTimer;
 
 class VideoListEditorPanel
        : public Tizen::Ui::Controls::Panel
@@ -83,7 +83,7 @@ private:
        Tizen::Ui::Controls::Label* __pLabelSelectCnt;
        int __itemCount;
        FileListPresentationModel* __pPresentationModel;
-       FileDeleteTimer* __pFileDelete;
+       FileUpdateTimer* __pFileDelete;
 };
 
 #endif /* _GL_VIDEO_LIST_EDITOR_PANEL_H_ */
index de07441..abb1b7f 100644 (file)
@@ -65,7 +65,7 @@ AlbumListEditorForm::AlbumListEditorForm()
        , __pEditorFolderIconList(null)
        , __pShareContextMenu(null)
        , __pDeletePopup(null)
-       , __pFileDeleteTimer(null)
+       , __pFileUpdateTimer(null)
        , __pPresentationModel(null)
 {
        AppLogDebug("ENTER");
@@ -122,10 +122,10 @@ AlbumListEditorForm::OnTerminating(void)
                delete __pDeletePopup;
                __pDeletePopup = null;
        }
-       if (__pFileDeleteTimer != null)
+       if (__pFileUpdateTimer != null)
        {
-               delete __pFileDeleteTimer;
-               __pFileDeleteTimer = null;
+               delete __pFileUpdateTimer;
+               __pFileUpdateTimer = null;
        }
        AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
 
@@ -412,17 +412,17 @@ AlbumListEditorForm::DeleteFolder()
                return E_FAILURE;
        }
 
-       if (__pFileDeleteTimer != null)
+       if (__pFileUpdateTimer != null)
        {
-               delete __pFileDeleteTimer;
+               delete __pFileUpdateTimer;
        }
-       __pFileDeleteTimer = new FileDeleteTimer(pIndexList, __pPresentationModel, this);
-       result r = __pFileDeleteTimer->StartTimer();
+       __pFileUpdateTimer = new FileUpdateTimer(pIndexList, __pPresentationModel, this, FILE_DELETE_ACTION);
+       result r = __pFileUpdateTimer->StartTimer();
 
        if (IsFailed(r))
        {
-               delete __pFileDeleteTimer;
-               __pFileDeleteTimer = null;
+               delete __pFileUpdateTimer;
+               __pFileUpdateTimer = null;
                return E_FAILURE;
        }
        else
index 5d5127d..3e2c605 100644 (file)
@@ -1133,6 +1133,12 @@ AlbumListPresentationModel::SetUpdateProgressStatus(bool status)
        AppLogDebug("EXIT");
 }
 
+result
+AlbumListPresentationModel::RotateImage(int index, RotateMode rotateMode)
+{
+       return E_SUCCESS;
+}
+
 void
 AlbumListPresentationModel::RequestThumbnail(const int folderIndex, int pathIndex)
 {
index 8c3ac37..56330c1 100644 (file)
@@ -254,8 +254,6 @@ AlbumNameEditorForm::OnRenameAlbum(const String& strOri)
                        __overlayMsg = false;
                        delete __pMessageBox;
                        __pMessageBox = null;
-                       SceneManager* pSceneManager = SceneManager::GetInstance();
-                       pSceneManager->GoBackward(BackwardSceneTransition(__callerSceneId));
                }
        }
        else
index 0f32119..9722435 100644 (file)
@@ -23,7 +23,7 @@
 #include <FMedia.h>
 #include "GlAllListEditorPanel.h"
 #include "GlCommonUtil.h"
-#include "GlFileDeleteTimer.h"
+#include "GlFileUpdateTimer.h"
 #include "GlFileListEditorForm.h"
 #include "GlFileListPresentationModel.h"
 #include "GlResourceManager.h"
@@ -61,7 +61,7 @@ AllListEditorPanel::AllListEditorPanel(void)
        , __pLabelSelectCnt(null)
        , __pButtonSelectRegion(null)
        , __itemCount(0)
-       , __pFileDelete(null)
+       , __pFileUpdateTimer(null)
        , __pFileListEditorForm(null)
 , __pPresentationModel(null)
 {
@@ -72,7 +72,7 @@ AllListEditorPanel::AllListEditorPanel(void)
 AllListEditorPanel::~AllListEditorPanel(void)
 {
        AppLogDebug("ENTER");
-       delete __pFileDelete;
+       delete __pFileUpdateTimer;
        AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
 }
 
@@ -519,14 +519,14 @@ AllListEditorPanel::OnRequestDelete(void)
                return E_FAILURE;
        }
 
-       delete __pFileDelete;
-       __pFileDelete = new FileDeleteTimer(pIndexList, __pPresentationModel, this);
-       result r = __pFileDelete->StartTimer();
+       delete __pFileUpdateTimer;
+       __pFileUpdateTimer = new FileUpdateTimer(pIndexList, __pPresentationModel, this, FILE_DELETE_ACTION);
+       result r = __pFileUpdateTimer->StartTimer();
 
        if (IsFailed(r))
        {
-               delete __pFileDelete;
-               __pFileDelete = null;
+               delete __pFileUpdateTimer;
+               __pFileUpdateTimer = null;
                return E_FAILURE;
        }
        else
@@ -787,36 +787,38 @@ AllListEditorPanel::SelectAllPressed(void)
        SetButtonState();
 }
 
-void
-AllListEditorPanel::OnRotateRequested(RotateMode rotateMode)
+result
+AllListEditorPanel::OnRequestRotate(RotateMode rotateMode)
 {
-
        AppLogDebug("ENTER");
        IList* pIndexList = GetItemCheckedIndexListN();
        if (pIndexList == null)
        {
                AppLogDebug("EXIT 1(%s)", GetErrorMessage(GetLastResult()));
-               return;
+               return E_FAILURE;
        }
+       else if (pIndexList->GetCount() <= 0)
+       {
+               delete pIndexList;
+               AppLogDebug("EXIT 1(%s)", GetErrorMessage(GetLastResult()));
 
-       Integer* pRealIndex = null;
-       int realIndex = -1;
-       ArrayList* pArrayList = new (std::nothrow) ArrayList(SingleObjectDeleter);
-       pArrayList->Construct();
-       int loopCount = pIndexList->GetCount();
+               return E_FAILURE;
+       }
 
-       for (int i = 0; i < loopCount; ++i)
+       delete __pFileUpdateTimer;
+       __pFileUpdateTimer = new FileUpdateTimer(pIndexList, __pPresentationModel, this, FILE_ROTATE_ACTION, rotateMode);
+       result r = __pFileUpdateTimer->StartTimer();
+
+       if (IsFailed(r))
        {
-               pRealIndex = static_cast<Integer*>(pIndexList->GetAt(i));
-               if (pRealIndex != null)
-               {
-                       realIndex = pRealIndex->ToInt();
-                       pArrayList->Add(new (std::nothrow) String(__pPresentationModel->GetContentFilePath(realIndex)));
-                       String filePath = __pPresentationModel->GetContentFilePath(realIndex);
-                       __pPresentationModel->RotateImage(filePath, rotateMode);
-                       ContentManager::ScanFile(filePath);
-                       __pPresentationModel->RequestThumbnail(realIndex);
-               }
+               delete __pFileUpdateTimer;
+               __pFileUpdateTimer = null;
+               return E_FAILURE;
        }
+       else
+       {
+               __pPresentationModel->SetUpdateProgressStatus(true);
+       }
+       return E_SUCCESS;
 }
 
index 99a0d46..35ec1f0 100644 (file)
@@ -27,7 +27,7 @@
 #include "GlFileListPresentationModel.h"
 #include "GlResourceManager.h"
 #include "GlTypes.h"
-#include "GlFileDeleteTimer.h"
+#include "GlFileUpdateTimer.h"
 
 using namespace Tizen::App;
 using namespace Tizen::Base;
@@ -54,7 +54,7 @@ AllListSelectionPanel::AllListSelectionPanel(void)
        , __pSeletedIndexList(null)
        , __itemCount(0)
        , __pFileListEditorForm(null)
-       , __pFileDelete(null)
+       , __pFileUpdateTimer(null)
        , __pPresentationModel(null)
 {
        AppLogDebug("ENTER");
@@ -64,7 +64,7 @@ AllListSelectionPanel::AllListSelectionPanel(void)
 AllListSelectionPanel::~AllListSelectionPanel(void)
 {
        AppLogDebug("ENTER");
-       delete __pFileDelete;
+       delete __pFileUpdateTimer;
        AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
 }
 
@@ -431,14 +431,14 @@ AllListSelectionPanel::OnRequestDelete(void)
                return E_FAILURE;
        }
 
-       delete __pFileDelete;
-       __pFileDelete = new FileDeleteTimer(pIndexList, __pPresentationModel, this);
-       result r = __pFileDelete->StartTimer();
+       delete __pFileUpdateTimer;
+       __pFileUpdateTimer = new FileUpdateTimer(pIndexList, __pPresentationModel, this, FILE_DELETE_ACTION);
+       result r = __pFileUpdateTimer->StartTimer();
 
        if (IsFailed(r))
        {
-               delete __pFileDelete;
-               __pFileDelete = null;
+               delete __pFileUpdateTimer;
+               __pFileUpdateTimer = null;
                return E_FAILURE;
        }
        else
@@ -700,37 +700,38 @@ AllListSelectionPanel::SelectAllPressed(void)
        SetButtonState();
 }
 
-void
+result
 AllListSelectionPanel::OnRotateRequested(RotateMode rotateMode)
 {
-
        AppLogDebug("ENTER");
        IList* pIndexList = GetItemCheckedIndexListN();
        if (pIndexList == null)
        {
                AppLogDebug("EXIT 1(%s)", GetErrorMessage(GetLastResult()));
-               return;
+               return E_FAILURE;
        }
+       else if (pIndexList->GetCount() <= 0)
+       {
+               delete pIndexList;
+               AppLogDebug("EXIT 1(%s)", GetErrorMessage(GetLastResult()));
 
-       Integer* pRealIndex = null;
-       int realIndex = -1;
-       ArrayList* pArrayList = new (std::nothrow) ArrayList(SingleObjectDeleter);
-       pArrayList->Construct();
-       int loopCount = pIndexList->GetCount();
+               return E_FAILURE;
+       }
 
-       for (int i = 0; i < loopCount; ++i)
+       delete __pFileUpdateTimer;
+       __pFileUpdateTimer = new FileUpdateTimer(pIndexList, __pPresentationModel, this, FILE_ROTATE_ACTION, rotateMode);
+       result r = __pFileUpdateTimer->StartTimer();
+
+       if (IsFailed(r))
        {
-               pRealIndex = static_cast<Integer*>(pIndexList->GetAt(i));
-               if (pRealIndex != null)
-               {
-                       realIndex = pRealIndex->ToInt();
-                       pArrayList->Add(new (std::nothrow) String(__pPresentationModel->GetContentFilePath(realIndex)));
-                       String filePath = __pPresentationModel->GetContentFilePath(realIndex);
-                       __pPresentationModel->RotateImage(filePath, rotateMode);
-                       ContentManager::ScanFile(filePath);
-                       __pPresentationModel->RequestThumbnail(realIndex);
-               }
+               delete __pFileUpdateTimer;
+               __pFileUpdateTimer = null;
+               return E_FAILURE;
        }
-
+       else
+       {
+               __pPresentationModel->SetUpdateProgressStatus(true);
+       }
+       return E_SUCCESS;
 }
 
diff --git a/src/GlFileDeleteTimer.cpp b/src/GlFileDeleteTimer.cpp
deleted file mode 100644 (file)
index 7084131..0000000
+++ /dev/null
@@ -1,70 +0,0 @@
-//
-// Copyright (c) 2012 Samsung Electronics Co., Ltd.
-//
-// Licensed under the Flora License, Version 1.0 (the License);
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://floralicense.org/license/
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an AS IS BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-
-/**
- * @file               FileDeleteTimer.cpp
- * @brief              This is the source file for FileDeleteTimer class.
- */
-
-#include <FBase.h>
-#include <FContent.h>
-#include <FMedia.h>
-#include <FSystem.h>
-#include <FUi.h>
-
-#include "GlFileDeleteTimer.h"
-#include "GlFileListPresentationModel.h"
-
-using namespace Tizen::Base;
-using namespace Tizen::Base::Collection;
-using namespace Tizen::Base::Utility;
-using namespace Tizen::Content;
-using namespace Tizen::Io;
-using namespace Tizen::Ui;
-using namespace Tizen::Ui::Controls;
-using namespace Tizen::Ui::Scenes;
-
-FileDeleteTimer::FileDeleteTimer(Tizen::Base::Collection::IList* pDelList
-       , IContentFileDeleteManager* pFDM
-       , IFileOpInvalidateListener* invalidate)
-       : GlTimerBase(invalidate, FILE_DELETE_ACTION)
-       , __pDeleteIndexList(pDelList)
-       , __pFileDeleteManager(pFDM)
-{
-}
-
-FileDeleteTimer::~FileDeleteTimer(void)
-{
-       delete __pDeleteIndexList;
-}
-
-IList * FileDeleteTimer::TimerStart(void)
-{
-       return __pFileDeleteManager->GetContentIdListAtIndexN(*__pDeleteIndexList);
-}
-
-result FileDeleteTimer::TimerExpired(const ContentId& contentId)
-{
-       return __pFileDeleteManager->DeleteContentFile(contentId);
-}
-
-void FileDeleteTimer::TimerCancel(int, enum FileActionCancelRes res)
-{
-}
-
-void FileDeleteTimer::TimerComplete(int, enum FileActionCompleteRes res)
-{
-}
index 3767cdc..fcd78a1 100644 (file)
@@ -669,7 +669,7 @@ FileListEditorForm::OnActionPerformed(const Control& source, int actionId)
                        if (pEditorPanel != null)
                        {
                                RotateMode rotateMode = ROTATE_MODE_LEFT;
-                               pEditorPanel->OnRotateRequested(rotateMode);
+                               pEditorPanel->OnRequestRotate(rotateMode);
                        }
                }
                else if (pSceneManager->GetCurrentSceneId() == IDSCN_ALL_LIST_SELECTION)
@@ -695,7 +695,7 @@ FileListEditorForm::OnActionPerformed(const Control& source, int actionId)
                        if (pEditorPanel != null)
                        {
                                RotateMode rotateMode = ROTATE_MODE_RIGHT;
-                               pEditorPanel->OnRotateRequested(rotateMode);
+                               pEditorPanel->OnRequestRotate(rotateMode);
                        }
                }
                else if (pSceneManager->GetCurrentSceneId() == IDSCN_ALL_LIST_SELECTION)
index c03abf0..8f93fe8 100644 (file)
@@ -1586,8 +1586,8 @@ FileListPresentationModel::SetUpdateProgressStatus(bool status)
        AppLogDebug("EXIT");
 }
 
-void
-FileListPresentationModel::RotateImage(String& filePath, RotateMode rotateMode)
+result
+FileListPresentationModel::RotateImage(int index, RotateMode rotateMode)
 {
        result r = E_SUCCESS;
        ImageBuffer* pRotatedBuffer = null;
@@ -1596,6 +1596,8 @@ FileListPresentationModel::RotateImage(String& filePath, RotateMode rotateMode)
        int width = 0;
        int height = 0;
        pRotatedBuffer = new (std::nothrow) ImageBuffer();
+
+       String filePath = GetContentFilePath(index);
        r = pRotatedBuffer->Construct(filePath);
        ImageBuffer::GetImageInfo(filePath, imageFormat, width, height);
 
@@ -1612,9 +1614,10 @@ FileListPresentationModel::RotateImage(String& filePath, RotateMode rotateMode)
        }
        TryCatch(pRotatedBuffer1 != null, r = GetLastResult(), "RotateN failed:%s", GetErrorMessage(GetLastResult()));
        pRotatedBuffer1->EncodeToFile(filePath, imageFormat, true, 100);
+       ContentManager::ScanFile(filePath);
        delete pRotatedBuffer1;
        delete pRotatedBuffer;
-       return;
+       return r;
 
        CATCH:
        if (pRotatedBuffer != null) //this buffer is no longer used
@@ -1625,5 +1628,5 @@ FileListPresentationModel::RotateImage(String& filePath, RotateMode rotateMode)
        {
                delete pRotatedBuffer1;
        }
-       return;
+       return r;
 }
index bcc3450..b90b837 100644 (file)
@@ -84,10 +84,10 @@ IList * FileMoveTimer::TimerStart(void)
        }
 }
 
-result FileMoveTimer::TimerExpired(const ContentId& contentId)
+result FileMoveTimer::TimerExpired(const Object* contentId)
 {
        AppLogDebug("ENTER");
-       return __pPresentationModel->MoveToContentFile(contentId, __moveToDir, __isCopyOperation);
+       return __pPresentationModel->MoveToContentFile(*static_cast<const ContentId*>(contentId), __moveToDir, __isCopyOperation);
 }
 
 void FileMoveTimer::TimerCancel(int, enum FileActionCancelRes res)
diff --git a/src/GlFileUpdateTimer.cpp b/src/GlFileUpdateTimer.cpp
new file mode 100644 (file)
index 0000000..a3225f0
--- /dev/null
@@ -0,0 +1,97 @@
+//
+// Copyright (c) 2012 Samsung Electronics Co., Ltd.
+//
+// Licensed under the Flora License, Version 1.0 (the License);
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://floralicense.org/license/
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an AS IS BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+
+/**
+ * @file               FileUpdateTimer.cpp
+ * @brief              This is the source file for FileUpdateTimer class.
+ */
+
+#include <FBase.h>
+#include <FContent.h>
+#include <FMedia.h>
+#include <FSystem.h>
+#include <FUi.h>
+
+#include "GlFileUpdateTimer.h"
+#include "GlFileListPresentationModel.h"
+
+using namespace Tizen::Base;
+using namespace Tizen::Base::Collection;
+using namespace Tizen::Base::Utility;
+using namespace Tizen::Content;
+using namespace Tizen::Io;
+using namespace Tizen::Ui;
+using namespace Tizen::Ui::Controls;
+using namespace Tizen::Ui::Scenes;
+
+FileUpdateTimer::FileUpdateTimer(Tizen::Base::Collection::IList* pDelList
+       , IContentFileUpdateManager* pFDM
+       , IFileOpInvalidateListener* invalidate
+       , FileActionMode actionId
+       , RotateMode rotateMode)
+       : GlTimerBase(invalidate, actionId)
+       , __pUpdateIndexList(pDelList)
+       , __pFileUpdateManager(pFDM)
+       , __rotateMode(rotateMode)
+{
+}
+
+FileUpdateTimer::~FileUpdateTimer(void)
+{
+       if (__actionId == FILE_DELETE_ACTION)
+       {
+               delete __pUpdateIndexList;
+       }
+}
+
+IList * FileUpdateTimer::TimerStart(void)
+{
+       if (__actionId == FILE_DELETE_ACTION)
+       {
+               return __pFileUpdateManager->GetContentIdListAtIndexN(*__pUpdateIndexList);
+       }
+       else // if (__actionId == FILE_ROTATE_ACTION)
+       {
+               return __pUpdateIndexList;
+       }
+}
+
+result FileUpdateTimer::TimerExpired(const Object* contentId)
+{
+       if (__actionId == FILE_DELETE_ACTION)
+       {
+               return __pFileUpdateManager->DeleteContentFile(*(static_cast<const ContentId*>(contentId)));
+       }
+       else // if (__actionId == FILE_ROTATE_ACTION)
+       {
+               result r = E_SUCCESS;
+               const Integer* pIndex = static_cast<const Integer*>(contentId);
+               if (pIndex != null)
+               {
+                       r = __pFileUpdateManager->RotateImage(pIndex->ToInt(), __rotateMode);
+                       __pFileUpdateManager->RequestThumbnail(pIndex->ToInt());
+               }
+               return r;
+       }
+}
+
+void FileUpdateTimer::TimerCancel(int, enum FileActionCancelRes res)
+{
+}
+
+void FileUpdateTimer::TimerComplete(int, enum FileActionCompleteRes res)
+{
+}
index b6b6afb..00e930d 100644 (file)
@@ -28,7 +28,7 @@
 #include "GlImageListEditorPanel.h"
 #include "GlResourceManager.h"
 #include "GlTypes.h"
-#include "GlFileDeleteTimer.h"
+#include "GlFileUpdateTimer.h"
 #include "GlFileListEditorForm.h"
 
 using namespace Tizen::App;
index 0b77414..065fcd1 100644 (file)
@@ -148,6 +148,9 @@ GlProgressBar::ShowFileProgressingPopup(int val, enum FileActionMode action)
                        case FILE_COPY_ACTION:
                                __pFileProgressingHeaderLabel->SetText(L"Copying...");
                                break;
+                       case FILE_ROTATE_ACTION:
+                               __pFileProgressingHeaderLabel->SetText(L"Rotating...");
+                               break;
                        default:
                                break;
                        }
index 05bea32..1f4e0f5 100644 (file)
 using namespace Tizen::Ui;
 
 GlTimerBase::GlTimerBase(IFileOpInvalidateListener* invalidateListener, enum FileActionMode actionId)
-       : __pContentIdList(null)
+       : __actionId(actionId)
+       , __pContentIdList(null)
        , __moveToCount(0)
        , __pMoveProBar(null)
        , __pInvalidate(invalidateListener)
-       , __actionId(actionId)
 {
        AppLogDebug("ENTER");
        AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
@@ -90,10 +90,9 @@ GlTimerBase::OnTimerExpired(Timer& timer)
                if (__moveToCount < __pContentIdList->GetCount())
                {
                        AppLogDebug("__pContentIdList count is %d", __pContentIdList->GetCount());
-                       ContentId* pContentId = static_cast<ContentId*>(__pContentIdList->GetAt(__moveToCount));
-                       if (pContentId != null)
+                       if (__pContentIdList->GetAt(__moveToCount) != null)
                        {
-                               result r = TimerExpired(*pContentId);
+                               result r = TimerExpired(__pContentIdList->GetAt(__moveToCount));
                                if (IsFailed(r))
                                {
                                        AppLogDebug("OnTimerExpired EXIT(%s)", GetErrorMessage(r));
index c57b16f..287e426 100644 (file)
@@ -29,7 +29,7 @@
 #include "GlTypes.h"
 #include "GlVideoListEditorPanel.h"
 #include "GlFileListEditorForm.h"
-#include "GlFileDeleteTimer.h"
+#include "GlFileUpdateTimer.h"
 
 using namespace Tizen::App;
 using namespace Tizen::Base;