//
// Copyright (c) 2012 Samsung Electronics Co., Ltd.
//
-// Licensed under the Flora License, Version 1.0 (the License);
+// Licensed under the Flora License, Version 1.1 (the License);
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
using namespace Tizen::Content;
using namespace Tizen::Graphics;
-static const int FORMAT_BUFFER_SIZE = 256;
-
AlbumInfo::AlbumInfo(void)
- : __albumName(EMPTY_SPACE)
- , __pDirectoryFullPathList(null)
+ : __pDirectoryFullPathList(null)
, __pContentIdList(null)
- , __folderThumnailBitmapCount(0)
+ , __pFolderThumnailBitmap(null)
{
- for (int i = 0; i < FOLDER_BITMAP_MAX; ++i)
- {
- __pFolderThumnailBitmap[i] = null;
- }
}
AlbumInfo::~AlbumInfo(void)
delete __pContentIdList;
}
- for (int i = 0; i < FOLDER_BITMAP_MAX; ++i)
+ if (__pFolderThumnailBitmap != null)
{
- if (__pFolderThumnailBitmap[i] != null)
- {
- delete __pFolderThumnailBitmap[i];
- }
+ delete __pFolderThumnailBitmap;
}
}
pDirectoryFullPathList->Add(pItem);
}
delete pEnum;
- pEnum = null;
return pDirectoryFullPathList;
}
{
delete __pDirectoryFullPathList;
}
+
__pDirectoryFullPathList = new (std::nothrow) ArrayList(SingleObjectDeleter);
}
__pDirectoryFullPathList->Add(pItem);
}
delete pEnum;
- pEnum = null;
}
int
pContentIdList->Add(pItem);
}
delete pEnum;
- pEnum = null;
return pContentIdList;
}
__pDirectoryFullPathList = new (std::nothrow) ArrayList(SingleObjectDeleter);
__pContentIdList = new (std::nothrow) ArrayList(SingleObjectDeleter);
result r = E_SUCCESS;
- if (GetLastResult() == E_SUCCESS && __pDirectoryFullPathList != null && __pContentIdList != null)
- {
- r = E_SUCCESS;
- }
- else
+ if (GetLastResult() != E_SUCCESS || __pDirectoryFullPathList == null || __pContentIdList == null)
{
delete __pDirectoryFullPathList;
+ __pDirectoryFullPathList = null;
delete __pContentIdList;
+ __pContentIdList = null;
r = E_FAILURE;
}
}
result
-AlbumInfo::Construct(const String& albumName, ContentType contentType ,
- const IList& directoryList, const IList& contentIdList)
+AlbumInfo::Construct(const String& albumName, ContentType contentType, const IList& directoryList,
+ const IList& contentIdList)
{
if (&albumName == null)
{
__pContentIdList->Add(pItem);
}
delete pEnum;
- pEnum = null;
-
- int thumnailCount = __pContentIdList->GetCount();
- if (thumnailCount >= FOLDER_BITMAP_MAX)
- {
- __folderThumnailBitmapCount = FOLDER_BITMAP_MAX;
- }
- else
- {
- __folderThumnailBitmapCount = thumnailCount;
- }
}
void
}
result
-AlbumInfo::RemoveContentIdAt(int index)
+AlbumInfo::RemoveContentIdAt(const int index)
{
result r = E_SUCCESS;
return r;
}
-int
-AlbumInfo::GetFolderThumnailBitmapCount(void) const
-{
- return __folderThumnailBitmapCount;
-}
-
void
-AlbumInfo::AppendFolderThumnailBitmap(Bitmap* FolderThumnailBitmap, int index)
+AlbumInfo::SetFolderThumnailBitmap(Bitmap* pFolderThumnailBitmap)
{
- if (index >= FOLDER_BITMAP_MAX)
- {
- return;
- }
-
- __pFolderThumnailBitmap[index] = FolderThumnailBitmap;
+ __pFolderThumnailBitmap = pFolderThumnailBitmap;
}
Bitmap*
-AlbumInfo::GetFolderThumnailBitmap(int index)
-{
- if (index >= FOLDER_BITMAP_MAX)
- {
- return null;
- }
-
- return __pFolderThumnailBitmap[index];
-}
-
-int
-AlbumInfo::GetEmptyBitmapIndex(void)
-{
- int empty = FOLDER_BITMAP_MAX;
-
- for (int i = 0; i < __folderThumnailBitmapCount; ++i)
- {
- if (i >= FOLDER_BITMAP_MAX)
- {
- break;
- }
-
- if (__pFolderThumnailBitmap[i] == null)
- {
- empty = i;
- break;
- }
- }
- return empty;
-}
-
-String
-AlbumInfo::GetCreateDateString(void) const
-{
- return __createFileDateString;
-}
-
-void
-AlbumInfo::SetCreateDateString(String& strMinimumDate, String& strMaximumDate)
+AlbumInfo::GetFolderThumnailBitmap(void) const
{
- String resultTime;
-
- if (strMinimumDate == strMaximumDate)
- {
- resultTime.Format(FORMAT_BUFFER_SIZE, L"%ls", strMaximumDate.GetPointer());
- }
- else
- {
- resultTime.Format(FORMAT_BUFFER_SIZE, L"%ls - %ls", strMinimumDate.GetPointer(),
- strMaximumDate.GetPointer());
- }
-
- __createFileDateString = resultTime;
+ return __pFolderThumnailBitmap;
}
AlbumInfoType
-AlbumInfo::GetAlbumInfoType(void)
+AlbumInfo::GetAlbumInfoType(void) const
{
return ALBUM_INFO_TYPE_FOLDER;
}