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 GlVideoListEditorPanel.cpp
19 * @brief This is the implementation file for VideoListEditorPanel class.
24 #include "GlAlbumInfo.h"
25 #include "GlCommonUtil.h"
26 #include "GlFileListPresentationModel.h"
27 #include "GlGalleryApp.h"
28 #include "GlResourceManager.h"
30 #include "GlVideoListEditorPanel.h"
31 #include "GlFileListEditorForm.h"
32 #include "GlFileUpdateTimer.h"
34 using namespace Tizen::App;
35 using namespace Tizen::Base;
36 using namespace Tizen::Base::Collection;
37 using namespace Tizen::Content;
38 using namespace Tizen::Graphics;
39 using namespace Tizen::Media;
40 using namespace Tizen::Ui::Controls;
41 using namespace Tizen::Ui::Scenes;
43 static const unsigned int COLOR_COUNT_LABEL = Color32<68, 68, 68>::Value;
44 static const unsigned int COLOR_SELECT_COUNT_FONT = Color32<255, 255, 255>::Value;
45 static const Color COLOR_THUMBNAIL_DIM (Color::GetColor(COLOR_ID_BLACK));
46 static const Rectangle RECT_VIDEO_THUMBNAIL(16, 16, 172, 128);
47 static const Rectangle RECT_INITIAL(0, 0, 10, 10);
49 static const int H_SELECTALL_REGION = 112;
50 static const int ALPHA_THUMBNAIL_DIM = 70;
51 static const int H_COUNT_LABEL = 48;
52 static const int COUNT_LABEL_FONT_SIZE = 33;
53 static const int LENGTH_COUNT_LABEL = 256;
54 static const int W_CLIENT_REGION = 720;
55 static const int H_VIDEO_ITEM = 160;
56 static const int GAP_W_VIDEO_TITLE = 16+172+16;
57 static const int GAP_H_VIDEO_TITLE = 22;
58 static const int W_VIDEO_TITLE = (16+172+16)+(16+64+16);
59 static const int H_VIDEO_TITLE = 64;
60 static const int FONT_SIZE_TITLE = 36;
61 static const int GAP_W_VIDEO_DURATION = 16+172+16;
62 static const int GAP_H_VIDEO_DURATION = 22+64;
63 static const int W_VIDEO_DURATION = (16+172+16)+(16+64+16);
64 static const int H_VIDEO_DURATION = 48;
65 static const int FONT_SIZE_DURATION = 32;
67 VideoListEditorPanel::VideoListEditorPanel()
68 : __pContentIconListView(null)
69 , __pCheckButton(null)
70 , __pLabelSelectCnt(null)
72 , __pPresentationModel(null)
76 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
79 VideoListEditorPanel::~VideoListEditorPanel()
83 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
87 VideoListEditorPanel::Initialize(void)
90 result r = Construct(RECT_INITIAL);
91 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
97 VideoListEditorPanel::OnInitializing(void)
100 const Form* pForm = dynamic_cast<Form*>(GetParent());
101 TryReturn(pForm != null, E_FAILURE, "[%s] fail to get the form.", GetErrorMessage(GetLastResult()));
103 __pPresentationModel = FileListPresentationModel::GetInstance();
104 __pPresentationModel->ClearThumbnailRequests();
105 __pPresentationModel->AddPresentationModelListener(this);
108 Rectangle clientAreaBounds = pForm->GetClientAreaBounds();
109 clientAreaBounds.x = clientAreaBounds.y = 0;
110 SetBounds(clientAreaBounds);
112 if (__pPresentationModel->GetAppControlMode() == APP_CONTROL_MODE_PICK)
114 __pContentIconListView = new (std::nothrow) ListView();
116 if (__pPresentationModel->GetAppControlSelectionMode() == APPCONTROL_SELECTION_MODE_MULTIPLE)
118 __pContentIconListView->Construct(Rectangle(0, 0, clientAreaBounds.width, clientAreaBounds.height), true, false);
119 Bitmap* pBitmapEmpty = ResourceManager::GetBitmapN(IDB_LISTVIEW_EMPTY);
120 if (pBitmapEmpty != null)
122 __pContentIconListView->SetBitmapOfEmptyList(pBitmapEmpty);
125 __pContentIconListView->SetTextOfEmptyList(ResourceManager::GetString(L"IDS_COM_BODY_NO_ITEMS"));
126 __pContentIconListView->SetItemProvider(*this);
127 __pContentIconListView->AddListViewItemEventListener(*this);
128 AddControl(*__pContentIconListView);
129 __pContentIconListView->SetShowState(true);
133 __pContentIconListView->Construct(Rectangle(0, 0, clientAreaBounds.width, clientAreaBounds.height), true, false);
134 Bitmap* pBitmapEmpty = ResourceManager::GetBitmapN(IDB_LISTVIEW_EMPTY);
135 if (pBitmapEmpty != null)
137 __pContentIconListView->SetBitmapOfEmptyList(pBitmapEmpty);
140 __pContentIconListView->SetTextOfEmptyList(ResourceManager::GetString(L"IDS_COM_BODY_NO_ITEMS"));
141 __pContentIconListView->SetItemProvider(*this);
142 __pContentIconListView->AddListViewItemEventListener(*this);
143 AddControl(*__pContentIconListView);
144 __pContentIconListView->SetShowState(true);
149 __pContentIconListView = new (std::nothrow) ListView();
150 __pContentIconListView->Construct(
151 Rectangle(0, H_SELECTALL_REGION, W_CLIENT_REGION, clientAreaBounds.height-H_SELECTALL_REGION),
153 Bitmap* pBitmapEmpty = ResourceManager::GetBitmapN(IDB_LISTVIEW_EMPTY);
154 if (pBitmapEmpty != null)
156 __pContentIconListView->SetBitmapOfEmptyList(pBitmapEmpty);
159 __pContentIconListView->SetTextOfEmptyList(ResourceManager::GetString(L"IDS_COM_BODY_NO_ITEMS"));
160 __pContentIconListView->SetItemProvider(*this);
161 __pContentIconListView->AddListViewItemEventListener(*this);
162 AddControl(*__pContentIconListView);
163 __pContentIconListView->SetShowState(true);
165 __pLabelSelectCnt = new (std::nothrow) Label();
166 __pLabelSelectCnt->Construct(
167 Rectangle(0, clientAreaBounds.height-H_COUNT_LABEL, clientAreaBounds.width, H_COUNT_LABEL),
168 ResourceManager::GetString(L"IDS_ST_POP_NO_ITEMS_SELECTED"));
169 __pLabelSelectCnt->SetTextVerticalAlignment(ALIGNMENT_MIDDLE);
170 __pLabelSelectCnt->SetTextHorizontalAlignment(ALIGNMENT_LEFT);
171 __pLabelSelectCnt->SetBackgroundColor(COLOR_COUNT_LABEL);
172 __pLabelSelectCnt->SetTextColor(Color(COLOR_SELECT_COUNT_FONT));
173 __pLabelSelectCnt->SetTextConfig(COUNT_LABEL_FONT_SIZE, LABEL_TEXT_STYLE_BOLD);
174 AddControl(*__pLabelSelectCnt);
177 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
183 VideoListEditorPanel::OnTerminating(void)
185 AppLogDebug("ENTER");
186 __pPresentationModel->RemovePresentationModelListener(*this);
187 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
193 VideoListEditorPanel::GetItemCount(void)
195 AppLogDebug("ENTER");
196 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
202 VideoListEditorPanel::CreateItem(int index, int itemWidth)
204 AppLogDebug("ENTER : index(%d)", index);
205 CustomItem* pItem = new (std::nothrow) CustomItem();
207 Bitmap* pBitmap = null;
208 String* pItemText = null;
209 String* pTitle = null;
210 String* pDuration = null;
212 result r = __pPresentationModel->GetThumbnailVideoInSyncCacheN(index, pItemText, pBitmap, pDuration);
213 if (pBitmap == null || r == E_FAILURE)
215 __pPresentationModel->RequestThumbnail(index);
216 pBitmap = CommonUtil::GetEmptyThumbnailN();
219 if (pItemText == null)
221 pItemText = new (std::nothrow) String(ResourceManager::GetString(L"EMPTY_SPACE"));
224 pTitle = new (std::nothrow) String(ResourceManager::GetString(L"EMPTY_SPACE"));
226 if (pDuration == null)
228 pDuration = new (std::nothrow) String(ResourceManager::GetString(L"EMPTY_SPACE"));
231 if (__pPresentationModel->GetAppControlMode() == APP_CONTROL_MODE_PICK)
233 if (__pPresentationModel->GetAppControlSelectionMode() == APPCONTROL_SELECTION_MODE_MULTIPLE)
235 pItem->Construct(Dimension(itemWidth, H_VIDEO_ITEM), LIST_ANNEX_STYLE_MARK);
237 if (__pContentIconListView->IsItemChecked(index) == true)
241 BufferInfo bufferInfo;
242 pBitmap->Lock(bufferInfo, INFINITE);
245 Color dimColor(COLOR_THUMBNAIL_DIM);
246 dimColor.SetAlpha(ALPHA_THUMBNAIL_DIM);
249 canvas.Construct(bufferInfo);
250 canvas.FillRectangle(dimColor, canvas.GetBounds());
252 Bitmap* pSelectedBitmap = new (std::nothrow) Bitmap();
253 pSelectedBitmap->Construct(canvas, canvas.GetBounds());
254 pItem->AddElement(RECT_VIDEO_THUMBNAIL, ACTION_ID_FORMAT_THUMBNAIL, *pBitmap,
256 delete pSelectedBitmap;
260 AppLogDebug("EXIT 1(%s)", GetErrorMessage(GetLastResult()));
267 pItem->AddElement(RECT_VIDEO_THUMBNAIL, ACTION_ID_FORMAT_THUMBNAIL, *pBitmap);
272 pTitle = new (std::nothrow) String(SINGLE_SPACE);
274 else if (pTitle->IsEmpty() == true)
277 pTitle = new (std::nothrow) String(SINGLE_SPACE);
280 Rectangle titleRect(GAP_W_VIDEO_TITLE, GAP_H_VIDEO_TITLE, itemWidth-W_VIDEO_TITLE, H_VIDEO_TITLE);
281 pItem->AddElement(titleRect, ACTION_ID_FORMAT_TITLE, *pTitle, FONT_SIZE_TITLE,
282 Color::GetColor(COLOR_ID_BLACK),null,null,false);
284 Rectangle durationRect(GAP_W_VIDEO_DURATION, GAP_H_VIDEO_DURATION, itemWidth-W_VIDEO_DURATION,
286 pItem->AddElement(durationRect, ACTION_ID_FORMAT_DURATION, *pDuration, FONT_SIZE_DURATION,
287 Color::GetColor(COLOR_ID_GREY),null,null,false);
291 pItem->Construct(Dimension(itemWidth, H_VIDEO_ITEM), LIST_ANNEX_STYLE_NORMAL);
292 pItem->AddElement(RECT_VIDEO_THUMBNAIL, ACTION_ID_FORMAT_THUMBNAIL, *pBitmap);
296 pTitle = new (std::nothrow) String(SINGLE_SPACE);
298 else if (pTitle->IsEmpty() == true)
301 pTitle = new (std::nothrow) String(SINGLE_SPACE);
304 Rectangle titleRect(GAP_W_VIDEO_TITLE, GAP_H_VIDEO_TITLE, itemWidth-W_VIDEO_TITLE, H_VIDEO_TITLE);
305 pItem->AddElement(titleRect, ACTION_ID_FORMAT_TITLE, *pTitle, FONT_SIZE_TITLE,
306 Color::GetColor(COLOR_ID_BLACK),null,null,false);
308 Rectangle durationRect(GAP_W_VIDEO_DURATION, GAP_H_VIDEO_DURATION, itemWidth-W_VIDEO_DURATION,
310 pItem->AddElement(durationRect, ACTION_ID_FORMAT_DURATION, *pDuration, FONT_SIZE_DURATION,
311 Color::GetColor(COLOR_ID_GREY),null,null,false);
316 pItem->Construct(Dimension(itemWidth, H_VIDEO_ITEM), LIST_ANNEX_STYLE_MARK);
317 if (__pContentIconListView->IsItemChecked(index) == true)
321 BufferInfo bufferInfo;
322 pBitmap->Lock(bufferInfo, INFINITE);
324 Color dimColor(COLOR_THUMBNAIL_DIM);
325 dimColor.SetAlpha(ALPHA_THUMBNAIL_DIM);
328 canvas.Construct(bufferInfo);
329 canvas.FillRectangle(dimColor, canvas.GetBounds());
331 Bitmap* pSelectedBitmap = new (std::nothrow) Bitmap();
332 pSelectedBitmap->Construct(canvas, canvas.GetBounds());
333 pItem->AddElement(RECT_VIDEO_THUMBNAIL, ACTION_ID_FORMAT_THUMBNAIL, *pBitmap, pSelectedBitmap);
334 delete pSelectedBitmap;
338 pItem->AddElement(RECT_VIDEO_THUMBNAIL, ACTION_ID_FORMAT_THUMBNAIL, *pBitmap);
343 pItem->AddElement(RECT_VIDEO_THUMBNAIL, ACTION_ID_FORMAT_THUMBNAIL, *pBitmap);
348 pTitle = new (std::nothrow) String(SINGLE_SPACE);
350 else if (pTitle->IsEmpty() == true)
353 pTitle = new (std::nothrow) String(SINGLE_SPACE);
356 Rectangle titleRect(GAP_W_VIDEO_TITLE, GAP_H_VIDEO_TITLE, itemWidth-W_VIDEO_TITLE, H_VIDEO_TITLE);
357 pItem->AddElement(titleRect, ACTION_ID_FORMAT_TITLE, *pTitle, FONT_SIZE_TITLE,
358 Color::GetColor(COLOR_ID_BLACK),null,null,false);
360 Rectangle durationRect(GAP_W_VIDEO_DURATION, GAP_H_VIDEO_DURATION, itemWidth - W_VIDEO_DURATION,
362 pItem->AddElement(durationRect, ACTION_ID_FORMAT_DURATION, *pDuration, FONT_SIZE_DURATION,
363 Color::GetColor(COLOR_ID_GREY),null,null,false);
370 if (pItemText != null)
378 if (pDuration != null)
382 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
388 VideoListEditorPanel::DeleteItem(int index, ListItemBase* pItem, int itemWidth)
390 AppLogDebug("ENTER");
392 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
398 VideoListEditorPanel::OnListViewItemStateChanged(ListView& listView, int index, int elementId,
399 ListItemStatus status)
401 AppLogDebug("ENTER");
403 if (status == LIST_ITEM_STATUS_CHECKED || status == LIST_ITEM_STATUS_UNCHECKED)
405 if (__pPresentationModel->GetAppControlMode() == APP_CONTROL_MODE_PICK)
407 if (__pPresentationModel->GetAppControlSelectionMode() == APPCONTROL_SELECTION_MODE_MULTIPLE)
409 int checkedCount = GetItemCheckedCount();
411 if (checkedCount == 0)
413 strTmp = ResourceManager::GetString(L"IDS_ST_POP_NO_ITEMS_SELECTED");
415 else if (checkedCount == 1)
417 strTmp = ResourceManager::GetString(L"IDS_VR_POP_1_ITEM_SELECTED");
421 strTmp.Format(LENGTH_COUNT_LABEL,
422 ResourceManager::GetString(L"IDS_VR_POP_PD_ITEMS_SELECTED").GetPointer(), checkedCount);
425 __pLabelSelectCnt->SetText(strTmp);
426 __pLabelSelectCnt->RequestRedraw(true);
427 __pContentIconListView->RefreshList(index, LIST_REFRESH_TYPE_ITEM_MODIFY);
432 int checkedCount = GetItemCheckedCount();
434 if (checkedCount == 0)
436 strTmp = ResourceManager::GetString(L"IDS_ST_POP_NO_ITEMS_SELECTED");
438 else if (checkedCount == 1)
440 strTmp = ResourceManager::GetString(L"IDS_VR_POP_1_ITEM_SELECTED");
444 strTmp.Format(LENGTH_COUNT_LABEL,
445 ResourceManager::GetString(L"IDS_VR_POP_PD_ITEMS_SELECTED").GetPointer(), checkedCount);
448 __pLabelSelectCnt->SetText(strTmp);
449 __pLabelSelectCnt->RequestRedraw(true);
450 if (__pCheckButton->IsSelected())
452 __pCheckButton->SetSelected(false);
454 __pContentIconListView->RefreshList(index, LIST_REFRESH_TYPE_ITEM_MODIFY);
458 if ( __pPresentationModel->GetAppControlMode() == APP_CONTROL_MODE_PICK
459 && __pPresentationModel->GetAppControlSelectionMode() != APPCONTROL_SELECTION_MODE_MULTIPLE)
461 if (status == LIST_ITEM_STATUS_SELECTED)
463 HashMap* map = new (std::nothrow) HashMap(SingleObjectDeleter);
464 result r = map->Construct();
467 map->Add(new (std::nothrow) String(APPCONTROL_KEY_PATH),
468 new (std::nothrow) String(__pPresentationModel->GetContentFilePath(index)));
469 ArrayList* pArrayList = new (std::nothrow) ArrayList(SingleObjectDeleter);
470 pArrayList->Construct();
474 pArrayList->Add(new (std::nothrow) String(__pPresentationModel->GetContentFilePath(index)));
475 map->Add(new (std::nothrow) String(APPCONTROL_KEY_DATA_SELECTED), (Object*)pArrayList);
477 GalleryApp* pApp = dynamic_cast<GalleryApp*>(UiApp::GetInstance());
480 pApp->SendAppControlResult(APP_CTRL_RESULT_SUCCEEDED, map);
495 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
499 VideoListEditorPanel::OnListViewItemSwept(ListView& listView, int index, SweepDirection direction)
501 AppLogDebug("ENTER");
502 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
506 VideoListEditorPanel::OnListViewContextItemStateChanged(ListView& listView, int index, int elementId,
507 ListContextItemStatus status)
509 AppLogDebug("ENTER");
510 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
514 VideoListEditorPanel::OnFileInfoChanged(const ContentType contentType)
516 AppLogDebug("ENTER");
517 if (contentType == CONTENT_TYPE_VIDEO)
519 __pPresentationModel->RefreshCurrentAlbumContentInfoList(CONTENT_TYPE_VIDEO);
520 __itemCount = __pPresentationModel->GetCurrentAlbumContentInfoCount();
521 __pContentIconListView->UpdateList();
523 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
527 VideoListEditorPanel::OnThumbnailDecoded(const int index)
529 AppLogDebug("ENTER : index(%d)", index);
532 __pContentIconListView->RefreshList(index, LIST_REFRESH_TYPE_ITEM_MODIFY);
534 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
538 VideoListEditorPanel::OnSceneActivatedN(const SceneId& previousSceneId,
539 const SceneId& currentSceneId, IList* pArgs)
541 AppLogDebug("ENTER");
542 __pPresentationModel = FileListPresentationModel::GetInstance();
544 if (__pPresentationModel->GetAppControlMode() == APP_CONTROL_MODE_PICK)
546 if (currentSceneId == IDSCN_VIDEO_LIST_EDITOR)
548 if (previousSceneId == IDSCN_ALBUM_LIST)
550 AlbumInfo* pAlbumInfo = static_cast<AlbumInfo*>(pArgs->GetAt(0));
551 if (pAlbumInfo == null)
553 AppLogDebug("EXIT 1(%s)", GetErrorMessage(GetLastResult()));
558 IList* pDirectoryList = pAlbumInfo->GetDirectoryListN();
559 __pPresentationModel->SetCurrentAlbumInfo(pAlbumInfo->GetAlbumName(), *pDirectoryList);
561 if (pDirectoryList != null)
563 delete pDirectoryList;
567 __itemCount = __pPresentationModel->GetCurrentAlbumContentInfoCount();
568 __pContentIconListView->UpdateList();
574 __itemCount = __pPresentationModel->GetCurrentAlbumContentInfoCount();
575 __pContentIconListView->RequestRedraw(true);
578 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
582 VideoListEditorPanel::OnSceneDeactivated(const SceneId& currentSceneId,
583 const SceneId& nextSceneId)
585 AppLogDebug("ENTER");
586 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
590 VideoListEditorPanel::GetItemCheckedCount(void) const
592 AppLogDebug("ENTER");
594 if (__pContentIconListView != null)
596 int loopCount = __pPresentationModel->GetCurrentAlbumContentInfoCount();
597 for (int i = 0; i < loopCount; ++i)
599 if (__pContentIconListView->IsItemChecked(i))
605 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
611 VideoListEditorPanel::GetItemCheckedIndexListN(void) const
613 AppLogDebug("ENTER");
614 IList* pList = new (std::nothrow) ArrayList(SingleObjectDeleter);
615 Integer* pIndex = null;
617 if (__pContentIconListView != null)
619 int loopCount = __pPresentationModel->GetCurrentAlbumContentInfoCount();
620 for (int i = 0; i < loopCount; ++i)
622 if (__pContentIconListView->IsItemChecked(i))
624 pIndex = new (std::nothrow) Integer(i);
629 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
635 VideoListEditorPanel::OnFileOpInvalidate(enum FileActionMode actionId)
637 SceneManager* pSceneManager = SceneManager::GetInstance();
638 FileListEditorForm* pFileListEditorForm =
639 dynamic_cast<FileListEditorForm*>(pSceneManager->GetCurrentScene()->GetForm());
640 TryReturnVoid(pFileListEditorForm != null, "[%s] fail to get SceneManager.",
641 GetErrorMessage(GetLastResult()));
642 pFileListEditorForm->Invalidate(true);
646 VideoListEditorPanel::OnFileOpComplete(enum FileActionMode actionId, enum FileActionCompleteRes res)
651 VideoListEditorPanel::OnRequestAppExitWithMultipleSelectionAppControlResult(void)
653 AppLogDebug("ENTER");
654 IList* pIndexList = GetItemCheckedIndexListN();
656 if (pIndexList->GetCount() <= 0)
659 AppLogDebug("EXIT 1(%s)", GetErrorMessage(GetLastResult()));
663 HashMap* map = new (std::nothrow) HashMap(SingleObjectDeleter);
664 result r = map->Construct();
668 ArrayList* pArrayList = new (std::nothrow) ArrayList(SingleObjectDeleter);
669 r = pArrayList->Construct();
673 Integer* temp = null;
674 int loopCount = pIndexList->GetCount();
676 for (int i = 0; i < loopCount; ++i)
678 temp = static_cast<Integer*>(pIndexList->GetAt(i));
679 pArrayList->Add(new (std::nothrow) String(__pPresentationModel->GetContentFilePath(temp->ToInt())));
682 map->Add(new (std::nothrow) String(APPCONTROL_KEY_DATA_SELECTED), (Object*)pArrayList);
684 GalleryApp* pApp = dynamic_cast<GalleryApp*>(UiApp::GetInstance());
687 pApp->SendAppControlResult(APP_CTRL_RESULT_SUCCEEDED, map);
707 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
711 VideoListEditorPanel::SelectAllPressed(void)
713 bool needToSelectAll = true;
714 int checkedCount = GetItemCheckedCount();
715 int totalFileCount = __pPresentationModel->GetCurrentAlbumContentInfoCount();
716 if (checkedCount == totalFileCount)
718 needToSelectAll = false;
721 if (needToSelectAll == true)
723 for (int i = 0 ; i < totalFileCount; ++i)
725 if (__pContentIconListView->IsItemChecked(i) == false)
727 __pContentIconListView->SetItemChecked(i,true);
728 __pContentIconListView->RefreshList(i, LIST_REFRESH_TYPE_ITEM_MODIFY);
734 for (int i = 0 ; i < totalFileCount; ++i)
736 if (__pContentIconListView->IsItemChecked(i) == true)
738 __pContentIconListView->SetItemChecked(i, false);
739 __pContentIconListView->RefreshList(i, LIST_REFRESH_TYPE_ITEM_MODIFY);
745 if (needToSelectAll == true)
747 tempString.Format(LENGTH_COUNT_LABEL,
748 ResourceManager::GetString(L"IDS_VR_POP_PD_ITEMS_SELECTED").GetPointer(), totalFileCount);
752 tempString = ResourceManager::GetString(L"IDS_ST_POP_NO_ITEMS_SELECTED");
755 __pLabelSelectCnt->SetText(tempString);
756 __pLabelSelectCnt->RequestRedraw(true);