//
// 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
//
static const int H_VIDEO_DURATION = 48;
static const int FONT_SIZE_DURATION = 32;
-VideoListEditorPanel::VideoListEditorPanel()
+VideoListEditorPanel::VideoListEditorPanel(void)
: __pContentIconListView(null)
, __pCheckButton(null)
, __pLabelSelectCnt(null)
, __itemCount(0)
, __pPresentationModel(null)
, __pFileDelete(null)
+ , __pFileListEditorForm(null)
{
AppLogDebug("ENTER");
AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
}
-VideoListEditorPanel::~VideoListEditorPanel()
+VideoListEditorPanel::~VideoListEditorPanel(void)
{
AppLogDebug("ENTER");
delete __pFileDelete;
clientAreaBounds.x = clientAreaBounds.y = 0;
SetBounds(clientAreaBounds);
- if (__pPresentationModel->GetAppControlMode() == APP_CONTROL_MODE_PICK)
+ if (__pPresentationModel->GetAppControlMode() == APPCONTROL_MODE_PICK)
{
__pContentIconListView = new (std::nothrow) ListView();
__pContentIconListView->SetTextOfEmptyList(ResourceManager::GetString(L"IDS_COM_BODY_NO_ITEMS"));
__pContentIconListView->SetItemProvider(*this);
__pContentIconListView->AddListViewItemEventListener(*this);
- AddControl(*__pContentIconListView);
+ AddControl(__pContentIconListView);
__pContentIconListView->SetShowState(true);
+
+ __pLabelSelectCnt = new (std::nothrow) Label();
+ __pLabelSelectCnt->Construct(Rectangle(0, clientAreaBounds.height - H_COUNT_LABEL,
+ clientAreaBounds.width, H_COUNT_LABEL), ResourceManager::GetString(L"IDS_ST_POP_NO_ITEMS_SELECTED"));
+ __pLabelSelectCnt->SetTextVerticalAlignment(ALIGNMENT_MIDDLE);
+ __pLabelSelectCnt->SetTextHorizontalAlignment(ALIGNMENT_LEFT);
+ __pLabelSelectCnt->SetBackgroundColor(COLOR_COUNT_LABEL);
+ __pLabelSelectCnt->SetTextColor(Color(COLOR_SELECT_COUNT_FONT));
+ __pLabelSelectCnt->SetTextConfig(COUNT_LABEL_FONT_SIZE, LABEL_TEXT_STYLE_BOLD);
+ AddControl(__pLabelSelectCnt);
}
else
{
- __pContentIconListView->Construct(Rectangle(0, 0, clientAreaBounds.width, clientAreaBounds.height), true, false);
+ __pContentIconListView->Construct(Rectangle(0, 0, clientAreaBounds.width,
+ clientAreaBounds.height), true, false);
Bitmap* pBitmapEmpty = ResourceManager::GetBitmapN(IDB_LISTVIEW_EMPTY);
if (pBitmapEmpty != null)
{
__pContentIconListView->SetTextOfEmptyList(ResourceManager::GetString(L"IDS_COM_BODY_NO_ITEMS"));
__pContentIconListView->SetItemProvider(*this);
__pContentIconListView->AddListViewItemEventListener(*this);
- AddControl(*__pContentIconListView);
+ AddControl(__pContentIconListView);
__pContentIconListView->SetShowState(true);
}
}
{
__pContentIconListView = new (std::nothrow) ListView();
__pContentIconListView->Construct(
- Rectangle(0, H_SELECTALL_REGION, W_CLIENT_REGION, clientAreaBounds.height-H_SELECTALL_REGION),
+ Rectangle(0, H_SELECTALL_REGION, W_CLIENT_REGION, clientAreaBounds.height - H_SELECTALL_REGION),
true, false);
Bitmap* pBitmapEmpty = ResourceManager::GetBitmapN(IDB_LISTVIEW_EMPTY);
if (pBitmapEmpty != null)
__pContentIconListView->SetTextOfEmptyList(ResourceManager::GetString(L"IDS_COM_BODY_NO_ITEMS"));
__pContentIconListView->SetItemProvider(*this);
__pContentIconListView->AddListViewItemEventListener(*this);
- AddControl(*__pContentIconListView);
+ AddControl(__pContentIconListView);
__pContentIconListView->SetShowState(true);
__pLabelSelectCnt = new (std::nothrow) Label();
__pLabelSelectCnt->Construct(
- Rectangle(0, clientAreaBounds.height-H_COUNT_LABEL, clientAreaBounds.width, H_COUNT_LABEL),
+ Rectangle(0, clientAreaBounds.height - H_COUNT_LABEL, clientAreaBounds.width, H_COUNT_LABEL),
ResourceManager::GetString(L"IDS_ST_POP_NO_ITEMS_SELECTED"));
__pLabelSelectCnt->SetTextVerticalAlignment(ALIGNMENT_MIDDLE);
__pLabelSelectCnt->SetTextHorizontalAlignment(ALIGNMENT_LEFT);
__pLabelSelectCnt->SetBackgroundColor(COLOR_COUNT_LABEL);
__pLabelSelectCnt->SetTextColor(Color(COLOR_SELECT_COUNT_FONT));
__pLabelSelectCnt->SetTextConfig(COUNT_LABEL_FONT_SIZE, LABEL_TEXT_STYLE_BOLD);
- AddControl(*__pLabelSelectCnt);
+ AddControl(__pLabelSelectCnt);
}
AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
pDuration = new (std::nothrow) String(ResourceManager::GetString(L"EMPTY_SPACE"));
}
- if (__pPresentationModel->GetAppControlMode() == APP_CONTROL_MODE_PICK)
+ if (__pPresentationModel->GetAppControlMode() == APPCONTROL_MODE_PICK)
{
if (__pPresentationModel->GetAppControlSelectionMode() == APPCONTROL_SELECTION_MODE_MULTIPLE)
{
Bitmap* pSelectedBitmap = new (std::nothrow) Bitmap();
pSelectedBitmap->Construct(canvas, canvas.GetBounds());
- pItem->AddElement(RECT_VIDEO_THUMBNAIL, ACTION_ID_FORMAT_THUMBNAIL, *pBitmap,
- pSelectedBitmap);
+ pItem->AddElement(RECT_VIDEO_THUMBNAIL, IDA_FORMAT_THUMBNAIL, *pBitmap, pSelectedBitmap);
delete pSelectedBitmap;
}
else
{
AppLogDebug("EXIT 1(%s)", GetErrorMessage(GetLastResult()));
-
+ delete pTitle;
+ delete pItemText;
+ delete pDuration;
return null;
}
}
else
{
- pItem->AddElement(RECT_VIDEO_THUMBNAIL, ACTION_ID_FORMAT_THUMBNAIL, *pBitmap);
+ pItem->AddElement(RECT_VIDEO_THUMBNAIL, IDA_FORMAT_THUMBNAIL, *pBitmap);
}
if (pTitle == null)
}
Rectangle titleRect(GAP_W_VIDEO_TITLE, GAP_H_VIDEO_TITLE, itemWidth-W_VIDEO_TITLE, H_VIDEO_TITLE);
- pItem->AddElement(titleRect, ACTION_ID_FORMAT_TITLE, *pTitle, FONT_SIZE_TITLE,
+ pItem->AddElement(titleRect, IDA_FORMAT_TITLE, *pTitle, FONT_SIZE_TITLE,
Color::GetColor(COLOR_ID_BLACK),null,null,false);
Rectangle durationRect(GAP_W_VIDEO_DURATION, GAP_H_VIDEO_DURATION, itemWidth-W_VIDEO_DURATION,
H_VIDEO_DURATION);
- pItem->AddElement(durationRect, ACTION_ID_FORMAT_DURATION, *pDuration, FONT_SIZE_DURATION,
+ pItem->AddElement(durationRect, IDA_FORMAT_DURATION, *pDuration, FONT_SIZE_DURATION,
Color::GetColor(COLOR_ID_GREY),null,null,false);
}
else
{
pItem->Construct(Dimension(itemWidth, H_VIDEO_ITEM), LIST_ANNEX_STYLE_NORMAL);
- pItem->AddElement(RECT_VIDEO_THUMBNAIL, ACTION_ID_FORMAT_THUMBNAIL, *pBitmap);
+ pItem->AddElement(RECT_VIDEO_THUMBNAIL, IDA_FORMAT_THUMBNAIL, *pBitmap);
if (pTitle == null)
{
}
Rectangle titleRect(GAP_W_VIDEO_TITLE, GAP_H_VIDEO_TITLE, itemWidth-W_VIDEO_TITLE, H_VIDEO_TITLE);
- pItem->AddElement(titleRect, ACTION_ID_FORMAT_TITLE, *pTitle, FONT_SIZE_TITLE,
- Color::GetColor(COLOR_ID_BLACK),null,null,false);
+ pItem->AddElement(titleRect, IDA_FORMAT_TITLE, *pTitle, FONT_SIZE_TITLE,
+ Color::GetColor(COLOR_ID_BLACK), null, null, false);
Rectangle durationRect(GAP_W_VIDEO_DURATION, GAP_H_VIDEO_DURATION, itemWidth-W_VIDEO_DURATION,
H_VIDEO_DURATION);
- pItem->AddElement(durationRect, ACTION_ID_FORMAT_DURATION, *pDuration, FONT_SIZE_DURATION,
- Color::GetColor(COLOR_ID_GREY),null,null,false);
+ pItem->AddElement(durationRect, IDA_FORMAT_DURATION, *pDuration, FONT_SIZE_DURATION,
+ Color::GetColor(COLOR_ID_GREY), null, null, false);
}
}
else
Bitmap* pSelectedBitmap = new (std::nothrow) Bitmap();
pSelectedBitmap->Construct(canvas, canvas.GetBounds());
- pItem->AddElement(RECT_VIDEO_THUMBNAIL, ACTION_ID_FORMAT_THUMBNAIL, *pBitmap, pSelectedBitmap);
+ pItem->AddElement(RECT_VIDEO_THUMBNAIL, IDA_FORMAT_THUMBNAIL, *pBitmap, pSelectedBitmap);
delete pSelectedBitmap;
}
else
{
- pItem->AddElement(RECT_VIDEO_THUMBNAIL, ACTION_ID_FORMAT_THUMBNAIL, *pBitmap);
+ pItem->AddElement(RECT_VIDEO_THUMBNAIL, IDA_FORMAT_THUMBNAIL, *pBitmap);
}
}
else
{
- pItem->AddElement(RECT_VIDEO_THUMBNAIL, ACTION_ID_FORMAT_THUMBNAIL, *pBitmap);
+ pItem->AddElement(RECT_VIDEO_THUMBNAIL, IDA_FORMAT_THUMBNAIL, *pBitmap);
}
if (pTitle == null)
}
Rectangle titleRect(GAP_W_VIDEO_TITLE, GAP_H_VIDEO_TITLE, itemWidth-W_VIDEO_TITLE, H_VIDEO_TITLE);
- pItem->AddElement(titleRect, ACTION_ID_FORMAT_TITLE, *pTitle, FONT_SIZE_TITLE,
- Color::GetColor(COLOR_ID_BLACK),null,null,false);
+ pItem->AddElement(titleRect, IDA_FORMAT_TITLE, *pTitle, FONT_SIZE_TITLE,
+ Color::GetColor(COLOR_ID_BLACK), null, null, false);
Rectangle durationRect(GAP_W_VIDEO_DURATION, GAP_H_VIDEO_DURATION, itemWidth - W_VIDEO_DURATION,
H_VIDEO_DURATION);
- pItem->AddElement(durationRect, ACTION_ID_FORMAT_DURATION, *pDuration, FONT_SIZE_DURATION,
- Color::GetColor(COLOR_ID_GREY),null,null,false);
+ pItem->AddElement(durationRect, IDA_FORMAT_DURATION, *pDuration, FONT_SIZE_DURATION,
+ Color::GetColor(COLOR_ID_GREY), null, null, false);
}
if (pBitmap != null)
if (status == LIST_ITEM_STATUS_CHECKED || status == LIST_ITEM_STATUS_UNCHECKED)
{
- if (__pPresentationModel->GetAppControlMode() == APP_CONTROL_MODE_PICK)
+ if (__pPresentationModel->GetAppControlMode() == APPCONTROL_MODE_PICK)
{
if (__pPresentationModel->GetAppControlSelectionMode() == APPCONTROL_SELECTION_MODE_MULTIPLE)
{
}
}
- if ( __pPresentationModel->GetAppControlMode() == APP_CONTROL_MODE_PICK
+ if ( __pPresentationModel->GetAppControlMode() == APPCONTROL_MODE_PICK
&& __pPresentationModel->GetAppControlSelectionMode() != APPCONTROL_SELECTION_MODE_MULTIPLE)
{
if (status == LIST_ITEM_STATUS_SELECTED)
{
- HashMap* map = new (std::nothrow) HashMap(SingleObjectDeleter);
- result r = map->Construct();
+ HashMap* pMap = new (std::nothrow) HashMap(SingleObjectDeleter);
+ result r = pMap->Construct();
if (r == E_SUCCESS)
{
- map->Add(new (std::nothrow) String(APPCONTROL_KEY_PATH),
- new (std::nothrow) String(__pPresentationModel->GetContentFilePath(index)));
ArrayList* pArrayList = new (std::nothrow) ArrayList(SingleObjectDeleter);
pArrayList->Construct();
if (r == E_SUCCESS)
{
pArrayList->Add(new (std::nothrow) String(__pPresentationModel->GetContentFilePath(index)));
- map->Add(new (std::nothrow) String(APPCONTROL_KEY_DATA_SELECTED), (Object*)pArrayList);
+ pMap->Add(new (std::nothrow) String(APPCONTROL_KEY_DATA_SELECTED), (Object*)pArrayList);
GalleryApp* pApp = dynamic_cast<GalleryApp*>(UiApp::GetInstance());
if (pApp != null)
{
- pApp->SendAppControlResult(APP_CTRL_RESULT_SUCCEEDED, map);
+ pApp->SendAppControlResult(APP_CTRL_RESULT_SUCCEEDED, pMap);
pApp->Terminate();
}
else
{
- delete map;
+ delete pMap;
}
}
}
else
{
- delete map;
+ delete pMap;
}
}
}
- AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
-}
-
-void
-VideoListEditorPanel::OnListViewItemSwept(ListView& listView, int index, SweepDirection direction)
-{
- AppLogDebug("ENTER");
- AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
-}
-
-void
-VideoListEditorPanel::OnListViewContextItemStateChanged(ListView& listView, int index, int elementId,
- ListContextItemStatus status)
-{
- AppLogDebug("ENTER");
+ SetButtonState();
AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
}
const SceneId& currentSceneId, IList* pArgs)
{
AppLogDebug("ENTER");
+ SceneManager* pSceneManager = SceneManager::GetInstance();
+ __pFileListEditorForm = dynamic_cast<FileListEditorForm*>(pSceneManager->GetCurrentScene()->GetForm());
+
__pPresentationModel = FileListPresentationModel::GetInstance();
- if (__pPresentationModel->GetAppControlMode() == APP_CONTROL_MODE_PICK)
+ if (__pPresentationModel->GetAppControlMode() == APPCONTROL_MODE_PICK)
{
if (currentSceneId == IDSCN_VIDEO_LIST_EDITOR)
{
}
void
-VideoListEditorPanel::OnFileOpComplete(enum FileActionMode actionId, enum FileActionCompleteRes res)
-{
-}
-
-void
VideoListEditorPanel::OnRequestAppExitWithMultipleSelectionAppControlResult(void)
{
AppLogDebug("ENTER");
return;
}
- HashMap* map = new (std::nothrow) HashMap(SingleObjectDeleter);
- result r = map->Construct();
+ HashMap* pMap = new (std::nothrow) HashMap(SingleObjectDeleter);
+ result r = pMap->Construct();
if (r == E_SUCCESS)
{
if (r == E_SUCCESS)
{
- Integer* temp = null;
+ Integer* pTemp = null;
int loopCount = pIndexList->GetCount();
for (int i = 0; i < loopCount; ++i)
{
- temp = static_cast<Integer*>(pIndexList->GetAt(i));
- pArrayList->Add(new (std::nothrow) String(__pPresentationModel->GetContentFilePath(temp->ToInt())));
+ pTemp = static_cast<Integer*>(pIndexList->GetAt(i));
+ pArrayList->Add(new (std::nothrow) String(__pPresentationModel->GetContentFilePath(pTemp->ToInt())));
}
- map->Add(new (std::nothrow) String(APPCONTROL_KEY_DATA_SELECTED), (Object*)pArrayList);
+ pMap->Add(new (std::nothrow) String(APPCONTROL_KEY_DATA_SELECTED), (Object*)pArrayList);
GalleryApp* pApp = dynamic_cast<GalleryApp*>(UiApp::GetInstance());
if (pApp != null)
{
- pApp->SendAppControlResult(APP_CTRL_RESULT_SUCCEEDED, map);
+ pApp->SendAppControlResult(APP_CTRL_RESULT_SUCCEEDED, pMap);
pApp->Terminate();
}
else
{
- delete map;
+ delete pMap;
}
}
else
{
- delete map;
+ delete pMap;
delete pArrayList;
}
}
else
{
- delete map;
+ delete pMap;
}
delete pIndexList;
}
void
-VideoListEditorPanel::SelectAllPressed(void)
+VideoListEditorPanel::OnSelectAllPressed(void)
{
bool needToSelectAll = true;
int checkedCount = GetItemCheckedCount();
if (needToSelectAll == true)
{
- for (int i = 0 ; i < totalFileCount; ++i)
+ for (int i = 0; i < totalFileCount; ++i)
{
if (__pContentIconListView->IsItemChecked(i) == false)
{
- __pContentIconListView->SetItemChecked(i,true);
+ __pContentIconListView->SetItemChecked(i, true);
__pContentIconListView->RefreshList(i, LIST_REFRESH_TYPE_ITEM_MODIFY);
}
+ __pFileListEditorForm->SetFooterButtonsState(true);
}
}
else
{
- for (int i = 0 ; i < totalFileCount; ++i)
+ for (int i = 0; i < totalFileCount; ++i)
{
if (__pContentIconListView->IsItemChecked(i) == true)
{
__pContentIconListView->SetItemChecked(i, false);
__pContentIconListView->RefreshList(i, LIST_REFRESH_TYPE_ITEM_MODIFY);
}
+ __pFileListEditorForm->SetFooterButtonsState(false);
}
}
__pLabelSelectCnt->SetText(tempString);
__pLabelSelectCnt->RequestRedraw(true);
}
+
+void
+VideoListEditorPanel::SetButtonState(void)
+{
+ AppLogDebug("ENTER");
+
+ SceneManager* pSceneManager = SceneManager::GetInstance();
+ TryReturnVoid(pSceneManager != null, "[%s] fail to get SceneManager.", GetErrorMessage(GetLastResult()));
+
+ if (GetItemCheckedCount() > 0)
+ {
+ __pFileListEditorForm->SetFooterButtonsState(true);
+ }
+ else
+ {
+ __pFileListEditorForm->SetFooterButtonsState(false);
+ }
+
+ AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
+}
+
+void
+VideoListEditorPanel::ChangeOrientation(void)
+{
+ AppLogDebug("ENTER");
+ 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);
+}