static void SetAllCheckState(bool state, Tizen::Ui::Controls::TableView& tableView, int totalCount);
static result SetFastScrollIndex(Tizen::Ui::Controls::TableView& tableview);
- static void SetLayoutFitToForm(const Tizen::Ui::Controls::Form& form, Tizen::Ui::Control& childControl);
static void SetLayoutFitToContainer(const Tizen::Ui::Container& container, Tizen::Ui::Control& childControl);
static void SetFooterItemEnabled(Tizen::Ui::Controls::Footer& pFooter, bool enable);
static void SetNoContentImage(Tizen::Ui::Controls::Label& source, Tizen::Base::String& resourceName, Tizen::Base::String& text);
//-->fixed
-
-// static void SetButtonItemIcon(Tizen::Ui::Controls::ButtonItem& buttonItem, Tizen::Base::String normalIDB, Tizen::Base::String pressedIDB, Tizen::Base::String disableIDB);
-// static void SetButtonItemBackgroundBitmap(Tizen::Ui::Controls::ButtonItem& buttonItem, Tizen::Base::String normalIDB, Tizen::Base::String pressedIDB, Tizen::Base::String disableIDB);
-// static void SetHeaderItemBackgroundBitmap(Tizen::Ui::Controls::HeaderItem& headerItem, Tizen::Base::String normalIDB
-// , Tizen::Base::String pressedIDB, Tizen::Base::String disableIDB, Tizen::Base::String selectedIDB);
- //-->fixed
-
static Tizen::Ui::Controls::Popup* CreateContentDeletePopup(Tizen::Ui::IActionEventListener& listener, int deleteActionId, int cancelActionId);
static Tizen::Ui::Controls::Panel* CreateFlickMenuN(Tizen::Ui::IActionEventListener& listener, FlickMenuStyle menuStyle);
static Tizen::Ui::Controls::TableViewContextItem* CreateTableViewContextItemN(Tizen::Ui::IActionEventListener& listener, int itemWidth, FlickMenuStyle menuStyle);
- static void SetTextItemSelectedBalloonPopup(Tizen::Ui::Controls::Label& itemSelectedBalloonPopup, int itemCount); //removable
static Tizen::Base::String GetStringItemSelectd(int itemCount);
-// static result SetShowStateItemSelectedBalloonPopup(Tizen::Ui::Controls::Label& itemSelectedBalloonPopup, bool isShow);
-
static Tizen::Ui::Controls::Footer* CreateContentListFooter(const Tizen::Ui::Controls::Form& form);
static Tizen::Ui::Controls::Footer* CreatePlaylistEditFooter(const Tizen::Ui::Controls::Form& form);
static void SetButtonEnabled(const Tizen::Ui::Controls::Form& form, int checkedItemCount, int actionId);
static void SetButtonEnabled(const Tizen::Ui::Controls::Form& form, int checkedItemCount);
- static void ShowNoContentImage(int total, Tizen::Ui::Controls::TableView& contentTableView, Tizen::Ui::Controls::Label& contentImageLabel, Tizen::Ui::Controls::Label& contentTextLabel);
static Tizen::Graphics::Bitmap* GetColorizedBitmapN(const Tizen::Graphics::Bitmap& bitmap, const Tizen::Graphics::Color& color);
};
virtual int GetCheckedItemCount(void);
private:
- result CreateTableViewItem(Tizen::Ui::Container& parent, const ContentInformation& contentInfo);
+ result CreateTableViewItem(Tizen::Ui::Container& parent, const Tizen::Base::String& contentPath, int contentCount);
void UpdateContentList(void);
void SetEditHeaderStyle(void);
virtual void OnUserEventReceivedN(RequestId requestId, Tizen::Base::Collection::IList* pArgs);
private:
+ result CreateTableViewItem(Tizen::Ui::Container& parent, const Tizen::Base::String& contentPath, int contentCount);
+
void UpdateContentList(void);
virtual bool IsEmptyContentList(void);
void RemoveMoreContextMenuActionEventListner(Tizen::Ui::IActionEventListener& listener);\r
void RemoveBackActionEventListner(Tizen::Ui::IActionEventListener& listener, int actionId);\r
\r
- void MiniPlayerActivate(void);\r
+ result MiniPlayerActivate(void);\r
void MiniPlayerDeactivate(void);\r
\r
protected:\r
int GetPlayListItemCount(Tizen::Base::String& playlist);
int GetAllPlayListCount(void);
Tizen::Base::Collection::IList* GetAllPlayListNameN(void);
- Tizen::Base::String* GetPlayListNameN(int playlistIndex);
+ Tizen::Base::String GetPlayListName(int playlistIndex);
Tizen::Graphics::Bitmap* GetPlayListItemBitmap(Tizen::Base::String& playlist);
Tizen::Content::ContentId GetPlayListItemContentId(Tizen::Base::String& playlist);
result SetPlayListName(const Tizen::Base::String& oldPlayListName, const Tizen::Base::String& newPlayListName);
class PlaylistListEditorPanel
: public ContentEditPanel
, public ThumbnailBase
-// , public Tizen::Ui::IActionEventListener
-// , public Tizen::Ui::Scenes::ISceneEventListener
{
public:
PlaylistListEditorPanel(void);
virtual int GetCheckedItemCount(void);
private:
+ result CreateTableViewItem(Tizen::Ui::Controls::TableViewItem& parent, const Tizen::Base::String& title, int itemIndex);
+
void UpdateContentList(void);
void SetEditHeaderStyle(void);
void SetTabHeaderStyle(void);
const Tizen::Ui::Scenes::SceneId& nextSceneId)
{
AppLogDebug("ENTER");
- Form* pForm = dynamic_cast<Form*>(GetParent());
- AppAssert(pForm);
-
- Footer* pFooter = pForm->GetFooter();
- pFooter->RemoveAllButtons();
- pFooter->RemoveAllItems();
- pFooter->RemoveActionEventListener(*this);
+ ContentLibaryPanel::OnSceneDeactivated(currentSceneId, nextSceneId);
CancelAllThumbnailRequest();
AppLogDebug("EXIT");
}
if (__pAlbumList == null)
{
+ AppLogDebug("EXIT");
return INIT_VALUE;
}
}
else
{
- IList* pContentSearchResultList = CommonUtil::ContentSearchResultListN(
- *(static_cast<String*>(__pAlbumList->GetAt(albumIndex))), STRING_SORT_ALBUM, STRING_SORT_TITLE);
+ String* pContentFileName = static_cast<String*>(__pAlbumList->GetAt(albumIndex));
+ if (pContentFileName == null)
+ {
+ AppLogDebug("EXIT(pContentFileName is null");
+ return INIT_VALUE;
+ }
+
+ IList* pContentSearchResultList = CommonUtil::ContentSearchResultListN(*pContentFileName, STRING_SORT_ALBUM, STRING_SORT_TITLE);
if (pContentSearchResultList == null)
{
AppLogDebug("CommonUtil::ContentSearchResultListN() failed");
return null;
}
- IList* pContentSearchResultList = CommonUtil::ContentSearchResultListN(
- *(static_cast<String*>(__pAlbumList->GetAt(albumIndex))), STRING_SORT_ALBUM, STRING_SORT_TITLE);
+ String* pContentFileName = static_cast<String*>(__pAlbumList->GetAt(albumIndex));
+ if (pContentFileName == null)
+ {
+ AppLogDebug("EXIT(pContentFileName is null");
+ return null;
+ }
+
+ IList* pContentSearchResultList = CommonUtil::ContentSearchResultListN(*pContentFileName, STRING_SORT_ALBUM, STRING_SORT_TITLE);
if (pContentSearchResultList == null)
{
AppLogDebug("CommonUtil::ContentSearchResultListN() failed");
AlbumListPresentationModel::GetContentInfoN(int contentIndex)
{
AppLogDebug("ENTER");
+ if (__pContentList == null || contentIndex < INIT_VALUE)
+ {
+ AppLogDebug("EXIT(index(%d) MUST be greater than or equal to 0 OR __pContentList is null)", contentIndex);
+ return null;
+ }
+
ContentInformation* pContentInformation = null;
ContentSearchResult* pResult = static_cast<ContentSearchResult*>(__pContentList->GetAt(contentIndex));
if (pResult->GetContentType() == CONTENT_TYPE_AUDIO)
if (__pAlbumList == null)
{
+ AppLogDebug("EXIT");
return ;
}
- pRemoveAlbumList = CommonUtil::ContentSearchResultListN(
- *(static_cast<String*>(__pAlbumList->GetAt(albumIndex))), STRING_SORT_ALBUM, STRING_SORT_TITLE);
+
+ String* pContentFileName = static_cast<String*>(__pAlbumList->GetAt(albumIndex));
+ if (pContentFileName == null)
+ {
+ AppLogDebug("EXIT(pContentFileName is null");
+ return;
+ }
+
+ pRemoveAlbumList = CommonUtil::ContentSearchResultListN(*pContentFileName, STRING_SORT_ALBUM, STRING_SORT_TITLE);
totalCount = pRemoveAlbumList->GetCount();
for (int iCount = 0; iCount < totalCount; iCount++)
if (__pContentList != null)
{
__pContentList->RemoveAll(true);
+ delete __pContentList;
+ __pContentList = null;
}
__currentAlbumIndex = albumIndex;
- __pContentList = CommonUtil::ContentSearchResultListN(
- *(static_cast<String*>(__pAlbumList->GetAt(albumIndex))), STRING_SORT_ALBUM, STRING_SORT_TITLE);
+
+ String* pContentFileName = static_cast<String*>(__pAlbumList->GetAt(albumIndex));
+ if (pContentFileName == null)
+ {
+ AppLogDebug("EXIT(pContentFileName is null");
+ return;
+ }
+
+ __pContentList = CommonUtil::ContentSearchResultListN(*pContentFileName, STRING_SORT_ALBUM, STRING_SORT_TITLE);
AppLogDebug("EXIT");
}
AppLogDebug("ENTER");
if (__pAlbumList == null)
{
+ AppLogDebug("EXIT");
+ return null;
+ }
+
+ String* pContentFileName = static_cast<String*>(__pAlbumList->GetAt(albumIndex));
+ if (pContentFileName == null)
+ {
+ AppLogDebug("EXIT(pContentFileName is null");
return null;
}
- IList* pContentSearchResultList = CommonUtil::ContentSearchResultListN(
- *(static_cast<String*>(__pAlbumList->GetAt(albumIndex))), STRING_SORT_ALBUM, STRING_SORT_TITLE);
+ IList* pContentSearchResultList = CommonUtil::ContentSearchResultListN(*pContentFileName, STRING_SORT_ALBUM, STRING_SORT_TITLE);
if (pContentSearchResultList == null)
{
AppLogDebug("CommonUtil::ContentSearchResultListN() failed");
{
__pContentList->RemoveAll(true);
delete __pContentList;
+ __pContentList = null;
+ }
+
+ String* pContentFileName = static_cast<String*>(__pAlbumList->GetAt(albumIndex));
+ if (pContentFileName == null)
+ {
+ AppLogDebug("EXIT(pContentFileName is null");
+ return;
}
- __pContentList = CommonUtil::ContentSearchResultListN(
- *(static_cast<String*>(__pAlbumList->GetAt(albumIndex))), STRING_SORT_ALBUM, STRING_SORT_TITLE);
+ __pContentList = CommonUtil::ContentSearchResultListN(*pContentFileName, STRING_SORT_ALBUM, STRING_SORT_TITLE);
if (__pContentList != null && __pContentList->GetCount() == INIT_VALUE)
{
delete __pContentList;
AppLogDebug("EXIT");
return;
}
-
AppLogDebug("%ls, %ls", appId.GetPointer(), operationId.GetPointer());
+
if (appId.Equals(String(PROVIDER_ID_CONTACT))/* && operationId.Equals(String(OPERATION_ID_PICK))*/)
{
if (appControlResult == APP_CTRL_RESULT_SUCCEEDED)
{
- const String* pResultString = static_cast<const String*>(pExtraData->GetValue(String(APPCONTROL_KEY_SOCIAL_ITEM_ID)));
+ int contactId = -1;
+ String* pKey = null;
+ ArrayList* pArrayListValue = null;
+ String* pResultString = null;
+ if (pExtraData != null)
+ {
+ IMapEnumerator* pEnum = pExtraData->GetMapEnumeratorN();
+ while (pEnum->MoveNext() == E_SUCCESS)
+ {
+ pKey = static_cast<String*>(pEnum->GetKey());
+ if (pKey->Equals(APPCONTROL_KEY_SOCIAL_ITEM_ID, true))
+ {
+ pArrayListValue = static_cast<ArrayList*>(pEnum->GetValue());
+ pResultString = static_cast<String*>(pArrayListValue->GetAt(0));
+ AppLogDebug("extraData : %ls:%ls", pKey->GetPointer(), pResultString->GetPointer());
+ Integer::Parse(*pResultString, contactId);
+ break;
+ }
+ }
+ delete pEnum;
+
+ if (contactId < 0)
+ {
+ AppLogDebug("pKey is invaild");
+ return;
+ }
+ }
+ else
+ {
+ AppLogDebug("pExtraData is null");
+ return;
+ }
- AppLogDebug("%ls", pResultString->GetPointer());
+ AddressbookManager* pAddressbookManager = AddressbookManager::GetInstance();
+ Addressbook* pAddressbook = pAddressbookManager->GetAddressbookN(DEFAULT_ADDRESSBOOK_ID);
ContentInformation* pContentInfoStruct = __pPresentationModel->GetContentInfoN(__itemIndex);
if (pContentInfoStruct == null)
return;
}
- int contactId;
- Integer::Parse(*pResultString, contactId);
-
- AddressbookManager* pAddressbookManager = AddressbookManager::GetInstance();
- Addressbook* pAddressbook = pAddressbookManager->GetAddressbookN(DEFAULT_ADDRESSBOOK_ID);
-
Contact* pContact = pAddressbook->GetContactN(contactId);
pContact->Tizen::Social::Contact::SetValue(CONTACT_PROPERTY_ID_RINGTONE, pContentInfoStruct->ContentFilePath);
result r = pAddressbook->UpdateContact(*pContact);
int AllListPresentationModel::GetTotalCount(void)
{
AppLogDebug("ENTER");
-
if (__pContentList == null)
{
+ AppLogDebug("EXIT");
return INIT_VALUE;
}
AppLogDebug("EXIT");
-
return __pContentList->GetCount();
}
AllListPresentationModel::GetContentInfoN(int index)
{
AppLogDebug("ENTER");
+ if (__pContentList == null || index < INIT_VALUE)
+ {
+ AppLogDebug("EXIT(index(%d) MUST be greater than or equal to 0 OR __pContentList is null)", index);
+ return null;
+ }
+
ContentInformation* pContentInformation = null;
ContentSearchResult* pResult = static_cast<ContentSearchResult*>(__pContentList->GetAt(index));
if (pResult != null && pResult->GetContentType() == CONTENT_TYPE_AUDIO)
AllListPresentationModel::AddContent(String path, int playlistIndex)
{
AppLogDebug("ENTER");
- ContentInformation* pContentInfoStruct = GetContentInfoN(playlistIndex);
+ ContentInformation* pContentInfo = GetContentInfoN(playlistIndex);
PlayList* pPlayList = PlayListManager::GetInstance()->GetPlayListN(path);
- pPlayList->AddItem(pContentInfoStruct->contentId);
-
- delete pContentInfoStruct;
- pContentInfoStruct = null;
+ if (pContentInfo != null && pPlayList != null)
+ {
+ pPlayList->AddItem(pContentInfo->contentId);
+ }
+ delete pContentInfo;
delete pPlayList;
- pPlayList = null;
AppLogDebug("EXIT");
}
if (__pPresentationModel->GetArtistAlbumListCount() == 0)
{
- CommonUtil::ShowNoContentImage(__pPresentationModel->GetArtistAlbumListCount(), *__pContentTableView, *__pNoContentImageLabel, *__pNoContentTextLabel);
+// CommonUtil::ShowNoContentImage(__pPresentationModel->GetArtistAlbumListCount(), *__pContentTableView, *__pNoContentImageLabel, *__pNoContentTextLabel);
CommonUtil::SetButtonEnabled(*this, __pPresentationModel->GetArtistAlbumListCount());
pHeader->SetTitleText(ResourceManager::GetString(L"IDS_COM_BODY_NO_ITEMS"));
pFooter->SetItemEnabled(INDEX_ADDTOPLAYLIST_FOOTER_ADDTOPLAYLIST, false);
{
RemoveContentAt(pContentInfo->contentId);
__pPresentationModel->InitializeArtistAlbumList(__headerTitle);
+ __pPresentationModel->InitializeContentList(INIT_VALUE);
SetItemCheckedAll(false);
__pContentGroupedTableView->RefreshItem(__activatedStateContextItem.__groupIndex, __activatedStateContextItem.__itemIndex, TABLE_VIEW_REFRESH_TYPE_ITEM_REMOVE);;
case IDA_FOOTER_BUTTON_DELETE:
{
RemoveConentCheckedAll();
- __pPresentationModel->InitializeArtistAlbumList(__headerTitle);
-
- SetItemCheckedAll(false);
UpdateScreenState();
UpdateTableView();
}
RelativeLayout layout;
layout.Construct();
- TableViewItem* pItem = new (std::nothrow) TableViewItem();
TableViewAnnexStyle tableViewAnnexStyle = TABLE_VIEW_ANNEX_STYLE_NORMAL;
if (GetScreenState() != SCREEN_STATE_NORMAL)
{
tableViewAnnexStyle = TABLE_VIEW_ANNEX_STYLE_MARK;
}
- if (IsFailed(pItem->Construct(layout, Dimension(itemWidth, H_TABLEVIEW_IITEM), tableViewAnnexStyle)))
- {
- AppLogDebug("Construct(Dimension(itemWidth, ITEM_HEIGHT) failed(%s)", GetErrorMessage(GetLastResult()));
- delete pItem;
- return null;
- }
+ TableViewItem* pItem = new (std::nothrow) TableViewItem();
+ ContentInformation* pContentInfo = __pPresentationModel->GetArtistAlbumContentInfoN(itemIndex);
+
+ result r = pItem->Construct(layout, Dimension(itemWidth, ITEM_HEIGHT), tableViewAnnexStyle);
+ TryCatch(r == E_SUCCESS, delete pItem, "pItem->Construct(%s)", GetErrorMessage(r));
+ TryCatch(pContentInfo != null, delete pItem, "pContentInfo is null", GetErrorMessage(GetLastResult()));
if (__pPresentationModel->GetCurrentArtistAlbumIndex() != groupIndex)
{
__pPresentationModel->InitializeContentList(groupIndex);
}
-// ContentInformation* pContentInfo = __pPresentationModel->GetArtistContentInfoN(callCount);
- ContentInformation* pContentInfo = __pPresentationModel->GetArtistAlbumContentInfoN(itemIndex);
- if (pContentInfo != null)
- {
- CreateTableViewItem(*pItem, *pContentInfo);
- delete pContentInfo;
- }
+ r = CreateTableViewItem(*pItem, *pContentInfo);
+ TryCatch(r == E_SUCCESS, delete pItem, "CreateTableViewItem failed(%s)", GetErrorMessage(r));
+ delete pContentInfo;
AppLogDebug("EXIT");
return pItem;
+
+CATCH:
+ AppLogDebug("EXIT(%ls)", GetErrorMessage(GetLastResult()));
+ delete pContentInfo;
+ return null;
}
bool
{
if (appControlResult == APP_CTRL_RESULT_SUCCEEDED)
{
- const String* pResultString = static_cast<const String*>(pExtraData->GetValue(String(APPCONTROL_KEY_SOCIAL_ITEM_ID)));
-
- AppLogDebug("%ls", pResultString->GetPointer());
- int contactId;
- Integer::Parse(*pResultString, contactId);
+ int contactId = -1;
+ String* pKey = null;
+ ArrayList* pArrayListValue = null;
+ String* pResultString = null;
+ if (pExtraData != null)
+ {
+ IMapEnumerator* pEnum = pExtraData->GetMapEnumeratorN();
+ while (pEnum->MoveNext() == E_SUCCESS)
+ {
+ pKey = static_cast<String*>(pEnum->GetKey());
+ if (pKey->Equals(APPCONTROL_KEY_SOCIAL_ITEM_ID, true))
+ {
+ pArrayListValue = static_cast<ArrayList*>(pEnum->GetValue());
+ pResultString = static_cast<String*>(pArrayListValue->GetAt(0));
+ AppLogDebug("extraData : %ls:%ls", pKey->GetPointer(), pResultString->GetPointer());
+ Integer::Parse(*pResultString, contactId);
+ break;
+ }
+ }
+ delete pEnum;
+
+ if (contactId < 0)
+ {
+ AppLogDebug("pKey is invaild");
+ return;
+ }
+ }
+ else
+ {
+ AppLogDebug("pExtraData is null");
+ return;
+ }
AddressbookManager* pAddressbookManager = AddressbookManager::GetInstance();
Addressbook* pAddressbook = pAddressbookManager->GetAddressbookN(DEFAULT_ADDRESSBOOK_ID);
ArtistContentListForm::SetItemCheckedAt(int groupIndex, bool check)
{
AppLogDebug("ENTER");
- int groupItemCount = 0;
+ int groupItemCount = __pContentGroupedTableView->GetItemCountAt(groupIndex);
if (check == true)
{
groupItemCount = __pContentGroupedTableView->GetItemCountAt(groupIndex);
+ for (int iCount= 0; iCount < groupItemCount; iCount++)
+ {
+ __pContentGroupedTableView->SetItemChecked(groupIndex, iCount, check);
+ SetItemChecked(groupIndex, iCount, check);
+ }
}
else
{
- __pCheckedItemCountMultiHashMap->GetCount(groupIndex, groupItemCount);
- }
-
- for (int iCount= 0; iCount < groupItemCount; iCount++)
- {
- __pContentGroupedTableView->SetItemChecked(groupIndex, iCount, check);
- SetItemChecked(groupIndex, iCount, check);
+ __pCheckedItemCountMultiHashMap->Remove(groupIndex);
+ for (int iCount= 0; iCount < groupItemCount; iCount++)
+ {
+ __pContentGroupedTableView->SetItemChecked(groupIndex, iCount, check);
+ }
}
AppLogDebug("EXIT");
}
ArtistContentListForm::EventHandlerContextMenuItemMessageEmail(ContentInformation& contentInfo, Tizen::Base::String providerId)
{
AppLogDebug("ENTER");
- if (!providerId.Equals(PROVIDER_ID_EMAIL, false) || !providerId.Equals(PROVIDER_ID_MESSAGE, false))
+ if (!providerId.Equals(PROVIDER_ID_EMAIL, false) && !providerId.Equals(PROVIDER_ID_MESSAGE, false))
{
AppLogDebug("worng providerId(%s)", providerId.GetPointer());
return E_FAILURE;
}
delete pMapEnum;
+ SetItemCheckedAll(false);
+
+ __pPresentationModel->InitializeArtistAlbumList(__headerTitle);
+ __pPresentationModel->InitializeContentList(INIT_VALUE);
+
AppLogDebug("EXIT");
return E_SUCCESS;
}
ArtistListEditorPanel::CreateItem(const int itemIndex, int itemWidth)
{
AppLogDebug("ENTER");
- ContentInformation* pContentInfo = __pPresentationModel->GetArtistnIfoN(itemIndex);
- if (pContentInfo == null)
- {
- return null;
- }
-
RelativeLayout layout;
layout.Construct();
TableViewItem* pItem = new (std::nothrow) TableViewItem();
- pItem->Construct(layout, Dimension(itemWidth, ITEM_HEIGHT), TABLE_VIEW_ANNEX_STYLE_MARK);
+ ContentInformation* pContentInfo = __pPresentationModel->GetArtistnIfoN(itemIndex);
+
+ result r = pItem->Construct(layout, Dimension(itemWidth, ITEM_HEIGHT), TABLE_VIEW_ANNEX_STYLE_MARK);
+ TryCatch(r == E_SUCCESS, delete pItem, "pItem->Construct(%s)", GetErrorMessage(r));
+ TryCatch(pContentInfo != null, delete pItem, "pContentInfo is null", GetErrorMessage(GetLastResult()));
+
+ r = CreateTableViewItem(*pItem, *pContentInfo);
+ TryCatch(r == E_SUCCESS, delete pItem, "CreateTableViewItem failed(%s)", GetErrorMessage(r));
- CreateTableViewItem(*pItem, *pContentInfo);
RequestThumbnail(pContentInfo->contentId, (new (std::nothrow) Integer(itemIndex)));
delete pContentInfo;
AppLogDebug("EXIT");
return pItem;
+
+CATCH:
+ AppLogDebug("EXIT(%ls)", GetErrorMessage(GetLastResult()));
+ delete pContentInfo;
+ return null;
}
void
const Tizen::Ui::Scenes::SceneId& nextSceneId)
{
AppLogDebug("ENTER");
- Form* pForm = dynamic_cast<Form*>(GetParent());
- AppAssert(pForm);
-
- Footer* pFooter = pForm->GetFooter();
- pFooter->RemoveAllButtons();
- pFooter->RemoveAllItems();
- pFooter->RemoveActionEventListener(*this);
CancelAllThumbnailRequest();
+ ContentLibaryPanel::OnSceneDeactivated(currentSceneId, nextSceneId);
AppLogDebug("EXIT");
}
ArtistListPanel::CreateItem(const int itemIndex, int itemWidth)
{
AppLogDebug("ENTER");
- ContentInformation* pContentInfo = __pPresentationModel->GetArtistnIfoN(itemIndex);
- if (pContentInfo == null)
- {
- AppLogDebug("EXIT");
- return null;
- }
-
RelativeLayout layout;
layout.Construct();
TableViewItem* pItem = new (std::nothrow) TableViewItem();
- pItem->Construct(layout, Dimension(itemWidth, ITEM_HEIGHT), TABLE_VIEW_ANNEX_STYLE_NORMAL);
+ ContentInformation* pContentInfo = __pPresentationModel->GetArtistnIfoN(itemIndex);
- CreateTableViewItem(*pItem, *pContentInfo, __pPresentationModel->GetArtistContentCount(itemIndex));
- pItem->SetContextItem(__pContextItem);
+ result r = pItem->Construct(layout, Dimension(itemWidth, ITEM_HEIGHT), TABLE_VIEW_ANNEX_STYLE_NORMAL);
+ TryCatch(r == E_SUCCESS, delete pItem, "pItem->Construct(%s)", GetErrorMessage(r));
+ TryCatch(pContentInfo != null, delete pItem, "pContentInfo is null", GetErrorMessage(GetLastResult()));
+
+ r = CreateTableViewItem(*pItem, *pContentInfo, __pPresentationModel->GetArtistContentCount(itemIndex));
+ TryCatch(r == E_SUCCESS, delete pItem, "CreateTableViewItem failed(%s)", GetErrorMessage(r));
+ pItem->SetContextItem(__pContextItem);
RequestThumbnail(pContentInfo->contentId, (new (std::nothrow) Integer(itemIndex)));
delete pContentInfo;
AppLogDebug("EXIT");
return pItem;
+
+CATCH:
+ AppLogDebug("EXIT(%ls)", GetErrorMessage(GetLastResult()));
+ delete pContentInfo;
+ return null;
}
void
AppLogDebug("ENTER");
if (__pArtistList == null)
{
+ AppLogDebug("EXIT");
return INIT_VALUE;
}
if (__pArtistList->GetCount() == 0)
{
+ AppLogDebug("EXIT");
return INIT_VALUE;
}
- IList* pContentSearchResultList = CommonUtil::ContentSearchResultListN(
- *(static_cast<String*>(__pArtistList->GetAt(artistIndex))), STRING_SORT_ARTIST, STRING_SORT_TITLE);
+ String* pContentFileName = static_cast<String*>(__pArtistList->GetAt(artistIndex));
+ if (pContentFileName == null)
+ {
+ AppLogDebug("EXIT(pContentFileName is null");
+ return INIT_VALUE;
+ }
+
+ IList* pContentSearchResultList = CommonUtil::ContentSearchResultListN(*pContentFileName, STRING_SORT_ARTIST, STRING_SORT_TITLE);
if (pContentSearchResultList == null)
{
AppLogDebug("CommonUtil::ContentSearchResultListN() failed");
AppLogDebug("ENTER");
if (__pArtistAlbumList == null)
{
+ AppLogDebug("EXIT");
return INIT_VALUE;
}
/*
}
else
*/
- IList* pContentSearchResultList = CommonUtil::ContentSearchResultListN(
- *(static_cast<String*>(__pArtistAlbumList->GetAt(albumIndex))), STRING_SORT_ALBUM, STRING_SORT_TITLE);
+
+ String* pContentFileName = static_cast<String*>(__pArtistAlbumList->GetAt(albumIndex));
+ if (pContentFileName == null)
+ {
+ AppLogDebug("EXIT(pContentFileName is null");
+ return INIT_VALUE;
+ }
+
+ IList* pContentSearchResultList = CommonUtil::ContentSearchResultListN(*pContentFileName, STRING_SORT_ALBUM, STRING_SORT_TITLE);
if (pContentSearchResultList == null)
{
AppLogDebug("CommonUtil::ContentSearchResultListN() failed");
return null;
}
- IList* pContentSearchResultList = CommonUtil::ContentSearchResultListN(
- *(static_cast<String*>(__pArtistList->GetAt(artistIndex))), STRING_SORT_ARTIST, STRING_SORT_TITLE);
+ String* pContentFileName = static_cast<String*>(__pArtistList->GetAt(artistIndex));
+ if (pContentFileName == null)
+ {
+ AppLogDebug("EXIT(pContentFileName is null");
+ return null;
+ }
+
+ IList* pContentSearchResultList = CommonUtil::ContentSearchResultListN(*pContentFileName, STRING_SORT_ARTIST, STRING_SORT_TITLE);
if (pContentSearchResultList == null)
{
AppLogDebug("CommonUtil::ContentSearchResultListN() failed");
return null;
}
- IList* pContentSearchResultList = CommonUtil::ContentSearchResultListN(
- *(static_cast<String*>(__pArtistAlbumList->GetAt(albumIndex))), STRING_SORT_ALBUM, STRING_SORT_TITLE);
+ String* pContentFileName = static_cast<String*>(__pArtistAlbumList->GetAt(albumIndex));
+ if (pContentFileName == null)
+ {
+ AppLogDebug("EXIT(pContentFileName is null");
+ return null;
+ }
+
+ IList* pContentSearchResultList = CommonUtil::ContentSearchResultListN(*pContentFileName, STRING_SORT_ALBUM, STRING_SORT_TITLE);
if (pContentSearchResultList == null)
{
AppLogDebug("CommonUtil::ContentSearchResultListN() failed");
if (__pArtistAlbumContentList != null)
{
__pArtistAlbumContentList->RemoveAll(true);
+ delete __pArtistAlbumContentList;
+ __pArtistAlbumContentList = null;
+ }
+
+ String* pContentFileName = static_cast<String*>(__pArtistAlbumList->GetAt(albumIndex));
+ if (pContentFileName == null)
+ {
+ AppLogDebug("EXIT(pContentFileName is null");
+ return;
}
- __pArtistAlbumContentList = CommonUtil::ContentSearchResultListN(
- *(static_cast<String*>(__pArtistAlbumList->GetAt(albumIndex))), STRING_SORT_ALBUM, STRING_SORT_TITLE);
+ __pArtistAlbumContentList = CommonUtil::ContentSearchResultListN(*pContentFileName, STRING_SORT_ALBUM, STRING_SORT_TITLE);
__currentArtistAlbumIndex = albumIndex;
AppLogDebug("EXIT");
}
if (__pArtistList == null)
{
+ AppLogDebug("EXIT");
return;
}
- pRemoveArtistList = CommonUtil::ContentSearchResultListN(
- *(static_cast<String*>(__pArtistList->GetAt(artistIndex))), STRING_SORT_ARTIST, STRING_SORT_TITLE);
+
+ String* pContentFileName = static_cast<String*>(__pArtistList->GetAt(artistIndex));
+ if (pContentFileName == null)
+ {
+ AppLogDebug("EXIT(pContentFileName is null");
+ return;
+ }
+
+ pRemoveArtistList = CommonUtil::ContentSearchResultListN(*pContentFileName, STRING_SORT_ARTIST, STRING_SORT_TITLE);
+ if (pRemoveArtistList == null)
+ {
+ AppLogDebug("EXIT(pRemoveArtistList is null");
+ return;
+ }
+
totalCount = pRemoveArtistList->GetCount();
for (int iCount = 0; iCount < totalCount; iCount++)
{
{
pContentInformation = CommonUtil::GetContentInformationN(*static_cast<AudioContentInfo*>(pResult->GetContentInfo()));
contentManager.DeleteContent(pContentInformation->contentId);
-
delete pContentInformation;
- pContentInformation = null;
}
}
AppLogDebug("ENTER");
if (__pArtistList == null)
{
+ AppLogDebug("EXIT");
return null;
}
if (__pArtistList == null)
{
+ AppLogDebug("EXIT");
+ return null;
+ }
+
+ String* pContentFileName = static_cast<String*>(__pArtistList->GetAt(index));
+ if (pContentFileName == null)
+ {
+ AppLogDebug("EXIT(pContentFileName is null");
return null;
}
{
case SEARCH_MODE_ARTIST:
{
- pContentSearchResultList = CommonUtil::ContentSearchResultListN(
- *(static_cast<String*>(__pArtistList->GetAt(index))), STRING_SORT_ARTIST, STRING_SORT_TITLE);
+ pContentSearchResultList = CommonUtil::ContentSearchResultListN(*pContentFileName, STRING_SORT_ARTIST, STRING_SORT_TITLE);
}
break;
case SEARCH_MODE_ARTIST_ALBUM:
{
- pContentSearchResultList = CommonUtil::ContentSearchResultListN(
- *(static_cast<String*>(__pArtistAlbumList->GetAt(index))), STRING_SORT_ALBUM, STRING_SORT_TITLE);
+ pContentSearchResultList = CommonUtil::ContentSearchResultListN(*pContentFileName, STRING_SORT_ALBUM, STRING_SORT_TITLE);
}
break;
{
__pArtistAlbumContentList->RemoveAll(true);
delete __pArtistAlbumContentList;
+ __pArtistAlbumContentList = null;
}
- __pArtistAlbumContentList = CommonUtil::ContentSearchResultListN(
- *(static_cast<String*>(__pArtistAlbumList->GetAt(albumIndex))), STRING_SORT_ALBUM, STRING_SORT_TITLE);
+ __currentArtistAlbumIndex = albumIndex;
+
+ String* pContentFileName = static_cast<String*>(__pArtistAlbumList->GetAt(albumIndex));
+ if (pContentFileName == null)
+ {
+ AppLogDebug("EXIT(pContentFileName is null");
+ return;
+ }
+ __pArtistAlbumContentList = CommonUtil::ContentSearchResultListN(*pContentFileName, STRING_SORT_ALBUM, STRING_SORT_TITLE);
if (__pArtistAlbumContentList != null && __pArtistAlbumContentList->GetCount() == INIT_VALUE)
{
__pArtistAlbumContentList->RemoveAll(true);
delete __pArtistAlbumContentList;
__pArtistAlbumContentList = null;
- AppLogDebug(" __pArtistAlbumContentList->GetCount() is zero");
+ AppLogDebug("__pArtistAlbumContentList->GetCount() is zero");
}
- __currentArtistAlbumIndex = albumIndex;
AppLogDebug("EXIT");
}
}
void
-CommonUtil::SetLayoutFitToForm(const Tizen::Ui::Controls::Form& form, Tizen::Ui::Control& childControl)
-{
- AppLogDebug("ENTER");
- RelativeLayout* pLayout = dynamic_cast<RelativeLayout*>(form.GetPortraitLayoutN());
- pLayout->SetHorizontalFitPolicy(childControl, FIT_POLICY_PARENT);
- pLayout->SetVerticalFitPolicy(childControl, FIT_POLICY_PARENT);
- delete pLayout;
-
- pLayout = dynamic_cast<RelativeLayout*>(form.GetLandscapeLayoutN());
- pLayout->SetHorizontalFitPolicy(childControl, FIT_POLICY_PARENT);
- pLayout->SetVerticalFitPolicy(childControl, FIT_POLICY_PARENT);
- delete pLayout;
- AppLogDebug("EXIT");
-}
-
-void
CommonUtil::SetLayoutFitToContainer(const Tizen::Ui::Container& container, Tizen::Ui::Control& childControl)
{
AppLogDebug("ENTER");
return pFlickMenuPanel;
}
-void
-CommonUtil::SetTextItemSelectedBalloonPopup(Tizen::Ui::Controls::Label& itemSelectedBalloonPopup, int itemCount)
-{
- AppLogDebug("ENTER");
- String StrSelectStr = null;
-
- if (itemCount > INIT_VALUE)
- {
- String ResSelect = ResourceManager::GetString("IDS_COM_BODY_SELECTED");
- ResSelect.Append(L"(%d)");
-
- StrSelectStr.Format(STRING_LENGTH, ResSelect.GetPointer(), itemCount);
- }
- else
- {
- StrSelectStr.Format(STRING_LENGTH,L"Select <Noun>s");//NEED STRING
- }
-
- itemSelectedBalloonPopup.SetText(StrSelectStr);
- itemSelectedBalloonPopup.SetTextHorizontalAlignment(ALIGNMENT_LEFT);
- itemSelectedBalloonPopup.Invalidate(true);
- AppLogDebug("EXIT");
-}
-
Tizen::Base::String
CommonUtil::GetStringItemSelectd(int itemCount)
{
AppLogDebug("EXIT");
}
-void
-CommonUtil::ShowNoContentImage(int contentTotal, Tizen::Ui::Controls::TableView& contentTableView, Tizen::Ui::Controls::Label& contentImageLabel, Tizen::Ui::Controls::Label& contentTextLabel)
-{
- AppLogDebug("ENTER");
- if (contentTotal == 0)
- {
- contentTableView.SetShowState(false);
- contentImageLabel.SetShowState(true);
- contentTextLabel.SetShowState(true);
- }
- else
- {
- contentTableView.SetShowState(true);
- contentImageLabel.SetShowState(false);
- contentTextLabel.SetShowState(false);
- }
-
- contentTableView.Invalidate(true);
- contentImageLabel.Invalidate(true);
- contentTextLabel.Invalidate(true);
- AppLogDebug("EXIT");
-}
-
Bitmap*
CommonUtil::GetColorizedBitmapN(const Tizen::Graphics::Bitmap& bitmap, const Tizen::Graphics::Color& color)
{
int totalComposerCount = __pPresentationModel->GetAllComposerCount();
CommonUtil::SetButtonEnabled(*pForm, totalComposerCount, IDA_FOOTER_BUTTON_ADD_TO_PLAYLIST);
- CommonUtil::ShowNoContentImage(totalComposerCount, *__pContentTableView, *__pNoContentImageLabel, *__pNoContentTextLabel);
+// CommonUtil::ShowNoContentImage(totalComposerCount, *__pContentTableView, *__pNoContentImageLabel, *__pNoContentTextLabel);
}
AppLogDebug("EXIT");
}
__pPresentationModel->UpdateComposerList();
if (__pPresentationModel != null)
{
- CommonUtil::ShowNoContentImage(__pPresentationModel->GetAllComposerCount(), *__pContentTableView, *__pNoContentImageLabel, *__pNoContentTextLabel);
+// CommonUtil::ShowNoContentImage(__pPresentationModel->GetAllComposerCount(), *__pContentTableView, *__pNoContentImageLabel, *__pNoContentTextLabel);
}
if (pSceneManager->IsSceneAlive(IDSCN_PLAYER))
if (IsExistMiniPlayer() == true)\r
{\r
MiniPlayer* pMiniPlayer = static_cast<MiniPlayer*>(__pMiniPlayerRegisterBar->GetControl(IDL_MINI_PLYAER_PANEL));\r
- pMiniPlayer->MiniPlayerActivate();\r
- SetShowStateFooter(false);\r
+ if (IsFailed(pMiniPlayer->MiniPlayerActivate()))\r
+ {\r
+ RemoveMiniPlayer();\r
+ }\r
+ else\r
+ {\r
+ SetShowStateFooter(false);\r
+ }\r
}\r
+\r
UpdateContentLibaryScreenState();\r
- AppLogDebug("EXIT");\r
+ AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));\r
}\r
\r
void\r
AppLogDebug("ENTER");
RelativeLayout layout;
layout.Construct();
- TableViewItem* pItem = new (std::nothrow) TableViewItem();
- TableViewAnnexStyle tableViewAnnexStyle = TABLE_VIEW_ANNEX_STYLE_NORMAL;
+ TableViewAnnexStyle tableViewAnnexStyle = TABLE_VIEW_ANNEX_STYLE_NORMAL;
if (GetScreenState() != SCREEN_STATE_NORMAL)
{
tableViewAnnexStyle = TABLE_VIEW_ANNEX_STYLE_MARK;
}
- if (IsFailed(pItem->Construct(Dimension(itemWidth, ITEM_HEIGHT), tableViewAnnexStyle)))
- {
- AppLogDebug("Construct(Dimension(itemWidth, ITEM_HEIGHT) failed(%s)", GetErrorMessage(GetLastResult()));
- return null;
- }
-
+ TableViewItem* pItem = new (std::nothrow) TableViewItem();
ContentInformation* pContentInfo = __pPresentationModel->GetContentInfoN(itemIndex);
- if (pContentInfo != null)
- {
- CreateTableViewItem(*pItem, *pContentInfo);
- RequestThumbnail(pContentInfo->contentId, (new (std::nothrow) Integer(itemIndex)));
- delete pContentInfo;
- }
+
+ result r = pItem->Construct(layout, Dimension(itemWidth, ITEM_HEIGHT), tableViewAnnexStyle);
+ TryCatch(r == E_SUCCESS, delete pItem, "pItem->Construct(%s)", GetErrorMessage(r));
+ TryCatch(pContentInfo != null, delete pItem, "pContentInfo is null", GetErrorMessage(GetLastResult()));
+
+ r = CreateTableViewItem(*pItem, *pContentInfo);
+ TryCatch(r == E_SUCCESS, delete pItem, "CreateTableViewItem failed(%s)", GetErrorMessage(r));
+
+ RequestThumbnail(pContentInfo->contentId, (new (std::nothrow) Integer(itemIndex)));
+ delete pContentInfo;
AppLogDebug("EXIT");
return pItem;
+
+CATCH:
+ AppLogDebug("EXIT(%ls)", GetErrorMessage(GetLastResult()));
+ delete pContentInfo;
+ return null;
}
void
{
if (appControlResult == APP_CTRL_RESULT_SUCCEEDED)
{
- const String* pResultString = static_cast<const String*>(pExtraData->GetValue(String(APPCONTROL_KEY_SOCIAL_ITEM_ID)));
+ int contactId = -1;
+ String* pKey = null;
+ ArrayList* pArrayListValue = null;
+ String* pResultString = null;
+ if (pExtraData != null)
+ {
+ IMapEnumerator* pEnum = pExtraData->GetMapEnumeratorN();
+ while (pEnum->MoveNext() == E_SUCCESS)
+ {
+ pKey = static_cast<String*>(pEnum->GetKey());
+ if (pKey->Equals(APPCONTROL_KEY_SOCIAL_ITEM_ID, true))
+ {
+ pArrayListValue = static_cast<ArrayList*>(pEnum->GetValue());
+ pResultString = static_cast<String*>(pArrayListValue->GetAt(0));
+ AppLogDebug("extraData : %ls:%ls", pKey->GetPointer(), pResultString->GetPointer());
+ Integer::Parse(*pResultString, contactId);
+ break;
+ }
+ }
+ delete pEnum;
- AppLogDebug("%ls", pResultString->GetPointer());
- int contactId;
- Integer::Parse(*pResultString, contactId);
+ if (contactId < 0)
+ {
+ AppLogDebug("pKey is invaild");
+ return;
+ }
+ }
+ else
+ {
+ AppLogDebug("pExtraData is null");
+ return;
+ }
AddressbookManager* pAddressbookManager = AddressbookManager::GetInstance();
Addressbook* pAddressbook = pAddressbookManager->GetAddressbookN(DEFAULT_ADDRESSBOOK_ID);
FolderListEditorPanel::CreateItem(const int itemIndex, int itemWidth)
{
AppLogDebug("ENTER");
- String* pContentPath = __pPresentationModel->GetFolderPath(itemIndex);
- Bitmap* StorageIconBitmap = null;
- String strFolderName = null;
-
- int folderNamePosition = 0;
- pContentPath->LastIndexOf(IDS_SEPARATOR_SLASH, pContentPath->GetLength() - 1, folderNamePosition);
- pContentPath->SubString(folderNamePosition + 1, strFolderName);
-
- if (pContentPath->Contains(IDS_STORAGE_PHONE_PATH))
- {
- StorageIconBitmap = ResourceManager::GetBitmapN(IDB_STORAGE_PHONE);
- }
- else if (pContentPath->Contains(IDS_STORAGE_SDCARD_PATH))
- {
- StorageIconBitmap = ResourceManager::GetBitmapN(IDB_STORAGE_SDCARD);
- }
- else if (pContentPath->Contains(IDS_STORAGE_EXTERNAL_PATH))
- {
- StorageIconBitmap = ResourceManager::GetBitmapN(IDB_STORAGE_EXTERNAL);
- }
- else
- {
- StorageIconBitmap = ResourceManager::GetBitmapN(IDB_STORAGE_PHONE);
- }
-
- Panel* pTableViewItem = new (std::nothrow) Panel();
- if (IsFailed(pTableViewItem->Construct(IDL_CONTENT_LIBARY_FOLDER_EDITOR_ITEM_PANEL)))
- {
- AppLogDebug("Construct(IDL_CONTENT_LIBARY_FOLDER_ITEM_PANEL) failed(%s)", GetErrorMessage(GetLastResult()));
- return null;
- }
-
- Label* pStorageIcon = static_cast<Label*>(pTableViewItem->GetControl(IDC_STORAGE_TYPE_ICON));
- pStorageIcon->SetBackgroundBitmap(*StorageIconBitmap);
- delete StorageIconBitmap;
-
- Label* pFolderPath = static_cast<Label*>(pTableViewItem->GetControl(IDC_FOLDER_PATH));
- String fullContentPath;
- pContentPath->SubString(INIT_VALUE, folderNamePosition, fullContentPath);
- pFolderPath->SetText(CommonUtil::SetHighDepthToEllipsisPath(fullContentPath));
-
- Label* pFolderName = static_cast<Label*>(pTableViewItem->GetControl(IDC_FOLDER_NAME));
- pFolderName->SetText(strFolderName);
-
- Label* pFolderItemCount = static_cast<Label*>(pTableViewItem->GetControl(IDC_CONTENTS_ITEM_COUNT));
- pFolderItemCount->SetText(CommonUtil::SetSongsString(__pPresentationModel->GetContentCount(itemIndex)));
-
RelativeLayout layout;
layout.Construct();
+
TableViewItem* pItem = new (std::nothrow) TableViewItem();
- pItem->Construct(layout, Dimension(itemWidth, ITEM_HEIGHT), TABLE_VIEW_ANNEX_STYLE_MARK);
+ result r = pItem->Construct(layout, Dimension(itemWidth, ITEM_HEIGHT), TABLE_VIEW_ANNEX_STYLE_MARK);
+ TryCatch(r == E_SUCCESS, delete pItem, "pItem->Construct(%s)", GetErrorMessage(r));
- pItem->AddControl(*pTableViewItem);
- pItem->SetIndividualSelectionEnabled(pTableViewItem, true);
- CommonUtil::SetLayoutFitToContainer(*pItem, *pTableViewItem);
+ r = CreateTableViewItem(*pItem, *__pPresentationModel->GetFolderPath(itemIndex), __pPresentationModel->GetContentCount(itemIndex));
+ TryCatch(r == E_SUCCESS, delete pItem, "CreateTableViewItem failed(%s)", GetErrorMessage(r));
AppLogDebug("EXIT");
return pItem;
+
+CATCH:
+ AppLogDebug("EXIT(%ls)", GetErrorMessage(GetLastResult()));
+ return null;
}
bool
pHeader->SetButtonEnabled(BUTTON_POSITION_RIGHT, false);
pHeader->Invalidate(true);
AppLogDebug("EXIT");
+}
+
+result
+FolderListEditorPanel::CreateTableViewItem(Tizen::Ui::Container& parent, const Tizen::Base::String& contentPath, int contentCount)
+{
+ AppLogDebug("ENTER");
+ Bitmap* StorageIconBitmap = null;
+ String strFolderName = null;
+
+ int folderNamePosition = 0;
+ contentPath.LastIndexOf(IDS_SEPARATOR_SLASH, contentPath.GetLength() - 1, folderNamePosition);
+ contentPath.SubString(folderNamePosition + 1, strFolderName);
+
+ if (contentPath.Contains(IDS_STORAGE_PHONE_PATH))
+ {
+ StorageIconBitmap = ResourceManager::GetBitmapN(IDB_STORAGE_PHONE);
+ }
+ else if (contentPath.Contains(IDS_STORAGE_SDCARD_PATH))
+ {
+ StorageIconBitmap = ResourceManager::GetBitmapN(IDB_STORAGE_SDCARD);
+ }
+ else if (contentPath.Contains(IDS_STORAGE_EXTERNAL_PATH))
+ {
+ StorageIconBitmap = ResourceManager::GetBitmapN(IDB_STORAGE_EXTERNAL);
+ }
+ else
+ {
+ StorageIconBitmap = ResourceManager::GetBitmapN(IDB_STORAGE_PHONE);
+ }
+
+ Panel* pTableViewItem = new (std::nothrow) Panel();
+ if (IsFailed(pTableViewItem->Construct(IDL_CONTENT_LIBARY_FOLDER_EDITOR_ITEM_PANEL)))
+ {
+ AppLogDebug("Construct(IDL_CONTENT_LIBARY_FOLDER_ITEM_PANEL) failed(%s)", GetErrorMessage(GetLastResult()));
+ return null;
+ }
+
+ static_cast<Label*>(pTableViewItem->GetControl(IDC_STORAGE_TYPE_ICON))->SetBackgroundBitmap(*StorageIconBitmap);
+ delete StorageIconBitmap;
+
+ String fullContentPath;
+ contentPath.SubString(INIT_VALUE, folderNamePosition, fullContentPath);
+ static_cast<Label*>(pTableViewItem->GetControl(IDC_FOLDER_PATH))->SetText(CommonUtil::SetHighDepthToEllipsisPath(fullContentPath));
+
+ static_cast<Label*>(pTableViewItem->GetControl(IDC_FOLDER_NAME))->SetText(strFolderName);
+ static_cast<Label*>(pTableViewItem->GetControl(IDC_CONTENTS_ITEM_COUNT))->SetText(CommonUtil::SetSongsString(contentCount));
+
+ parent.AddControl(*pTableViewItem);
+ CommonUtil::SetLayoutFitToContainer(parent, *pTableViewItem);
+
+ AppLogDebug("EXIT");
+ return E_SUCCESS;
}
\ No newline at end of file
FolderListPanel::CreateItem(const int itemIndex, int itemWidth)
{
AppLogDebug("ENTER");
- String* pContentPath = __pPresentationModel->GetFolderPath(itemIndex);
- Bitmap* StorageIconBitmap = null;
- String strFolderName = null;
-
- int folderNamePosition = 0;
- pContentPath->LastIndexOf(IDS_SEPARATOR_SLASH, pContentPath->GetLength() - 1, folderNamePosition);
- pContentPath->SubString(folderNamePosition + 1, strFolderName);
-
- if (pContentPath->Contains(IDS_STORAGE_PHONE_PATH))
- {
- StorageIconBitmap = ResourceManager::GetBitmapN(IDB_STORAGE_PHONE);
- }
- else if (pContentPath->Contains(IDS_STORAGE_SDCARD_PATH))
- {
- StorageIconBitmap = ResourceManager::GetBitmapN(IDB_STORAGE_SDCARD);
- }
- else if (pContentPath->Contains(IDS_STORAGE_EXTERNAL_PATH))
- {
- StorageIconBitmap = ResourceManager::GetBitmapN(IDB_STORAGE_EXTERNAL);
- }
- else
- {
- StorageIconBitmap = ResourceManager::GetBitmapN(IDB_STORAGE_PHONE);
- }
-
- Panel* pTableViewItem = new (std::nothrow) Panel();
- if (IsFailed(pTableViewItem->Construct(IDL_CONTENT_LIBARY_FOLDER_ITEM_PANEL)))
- {
- AppLogDebug("Construct(IDL_CONTENT_LIBARY_FOLDER_ITEM_PANEL) failed(%s)", GetErrorMessage(GetLastResult()));
- return null;
- }
-
- static_cast<Label*>(pTableViewItem->GetControl(IDC_STORAGE_TYPE_ICON))->SetBackgroundBitmap(*StorageIconBitmap);
- delete StorageIconBitmap;
-
- String fullContentPath;
- pContentPath->SubString(INIT_VALUE, folderNamePosition, fullContentPath);
- static_cast<Label*>(pTableViewItem->GetControl(IDC_FOLDER_PATH))->SetText(CommonUtil::SetHighDepthToEllipsisPath(fullContentPath));
-
- static_cast<Label*>(pTableViewItem->GetControl(IDC_FOLDER_NAME))->SetText(strFolderName);
- static_cast<Label*>(pTableViewItem->GetControl(IDC_CONTENTS_ITEM_COUNT))->SetText(CommonUtil::SetSongsString(__pPresentationModel->GetContentCount(itemIndex)));
-
RelativeLayout layout;
layout.Construct();
TableViewItem* pItem = new (std::nothrow) TableViewItem();
- pItem->Construct(layout, Dimension(itemWidth, ITEM_HEIGHT), TABLE_VIEW_ANNEX_STYLE_NORMAL);
+ result r = pItem->Construct(layout, Dimension(itemWidth, ITEM_HEIGHT), TABLE_VIEW_ANNEX_STYLE_NORMAL);
+ TryCatch(r == E_SUCCESS, delete pItem, "pItem->Construct(%s)", GetErrorMessage(r));
- pItem->AddControl(*pTableViewItem);
- CommonUtil::SetLayoutFitToContainer(*pItem, *pTableViewItem);
+ r = CreateTableViewItem(*pItem, *__pPresentationModel->GetFolderPath(itemIndex), __pPresentationModel->GetContentCount(itemIndex));
+ TryCatch(r == E_SUCCESS, delete pItem, "CreateTableViewItem failed(%s)", GetErrorMessage(r));
pItem->SetContextItem(__pContextItem);
AppLogDebug("EXIT");
return pItem;
+
+CATCH:
+ AppLogDebug("EXIT(%ls)", GetErrorMessage(GetLastResult()));
+ return null;
}
void
}
AppLogDebug("EXIT");
return false;
+}
+
+result
+FolderListPanel::CreateTableViewItem(Tizen::Ui::Container& parent, const Tizen::Base::String& contentPath, int contentCount)
+{
+ AppLogDebug("ENTER");
+ Bitmap* StorageIconBitmap = null;
+ String strFolderName = null;
+
+ int folderNamePosition = 0;
+ contentPath.LastIndexOf(IDS_SEPARATOR_SLASH, contentPath.GetLength() - 1, folderNamePosition);
+ contentPath.SubString(folderNamePosition + 1, strFolderName);
+
+ if (contentPath.Contains(IDS_STORAGE_PHONE_PATH))
+ {
+ StorageIconBitmap = ResourceManager::GetBitmapN(IDB_STORAGE_PHONE);
+ }
+ else if (contentPath.Contains(IDS_STORAGE_SDCARD_PATH))
+ {
+ StorageIconBitmap = ResourceManager::GetBitmapN(IDB_STORAGE_SDCARD);
+ }
+ else if (contentPath.Contains(IDS_STORAGE_EXTERNAL_PATH))
+ {
+ StorageIconBitmap = ResourceManager::GetBitmapN(IDB_STORAGE_EXTERNAL);
+ }
+ else
+ {
+ StorageIconBitmap = ResourceManager::GetBitmapN(IDB_STORAGE_PHONE);
+ }
+
+ Panel* pTableViewItem = new (std::nothrow) Panel();
+ if (IsFailed(pTableViewItem->Construct(IDL_CONTENT_LIBARY_FOLDER_ITEM_PANEL)))
+ {
+ AppLogDebug("Construct(IDL_CONTENT_LIBARY_FOLDER_ITEM_PANEL) failed(%s)", GetErrorMessage(GetLastResult()));
+ return null;
+ }
+
+ static_cast<Label*>(pTableViewItem->GetControl(IDC_STORAGE_TYPE_ICON))->SetBackgroundBitmap(*StorageIconBitmap);
+ delete StorageIconBitmap;
+
+ String fullContentPath;
+ contentPath.SubString(INIT_VALUE, folderNamePosition, fullContentPath);
+ static_cast<Label*>(pTableViewItem->GetControl(IDC_FOLDER_PATH))->SetText(CommonUtil::SetHighDepthToEllipsisPath(fullContentPath));
+
+ static_cast<Label*>(pTableViewItem->GetControl(IDC_FOLDER_NAME))->SetText(strFolderName);
+ static_cast<Label*>(pTableViewItem->GetControl(IDC_CONTENTS_ITEM_COUNT))->SetText(CommonUtil::SetSongsString(contentCount));
+
+ parent.AddControl(*pTableViewItem);
+ CommonUtil::SetLayoutFitToContainer(parent, *pTableViewItem);
+
+ AppLogDebug("EXIT");
+ return E_SUCCESS;
}
\ No newline at end of file
FolderListPresentationModel::GetContentInfoN(int contentIndex)
{
AppLogDebug("ENTER");
- ContentInformation* pContentInfoStruct = null;
+ if (__pContentList == null || contentIndex < INIT_VALUE)
+ {
+ AppLogDebug("EXIT(index(%d) MUST be greater than or equal to 0 OR __pContentList is null)", contentIndex);
+ return null;
+ }
+ ContentInformation* pContentInfoStruct = null;
ContentInfo* pContentInfo = static_cast<ContentInfo*>(__pContentList->GetAt(contentIndex));
if (pContentInfo != null && pContentInfo->GetContentType() == CONTENT_TYPE_AUDIO)
{
int totalGenreCount = __pPresentationModel->GetAllGenreCount();
CommonUtil::SetButtonEnabled(*pForm, totalGenreCount, IDA_FOOTER_BUTTON_ADD_TO_PLAYLIST);
- CommonUtil::ShowNoContentImage(totalGenreCount, *__pContentTableView, *__pNoContentImageLabel, *__pNoContentTextLabel);
+// CommonUtil::ShowNoContentImage(totalGenreCount, *__pContentTableView, *__pNoContentImageLabel, *__pNoContentTextLabel);
}
if (pArgs != null)
{
__pPresentationModel->UpdateGnereList();
if (__pPresentationModel != null)
{
- CommonUtil::ShowNoContentImage(__pPresentationModel->GetAllGenreCount(), *__pContentTableView, *__pNoContentImageLabel, *__pNoContentTextLabel);
+// CommonUtil::ShowNoContentImage(__pPresentationModel->GetAllGenreCount(), *__pContentTableView, *__pNoContentImageLabel, *__pNoContentTextLabel);
}
if (pSceneManager->IsSceneAlive(IDSCN_PLAYER))
AppLogDebug("EXIT");\r
}\r
\r
-void\r
+result\r
MiniPlayer::MiniPlayerActivate(void)\r
{\r
AppLogDebug("ENTER");\r
-// if (__pPlayerPresentationModel->GetContentListCount() == INIT_VALUE)\r
-// {\r
-// }\r
+ result r = SetContentInfo(__pPresentationModel->GetCurrentContentIndex());\r
+ if (IsFailed(r))\r
+ {\r
+ AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));\r
+ return r;\r
+ }\r
\r
switch (__pPresentationModel->GetPlayerState())\r
{\r
break;\r
}\r
\r
- SetContentInfo(__pPresentationModel->GetCurrentContentIndex());\r
__pProgressBar->SetValue(__pPresentationModel->GetPlayPosition());\r
__pPresentationModel->AddMusicPlayerEventListener(*this);\r
+\r
AppLogDebug("EXIT");\r
+ return E_SUCCESS;\r
}\r
\r
void\r
ContentInformation* pContentInfo = __pPresentationModel->GetContentInfoN(currentContentIndex);\r
if (pContentInfo == null)\r
{\r
- AppLogDebug("__pPresentationModel->GetContentInfoN(currentContentIndex) failed");\r
AppLogDebug("__pPlayerPresentationModel->GetContentInfoN is null");\r
return E_FAILURE;\r
}\r
PlayerForm::CreateItem(int index, int itemWidth)
{
AppLogDebug("ENTER");
- ContentInformation* pContentInfo = __pPlayerPresentationModel->GetContentInfoN(index);
- if (pContentInfo == null)
- {
- return null;
- }
-
RelativeLayout layout;
layout.Construct();
TableViewItem* pItem = new (std::nothrow) TableViewItem();
+ ContentInformation* pContentInfo = __pPlayerPresentationModel->GetContentInfoN(index);
+
result r = pItem->Construct(layout, Dimension(itemWidth, ITEM_HEIGHT), TABLE_VIEW_ANNEX_STYLE_NORMAL);
- if (IsFailed(r))
- {
- AppLogDebug("EXIT(%s)", GetErrorMessage(r));
- delete pContentInfo;
- delete pItem;
- return null;
- }
+ TryCatch(r == E_SUCCESS, delete pItem, "pItem->Construct(%s)", GetErrorMessage(r));
+ TryCatch(pContentInfo != null, delete pItem, "pContentInfo is null", GetErrorMessage(GetLastResult()));
+
+ r = CreateTableViewItem(*pItem, *pContentInfo);
+ TryCatch(r == E_SUCCESS, delete pItem, "CreateTableViewItem failed(%s)", GetErrorMessage(r));
- CreateTableViewItem(*pItem, *pContentInfo);
RequestThumbnail(pContentInfo->contentId, (new (std::nothrow) Integer(index)));
delete pContentInfo;
AppLogDebug("EXIT");
return pItem;
+
+CATCH:
+ AppLogDebug("EXIT(%ls)", GetErrorMessage(GetLastResult()));
+ delete pContentInfo;
+ return null;
}
bool
PlayerPresentationModel::GetContentInfoN(int contentIndex)
{
AppLogDebug("ENTER");
- Tizen::Base::String contentPath = *static_cast<String*>(__pPlayContentList->GetAt(contentIndex));
+ if (__pPlayContentList == null || contentIndex < INIT_VALUE)
+ {
+ AppLogDebug("EXIT(index(%d) MUST be greater than or equal to 0 OR __pPlayContentList is null)", contentIndex);
+ return null;
+ }
+ Tizen::Base::String contentPath = *static_cast<String*>(__pPlayContentList->GetAt(contentIndex));
if (File::IsFileExist(contentPath) == false)
{
+ AppLogDebug("EXIT");
return null;
}
- ContentInformation* pContentInfoStruct = new (std::nothrow) ContentInformation();
+
+ ContentInformation* pContentInfo = new (std::nothrow) ContentInformation();
AudioContentInfo* pAudioContentInfo = CommonUtil::GetAudioContentInfoN(contentPath);
if (pAudioContentInfo != null)
{
if (pAudioContentInfo->GetArtist() == null)
{
- pContentInfoStruct->ArtistName = ResourceManager::GetString(L"IDS_MUSIC_BODY_UNKNOWN");
+ pContentInfo->ArtistName = ResourceManager::GetString(L"IDS_MUSIC_BODY_UNKNOWN");
}
else
{
- pContentInfoStruct->ArtistName = pAudioContentInfo->GetArtist();
+ pContentInfo->ArtistName = pAudioContentInfo->GetArtist();
}
if (pAudioContentInfo->GetTitle() == null)
{
- pContentInfoStruct->TitleName = ResourceManager::GetString(L"IDS_MUSIC_BODY_UNKNOWN");
+ pContentInfo->TitleName = ResourceManager::GetString(L"IDS_MUSIC_BODY_UNKNOWN");
}
else
{
- pContentInfoStruct->TitleName = pAudioContentInfo->GetTitle();
+ pContentInfo->TitleName = pAudioContentInfo->GetTitle();
}
- pContentInfoStruct->Duration = pAudioContentInfo->GetDuration();/*__pPlayer->GetDuration();*/
- if (__pPlayer != null && pContentInfoStruct->Duration == null)
+ pContentInfo->Duration = pAudioContentInfo->GetDuration();/*__pPlayer->GetDuration();*/
+ if (__pPlayer != null && pContentInfo->Duration == null)
{
__pPlayer->GetDuration();
}
- pContentInfoStruct->contentId = pAudioContentInfo->GetContentId();
+ pContentInfo->contentId = pAudioContentInfo->GetContentId();
}
else
{
Tizen::Content::AudioMetadata* pAudioMeta = Tizen::Content::ContentManagerUtil::GetAudioMetaN(*static_cast<String*>(__pPlayContentList->GetAt(contentIndex)));
if (pAudioMeta == null)
{
- delete pContentInfoStruct;
+ delete pContentInfo;
return null;
}
if (pAudioMeta->GetArtist() == null)
{
- pContentInfoStruct->ArtistName = ResourceManager::GetString(L"IDS_MUSIC_BODY_UNKNOWN");
+ pContentInfo->ArtistName = ResourceManager::GetString(L"IDS_MUSIC_BODY_UNKNOWN");
}
else
{
- pContentInfoStruct->ArtistName = pAudioMeta->GetArtist();
+ pContentInfo->ArtistName = pAudioMeta->GetArtist();
}
if (pAudioMeta->GetTitle() == null)
{
- pContentInfoStruct->TitleName = ResourceManager::GetString(L"IDS_MUSIC_BODY_UNKNOWN");
+ pContentInfo->TitleName = ResourceManager::GetString(L"IDS_MUSIC_BODY_UNKNOWN");
}
else
{
- pContentInfoStruct->TitleName = pAudioMeta->GetTitle();
+ pContentInfo->TitleName = pAudioMeta->GetTitle();
}
if (__pPlayer != null)
{
- pContentInfoStruct->Duration = __pPlayer->GetDuration();
+ pContentInfo->Duration = __pPlayer->GetDuration();
}
delete pAudioMeta;
delete pAudioContentInfo;
AppLogDebug("EXIT");
- return pContentInfoStruct;
+ return pContentInfo;
}
Tizen::Graphics::Bitmap*
RelativeLayout layout;
layout.Construct();
- TableViewItem* pItem = new (std::nothrow) TableViewItem();
- TableViewAnnexStyle tableViewAnnexStyle = TABLE_VIEW_ANNEX_STYLE_NORMAL;
+ TableViewAnnexStyle tableViewAnnexStyle = TABLE_VIEW_ANNEX_STYLE_NORMAL;
if (GetScreenState() != SCREEN_STATE_NORMAL)
{
tableViewAnnexStyle = TABLE_VIEW_ANNEX_STYLE_MARK;
}
+ TableViewItem* pItem = new (std::nothrow) TableViewItem();
+ ContentInformation* pContentInfo = __pPresentationModel->GetContentInfoN(itemIndex);
+
result r = pItem->Construct(layout, Dimension(itemWidth, ITEM_HEIGHT), tableViewAnnexStyle);
- if (IsFailed(r))
- {
- AppLogDebug("pItem->Construct() failed(%s)", GetErrorMessage(r));
- delete pItem;
- return null;
- }
+ TryCatch(r == E_SUCCESS, delete pItem, "pItem->Construct(%s)", GetErrorMessage(r));
+ TryCatch(pContentInfo != null, delete pItem, "pContentInfo is null", GetErrorMessage(GetLastResult()));
- ContentInformation* pContentInfo = __pPresentationModel->GetContentInfoN(itemIndex);
- if (pContentInfo == null)
- {
- AppLogDebug("__pPresentationModel->GetContentInfoN failed(null)");
- delete pItem;
- return null;
- }
+ r = CreateTableViewItem(*pItem, *pContentInfo);
+ TryCatch(r == E_SUCCESS, delete pItem, "CreateTableViewItem failed(%s)", GetErrorMessage(r));
- CreateTableViewItem(*pItem, *pContentInfo);
RequestThumbnail(pContentInfo->contentId, (new (std::nothrow) Integer(itemIndex)));
delete pContentInfo;
AppLogDebug("EXIT");
return pItem;
+
+CATCH:
+ AppLogDebug("EXIT(%ls)", GetErrorMessage(GetLastResult()));
+ delete pContentInfo;
+ return null;
}
void
int lastNum = 0;
for (int i = 0; i < totalPlaylistCount; i++)
{
- String* pStr = __pPlaylistEditorPresentationModel->GetPlayListNameN(i);
- if (pStr->GetLength() >= PlayListName.GetLength())
+ String currentPlayListName = __pPlaylistEditorPresentationModel->GetPlayListName(i);
+ if (currentPlayListName.GetLength() >= PlayListName.GetLength())
{
String pCompareStr = null;
- pStr->SubString(0, PlayListName.GetLength(), pCompareStr);
+ currentPlayListName.SubString(0, PlayListName.GetLength(), pCompareStr);
if (pCompareStr.Equals(PlayListName, true))
{
String pLastStr = null;
wchar_t ch;
- for (int index = pStr->GetLength()-1; index >= 0; index--)
+ for (int index = currentPlayListName.GetLength()-1; index >= 0; index--)
{
- pStr->GetCharAt(index, ch);
+ currentPlayListName.GetCharAt(index, ch);
if (Character::IsDigit(ch))
{
continue;
}
else
{
- pStr->SubString(index + 1, pStr->GetLength() - (index + 1), pLastStr);
+ currentPlayListName.SubString(index + 1, currentPlayListName.GetLength() - (index + 1), pLastStr);
break;
}
}
// StringComparer strComparer;
// pTempList->Sort(strComparer);
AppLogDebug("EXIT");
-// return pTempList;
return PlayListManager::GetInstance()->GetAllPlayListNameN();
}
-Tizen::Base::String*
-PlaylistEditorPresentationModel::GetPlayListNameN(int playlistIndex)
+Tizen::Base::String
+PlaylistEditorPresentationModel::GetPlayListName(int playlistIndex)
{
AppLogDebug("ENTER");
-// IList* pTempList = PlayListManager::GetInstance()->GetAllPlayListNameN();
-// StringComparer strComparer;
-// pTempList->Sort(strComparer);
+ IList* pList = PlayListManager::GetInstance()->GetAllPlayListNameN();
+ if (pList == null)
+ {
+ AppLogDebug("EXIT");
+ return String(L"");
+ }
+
+ String* pPlayListName = static_cast<String*>(pList->GetAt(playlistIndex));
+ if (pPlayListName == null)
+ {
+ AppLogDebug("EXIT(pPlayListName is null)");
+ return String(L"");
+ }
+
+ String playListName(*pPlayListName);
+ pList->RemoveAll();
+ delete pList;
+
AppLogDebug("EXIT");
-// return static_cast<String*>(pTempList->GetAt(playlistIndex));
- return static_cast<String*>(PlayListManager::GetInstance()->GetAllPlayListNameN()->GetAt(playlistIndex));
+ return playListName;
}
result
{
PlayList* pPlaylist = PlayListManager::GetInstance()->GetPlayListN(oldPlayListName);
r = pPlaylist->SetPlayListName(newPlayListName);
-
delete pPlaylist;
- pPlaylist = null;
}
else
{
PlayList* pPlaylist = new (std::nothrow) PlayList();
r = pPlaylist->Construct(newPlayListName);
delete pPlaylist;
- pPlaylist = null;
}
AppLogDebug("EXIT");
{
if (__pContentTableView->IsItemChecked(index) == true)
{
- pTempList->Add(*(new (std::nothrow) String(*__pPresentationModel->GetPlayListNameN(index))));
+ pTempList->Add(*(new (std::nothrow) String(__pPresentationModel->GetPlayListName(index))));
__pContentTableView->RefreshItem(index, TABLE_VIEW_REFRESH_TYPE_ITEM_REMOVE);
}
}
PlaylistListEditorPanel::CreateItem(const int itemIndex, int itemWidth)
{
AppLogDebug("ENTER");
- AppLogDebug("%d", itemIndex);
RelativeLayout layout;
layout.Construct();
TableViewItem* pItem = new (std::nothrow) TableViewItem();
- pItem->Construct(layout, Dimension(itemWidth, ITEM_HEIGHT), TABLE_VIEW_ANNEX_STYLE_MARK);
+ Tizen::Base::String playlistName = __pPresentationModel->GetPlayListName(itemIndex);
+ Panel* pPanel = null;
- Tizen::Base::String* playlistName = __pPresentationModel->GetPlayListNameN(itemIndex);
- int playlistItemCount = __pPresentationModel->GetPlayListItemCount(*playlistName);
- ContentId contentId = __pPresentationModel->GetPlayListItemContentId(*playlistName);
+ result r = pItem->Construct(layout, Dimension(itemWidth, ITEM_HEIGHT), TABLE_VIEW_ANNEX_STYLE_MARK);
+ TryCatch(r == E_SUCCESS, delete pItem, "pItem->Construct(%s)", GetErrorMessage(r));
- Panel* pTableViewItem = new (std::nothrow) Panel();
- if (IsFailed(pTableViewItem->Construct(IDL_CONTENTS_PLAYLIST_EDITOR_ITEM_PANEL)))
- {
- AppLogDebug("Construct(IDL_CONTENTS_LIBARY_EDITOR_ITEM_PANEL) failed(%s)", GetErrorMessage(GetLastResult()));
- return null;
- }
-
- static_cast<Label*>(pTableViewItem->GetControl(IDC_CONTENTS_TITLE_NAME))->SetText(*playlistName);
-
- String str = L"";
- str.Append(itemIndex);
-
- Button* pEditButton = static_cast<Button*>(pTableViewItem->GetControl(IDC_BUTTON_EDIT));
- pEditButton->SetName(str);
-
- Bitmap* pNormalBitmap = ResourceManager::GetBitmapN(L"00_button_rename_normal.png");
- Bitmap* pPressedBitmap = ResourceManager::GetBitmapN(L"00_button_rename_press.png");
- Bitmap* pBackgroundNormalBitmap = ResourceManager::GetBitmapN(L"00_btn_circle_bg_normal.png");
- Bitmap* pBackgroundPressBitmap = ResourceManager::GetBitmapN(L"00_btn_circle_bg_press.png");
-
- pEditButton->SetNormalBitmap(Point(0, 0), *pNormalBitmap);
- pEditButton->SetNormalBackgroundBitmap(*pBackgroundNormalBitmap);
- pEditButton->SetPressedBitmap(Point(0, 0), *pPressedBitmap);
- pEditButton->SetPressedBackgroundBitmap(*pBackgroundPressBitmap);
-
- pEditButton->SetActionId(IDA_RENAME_EDIT_BUTTON);
- pEditButton->AddActionEventListener(*this);
-
- delete pNormalBitmap;
- delete pPressedBitmap;
- delete pBackgroundNormalBitmap;
- delete pBackgroundPressBitmap;
-
- pItem->SetIndividualSelectionEnabled(pEditButton, true);
- pItem->AddControl(*pTableViewItem);
-
- CommonUtil::SetLayoutFitToContainer(*pItem, *pTableViewItem);
+ r = CreateTableViewItem(*pItem, playlistName, itemIndex);
+ TryCatch(r == E_SUCCESS, delete pItem, "CreateTableViewItem failed(%s)", GetErrorMessage(r));
- if (playlistItemCount > 0 && !IsFailed(GetLastResult()))
+ pPanel = static_cast<Panel*>(pItem->GetControl(IDL_CONTENTS_PLAYLIST_EDITOR_ITEM_PANEL));
+ if (__pPresentationModel->GetPlayListItemCount(playlistName) > 0 && !IsFailed(GetLastResult()))
{
- static_cast<Label*>(pTableViewItem->GetControl(IDC_CONTENTS_THUMBNAIL))->SetBackgroundBitmap(*GetDefaultThumbnail());
- RequestThumbnail(contentId, (new (std::nothrow) Integer(itemIndex)));
+ static_cast<Label*>(pPanel->GetControl(IDC_CONTENTS_THUMBNAIL))->SetBackgroundBitmap(*GetDefaultThumbnail());
+ RequestThumbnail(__pPresentationModel->GetPlayListItemContentId(playlistName), (new (std::nothrow) Integer(itemIndex)));
}
else
{
Bitmap* thumbnail = (ResourceManager::GetBitmapN(L"34_player_list_thum_noitems.png"));
thumbnail->Scale(Dimension(W_THUMBNAIL, H_THUMBNAIL));
- static_cast<Label*>(pTableViewItem->GetControl(IDC_CONTENTS_THUMBNAIL))->SetBackgroundBitmap(*thumbnail);
+ static_cast<Label*>(pPanel->GetControl(IDC_CONTENTS_THUMBNAIL))->SetBackgroundBitmap(*thumbnail);
delete thumbnail;
}
AppLogDebug("EXIT");
return pItem;
+
+CATCH:
+ AppLogDebug("EXIT(%ls)", GetErrorMessage(GetLastResult()));
+ return null;
}
void
AppLogDebug("ENTER");
AppLogDebug("EXIT");
return __checkedItemCount;
+}
+
+result
+PlaylistListEditorPanel::CreateTableViewItem(Tizen::Ui::Controls::TableViewItem& parent, const Tizen::Base::String& title, int itemIndex)
+{
+ AppLogDebug("ENTER");
+ Panel* pTableViewItem = new (std::nothrow) Panel();
+ if (IsFailed(pTableViewItem->Construct(IDL_CONTENTS_PLAYLIST_EDITOR_ITEM_PANEL)))
+ {
+ AppLogDebug("Construct(IDL_CONTENTS_LIBARY_EDITOR_ITEM_PANEL) failed(%s)", GetErrorMessage(GetLastResult()));
+ return E_FAILURE;
+ }
+
+ static_cast<Label*>(pTableViewItem->GetControl(IDC_CONTENTS_TITLE_NAME))->SetText(title);
+
+ String str = L"";
+ str.Append(itemIndex);
+
+ Button* pEditButton = static_cast<Button*>(pTableViewItem->GetControl(IDC_BUTTON_EDIT));
+ pEditButton->SetName(str);
+
+ Bitmap* pNormalBitmap = ResourceManager::GetBitmapN(L"00_button_rename_normal.png");
+ Bitmap* pPressedBitmap = ResourceManager::GetBitmapN(L"00_button_rename_press.png");
+ Bitmap* pBackgroundNormalBitmap = ResourceManager::GetBitmapN(L"00_btn_circle_bg_normal.png");
+ Bitmap* pBackgroundPressBitmap = ResourceManager::GetBitmapN(L"00_btn_circle_bg_press.png");
+
+ pEditButton->SetNormalBitmap(Point(0, 0), *pNormalBitmap);
+ pEditButton->SetNormalBackgroundBitmap(*pBackgroundNormalBitmap);
+ pEditButton->SetPressedBitmap(Point(0, 0), *pPressedBitmap);
+ pEditButton->SetPressedBackgroundBitmap(*pBackgroundPressBitmap);
+
+ pEditButton->SetActionId(IDA_RENAME_EDIT_BUTTON);
+ pEditButton->AddActionEventListener(*this);
+
+ delete pNormalBitmap;
+ delete pPressedBitmap;
+ delete pBackgroundNormalBitmap;
+ delete pBackgroundPressBitmap;
+
+ parent.AddControl(*pTableViewItem);
+ CommonUtil::SetLayoutFitToContainer(parent, *pTableViewItem);
+
+ AppLogDebug("EXIT");
+ return E_SUCCESS;
}
\ No newline at end of file
RelativeLayout layout;
layout.Construct();
- TableViewItem* pTableItem = new (std::nothrow) TableViewItem();
- pTableItem->Construct(layout, Dimension(itemWidth, ITEM_HEIGHT), TABLE_VIEW_ANNEX_STYLE_NORMAL);
+ TableViewItem* pItem = new (std::nothrow) TableViewItem();
+ result r = pItem->Construct(layout, Dimension(itemWidth, ITEM_HEIGHT), TABLE_VIEW_ANNEX_STYLE_NORMAL);
+ TryCatch(r == E_SUCCESS, delete pItem, "pItem->Construct(%s)", GetErrorMessage(r));
if (itemIndex < USER_CONTENT)
{
}
String bitmapResName[] = {"34_mostplayed.png", "34_recentlyplayed.png", "34_recentlyadded.png"};
- CreateTableViewItem(*pTableItem, pDefaultPlaylistTitle, *(ResourceManager::GetBitmapN(bitmapResName[itemIndex])), NUM_NOT_DISPLAY_CONTENT_COUNT);
+ Bitmap* pBitmap = ResourceManager::GetBitmapN(bitmapResName[itemIndex]);
+ r = CreateTableViewItem(*pItem, pDefaultPlaylistTitle, *pBitmap, NUM_NOT_DISPLAY_CONTENT_COUNT);
+ TryCatch(r == E_SUCCESS, delete pItem, "CreateTableViewItem failed(%s)", GetErrorMessage(r));
- pTableItem->SetContextItem(__pContextItem_default);
+ pItem->SetContextItem(__pContextItem_default);
+ delete pBitmap;
}
else
{
ContentId contentId = __pPlaylistListPresentationModel->GetPlayListItemContentId(*playlistName);
if (playlistItemCount > 0 && !IsFailed(GetLastResult()))
{
- CreateTableViewItem(*pTableItem, *playlistName, *GetDefaultThumbnail(), playlistItemCount);
+ r = CreateTableViewItem(*pItem, *playlistName, *GetDefaultThumbnail(), playlistItemCount);
+ TryCatch(r == E_SUCCESS, delete pItem, "CreateTableViewItem failed(%s)", GetErrorMessage(r));
RequestThumbnail(contentId, (new (std::nothrow) Integer(itemIndex)));
}
else
{
Bitmap* thumbnail = (ResourceManager::GetBitmapN(L"34_player_list_thum_noitems.png"));
thumbnail->Scale(Dimension(W_THUMBNAIL, H_THUMBNAIL));
- CreateTableViewItem(*pTableItem, *playlistName, *thumbnail, playlistItemCount);
+ r = CreateTableViewItem(*pItem, *playlistName, *thumbnail, playlistItemCount);
+ TryCatch(r == E_SUCCESS, delete pItem, "CreateTableViewItem failed(%s)", GetErrorMessage(r));
+
delete thumbnail;
}
-
- pTableItem->SetContextItem(__pContextItem_user);
+ pItem->SetContextItem(__pContextItem_user);
}
AppLogDebug("EXIT");
- return pTableItem;
+ return pItem;
+
+CATCH:
+ AppLogDebug("EXIT(%ls)", GetErrorMessage(GetLastResult()));
+ return null;
}
bool
PlaylistListPresentationModel::GetContentInfoN(int contentIndex)
{
AppLogDebug("ENTER");
- if (__pContentList == null)
+ if (__pContentList == null || contentIndex < INIT_VALUE)
{
+ AppLogDebug("EXIT(index(%d) MUST be greater than or equal to 0 OR __pContentList is null)", contentIndex);
return null;
}
PlayListPickerPopup::CreateItem(const int itemIndex, int itemWidth)
{
AppLogDebug("ENTER");
+ RelativeLayout layout;
+ layout.Construct();
+
TableViewItem* pItem = new (std::nothrow) TableViewItem();
- if (pItem == null)
- {
- return null;
- }
- pItem->Construct(Dimension(itemWidth, HEIGHT_POPUP_ITEM), TABLE_VIEW_ANNEX_STYLE_NORMAL);
-// pItem->SetBackgroundColor(Color(255, 255, 255));
+ result r = pItem->Construct(layout, Dimension(itemWidth, HEIGHT_POPUP_ITEM), TABLE_VIEW_ANNEX_STYLE_NORMAL);
+ TryCatch(r == E_SUCCESS, delete pItem, "pItem->Construct(%s)", GetErrorMessage(r));
- CreateTableViewItem(*pItem, *(__pPlaylistListPresentationModel->GetPlayListName(itemIndex)));
+ r = CreateTableViewItem(*pItem, *(__pPlaylistListPresentationModel->GetPlayListName(itemIndex)));
+ TryCatch(r == E_SUCCESS, delete pItem, "CreateTableViewItem failed(%s)", GetErrorMessage(r));
AppLogDebug("EXIT");
return pItem;
+
+CATCH:
+ AppLogDebug("EXIT(%ls)", GetErrorMessage(GetLastResult()));
+ return null;
}
bool
SearchForm::CreateItem(const int itemIndex, int itemWidth)
{
AppLogDebug("ENTER");
+ RelativeLayout layout;
+ layout.Construct();
+
+ ContentInformation* pContentInfo = null;
TableViewItem* pItem = new (std::nothrow) TableViewItem();
- pItem->Construct(Dimension(itemWidth, H_GROUP_NAME), TABLE_VIEW_ANNEX_STYLE_NORMAL);
-// pItem->SetBackgroundColor(COLOR_ITEM);
+
+ result r = pItem->Construct(layout, Dimension(itemWidth, H_GROUP_NAME), TABLE_VIEW_ANNEX_STYLE_NORMAL);
+ TryCatch(r == E_SUCCESS, delete pItem, "pItem->Construct(%s)", GetErrorMessage(r));
if (__pPresentationModel->GetArtistIndex() == itemIndex)
{
- CreateGroupNameTableViewItem(*pItem, ResourceManager::GetString(L"IDS_MUSIC_BODY_ARTISTS"));
+ r = CreateGroupNameTableViewItem(*pItem, ResourceManager::GetString(L"IDS_MUSIC_BODY_ARTISTS"));
+ TryCatch(r == E_SUCCESS, delete pItem, "CreateTableViewItem failed(%s)", GetErrorMessage(r));
+
+ AppLogDebug("EXIT");
return pItem;
}
else if (__pPresentationModel->GetAlbumIndex() == itemIndex)
{
- CreateGroupNameTableViewItem(*pItem, ResourceManager::GetString(L"IDS_MUSIC_BODY_ALBUMS"));
+ r = CreateGroupNameTableViewItem(*pItem, ResourceManager::GetString(L"IDS_MUSIC_BODY_ALBUMS"));
+ TryCatch(r == E_SUCCESS, delete pItem, "CreateTableViewItem failed(%s)", GetErrorMessage(r));
+
+ AppLogDebug("EXIT");
return pItem;
}
else if (__pPresentationModel->GetSongIndex() == itemIndex)
{
- CreateGroupNameTableViewItem(*pItem, ResourceManager::GetString(L"IDS_MUSIC_HEADER_SONGS"));
+ r = CreateGroupNameTableViewItem(*pItem, ResourceManager::GetString(L"IDS_MUSIC_HEADER_SONGS"));
+ TryCatch(r == E_SUCCESS, delete pItem, "CreateTableViewItem failed(%s)", GetErrorMessage(r));
+
+ AppLogDebug("EXIT");
return pItem;
}
-
- delete pItem;
- pItem = null;
-
- ContentInformation* pContentInfo = __pPresentationModel->GetContentInfoN(itemIndex);
- if (pContentInfo == null)
+ else
{
- return null;
+ delete pItem;
}
+
pItem = new (std::nothrow) TableViewItem();
- pItem->Construct(Dimension(itemWidth, ITEM_HEIGHT), TABLE_VIEW_ANNEX_STYLE_NORMAL);
-// pItem->SetBackgroundColor(COLOR_ITEM);
+ r = pItem->Construct(Dimension(itemWidth, ITEM_HEIGHT), TABLE_VIEW_ANNEX_STYLE_NORMAL);
+ TryCatch(r == E_SUCCESS, delete pItem, "pItem->Construct(%s)", GetErrorMessage(r));
+
+ pContentInfo = __pPresentationModel->GetContentInfoN(itemIndex);
+ TryCatch(pContentInfo != null, delete pItem, "pContentInfo is null", GetErrorMessage(GetLastResult()));
if (itemIndex < __pPresentationModel->GetAlbumIndex())
{
pItem->AddControl(*pSongNameLabel);
}
-
delete pContentInfo;
- pContentInfo = null;
AppLogDebug("EXIT");
return pItem;
+
+CATCH:
+ AppLogDebug("EXIT(%ls)", GetErrorMessage(GetLastResult()));
+ delete pContentInfo;
+ return null;
}
bool
SearchPresentationModel::GetContentInfoN(int index)
{
AppLogDebug("ENTER");
- ContentInformation* pContentInfoStruct = null;
+ if (__pSearchList == null || index < INIT_VALUE)
+ {
+ AppLogDebug("EXIT(index(%d) MUST be greater than or equal to 0 OR __pSearchList is null)", index);
+ return null;
+ }
+ ContentInformation* pContentInfoStruct = null;
ContentSearchResult* pResult = static_cast<ContentSearchResult*>(__pSearchList->GetAt(index));
if (pResult->GetContentType() == CONTENT_TYPE_AUDIO)
{
SetAsPopup::CreateItem(const int itemIndex, int itemWidth)
{
AppLogDebug("ENTER");
+ RelativeLayout layout;
+ layout.Construct();
+
TableViewItem* pItem = new (std::nothrow) TableViewItem();
- if (pItem == null)
- {
- return null;
- }
- pItem->Construct(Dimension(itemWidth, ITEM_HEIGHT), TABLE_VIEW_ANNEX_STYLE_NORMAL);
-// pItem->SetBackgroundColor(COLOR_ITEM);
+
+ result r = pItem->Construct(Dimension(itemWidth, ITEM_HEIGHT), TABLE_VIEW_ANNEX_STYLE_NORMAL);
+ TryCatch(r == E_SUCCESS, delete pItem, "pItem->Construct(%s)", GetErrorMessage(r));
if (itemIndex < SET_AS_END)
{
default:
break;
}
- CreateTableViewItem(*pItem, labelName);
+
+ r = CreateTableViewItem(*pItem, labelName);
+ TryCatch(r == E_SUCCESS, delete pItem, "CreateTableViewItem failed(%s)", GetErrorMessage(r));
}
+
AppLogDebug("EXIT");
return pItem;
+
+CATCH:
+ AppLogDebug("EXIT(%ls)", GetErrorMessage(GetLastResult()));
+ return null;
}
bool
Tizen::Ui::Controls::TableViewItem*
SettingForm::CreateItem(int groupIndex, int itemIndex, int itemWidth)
{
- AppLogDebug("ENTER %d %d", groupIndex, itemIndex);
+ AppLogDebug("ENTER");
RelativeLayout layout;
layout.Construct();
TableViewItem* pItem = new (std::nothrow) TableViewItem();
Panel* pGroupTableViewItem = new (std::nothrow) Panel();
- if (IsFailed(pGroupTableViewItem->Construct(IDL_GROUPEDTABLEVIEW_ITEM_PANEL)))
- {
- AppLogDebug("Construct(IDL_SETTING_PLAYLIST_SET_ITEM_PANEL) failed(%s)", GetErrorMessage(GetLastResult()));
- return null;
- }
+ result r = pGroupTableViewItem->Construct(IDL_GROUPEDTABLEVIEW_ITEM_PANEL);
+ TryCatch(r == E_SUCCESS, delete pItem, "pGroupTableViewItem->Construct(%s)", GetErrorMessage(r));
if (groupIndex == ID_MAIN_DEFAULT_PLAYLIST_ITEM)
{
- pItem->Construct(layout, Tizen::Graphics::Dimension(W_CLIENT_AREA, SETTING_ITEM_HEIGHT), TABLE_VIEW_ANNEX_STYLE_MARK);
+ r = pItem->Construct(layout, Tizen::Graphics::Dimension(W_CLIENT_AREA, SETTING_ITEM_HEIGHT), TABLE_VIEW_ANNEX_STYLE_MARK);
+ TryCatch(r == E_SUCCESS, delete pItem, "pItem->Construct(%s)", GetErrorMessage(r));
+
Label* pMainText = static_cast<Label*>(pGroupTableViewItem->GetControl(IDC_LABEL_MAIN_TEXT));
switch (itemIndex)
}
else
{
- pItem->Construct(layout, Tizen::Graphics::Dimension(W_CLIENT_AREA, SETTING_ITEM_HEIGHT), TABLE_VIEW_ANNEX_STYLE_RADIO);
+ r = pItem->Construct(layout, Tizen::Graphics::Dimension(W_CLIENT_AREA, SETTING_ITEM_HEIGHT), TABLE_VIEW_ANNEX_STYLE_RADIO);
+ TryCatch(r == E_SUCCESS, delete pItem, "pItem->Construct(%s)", GetErrorMessage(r));
+
Label* pMainText = static_cast<Label*>(pGroupTableViewItem->GetControl(IDC_LABEL_MAIN_TEXT));
switch (itemIndex)
AppLogDebug("EXIT");
return pItem;
+
+CATCH:
+ AppLogDebug("EXIT(%ls)", GetErrorMessage(GetLastResult()));
+ delete pGroupTableViewItem;
+ return null;
}
void
{
AppLogDebug("ENTER");
TableViewItem* pItem = new (std::nothrow) TableViewItem();
- pItem->Construct(Dimension(itemWidth, HEIGHT_POPUP_ITEM), TABLE_VIEW_ANNEX_STYLE_NORMAL);
-// pItem->SetBackgroundColor(COLOR_ITEM);
+ result r = pItem->Construct(Dimension(itemWidth, HEIGHT_POPUP_ITEM), TABLE_VIEW_ANNEX_STYLE_NORMAL);
+ if (IsFailed(r))
+ {
+ AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
+ delete pItem;
+ return null;
+ }
//String shareItemName[] = {L"Message", L"Email", L"Bluetooth"};//NEED STRING Bluetooth
String shareItemName[] = {L"Email"};//NEED
RelativeLayout layout;
layout.Construct();
- TableViewItem* pItem = new (std::nothrow) TableViewItem();
TableViewAnnexStyle tableViewAnnexStyle = TABLE_VIEW_ANNEX_STYLE_NORMAL;
if (GetScreenState() != SCREEN_STATE_NORMAL)
{
tableViewAnnexStyle = TABLE_VIEW_ANNEX_STYLE_MARK;
}
+ TableViewItem* pItem = new (std::nothrow) TableViewItem();
+ ContentInformation* pContentInfo = __pPresentationModel->GetContentInfoN(itemIndex);
+
result r = pItem->Construct(layout, Dimension(itemWidth, ITEM_HEIGHT), tableViewAnnexStyle);
- if (IsFailed(r))
- {
- AppLogDebug("pItem->Construct() failed(%s)", GetErrorMessage(r));
- delete pItem;
- return null;
- }
+ TryCatch(r == E_SUCCESS, delete pItem, "pItem->Construct(%s)", GetErrorMessage(r));
+ TryCatch(pContentInfo != null, delete pItem, "pContentInfo is null", GetErrorMessage(GetLastResult()));
- ContentInformation* pContentInfo = __pPresentationModel->GetContentInfoN(itemIndex);
- if (pContentInfo == null)
- {
- AppLogDebug("__pPresentationModel->GetContentInfoN failed(null)");
- delete pItem;
- return null;
- }
+ r = CreateTableViewItem(*pItem, *pContentInfo);
+ TryCatch(r == E_SUCCESS, delete pItem, "CreateTableViewItem failed(%s)", GetErrorMessage(r));
- CreateTableViewItem(*pItem, *pContentInfo);
RequestThumbnail(pContentInfo->contentId, (new (std::nothrow) Integer(itemIndex)));
delete pContentInfo;
AppLogDebug("EXIT");
return pItem;
+
+CATCH:
+ AppLogDebug("EXIT(%ls)", GetErrorMessage(GetLastResult()));
+ delete pContentInfo;
+ return null;
}
void
int totalYearCount = __pPresentationModel->GetAllYearCount();
CommonUtil::SetButtonEnabled(*pForm, totalYearCount, IDA_FOOTER_BUTTON_ADD_TO_PLAYLIST);
- CommonUtil::ShowNoContentImage(totalYearCount, *__pContentTableView, *__pNoContentImageLabel, *__pNoContentTextLabel);
+// CommonUtil::ShowNoContentImage(totalYearCount, *__pContentTableView, *__pNoContentImageLabel, *__pNoContentTextLabel);
}
if (pArgs != null)
{
__pPresentationModel->UpdateYearList();
if (__pPresentationModel != null)
{
- CommonUtil::ShowNoContentImage(__pPresentationModel->GetAllYearCount(), *__pContentTableView, *__pNoContentImageLabel, *__pNoContentTextLabel);
+// CommonUtil::ShowNoContentImage(__pPresentationModel->GetAllYearCount(), *__pContentTableView, *__pNoContentImageLabel, *__pNoContentTextLabel);
}
if (pSceneManager->IsSceneAlive(IDSCN_PLAYER))