//
// 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;
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()));
AllListSelectionPanel::~AllListSelectionPanel(void)
{
AppLogDebug("ENTER");
- delete __pFileDelete;
+ delete __pFileUpdateTimer;
AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
}
__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;
return r;
}
-/*
-void
-AllListSelectionPanel::UpdatePanelContent()
-{
- 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)
else
{
AppLogDebug("EXIT 1(%s)", GetErrorMessage(GetLastResult()));
+ delete pItemText;
return null;
}
const SceneId& currentSceneId, IList* pArgs)
{
AppLogDebug("ENTER");
+
+ ChangeOrientation();
+
__pPresentationModel = FileListPresentationModel::GetInstance();
SceneManager* pSceneManager = SceneManager::GetInstance();
}
IList*
-AllListSelectionPanel::GetItemCheckedIndexListN(void)
+AllListSelectionPanel::GetItemCheckedIndexListN(void) const
{
AppLogDebug("ENTER");
IList* pList = new (std::nothrow) ArrayList(SingleObjectDeleter);
}
int
-AllListSelectionPanel::GetRealindexFromVirtualIndex(int virtualIndex)
+AllListSelectionPanel::GetRealindexFromVirtualIndex(const int virtualIndex) const
{
if (__pSeletedIndexList == null || __pSeletedIndexList->GetCount() == 0)
{
}
int
-AllListSelectionPanel::GetVirtualIndexFromRealIndex(int realIndex)
+AllListSelectionPanel::GetVirtualIndexFromRealIndex(const int realIndex) const
{
int returnValue = -1;
int loopCount = __pSeletedIndexList->GetCount();
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
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
{
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)
{
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);
- __pPresentationModel->StartAppControl(APPCONTROL_PROVIDER_ID_MESSAGE, APPCONTROL_OPERATION_ID_COMPOSE, null,
+ 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);
+ }
+
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)
{
}
}
+ const String uriData = APPCONTROL_URI_MAIL_TO;
HashMap* pDataList = new (std::nothrow) HashMap(SingleObjectDeleter);
pDataList->Construct();
pDataList->Add(new (std::nothrow) String(APPCONTROL_KEY_PATH), (Object*)pArrayList);
- __pPresentationModel->StartAppControl(APPCONTROL_PROVIDER_ID_EMAIL, APPCONTROL_OPERATION_ID_COMPOSE,
- new (std::nothrow) String(APPCONTROL_URI_MAIL_TO), null, pDataList, null);
+ 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);
+ }
+
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)
{
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);
+
+ 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, null,
- new (std::nothrow) String(APPCONTROL_MIME_IMAGE_ALL), pDataList, null);
AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
- return E_SUCCESS;
+ return r;
}
void
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();
- }
+
SetButtonState();
AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
}
}
void
-AllListSelectionPanel::SelectAllPressed(void)
+AllListSelectionPanel::OnSelectAllPressed(void)
{
bool needToSelectAll = true;
int checkedCount = GetItemCheckedCount();
if (needToSelectAll == true)
{
- for (int i = 0 ; i < __itemCount; ++i)
+ for (int i = 0; i < __itemCount; ++i)
{
if (__pContentIconListView->IsItemChecked(i) == false)
{
- __pContentIconListView->SetItemChecked(i,true);
+ __pContentIconListView->SetItemChecked(i, true);
__pContentIconListView->RefreshList(i, LIST_REFRESH_TYPE_ITEM_MODIFY);
}
}
}
else
{
- for (int i = 0 ; i < __itemCount; ++i)
+ for (int i = 0; i < __itemCount; ++i)
{
if (__pContentIconListView->IsItemChecked(i) == true)
{
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;
+ }
+}
+
+void
+AllListSelectionPanel::OnScanDirStart()
+{
+ AppLogDebug("ENTER");
+ __pFileListEditorForm->SetProgressState(true);
+ AppLogDebug("EXIT");
+}
+void
+AllListSelectionPanel::OnScanDirComplete()
+{
+ AppLogDebug("ENTER");
+ __pFileListEditorForm->SetProgressState(false);
+ AppLogDebug("EXIT");
+}