Arrange code
[apps/osp/Gallery.git] / src / GlAllListSelectionPanel.cpp
index 3bed0bf..95f6ae6 100644 (file)
@@ -1,7 +1,7 @@
 //
 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
 //
-// Licensed under the Flora License, Version 1.0 (the License);
+// Licensed under the Flora License, Version 1.1 (the License);
 // you may not use this file except in compliance with the License.
 // You may obtain a copy of the License at
 //
  * @brief              This is the implementation file for AllListSelectionPanel class.
  */
 
-#include <FContent.h>
-#include <FMedia.h>
 #include "GlAllListSelectionPanel.h"
 #include "GlCommonUtil.h"
 #include "GlFileListEditorForm.h"
 #include "GlFileListPresentationModel.h"
 #include "GlResourceManager.h"
 #include "GlTypes.h"
-#include "GlFileDeleteTimer.h"
+#include "GlFileUpdateTimer.h"
 
 using namespace Tizen::App;
 using namespace Tizen::Base;
@@ -50,12 +48,12 @@ static const int ALPHA_THUMBNAIL_DIM = 70;
 static const Rectangle RECT_INITIAL (0, 0, 10, 10);
 
 AllListSelectionPanel::AllListSelectionPanel(void)
-       : __pContentIconListView(null)
+       : __itemCount(0)
+       , __pContentIconListView(null)
        , __pSeletedIndexList(null)
-       , __itemCount(0)
-       , __deleteInProgress(false)
+       , __pFileListEditorForm(null)
+       , __pFileUpdateTimer(null)
        , __pPresentationModel(null)
-       , __pFileDelete(null)
 {
        AppLogDebug("ENTER");
        AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
@@ -64,7 +62,7 @@ AllListSelectionPanel::AllListSelectionPanel(void)
 AllListSelectionPanel::~AllListSelectionPanel(void)
 {
        AppLogDebug("ENTER");
-       delete __pFileDelete;
+       delete __pFileUpdateTimer;
        AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
 }
 
@@ -111,7 +109,7 @@ AllListSelectionPanel::OnInitializing(void)
        __pContentIconListView->SetCheckBoxPosition(ICON_LIST_VIEW_CHECK_BOX_POSITION_TOP_LEFT);
        __pContentIconListView->AddIconListViewItemEventListener(*this);
        __pContentIconListView->SetTouchAnimationEnabled(false);
-       AddControl(*__pContentIconListView);
+       AddControl(__pContentIconListView);
        __pContentIconListView->SetShowState(true);
 
        __itemCount = 0;
@@ -120,24 +118,6 @@ AllListSelectionPanel::OnInitializing(void)
        return r;
 }
 
-void
-AllListSelectionPanel::OnUpdateContentList()
-{
-       AppLogDebug("ENTER");
-       SceneManager* pSceneManager = SceneManager::GetInstance();
-       FileListEditorForm* pFileListEditorForm =
-                       dynamic_cast<FileListEditorForm*>(pSceneManager->GetCurrentScene()->GetForm());
-       TryReturnVoid(pFileListEditorForm != null, "[%s] fail to get SceneManager.",
-                       GetErrorMessage(GetLastResult()));
-
-       if ( pFileListEditorForm->GetOverlayStatus() == false && __deleteInProgress == false )
-       {
-               SceneManager* pSceneManager = SceneManager::GetInstance();
-               pSceneManager->GoForward(ForwardSceneTransition(IDSCN_ALL_LIST));
-       }
-       AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
-}
-
 result
 AllListSelectionPanel::OnTerminating(void)
 {
@@ -213,6 +193,7 @@ AllListSelectionPanel::CreateItem(int index)
                else
                {
                        AppLogDebug("EXIT 1(%s)", GetErrorMessage(GetLastResult()));
+                       delete pItemText;
                        return null;
                }
 
@@ -255,15 +236,10 @@ AllListSelectionPanel::OnIconListViewItemStateChanged(IconListView& view, int in
                SceneManager* pSceneManager = SceneManager::GetInstance();
                TryReturnVoid(pSceneManager != null, "[%s] fail to get SceneManager.", GetErrorMessage(GetLastResult()));
 
-               FileListEditorForm* pFileListEditorForm =
-                               dynamic_cast<FileListEditorForm*>(pSceneManager->GetCurrentScene()->GetForm());
-               TryReturnVoid(pFileListEditorForm != null, "[%s] fail to get FileListEditorForm.",
-                               GetErrorMessage(GetLastResult()));
-
                String strTmp;
                strTmp.Format(LENGTH_COUNT_LABEL, L"%ls (%d)",
                                ResourceManager::GetString(L"IDS_COM_BODY_SELECTED").GetPointer(), GetItemCheckedCount());
-               pFileListEditorForm->SetTitleText(strTmp);
+               __pFileListEditorForm->SetTitleText(strTmp);
                __pContentIconListView->RefreshList(index, LIST_REFRESH_TYPE_ITEM_MODIFY);
        }
 
@@ -304,17 +280,23 @@ AllListSelectionPanel::OnSceneActivatedN(const SceneId& previousSceneId,
                const SceneId& currentSceneId, IList* pArgs)
 {
        AppLogDebug("ENTER");
+
+       ChangeOrientation();
+
        __pPresentationModel = FileListPresentationModel::GetInstance();
 
        SceneManager* pSceneManager = SceneManager::GetInstance();
        TryReturnVoid(pSceneManager != null, "[%s] fail to get SceneManager.", GetErrorMessage(GetLastResult()));
 
+       __pFileListEditorForm = dynamic_cast<FileListEditorForm*>(pSceneManager->GetCurrentScene()->GetForm());
+       TryReturnVoid(__pFileListEditorForm != null, "[%s] fail to get FileListEditorForm.", GetErrorMessage(GetLastResult()));
+       __pPresentationModel->AddContentEventListener(__pFileListEditorForm);
+
        if (previousSceneId == IDSCN_ALL_LIST_EDITOR)
        {
                if (pArgs != null)
                {
                        __pSeletedIndexList = pArgs;
-                       pArgs = null;
                }
                ResetSelection();
                int loopCount = __pSeletedIndexList->GetCount();
@@ -325,17 +307,13 @@ AllListSelectionPanel::OnSceneActivatedN(const SceneId& previousSceneId,
                }
        }
        SetButtonState();
-       FileListEditorForm* pFileListEditorForm =
-                       dynamic_cast<FileListEditorForm*>(pSceneManager->GetCurrentScene()->GetForm());
-       TryReturnVoid(pFileListEditorForm != null, "[%s] fail to get FileListEditorForm.",
-                       GetErrorMessage(GetLastResult()));
 
        if (pArgs != null && pArgs->GetCount() > 0)
        {
                String* pDirectory = static_cast<String*>(pArgs->GetAt(0));
                if (pDirectory != null && pDirectory->GetLength() > 0)
                {
-                       pFileListEditorForm->MoveToAlbum(*pDirectory);
+                       __pFileListEditorForm->MoveToAlbum(*pDirectory);
                }
        }
        AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
@@ -346,6 +324,7 @@ AllListSelectionPanel::OnSceneDeactivated(const SceneId& currentSceneId,
                const SceneId& nextSceneId)
 {
        AppLogDebug("ENTER");
+       __pPresentationModel->RemoveContentEventListener(__pFileListEditorForm);
        AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
 }
 
@@ -371,11 +350,11 @@ AllListSelectionPanel::GetItemCheckedCount(void) const
 }
 
 IList*
-AllListSelectionPanel::GetItemCheckedIndexListN(void)
+AllListSelectionPanel::GetItemCheckedIndexListN(void) const
 {
        AppLogDebug("ENTER");
        IList* pList = new (std::nothrow) ArrayList(SingleObjectDeleter);
-       Integer* pIndex=null;
+       Integer* pIndex = null;
 
        if (__pContentIconListView!=null)
        {
@@ -397,7 +376,7 @@ AllListSelectionPanel::GetItemCheckedIndexListN(void)
 }
 
 int
-AllListSelectionPanel::GetRealindexFromVirtualIndex(int virtualIndex)
+AllListSelectionPanel::GetRealindexFromVirtualIndex(const int virtualIndex) const
 {
        if (__pSeletedIndexList == null || __pSeletedIndexList->GetCount() == 0)
        {
@@ -418,7 +397,7 @@ AllListSelectionPanel::GetRealindexFromVirtualIndex(int virtualIndex)
 }
 
 int
-AllListSelectionPanel::GetVirtualIndexFromRealIndex(int realIndex)
+AllListSelectionPanel::GetVirtualIndexFromRealIndex(const int realIndex) const
 {
        int returnValue = -1;
        int loopCount = __pSeletedIndexList->GetCount();
@@ -454,21 +433,19 @@ AllListSelectionPanel::OnRequestDelete(void)
                return E_FAILURE;
        }
 
-       delete __pFileDelete;
-       __pFileDelete = new FileDeleteTimer(pIndexList,
-                       __pPresentationModel,
-                       this );
-       result r = __pFileDelete->StartTimer();
+       delete __pFileUpdateTimer;
+       __pFileUpdateTimer = new (std::nothrow) FileUpdateTimer(pIndexList, __pPresentationModel, this, FILE_ACTION_DELETE);
+       result r = __pFileUpdateTimer->StartTimer();
 
        if (IsFailed(r))
        {
-               delete __pFileDelete;
-               __pFileDelete = null;
+               delete __pFileUpdateTimer;
+               __pFileUpdateTimer = null;
                return E_FAILURE;
        }
        else
        {
-               __deleteInProgress = true;
+               __pPresentationModel->SetUpdateProgressStatus(true);
        }
 
        return E_SUCCESS;
@@ -476,30 +453,20 @@ AllListSelectionPanel::OnRequestDelete(void)
 
 void AllListSelectionPanel::OnFileOpInvalidate(enum FileActionMode actionId)
 {
-       SceneManager* pSceneManager = SceneManager::GetInstance();
-       FileListEditorForm* pFileListEditorForm =
-                               dynamic_cast<FileListEditorForm*>(pSceneManager->GetCurrentScene()->GetForm());
-       TryReturnVoid(pFileListEditorForm != null, "[%s] fail to get SceneManager.",
-                       GetErrorMessage(GetLastResult()));
-       pFileListEditorForm->Invalidate(true);
+       __pFileListEditorForm->Invalidate(true);
 }
 
 void AllListSelectionPanel::OnFileOpComplete(enum FileActionMode actionId, enum FileActionCompleteRes res)
 {
-       __deleteInProgress = false;
+       __pPresentationModel->SetUpdateProgressStatus(false);
        SceneManager* pSceneManager = SceneManager::GetInstance();
        TryReturnVoid(pSceneManager != null, "[%s] fail to get SceneManager.",
                        GetErrorMessage(GetLastResult()));
 
-       FileListEditorForm* pFileListEditorForm =
-                       dynamic_cast<FileListEditorForm*>(pSceneManager->GetCurrentScene()->GetForm());
-       TryReturnVoid(pFileListEditorForm != null, "[%s] fail to get SceneManager.",
-                       GetErrorMessage(GetLastResult()));
-
        String strTmp;
        String selectString = ResourceManager::GetString(L"IDS_COM_BODY_SELECTED");
        strTmp.Format(LENGTH_COUNT_LABEL, L"%ls (%d)", selectString.GetPointer(), 0);
-       pFileListEditorForm->SetTitleText(strTmp);
+       __pFileListEditorForm->SetTitleText(strTmp);
 
        __pPresentationModel->RefreshCurrentAlbumContentInfoList(CONTENT_TYPE_ALL);
        __itemCount = __pPresentationModel->GetCurrentAlbumContentInfoCount();
@@ -507,7 +474,8 @@ void AllListSelectionPanel::OnFileOpComplete(enum FileActionMode actionId, enum
 
        if (GetItemCount() > 0)
        {
-               pSceneManager->GoForward(ForwardSceneTransition(IDSCN_ALL_LIST));
+               pSceneManager->GoForward(ForwardSceneTransition(IDSCN_ALL_LIST, SCENE_TRANSITION_ANIMATION_TYPE_NONE,
+                               SCENE_HISTORY_OPTION_NO_HISTORY, SCENE_DESTROY_OPTION_DESTROY));
        }
        else
        {
@@ -516,10 +484,23 @@ void AllListSelectionPanel::OnFileOpComplete(enum FileActionMode actionId, enum
        AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
 }
 
+void
+AllListSelectionPanel::ChangeOrientation()
+{
+       SceneManager* pSceneManager = SceneManager::GetInstance();
+       const Form* pForm = dynamic_cast<Form*>(pSceneManager->GetCurrentScene()->GetForm());
+       TryReturn(pForm != null,, "[%s] fail to get the form.", GetErrorMessage(GetLastResult()));
+
+       Rectangle clientAreaBounds = pForm->GetClientAreaBounds();
+       SetBounds(0, 0, clientAreaBounds.width, clientAreaBounds.height);
+       __pContentIconListView->SetBounds(0, 0, clientAreaBounds.width, clientAreaBounds.height);
+}
+
 result
 AllListSelectionPanel::OnRequestMessage(void)
 {
        AppLogDebug("ENTER");
+       result r = E_SUCCESS;
        IList* pIndexList = GetItemCheckedIndexListN();
        if (pIndexList == null || pIndexList->GetCount() <= 0)
        {
@@ -528,44 +509,49 @@ AllListSelectionPanel::OnRequestMessage(void)
                return E_FAILURE;
        }
 
-       String combineText;
-       String path;
        Integer* pIndex = null;
        int checkedIndex;
-
+       ArrayList* pArrayList = new (std::nothrow) ArrayList(SingleObjectDeleter);
+       pArrayList->Construct();
        int loopCount = pIndexList->GetCount();
-       AppLogDebug("pIndexList->GetCount(%d)", loopCount);
+
        for (int i = 0; i < loopCount; ++i)
        {
                pIndex = static_cast<Integer*>(pIndexList->GetAt(i));
                if (pIndex != null)
                {
                        checkedIndex = pIndex->ToInt();
-                       path = __pPresentationModel->GetContentFilePath(checkedIndex);
+                       pArrayList->Add(new (std::nothrow) String(__pPresentationModel->GetContentFilePath(checkedIndex)));
                }
-
-               if (combineText.CompareTo(EMPTY_SPACE) != 0)
-               {
-                       combineText.Append(L";");
-               }
-               combineText.Append(path);
        }
+
        HashMap* pDataList = new (std::nothrow) HashMap(SingleObjectDeleter);
        pDataList->Construct();
-       pDataList->Add(new (std::nothrow) String(APPCONTROL_KEY_TYPE), new (std::nothrow) String(APPCONTROL_DATA_MMS));
-       pDataList->Add(new (std::nothrow) String(APPCONTROL_KEY_ATTACHMENTS), new (std::nothrow) String(combineText));
+       pDataList->Add(new (std::nothrow) String(APPCONTROL_KEY_MESSAGE_TYPE), new (std::nothrow) String(APPCONTROL_DATA_MMS));
+       pDataList->Add(new (std::nothrow) String(APPCONTROL_KEY_PATH), (Object*)pArrayList);
+
+       r = __pPresentationModel->StartAppControl(APPCONTROL_PROVIDER_ID_MESSAGE, APPCONTROL_OPERATION_ID_COMPOSE, null,
+                       null, pDataList, null);
+       if (r == E_MAX_EXCEEDED)
+       {
+               MessageBox messageBox;
+               messageBox.Construct(L"", ResourceManager::GetString(L"IDS_RCS_BODY_MAXIMUM_NUMBER_OF_FILES_EXCEEDED"),
+                               MSGBOX_STYLE_NONE, 3000);
+               int modalResult;
+               messageBox.ShowAndWait(modalResult);
+       }
 
-       __pPresentationModel->StartAppControl(APPCONTROL_PROVIDER_ID_MESSAGE, APPCONTROL_OPERATION_ID_COMPOSE,
-                       pDataList, null);
        AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
 
-       return E_SUCCESS;
+       return r;
 }
 
 result
 AllListSelectionPanel::OnRequestEmail(void)
 {
        AppLogDebug("ENTER");
+       result r = E_SUCCESS;
+
        IList* pIndexList = GetItemCheckedIndexListN();
        if (pIndexList == null || pIndexList->GetCount() <= 0)
        {
@@ -574,99 +560,91 @@ AllListSelectionPanel::OnRequestEmail(void)
                return E_FAILURE;
        }
 
-       String combineText;
-       String path;
        Integer* pIndex = null;
        int checkedIndex;
-
+       ArrayList* pArrayList = new (std::nothrow) ArrayList(SingleObjectDeleter);
+       pArrayList->Construct();
        int loopCount = pIndexList->GetCount();
-       AppLogDebug("pIndexList->GetCount(%d)", loopCount);
+
        for (int i = 0; i < loopCount; ++i)
        {
                pIndex = static_cast<Integer*>(pIndexList->GetAt(i));
                if (pIndex != null)
                {
                        checkedIndex = pIndex->ToInt();
-                       path = __pPresentationModel->GetContentFilePath(checkedIndex);
-               }
-
-               if (combineText.CompareTo(EMPTY_SPACE) != 0)
-               {
-                       combineText.Append(L";");
+                       pArrayList->Add(new (std::nothrow) String(__pPresentationModel->GetContentFilePath(checkedIndex)));
                }
-               combineText.Append(path);
        }
+
        HashMap* pDataList = new (std::nothrow) HashMap(SingleObjectDeleter);
        pDataList->Construct();
-       pDataList->Add(new (std::nothrow) String(APPCONTROL_KEY_ATTACHMENTS), new (std::nothrow) String(combineText));
+       pDataList->Add(new (std::nothrow) String(APPCONTROL_KEY_PATH), (Object*)pArrayList);
+
+       r = __pPresentationModel->StartAppControl(APPCONTROL_PROVIDER_ID_EMAIL, APPCONTROL_OPERATION_ID_COMPOSE,
+                       new (std::nothrow) String(APPCONTROL_URI_MAIL_TO), null, pDataList, null);
+
+       if (r == E_MAX_EXCEEDED)
+       {
+               MessageBox messageBox;
+               messageBox.Construct(L"", ResourceManager::GetString(L"IDS_RCS_BODY_MAXIMUM_NUMBER_OF_FILES_EXCEEDED"),
+                               MSGBOX_STYLE_NONE, 3000);
+               int modalResult;
+               messageBox.ShowAndWait(modalResult);
+       }
 
-       __pPresentationModel->StartAppControl(APPCONTROL_PROVIDER_ID_EMAIL,
-                       APPCONTROL_OPERATION_ID_COMPOSE, pDataList, null);
        AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
 
-       return E_SUCCESS;
+       return r;
 }
 
 result
 AllListSelectionPanel::OnRequestSlideShow(void)
 {
        AppLogDebug("ENTER");
+       result r = E_SUCCESS;
        IList* pIndexList = GetItemCheckedIndexListN();
        if (pIndexList == null)
        {
                AppLogDebug("EXIT 1(%s)", GetErrorMessage(GetLastResult()));
-
                return E_FAILURE;
        }
 
-       HashMap* pDataList = new (std::nothrow) HashMap(SingleObjectDeleter);
-       result r = pDataList->Construct();
-       if (r != E_SUCCESS)
-       {
-               delete pDataList;
-               delete pIndexList;
-               AppLogDebug("EXIT 2(%s)", GetErrorMessage(GetLastResult()));
-
-               return E_FAILURE;
-       }
-
-       pDataList->Add(new (std::nothrow) String(APPCONTROL_KEY_TYPE),
-                       new (std::nothrow) String(APPCONTROL_DATA_SLIDE_SHOW));
-
        Integer* pRealIndex = null;
        int realIndex = -1;
-       String combineText;
-       String path;
-
+       ArrayList* pArrayList = new (std::nothrow) ArrayList(SingleObjectDeleter);
+       pArrayList->Construct();
        int loopCount = pIndexList->GetCount();
-       if (loopCount > 0)
+
+       for (int i = 0; i < loopCount; ++i)
        {
-               for (int i = 0; i < loopCount; ++i)
+               pRealIndex = static_cast<Integer*>(pIndexList->GetAt(i));
+               if (pRealIndex != null)
                {
-                       pRealIndex = static_cast<Integer*>(pIndexList->GetAt(i));
-                       if (pRealIndex != null)
-                       {
-                               realIndex = pRealIndex->ToInt();
-                       }
-
-                       path = __pPresentationModel->GetContentFilePath(realIndex);
-                       if (combineText.CompareTo(EMPTY_SPACE) != 0)
-                       {
-                               combineText.Append(L";");
-                       }
-                       combineText.Append(path);
+                       realIndex = pRealIndex->ToInt();
+                       pArrayList->Add(new (std::nothrow) String(__pPresentationModel->GetContentFilePath(realIndex)));
                }
-               pDataList->Add(new (std::nothrow) String(APPCONTROL_KEY_PATH),
-                               new (std::nothrow) String(combineText));
        }
 
-       delete pIndexList;
+       HashMap* pDataList = new (std::nothrow) HashMap(SingleObjectDeleter);
+       pDataList->Construct();
+       pDataList->Add(new (std::nothrow) String(APPCONTROL_KEY_TYPE), new (std::nothrow) String(APPCONTROL_DATA_SLIDE_SHOW));
+       pDataList->Add(new (std::nothrow) String(APPCONTROL_KEY_PATH), (Object*)pArrayList);
+
+       r = __pPresentationModel->StartAppControl(APPCONTROL_PROVIDER_ID_IMAGE, APPCONTROL_OPERATION_ID_VIEW, null,
+                       new (std::nothrow) String(APPCONTROL_MIME_IMAGE_ALL), pDataList, null);
+
+       if (r == E_MAX_EXCEEDED)
+       {
+               MessageBox messageBox;
+               messageBox.Construct(L"", ResourceManager::GetString(L"IDS_RCS_BODY_MAXIMUM_NUMBER_OF_FILES_EXCEEDED"),
+                               MSGBOX_STYLE_NONE, 3000);
+               int modalResult;
+               messageBox.ShowAndWait(modalResult);
+       }
 
-       __pPresentationModel->StartAppControl(APPCONTROL_PROVIDER_ID_IMAGE,
-                       APPCONTROL_OPERATION_ID_VIEW, pDataList, null);
        AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
 
-       return E_SUCCESS;
+       return r;
 }
 
 void
@@ -686,17 +664,11 @@ AllListSelectionPanel::ResetSelection(void)
        SceneManager* pSceneManager = SceneManager::GetInstance();
        TryReturnVoid(pSceneManager != null, "[%s] fail to get SceneManager.", GetErrorMessage(GetLastResult()));
 
-       FileListEditorForm* pFileListEditorForm = dynamic_cast<FileListEditorForm*>(pSceneManager->GetCurrentScene()->GetForm());
-       TryReturnVoid(pFileListEditorForm != null, "[%s] fail to get FileListEditorForm.", GetErrorMessage(GetLastResult()));
-
        String strTmp;
        String bodyText = ResourceManager::GetString(L"IDS_COM_BODY_SELECTED");
        strTmp.Format(LENGTH_COUNT_LABEL, L"%ls (%d)", bodyText.GetPointer(), __itemCount);
-       pFileListEditorForm->SetTitleText(strTmp);
-       if (__pContentIconListView != null)
-       {
-               __pContentIconListView->UpdateList();
-       }
+       __pFileListEditorForm->SetTitleText(strTmp);
+
        SetButtonState();
        AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
 }
@@ -708,20 +680,112 @@ AllListSelectionPanel::SetButtonState(void)
        SceneManager* pSceneManager = SceneManager::GetInstance();
        TryReturnVoid(pSceneManager != null, "[%s] fail to get SceneManager.", GetErrorMessage(GetLastResult()));
 
-       FileListEditorForm* pFileListEditorForm = dynamic_cast<FileListEditorForm*>(pSceneManager->GetCurrentScene()->GetForm());
-       TryReturnVoid(pFileListEditorForm != null, "[%s] fail to get FileListEditorForm.", GetErrorMessage(GetLastResult()));
-
        if (GetItemCheckedCount() > 0)
        {
                AppLogDebug("BUTTONSTATE : Request Enable");
-               pFileListEditorForm->SetFooterButtonsState(true);
+               __pFileListEditorForm->SetFooterButtonsState(true);
        }
        else
        {
                AppLogDebug("BUTTONSTATE : Request disable");
-               pFileListEditorForm->SetFooterButtonsState(false);
+               __pFileListEditorForm->SetFooterButtonsState(false);
        }
        AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
 }
 
+void
+AllListSelectionPanel::OnSelectAllPressed(void)
+{
+       bool needToSelectAll = true;
+       int checkedCount = GetItemCheckedCount();
+       if (checkedCount == __itemCount)
+       {
+               needToSelectAll = false;
+       }
+
+       if (needToSelectAll == true)
+       {
+               for (int i = 0; i < __itemCount; ++i)
+               {
+                       if (__pContentIconListView->IsItemChecked(i) == false)
+                       {
+                               __pContentIconListView->SetItemChecked(i, true);
+                               __pContentIconListView->RefreshList(i, LIST_REFRESH_TYPE_ITEM_MODIFY);
+                       }
+               }
+       }
+       else
+       {
+               for (int i = 0; i < __itemCount; ++i)
+               {
+                       if (__pContentIconListView->IsItemChecked(i) == true)
+                       {
+                               __pContentIconListView->SetItemChecked(i, false);
+                               __pContentIconListView->RefreshList(i, LIST_REFRESH_TYPE_ITEM_MODIFY);
+                       }
+               }
+       }
+
+       SceneManager* pSceneManager = SceneManager::GetInstance();
+       TryReturnVoid(pSceneManager != null, "[%s] fail to get SceneManager.", GetErrorMessage(GetLastResult()));
+
+       String tempString;
+       if (needToSelectAll == true)
+       {
+               tempString.Format(LENGTH_COUNT_LABEL, L"%ls (%d)",
+                               ResourceManager::GetString(L"IDS_COM_BODY_SELECTED").GetPointer(), __itemCount);
+       }
+       else
+       {
+               tempString.Format(LENGTH_COUNT_LABEL, L"%ls (%d)",
+                               ResourceManager::GetString(L"IDS_COM_BODY_SELECTED").GetPointer(), 0);
+       }
+       __pFileListEditorForm->SetTitleText(tempString);
+
+       SetButtonState();
+}
+
+result
+AllListSelectionPanel::OnRotateRequested(RotateMode rotateMode)
+{
+       AppLogDebug("ENTER");
+       IList* pIndexList = GetItemCheckedIndexListN();
+       if (pIndexList == null)
+       {
+               AppLogDebug("EXIT 1(%s)", GetErrorMessage(GetLastResult()));
+               return E_FAILURE;
+       }
+       else if (pIndexList->GetCount() <= 0)
+       {
+               delete pIndexList;
+               AppLogDebug("EXIT 1(%s)", GetErrorMessage(GetLastResult()));
 
+               return E_FAILURE;
+       }
+
+       delete __pFileUpdateTimer;
+       __pFileUpdateTimer = new (std::nothrow) FileUpdateTimer(pIndexList, __pPresentationModel, this, FILE_ACTION_ROTATE, rotateMode);
+       result r = __pFileUpdateTimer->StartTimer();
+
+       if (IsFailed(r))
+       {
+               delete __pFileUpdateTimer;
+               __pFileUpdateTimer = null;
+               return E_FAILURE;
+       }
+       else
+       {
+               __pPresentationModel->SetUpdateProgressStatus(true);
+       }
+       return E_SUCCESS;
+}
+
+void AllListSelectionPanel::CancelUpdateProgress(void)
+{
+       if (__pFileUpdateTimer!= null && __pFileUpdateTimer->IsStarted())
+       {
+               __pFileUpdateTimer->Cancel();
+               delete __pFileUpdateTimer;
+               __pFileUpdateTimer = null;
+       }
+}