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 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;
AllListEditorPanel::AllListEditorPanel(void)
: __pContentIconListView(null)
- , __pCheckButton(null)
, __pLabelSelectCnt(null)
, __pButtonSelectRegion(null)
, __itemCount(0)
__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);
+ SetBounds(0, 0, 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);
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
}
void
-AllListEditorPanel::OnUpdateContentList()
+AllListEditorPanel::UpdatePanelContent()
{
AppLogDebug("ENTER");
SceneManager* pSceneManager = SceneManager::GetInstance();
TryReturnVoid(pFileListEditorForm != null, "[%s] fail to get SceneManager.",
GetErrorMessage(GetLastResult()));
- if ( pFileListEditorForm->GetOverlayStatus() == false && __deleteInProgress == false )
+ if (pFileListEditorForm->GetOverlayStatus() == false && __deleteInProgress == false)
{
SceneManager* pSceneManager = SceneManager::GetInstance();
pSceneManager->GoForward(ForwardSceneTransition(IDSCN_ALL_LIST));
pIconListviewItem = new (std::nothrow) IconListViewItem();
pIconListviewItem->Construct(*pBitmap, pItemText, pSelectedBitmap);
delete pSelectedBitmap;
- pSelectedBitmap = null;
}
else
{
if (pBitmap != null)
{
delete pBitmap;
- pBitmap = null;
}
if (pItemText != null)
{
delete pItemText;
- pItemText = null;
}
AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
__pLabelSelectCnt->SetText(strTmp);
__pLabelSelectCnt->RequestRedraw(true);
- if (__pCheckButton->IsSelected() == true)
- {
- __pCheckButton->SetSelected(false);
- }
- else
- {
- if (checkedCount != 0 && checkedCount == __pPresentationModel->GetCurrentAlbumContentInfoCount())
- {
- __pCheckButton->SetSelected(true);
- }
- }
__pContentIconListView->RefreshList(index, LIST_REFRESH_TYPE_ITEM_MODIFY);
}
SetButtonState();
if (previousSceneId == IDSCN_ALL_LIST_SELECTION)
{
ResetSelection();
+ if (pArgs != null && pArgs->GetCount() > 0)
+ {
+ IList* pSeletedIndexList = pArgs;
+ int loopCount = pSeletedIndexList->GetCount();
+ for (int i = 0; i < loopCount; ++i)
+ {
+ int index = static_cast<Integer*>(pSeletedIndexList->GetAt(i))->ToInt();
+ __pContentIconListView->SetItemChecked(index, true);
+ }
+ __pContentIconListView->RequestRedraw(true);
+ }
}
else if (previousSceneId == IDSCN_ALL_LIST)
{
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)
}
delete __pFileDelete;
- __pFileDelete = new FileDeleteTimer(pIndexList,
- __pPresentationModel,
- this );
+ __pFileDelete = new FileDeleteTimer(pIndexList, __pPresentationModel, this);
result r = __pFileDelete->StartTimer();
if (IsFailed(r))
void AllListEditorPanel::OnFileOpComplete(enum FileActionMode actionId, enum FileActionCompleteRes res)
{
- __pCheckButton->SetSelected(false);
__deleteInProgress = false;
__pLabelSelectCnt->SetText(ResourceManager::GetString(L"IDS_ST_POP_NO_ITEMS_SELECTED"));
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_PATH), (Object*)pArrayList);
__pPresentationModel->StartAppControl(APPCONTROL_PROVIDER_ID_MESSAGE, APPCONTROL_OPERATION_ID_COMPOSE,
- pDataList, null);
+ new (std::nothrow) String(APPCONTROL_URI_MMS_TO), null, pDataList, null);
AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
return E_SUCCESS;
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_ATTACHMENTS), new (std::nothrow) String(combineText));
+ pDataList->Add(new (std::nothrow) String(APPCONTROL_KEY_PATH), (Object*)pArrayList);
__pPresentationModel->StartAppControl(APPCONTROL_PROVIDER_ID_EMAIL, APPCONTROL_OPERATION_ID_COMPOSE,
- pDataList, null);
+ new (std::nothrow) String(APPCONTROL_URI_MAIL_TO), null, pDataList, null);
AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
return E_SUCCESS;
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);
- __pPresentationModel->StartAppControl(APPCONTROL_PROVIDER_ID_IMAGE,
- APPCONTROL_OPERATION_ID_VIEW, pDataList, null);
+ __pPresentationModel->StartAppControl(APPCONTROL_PROVIDER_ID_IMAGE, APPCONTROL_OPERATION_ID_VIEW, null,
+ new (std::nothrow) String(APPCONTROL_MIME_IMAGE_ALL), pDataList, null);
+
+ delete pIndexList;
AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
return E_SUCCESS;
__pLabelSelectCnt->SetText(strTmp);
__pLabelSelectCnt->RequestRedraw(true);
- __pCheckButton->SetSelected(false);
SetButtonState();
AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
}
}
AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
}
+
+void
+AllListEditorPanel::SelectAllPressed(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();
+}