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_UNKNOWN)
88 , __appControlSelectionMode(APPCONTROL_SELECTION_MODE_SINGLE)
91 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
94 FileListPresentationModel::~FileListPresentationModel(void)
97 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
100 FileListPresentationModel*
101 FileListPresentationModel::GetInstance(void)
103 AppLogDebug("ENTER");
104 if (__pPresentationModelInstance == null)
108 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
110 return __pPresentationModelInstance;
114 FileListPresentationModel::Construct(void)
116 AppLogDebug("ENTER");
118 IThumbnailEventListener* pThumbnailEventListener = static_cast<IThumbnailEventListener*>(this);
119 __pThumbnailEvent = new (std::nothrow) ThumbnailEvent();
120 __pThumbnailEvent->AddListener(*pThumbnailEventListener, true);
122 ContentUpdateEventListener::GetInstance();
123 __pContentManager = new (std::nothrow) ContentManager();
124 __pContentManager->Construct();
126 if (__pIconListViewCache != null)
128 delete __pIconListViewCache;
130 __pIconListViewCache = new (std::nothrow) ArrayList(SingleObjectDeleter);
131 __pIconListViewCache->Construct(SIZE_ICON_LIST_CACHE);
133 if (__pDirectoryList != null)
135 delete __pDirectoryList;
137 __pDirectoryList = new (std::nothrow) ArrayList(SingleObjectDeleter);
139 if (__pContentInfoList != null)
141 delete __pContentInfoList;
143 __pContentInfoList = new (std::nothrow) ArrayList(SingleObjectDeleter);
145 __pPresentationModelListener = new (std::nothrow) ArrayList();
146 __pPresentationModelListener->Construct();
148 __pContentEventListener = new (std::nothrow) ArrayList();
149 __pContentEventListener->Construct();
151 __pThumbnailProvider = ThumbnailProvider::GetInstance();
153 GalleryApp* pApp = static_cast<GalleryApp*>(GalleryApp::GetInstance());
154 const IMap* pArguments = pApp->GetAppControlArguments();
155 String operationId = pApp->GetAppControlOperationId();
157 if (operationId.CompareTo(APPCONTROL_OPERATION_ID_MAIN) == 0)
159 __appControlMode = APP_CONTROL_MODE_MAIN;
161 else if (operationId.CompareTo(APPCONTROL_OPERATION_ID_PICK) == 0)
163 __appControlMode = APP_CONTROL_MODE_PICK;
165 if (pArguments != null)
167 const String* selectionMode = static_cast<const String*>(pArguments->GetValue(String(APPCONTROL_KEY_SELECTION_MODE)));
168 const String* mediaType = static_cast<const String*>(pArguments->GetValue(String(APPCONTROL_KEY_MEDIA_TYPE)));
170 if (mediaType != null && mediaType->CompareTo(APPCONTROL_DATA_VIDEO) == 0)
172 __appControlMediaType = APPCONTROL_MEDIA_TYPE_VIDEO;
176 __appControlMediaType = APPCONTROL_MEDIA_TYPE_IMAGE;
179 if (selectionMode != null && selectionMode->CompareTo(APPCONTROL_DATA_MULTIPLE) == 0)
181 __appControlSelectionMode = APPCONTROL_SELECTION_MODE_MULTIPLE;
185 else if (operationId.CompareTo(APPCONTROL_OPERATION_ID_CONFIGURE) == 0)
187 __appControlMode = APP_CONTROL_MODE_SETTING;
190 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
196 FileListPresentationModel::CreateInstance(void)
198 AppLogDebug("ENTER");
199 __pPresentationModelInstance = new (std::nothrow) FileListPresentationModel();
200 result r = __pPresentationModelInstance->Construct();
201 if (IsFailed(r) == true)
203 delete __pPresentationModelInstance;
204 __pPresentationModelInstance = null;
205 AppLogDebug("EXIT 1(%s)", GetErrorMessage(GetLastResult()));
210 std::atexit(DestroyInstance);
211 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
215 FileListPresentationModel::DestroyInstance(void)
217 AppLogDebug("ENTER");
219 delete __pThumbnailEvent;
220 __pIconListViewCache = null;
222 if (__pIconListViewCache != null)
224 delete __pIconListViewCache;
225 __pIconListViewCache = null;
228 if (__pDirectoryList != null)
230 delete __pDirectoryList;
231 __pDirectoryList = null;
234 if (__pContentInfoList != null)
236 delete __pContentInfoList;
237 __pContentInfoList = null;
240 if (__pPresentationModelListener != null)
242 delete __pPresentationModelListener;
243 __pPresentationModelListener = null;
246 if (__pContentEventListener != null)
248 delete __pContentEventListener;
249 __pContentEventListener = null;
252 delete __pPresentationModelInstance;
253 __pPresentationModelInstance = null;
255 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
259 FileListPresentationModel::GetFileNameFromFullPath(const String& fullPath, bool withExt) const
261 AppLogDebug("ENTER");
262 if (fullPath.CompareTo(EMPTY_SPACE) == 0)
264 AppLogDebug("EXIT 1(%s)", GetErrorMessage(GetLastResult()));
269 String delim(DIRECTORY_SEPARATOR);
270 StringTokenizer st(fullPath,delim);
272 while (st.HasMoreTokens())
274 st.GetNextToken(token);
279 AppLogDebug("EXIT 2(%s)", GetErrorMessage(GetLastResult()));
285 String subDelim(FILE_EXT_SEPARATOR);
286 StringTokenizer subSt(token, subDelim);
288 subSt.GetNextToken(subToken);
289 AppLogDebug("EXIT 3(%s)", GetErrorMessage(GetLastResult()));
296 FileListPresentationModel::GetDirecotyNameFromFullPath(const String& fullPath)const
298 AppLogDebug("ENTER");
299 if (fullPath == null)
301 AppLogDebug("EXIT 1(%s)", GetErrorMessage(GetLastResult()));
305 String delim(DIRECTORY_SEPARATOR);
306 StringTokenizer st(fullPath,delim);
308 while (st.HasMoreTokens())
310 st.GetNextToken(token);
312 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
318 FileListPresentationModel::IsContainContentInDirectory(const String& directoryPath, ContentType contentType) const
320 AppLogDebug("ENTER");
321 IListT<ContentType>* pContentTypeList = new (std::nothrow) ArrayListT<ContentType>();
322 if (&directoryPath == null || pContentTypeList == null)
324 AppLogDebug("EXIT 1(%s)", GetErrorMessage(GetLastResult()));
329 if (contentType == CONTENT_TYPE_IMAGE || contentType == CONTENT_TYPE_ALL)
331 pContentTypeList->Add(CONTENT_TYPE_IMAGE);
333 if (contentType == CONTENT_TYPE_VIDEO || contentType == CONTENT_TYPE_ALL)
335 pContentTypeList->Add(CONTENT_TYPE_VIDEO);
338 ContentDirectory contentDirectory;
339 result r = contentDirectory.Construct(*pContentTypeList);
340 if (pContentTypeList != null)
342 delete pContentTypeList;
344 TryReturn(r == E_SUCCESS, false, "[%s] Unable to construct ContentDirectory", GetErrorMessage(r));
346 bool returnValue = false;
347 int pageNo = SIZE_PAGE_NO;
348 int countPerPage = SIZE_CONUNT_PER_PAGE;
350 IList* pContentList = contentDirectory.GetContentDirectoryItemListN(directoryPath, pageNo, countPerPage,
351 CONTENT_INFO_ORDER, SORT_ORDER_ASCENDING);
353 if (pContentList == null || pContentList->GetCount() <= 0)
362 if (pContentList != null)
366 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
372 FileListPresentationModel::GetThumbnailInSyncCacheN(const int index, String*& pName, Bitmap*& pThumbnail)
374 AppLogDebug("ENTER : index(%d)", index);
375 Bitmap* pOrgBitmap = null;
376 Bitmap* pDstBitmap = null;
377 ContentInfo* pContentInfo = null;
379 if (__pContentInfoList != null && index < __pContentInfoList->GetCount())
381 pContentInfo = static_cast<ContentInfo*>(__pContentInfoList->GetAt(index));
382 if (pContentInfo == null)
384 AppLogDebug("EXIT 1(%s)", GetErrorMessage(GetLastResult()));
391 AppLogDebug("EXIT 2 __pContentInfoList(%x) index(%d)", __pContentInfoList, index);
395 ThumbnailInfo* pThumbnailInfo = GetThumbnailInfoFromInternalBufferN(pContentInfo->GetContentId());
396 if (pThumbnailInfo != null)
398 pName = new (std::nothrow) String(pThumbnailInfo->GetFilePath());
399 pOrgBitmap = pThumbnailInfo->GetBitmapN();
402 if ((pThumbnailInfo != null)&&(pThumbnailInfo->GetContentType() == CONTENT_TYPE_VIDEO))
404 if (pOrgBitmap != null)
406 pDstBitmap = CoverVideoOverlayedImageOnThumbnailN(*pOrgBitmap, *pThumbnailInfo);
412 pDstBitmap = pOrgBitmap;
415 if (pDstBitmap != null)
417 Bitmap* pThumbnailBgBitmap = ResourceManager::GetBitmapN(IDB_VIDEOTHUMBNAIL_BG);
418 Rectangle thumbnailRect(RECTANGLE_THUMBNAIL_OFFSET_POSION);
419 pDstBitmap->Scale(Dimension(RECTANGLE_THUMBNAIL_OFFSET_POSION.width - RECTANGLE_THUMBNAIL_OFFSET_POSION.x
420 , RECTANGLE_THUMBNAIL_OFFSET_POSION.height - RECTANGLE_THUMBNAIL_OFFSET_POSION.y));
421 if (pThumbnailBgBitmap != null)
423 pThumbnailBgBitmap->Scale(DIMENSION_REAL_ICON);
424 pThumbnail = GetShadedBackgroundBitmapN(*pThumbnailBgBitmap, *pDstBitmap, thumbnailRect);
425 delete pThumbnailBgBitmap;
430 pThumbnail = pDstBitmap;
438 if (pThumbnailInfo != null)
440 delete pThumbnailInfo;
442 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
448 FileListPresentationModel::GetThumbnailVideoInSyncCacheN(const int index, String*& pName, Bitmap*& pThumbnail, String*& pDuration)
450 AppLogDebug("ENTER : index(%d)", index);
451 ContentInfo* pContentInfo = null;
452 Bitmap* pOrgBitmap = null;
454 if (__pContentInfoList != null && index < __pContentInfoList->GetCount())
456 pContentInfo = static_cast<ContentInfo*>(__pContentInfoList->GetAt(index));
457 if (pContentInfo == null)
459 AppLogDebug("EXIT 1(%s)", GetErrorMessage(GetLastResult()));
465 AppLogDebug("EXIT 2 __pContentInfoList(%x) index(%d)", __pContentInfoList, index);
469 ThumbnailInfo* pThumbnailInfo = GetThumbnailInfoFromInternalBufferN(pContentInfo->GetContentId());
470 if (pThumbnailInfo != null)
472 pName = new (std::nothrow) String(pThumbnailInfo->GetFilePath());
473 pOrgBitmap = pThumbnailInfo->GetBitmapN();
474 pDuration = new (std::nothrow) String(CommonUtil::DurationToTimeString(pThumbnailInfo->GetDuration()));
478 pName = new (std::nothrow) String(EMPTY_SPACE);
479 pDuration = new (std::nothrow) String(CommonUtil::DurationToTimeString(0));
482 if (pOrgBitmap != null)
484 Bitmap* pThumbnailBgBitmap = ResourceManager::GetBitmapN(IDB_VIDEOTHUMBNAIL_BG);
485 Rectangle thumbnailRect(RECTANGLE_VIDEO_THUMBNAIL_OFFSET_POSION);
486 pOrgBitmap->Scale(Dimension(RECTANGLE_VIDEO_THUMBNAIL_OFFSET_POSION.width - RECTANGLE_VIDEO_THUMBNAIL_OFFSET_POSION.x
487 , RECTANGLE_VIDEO_THUMBNAIL_OFFSET_POSION.height - RECTANGLE_VIDEO_THUMBNAIL_OFFSET_POSION.y));
488 if (pThumbnailBgBitmap != null)
490 pThumbnailBgBitmap->Scale(Dimension(W_WIDE_THUMBNAIL, H_WIDE_THUMBNAIL));
491 pThumbnail = GetShadedBackgroundBitmapN(*pThumbnailBgBitmap, *pOrgBitmap, thumbnailRect);
492 delete pThumbnailBgBitmap;
501 if (pThumbnail != null)
503 pThumbnail->Scale(Dimension(W_WIDE_THUMBNAIL, H_WIDE_THUMBNAIL));
506 if (pThumbnailInfo != null)
508 delete pThumbnailInfo;
510 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
516 FileListPresentationModel::RequestThumbnail(const int index)
518 AppLogDebug("ENTER : index(%d)", index);
519 ContentInfo* pContentInfo = null;
521 if (__pContentInfoList != null && index < __pContentInfoList->GetCount())
523 pContentInfo = static_cast<ContentInfo*>(__pContentInfoList->GetAt(index));
524 if (pContentInfo == null)
526 AppLogDebug("EXIT 1(%s)", GetErrorMessage(GetLastResult()));
532 AppLogDebug("EXIT 2 __pContentInfoList(%x) index(%d)", __pContentInfoList, index);
537 __pThumbnailProvider->RequestThumbnail(pContentInfo->GetContentId(), __pThumbnailEvent);
542 FileListPresentationModel::CancelThumbnailRequest(const int index)
544 AppLogDebug("ENTER : index(%d)", index);
545 /*ContentInfo* pContentInfo = null;
547 if (__pContentInfoList != null && index < __pContentInfoList->GetCount())
549 pContentInfo = static_cast<ContentInfo*>(__pContentInfoList->GetAt(index));
550 if (pContentInfo == null)
552 AppLogDebug("EXIT 1(%s)", GetErrorMessage(GetLastResult()));
555 __pThumbnailProvider->CancelThumbnailRequest(pContentInfo->GetContentId(), __pThumbnailEvent);
561 FileListPresentationModel::ClearThumbnailRequests(bool appTerminating)
563 AppLogDebug("ENTER");
565 if (__pThumbnailProvider != null)
567 __pThumbnailProvider->ClearThumbnailRequests(appTerminating);
574 FileListPresentationModel::OnThumbnailReceivedN(IEventArg& eventArg)
576 AppLogDebug("ENTER");
578 if (&eventArg != null)
580 ThumbnailEventArg* pThumbnailEventArg = static_cast<ThumbnailEventArg*>(&eventArg);
581 if (pThumbnailEventArg == null)
583 AppLogDebug("EXIT 1(%s)", GetErrorMessage(GetLastResult()));
587 ThumbnailInfo* pThumbnailInfo = pThumbnailEventArg->GetThumbnailInfoN();
588 if (pThumbnailInfo == null)
590 AppLogDebug("EXIT 2(%s)", GetErrorMessage(GetLastResult()));
595 bool isMatch = false;
596 ContentId contentId = pThumbnailInfo->GetContentId();
598 if (__pIconListViewCache != null)
600 IEnumerator* pEnum = __pIconListViewCache->GetEnumeratorN();
601 Bitmap* pBitmap = null;
602 while (pEnum->MoveNext() == E_SUCCESS)
604 ThumbnailInfo* pTempThumbnailInfo = static_cast<ThumbnailInfo*>(pEnum->GetCurrent());
606 if (contentId == pTempThumbnailInfo->GetContentId())
608 AppLogDebug("[CHASEFIRE] PM receive (%ls)", pThumbnailInfo->GetFilePath().GetPointer());
609 pBitmap = pThumbnailInfo->GetBitmapN();
610 pTempThumbnailInfo->SetBitmap(*pBitmap);
613 pTempThumbnailInfo->SetContentType(pThumbnailInfo->GetContentType());
614 pTempThumbnailInfo->SetDuration(pThumbnailInfo->GetDuration());
615 delete pThumbnailInfo;
621 if (isMatch == false)
623 if (SIZE_ICON_LIST_CACHE <= __pIconListViewCache->GetCount())
625 __pIconListViewCache->RemoveAt(0, true);
627 AppLogDebug("[CHASEFIRE] (all:%d) Add Thumbail(%ls)",__pIconListViewCache->GetCount(),
628 pThumbnailInfo->GetFilePath().GetPointer());
629 __pIconListViewCache->Add(pThumbnailInfo);
634 int loopCount = __pContentInfoList->GetCount();
635 for (int i = 0; i < loopCount; ++i)
637 if (contentId == (static_cast<ContentInfo*>(__pContentInfoList->GetAt(i)))->GetContentId())
644 IAlbumEventListener* pInterface = null;
645 IEnumerator* pEventEnum = __pPresentationModelListener->GetEnumeratorN();
646 while (pEventEnum->MoveNext() == E_SUCCESS)
648 pInterface = static_cast<IAlbumEventListener*>(pEventEnum->GetCurrent());
649 pInterface->OnThumbnailDecoded(index);
653 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
657 FileListPresentationModel::OnContentCreated(Tizen::Content::ContentId contentId, Tizen::Content::ContentType contentType, result r)
659 AppLogDebug("ENTER");
660 IFormContentUpdateEventListener* pInterface = null;
661 if (__pContentEventListener == null)
666 IEnumerator* pEventEnum = __pContentEventListener->GetEnumeratorN();
667 while (pEventEnum->MoveNext() == E_SUCCESS)
669 pInterface = static_cast<IFormContentUpdateEventListener*>(pEventEnum->GetCurrent());
670 pInterface->OnContentUpdated();
677 FileListPresentationModel::OnContentUpdated(Tizen::Content::ContentId contentId, Tizen::Content::ContentType contentType, result r)
679 AppLogDebug("ENTER");
680 IFormContentUpdateEventListener* pInterface = null;
681 if (__pContentEventListener == null)
686 IEnumerator* pEventEnum = __pContentEventListener->GetEnumeratorN();
687 while (pEventEnum->MoveNext() == E_SUCCESS)
689 pInterface = static_cast<IFormContentUpdateEventListener*>(pEventEnum->GetCurrent());
690 pInterface->OnContentUpdated();
697 FileListPresentationModel::OnContentDeleted(Tizen::Content::ContentId contentId, Tizen::Content::ContentType contentType, result r)
699 AppLogDebug("ENTER");
700 IFormContentUpdateEventListener* pInterface = null;
701 if (__pContentEventListener == null)
706 IEnumerator* pEventEnum = __pContentEventListener->GetEnumeratorN();
707 while (pEventEnum->MoveNext() == E_SUCCESS)
709 pInterface = static_cast<IFormContentUpdateEventListener*>(pEventEnum->GetCurrent());
710 pInterface->OnContentUpdated();
717 FileListPresentationModel::AddPresentationModelListener(const IAlbumEventListener* listener)
719 AppLogDebug("ENTER");
720 __pPresentationModelListener->Add((Object*)listener);
721 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
725 FileListPresentationModel::RemovePresentationModelListener(const IAlbumEventListener& listener)
727 AppLogDebug("ENTER");
728 __pPresentationModelListener->Remove(listener);
729 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
733 FileListPresentationModel::AddContentEventListener(const IFormContentUpdateEventListener* listener)
735 AppLogDebug("ENTER");
736 if (__pContentEventListener != null)
738 __pContentEventListener->RemoveAll();
739 __pContentEventListener->Add((Object*)listener);
740 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
745 FileListPresentationModel::RemoveContentEventListener(const IFormContentUpdateEventListener* listener)
747 AppLogDebug("ENTER");
748 __pContentEventListener->Remove(*listener);
749 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
753 FileListPresentationModel::GetThumbnailInfoFromInternalBufferN(const ContentId& contentId) const
755 AppLogDebug("ENTER");
756 ThumbnailInfo* pThumbnailInfo = null;
757 ThumbnailInfo* pTempThumbnailInfo = null;
758 if (__pIconListViewCache != null)
760 int loopCount = __pIconListViewCache->GetCount();
761 for (int i = 0 ; i < loopCount; ++i)
763 pTempThumbnailInfo = static_cast<ThumbnailInfo*>(__pIconListViewCache->GetAt(i));
764 if (contentId == pTempThumbnailInfo->GetContentId())
767 pThumbnailInfo = new (std::nothrow) ThumbnailInfo();
768 Bitmap* pBitmap = pTempThumbnailInfo->GetBitmapN();
769 pThumbnailInfo->Construct(pTempThumbnailInfo->GetContentId(),
770 pTempThumbnailInfo->GetFilePath(), *pBitmap,
771 pTempThumbnailInfo->GetContentType(), pTempThumbnailInfo->GetDuration());
777 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
779 return pThumbnailInfo;
783 FileListPresentationModel::DeleteContentFileList(const IList& contentIndexList)
785 AppLogDebug("ENTER");
786 if (&contentIndexList == null || contentIndexList.GetCount() <= 0)
788 AppLogDebug("EXIT 1(%s)", GetErrorMessage(GetLastResult()));
793 IList * pContentIdList = new (std::nothrow) ArrayList(SingleObjectDeleter);
794 int loopCount = contentIndexList.GetCount();
795 for (int i = 0; i < loopCount; ++i)
797 const Integer* pIndex = static_cast<const Integer*>(contentIndexList.GetAt(i));
799 if ((pIndex != null) && (pIndex->ToInt())>=0 && __pContentInfoList->GetCount() > pIndex->ToInt())
801 pContentIdList->Add(new (std::nothrow) ContentId((static_cast<ContentInfo*>
802 (__pContentInfoList->GetAt(pIndex->ToInt())))->GetContentId()));
806 loopCount = pContentIdList->GetCount();
807 for (int i = 0; i < loopCount; ++i)
809 ContentId* pContentId = static_cast<ContentId*>(pContentIdList->GetAt(i));
810 if (pContentId != null)
812 DeleteContentFile(*pContentId);
815 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
821 FileListPresentationModel::GetCollisionIndexListN(const IList& contentIndexList, const String& destDirectory)
823 AppLogDebug("ENTER");
824 if (&contentIndexList == null || contentIndexList.GetCount() <= 0 || &destDirectory == null
825 || destDirectory.IsEmpty() == true)
827 AppLogDebug("EXIT 1(%s)", GetErrorMessage(GetLastResult()));
832 if (File::IsFileExist(destDirectory) == false)
834 AppLogDebug("EXIT 2(%s)", GetErrorMessage(GetLastResult()));
839 IList * pCollisionInfoList = new (std::nothrow) ArrayList(SingleObjectDeleter);
840 ContentInfo* pContentInfo = null;
841 int loopCount = contentIndexList.GetCount();
842 for (int i = 0; i < loopCount; ++i)
844 const Integer* pIndex = static_cast<const Integer*>(contentIndexList.GetAt(i));
846 if ((pIndex != null) && (pIndex->ToInt()) >= 0 && __pContentInfoList->GetCount() > pIndex->ToInt())
848 pContentInfo = const_cast<ContentInfo*>(static_cast<const ContentInfo*>(__pContentInfoList->GetAt(pIndex->ToInt())));
849 String filePath = pContentInfo->GetContentPath();
850 String fileName = GetFileNameFromFullPath(filePath, true);
853 if (destDirectory.EndsWith(DIRECTORY_SEPARATOR) == true)
855 destPath.Append(destDirectory);
856 destPath.Append(fileName);
860 destPath.Append(destDirectory);
861 destPath.Append(DIRECTORY_SEPARATOR);
862 destPath.Append(fileName);
865 if (File::IsFileExist(destPath) == true)
867 pCollisionInfoList->Add(*(new (std::nothrow) String(pIndex->ToString() + MULTI_ITEM_SEPARATOR + fileName)));
871 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
873 return pCollisionInfoList;
877 FileListPresentationModel::MoveToContentFileList(const IList& contentIndexList, const String& destDirectory)
879 AppLogDebug("ENTER");
880 result r = E_SUCCESS;
881 if (&contentIndexList == null || contentIndexList.GetCount() <= 0 || &destDirectory == null || destDirectory.IsEmpty() == true)
883 AppLogDebug("EXIT 1(%s)", GetErrorMessage(GetLastResult()));
888 if (File::IsFileExist(destDirectory) == false)
890 Directory::Create(destDirectory, true);
893 delete __pContentIdList;
894 __pContentIdList = new (std::nothrow) ArrayList(SingleObjectDeleter);
895 int loopCount = contentIndexList.GetCount();
896 for (int i = 0; i < loopCount; ++i)
898 const Integer* pIndex = static_cast<const Integer*>(contentIndexList.GetAt(i));
900 if ((pIndex != null) && (pIndex->ToInt())>=0 && __pContentInfoList->GetCount() > pIndex->ToInt())
902 __pContentIdList->Add(new (std::nothrow) ContentId((static_cast<ContentInfo*>(__pContentInfoList->GetAt(pIndex->ToInt())))->GetContentId()));
907 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
913 FileListPresentationModel::DeleteContentFile(const ContentId& contentId)
915 AppLogDebug("ENTER");
916 if (&contentId == null)
918 AppLogDebug("EXIT 1(%s)", GetErrorMessage(GetLastResult()));
922 result r = __pContentManager->DeleteContent(contentId);
924 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
930 FileListPresentationModel::MoveToContentFile(const ContentId& contentId, const String& destDirectory)
932 AppLogDebug("ENTER");
933 if (contentId.ToString().IsEmpty() == true || destDirectory.IsEmpty() == true)
935 AppLogDebug("EXIT 1(%s)", GetErrorMessage(GetLastResult()));
938 result r = E_SUCCESS;
939 ContentInfo* pContentInfo = __pContentManager->GetContentInfoN(contentId);
940 if (pContentInfo == null)
942 AppLogDebug("Santhosh %s", destDirectory.GetPointer());
943 AppLogDebug("EXIT 2(%s)", GetErrorMessage(GetLastResult()));
947 String filePath = pContentInfo->GetContentPath();
948 if (filePath.GetLength() < 4)
950 AppLogDebug("EXIT 3(%s)", GetErrorMessage(GetLastResult()));
955 if (destDirectory.EndsWith(DIRECTORY_SEPARATOR) == true)
957 destPath.Append(destDirectory);
958 destPath.Append(GetFileNameFromFullPath(filePath, true));
962 destPath.Append(destDirectory);
963 destPath.Append(DIRECTORY_SEPARATOR);
964 destPath.Append(GetFileNameFromFullPath(filePath, true));
967 if (destPath.CompareTo(filePath) == 0)
969 AppLogDebug("EXIT 4(%s)", GetErrorMessage(GetLastResult()));
973 if (File::IsFileExist(destPath) == true)
975 File::Remove(destPath);
978 if (pContentInfo->GetContentType() == CONTENT_TYPE_IMAGE)
980 r = File::Copy(filePath, destPath, false);
985 ImageContentInfo contentInfo;
986 r = contentInfo.Construct(&destPath);
989 __pContentManager->CreateContent(contentInfo);
991 TryCatch(!IsFailed(r),,"CreateContent::the value is %s",GetErrorMessage(r));
992 r = __pContentManager->DeleteContent(contentId);
993 TryCatch(!IsFailed(r),,"DeleteContent::the value is %s",GetErrorMessage(r));
998 else if (pContentInfo->GetContentType() == CONTENT_TYPE_VIDEO)
1000 r = File::Copy(filePath, destPath, false);
1003 VideoContentInfo contentInfo;
1004 r = contentInfo.Construct(&destPath);
1006 __pContentManager->CreateContent(contentInfo);
1007 r = GetLastResult();
1008 TryCatch(!IsFailed(r),,"CreateContent::the value is %s",GetErrorMessage(r));
1009 r = __pContentManager->DeleteContent(contentId);
1010 TryCatch(!IsFailed(r),,"DeleteContent::the value is %s",GetErrorMessage(r));
1015 delete pContentInfo;
1017 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
1023 FileListPresentationModel::StartAppControl(const String& providerId, const String& operationId,
1024 const IMap* pDataList, IAppControlResponseListener* pListener)
1026 AppLogDebug("ENTER");
1027 AppControl* pAc = AppManager::FindAppControlN(providerId, operationId);
1030 AppLogDebug("EXIT 1(%s)", GetErrorMessage(GetLastResult()));
1034 result r = pAc->Start(null, null, pDataList, pListener);
1038 GalleryApp* pGalleryApp = static_cast<GalleryApp*>(GalleryApp::GetInstance());
1039 pGalleryApp->SetFrameEnabled(false);
1044 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
1050 FileListPresentationModel::SetCurrentAlbumInfo(const String& albumName, const IList& directoryList)
1052 AppLogDebug("ENTER");
1054 if (&directoryList != null)
1056 if (__pDirectoryList != null && __pDirectoryList->GetCount() > 0)
1058 bool isMatched = false;
1059 int outterLoopCount = __pDirectoryList->GetCount();
1060 int innerLoopCount = 0;
1061 for (int i = 0; i < outterLoopCount ; ++i)
1064 innerLoopCount = directoryList.GetCount();
1065 for (int j = 0; j < innerLoopCount; ++j)
1067 if (static_cast<String*>(__pDirectoryList->GetAt(i))->CompareTo(
1068 *(const_cast<String*>(static_cast<const String*>(directoryList.GetAt(j))))) == 0)
1076 outterLoopCount = directoryList.GetCount();
1077 for (int i = 0; i < outterLoopCount; ++i)
1080 innerLoopCount = __pDirectoryList->GetCount();
1081 for (int j = 0; j < innerLoopCount; ++j)
1083 if (const_cast<String*>(static_cast<const String*>(directoryList.GetAt(i)))->CompareTo(
1084 *(static_cast<String*>(__pDirectoryList->GetAt(j)))) == 0)
1094 __albumName = albumName;
1096 if (__pDirectoryList != null)
1098 delete __pDirectoryList;
1100 __pDirectoryList = new (std::nothrow) ArrayList(SingleObjectDeleter);
1102 int loopCount = directoryList.GetCount();
1103 for (int i = 0; i < loopCount; ++i)
1105 __pDirectoryList->Add(new (std::nothrow) String(*(const_cast<String*>
1106 (static_cast<const String*>(directoryList.GetAt(i))))));
1109 if (__pContentInfoList != null)
1111 delete __pContentInfoList;
1112 __pContentInfoList = null;
1115 if (GetAppControlMode() == APP_CONTROL_MODE_PICK)
1117 AppControlMediaType appControlMediaType = GetAppControlMediaType();
1118 if (appControlMediaType == APPCONTROL_MEDIA_TYPE_IMAGE)
1120 __albumContentType = CONTENT_TYPE_IMAGE;
1122 else if (appControlMediaType == APPCONTROL_MEDIA_TYPE_VIDEO)
1124 __albumContentType = CONTENT_TYPE_VIDEO;
1127 __pContentInfoList = GetContentInfoListInDirectoryListN(*__pDirectoryList, __albumContentType);
1128 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
1134 FileListPresentationModel::RefreshCurrentAlbumContentInfoList(ContentType contentType)
1136 AppLogDebug("ENTER");
1137 result r = RefreshContentInfoList(contentType);
1138 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
1144 FileListPresentationModel::RefreshContentInfoList(ContentType contentType)
1146 AppLogDebug("ENTER");
1147 if ((contentType != CONTENT_TYPE_ALL) && (contentType != CONTENT_TYPE_IMAGE) && (contentType != CONTENT_TYPE_VIDEO))
1149 AppLogDebug("EXIT 1(%s)", GetErrorMessage(GetLastResult()));
1154 if ((__pDirectoryList == null) || (__pDirectoryList->GetCount() <= 0))
1156 AppLogDebug("EXIT 2(%s)", GetErrorMessage(GetLastResult()));
1161 __albumContentType = contentType;
1163 if (__pContentInfoList != null)
1165 delete __pContentInfoList;
1166 __pContentInfoList = null;
1168 __pContentInfoList = GetContentInfoListInDirectoryListN(*__pDirectoryList, __albumContentType);
1169 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
1175 FileListPresentationModel::GetCurrentAlbumName(void)
1177 AppLogDebug("ENTER");
1178 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
1184 FileListPresentationModel::SetCurrentAlbumName(String& albumName)
1186 AppLogDebug("ENTER");
1187 if (&albumName == null)
1189 __albumName = EMPTY_SPACE;
1193 __albumName = albumName;
1195 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
1199 FileListPresentationModel::GetCurrentAlbumContentType(void)
1201 AppLogDebug("ENTER");
1202 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
1204 return __albumContentType;
1208 FileListPresentationModel::SetCurrentAlbumContentType(ContentType contentType)
1210 AppLogDebug("ENTER");
1211 __albumContentType = contentType;
1212 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
1216 FileListPresentationModel::GetAlbumDirectoryListN(void)
1218 AppLogDebug("ENTER");
1219 IList* pAlbumDirectoryList = new (std::nothrow) ArrayList(SingleObjectDeleter);
1220 if (__pDirectoryList == null)
1222 AppLogDebug("EXIT 1(%s)", GetErrorMessage(GetLastResult()));
1224 return pAlbumDirectoryList;
1227 String* pDirectory = null;
1228 int loopCount = __pDirectoryList->GetCount();
1229 for (int i = 0; i < loopCount; ++i)
1231 pDirectory = static_cast<String*>(__pDirectoryList->GetAt(i));
1232 pAlbumDirectoryList->Add(new (std::nothrow) String(*pDirectory));
1234 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
1236 return pAlbumDirectoryList;
1240 FileListPresentationModel::GetAlbumContentInfoList(void)
1242 AppLogDebug("ENTER");
1243 IList* pContentList = new (std::nothrow) ArrayList(SingleObjectDeleter);
1244 if (__pContentInfoList == null)
1246 AppLogDebug("EXIT 1(%s)", GetErrorMessage(GetLastResult()));
1248 return pContentList;
1251 ContentInfo* pContentInfo = null;
1252 int loopCount = __pContentInfoList->GetCount();
1253 for (int i = 0; i < loopCount; ++i)
1255 pContentInfo = static_cast<ContentInfo*>(__pContentInfoList->GetAt(i));
1256 pContentList->Add(pContentInfo);
1258 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
1260 return pContentList;
1264 FileListPresentationModel::GetContentInfo(int index)
1266 AppLogDebug("ENTER");
1267 if (__pContentInfoList == null || __pContentInfoList->GetCount() == 0)
1269 AppLogDebug("EXIT 1(%s)", GetErrorMessage(GetLastResult()));
1274 if (index < 0 || index >= __pContentInfoList->GetCount())
1276 AppLogDebug("EXIT 2(%s)", GetErrorMessage(GetLastResult()));
1280 ContentInfo* pContentInfo = static_cast<ContentInfo*>(__pContentInfoList->GetAt(index));
1281 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
1283 return pContentInfo;
1287 IList* FileListPresentationModel::GetContentIdListN(const IList& contentInfoList)
1289 IList* pContentIdList = new (std::nothrow) ArrayList(SingleObjectDeleter);
1290 int loopCount = contentInfoList.GetCount();
1291 for (int i = 0; i < loopCount; ++i)
1293 const Integer* pIndex = static_cast<const Integer*>(contentInfoList.GetAt(i));
1295 if ((pIndex != null) && (pIndex->ToInt())>=0 && __pContentInfoList->GetCount() > pIndex->ToInt())
1297 pContentIdList->Add(new (std::nothrow) ContentId((static_cast<ContentInfo*>(__pContentInfoList->GetAt(pIndex->ToInt())))->GetContentId()));
1301 return pContentIdList;
1305 FileListPresentationModel::GetCurrentAlbumContentInfoCount(void)
1307 AppLogDebug("ENTER");
1308 if (__pContentInfoList == null)
1310 AppLogDebug("EXIT 1(%s)", GetErrorMessage(GetLastResult()));
1314 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
1316 return __pContentInfoList->GetCount();
1320 FileListPresentationModel::GetContentInfoIndex(int index)
1322 AppLogDebug("ENTER");
1323 if (__pContentInfoList == null || __pContentInfoList->GetCount() == 0)
1325 AppLogDebug("EXIT 1(%s)", GetErrorMessage(GetLastResult()));
1330 if (index < 0 || index >= __pContentInfoList->GetCount())
1332 AppLogDebug("EXIT 2(%s)", GetErrorMessage(GetLastResult()));
1336 ContentInfo* pContentInfo = static_cast<ContentInfo*>(__pContentInfoList->GetAt(index));
1337 ContentId contentId = pContentInfo->GetContentId();
1338 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
1344 FileListPresentationModel::GetContentFilePath(int index)
1346 AppLogDebug("ENTER index(%d)", index);
1347 if (__pContentInfoList == null || __pContentInfoList->GetCount() == 0)
1349 AppLogDebug("EXIT 1(%s)", GetErrorMessage(GetLastResult()));
1354 if (index < 0 || index >= __pContentInfoList->GetCount())
1356 AppLogDebug("EXIT 2(%s)", GetErrorMessage(GetLastResult()));
1361 ContentInfo* pContentInfo = static_cast<ContentInfo*>(__pContentInfoList->GetAt(index));
1362 String contentPath = pContentInfo->GetContentPath();
1363 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
1369 FileListPresentationModel::CoverVideoOverlayedImageOnThumbnailN(Bitmap& thumbnail,
1370 const ThumbnailInfo& thumbmailInfo)
1372 AppLogDebug("ENTER");
1373 Bitmap* overlayedImage = null;
1375 if (&thumbmailInfo != null)
1377 long duration = thumbmailInfo.GetDuration();
1380 if (&thumbnail != null)
1382 BufferInfo bufferInfo;
1383 thumbnail.Lock(bufferInfo, INFINITE);
1385 mainCanvas.Construct(bufferInfo);
1389 Rectangle mainRect(0, 0, W_DEFAULT_THUMBNAIL, H_DEFAULT_THUMBNAIL);
1390 mainCanvas.Construct(mainRect);
1391 mainCanvas.FillRectangle(Color::GetColor(COLOR_ID_BLACK), mainRect);
1394 Rectangle playRect(GAP_W_PLAY_FG, GAP_H_PLAY_FG, W_PLAY_FG, H_PLAY_FG);
1395 Bitmap* playBitmap = ResourceManager::GetBitmapN(IDB_VIDEOTHUMBNAIL_PLAY);
1396 if (playBitmap != null)
1398 mainCanvas.DrawBitmap(playRect, *playBitmap);
1403 Rectangle durSize(0, 0, W_DURATION, H_DURATION);
1404 Rectangle durRect(0, GAP_H_DURATION, W_DURATION, H_DURATION);
1405 Color durColor(COLOR_DURATION_BG);
1406 durColor.SetAlpha(ALPHA_DURATION);
1407 durCanvas.Construct(durSize);
1408 durCanvas.FillRectangle(durColor, durSize);
1410 durFont.Construct(FONT_STYLE_PLAIN, FONT_SIZE_DURATION);
1411 durCanvas.SetFont(durFont);
1412 durCanvas.DrawText(Point(W_DURATION_TEXT, H_DURATION_TEXT), CommonUtil::DurationToTimeString(duration), COLOR_TEXT_OUTLINE);
1414 durBitmap.Construct(durCanvas,durCanvas.GetBounds());
1415 mainCanvas.DrawBitmap(durRect,durBitmap);
1417 overlayedImage = new (std::nothrow) Bitmap();
1418 overlayedImage->Construct(mainCanvas,mainCanvas.GetBounds());
1420 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
1422 return overlayedImage;
1426 FileListPresentationModel::GetShadedBackgroundBitmapN(Bitmap& bgBitmap,
1427 const Bitmap& orgBitmap,
1428 const Rectangle& orgBitmapPosition)
1430 AppLogDebug("ENTER");
1431 if (&orgBitmap == null || &orgBitmap == null)
1433 AppLogDebug("EXIT 1(%s)", GetErrorMessage(GetLastResult()));
1438 BufferInfo bufferInfo;
1439 bgBitmap.Lock(bufferInfo, INFINITE);
1442 mainCanvas.Construct(bufferInfo);
1444 mainCanvas.DrawBitmap(orgBitmapPosition, orgBitmap);
1446 Bitmap* pMainImage = new (std::nothrow) Bitmap();
1447 pMainImage->Construct(mainCanvas,mainCanvas.GetBounds());
1448 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
1454 FileListPresentationModel::GetContentInfoListInDirectoryListN(const IList& contentDirectoryList,
1455 ContentType contentType)const
1457 AppLogDebug("ENTER");
1458 IList* pContentList = new (std::nothrow) ArrayList(SingleObjectDeleter);
1460 if ((&contentDirectoryList == null) || (contentDirectoryList.GetCount() == 0)
1461 || ((contentType != CONTENT_TYPE_IMAGE) && (contentType != CONTENT_TYPE_VIDEO) && (contentType != CONTENT_TYPE_ALL)))
1463 AppLogDebug("EXIT 1(%s)", GetErrorMessage(GetLastResult()));
1464 return pContentList;
1467 ContentDirectory contentDirectory;
1468 IListT<ContentType>* pContentTypeList = new (std::nothrow) ArrayListT<ContentType>();
1469 if (contentType == CONTENT_TYPE_IMAGE || contentType == CONTENT_TYPE_ALL)
1471 pContentTypeList->Add(CONTENT_TYPE_IMAGE);
1473 if (contentType == CONTENT_TYPE_VIDEO || contentType == CONTENT_TYPE_ALL)
1475 pContentTypeList->Add(CONTENT_TYPE_VIDEO);
1477 result r = contentDirectory.Construct(*pContentTypeList);
1478 delete pContentTypeList;
1482 int pageNo = SIZE_PAGE_NO;
1483 int countPerPage = SIZE_CONUNT_PER_PAGE;
1484 String* pContentDirectory = null;
1486 int loopCount = contentDirectoryList.GetCount();
1487 for (int i = 0; i < loopCount; ++i)
1489 IList* pIList = null;
1490 pContentDirectory = const_cast<String*>(static_cast<const String*>(contentDirectoryList.GetAt(i)));
1491 if (pContentDirectory != null)
1493 pIList = contentDirectory.GetContentDirectoryItemListN(*pContentDirectory, pageNo, countPerPage,
1494 CONTENT_INFO_ORDER, SORT_ORDER_NONE);
1498 pContentList->AddItems(*pIList);
1507 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
1509 return pContentList;
1513 FileListPresentationModel::ConvertToAlbumName(const String& targetPath)const
1515 AppLogDebug("ENTER");
1517 if (&targetPath == null || targetPath.GetLength() == 0)
1522 if (targetPath == RESERVED_CAMERA_PATH || targetPath == RESERVED_CAMERA_PATH_EXT)
1524 albumName = ResourceManager::GetString(L"IDS_MEDIABR_BODY_CAMERA_ROLL_ABB");
1526 else if (targetPath == RESERVED_DOWNLOAD_PATH)
1528 albumName = ResourceManager::GetString(L"IDS_COM_BODY_DOWNLOADS");
1532 String directoryName = GetDirecotyNameFromFullPath(targetPath);
1533 albumName = directoryName;
1540 FileListPresentationModel::GetAppControlMode(void) const
1542 AppLogDebug("Enter");
1543 AppLogDebug("Exit");
1545 return __appControlMode;
1549 FileListPresentationModel::GetAppControlMediaType(void) const
1551 AppLogDebug("Enter");
1552 AppLogDebug("Exit");
1554 return __appControlMediaType;
1557 AppControlSelectionMode
1558 FileListPresentationModel::GetAppControlSelectionMode(void) const
1560 AppLogDebug("Enter");
1561 AppLogDebug("Exit");
1563 return __appControlSelectionMode;