Fixed prevent issue
[apps/osp/Gallery.git] / src / GlAllListEditorPanel.cpp
index c95bf20..d019e21 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
 //
  */
 
 #include <FContent.h>
-#include <FMedia.h>
 #include "GlAllListEditorPanel.h"
 #include "GlCommonUtil.h"
+#include "GlFileUpdateTimer.h"
 #include "GlFileListEditorForm.h"
 #include "GlFileListPresentationModel.h"
 #include "GlResourceManager.h"
 #include "GlTypes.h"
-#include "GlFileDeleteTimer.h"
 
 using namespace Tizen::App;
 using namespace Tizen::Base;
@@ -39,10 +38,10 @@ using namespace Tizen::Media;
 using namespace Tizen::Ui::Controls;
 using namespace Tizen::Ui::Scenes;
 
-static const int H_SELECTALL_REGION = 112;
-static const int H_COUNT_LABEL = 48;
-static const int H_COUNT_LABEL_BUTTON = 42;
-static const int W_COUNT_LABEL_BUTTON = 42;
+static const float H_COUNT_LABEL = 48.0f;
+static const float H_COUNT_LABEL_BUTTON = 42.0f;
+static const float W_COUNT_LABEL_BUTTON = 42.0f;
+static const int COUNT_LABEL_FONT_SIZE = 33;
 static const int H_CONTENT_MARGIN = 9;
 static const int W_CONTENT_MARGIN = 6;
 static const int W_CONTENT_SPACE = 6;
@@ -51,21 +50,19 @@ static const int LENGTH_COUNT_LABEL = 256;
 static const unsigned int COLOR_COUNT_LABEL = Color32<68, 68, 68>::Value;
 static const unsigned int COLOR_SELECT_COUNT_FONT = Color32<255, 255, 255>::Value;
 static const unsigned int COLOR_COUNT_LABEL_BUTTON = Color32<120, 120, 120>::Value;
-static const unsigned int COLOR_SELECTALL_REGION = Color32<0x2A, 0x36, 0x4A>::Value;
 static const Color COLOR_THUMBNAIL_DIM (Color::GetColor(COLOR_ID_BLACK));
 static const int ALPHA_THUMBNAIL_DIM = 70;
 
 static const Rectangle RECT_INITIAL (0, 0, 10, 10);
 
 AllListEditorPanel::AllListEditorPanel(void)
-       : __pContentIconListView(null)
-       , __pCheckButton(null)
+       : __itemCount(0)
+       , __pContentIconListView(null)
        , __pLabelSelectCnt(null)
        , __pButtonSelectRegion(null)
-       , __itemCount(0)
-       , __deleteInProgress(false)
+       , __pFileUpdateTimer(null)
+       , __pFileListEditorForm(null)
        , __pPresentationModel(null)
-       , __pFileDelete(null)
 {
        AppLogDebug("ENTER");
        AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
@@ -74,7 +71,7 @@ AllListEditorPanel::AllListEditorPanel(void)
 AllListEditorPanel::~AllListEditorPanel(void)
 {
        AppLogDebug("ENTER");
-       delete __pFileDelete;
+       delete __pFileUpdateTimer;
        AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
 }
 
@@ -99,31 +96,18 @@ AllListEditorPanel::OnInitializing(void)
        __pPresentationModel->ClearThumbnailRequests();
        __pPresentationModel->AddPresentationModelListener(this);
 
-       Rectangle clientAreaBounds = pForm->GetClientAreaBounds();
-       clientAreaBounds.x = clientAreaBounds.y = 0;
-       result r = SetBounds(clientAreaBounds);
-
-       Panel* pCheckPanel = new (std::nothrow) Panel();
-       pCheckPanel->Construct(Rectangle(0, 0, clientAreaBounds.width, H_SELECTALL_REGION));
-       pCheckPanel->SetBackgroundColor(COLOR_SELECTALL_REGION);
-       __pCheckButton = new (std::nothrow) CheckButton();
-       __pCheckButton->Construct(pCheckPanel->GetBounds(), CHECK_BUTTON_STYLE_MARK, BACKGROUND_STYLE_DEFAULT, false,
-                       ResourceManager::GetString(L"IDS_COM_BODY_SELECT_ALL"));
-       __pCheckButton->SetActionId(ACTION_ID_BUTTON_CHECKED, ACTION_ID_BUTTON_UNCHECKED);
-       __pCheckButton->AddActionEventListener(*this);
-       pCheckPanel->AddControl(*__pCheckButton);
-       AddControl(*pCheckPanel);
+       FloatRectangle clientAreaBounds = pForm->GetClientAreaBoundsF();
+       SetBounds(0.0f, 0.0f, clientAreaBounds.width, clientAreaBounds.height);
+
 
        __pContentIconListView = new (std::nothrow) IconListView();
-       __pContentIconListView->Construct(Rectangle(0, H_SELECTALL_REGION, clientAreaBounds.width,
-                       clientAreaBounds.height - H_COUNT_LABEL - H_SELECTALL_REGION), DIMENSION_DEFAULT_THUMBNAIL,
-                       ICON_LIST_VIEW_STYLE_MARK, ICON_LIST_VIEW_SCROLL_DIRECTION_VERTICAL);
+       __pContentIconListView->Construct(Rectangle(0, 0, clientAreaBounds.width, clientAreaBounds.height - H_COUNT_LABEL),
+                       DIMENSION_DEFAULT_THUMBNAIL, ICON_LIST_VIEW_STYLE_MARK, ICON_LIST_VIEW_SCROLL_DIRECTION_VERTICAL);
        Bitmap* pBitmapEmpty = ResourceManager::GetBitmapN(IDB_LISTVIEW_EMPTY);
        if (pBitmapEmpty != null)
        {
                __pContentIconListView->SetBitmapOfEmptyList(pBitmapEmpty);
                delete pBitmapEmpty;
-               pBitmapEmpty = null;
        }
        __pContentIconListView->SetTextOfEmptyList(ResourceManager::GetString(L"IDS_COM_BODY_NO_ITEMS"));
        __pContentIconListView->SetMargin(MARGIN_TYPE_LEFT, W_CONTENT_MARGIN);
@@ -135,27 +119,27 @@ AllListEditorPanel::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);
 
        __pLabelSelectCnt = new (std::nothrow) Label();
        String strTmp;
-       strTmp.Format(LENGTH_COUNT_LABEL, L"%ls (%d)",
-                       ResourceManager::GetString(L"IDS_COM_BODY_SELECTED").GetPointer(), 0);
+       strTmp = ResourceManager::GetString(L"IDS_ST_POP_NO_ITEMS_SELECTED").GetPointer();
        __pLabelSelectCnt->Construct(
-                       Rectangle(0, clientAreaBounds.height-H_COUNT_LABEL, clientAreaBounds.width, H_COUNT_LABEL), strTmp);
+                       FloatRectangle(0, clientAreaBounds.height - H_COUNT_LABEL, clientAreaBounds.width, H_COUNT_LABEL), strTmp);
        __pLabelSelectCnt->SetTextVerticalAlignment(ALIGNMENT_MIDDLE);
-       __pLabelSelectCnt->SetTextHorizontalAlignment(ALIGNMENT_CENTER);
+       __pLabelSelectCnt->SetTextHorizontalAlignment(ALIGNMENT_LEFT);
        __pLabelSelectCnt->SetBackgroundColor(COLOR_COUNT_LABEL);
        __pLabelSelectCnt->SetTextColor(Color(COLOR_SELECT_COUNT_FONT));
-       AddControl(*__pLabelSelectCnt);
+       __pLabelSelectCnt->SetTextConfig(COUNT_LABEL_FONT_SIZE, LABEL_TEXT_STYLE_BOLD);
+       AddControl(__pLabelSelectCnt);
        __pLabelSelectCnt->Invalidate(true);
 
        __pButtonSelectRegion = new (std::nothrow) Button();
-       __pButtonSelectRegion->Construct(Rectangle(clientAreaBounds.width - W_COUNT_LABEL_BUTTON - 10,
+       __pButtonSelectRegion->Construct(FloatRectangle(clientAreaBounds.width - W_COUNT_LABEL_BUTTON - 10,
                        clientAreaBounds.height - H_COUNT_LABEL_BUTTON - 4, W_COUNT_LABEL_BUTTON, H_COUNT_LABEL_BUTTON),
                        EMPTY_SPACE);
-       __pButtonSelectRegion->SetActionId(ACTION_ID_BUTTON_MOVE_TO_SELECTION);
+       __pButtonSelectRegion->SetActionId(IDA_BUTTON_MOVE_TO_SELECTION);
        __pButtonSelectRegion->SetColor(BUTTON_STATUS_NORMAL, COLOR_COUNT_LABEL_BUTTON);
        Bitmap* pSelectionBitmap = ResourceManager::GetBitmapN(IDB_BUTTON_MOVE_SELECTION);
        if (pSelectionBitmap != null)
@@ -165,19 +149,18 @@ AllListEditorPanel::OnInitializing(void)
                __pButtonSelectRegion->SetNormalBitmap(Point(buttonRegionRect.width, buttonRegionRect.height),
                                *pSelectionBitmap);
        }
-       AddControl(*__pButtonSelectRegion);
+       AddControl(__pButtonSelectRegion);
 
        if (pSelectionBitmap != null)
        {
                delete pSelectionBitmap;
-               pSelectionBitmap = null;
        }
        __pButtonSelectRegion->AddActionEventListener(*this);
 
-       __itemCount=0;
+       __itemCount = 0;
        AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
 
-       return r;
+       return E_SUCCESS;
 }
 
 result
@@ -185,30 +168,13 @@ AllListEditorPanel::OnTerminating(void)
 {
        AppLogDebug("ENTER");
        __pPresentationModel->RemovePresentationModelListener(*this);
+       __pPresentationModel->RemoveContentEventListener(__pFileListEditorForm);
        AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
 
        return E_SUCCESS;
 }
 
 void
-AllListEditorPanel::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()));
-       }
-}
-
-void
 AllListEditorPanel::OnActionPerformed(const Control& source, int actionId)
 {
        AppLogDebug("ENTER");
@@ -217,27 +183,41 @@ AllListEditorPanel::OnActionPerformed(const Control& source, int actionId)
 
        switch (actionId)
        {
-       case ACTION_ID_BUTTON_CHECKED:
+       case IDA_BUTTON_CHECKED:
        {
                int loopCount = __pPresentationModel->GetCurrentAlbumContentInfoCount();
-               for (int i=0 ; i < loopCount; ++i)
+               for (int i=0; i < loopCount; ++i)
                {
                        if (__pContentIconListView->IsItemChecked(i) == false)
                        {
-                               __pContentIconListView->SetItemChecked(i,true);
+                               __pContentIconListView->SetItemChecked(i, true);
                                __pContentIconListView->RefreshList(i, LIST_REFRESH_TYPE_ITEM_MODIFY);
                        }
                }
                int checkedCount = GetItemCheckedCount();
                String strTmp;
-               strTmp.Format(LENGTH_COUNT_LABEL, L"%ls (%d)",
-                               ResourceManager::GetString(L"IDS_COM_BODY_SELECTED").GetPointer(), checkedCount);
+
+               if (checkedCount == 0)
+               {
+                       strTmp = ResourceManager::GetString(L"IDS_ST_POP_NO_ITEMS_SELECTED");
+               }
+               else if (checkedCount == 1)
+               {
+                       strTmp = ResourceManager::GetString(L"IDS_VR_POP_1_ITEM_SELECTED");
+               }
+               else
+               {
+                       strTmp.Format(LENGTH_COUNT_LABEL,
+                                       ResourceManager::GetString(L"IDS_VR_POP_PD_ITEMS_SELECTED").GetPointer(), checkedCount);
+               }
+
                __pLabelSelectCnt->SetText(strTmp);
                __pLabelSelectCnt->RequestRedraw(true);
                SetButtonState();
-               break;
        }
-       case ACTION_ID_BUTTON_UNCHECKED:
+       break;
+
+       case IDA_BUTTON_UNCHECKED:
        {
                int loopCount = __pPresentationModel->GetCurrentAlbumContentInfoCount();
                for (int i = 0; i < loopCount; ++i)
@@ -249,15 +229,29 @@ AllListEditorPanel::OnActionPerformed(const Control& source, int actionId)
                }
                int checkedCount = GetItemCheckedCount();
                String strTmp;
-               strTmp.Format(LENGTH_COUNT_LABEL, L"%ls (%d)",
-                               ResourceManager::GetString(L"IDS_COM_BODY_SELECTED").GetPointer(), checkedCount);
+
+               if (checkedCount == 0)
+               {
+                       strTmp = ResourceManager::GetString(L"IDS_ST_POP_NO_ITEMS_SELECTED");
+               }
+               else if (checkedCount == 1)
+               {
+                       strTmp = ResourceManager::GetString(L"IDS_VR_POP_1_ITEM_SELECTED");
+               }
+               else
+               {
+                       strTmp.Format(LENGTH_COUNT_LABEL,
+                                       ResourceManager::GetString(L"IDS_VR_POP_PD_ITEMS_SELECTED").GetPointer(), checkedCount);
+               }
+
                __pLabelSelectCnt->SetText(strTmp);
                __pLabelSelectCnt->RequestRedraw(true);
                __pContentIconListView->UpdateList();
                SetButtonState();
-               break;
        }
-       case ACTION_ID_BUTTON_MOVE_TO_SELECTION:
+       break;
+
+       case IDA_BUTTON_MOVE_TO_SELECTION:
        {
                if (pSceneManager->GetCurrentSceneId() == IDSCN_ALL_LIST_EDITOR)
                {
@@ -272,13 +266,12 @@ AllListEditorPanel::OnActionPerformed(const Control& source, int actionId)
                {
                        pSceneManager->GoForward(ForwardSceneTransition(IDSCN_ALL_LIST_SELECTION));
                }
-               break;
        }
+       break;
+
        default:
-       {
                break;
        }
-       }
        AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
 }
 
@@ -296,8 +289,8 @@ AllListEditorPanel::CreateItem(int index)
 {
        AppLogDebug("ENTER : index(%d)", index);
        IconListViewItem* pIconListviewItem;
-       Bitmap* pBitmap=null;
-       String* pItemText=null;
+       Bitmap* pBitmap = null;
+       String* pItemText = null;
        result r = __pPresentationModel->GetThumbnailInSyncCacheN(index, pItemText, pBitmap);
        if (pBitmap == null || r == E_FAILURE)
        {
@@ -334,11 +327,11 @@ AllListEditorPanel::CreateItem(int index)
                        pIconListviewItem = new (std::nothrow) IconListViewItem();
                        pIconListviewItem->Construct(*pBitmap, pItemText, pSelectedBitmap);
                        delete pSelectedBitmap;
-                       pSelectedBitmap = null;
                }
                else
                {
                        AppLogDebug("EXIT 1(%s)", GetErrorMessage(GetLastResult()));
+                       delete pItemText;
                        return null;
                }
        }
@@ -351,12 +344,10 @@ AllListEditorPanel::CreateItem(int index)
        if (pBitmap != null)
        {
                delete pBitmap;
-               pBitmap = null;
        }
        if (pItemText != null)
        {
                delete pItemText;
-               pItemText = null;
        }
        AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
 
@@ -381,21 +372,23 @@ AllListEditorPanel::OnIconListViewItemStateChanged(IconListView& view, int index
        {
                int checkedCount = GetItemCheckedCount();
                String strTmp;
-               strTmp.Format(LENGTH_COUNT_LABEL, L"%ls (%d)",
-                               ResourceManager::GetString(L"IDS_COM_BODY_SELECTED").GetPointer(), checkedCount);
-               __pLabelSelectCnt->SetText(strTmp);
-               __pLabelSelectCnt->RequestRedraw(true);
-               if (__pCheckButton->IsSelected() == true)
+
+               if (checkedCount == 0)
+               {
+                       strTmp = ResourceManager::GetString(L"IDS_ST_POP_NO_ITEMS_SELECTED");
+               }
+               else if (checkedCount == 1)
                {
-                       __pCheckButton->SetSelected(false);
+                       strTmp = ResourceManager::GetString(L"IDS_VR_POP_1_ITEM_SELECTED");
                }
                else
                {
-                       if (checkedCount != 0 && checkedCount == __pPresentationModel->GetCurrentAlbumContentInfoCount())
-                       {
-                               __pCheckButton->SetSelected(true);
-                       }
+                       strTmp.Format(LENGTH_COUNT_LABEL,
+                                       ResourceManager::GetString(L"IDS_VR_POP_PD_ITEMS_SELECTED").GetPointer(), checkedCount);
                }
+
+               __pLabelSelectCnt->SetText(strTmp);
+               __pLabelSelectCnt->RequestRedraw(true);
                __pContentIconListView->RefreshList(index, LIST_REFRESH_TYPE_ITEM_MODIFY);
        }
        SetButtonState();
@@ -433,14 +426,66 @@ AllListEditorPanel::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 SceneManager.", GetErrorMessage(GetLastResult()));
+       __pPresentationModel->AddContentEventListener(__pFileListEditorForm);
 
-       if (previousSceneId == IDSCN_ALL_LIST_SELECTION)
+       if (previousSceneId == IDSCN_ALL_LIST_SELECTION)
        {
-               ResetSelection();
+               if (pArgs != null)
+               {
+                       if (__pContentIconListView != null)
+                       {
+                               int loopCount = __pPresentationModel->GetCurrentAlbumContentInfoCount();
+                               for (int i = 0; i < loopCount; ++i)
+                               {
+                                       __pContentIconListView->SetItemChecked(i, false);
+                               }
+                               __pContentIconListView->UpdateList();
+                       }
+
+                       if (pArgs->GetCount() > 0) //SomeItems are Still Selected.
+                       {
+                               IList* pSeletedIndexList = pArgs;
+                               int loopCount = pSeletedIndexList->GetCount();
+                               if (__pContentIconListView != null)
+                               {
+                                       for (int i = 0; i < loopCount; ++i)
+                                       {
+                                               int index = static_cast<Integer*>(pSeletedIndexList->GetAt(i))->ToInt();
+                                               __pContentIconListView->SetItemChecked(index, true);
+                                       }
+                                       __pContentIconListView->UpdateList();
+                               }
+                       }
+               }
+
+               int checkedCount = GetItemCheckedCount();
+               String strTmp;
+
+               if (checkedCount == 0)
+               {
+                       strTmp = ResourceManager::GetString(L"IDS_ST_POP_NO_ITEMS_SELECTED");
+               }
+               else if (checkedCount == 1)
+               {
+                       strTmp = ResourceManager::GetString(L"IDS_VR_POP_1_ITEM_SELECTED");
+               }
+               else
+               {
+                       strTmp.Format(LENGTH_COUNT_LABEL,
+                                       ResourceManager::GetString(L"IDS_VR_POP_PD_ITEMS_SELECTED").GetPointer(), checkedCount);
+               }
+
+               __pLabelSelectCnt->SetText(strTmp);
+               __pLabelSelectCnt->RequestRedraw(true);
        }
        else if (previousSceneId == IDSCN_ALL_LIST)
        {
@@ -449,19 +494,14 @@ AllListEditorPanel::OnSceneActivatedN(const SceneId& previousSceneId,
 
        SetButtonState();
 
-       FileListEditorForm* pFileListEditorForm =
-                       dynamic_cast<FileListEditorForm*>(pSceneManager->GetCurrentScene()->GetForm());
-       TryReturnVoid(pFileListEditorForm != null, "[%s] fail to get SceneManager.",
-                       GetErrorMessage(GetLastResult()));
-
-       pFileListEditorForm->SetTitleText(ResourceManager::GetString(L"IDS_COM_BODY_EDIT"));
+       __pFileListEditorForm->SetTitleText(ResourceManager::GetString(L"IDS_COM_BODY_EDIT"));
        
-       if (pArgs != null && pArgs->GetCount() > 0)
+       if (pArgs != null && pArgs->GetCount() > 0 && previousSceneId != IDSCN_ALL_LIST_SELECTION)
        {
                String* pDirectory = static_cast<String*>(pArgs->GetAt(0));
                if (pDirectory != null && pDirectory->GetLength() > 0)
                {
-                       pFileListEditorForm->MoveToAlbum(*pDirectory);
+                       __pFileListEditorForm->MoveToAlbum(*pDirectory);
                }
        }
 
@@ -472,6 +512,7 @@ void
 AllListEditorPanel::OnSceneDeactivated(const SceneId& currentSceneId, const SceneId& nextSceneId)
 {
        AppLogDebug("ENTER");
+       __pPresentationModel->RemoveContentEventListener(__pFileListEditorForm);
        AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
 }
 
@@ -489,6 +530,10 @@ AllListEditorPanel::GetItemCheckedCount(void) const
                        {
                                ++count;
                        }
+                       else
+                       {
+                               AppLog("Index i = %d is Not Checked", i);
+                       }
                }
        }
        AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
@@ -534,44 +579,33 @@ AllListEditorPanel::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;
 }
 
 void AllListEditorPanel::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 AllListEditorPanel::OnFileOpComplete(enum FileActionMode actionId, enum FileActionCompleteRes res)
 {
-       __pCheckButton->SetSelected(false);
-       __deleteInProgress = false;
+       __pPresentationModel->SetUpdateProgressStatus(false);
 
-       String strTmp;
-       strTmp.Format(LENGTH_COUNT_LABEL, L"%ls (%d)",
-                       ResourceManager::GetString(L"IDS_COM_BODY_SELECTED").GetPointer(), 0);
-       __pLabelSelectCnt->SetText(strTmp);
+       __pLabelSelectCnt->SetText(ResourceManager::GetString(L"IDS_ST_POP_NO_ITEMS_SELECTED"));
        __pLabelSelectCnt->RequestRedraw(true);
 
        __pPresentationModel->RefreshCurrentAlbumContentInfoList(CONTENT_TYPE_ALL);
@@ -581,19 +615,37 @@ void AllListEditorPanel::OnFileOpComplete(enum FileActionMode actionId, enum Fil
        SceneManager* pSceneManager = SceneManager::GetInstance();
        if (GetItemCount() > 0)
        {
-               pSceneManager->GoForward(ForwardSceneTransition(IDSCN_ALL_LIST));
+               pSceneManager->GoForward(ForwardSceneTransition(IDSCN_ALL_LIST,SCENE_TRANSITION_ANIMATION_TYPE_NONE,
+                                                                  SCENE_HISTORY_OPTION_ADD_HISTORY, SCENE_DESTROY_OPTION_DESTROY));
        }
        else
        {
-               pSceneManager->GoForward(ForwardSceneTransition(IDSCN_ALBUM_LIST));
+               pSceneManager->GoForward(ForwardSceneTransition(IDSCN_ALBUM_LIST,SCENE_TRANSITION_ANIMATION_TYPE_NONE,
+                                                                  SCENE_HISTORY_OPTION_ADD_HISTORY, SCENE_DESTROY_OPTION_DESTROY));
        }
        AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
 }
 
+void
+AllListEditorPanel::ChangeOrientation(void)
+{
+       SceneManager* pSceneManager = SceneManager::GetInstance();
+       const Form* pForm = dynamic_cast<Form*>(pSceneManager->GetCurrentScene()->GetForm());
+       TryReturn(pForm != null,, "[%s] fail to get the form.", GetErrorMessage(GetLastResult()));
+
+       FloatRectangle clientAreaBounds = pForm->GetClientAreaBoundsF();
+       SetBounds(0.0f, 0.0f, clientAreaBounds.width, clientAreaBounds.height);
+       __pContentIconListView->SetBounds(0.0f, 0.0f, clientAreaBounds.width, clientAreaBounds.height - H_COUNT_LABEL);
+       __pLabelSelectCnt->SetBounds(0.0f, clientAreaBounds.height - H_COUNT_LABEL, clientAreaBounds.width, H_COUNT_LABEL);
+       __pButtonSelectRegion->SetBounds(clientAreaBounds.width - W_COUNT_LABEL_BUTTON - 10.0f,
+                       clientAreaBounds.height - H_COUNT_LABEL_BUTTON - 4.0f, W_COUNT_LABEL_BUTTON, H_COUNT_LABEL_BUTTON);
+}
+
 result
 AllListEditorPanel::OnRequestMessage(void)
 {
        AppLogDebug("ENTER");
+       result r = E_SUCCESS;
        IList* pIndexList = GetItemCheckedIndexListN();
        if (pIndexList == null || pIndexList->GetCount() <= 0)
        {
@@ -602,45 +654,49 @@ AllListEditorPanel::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);
-               }
-
-               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_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);
 
-       __pPresentationModel->StartAppControl(APPCONTROL_PROVIDER_ID_MESSAGE, APPCONTROL_OPERATION_ID_COMPOSE,
-                       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);
+       }
        AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
 
-       return E_SUCCESS;
+       return r;
 }
 
 result
 AllListEditorPanel::OnRequestEmail(void)
 {
        AppLogDebug("ENTER");
+       result r = E_SUCCESS;
+
        IList* pIndexList = GetItemCheckedIndexListN();
        if (pIndexList == null || pIndexList->GetCount() <= 0)
        {
@@ -649,101 +705,94 @@ AllListEditorPanel::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);
+                       pArrayList->Add(new (std::nothrow) String(__pPresentationModel->GetContentFilePath(checkedIndex)));
                }
-
-               if (combineText.CompareTo(EMPTY_SPACE) != 0)
-               {
-                       combineText.Append(L";");
-               }
-               combineText.Append(path);
        }
 
+       const String uriData = APPCONTROL_URI_MAIL_TO;
        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,
+                       &uriData, 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
 AllListEditorPanel::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;
-               pDataList = null;
-               delete pIndexList;
-               pIndexList = null;
-               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);
+       const String mimeType = APPCONTROL_MIME_IMAGE_ALL;
+
+       r = __pPresentationModel->StartAppControl(APPCONTROL_PROVIDER_ID_IMAGE, APPCONTROL_OPERATION_ID_VIEW, null,
+                       &mimeType, pDataList, null);
 
-       __pPresentationModel->StartAppControl(APPCONTROL_PROVIDER_ID_IMAGE,
-                       APPCONTROL_OPERATION_ID_VIEW, 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);
+       }
+
+       delete pIndexList;
        AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
 
-       return E_SUCCESS;
+       return r;
 }
 
 void
@@ -754,13 +803,17 @@ AllListEditorPanel::ResetSelection(void)
        __itemCount = __pPresentationModel->GetCurrentAlbumContentInfoCount();
        __pContentIconListView->UpdateList();
 
-       int checkedCount = GetItemCheckedCount();
+       for (int index = 0; index < __itemCount; ++index)
+       {
+               __pContentIconListView->SetItemChecked(index, false);
+               __pContentIconListView->RefreshList(index,LIST_REFRESH_TYPE_ITEM_MODIFY);
+       }
+
        String strTmp;
-       strTmp.Format(LENGTH_COUNT_LABEL, L"%ls (%d)",
-                       ResourceManager::GetString(L"IDS_COM_BODY_SELECTED").GetPointer(), checkedCount);
+       strTmp = ResourceManager::GetString(L"IDS_ST_POP_NO_ITEMS_SELECTED");
+
        __pLabelSelectCnt->SetText(strTmp);
        __pLabelSelectCnt->RequestRedraw(true);
-       __pCheckButton->SetSelected(false);
        SetButtonState();
        AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
 }
@@ -772,22 +825,127 @@ AllListEditorPanel::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 SceneManager.",
-                       GetErrorMessage(GetLastResult()));
-
        if (GetItemCheckedCount() > 0)
        {
                AppLogDebug("BUTTONSTATE : Request Enable");
-               pFileListEditorForm->SetFooterButtonsState(true);
+               __pFileListEditorForm->SetFooterButtonsState(true);
                __pButtonSelectRegion->SetShowState(true);
        }
        else
        {
                AppLogDebug("BUTTONSTATE : Request disable");
-               pFileListEditorForm->SetFooterButtonsState(false);
+               __pFileListEditorForm->SetFooterButtonsState(false);
                __pButtonSelectRegion->SetShowState(false);
        }
        AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
 }
+
+void
+AllListEditorPanel::OnSelectAllPressed(void)
+{
+       bool needToSelectAll = true;
+       int checkedCount = GetItemCheckedCount();
+       int totalFileCount = __pPresentationModel->GetCurrentAlbumContentInfoCount();
+       if (checkedCount == totalFileCount)
+       {
+               needToSelectAll = false;
+       }
+
+       if (needToSelectAll == true)
+       {
+               for (int i = 0; i < totalFileCount; ++i)
+               {
+                       if (__pContentIconListView->IsItemChecked(i) == false)
+                       {
+                               __pContentIconListView->SetItemChecked(i,true);
+                               __pContentIconListView->RefreshList(i, LIST_REFRESH_TYPE_ITEM_MODIFY);
+                       }
+               }
+       }
+       else
+       {
+               for (int i = 0; i < totalFileCount; ++i)
+               {
+                       if (__pContentIconListView->IsItemChecked(i) == true)
+                       {
+                               __pContentIconListView->SetItemChecked(i, false);
+                               __pContentIconListView->RefreshList(i, LIST_REFRESH_TYPE_ITEM_MODIFY);
+                       }
+               }
+       }
+
+       String tempString;
+       if (needToSelectAll == true)
+       {
+               tempString.Format(LENGTH_COUNT_LABEL,
+                                               ResourceManager::GetString(L"IDS_VR_POP_PD_ITEMS_SELECTED").GetPointer(), totalFileCount);
+       }
+       else
+       {
+               tempString = ResourceManager::GetString(L"IDS_ST_POP_NO_ITEMS_SELECTED");
+       }
+
+       __pLabelSelectCnt->SetText(tempString);
+       __pLabelSelectCnt->RequestRedraw(true);
+       SetButtonState();
+}
+
+result
+AllListEditorPanel::OnRequestRotate(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 AllListEditorPanel::CancelUpdateProgress(void)
+{
+       if (__pFileUpdateTimer!= null && __pFileUpdateTimer->IsStarted())
+       {
+               __pFileUpdateTimer->Cancel();
+               delete __pFileUpdateTimer;
+               __pFileUpdateTimer = null;
+       }
+}
+
+void
+AllListEditorPanel::OnScanDirStart()
+{
+       AppLogDebug("ENTER");
+       __pFileListEditorForm->SetProgressState(true);
+       AppLogDebug("EXIT");
+}
+void
+AllListEditorPanel::OnScanDirComplete()
+{
+       AppLogDebug("ENTER");
+       __pFileListEditorForm->SetProgressState(false);
+       AppLogDebug("EXIT");
+}