2 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
4 // Licensed under the Flora License, Version 1.1 (the License);
5 // you may not use this file except in compliance with the License.
6 // You may obtain a copy of the License at
8 // http://floralicense.org/license/
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an AS IS BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
18 * @file MpPlaylistContentListForm.cpp
19 * @brief This is the implementation file for PlaylistContentListForm class.
23 #include "MpMusicPlayerApp.h"
24 #include "MpNowPlayContentPanel.h"
25 #include "MpPlaylistContentListForm.h"
26 #include "MpPlaylistListPresentationModel.h"
27 #include "MpPlaylistPickerPopup.h"
28 #include "MpSharePopup.h"
29 #include "MpThumbnailInfo.h"
31 using namespace Tizen::App;
32 using namespace Tizen::Base;
33 using namespace Tizen::Base::Collection;
34 using namespace Tizen::Content;
35 using namespace Tizen::Graphics;
36 using namespace Tizen::Io;
37 using namespace Tizen::Social;
38 using namespace Tizen::Ui;
39 using namespace Tizen::Ui::Controls;
40 using namespace Tizen::Ui::Scenes;
42 PlaylistContentListForm::PlaylistContentListForm(void)
43 : ContentListForm::ContentListForm()
44 , ThumbnailBase::ThumbnailBase()
45 , __pContentListTableView(null)
47 , __pPresentationModel(null)
48 , __checkedItemCount(0)
49 , __currentContentType(-1)
50 , __activatedStateContextItem(-1)
56 PlaylistContentListForm::~PlaylistContentListForm(void)
63 PlaylistContentListForm::Initialize(void)
66 if (IsFailed(Form::Construct(IDL_CONTENT_LIST_FORM)))
68 AppLogDebug("Construct(IDL_CONTENT_LIST_FORM) failed(%s)", GetErrorMessage(GetLastResult()));
77 PlaylistContentListForm::Construct(void)
80 __pContentListTableView = static_cast<TableView*>(GetControl(IDC_TABLEVIEW_CONTENT_LIST));
81 __pContentListTableView->AddTableViewItemEventListener(*this);
82 __pContentListTableView->SetItemProvider(this);
84 SetContentList(__pContentListTableView);
86 return ContentListForm::Construct();
90 PlaylistContentListForm::OnInitializing(void)
93 __fontSizeValue = CommonUtil::GetFontSizeValue();
94 __itemHeight = CommonUtil::GetItemHeight(__fontSizeValue);
96 return ThumbnailBase::Construct();
100 PlaylistContentListForm::OnTerminating(void)
102 AppLogDebug("ENTER");
103 ThumbnailBase::Stop();
105 return ContentListForm::OnTerminating();
109 PlaylistContentListForm::OnActionPerformed(const Tizen::Ui::Control& source, int actionId)
111 AppLogDebug("ENTER");
112 SceneManager* pSceneManager = SceneManager::GetInstance();
114 AppAssert(pSceneManager);
118 case IDA_HEADER_BUTTON_SELECTE_ALL:
120 bool isChecked = true;
121 if (__checkedItemCount == __pContentListTableView->GetItemCount())
125 SetItemCheckedAll(isChecked);
129 case IDA_CONTEXT_MENU_ITEM_SEARCH:
131 pSceneManager->GoForward(ForwardSceneTransition(IDSCN_SEARCH, SCENE_TRANSITION_ANIMATION_TYPE_NONE, SCENE_HISTORY_OPTION_NO_HISTORY));
135 case IDA_CONTEXT_MENU_ITEM_EDIT:
137 if (__pPresentationModel->GetContentCount() == 0)
139 MessageBox messageBox;
140 messageBox.Construct(L"", ResourceManager::GetString(L"IDS_MUSIC_HEADER_NO_SONGS"), MSGBOX_STYLE_NONE, 3000);
143 messageBox.ShowAndWait(modalResult);
147 ToggleScreenState(SCREEN_STATE_EDITOR);
152 case IDA_CONTEXT_MENU_ITEM_SHARE_VIA:
154 if (__pPresentationModel->GetContentCount() == 0)
156 MessageBox messageBox;
157 messageBox.Construct(L"", ResourceManager::GetString(L"IDS_MUSIC_HEADER_NO_SONGS"), MSGBOX_STYLE_NONE, 3000);
160 messageBox.ShowAndWait(modalResult);
164 ToggleScreenState(SCREEN_STATE_SHARE_VIA);
165 // LanucherPicker(PICKER_TYPE_SHARE_PICKER);
170 case IDA_FOOTER_BUTTON_SHARE:
172 LanucherPicker(PICKER_TYPE_SHARE_PICKER);
176 case IDA_FOOTER_BUTTON_ADD_TO_PLAYLIST:
178 LanucherPicker(PICKER_TYPE_PLAY_LIST_PICKER);
182 case IDA_FOOTER_BUTTON_MORE:
184 CreateOptionMenuN(source);
185 SetOptionMenuItem(CONTEXT_MENU_ITEM_STYLE_SHARE_VIA | CONTEXT_MENU_ITEM_STYLE_EDIT);
189 case IDA_FOOTER_BUTTON_DELETE:
191 SetCommonPopup(CommonUtil::CreateContentDeletePopup(*this, IDA_COMMON_POPUP_DELETE, IDA_COMMON_POPUP_CANCEL),this);
195 case IDA_COMMON_POPUP_DELETE:
197 if (__currentContentType == RECENTLY_ADDED_CONTENT)
199 RemoveCheckedTableviewItem(true);
203 int totalCount = __pPresentationModel->GetContentCount();
204 for (int iCount = 0; iCount < totalCount; iCount++)
206 if (__pContentListTableView->IsItemChecked(iCount) == true)
208 ContentInformation* pContentInfoStruct = __pPresentationModel->GetContentInfoN(iCount);
209 __pContentListTableView->SetItemChecked(iCount, false);
210 __checkedItemCount--;
212 if (pContentInfoStruct == null)
216 // __pContentListTableView->SetItemChecked(iCount, false);
217 __pPresentationModel->DeleteContent(__currentContentType, *pContentInfoStruct);
219 delete pContentInfoStruct;
222 RemoveCheckedTableviewItem(false);
223 __pPresentationModel->UpdatePlaylistContentList(__currentContentType, __headerTitle);
227 if(__pPresentationModel->GetContentCount() == 0)
229 ToggleScreenState(SCREEN_STATE_NORMAL);
235 case IDA_COMMON_POPUP_CANCEL:
240 /*case IDA_FOOTER_BUTTON_DELETE:
242 if (__currentContentType == RECENTLY_ADDED_CONTENT)
244 RemoveCheckedTableviewItem(true);
248 int totalCount = __pPresentationModel->GetContentCount();
249 for (int iCount = 0; iCount < totalCount; iCount++)
251 if (__pContentListTableView->IsItemChecked(iCount) == true)
253 ContentInformation* pContentInfoStruct = __pPresentationModel->GetContentInfoN(iCount);
254 if (pContentInfoStruct == null)
258 // __pContentListTableView->SetItemChecked(iCount, false);
259 __pPresentationModel->DeleteContent(__currentContentType, *pContentInfoStruct);
261 delete pContentInfoStruct;
264 RemoveCheckedTableviewItem(false);
265 __pPresentationModel->UpdatePlaylistContentList(__currentContentType, __headerTitle);
269 if(__pPresentationModel->GetContentCount() == 0)
271 ToggleScreenState(SCREEN_STATE_NORMAL);
281 TryRemoveCommonPopup(actionId);
282 TryRemoveContextMenu(actionId);
287 PlaylistContentListForm::OnSceneActivatedN(const Tizen::Ui::Scenes::SceneId& previousSceneId,
288 const Tizen::Ui::Scenes::SceneId& currentSceneId,
289 Tizen::Base::Collection::IList* pArgs)
291 AppLogDebug("ENTER");
292 if (pArgs != null && previousSceneId.Equals(IDSCN_PLAYLIST_LIST, true) == true)
294 __headerTitle.Clear();
295 __prevSceneId.Clear();
296 __prevSceneId.Append(*static_cast<String*>(pArgs->GetAt(DATA_ITEM_SCENE_NAME)));
297 __headerTitle.Append(*static_cast<String*>(pArgs->GetAt(DATA_ITEM_CONTENT_NAME)));
298 __currentContentType = static_cast<Integer*>(pArgs->GetAt(DATA_ITEM_CONTENT_TYPE))->ToInt();
300 pArgs->RemoveAll(true);
303 else if (pArgs != null && previousSceneId.Equals(IDSCN_PLAYLIST_CREATOR, true) == true)
305 SetItemCheckedAll(false);
306 pArgs->RemoveAll(true);
310 __pPresentationModel = PlaylistListPresentationModel::GetInstance();
311 __pPresentationModel->UpdatePlaylistContentList(__currentContentType, __headerTitle);
313 if (__currentContentType < RECENTLY_ADDED_CONTENT || !previousSceneId.Equals(IDSCN_PLAYER,true))
322 PlaylistContentListForm::OnSceneDeactivated(const Tizen::Ui::Scenes::SceneId& currentSceneId,
323 const Tizen::Ui::Scenes::SceneId& nextSceneId)
325 AppLogDebug("ENTER");
326 CancelAllThumbnailRequest();
331 PlaylistContentListForm::GetItemCount(void)
333 AppLogDebug("ENTER");
334 if (__pPresentationModel == null)
340 return __pPresentationModel->GetContentCount();
343 Tizen::Ui::Controls::TableViewItem*
344 PlaylistContentListForm::CreateItem(const int itemIndex, int itemWidth)
346 AppLogDebug("ENTER");
347 RelativeLayout layout;
350 TableViewAnnexStyle tableViewAnnexStyle = TABLE_VIEW_ANNEX_STYLE_NORMAL;
351 if (GetScreenState() != SCREEN_STATE_NORMAL)
353 tableViewAnnexStyle = TABLE_VIEW_ANNEX_STYLE_MARK;
356 TableViewItem* pItem = new (std::nothrow) TableViewItem();
357 ContentInformation* pContentInfo = __pPresentationModel->GetContentInfoN(itemIndex);
359 result r = pItem->Construct(layout, Dimension(itemWidth, __itemHeight), tableViewAnnexStyle);
360 TryCatch(r == E_SUCCESS, delete pItem, "pItem->Construct(%s)", GetErrorMessage(r));
361 TryCatch(pContentInfo != null, delete pItem, "pContentInfo is null", GetErrorMessage(GetLastResult()));
363 r = CreateTableViewItem(*pItem, *pContentInfo);
364 TryCatch(r == E_SUCCESS, delete pItem, "CreateTableViewItem failed(%s)", GetErrorMessage(r));
366 RequestThumbnail(pContentInfo->contentId, (new (std::nothrow) Integer(itemIndex)));
373 AppLogDebug("EXIT(%ls)", GetErrorMessage(GetLastResult()));
379 PlaylistContentListForm::OnTableViewItemStateChanged(Tizen::Ui::Controls::TableView& tableView,
381 Tizen::Ui::Controls::TableViewItem* pItem,
382 Tizen::Ui::Controls::TableViewItemStatus status)
384 AppLogDebug("ENTER");
385 if (GetScreenState() != SCREEN_STATE_NORMAL)
387 SetItemCheckedStateChanged(status);
392 if (status == TABLE_VIEW_ITEM_STATUS_SELECTED)
394 SceneManager* pSceneManager = SceneManager::GetInstance();
395 AppAssert(pSceneManager);
397 ArrayList* pSceneArg = MakePlayerSceneParam(itemIndex);
398 if (pSceneArg != null)
400 pSceneManager->GoForward(ForwardSceneTransition(IDSCN_PLAYER), pSceneArg);
407 PlaylistContentListForm::OnTableViewContextItemActivationStateChanged(Tizen::Ui::Controls::TableView& tableView, int itemIndex,
408 Tizen::Ui::Controls::TableViewContextItem* pContextItem,
411 AppLogDebug("ENTER");
414 __activatedStateContextItem = itemIndex;
420 PlaylistContentListForm::GetDefaultItemHeight(void)
422 AppLogDebug("ENTER");
428 PlaylistContentListForm::DeleteItem(const int itemIndex, Tizen::Ui::Controls::TableViewItem* pItem)
430 AppLogDebug("ENTER");
436 PlaylistContentListForm::OnTableViewItemReordered(Tizen::Ui::Controls::TableView& tableView,
440 AppLogDebug("ENTER");
444 Tizen::Base::Collection::ArrayList*
445 PlaylistContentListForm::GetSearchResultContentList(int itemIndex)
447 AppLogDebug("ENTER");
448 ArrayList* pTempList = new (std::nothrow) ArrayList();
449 if (pTempList == null)
454 pTempList->Construct();
456 pTempList->Add(*(new (std::nothrow) String(MUSIC)));
457 pTempList->Add(*(new (std::nothrow) Integer(itemIndex)));
458 pTempList->Add(*(__pPresentationModel->GetContentPathListN(__currentContentType)));
463 Tizen::Base::Collection::ArrayList*
464 PlaylistContentListForm::GetAudioContentInfoContentList(int itemIndex)
466 AppLogDebug("ENTER");
467 ArrayList* pTempList = new (std::nothrow) ArrayList();
468 if (pTempList == null)
473 pTempList->Construct();
475 pTempList->Add(*(new (std::nothrow) String(MUSIC)));
476 pTempList->Add(*(new (std::nothrow) Integer(itemIndex)));
477 pTempList->Add(*(__pPresentationModel->GetContentPathListN(__currentContentType)));
483 PlaylistContentListForm::IsEmptyContentList(void)
485 AppLogDebug("ENTER");
486 if (__pPresentationModel->GetContentCount() != INIT_VALUE)
495 PlaylistContentListForm::GetCheckedItemCount(void)
497 AppLogDebug("ENTER");
499 return __checkedItemCount;
502 Tizen::Base::Collection::ArrayList*
503 PlaylistContentListForm::MakePlayerSceneParam(int startIndex)
505 AppLogDebug("ENTER");
506 if (__currentContentType != RECENTLY_ADDED_CONTENT)
509 return GetAudioContentInfoContentList(startIndex);
511 else if (__currentContentType == RECENTLY_ADDED_CONTENT)
514 return GetSearchResultContentList(startIndex);
521 PlaylistContentListForm::SetHeader(void)
523 AppLogDebug("ENTER");
524 CommonUtil::SetSimpleTitleStyle(*GetHeader(), __headerTitle);
530 PlaylistContentListForm::CreateTableViewItem(Tizen::Ui::Controls::TableViewItem& parent, const ContentInformation& contentInfo)
532 AppLogDebug("ENTER");
533 Panel* pTableViewItem = new (std::nothrow) Panel();
535 if (GetScreenState() != SCREEN_STATE_NORMAL)
537 if (__fontSizeValue.Equals(STRING_FONT_SIZE_GIANT, false))
539 if (IsFailed(pTableViewItem->Construct(IDL_CONTENTS_LIBARY_EDITOR_ITEM_PANEL_FONT_SIZE_GIANT)))
541 AppLogDebug("Construct(IDL_CONTENTS_LIBARY_ITEM_PANEL) failed(%s)", GetErrorMessage(GetLastResult()));
545 else if (__fontSizeValue.Equals(STRING_FONT_SIZE_HUGE, false))
547 if (IsFailed(pTableViewItem->Construct(IDL_CONTENTS_LIBARY_EDITOR_ITEM_PANEL_FONT_SIZE_HUGE)))
549 AppLogDebug("Construct(IDL_CONTENTS_LIBARY_ITEM_PANEL) failed(%s)", GetErrorMessage(GetLastResult()));
553 else if (__fontSizeValue.Equals(STRING_FONT_SIZE_LARGE, false))
555 if (IsFailed(pTableViewItem->Construct(IDL_CONTENTS_LIBARY_EDITOR_ITEM_PANEL_FONT_SIZE_LARGE)))
557 AppLogDebug("Construct(IDL_CONTENTS_LIBARY_ITEM_PANEL) failed(%s)", GetErrorMessage(GetLastResult()));
561 else if (__fontSizeValue.Equals(STRING_FONT_SIZE_SMALL, false))
563 if (IsFailed(pTableViewItem->Construct(IDL_CONTENTS_LIBARY_EDITOR_ITEM_PANEL_FONT_SIZE_SMALL)))
565 AppLogDebug("Construct(IDL_CONTENTS_LIBARY_ITEM_PANEL) failed(%s)", GetErrorMessage(GetLastResult()));
571 if (IsFailed(pTableViewItem->Construct(IDL_CONTENTS_LIBARY_EDITOR_ITEM_PANEL_DEFAULT)))
573 AppLogDebug("Construct(IDL_CONTENTS_LIBARY_ITEM_PANEL) failed(%s)", GetErrorMessage(GetLastResult()));
580 if (__fontSizeValue.Equals(STRING_FONT_SIZE_GIANT, false))
582 if (IsFailed(pTableViewItem->Construct(IDL_CONTENTS_LIBARY_ITEM_PANEL_FONT_SIZE_GIANT)))
584 AppLogDebug("Construct(IDL_CONTENTS_LIBARY_ITEM_PANEL) failed(%s)", GetErrorMessage(GetLastResult()));
588 else if (__fontSizeValue.Equals(STRING_FONT_SIZE_HUGE, false))
590 if (IsFailed(pTableViewItem->Construct(IDL_CONTENTS_LIBARY_ITEM_PANEL_FONT_SIZE_HUGE)))
592 AppLogDebug("Construct(IDL_CONTENTS_LIBARY_ITEM_PANEL) failed(%s)", GetErrorMessage(GetLastResult()));
596 else if (__fontSizeValue.Equals(STRING_FONT_SIZE_LARGE, false))
598 if (IsFailed(pTableViewItem->Construct(IDL_CONTENTS_LIBARY_ITEM_PANEL_FONT_SIZE_LARGE)))
600 AppLogDebug("Construct(IDL_CONTENTS_LIBARY_ITEM_PANEL) failed(%s)", GetErrorMessage(GetLastResult()));
604 else if (__fontSizeValue.Equals(STRING_FONT_SIZE_SMALL, false))
606 if (IsFailed(pTableViewItem->Construct(IDL_CONTENTS_LIBARY_ITEM_PANEL_FONT_SIZE_SMALL)))
608 AppLogDebug("Construct(IDL_CONTENTS_LIBARY_ITEM_PANEL) failed(%s)", GetErrorMessage(GetLastResult()));
614 if (IsFailed(pTableViewItem->Construct(IDL_CONTENTS_LIBARY_ITEM_PANEL_DEFAULT)))
616 AppLogDebug("Construct(IDL_CONTENTS_LIBARY_ITEM_PANEL) failed(%s)", GetErrorMessage(GetLastResult()));
622 static_cast<Label*>(pTableViewItem->GetControl(IDC_CONTENTS_TITLE_NAME))->SetText(contentInfo.TitleName);
623 static_cast<Label*>(pTableViewItem->GetControl(IDC_CONTENTS_ARTIST_NAME))->SetText(contentInfo.ArtistName);
624 // static_cast<Label*>(pTableViewItem->GetControl(IDC_CONTENTS_THUMBNAIL))->SetBackgroundBitmap(*GetDefaultThumbnail());
626 parent.AddControl(pTableViewItem);
627 CommonUtil::SetLayoutFitToContainer(parent, *pTableViewItem);
634 PlaylistContentListForm::OnAppControlCompleteResponseReceived(const AppId& appId,
635 const String& operationId, AppCtrlResult appControlResult,
636 const IMap* pExtraData)
638 AppLogDebug("ENTER");
639 if (pExtraData == null)
644 AppLogDebug("%ls, %ls", appId.GetPointer(), operationId.GetPointer());
645 if (appId.Equals(String(PROVIDER_ID_CONTACT)))
647 if (appControlResult == APP_CTRL_RESULT_SUCCEEDED)
649 const String* pResultString = static_cast<const String*>(pExtraData->GetValue(String(APPCONTROL_KEY_SOCIAL_ITEM_ID)));
651 AppLogDebug("%ls", pResultString->GetPointer());
653 Integer::Parse(*pResultString, contactId);
655 AddressbookManager* pAddressbookManager = AddressbookManager::GetInstance();
656 Addressbook* pAddressbook = pAddressbookManager->GetAddressbookN(DEFAULT_ADDRESSBOOK_ID);
658 ContentInformation* pCcontentInfo = __pPresentationModel->GetContentInfoN(__activatedStateContextItem);
659 if (pCcontentInfo == null)
666 Contact* pContact = pAddressbook->GetContactN(contactId);
667 pContact->SetValue(CONTACT_PROPERTY_ID_RINGTONE, pCcontentInfo->ContentFilePath);
668 result r = pAddressbook->UpdateContact(*pContact);
672 ShowDelayedMessageBox(ResourceManager::GetString(L"IDS_COM_POP_SUCCESS"));
675 delete pCcontentInfo;
676 pCcontentInfo = null;
689 PlaylistContentListForm::OnFormMenuRequested(Tizen::Ui::Controls::Form& source)
691 if (GetScreenState() == SCREEN_STATE_NORMAL && IsEmptyContentList() == false)
693 CreateOptionMenuN(source);
694 SetOptionMenuItem(CONTEXT_MENU_ITEM_STYLE_SHARE_VIA | CONTEXT_MENU_ITEM_STYLE_EDIT);
699 PlaylistContentListForm::OnThumbnailInfoReveivedN(ThumbnailInfo* pThumbnailInfo)
701 AppLogDebug("ENTER");
702 Object* pParam = null;
703 __pThumbnail = pThumbnailInfo->GetBitmapN();
704 pParam = pThumbnailInfo->GetUserParamN();
707 __pContentListTableView->RefreshItem((static_cast<Integer*>(pParam))->ToInt(), TABLE_VIEW_REFRESH_TYPE_ITEM_MODIFY);
711 delete pThumbnailInfo;
716 PlaylistContentListForm::UpdateItem(int itemIndex, Tizen::Ui::Controls::TableViewItem* pItem)
718 AppLogDebug("ENTER");
722 AppLogDebug("pItem is null");
728 Label* pThumbnailLabel = static_cast<Label*>(pItem->GetControl(IDC_CONTENTS_THUMBNAIL, true));
729 if (__pThumbnail == null || pThumbnailLabel == null)
731 AppLogDebug("__pThumbnail or pThumbnailLabel is null");
737 pThumbnailLabel->SetBackgroundBitmap(*__pThumbnail);
740 pThumbnailLabel->Invalidate(true);
745 PlaylistContentListForm::UpdateTableView(void)
747 AppLogDebug("ENTER");
748 __pContentListTableView->UpdateTableView();
753 PlaylistContentListForm::UpdateContentList(void)
755 AppLogDebug("ENTER");
756 __pPresentationModel->UpdatePlaylistContentList(__currentContentType, __headerTitle);
758 if (__pPresentationModel->GetContentCount() == 0)
760 ToggleScreenState(SCREEN_STATE_NORMAL);
761 SceneManager* pSceneManager = SceneManager::GetInstance();
762 if (pSceneManager->GetCurrentSceneId().Equals(IDSCN_PLAYLIST_CONTENT_LIST,true))
764 AppAssert(pSceneManager);
765 pSceneManager->GoBackward(BackwardSceneTransition(SCENE_TRANSITION_ANIMATION_TYPE_NONE,SCENE_DESTROY_OPTION_KEEP));
776 PlaylistContentListForm::SetItemCheckedAll(bool isChecked)
778 AppLogDebug("ENTER");
779 if (isChecked == true)
781 __checkedItemCount = __pContentListTableView->GetItemCount();
785 __checkedItemCount = INIT_VALUE;
787 CommonUtil::SetItemCheckedAll(isChecked, *__pContentListTableView);
789 if (GetFooter() != null)
791 CommonUtil::SetFooterItemEnabled(*GetFooter(), isChecked);
794 SetCheckedCountBallonTooltip(GetCheckedItemCount());
799 PlaylistContentListForm::RemoveCheckedTableviewItem(bool itemRemove)
801 AppLogDebug("ENTER");
804 int totalCount = __pContentListTableView->GetItemCount();
805 for (int iCount = 0; iCount < totalCount; iCount++)
807 if (__pContentListTableView->IsItemChecked(iCount) == true)
809 __pContentListTableView->SetItemChecked(iCount, false);
810 __checkedItemCount--;
811 ContentInformation* pContentInfo = __pPresentationModel->GetContentInfoN(iCount);
812 if (pContentInfo != null)
814 RemoveContentAt(pContentInfo->contentId);
822 SetItemCheckedAll(false);
828 PlaylistContentListForm::SetItemCheckedStateChanged(Tizen::Ui::Controls::TableViewItemStatus status)
830 AppLogDebug("ENTER");
831 if (status == TABLE_VIEW_ITEM_STATUS_UNCHECKED)
833 __checkedItemCount--;
834 if (__checkedItemCount == INIT_VALUE)
836 if (GetFooter() != null)
838 CommonUtil::SetFooterItemEnabled(*GetFooter(), false);
842 else if (status == TABLE_VIEW_ITEM_STATUS_CHECKED)
844 if (__checkedItemCount == INIT_VALUE)
846 if (GetFooter() != null)
848 CommonUtil::SetFooterItemEnabled(*GetFooter(), true);
852 __checkedItemCount++;
855 SetCheckedCountBallonTooltip(GetCheckedItemCount());
859 Tizen::Base::Collection::IList*
860 PlaylistContentListForm::GetPickerArgumentListN(PickerType pickerType, PickerArgumentType argumentType)
862 AppLogDebug("ENTER");
863 Tizen::Base::Collection::ArrayList* pContentFilePathList = new (std::nothrow) ArrayList(SingleObjectDeleter);
864 if (IsFailed(pContentFilePathList->Construct()))
866 AppLogDebug("pContentList->Construct failed(%s)", GetErrorMessage(GetLastResult()));
867 delete pContentFilePathList;
871 if (argumentType == PICKER_ARGUMENT_TYPE_ACTIVATED_STATE_CONTEXT_ITEM)
873 ContentInformation* pContentInfo = __pPresentationModel->GetContentInfoN(__activatedStateContextItem);
874 if (pContentInfo == null)
876 delete pContentFilePathList;
877 AppLogDebug("GetContentInfoN(%d) is null", __activatedStateContextItem);
881 pContentFilePathList->Add(*(new (std::nothrow) String(pContentInfo->ContentFilePath)));
884 else if (argumentType == PICKER_ARGUMENT_TYPE_CHECKED_ITEM_ALL)
886 int totalCount = __pContentListTableView->GetItemCount();
887 for (int iCount = 0; iCount < totalCount; iCount++)
889 if (__pContentListTableView->IsItemChecked(iCount) == true)
891 ContentInformation* pContentInfo = __pPresentationModel->GetContentInfoN(iCount);
892 if (pContentInfo == null)
894 AppLogDebug("GetContentInfoN(%d) is null", iCount);
895 delete pContentFilePathList;
899 if (pickerType == PICKER_TYPE_PLAY_LIST_PICKER)
901 pContentFilePathList->Add(*(new (std::nothrow) String(pContentInfo->ContentFilePath)));
903 else if (pickerType == PICKER_TYPE_SHARE_PICKER)
905 pContentFilePathList->Add(*(new (std::nothrow) String(pContentInfo->ContentFilePath)));
912 return pContentFilePathList;
916 PlaylistContentListForm::OnFontSizeChanged(void)
918 __fontSizeValue = CommonUtil::GetFontSizeValue();
919 __itemHeight = CommonUtil::GetItemHeight(__fontSizeValue);
920 __pContentListTableView->UpdateTableView();