result SetCheckedTableviewItemToShareVia(void);
void RefreshAdditionalInformationRegisterBar(void);
result SetActivatedContextItemToPlaylist(void);
- void RemoveCheckedTableviewItem(void);
+ void RemoveCheckedTableviewItem(bool itemRemove);
void RemoveAdditionalInforamtion(void);
ContentListScreenMode GetContentListScreenMode(void);
public:
SharePopup(void);
virtual ~SharePopup(void);
- result Initialize(void);
+ result Initialize(Tizen::Ui::Control* pControl);
void SetArguments(Tizen::Base::Collection::IList* pIList);
private:
Tizen::Ui::Controls::TableView* __pShareItemTableView;
Tizen::Ui::Controls::Button* __pCancelButton;
-// Tizen::Base::Collection::IList* __pDataList;
Tizen::Base::Collection::HashMap* __pDataList;
+ Tizen::Ui::Control* __pControl;
};
#endif // _MP_SHARE_POPUP_H_
\ No newline at end of file
static const int INDEX_EDIT_FOOTER_EDIT = 0;
static const long ID_DESTORY_PLAY_LIST_PICKER_POPUP = 0;
+static const long ID_DESTORY_SHARE_POPUP = 1;
static const Tizen::Base::String STRING_SORT_TITLE = L"Title";
static const Tizen::Base::String STRING_SORT_ARTIST = L"Artist";
case IDA_FOOTER_BUTTON_DELETE:
{
- RemoveCheckedTableviewItem();
+ RemoveCheckedTableviewItem(true);
__pPresentationModel->RefreshContentList(__currentContentIndex);
UpdateContentListScreenState();
__pContentTableView->UpdateTableView();
}
break;
- case IDA_FOOTER_BUTTON_SHARE:
- {
-// Tizen::Base::Collection::ArrayList* pDataList = new (std::nothrow) ArrayList();
-// Footer* pFooter = GetFooter();
-// int totalCount = __pPresentationModel->GetContentCount(__currentContentIndex);
-//
-// pDataList->Construct();
-//
-// for (int iCount = 0; iCount < totalCount; iCount++)
-// {
-// if (__pContentTableView->IsItemChecked(iCount) == true)
-// {
-// ContentInformation* pContentInfoStruct = __pPresentationModel->GetContentInfoN(iCount);
-// if (pContentInfoStruct == null)
-// {
-// pDataList->RemoveAll(true);
-// delete pDataList;
-// pDataList = null;
-// return;
-// }
-// pDataList->Add(*(new (std::nothrow) String(L"attachment:" + pContentInfoStruct->ContentFilePath)));
-//
-// __pContentTableView->SetItemChecked(iCount, false);
-//
-// delete pContentInfoStruct;
-// pContentInfoStruct = null;
-// }
-// }
-// pFooter->SetItemEnabled(INDEX_FOOTER_DELETE, false);
-// pFooter->SetItemEnabled(INDEX_FOOTER_SHARE, false);
-// pFooter->SetItemEnabled(INDEX_FOOTER_ADDTOPLATLIST, false);
-//
-// __checkedItemCount = INIT_VALUE;
-// CommonUtil::ShowCheckedCountLabel(*__pCheckedCountLabel, __checkedItemCount, *__pContentTableView, *this);
-// CommonUtil::ShowSelectAllCheckButton(*__pSelectAllCheckedButton);
-//
-// Invalidate(true);
-//
-// if (__pSharePopup == null)
-// {
-// __pSharePopup = new (std::nothrow) SharePopup();
-// __pSharePopup->Initialize();
-// }
-// __pSharePopup->SetShowState(true);
-// __pSharePopup->Show();
-// __pSharePopup->SetArguments(pDataList);
- }
- break;
-
-// case IDA_FOOTER_BUTTON_ADD_TO_PLAYLIST:
-// {
-// SetCheckedTableviewItemToPlayList();
-// }
-// break;
-
default:
break;
}
AlbumContentListForm::OnUserEventReceivedN(RequestId requestId, Tizen::Base::Collection::IList* pArgs)
{
AppLogDebug("ENTER");
- ContentListForm::OnUserEventReceivedN(requestId, null);
+ ContentListForm::OnUserEventReceivedN(requestId, pArgs);
AppLogDebug("EXIT");
}
if (__pContentTableView->IsItemChecked(iCount) == true)
{
pDataList->AddItems(*(__pPresentationModel->GetContentPathListN(iCount)));
- __pContentTableView->SetItemChecked(iCount, false);
}
}
__pPlayListPickerPopup->Initialize(this, pDataList);
__pPlayListPickerPopup->SetShowState(true);
__pPlayListPickerPopup->Show();
-
- __checkedItemCount = INIT_VALUE;
- SetCheckedCountBalloonPopup(__checkedItemCount);
- CommonUtil::SetFooterItemEnabled(*pFooter, false);
- __pContentTableView->Invalidate(true);
}
break;
delete __pPlayListPickerPopup;
__pPlayListPickerPopup = null;
}
+
+ if (pArgs == null)
+ {
+ AppLogDebug("EXIT_1");
+ return;
+ }
+
+ Boolean* pIsInitialize = static_cast<Boolean*>(pArgs->GetAt(0));
+ if (pIsInitialize->Equals(true))
+ {
+ __checkedItemCount = INIT_VALUE;
+ SetCheckedCountBalloonPopup(__checkedItemCount);
+
+ int totalCount = __pPresentationModel->GetAllAlbumCount();
+ for (int iCount = 0; iCount < totalCount; iCount++)
+ {
+ __pContentTableView->SetItemChecked(iCount, false);
+ }
+
+ Form* pForm = dynamic_cast<Form*>(GetParent());
+ Footer* pFooter = pForm->GetFooter();
+ CommonUtil::SetFooterItemEnabled(*pFooter, false);
+ Invalidate(true);
+ }
+ pArgs->RemoveAll(true);
+ delete pArgs;
}
AppLogDebug("EXIT");
}
if (__pContentTableView->IsItemChecked(iCount) == true)
{
pDataList->Add(__pPresentationModel->GetCheckedContent(iCount));
- __pContentTableView->SetItemChecked(iCount, false);
}
}
__pPlayListPickerPopup->Initialize(this, pDataList);
__pPlayListPickerPopup->SetShowState(true);
__pPlayListPickerPopup->Show();
-
- __checkedItemCount = INIT_VALUE;
- SetCheckedCountBalloonPopup(__checkedItemCount);
- CommonUtil::SetFooterItemEnabled(*pFooter, false);
- __pContentTableView->Invalidate(true);
}
break;
}
pDataList->Add(*(new (std::nothrow) String(L"attachment:" + pContentInfoStruct->ContentFilePath)));
- __pContentTableView->SetItemChecked(iCount, false);
-
delete pContentInfoStruct;
pContentInfoStruct = null;
}
}
- __checkedItemCount = INIT_VALUE;
- SetCheckedCountBalloonPopup(__checkedItemCount);
- CommonUtil::SetFooterItemEnabled(*pFooter, false);
- __pContentTableView->Invalidate(true);
if (__pSharePopup == null)
{
__pSharePopup = new (std::nothrow) SharePopup();
- __pSharePopup->Initialize();
+ __pSharePopup->Initialize(this);
}
__pSharePopup->SetShowState(true);
__pSharePopup->Show();
{
AppLogDebug("ENTER");
AppLogDebug("OnUserEventReceivedN %d", requestId);
- if (requestId == ID_DESTORY_PLAY_LIST_PICKER_POPUP)
+ switch (requestId)
{
- if (__pPlayListPickerPopup != null)
+ case ID_DESTORY_PLAY_LIST_PICKER_POPUP:
+ // fall through
+ case ID_DESTORY_SHARE_POPUP:
+ {
+ if (__pPlayListPickerPopup != null)
+ {
+ delete __pPlayListPickerPopup;
+ __pPlayListPickerPopup = null;
+ }
+
+ if (__pSharePopup != null)
+ {
+ delete __pSharePopup;
+ __pSharePopup = null;
+ }
+
+ if (pArgs == null)
+ {
+ AppLogDebug("EXIT_1");
+ return;
+ }
+
+ Boolean* pIsInitialize = static_cast<Boolean*>(pArgs->GetAt(0));
+ if (pIsInitialize->Equals(true))
+ {
+ __checkedItemCount = INIT_VALUE;
+ SetCheckedCountBalloonPopup(__checkedItemCount);
+
+ int totalCount = __pPresentationModel->GetTotalCount();
+ for (int iCount = 0; iCount < totalCount; iCount++)
+ {
+ __pContentTableView->SetItemChecked(iCount, false);
+ }
+
+ Form* pForm = dynamic_cast<Form*>(GetParent());
+ Footer* pFooter = pForm->GetFooter();
+ CommonUtil::SetFooterItemEnabled(*pFooter, false);
+ Invalidate(true);
+ }
+ pArgs->RemoveAll(true);
+ delete pArgs;
+ }
+ break;
+
+ default:
{
- delete __pPlayListPickerPopup;
- __pPlayListPickerPopup = null;
+ // Empty statement
}
+ break;
}
AppLogDebug("EXIT");
}
DestroySharePopup();
__pSharePopup = new (std::nothrow) SharePopup();
- result r = __pSharePopup->Initialize();
+ result r = __pSharePopup->Initialize(this);
if (IsFailed(r))
{
AppLogDebug("__pSharePopup->Initialize() failed(%s)", GetErrorMessage(r));
{
AppLogDebug("ENTER");
AppLogDebug("OnUserEventReceivedN %d", requestId);
- if (requestId == ID_DESTORY_PLAY_LIST_PICKER_POPUP)
+ if ((requestId == ID_DESTORY_PLAY_LIST_PICKER_POPUP) || (requestId == ID_DESTORY_SHARE_POPUP))
{
if (GetContentListScreenMode() != CONTENT_LIST_SCREEN_MODE_NORMAL)
{
- ToggleItemCheckedAll(false);
- __allSelectToggle = false;
+ if (pArgs == null)
+ {
+ AppLogDebug("EXIT_1");
+ return;
+ }
+ Boolean* pIsInitialize = static_cast<Boolean*>(pArgs->GetAt(0));
+ if (pIsInitialize->Equals(true))
+ {
+ ToggleItemCheckedAll(false);
+ __allSelectToggle = false;
+ }
}
DestroyPlayListPickerPopup();
+ DestroySharePopup();
+ }
+
+ if (pArgs != null)
+ {
+ pArgs->RemoveAll(true);
+ delete pArgs;
}
AppLogDebug("EXIT");
}
}
UpdateContentListScreenState();
+ GetHeader()->Invalidate(true);
__pContentTableView->UpdateTableView();
AppLogDebug("EXIT");
}
void
-ContentListForm::RemoveCheckedTableviewItem(void)
+ContentListForm::RemoveCheckedTableviewItem(bool itemRemove)
{
AppLogDebug("ENTER");
- int totalCount = __pContentTableView->GetItemCount();
- for (int iCount = 0; iCount < totalCount; iCount++)
+ if (itemRemove)
{
- if (__pContentTableView->IsItemChecked(iCount) == true)
+ int totalCount = __pContentTableView->GetItemCount();
+ for (int iCount = 0; iCount < totalCount; iCount++)
{
- __pContentTableView->SetItemChecked(iCount, false);
- ContentInformation* pContentInfo = GetContentInformation(iCount);
- RemoveContentAt(pContentInfo->contentId);
- delete pContentInfo;
+ if (__pContentTableView->IsItemChecked(iCount) == true)
+ {
+ __pContentTableView->SetItemChecked(iCount, false);
+ ContentInformation* pContentInfo = GetContentInformation(iCount);
+ RemoveContentAt(pContentInfo->contentId);
+ delete pContentInfo;
+ }
}
}
-
__checkedItemCount = INIT_VALUE;
__allSelectToggle = false;
CommonUtil::SetTextItemSelectedBalloonPopup(*__pItemSelectedBalloonPopup, __checkedItemCount);
__pSharePopup->SetShowState(true);
__pSharePopup->Show();
- ToggleItemCheckedAll(false);
- __allSelectToggle = false;
-
AppLogDebug("EXIT");
return E_SUCCESS;
}
AppLogDebug("EXIT");
return E_SUCCESS;
-}
+}
\ No newline at end of file
case IDA_FOOTER_BUTTON_DELETE:
{
- RemoveCheckedTableviewItem();
+ RemoveCheckedTableviewItem(true);
__pPresentationModel->RefreshContentList(__currentContentIndex);
UpdateContentListScreenState();
FolderContentListForm::OnUserEventReceivedN(RequestId requestId, Tizen::Base::Collection::IList* pArgs)
{
AppLogDebug("ENTER");
- ContentListForm::OnUserEventReceivedN(requestId, null);
+ ContentListForm::OnUserEventReceivedN(requestId, pArgs);
AppLogDebug("EXIT");
}
delete __pPlayListPickerPopup;
__pPlayListPickerPopup = null;
}
+
+ if (pArgs == null)
+ {
+ AppLogDebug("EXIT_1");
+ return;
+ }
+
+ Boolean* pIsInitialize = static_cast<Boolean*>(pArgs->GetAt(0));
+ if (pIsInitialize->Equals(true))
+ {
+ __checkedItemCount = INIT_VALUE;
+ SetCheckedCountBalloonPopup(__checkedItemCount);
+
+ int totalCount = __pPresentationModel->GetAllFolderCount();
+ for (int iCount = 0; iCount < totalCount; iCount++)
+ {
+ __pContentTableView->SetItemChecked(iCount, false);
+ }
+
+ Form* pForm = dynamic_cast<Form*>(GetParent());
+ Footer* pFooter = pForm->GetFooter();
+ CommonUtil::SetFooterItemEnabled(*pFooter, false);
+ Invalidate(true);
+ }
+ pArgs->RemoveAll(true);
+ delete pArgs;
}
AppLogDebug("EXIT");
}
if (__pSharePopup == null)
{
__pSharePopup = new (std::nothrow) SharePopup();
- __pSharePopup->Initialize();
+ __pSharePopup->Initialize(this);
}
pDataList->Add(*(new (std::nothrow) String(*contentPath)));
__pSharePopup->SetArguments(pDataList);
__pPlayListPickerPopup = null;
}
}
+
+ if (requestId == ID_DESTORY_SHARE_POPUP)
+ {
+ if (__pSharePopup != null)
+ {
+ delete __pSharePopup;
+ __pSharePopup = null;
+ }
+ }
+
+ if (pArgs != null)
+ {
+ pArgs->RemoveAll(true);
+ delete pArgs;
+ }
AppLogDebug("EXIT");
}
case IDA_FOOTER_BUTTON_DELETE:
{
- RemoveCheckedTableviewItem();
+ if (__currentContentIndex == RECENTLY_ADDED_CONTENT)
+ {
+ RemoveCheckedTableviewItem(true);
+ }
+ else
+ {
+ int totalCount = __pPresentationModel->GetContentCount();
+ for (int iCount = 0; iCount < totalCount; iCount++)
+ {
+ if (__pContentTableView->IsItemChecked(iCount) == true)
+ {
+ ContentInformation* pContentInfoStruct = __pPresentationModel->GetContentInfoN(iCount);
+ if (pContentInfoStruct == null)
+ {
+ return;
+ }
+ __pContentTableView->SetItemChecked(iCount, false);
+ __pPresentationModel->DeleteContent(__currentContentIndex, *pContentInfoStruct);
+
+ delete pContentInfoStruct;
+ pContentInfoStruct = null;
+ }
+ }
+ RemoveCheckedTableviewItem(false);
+ }
+
__pPresentationModel->UpdatePlaylistContentList(__currentContentIndex, __headerTitle);
UpdateContentListScreenState();
__pContentTableView->UpdateTableView();
using namespace Tizen::App;
using namespace Tizen::Base;
+using namespace Tizen::Base::Collection;
using namespace Tizen::Base::Runtime;
using namespace Tizen::Base::Utility;
using namespace Tizen::Content;
AppLogDebug("ENTER");
SceneManager* pSceneManager = SceneManager::GetInstance();
AppAssert(pSceneManager);
+
+ Tizen::Base::Collection::ArrayList* pDataList = new (std::nothrow) ArrayList();
+ pDataList->Construct();
+
if (actionId == IDA_BUTTON_CANCEL)
{
SetShowState(false);
Invalidate(true);
- __pControl->SendUserEvent(ID_DESTORY_PLAY_LIST_PICKER_POPUP, null);
+ pDataList->Add(*(new (std::nothrow) Boolean(false)));
+ __pControl->SendUserEvent(ID_DESTORY_PLAY_LIST_PICKER_POPUP, pDataList);
}
-
- if (actionId == IDA_BUTTON_CREATE)
+ else if (actionId == IDA_BUTTON_CREATE)
{
SetShowState(false);
Invalidate(true);
{
pSceneManager->GoForward(ForwardSceneTransition(IDSCN_PLAYLIST_CREATOR));
}
- __pControl->SendUserEvent(ID_DESTORY_PLAY_LIST_PICKER_POPUP, null);
+ pDataList->Add(*(new (std::nothrow) Boolean(true)));
+ __pControl->SendUserEvent(ID_DESTORY_PLAY_LIST_PICKER_POPUP, pDataList);
}
AppLogDebug("EXIT");
}
int modalResult = 0;
messageBox.ShowAndWait(modalResult);
}
- __pControl->SendUserEvent(ID_DESTORY_PLAY_LIST_PICKER_POPUP, null);
+ Tizen::Base::Collection::ArrayList* pDataList = new (std::nothrow) ArrayList();
+ pDataList->Construct();
+ pDataList->Add(*(new (std::nothrow) Boolean(true)));
+
+ __pControl->SendUserEvent(ID_DESTORY_PLAY_LIST_PICKER_POPUP, pDataList);
}
AppLogDebug("EXIT");
}
: __pShareItemTableView(null)
, __pCancelButton(null)
, __pDataList(null)
+ , __pControl(null)
{
AppLogDebug("ENTER");
AppLogDebug("EXIT");
}
result
-SharePopup::Initialize(void)
+SharePopup::Initialize(Tizen::Ui::Control* pControl)
{
AppLogDebug("ENTER");
result r = E_SUCCESS;
__pCancelButton = static_cast<Button*>(GetControl(IDC_CANCEL_BUTTON));
__pCancelButton->SetActionId(IDA_BUTTON_CANCEL);
__pCancelButton->AddActionEventListener(*this);
-
+ __pControl = pControl;
AppLogDebug("EXIT");
return r;
}
SharePopup::OnActionPerformed(const Tizen::Ui::Control& source, int actionId)
{
AppLogDebug("ENTER");
+ Tizen::Base::Collection::ArrayList* pDataList = new (std::nothrow) ArrayList();
+ pDataList->Construct();
+ pDataList->Add(*(new (std::nothrow) Boolean(false)));
+
if (actionId == IDA_BUTTON_CANCEL)
{
SetShowState(false);
Invalidate(true);
+ __pControl->SendUserEvent(ID_DESTORY_SHARE_POPUP, pDataList);
}
AppLogDebug("EXIT");
}
case INDEX_SHART_ITEM_EMAIL:
{
+ Tizen::Base::Collection::ArrayList* pDataList = new (std::nothrow) ArrayList();
+ pDataList->Construct();
+ pDataList->Add(*(new (std::nothrow) Boolean(true)));
+
+ __pControl->SendUserEvent(ID_DESTORY_SHARE_POPUP, pDataList);
LaunchAppControl(OPERATION_ID_COMPOSE, PROVIDER_ID_EMAIL);
}
break;
case IDA_FOOTER_BUTTON_DELETE:
{
- RemoveCheckedTableviewItem();
- __pPresentationModel->UpdatePlaylistContentList(__currentContentIndex, __headerTitle);
+ int totalCount = __pPresentationModel->GetContentCount();
+ for (int iCount = 0; iCount < totalCount; iCount++)
+ {
+ if (__pContentTableView->IsItemChecked(iCount) == true)
+ {
+ ContentInformation* pContentInfoStruct = __pPresentationModel->GetContentInfoN(iCount);
+ __pContentTableView->SetItemChecked(iCount, false);
+ if (pContentInfoStruct == null)
+ {
+ return;
+ }
+ __pPresentationModel->DeleteContent(USER_CONTENT, *pContentInfoStruct);
+
+ delete pContentInfoStruct;
+ pContentInfoStruct = null;
+ }
+ }
+ RemoveCheckedTableviewItem(false);
+ __pPresentationModel->UpdatePlaylistContentList(USER_CONTENT, __headerTitle);
UpdateContentListScreenState();
__pContentTableView->UpdateTableView();
}
UserPlaylistContentListForm::OnUserEventReceivedN(RequestId requestId, Tizen::Base::Collection::IList* pArgs)
{
AppLogDebug("ENTER");
- ContentListForm::OnUserEventReceivedN(requestId, null);
+ ContentListForm::OnUserEventReceivedN(requestId, pArgs);
if (requestId == ID_DESTORY_PLAY_LIST_PICKER_POPUP)
{
__pPresentationModel->UpdatePlaylistContentList(USER_CONTENT, __headerTitle);