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 MpAlbumContentListForm.cpp
19 * @brief This is the implementation file for AlbumContentListForm class.
23 #include "MpAlbumContentListForm.h"
24 #include "MpAlbumListPresentationModel.h"
25 #include "MpPlaylistPickerPopup.h"
26 #include "MpSharePopup.h"
27 #include "MpThumbnailInfo.h"
29 using namespace Tizen::App;
30 using namespace Tizen::Base;
31 using namespace Tizen::Base::Collection;
32 using namespace Tizen::Content;
33 using namespace Tizen::Graphics;
34 using namespace Tizen::Io;
35 using namespace Tizen::Social;
36 using namespace Tizen::Ui;
37 using namespace Tizen::Ui::Controls;
38 using namespace Tizen::Ui::Scenes;
40 AlbumContentListForm::AlbumContentListForm(void)
41 : ContentListForm::ContentListForm()
42 , ThumbnailBase::ThumbnailBase()
43 , __pContentListTableView(null)
45 , __pPresentationModel(null)
46 , __checkedItemCount(0)
47 , __currentAlbumIndex(-1)
48 , __activatedStateContextItem(-1)
54 AlbumContentListForm::~AlbumContentListForm(void)
61 AlbumContentListForm::Initialize(void)
64 if (IsFailed(Form::Construct(IDL_CONTENT_LIST_FORM)))
66 AppLogDebug("Construct(IDL_CONTENT_LIST_FORM) failed(%s)", GetErrorMessage(GetLastResult()));
75 AlbumContentListForm::Construct(void)
78 __pContentListTableView = static_cast<TableView*>(GetControl(IDC_TABLEVIEW_CONTENT_LIST));
79 __pContentListTableView->AddTableViewItemEventListener(*this);
80 __pContentListTableView->SetItemProvider(this);
82 SetContentList(__pContentListTableView);
84 return ContentListForm::Construct();
88 AlbumContentListForm::OnInitializing(void)
91 __fontSizeValue = CommonUtil::GetFontSizeValue();
92 __itemHeight = CommonUtil::GetItemHeight(__fontSizeValue);
95 return ThumbnailBase::Construct();
99 AlbumContentListForm::OnTerminating(void)
101 AppLogDebug("ENTER");
102 ThumbnailBase::Stop();
104 return ContentListForm::OnTerminating();
108 AlbumContentListForm::OnActionPerformed(const Tizen::Ui::Control& source, int actionId)
110 AppLogDebug("ENTER");
111 SceneManager* pSceneManager = SceneManager::GetInstance();
112 AppAssert(pSceneManager);
116 case IDA_HEADER_BUTTON_SELECTE_ALL:
118 bool isChecked = true;
119 if (__checkedItemCount == __pContentListTableView->GetItemCount())
123 SetItemCheckedAll(isChecked);
127 case IDA_FOOTER_BUTTON_SHARE:
129 LanucherPicker(PICKER_TYPE_SHARE_PICKER);
133 case IDA_FOOTER_BUTTON_ADD_TO_PLAYLIST:
135 LanucherPicker(PICKER_TYPE_PLAY_LIST_PICKER);
139 case IDA_FOOTER_BUTTON_MORE:
141 Point anchorPoint(X_POINT_FOOTER_MORE, Y_POINT_PORTRAIT_FOOTER_MORE);
142 if ((GetOrientationStatus() == ORIENTATION_STATUS_LANDSCAPE) || (GetOrientationStatus() == ORIENTATION_STATUS_LANDSCAPE_REVERSE))
144 anchorPoint.y = Y_POINT_LANDSCAPE_FOOTER_MORE;
147 CreateOptionMenuN(source);
148 SetOptionMenuItem(CONTEXT_MENU_ITEM_STYLE_SHARE_VIA | CONTEXT_MENU_ITEM_STYLE_EDIT);
152 case IDA_CONTEXT_MENU_ITEM_SHARE_VIA:
154 ToggleScreenState(SCREEN_STATE_SHARE_VIA);
158 case IDA_CONTEXT_MENU_ITEM_EDIT:
160 ToggleScreenState(SCREEN_STATE_EDITOR);
164 case IDA_CONTEXT_MENU_ITEM_SEARCH:
166 pSceneManager->GoForward(ForwardSceneTransition(IDSCN_SEARCH, SCENE_TRANSITION_ANIMATION_TYPE_NONE, SCENE_HISTORY_OPTION_NO_HISTORY));
170 case IDA_FOOTER_BUTTON_DELETE:
172 RemoveCheckedTableviewItem(true);
180 TryRemoveContextMenu(actionId);
185 AlbumContentListForm::OnFormMenuRequested(Tizen::Ui::Controls::Form& source)
187 if (GetScreenState() == SCREEN_STATE_NORMAL && IsEmptyContentList() == false)
189 CreateOptionMenuN(source);
190 SetOptionMenuItem(CONTEXT_MENU_ITEM_STYLE_SHARE_VIA | CONTEXT_MENU_ITEM_STYLE_EDIT);
194 AlbumContentListForm::OnSceneActivatedN(const Tizen::Ui::Scenes::SceneId& previousSceneId,
195 const Tizen::Ui::Scenes::SceneId& currentSceneId,
196 Tizen::Base::Collection::IList* pArgs)
198 AppLogDebug("ENTER");
201 __prevSceneId.Clear();
202 __prevSceneId.Append(*static_cast<String*>(pArgs->GetAt(DATA_ITEM_SCENE_NAME)));
203 __pPresentationModel = AlbumListPresentationModel::GetInstance();
205 if (__prevSceneId.Equals(IDSCN_SEARCH, false))
207 __pPresentationModel->UpdateAlbumList();
208 __ablumName = *(static_cast<String*>(pArgs->GetAt(DATA_ITEM_CONTENT_NAME)));
209 __currentAlbumIndex = __pPresentationModel->searchAlbumIndex(__ablumName);
211 else if (previousSceneId.Equals(IDSCN_PLAYLIST_CREATOR, false))
213 SetItemCheckedAll(false);
217 __currentAlbumIndex = static_cast<Integer*>(pArgs->GetAt(DATA_ITEM_CONTENT_TYPE))->ToInt();
220 __pPresentationModel->InitializeContentList(__currentAlbumIndex);
221 String* pAlbumName = __pPresentationModel->GetAlbumName(__currentAlbumIndex);
222 if (pAlbumName != null)
224 __ablumName = *pAlbumName;
225 __headerTitle.Format(255, pAlbumName->GetPointer());
228 ContentInformation* pContentInfo = __pPresentationModel->GetAlbumInfoN(__currentAlbumIndex);
229 if (pContentInfo != null)
231 Panel* pContentInfoPanel = new (std::nothrow) Panel();
232 pContentInfoPanel->Construct(IDL_CONTENT_LIST_ALBUM_INFO_PANEL);
234 static_cast<Label*>(pContentInfoPanel->GetControl(IDC_CONTENTS_THUMBNAIL))->SetBackgroundBitmap(*GetDefaultThumbnail());
235 static_cast<Label*>(pContentInfoPanel->GetControl(IDC_CONTENTS_TITLE_NAME))->SetText(pContentInfo->AlbumName);
236 static_cast<Label*>(pContentInfoPanel->GetControl(IDC_CONTENTS_ARTIST_NAME))->SetText(pContentInfo->ArtistName);
237 static_cast<Label*>(pContentInfoPanel->GetControl(IDC_PLAY_CONTENT_COUNT))->SetText(CommonUtil::SetSongsString(__pPresentationModel->GetContentCount(__currentAlbumIndex)));
239 Bitmap* pBgBitmap = ResourceManager::GetBitmapN(L"T02_album_bg.png");
240 Label* pBgLabel = static_cast<Label*>(pContentInfoPanel->GetControl(IDC_LABEL_ALBUM_BACKGROUND));
241 pBgLabel->SetBackgroundBitmap(*pBgBitmap);
242 pContentInfoPanel->SetControlAlwaysAtBottom(*pBgLabel, true);
245 SetExtraInformaionArea(*pContentInfoPanel);
246 RequestThumbnail(pContentInfo->contentId);
250 pArgs->RemoveAll(true);
261 AlbumContentListForm::OnSceneDeactivated(const Tizen::Ui::Scenes::SceneId& currentSceneId,
262 const Tizen::Ui::Scenes::SceneId& nextSceneId)
264 AppLogDebug("ENTER");
265 CancelAllThumbnailRequest();
270 AlbumContentListForm::GetItemCount(void)
272 AppLogDebug("ENTER");
273 int itemCount = INIT_VALUE;
274 String* pAlbum = __pPresentationModel->GetAlbumName(__currentAlbumIndex);
275 if (pAlbum != null && pAlbum->Equals(__ablumName, false))
277 itemCount = __pPresentationModel->GetContentCount(__currentAlbumIndex);
284 AlbumContentListForm::OnTableViewContextItemActivationStateChanged(Tizen::Ui::Controls::TableView& tableView, int itemIndex,
285 Tizen::Ui::Controls::TableViewContextItem* pContextItem,
288 AppLogDebug("ENTER");
291 AppLogDebug("INDEX %d", itemIndex);
292 __activatedStateContextItem = itemIndex;
298 AlbumContentListForm::GetDefaultItemHeight(void)
300 AppLogDebug("ENTER");
306 AlbumContentListForm::DeleteItem(const int itemIndex, Tizen::Ui::Controls::TableViewItem* pItem)
308 AppLogDebug("ENTER");
314 AlbumContentListForm::OnTableViewItemReordered(Tizen::Ui::Controls::TableView& tableView,
318 AppLogDebug("ENTER");
323 Tizen::Ui::Controls::TableViewItem*
324 AlbumContentListForm::CreateItem(const int itemIndex, int itemWidth)
326 AppLogDebug("ENTER");
327 RelativeLayout layout;
330 TableViewAnnexStyle tableViewAnnexStyle = TABLE_VIEW_ANNEX_STYLE_NORMAL;
331 if (GetScreenState() != SCREEN_STATE_NORMAL)
333 tableViewAnnexStyle = TABLE_VIEW_ANNEX_STYLE_MARK;
336 TableViewItem* pItem = new (std::nothrow) TableViewItem();
337 ContentInformation* pContentInfo = __pPresentationModel->GetContentInfoN(itemIndex);
339 result r = pItem->Construct(layout, Dimension(itemWidth, __itemHeight), tableViewAnnexStyle);
340 TryCatch(r == E_SUCCESS, delete pItem, "pItem->Construct(%s)", GetErrorMessage(r));
341 TryCatch(pContentInfo != null, delete pItem, "pContentInfo is null", GetErrorMessage(GetLastResult()));
343 r = CreateTableViewItem(*pItem, *pContentInfo);
344 TryCatch(r == E_SUCCESS, delete pItem, "CreateTableViewItem failed(%s)", GetErrorMessage(r));
351 AppLogDebug("EXIT(%ls)", GetErrorMessage(GetLastResult()));
357 AlbumContentListForm::UpdateItem(int itemIndex, Tizen::Ui::Controls::TableViewItem* pItem)
359 AppLogDebug("ENTER");
364 AlbumContentListForm::OnTableViewItemStateChanged(Tizen::Ui::Controls::TableView& tableView,
366 Tizen::Ui::Controls::TableViewItem* pItem,
367 Tizen::Ui::Controls::TableViewItemStatus status)
369 AppLogDebug("ENTER");
370 if (GetScreenState() != SCREEN_STATE_NORMAL)
372 SetItemCheckedStateChanged(status);
377 if (status == TABLE_VIEW_ITEM_STATUS_SELECTED)
379 SceneManager* pSceneManager = SceneManager::GetInstance();
380 AppAssert(pSceneManager);
382 ArrayList* pSceneArg = MakePlayerSceneParam(itemIndex);
383 if (pSceneArg != null)
385 pSceneManager->GoForward(ForwardSceneTransition(IDSCN_PLAYER), pSceneArg);
391 Tizen::Base::Collection::ArrayList*
392 AlbumContentListForm::MakePlayerSceneParam(int startIndex)
394 AppLogDebug("ENTER");
395 ArrayList* pTempList = new (std::nothrow) ArrayList();
396 if (pTempList == null)
402 ArrayList* pSelectedMusicContent = null;
404 pSelectedMusicContent = __pPresentationModel->GetContentPathListN(__currentAlbumIndex);
405 if (pSelectedMusicContent == null)
411 pTempList->Construct();
413 pTempList->Add(*(new (std::nothrow) String(MUSIC)));
414 pTempList->Add(*(new (std::nothrow) Integer(startIndex)));
415 pTempList->Add(*(pSelectedMusicContent));
422 AlbumContentListForm::IsEmptyContentList(void)
424 AppLogDebug("ENTER");
425 String* pAlbum = __pPresentationModel->GetAlbumName(__currentAlbumIndex);
426 if (pAlbum != null && pAlbum->Equals(__ablumName, false))
428 if (__pPresentationModel->GetContentCount(__currentAlbumIndex) != INIT_VALUE)
438 AlbumContentListForm::SetHeader(void)
440 AppLogDebug("ENTER");
441 CommonUtil::SetSimpleTitleStyle(*GetHeader(), __headerTitle);
447 AlbumContentListForm::CreateTableViewItem(Tizen::Ui::Controls::TableViewItem& parent, const ContentInformation& contentInfo)
449 AppLogDebug("ENTER");
450 Panel* pTableViewItem = new (std::nothrow) Panel();
452 if (GetScreenState() != SCREEN_STATE_NORMAL)
454 if (__fontSizeValue.Equals(STRING_FONT_SIZE_GIANT, false))
456 if (IsFailed(pTableViewItem->Construct(IDL_ALBUM_CONTENT_EDIT_ITEM_PANEL_FONT_SIZE_GIANT)))
458 AppLogDebug("Construct(IDL_CONTENTS_LIBARY_ITEM_PANEL) failed(%s)", GetErrorMessage(GetLastResult()));
462 else if (__fontSizeValue.Equals(STRING_FONT_SIZE_HUGE, false))
464 if (IsFailed(pTableViewItem->Construct(IDL_ALBUM_CONTENT_EDIT_ITEM_PANEL_FONT_SIZE_HUGE)))
466 AppLogDebug("Construct(IDL_CONTENTS_LIBARY_ITEM_PANEL) failed(%s)", GetErrorMessage(GetLastResult()));
470 else if (__fontSizeValue.Equals(STRING_FONT_SIZE_LARGE, false))
472 if (IsFailed(pTableViewItem->Construct(IDL_ALBUM_CONTENT_EDIT_ITEM_PANEL_FONT_SIZE_LARGE)))
474 AppLogDebug("Construct(IDL_CONTENTS_LIBARY_ITEM_PANEL) failed(%s)", GetErrorMessage(GetLastResult()));
478 else if (__fontSizeValue.Equals(STRING_FONT_SIZE_SMALL, false))
480 if (IsFailed(pTableViewItem->Construct(IDL_ALBUM_CONTENT_EDIT_ITEM_PANEL_FONT_SIZE_SMALL)))
482 AppLogDebug("Construct(IDL_CONTENTS_LIBARY_ITEM_PANEL) failed(%s)", GetErrorMessage(GetLastResult()));
488 if (IsFailed(pTableViewItem->Construct(IDL_ALBUM_CONTENT_EDIT_ITEM_PANEL_DEFAULT)))
490 AppLogDebug("Construct(IDL_CONTENTS_LIBARY_ITEM_PANEL) failed(%s)", GetErrorMessage(GetLastResult()));
497 if (__fontSizeValue.Equals(STRING_FONT_SIZE_GIANT, false))
499 if (IsFailed(pTableViewItem->Construct(IDL_ALBUM_CONTENT_ITEM_PANEL_FONT_SIZE_GIANT)))
501 AppLogDebug("Construct(IDL_CONTENTS_LIBARY_ITEM_PANEL) failed(%s)", GetErrorMessage(GetLastResult()));
505 else if (__fontSizeValue.Equals(STRING_FONT_SIZE_HUGE, false))
507 if (IsFailed(pTableViewItem->Construct(IDL_ALBUM_CONTENT_ITEM_PANEL_FONT_SIZE_HUGE)))
509 AppLogDebug("Construct(IDL_CONTENTS_LIBARY_ITEM_PANEL) failed(%s)", GetErrorMessage(GetLastResult()));
513 else if (__fontSizeValue.Equals(STRING_FONT_SIZE_LARGE, false))
515 if (IsFailed(pTableViewItem->Construct(IDL_ALBUM_CONTENT_ITEM_PANEL_FONT_SIZE_LARGE)))
517 AppLogDebug("Construct(IDL_CONTENTS_LIBARY_ITEM_PANEL) failed(%s)", GetErrorMessage(GetLastResult()));
521 else if (__fontSizeValue.Equals(STRING_FONT_SIZE_SMALL, false))
523 if (IsFailed(pTableViewItem->Construct(IDL_ALBUM_CONTENT_ITEM_PANEL_FONT_SIZE_SMALL)))
525 AppLogDebug("Construct(IDL_CONTENTS_LIBARY_ITEM_PANEL) failed(%s)", GetErrorMessage(GetLastResult()));
531 if (IsFailed(pTableViewItem->Construct(IDL_ALBUM_CONTENT_ITEM_PANEL_DEFAULT)))
533 AppLogDebug("Construct(IDL_CONTENTS_LIBARY_ITEM_PANEL) failed(%s)", GetErrorMessage(GetLastResult()));
539 static_cast<Label*>(pTableViewItem->GetControl(IDC_CONTENTS_TITLE_NAME))->SetText(contentInfo.TitleName);
540 static_cast<Label*>(pTableViewItem->GetControl(IDC_CONTENT_TOTAL_COUNT))->SetText(CommonUtil::GetFormatDate(contentInfo.Duration));
542 parent.AddControl(pTableViewItem);
543 parent.SetIndividualSelectionEnabled(pTableViewItem, true);
545 CommonUtil::SetLayoutFitToContainer(parent, *pTableViewItem);
552 AlbumContentListForm::OnAppControlCompleteResponseReceived(const AppId& appId,
553 const String& operationId, AppCtrlResult appControlResult,
554 const IMap* pExtraData)
556 AppLogDebug("ENTER");
557 if (pExtraData == null)
563 AppLogDebug("%ls, %ls", appId.GetPointer(), operationId.GetPointer());
564 if (appId.Equals(String(PROVIDER_ID_CONTACT)))
566 if (appControlResult == APP_CTRL_RESULT_SUCCEEDED)
568 const String* pResultString = static_cast<const String*>(pExtraData->GetValue(String(APPCONTROL_KEY_SOCIAL_ITEM_ID)));
570 AppLogDebug("%ls", pResultString->GetPointer());
572 Integer::Parse(*pResultString, contactId);
574 AddressbookManager* pAddressbookManager = AddressbookManager::GetInstance();
575 Addressbook* pAddressbook = pAddressbookManager->GetAddressbookN(DEFAULT_ADDRESSBOOK_ID);
577 ContentInformation* pCcontentInfo = __pPresentationModel->GetContentInfoN(__activatedStateContextItem);
578 if (pCcontentInfo == null)
585 Contact* pContact = pAddressbook->GetContactN(contactId);
586 pContact->SetValue(CONTACT_PROPERTY_ID_RINGTONE, pCcontentInfo->ContentFilePath);
587 result r = pAddressbook->UpdateContact(*pContact);
591 ShowDelayedMessageBox(ResourceManager::GetString(L"IDS_COM_POP_SUCCESS"));
594 delete pCcontentInfo;
595 pCcontentInfo = null;
608 AlbumContentListForm::OnThumbnailInfoReveivedN(ThumbnailInfo* pThumbnailInfo)
610 AppLogDebug("ENTER");
611 Panel* pItemPanel = static_cast<Panel*>(GetExtraInformaionAreaControl());
613 if (pItemPanel == null)
615 AppLogDebug("pItemPanel is null");
619 Label* pThumbnailLabel = static_cast<Label*>(pItemPanel->GetControl(IDC_CONTENTS_THUMBNAIL));
620 __pThumbnail = pThumbnailInfo->GetBitmapN();
621 delete pThumbnailInfo;
623 if (__pThumbnail == null || pThumbnailLabel == null)
625 if ( __pThumbnail != null)
627 AppLogDebug("pThumbnailLabel is null");
631 AppLogDebug("__pThumbnail or pThumbnailLabel is null");
638 pThumbnailLabel->SetBackgroundBitmap(*__pThumbnail);
642 pThumbnailLabel->Invalidate(true);
647 AlbumContentListForm::OnUserEventReceivedN(RequestId requestId, Tizen::Base::Collection::IList* pArgs)
649 AppLogDebug("ENTER");
650 ContentListForm::OnUserEventReceivedN(requestId, pArgs);
655 AlbumContentListForm::OnMusicContentUpdateCompleted(void)
657 AppLogDebug("ENTER");
658 ContentListForm::OnMusicContentUpdateCompleted();
659 UpdateExtraInformaionArea();
664 AlbumContentListForm::UpdateExtraInformaionArea(void)
666 AppLogDebug("ENTER");
668 Panel* pItemPanel = static_cast<Panel*>(GetExtraInformaionAreaControl());
670 if (pItemPanel == null)
672 AppLogDebug("pItemPanel is null");
676 albumCount.Format(255, L"%d songs", __pPresentationModel->GetContentCount(__currentAlbumIndex));
677 Label* pAlbumCount = static_cast<Label*>(pItemPanel->GetControl(IDC_PLAY_CONTENT_COUNT));
678 pAlbumCount->SetText(albumCount);
680 pAlbumCount->Invalidate(true);
685 AlbumContentListForm::RemoveCheckedTableviewItem(bool itemRemove)
687 AppLogDebug("ENTER");
690 int totalCount = __pContentListTableView->GetItemCount();
691 for (int iCount = 0; iCount < totalCount; iCount++)
693 if (__pContentListTableView->IsItemChecked(iCount) == true)
695 __pContentListTableView->SetItemChecked(iCount, false);
696 ContentInformation* pContentInfo = __pPresentationModel->GetContentInfoN(iCount);
697 RemoveContentAt(pContentInfo->contentId);
701 // __pPresentationModel->RefreshContentList(__currentAlbumIndex);
705 SetItemCheckedAll(false);
711 AlbumContentListForm::UpdateTableView(void)
713 AppLogDebug("ENTER");
714 __pContentListTableView->UpdateTableView();
719 AlbumContentListForm::UpdateContentList(void)
721 AppLogDebug("ENTER");
723 if (__pPresentationModel->GetContentCount(__currentAlbumIndex) > 0)
725 String* pAlbum = __pPresentationModel->GetAlbumName(__currentAlbumIndex);
726 if (pAlbum != null && pAlbum->Equals(__ablumName, false))
728 __pPresentationModel->InitializeContentList(__currentAlbumIndex);
730 if (__prevSceneId.Equals(IDSCN_SEARCH, false) && __pPresentationModel->GetContentCount(__currentAlbumIndex) == 0)
738 SceneManager* pSceneManager = SceneManager::GetInstance();
739 AppAssert(pSceneManager);
740 SetScreenState(SCREEN_STATE_NORMAL);
741 pSceneManager->GoBackward(BackwardSceneTransition(SCENE_TRANSITION_ANIMATION_TYPE_NONE,SCENE_DESTROY_OPTION_KEEP));
748 AlbumContentListForm::SetItemCheckedAll(bool isChecked)
750 AppLogDebug("ENTER");
751 if (isChecked == true)
753 __checkedItemCount = __pContentListTableView->GetItemCount();
757 __checkedItemCount = INIT_VALUE;
759 CommonUtil::SetItemCheckedAll(isChecked, *__pContentListTableView);
761 if (GetFooter() != null)
763 CommonUtil::SetFooterItemEnabled(*GetFooter(), isChecked);
766 SetCheckedCountBallonTooltip(GetCheckedItemCount());
771 AlbumContentListForm::SetItemCheckedStateChanged(Tizen::Ui::Controls::TableViewItemStatus status)
773 AppLogDebug("ENTER");
774 if (status == TABLE_VIEW_ITEM_STATUS_UNCHECKED)
776 __checkedItemCount--;
777 if (__checkedItemCount == INIT_VALUE)
779 if (GetFooter() != null)
781 CommonUtil::SetFooterItemEnabled(*GetFooter(), false);
785 else if (status == TABLE_VIEW_ITEM_STATUS_CHECKED)
787 if (__checkedItemCount == INIT_VALUE)
789 if (GetFooter() != null)
791 CommonUtil::SetFooterItemEnabled(*GetFooter(), true);
795 __checkedItemCount++;
798 SetCheckedCountBallonTooltip(GetCheckedItemCount());
803 AlbumContentListForm::GetCheckedItemCount(void)
805 AppLogDebug("ENTER");
807 return __checkedItemCount;
810 Tizen::Base::Collection::IList*
811 AlbumContentListForm::GetPickerArgumentListN(PickerType pickerType, PickerArgumentType argumentType)
813 AppLogDebug("ENTER");
814 Tizen::Base::Collection::ArrayList* pContentFilePathList = new (std::nothrow) ArrayList(SingleObjectDeleter);
815 if (IsFailed(pContentFilePathList->Construct()))
817 AppLogDebug("pContentList->Construct failed(%s)", GetErrorMessage(GetLastResult()));
818 delete pContentFilePathList;
822 if (argumentType == PICKER_ARGUMENT_TYPE_ACTIVATED_STATE_CONTEXT_ITEM)
824 ContentInformation* pContentInfo = __pPresentationModel->GetContentInfoN(__activatedStateContextItem);
825 if (pContentInfo == null)
827 delete pContentFilePathList;
828 AppLogDebug("GetContentInfoN(%d) is null", __activatedStateContextItem);
832 pContentFilePathList->Add(*(new (std::nothrow) String(pContentInfo->ContentFilePath)));
835 else if (argumentType == PICKER_ARGUMENT_TYPE_CHECKED_ITEM_ALL)
837 int totalCount = __pContentListTableView->GetItemCount();
838 for (int iCount = 0; iCount < totalCount; iCount++)
840 if (__pContentListTableView->IsItemChecked(iCount) == true)
842 ContentInformation* pContentInfo = __pPresentationModel->GetContentInfoN(iCount);
843 if (pContentInfo == null)
845 AppLogDebug("GetContentInfoN(%d) is null", iCount);
846 delete pContentFilePathList;
850 if (pickerType == PICKER_TYPE_PLAY_LIST_PICKER)
852 pContentFilePathList->Add(*(new (std::nothrow) String(pContentInfo->ContentFilePath)));
854 else if (pickerType == PICKER_TYPE_SHARE_PICKER)
856 pContentFilePathList->Add(*(new (std::nothrow) String(pContentInfo->ContentFilePath)));
863 return pContentFilePathList;
867 AlbumContentListForm::OnFontSizeChanged(void)
869 __fontSizeValue = CommonUtil::GetFontSizeValue();
870 __itemHeight = CommonUtil::GetItemHeight(__fontSizeValue);
872 __pContentListTableView->UpdateTableView();