2 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
4 // Licensed under the Flora License, Version 1.0 (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 GlFileListPresentationModel.cpp
19 * @brief This is the implementation file for FileListPresentationModel class.
25 #include "GlCommonUtil.h"
26 #include "GlFileListPresentationModel.h"
27 #include "GlContentUpdateEventListener.h"
28 #include "GlGalleryApp.h"
29 #include "GlThumbnailEvent.h"
30 #include "GlThumbnailEventArg.h"
31 #include "GlThumbnailProvider.h"
34 using namespace Tizen::App;
35 using namespace Tizen::Base;
36 using namespace Tizen::Base::Collection;
37 using namespace Tizen::Base::Runtime;
38 using namespace Tizen::Base::Utility;
39 using namespace Tizen::Content;
40 using namespace Tizen::Graphics;
41 using namespace Tizen::Io;
42 using namespace Tizen::Media;
43 using namespace Tizen::System;
45 static const String CONTENT_INFO_ORDER = L"ContentFileName";
47 static const int SIZE_PAGE_NO = 1;
48 static const int SIZE_CONUNT_PER_PAGE = 3000;
49 static const int SIZE_ICON_LIST_CACHE = 50;
50 static const int W_DURATION_TEXT = 44;
51 static const int H_DURATION_TEXT = 4;
52 static const int W_DURATION = 171;
53 static const int H_DURATION = 32;
54 static const int W_DEFAULT_THUMBNAIL = 171;
55 static const int H_DEFAULT_THUMBNAIL = 127;
56 static const int W_WIDE_THUMBNAIL = 171;
57 static const int H_WIDE_THUMBNAIL = 127;
58 static const int W_PLAY_FG = 64;
59 static const int H_PLAY_FG = 64;
60 static const int GAP_W_PLAY_FG = (W_DEFAULT_THUMBNAIL -W_PLAY_FG)/2 ;
61 static const int GAP_H_PLAY_FG = (H_DEFAULT_THUMBNAIL - H_PLAY_FG)/2;
62 static const int GAP_H_DURATION = H_DEFAULT_THUMBNAIL - H_DURATION;
63 static const int ALPHA_DURATION = 70;
64 static const int FONT_SIZE_DURATION = 24;
65 static const Dimension DIMENSION_REAL_ICON (171,127);
66 static const Rectangle RECTANGLE_THUMBNAIL_OFFSET_POSION (1, 1, 171, 127);
67 static const Rectangle RECTANGLE_VIDEO_THUMBNAIL_OFFSET_POSION (1, 1, 171, 127);
68 static const Color COLOR_DURATION_BG (Color::GetColor(COLOR_ID_BLACK));
69 static const Color COLOR_TEXT_OUTLINE (Color::GetColor(COLOR_ID_WHITE));
71 static const String RESERVED_CAMERA_PATH = Environment::GetMediaPath() + L"Camera";
72 static const String RESERVED_CAMERA_PATH_EXT = Environment::GetExternalStoragePath() + L"Camera";
73 static const String RESERVED_DOWNLOAD_PATH = Environment::GetMediaPath() + L"Downloads";
75 FileListPresentationModel* FileListPresentationModel::__pPresentationModelInstance = null;
76 ThumbnailProvider* FileListPresentationModel::__pThumbnailProvider = null;
77 ThumbnailEvent* FileListPresentationModel::__pThumbnailEvent = null;
78 ArrayList* FileListPresentationModel::__pPresentationModelListener = null;
79 ArrayList* FileListPresentationModel::__pContentEventListener = null;
80 ArrayList* FileListPresentationModel::__pIconListViewCache = null;
81 IList* FileListPresentationModel::__pDirectoryList = null;
82 IList* FileListPresentationModel::__pContentInfoList = null;
84 FileListPresentationModel::FileListPresentationModel(void)
85 : __albumContentType(CONTENT_TYPE_ALL)
86 , __appControlMode(APP_CONTROL_MODE_MAIN)
87 , __appControlMediaType(APPCONTROL_MEDIA_TYPE_IMAGE)
88 , __appControlSelectionMode(APPCONTROL_SELECTION_MODE_SINGLE)
89 , __updateProgressStatus(false)
92 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
95 FileListPresentationModel::~FileListPresentationModel(void)
98 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
101 FileListPresentationModel*
102 FileListPresentationModel::GetInstance(void)
104 AppLogDebug("ENTER");
105 if (__pPresentationModelInstance == null)
109 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
111 return __pPresentationModelInstance;
115 FileListPresentationModel::Construct(void)
117 AppLogDebug("ENTER");
119 IThumbnailEventListener* pThumbnailEventListener = static_cast<IThumbnailEventListener*>(this);
120 __pThumbnailEvent = new (std::nothrow) ThumbnailEvent();
121 __pThumbnailEvent->AddListener(*pThumbnailEventListener, true);
123 ContentUpdateEventListener::GetInstance();
124 __pContentManager = new (std::nothrow) ContentManager();
125 __pContentManager->Construct();
127 if (__pIconListViewCache != null)
129 delete __pIconListViewCache;
131 __pIconListViewCache = new (std::nothrow) ArrayList(SingleObjectDeleter);
132 __pIconListViewCache->Construct(SIZE_ICON_LIST_CACHE);
134 if (__pDirectoryList != null)
136 delete __pDirectoryList;
138 __pDirectoryList = new (std::nothrow) ArrayList(SingleObjectDeleter);
140 if (__pContentInfoList != null)
142 delete __pContentInfoList;
144 __pContentInfoList = new (std::nothrow) ArrayList(SingleObjectDeleter);
146 __pPresentationModelListener = new (std::nothrow) ArrayList();
147 __pPresentationModelListener->Construct();
149 __pContentEventListener = new (std::nothrow) ArrayList();
150 __pContentEventListener->Construct();
152 __pThumbnailProvider = ThumbnailProvider::GetInstance();
154 GalleryApp* pApp = static_cast<GalleryApp*>(GalleryApp::GetInstance());
155 const IMap* pArguments = pApp->GetAppControlArguments();
156 String operationId = pApp->GetAppControlOperationId();
158 if (operationId.CompareTo(APPCONTROL_OPERATION_ID_MAIN) == 0)
160 __appControlMode = APP_CONTROL_MODE_MAIN;
162 else if (operationId.CompareTo(APPCONTROL_OPERATION_ID_PICK) == 0)
164 __appControlMode = APP_CONTROL_MODE_PICK;
166 if (pArguments != null)
168 const String* selectionMode = static_cast<const String*>(pArguments->GetValue(String(APPCONTROL_KEY_SELECTION_MODE)));
170 if (pApp->GetMimeType().StartsWith(APPCONTROL_DATA_VIDEO, 0) == true)
172 __appControlMediaType = APPCONTROL_MEDIA_TYPE_VIDEO;
175 if (selectionMode != null && selectionMode->CompareTo(APPCONTROL_DATA_MULTIPLE) == 0)
177 __appControlSelectionMode = APPCONTROL_SELECTION_MODE_MULTIPLE;
181 else if (operationId.CompareTo(APPCONTROL_OPERATION_ID_CONFIGURE) == 0)
183 __appControlMode = APP_CONTROL_MODE_SETTING;
186 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
192 FileListPresentationModel::CreateInstance(void)
194 AppLogDebug("ENTER");
195 __pPresentationModelInstance = new (std::nothrow) FileListPresentationModel();
196 result r = __pPresentationModelInstance->Construct();
197 if (IsFailed(r) == true)
199 delete __pPresentationModelInstance;
200 __pPresentationModelInstance = null;
201 AppLogDebug("EXIT 1(%s)", GetErrorMessage(GetLastResult()));
206 std::atexit(DestroyInstance);
207 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
211 FileListPresentationModel::DestroyInstance(void)
213 AppLogDebug("ENTER");
215 delete __pThumbnailEvent;
216 __pIconListViewCache = null;
218 if (__pIconListViewCache != null)
220 delete __pIconListViewCache;
221 __pIconListViewCache = null;
224 if (__pDirectoryList != null)
226 delete __pDirectoryList;
227 __pDirectoryList = null;
230 if (__pContentInfoList != null)
232 delete __pContentInfoList;
233 __pContentInfoList = null;
236 if (__pPresentationModelListener != null)
238 delete __pPresentationModelListener;
239 __pPresentationModelListener = null;
242 if (__pContentEventListener != null)
244 delete __pContentEventListener;
245 __pContentEventListener = null;
248 delete __pPresentationModelInstance;
249 __pPresentationModelInstance = null;
251 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
255 FileListPresentationModel::GetFileNameFromFullPath(const String& fullPath, bool withExt) const
257 AppLogDebug("ENTER");
258 if (fullPath.CompareTo(EMPTY_SPACE) == 0)
260 AppLogDebug("EXIT 1(%s)", GetErrorMessage(GetLastResult()));
265 String delim(DIRECTORY_SEPARATOR);
266 StringTokenizer st(fullPath,delim);
268 while (st.HasMoreTokens())
270 st.GetNextToken(token);
275 AppLogDebug("EXIT 2(%s)", GetErrorMessage(GetLastResult()));
281 String subDelim(FILE_EXT_SEPARATOR);
282 StringTokenizer subSt(token, subDelim);
284 subSt.GetNextToken(subToken);
285 AppLogDebug("EXIT 3(%s)", GetErrorMessage(GetLastResult()));
292 FileListPresentationModel::GetDirecotyNameFromFullPath(const String& fullPath)const
294 AppLogDebug("ENTER");
295 if (fullPath == null)
297 AppLogDebug("EXIT 1(%s)", GetErrorMessage(GetLastResult()));
301 String delim(DIRECTORY_SEPARATOR);
302 StringTokenizer st(fullPath,delim);
304 while (st.HasMoreTokens())
306 st.GetNextToken(token);
308 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
314 FileListPresentationModel::IsContainContentInDirectory(const String& directoryPath, ContentType contentType) const
316 AppLogDebug("ENTER");
317 IListT<ContentType>* pContentTypeList = new (std::nothrow) ArrayListT<ContentType>();
318 if (&directoryPath == null || pContentTypeList == null)
320 AppLogDebug("EXIT 1(%s)", GetErrorMessage(GetLastResult()));
325 if (contentType == CONTENT_TYPE_IMAGE || contentType == CONTENT_TYPE_ALL)
327 pContentTypeList->Add(CONTENT_TYPE_IMAGE);
329 if (contentType == CONTENT_TYPE_VIDEO || contentType == CONTENT_TYPE_ALL)
331 pContentTypeList->Add(CONTENT_TYPE_VIDEO);
334 ContentDirectory contentDirectory;
335 result r = contentDirectory.Construct(*pContentTypeList);
336 if (pContentTypeList != null)
338 delete pContentTypeList;
340 TryReturn(r == E_SUCCESS, false, "[%s] Unable to construct ContentDirectory", GetErrorMessage(r));
342 bool returnValue = false;
343 int pageNo = SIZE_PAGE_NO;
344 int countPerPage = SIZE_CONUNT_PER_PAGE;
346 IList* pContentList = contentDirectory.GetContentDirectoryItemListN(directoryPath, pageNo, countPerPage,
347 CONTENT_INFO_ORDER, SORT_ORDER_ASCENDING);
349 if (pContentList == null || pContentList->GetCount() <= 0)
358 if (pContentList != null)
362 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
368 FileListPresentationModel::GetThumbnailInSyncCacheN(const int index, String*& pName, Bitmap*& pThumbnail)
370 AppLogDebug("ENTER : index(%d)", index);
371 Bitmap* pOrgBitmap = null;
372 Bitmap* pDstBitmap = null;
373 ContentInfo* pContentInfo = null;
375 if (__pContentInfoList != null && index < __pContentInfoList->GetCount())
377 pContentInfo = static_cast<ContentInfo*>(__pContentInfoList->GetAt(index));
378 if (pContentInfo == null)
380 AppLogDebug("EXIT 1(%s)", GetErrorMessage(GetLastResult()));
387 AppLogDebug("EXIT 2 __pContentInfoList(%x) index(%d)", __pContentInfoList, index);
391 ThumbnailInfo* pThumbnailInfo = GetThumbnailInfoFromInternalBufferN(pContentInfo->GetContentId());
392 if (pThumbnailInfo != null)
394 pName = new (std::nothrow) String(pThumbnailInfo->GetFilePath());
395 pOrgBitmap = pThumbnailInfo->GetBitmapN();
398 if ((pThumbnailInfo != null)&&(pThumbnailInfo->GetContentType() == CONTENT_TYPE_VIDEO))
400 if (pOrgBitmap != null)
402 pDstBitmap = CoverVideoOverlayedImageOnThumbnailN(*pOrgBitmap, *pThumbnailInfo);
408 pDstBitmap = pOrgBitmap;
411 if (pDstBitmap != null)
413 Bitmap* pThumbnailBgBitmap = ResourceManager::GetBitmapN(IDB_VIDEOTHUMBNAIL_BG);
414 Rectangle thumbnailRect(RECTANGLE_THUMBNAIL_OFFSET_POSION);
415 pDstBitmap->Scale(Dimension(RECTANGLE_THUMBNAIL_OFFSET_POSION.width - RECTANGLE_THUMBNAIL_OFFSET_POSION.x
416 , RECTANGLE_THUMBNAIL_OFFSET_POSION.height - RECTANGLE_THUMBNAIL_OFFSET_POSION.y));
417 if (pThumbnailBgBitmap != null)
419 pThumbnailBgBitmap->Scale(DIMENSION_REAL_ICON);
420 pThumbnail = GetShadedBackgroundBitmapN(*pThumbnailBgBitmap, *pDstBitmap, thumbnailRect);
421 delete pThumbnailBgBitmap;
426 pThumbnail = pDstBitmap;
434 if (pThumbnailInfo != null)
436 delete pThumbnailInfo;
438 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
444 FileListPresentationModel::GetThumbnailVideoInSyncCacheN(const int index, String*& pName, Bitmap*& pThumbnail, String*& pDuration)
446 AppLogDebug("ENTER : index(%d)", index);
447 ContentInfo* pContentInfo = null;
448 Bitmap* pOrgBitmap = null;
450 if (__pContentInfoList != null && index < __pContentInfoList->GetCount())
452 pContentInfo = static_cast<ContentInfo*>(__pContentInfoList->GetAt(index));
453 if (pContentInfo == null)
455 AppLogDebug("EXIT 1(%s)", GetErrorMessage(GetLastResult()));
461 AppLogDebug("EXIT 2 __pContentInfoList(%x) index(%d)", __pContentInfoList, index);
465 ThumbnailInfo* pThumbnailInfo = GetThumbnailInfoFromInternalBufferN(pContentInfo->GetContentId());
466 if (pThumbnailInfo != null)
468 pName = new (std::nothrow) String(pThumbnailInfo->GetFilePath());
469 pOrgBitmap = pThumbnailInfo->GetBitmapN();
470 pDuration = new (std::nothrow) String(CommonUtil::DurationToTimeString(pThumbnailInfo->GetDuration()));
474 pName = new (std::nothrow) String(EMPTY_SPACE);
475 pDuration = new (std::nothrow) String(CommonUtil::DurationToTimeString(0));
478 if (pOrgBitmap != null)
480 Bitmap* pThumbnailBgBitmap = ResourceManager::GetBitmapN(IDB_VIDEOTHUMBNAIL_BG);
481 Rectangle thumbnailRect(RECTANGLE_VIDEO_THUMBNAIL_OFFSET_POSION);
482 pOrgBitmap->Scale(Dimension(RECTANGLE_VIDEO_THUMBNAIL_OFFSET_POSION.width - RECTANGLE_VIDEO_THUMBNAIL_OFFSET_POSION.x
483 , RECTANGLE_VIDEO_THUMBNAIL_OFFSET_POSION.height - RECTANGLE_VIDEO_THUMBNAIL_OFFSET_POSION.y));
484 if (pThumbnailBgBitmap != null)
486 pThumbnailBgBitmap->Scale(Dimension(W_WIDE_THUMBNAIL, H_WIDE_THUMBNAIL));
487 pThumbnail = GetShadedBackgroundBitmapN(*pThumbnailBgBitmap, *pOrgBitmap, thumbnailRect);
488 delete pThumbnailBgBitmap;
497 if (pThumbnail != null)
499 pThumbnail->Scale(Dimension(W_WIDE_THUMBNAIL, H_WIDE_THUMBNAIL));
502 if (pThumbnailInfo != null)
504 delete pThumbnailInfo;
506 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
512 FileListPresentationModel::RequestThumbnail(const int index)
514 AppLogDebug("ENTER : index(%d)", index);
515 ContentInfo* pContentInfo = null;
517 if (__pContentInfoList != null && index < __pContentInfoList->GetCount())
519 pContentInfo = static_cast<ContentInfo*>(__pContentInfoList->GetAt(index));
520 if (pContentInfo == null)
522 AppLogDebug("EXIT 1(%s)", GetErrorMessage(GetLastResult()));
528 AppLogDebug("EXIT 2 __pContentInfoList(%x) index(%d)", __pContentInfoList, index);
533 __pThumbnailProvider->RequestThumbnail(pContentInfo->GetContentId(), __pThumbnailEvent);
538 FileListPresentationModel::CancelThumbnailRequest(const int index)
540 AppLogDebug("ENTER : index(%d)", index);
541 /*ContentInfo* pContentInfo = null;
543 if (__pContentInfoList != null && index < __pContentInfoList->GetCount())
545 pContentInfo = static_cast<ContentInfo*>(__pContentInfoList->GetAt(index));
546 if (pContentInfo == null)
548 AppLogDebug("EXIT 1(%s)", GetErrorMessage(GetLastResult()));
551 __pThumbnailProvider->CancelThumbnailRequest(pContentInfo->GetContentId(), __pThumbnailEvent);
557 FileListPresentationModel::ClearThumbnailRequests(bool appTerminating)
559 AppLogDebug("ENTER");
561 if (__pThumbnailProvider != null)
563 __pThumbnailProvider->ClearThumbnailRequests(appTerminating);
570 FileListPresentationModel::OnThumbnailReceivedN(IEventArg& eventArg)
572 AppLogDebug("ENTER");
574 if (&eventArg != null)
576 ThumbnailEventArg* pThumbnailEventArg = static_cast<ThumbnailEventArg*>(&eventArg);
577 if (pThumbnailEventArg == null)
579 AppLogDebug("EXIT 1(%s)", GetErrorMessage(GetLastResult()));
583 ThumbnailInfo* pThumbnailInfo = pThumbnailEventArg->GetThumbnailInfoN();
584 if (pThumbnailInfo == null)
586 AppLogDebug("EXIT 2(%s)", GetErrorMessage(GetLastResult()));
591 bool isMatch = false;
592 ContentId contentId = pThumbnailInfo->GetContentId();
594 if (__pIconListViewCache != null)
596 IEnumerator* pEnum = __pIconListViewCache->GetEnumeratorN();
597 Bitmap* pBitmap = null;
598 while (pEnum->MoveNext() == E_SUCCESS)
600 ThumbnailInfo* pTempThumbnailInfo = static_cast<ThumbnailInfo*>(pEnum->GetCurrent());
602 if (contentId == pTempThumbnailInfo->GetContentId())
604 AppLogDebug("[CHASEFIRE] PM receive (%ls)", pThumbnailInfo->GetFilePath().GetPointer());
605 pBitmap = pThumbnailInfo->GetBitmapN();
606 pTempThumbnailInfo->SetBitmap(*pBitmap);
609 pTempThumbnailInfo->SetContentType(pThumbnailInfo->GetContentType());
610 pTempThumbnailInfo->SetDuration(pThumbnailInfo->GetDuration());
611 delete pThumbnailInfo;
617 if (isMatch == false)
619 if (SIZE_ICON_LIST_CACHE <= __pIconListViewCache->GetCount())
621 __pIconListViewCache->RemoveAt(0, true);
623 AppLogDebug("[CHASEFIRE] (all:%d) Add Thumbail(%ls)",__pIconListViewCache->GetCount(),
624 pThumbnailInfo->GetFilePath().GetPointer());
625 __pIconListViewCache->Add(pThumbnailInfo);
630 int loopCount = __pContentInfoList->GetCount();
631 for (int i = 0; i < loopCount; ++i)
633 if (contentId == (static_cast<ContentInfo*>(__pContentInfoList->GetAt(i)))->GetContentId())
640 IAlbumEventListener* pInterface = null;
641 IEnumerator* pEventEnum = __pPresentationModelListener->GetEnumeratorN();
642 while (pEventEnum->MoveNext() == E_SUCCESS)
644 pInterface = static_cast<IAlbumEventListener*>(pEventEnum->GetCurrent());
645 pInterface->OnThumbnailDecoded(index);
649 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
653 FileListPresentationModel::OnContentCreated(Tizen::Content::ContentId contentId, Tizen::Content::ContentType contentType, result r)
655 AppLogDebug("ENTER");
656 if (__updateProgressStatus == true)
658 AppLogDebug("EXIT update in application");
661 IFormContentUpdateEventListener* pInterface = null;
662 if (__pContentEventListener == null)
667 IEnumerator* pEventEnum = __pContentEventListener->GetEnumeratorN();
668 while (pEventEnum->MoveNext() == E_SUCCESS)
670 pInterface = static_cast<IFormContentUpdateEventListener*>(pEventEnum->GetCurrent());
671 pInterface->OnContentUpdated();
678 FileListPresentationModel::OnContentUpdated(Tizen::Content::ContentId contentId, Tizen::Content::ContentType contentType, result r)
680 AppLogDebug("ENTER");
681 if (__updateProgressStatus == true)
683 AppLogDebug("EXIT update in application");
686 IFormContentUpdateEventListener* pInterface = null;
687 if (__pContentEventListener == null)
692 IEnumerator* pEventEnum = __pContentEventListener->GetEnumeratorN();
693 while (pEventEnum->MoveNext() == E_SUCCESS)
695 pInterface = static_cast<IFormContentUpdateEventListener*>(pEventEnum->GetCurrent());
696 pInterface->OnContentUpdated();
703 FileListPresentationModel::OnContentDeleted(Tizen::Content::ContentId contentId, Tizen::Content::ContentType contentType, result r)
705 AppLogDebug("ENTER");
706 if (__updateProgressStatus == true)
708 AppLogDebug("EXIT update in application");
711 IFormContentUpdateEventListener* pInterface = null;
712 if (__pContentEventListener == null)
717 IEnumerator* pEventEnum = __pContentEventListener->GetEnumeratorN();
718 while (pEventEnum->MoveNext() == E_SUCCESS)
720 pInterface = static_cast<IFormContentUpdateEventListener*>(pEventEnum->GetCurrent());
721 pInterface->OnContentUpdated();
728 FileListPresentationModel::AddPresentationModelListener(const IAlbumEventListener* listener)
730 AppLogDebug("ENTER");
731 __pPresentationModelListener->Add((Object*)listener);
732 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
736 FileListPresentationModel::RemovePresentationModelListener(const IAlbumEventListener& listener)
738 AppLogDebug("ENTER");
739 __pPresentationModelListener->Remove(listener);
740 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
744 FileListPresentationModel::AddContentEventListener(const IFormContentUpdateEventListener* listener)
746 AppLogDebug("ENTER");
747 if (__pContentEventListener != null)
749 __pContentEventListener->RemoveAll();
750 __pContentEventListener->Add((Object*)listener);
751 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
756 FileListPresentationModel::RemoveContentEventListener(const IFormContentUpdateEventListener* listener)
758 AppLogDebug("ENTER");
759 __pContentEventListener->Remove(*listener);
760 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
764 FileListPresentationModel::GetThumbnailInfoFromInternalBufferN(const ContentId& contentId) const
766 AppLogDebug("ENTER");
767 ThumbnailInfo* pThumbnailInfo = null;
768 ThumbnailInfo* pTempThumbnailInfo = null;
769 if (__pIconListViewCache != null)
771 int loopCount = __pIconListViewCache->GetCount();
772 for (int i = 0 ; i < loopCount; ++i)
774 pTempThumbnailInfo = static_cast<ThumbnailInfo*>(__pIconListViewCache->GetAt(i));
775 if (contentId == pTempThumbnailInfo->GetContentId())
778 pThumbnailInfo = new (std::nothrow) ThumbnailInfo();
779 Bitmap* pBitmap = pTempThumbnailInfo->GetBitmapN();
780 pThumbnailInfo->Construct(pTempThumbnailInfo->GetContentId(),
781 pTempThumbnailInfo->GetFilePath(), *pBitmap,
782 pTempThumbnailInfo->GetContentType(), pTempThumbnailInfo->GetDuration());
788 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
790 return pThumbnailInfo;
794 FileListPresentationModel::DeleteContentFileList(const IList& contentIndexList)
796 AppLogDebug("ENTER");
797 if (&contentIndexList == null || contentIndexList.GetCount() <= 0)
799 AppLogDebug("EXIT 1(%s)", GetErrorMessage(GetLastResult()));
804 IList * pContentIdList = new (std::nothrow) ArrayList(SingleObjectDeleter);
805 int loopCount = contentIndexList.GetCount();
806 for (int i = 0; i < loopCount; ++i)
808 const Integer* pIndex = static_cast<const Integer*>(contentIndexList.GetAt(i));
810 if ((pIndex != null) && (pIndex->ToInt())>=0 && __pContentInfoList->GetCount() > pIndex->ToInt())
812 pContentIdList->Add(new (std::nothrow) ContentId((static_cast<ContentInfo*>
813 (__pContentInfoList->GetAt(pIndex->ToInt())))->GetContentId()));
817 loopCount = pContentIdList->GetCount();
818 for (int i = 0; i < loopCount; ++i)
820 ContentId* pContentId = static_cast<ContentId*>(pContentIdList->GetAt(i));
821 if (pContentId != null)
823 DeleteContentFile(*pContentId);
826 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
832 FileListPresentationModel::GetCollisionIndexListN(const IList& contentIndexList, const String& destDirectory)
834 AppLogDebug("ENTER");
835 if (&contentIndexList == null || contentIndexList.GetCount() <= 0 || &destDirectory == null
836 || destDirectory.IsEmpty() == true)
838 AppLogDebug("EXIT 1(%s)", GetErrorMessage(GetLastResult()));
843 if (File::IsFileExist(destDirectory) == false)
845 AppLogDebug("EXIT 2(%s)", GetErrorMessage(GetLastResult()));
850 IList * pCollisionInfoList = new (std::nothrow) ArrayList(SingleObjectDeleter);
851 ContentInfo* pContentInfo = null;
852 int loopCount = contentIndexList.GetCount();
853 for (int i = 0; i < loopCount; ++i)
855 const Integer* pIndex = static_cast<const Integer*>(contentIndexList.GetAt(i));
857 if ((pIndex != null) && (pIndex->ToInt()) >= 0 && __pContentInfoList->GetCount() > pIndex->ToInt())
859 pContentInfo = const_cast<ContentInfo*>(static_cast<const ContentInfo*>(__pContentInfoList->GetAt(pIndex->ToInt())));
860 String filePath = pContentInfo->GetContentPath();
861 String fileName = GetFileNameFromFullPath(filePath, true);
864 if (destDirectory.EndsWith(DIRECTORY_SEPARATOR) == true)
866 destPath.Append(destDirectory);
867 destPath.Append(fileName);
871 destPath.Append(destDirectory);
872 destPath.Append(DIRECTORY_SEPARATOR);
873 destPath.Append(fileName);
876 if (File::IsFileExist(destPath) == true)
878 pCollisionInfoList->Add(*(new (std::nothrow) String(pIndex->ToString() + MULTI_ITEM_SEPARATOR + fileName)));
882 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
884 return pCollisionInfoList;
888 FileListPresentationModel::MoveToContentFileList(const IList& contentIndexList, const String& destDirectory)
890 AppLogDebug("ENTER");
891 result r = E_SUCCESS;
892 if (&contentIndexList == null || contentIndexList.GetCount() <= 0 || &destDirectory == null || destDirectory.IsEmpty() == true)
894 AppLogDebug("EXIT 1(%s)", GetErrorMessage(GetLastResult()));
899 if (File::IsFileExist(destDirectory) == false)
901 Directory::Create(destDirectory, true);
904 delete __pContentIdList;
905 __pContentIdList = new (std::nothrow) ArrayList(SingleObjectDeleter);
906 int loopCount = contentIndexList.GetCount();
907 for (int i = 0; i < loopCount; ++i)
909 const Integer* pIndex = static_cast<const Integer*>(contentIndexList.GetAt(i));
911 if ((pIndex != null) && (pIndex->ToInt())>=0 && __pContentInfoList->GetCount() > pIndex->ToInt())
913 __pContentIdList->Add(new (std::nothrow) ContentId((static_cast<ContentInfo*>(__pContentInfoList->GetAt(pIndex->ToInt())))->GetContentId()));
918 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
924 FileListPresentationModel::DeleteContentFile(const ContentId& contentId)
926 AppLogDebug("ENTER");
927 if (&contentId == null)
929 AppLogDebug("EXIT 1(%s)", GetErrorMessage(GetLastResult()));
933 result r = __pContentManager->DeleteContent(contentId);
935 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
941 FileListPresentationModel::MoveToContentFile(const ContentId& contentId, const String& destDirectory, const bool isCopyOperation)
943 AppLogDebug("ENTER");
944 if (contentId.ToString().IsEmpty() == true || destDirectory.IsEmpty() == true)
946 AppLogDebug("EXIT 1(%s)", GetErrorMessage(GetLastResult()));
949 result r = E_SUCCESS;
950 ContentInfo* pContentInfo = __pContentManager->GetContentInfoN(contentId);
951 if (pContentInfo == null)
953 AppLogDebug("Santhosh %s", destDirectory.GetPointer());
954 AppLogDebug("EXIT 2(%s)", GetErrorMessage(GetLastResult()));
958 String filePath = pContentInfo->GetContentPath();
959 if (filePath.GetLength() < 4)
961 AppLogDebug("EXIT 3(%s)", GetErrorMessage(GetLastResult()));
966 if (destDirectory.EndsWith(DIRECTORY_SEPARATOR) == true)
968 destPath.Append(destDirectory);
969 destPath.Append(GetFileNameFromFullPath(filePath, true));
973 destPath.Append(destDirectory);
974 destPath.Append(DIRECTORY_SEPARATOR);
975 destPath.Append(GetFileNameFromFullPath(filePath, true));
978 if (destPath.CompareTo(filePath) == 0)
980 AppLogDebug("EXIT 4(%s)", GetErrorMessage(GetLastResult()));
984 if (File::IsFileExist(destPath) == true)
986 File::Remove(destPath);
989 if (pContentInfo->GetContentType() == CONTENT_TYPE_IMAGE)
991 r = File::Copy(filePath, destPath, false);
996 ImageContentInfo contentInfo;
997 r = contentInfo.Construct(&destPath);
1000 __pContentManager->CreateContent(contentInfo);
1001 r = GetLastResult();
1002 TryCatch(!IsFailed(r),,"CreateContent::the value is %s",GetErrorMessage(r));
1003 if (!isCopyOperation)
1005 r = __pContentManager->DeleteContent(contentId);
1006 TryCatch(!IsFailed(r),,"DeleteContent::the value is %s",GetErrorMessage(r));
1012 else if (pContentInfo->GetContentType() == CONTENT_TYPE_VIDEO)
1014 r = File::Copy(filePath, destPath, false);
1017 VideoContentInfo contentInfo;
1018 r = contentInfo.Construct(&destPath);
1020 __pContentManager->CreateContent(contentInfo);
1021 r = GetLastResult();
1022 TryCatch(!IsFailed(r),,"CreateContent::the value is %s",GetErrorMessage(r));
1023 if (!isCopyOperation)
1025 r = __pContentManager->DeleteContent(contentId);
1026 TryCatch(!IsFailed(r),,"DeleteContent::the value is %s",GetErrorMessage(r));
1032 delete pContentInfo;
1034 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
1040 FileListPresentationModel::StartAppControl(const String& providerId, const String& operationId,
1041 const String* pUriData, const Tizen::Base::String* pMimeType, const HashMap* pDataList,
1042 IAppControlResponseListener* pListener)
1044 AppLogDebug("ENTER");
1045 AppControl* pAc = AppManager::FindAppControlN(providerId, operationId);
1048 AppLogDebug("EXIT 1(%s)", GetErrorMessage(GetLastResult()));
1051 result r = pAc->Start(pUriData, pMimeType, pDataList, pListener);
1055 GalleryApp* pGalleryApp = static_cast<GalleryApp*>(GalleryApp::GetInstance());
1056 pGalleryApp->SetFrameEnabled(false);
1061 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
1067 FileListPresentationModel::SetCurrentAlbumInfo(const String& albumName, const IList& directoryList)
1069 AppLogDebug("ENTER");
1071 if (&directoryList != null)
1073 if (__pDirectoryList != null && __pDirectoryList->GetCount() > 0)
1075 bool isMatched = false;
1076 int outterLoopCount = __pDirectoryList->GetCount();
1077 int innerLoopCount = 0;
1078 for (int i = 0; i < outterLoopCount ; ++i)
1081 innerLoopCount = directoryList.GetCount();
1082 for (int j = 0; j < innerLoopCount; ++j)
1084 if (static_cast<String*>(__pDirectoryList->GetAt(i))->CompareTo(
1085 *(const_cast<String*>(static_cast<const String*>(directoryList.GetAt(j))))) == 0)
1093 outterLoopCount = directoryList.GetCount();
1094 for (int i = 0; i < outterLoopCount; ++i)
1097 innerLoopCount = __pDirectoryList->GetCount();
1098 for (int j = 0; j < innerLoopCount; ++j)
1100 if (const_cast<String*>(static_cast<const String*>(directoryList.GetAt(i)))->CompareTo(
1101 *(static_cast<String*>(__pDirectoryList->GetAt(j)))) == 0)
1111 __albumName = albumName;
1113 if (__pDirectoryList != null)
1115 delete __pDirectoryList;
1117 __pDirectoryList = new (std::nothrow) ArrayList(SingleObjectDeleter);
1119 int loopCount = directoryList.GetCount();
1120 for (int i = 0; i < loopCount; ++i)
1122 __pDirectoryList->Add(new (std::nothrow) String(*(const_cast<String*>
1123 (static_cast<const String*>(directoryList.GetAt(i))))));
1126 if (__pContentInfoList != null)
1128 delete __pContentInfoList;
1129 __pContentInfoList = null;
1132 if (GetAppControlMode() == APP_CONTROL_MODE_PICK)
1134 AppControlMediaType appControlMediaType = GetAppControlMediaType();
1135 if (appControlMediaType == APPCONTROL_MEDIA_TYPE_IMAGE)
1137 __albumContentType = CONTENT_TYPE_IMAGE;
1139 else if (appControlMediaType == APPCONTROL_MEDIA_TYPE_VIDEO)
1141 __albumContentType = CONTENT_TYPE_VIDEO;
1144 __pContentInfoList = GetContentInfoListInDirectoryListN(*__pDirectoryList, __albumContentType);
1145 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
1151 FileListPresentationModel::RefreshCurrentAlbumContentInfoList(ContentType contentType)
1153 AppLogDebug("ENTER");
1154 result r = RefreshContentInfoList(contentType);
1155 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
1161 FileListPresentationModel::RefreshContentInfoList(ContentType contentType)
1163 AppLogDebug("ENTER");
1164 if ((contentType != CONTENT_TYPE_ALL) && (contentType != CONTENT_TYPE_IMAGE) && (contentType != CONTENT_TYPE_VIDEO))
1166 AppLogDebug("EXIT 1(%s)", GetErrorMessage(GetLastResult()));
1171 if ((__pDirectoryList == null) || (__pDirectoryList->GetCount() <= 0))
1173 AppLogDebug("EXIT 2(%s)", GetErrorMessage(GetLastResult()));
1178 __albumContentType = contentType;
1180 if (__pContentInfoList != null)
1182 delete __pContentInfoList;
1183 __pContentInfoList = null;
1185 __pContentInfoList = GetContentInfoListInDirectoryListN(*__pDirectoryList, __albumContentType);
1186 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
1192 FileListPresentationModel::GetCurrentAlbumName(void)
1194 AppLogDebug("ENTER");
1195 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
1201 FileListPresentationModel::SetCurrentAlbumName(String& albumName)
1203 AppLogDebug("ENTER");
1204 if (&albumName == null)
1206 __albumName = EMPTY_SPACE;
1210 __albumName = albumName;
1212 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
1216 FileListPresentationModel::GetCurrentAlbumContentType(void)
1218 AppLogDebug("ENTER");
1219 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
1221 return __albumContentType;
1225 FileListPresentationModel::SetCurrentAlbumContentType(ContentType contentType)
1227 AppLogDebug("ENTER");
1228 __albumContentType = contentType;
1229 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
1233 FileListPresentationModel::GetAlbumDirectoryListN(void)
1235 AppLogDebug("ENTER");
1236 IList* pAlbumDirectoryList = new (std::nothrow) ArrayList(SingleObjectDeleter);
1237 if (__pDirectoryList == null)
1239 AppLogDebug("EXIT 1(%s)", GetErrorMessage(GetLastResult()));
1241 return pAlbumDirectoryList;
1244 String* pDirectory = null;
1245 int loopCount = __pDirectoryList->GetCount();
1246 for (int i = 0; i < loopCount; ++i)
1248 pDirectory = static_cast<String*>(__pDirectoryList->GetAt(i));
1249 pAlbumDirectoryList->Add(new (std::nothrow) String(*pDirectory));
1251 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
1253 return pAlbumDirectoryList;
1257 FileListPresentationModel::GetAlbumContentInfoList(void)
1259 AppLogDebug("ENTER");
1260 IList* pContentList = new (std::nothrow) ArrayList(SingleObjectDeleter);
1261 if (__pContentInfoList == null)
1263 AppLogDebug("EXIT 1(%s)", GetErrorMessage(GetLastResult()));
1265 return pContentList;
1268 ContentInfo* pContentInfo = null;
1269 int loopCount = __pContentInfoList->GetCount();
1270 for (int i = 0; i < loopCount; ++i)
1272 pContentInfo = static_cast<ContentInfo*>(__pContentInfoList->GetAt(i));
1273 pContentList->Add(pContentInfo);
1275 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
1277 return pContentList;
1281 FileListPresentationModel::GetContentInfo(int index)
1283 AppLogDebug("ENTER");
1284 if (__pContentInfoList == null || __pContentInfoList->GetCount() == 0)
1286 AppLogDebug("EXIT 1(%s)", GetErrorMessage(GetLastResult()));
1291 if (index < 0 || index >= __pContentInfoList->GetCount())
1293 AppLogDebug("EXIT 2(%s)", GetErrorMessage(GetLastResult()));
1297 ContentInfo* pContentInfo = static_cast<ContentInfo*>(__pContentInfoList->GetAt(index));
1298 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
1300 return pContentInfo;
1304 IList* FileListPresentationModel::GetContentIdListN(const IList& contentInfoList)
1306 IList* pContentIdList = new (std::nothrow) ArrayList(SingleObjectDeleter);
1307 int loopCount = contentInfoList.GetCount();
1308 for (int i = 0; i < loopCount; ++i)
1310 const Integer* pIndex = static_cast<const Integer*>(contentInfoList.GetAt(i));
1312 if ((pIndex != null) && (pIndex->ToInt())>=0 && __pContentInfoList->GetCount() > pIndex->ToInt())
1314 pContentIdList->Add(new (std::nothrow) ContentId((static_cast<ContentInfo*>(__pContentInfoList->GetAt(pIndex->ToInt())))->GetContentId()));
1318 return pContentIdList;
1322 FileListPresentationModel::GetCurrentAlbumContentInfoCount(void)
1324 AppLogDebug("ENTER");
1325 if (__pContentInfoList == null)
1327 AppLogDebug("EXIT 1(%s)", GetErrorMessage(GetLastResult()));
1331 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
1333 return __pContentInfoList->GetCount();
1337 FileListPresentationModel::GetContentInfoIndex(int index)
1339 AppLogDebug("ENTER");
1340 if (__pContentInfoList == null || __pContentInfoList->GetCount() == 0)
1342 AppLogDebug("EXIT 1(%s)", GetErrorMessage(GetLastResult()));
1347 if (index < 0 || index >= __pContentInfoList->GetCount())
1349 AppLogDebug("EXIT 2(%s)", GetErrorMessage(GetLastResult()));
1353 ContentInfo* pContentInfo = static_cast<ContentInfo*>(__pContentInfoList->GetAt(index));
1354 ContentId contentId = pContentInfo->GetContentId();
1355 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
1361 FileListPresentationModel::GetContentFilePath(int index)
1363 AppLogDebug("ENTER index(%d)", index);
1364 if (__pContentInfoList == null || __pContentInfoList->GetCount() == 0)
1366 AppLogDebug("EXIT 1(%s)", GetErrorMessage(GetLastResult()));
1371 if (index < 0 || index >= __pContentInfoList->GetCount())
1373 AppLogDebug("EXIT 2(%s)", GetErrorMessage(GetLastResult()));
1378 ContentInfo* pContentInfo = static_cast<ContentInfo*>(__pContentInfoList->GetAt(index));
1379 String contentPath = pContentInfo->GetContentPath();
1380 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
1386 FileListPresentationModel::CoverVideoOverlayedImageOnThumbnailN(Bitmap& thumbnail,
1387 const ThumbnailInfo& thumbmailInfo)
1389 AppLogDebug("ENTER");
1390 Bitmap* overlayedImage = null;
1392 if (&thumbmailInfo != null)
1394 long duration = thumbmailInfo.GetDuration();
1397 if (&thumbnail != null)
1399 BufferInfo bufferInfo;
1400 thumbnail.Lock(bufferInfo, INFINITE);
1402 mainCanvas.Construct(bufferInfo);
1406 Rectangle mainRect(0, 0, W_DEFAULT_THUMBNAIL, H_DEFAULT_THUMBNAIL);
1407 mainCanvas.Construct(mainRect);
1408 mainCanvas.FillRectangle(Color::GetColor(COLOR_ID_BLACK), mainRect);
1411 Rectangle playRect(GAP_W_PLAY_FG, GAP_H_PLAY_FG, W_PLAY_FG, H_PLAY_FG);
1412 Bitmap* playBitmap = ResourceManager::GetBitmapN(IDB_VIDEOTHUMBNAIL_PLAY);
1413 if (playBitmap != null)
1415 mainCanvas.DrawBitmap(playRect, *playBitmap);
1420 Rectangle durSize(0, 0, W_DURATION, H_DURATION);
1421 Rectangle durRect(0, GAP_H_DURATION, W_DURATION, H_DURATION);
1422 Color durColor(COLOR_DURATION_BG);
1423 durColor.SetAlpha(ALPHA_DURATION);
1424 durCanvas.Construct(durSize);
1425 durCanvas.FillRectangle(durColor, durSize);
1427 durFont.Construct(FONT_STYLE_PLAIN, FONT_SIZE_DURATION);
1428 durCanvas.SetFont(durFont);
1429 durCanvas.DrawText(Point(W_DURATION_TEXT, H_DURATION_TEXT), CommonUtil::DurationToTimeString(duration), COLOR_TEXT_OUTLINE);
1431 durBitmap.Construct(durCanvas,durCanvas.GetBounds());
1432 mainCanvas.DrawBitmap(durRect,durBitmap);
1434 overlayedImage = new (std::nothrow) Bitmap();
1435 overlayedImage->Construct(mainCanvas,mainCanvas.GetBounds());
1437 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
1439 return overlayedImage;
1443 FileListPresentationModel::GetShadedBackgroundBitmapN(Bitmap& bgBitmap,
1444 const Bitmap& orgBitmap,
1445 const Rectangle& orgBitmapPosition)
1447 AppLogDebug("ENTER");
1448 if (&orgBitmap == null || &orgBitmap == null)
1450 AppLogDebug("EXIT 1(%s)", GetErrorMessage(GetLastResult()));
1455 BufferInfo bufferInfo;
1456 bgBitmap.Lock(bufferInfo, INFINITE);
1459 mainCanvas.Construct(bufferInfo);
1461 mainCanvas.DrawBitmap(orgBitmapPosition, orgBitmap);
1463 Bitmap* pMainImage = new (std::nothrow) Bitmap();
1464 pMainImage->Construct(mainCanvas,mainCanvas.GetBounds());
1465 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
1471 FileListPresentationModel::GetContentInfoListInDirectoryListN(const IList& contentDirectoryList,
1472 ContentType contentType)const
1474 AppLogDebug("ENTER");
1475 IList* pContentList = new (std::nothrow) ArrayList(SingleObjectDeleter);
1477 if ((&contentDirectoryList == null) || (contentDirectoryList.GetCount() == 0)
1478 || ((contentType != CONTENT_TYPE_IMAGE) && (contentType != CONTENT_TYPE_VIDEO) && (contentType != CONTENT_TYPE_ALL)))
1480 AppLogDebug("EXIT 1(%s)", GetErrorMessage(GetLastResult()));
1481 return pContentList;
1484 ContentDirectory contentDirectory;
1485 IListT<ContentType>* pContentTypeList = new (std::nothrow) ArrayListT<ContentType>();
1486 if (contentType == CONTENT_TYPE_IMAGE || contentType == CONTENT_TYPE_ALL)
1488 pContentTypeList->Add(CONTENT_TYPE_IMAGE);
1490 if (contentType == CONTENT_TYPE_VIDEO || contentType == CONTENT_TYPE_ALL)
1492 pContentTypeList->Add(CONTENT_TYPE_VIDEO);
1494 result r = contentDirectory.Construct(*pContentTypeList);
1495 delete pContentTypeList;
1499 int pageNo = SIZE_PAGE_NO;
1500 int countPerPage = SIZE_CONUNT_PER_PAGE;
1501 String* pContentDirectory = null;
1503 int loopCount = contentDirectoryList.GetCount();
1504 for (int i = 0; i < loopCount; ++i)
1506 IList* pIList = null;
1507 pContentDirectory = const_cast<String*>(static_cast<const String*>(contentDirectoryList.GetAt(i)));
1508 if (pContentDirectory != null)
1510 pIList = contentDirectory.GetContentDirectoryItemListN(*pContentDirectory, pageNo, countPerPage,
1511 CONTENT_INFO_ORDER, SORT_ORDER_NONE);
1515 pContentList->AddItems(*pIList);
1524 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
1526 return pContentList;
1530 FileListPresentationModel::ConvertToAlbumName(const String& targetPath)const
1532 AppLogDebug("ENTER");
1534 if (&targetPath == null || targetPath.GetLength() == 0)
1539 if (targetPath == RESERVED_CAMERA_PATH || targetPath == RESERVED_CAMERA_PATH_EXT)
1541 albumName = ResourceManager::GetString(L"IDS_MEDIABR_BODY_CAMERA_ROLL_ABB");
1543 else if (targetPath == RESERVED_DOWNLOAD_PATH)
1545 albumName = ResourceManager::GetString(L"IDS_COM_BODY_DOWNLOADS");
1549 String directoryName = GetDirecotyNameFromFullPath(targetPath);
1550 albumName = directoryName;
1557 FileListPresentationModel::GetAppControlMode(void) const
1559 AppLogDebug("Enter");
1560 AppLogDebug("Exit");
1562 return __appControlMode;
1566 FileListPresentationModel::GetAppControlMediaType(void) const
1568 AppLogDebug("Enter");
1569 AppLogDebug("Exit");
1571 return __appControlMediaType;
1574 AppControlSelectionMode
1575 FileListPresentationModel::GetAppControlSelectionMode(void) const
1577 AppLogDebug("Enter");
1578 AppLogDebug("Exit");
1580 return __appControlSelectionMode;
1584 FileListPresentationModel::SetUpdateProgressStatus(bool status)
1586 AppLogDebug("ENTER status = %d",status);
1587 __updateProgressStatus = status;
1588 AppLogDebug("EXIT");