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()));
269 pItem->AddElement(RECT_VIDEO_THUMBNAIL, ACTION_ID_FORMAT_THUMBNAIL, *pBitmap);
274 pTitle = new (std::nothrow) String(SINGLE_SPACE);
276 else if (pTitle->IsEmpty() == true)
279 pTitle = new (std::nothrow) String(SINGLE_SPACE);
282 Rectangle titleRect(GAP_W_VIDEO_TITLE, GAP_H_VIDEO_TITLE, itemWidth-W_VIDEO_TITLE, H_VIDEO_TITLE);
283 pItem->AddElement(titleRect, ACTION_ID_FORMAT_TITLE, *pTitle, FONT_SIZE_TITLE,
284 Color::GetColor(COLOR_ID_BLACK),null,null,false);
286 Rectangle durationRect(GAP_W_VIDEO_DURATION, GAP_H_VIDEO_DURATION, itemWidth-W_VIDEO_DURATION,
288 pItem->AddElement(durationRect, ACTION_ID_FORMAT_DURATION, *pDuration, FONT_SIZE_DURATION,
289 Color::GetColor(COLOR_ID_GREY),null,null,false);
293 pItem->Construct(Dimension(itemWidth, H_VIDEO_ITEM), LIST_ANNEX_STYLE_NORMAL);
294 pItem->AddElement(RECT_VIDEO_THUMBNAIL, ACTION_ID_FORMAT_THUMBNAIL, *pBitmap);
298 pTitle = new (std::nothrow) String(SINGLE_SPACE);
300 else if (pTitle->IsEmpty() == true)
303 pTitle = new (std::nothrow) String(SINGLE_SPACE);
306 Rectangle titleRect(GAP_W_VIDEO_TITLE, GAP_H_VIDEO_TITLE, itemWidth-W_VIDEO_TITLE, H_VIDEO_TITLE);
307 pItem->AddElement(titleRect, ACTION_ID_FORMAT_TITLE, *pTitle, FONT_SIZE_TITLE,
308 Color::GetColor(COLOR_ID_BLACK),null,null,false);
310 Rectangle durationRect(GAP_W_VIDEO_DURATION, GAP_H_VIDEO_DURATION, itemWidth-W_VIDEO_DURATION,
312 pItem->AddElement(durationRect, ACTION_ID_FORMAT_DURATION, *pDuration, FONT_SIZE_DURATION,
313 Color::GetColor(COLOR_ID_GREY),null,null,false);
318 pItem->Construct(Dimension(itemWidth, H_VIDEO_ITEM), LIST_ANNEX_STYLE_MARK);
319 if (__pContentIconListView->IsItemChecked(index) == true)
323 BufferInfo bufferInfo;
324 pBitmap->Lock(bufferInfo, INFINITE);
326 Color dimColor(COLOR_THUMBNAIL_DIM);
327 dimColor.SetAlpha(ALPHA_THUMBNAIL_DIM);
330 canvas.Construct(bufferInfo);
331 canvas.FillRectangle(dimColor, canvas.GetBounds());
333 Bitmap* pSelectedBitmap = new (std::nothrow) Bitmap();
334 pSelectedBitmap->Construct(canvas, canvas.GetBounds());
335 pItem->AddElement(RECT_VIDEO_THUMBNAIL, ACTION_ID_FORMAT_THUMBNAIL, *pBitmap, pSelectedBitmap);
336 delete pSelectedBitmap;
340 pItem->AddElement(RECT_VIDEO_THUMBNAIL, ACTION_ID_FORMAT_THUMBNAIL, *pBitmap);
345 pItem->AddElement(RECT_VIDEO_THUMBNAIL, ACTION_ID_FORMAT_THUMBNAIL, *pBitmap);
350 pTitle = new (std::nothrow) String(SINGLE_SPACE);
352 else if (pTitle->IsEmpty() == true)
355 pTitle = new (std::nothrow) String(SINGLE_SPACE);
358 Rectangle titleRect(GAP_W_VIDEO_TITLE, GAP_H_VIDEO_TITLE, itemWidth-W_VIDEO_TITLE, H_VIDEO_TITLE);
359 pItem->AddElement(titleRect, ACTION_ID_FORMAT_TITLE, *pTitle, FONT_SIZE_TITLE,
360 Color::GetColor(COLOR_ID_BLACK),null,null,false);
362 Rectangle durationRect(GAP_W_VIDEO_DURATION, GAP_H_VIDEO_DURATION, itemWidth - W_VIDEO_DURATION,
364 pItem->AddElement(durationRect, ACTION_ID_FORMAT_DURATION, *pDuration, FONT_SIZE_DURATION,
365 Color::GetColor(COLOR_ID_GREY),null,null,false);
372 if (pItemText != null)
380 if (pDuration != null)
384 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
390 VideoListEditorPanel::DeleteItem(int index, ListItemBase* pItem, int itemWidth)
392 AppLogDebug("ENTER");
394 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
400 VideoListEditorPanel::OnListViewItemStateChanged(ListView& listView, int index, int elementId,
401 ListItemStatus status)
403 AppLogDebug("ENTER");
405 if (status == LIST_ITEM_STATUS_CHECKED || status == LIST_ITEM_STATUS_UNCHECKED)
407 if (__pPresentationModel->GetAppControlMode() == APP_CONTROL_MODE_PICK)
409 if (__pPresentationModel->GetAppControlSelectionMode() == APPCONTROL_SELECTION_MODE_MULTIPLE)
411 int checkedCount = GetItemCheckedCount();
413 if (checkedCount == 0)
415 strTmp = ResourceManager::GetString(L"IDS_ST_POP_NO_ITEMS_SELECTED");
417 else if (checkedCount == 1)
419 strTmp = ResourceManager::GetString(L"IDS_VR_POP_1_ITEM_SELECTED");
423 strTmp.Format(LENGTH_COUNT_LABEL,
424 ResourceManager::GetString(L"IDS_VR_POP_PD_ITEMS_SELECTED").GetPointer(), checkedCount);
427 __pLabelSelectCnt->SetText(strTmp);
428 __pLabelSelectCnt->RequestRedraw(true);
429 __pContentIconListView->RefreshList(index, LIST_REFRESH_TYPE_ITEM_MODIFY);
434 int checkedCount = GetItemCheckedCount();
436 if (checkedCount == 0)
438 strTmp = ResourceManager::GetString(L"IDS_ST_POP_NO_ITEMS_SELECTED");
440 else if (checkedCount == 1)
442 strTmp = ResourceManager::GetString(L"IDS_VR_POP_1_ITEM_SELECTED");
446 strTmp.Format(LENGTH_COUNT_LABEL,
447 ResourceManager::GetString(L"IDS_VR_POP_PD_ITEMS_SELECTED").GetPointer(), checkedCount);
450 __pLabelSelectCnt->SetText(strTmp);
451 __pLabelSelectCnt->RequestRedraw(true);
452 if (__pCheckButton->IsSelected())
454 __pCheckButton->SetSelected(false);
456 __pContentIconListView->RefreshList(index, LIST_REFRESH_TYPE_ITEM_MODIFY);
460 if ( __pPresentationModel->GetAppControlMode() == APP_CONTROL_MODE_PICK
461 && __pPresentationModel->GetAppControlSelectionMode() != APPCONTROL_SELECTION_MODE_MULTIPLE)
463 if (status == LIST_ITEM_STATUS_SELECTED)
465 HashMap* map = new (std::nothrow) HashMap(SingleObjectDeleter);
466 result r = map->Construct();
469 map->Add(new (std::nothrow) String(APPCONTROL_KEY_PATH),
470 new (std::nothrow) String(__pPresentationModel->GetContentFilePath(index)));
471 ArrayList* pArrayList = new (std::nothrow) ArrayList(SingleObjectDeleter);
472 pArrayList->Construct();
476 pArrayList->Add(new (std::nothrow) String(__pPresentationModel->GetContentFilePath(index)));
477 map->Add(new (std::nothrow) String(APPCONTROL_KEY_DATA_SELECTED), (Object*)pArrayList);
479 GalleryApp* pApp = dynamic_cast<GalleryApp*>(UiApp::GetInstance());
482 pApp->SendAppControlResult(APP_CTRL_RESULT_SUCCEEDED, map);
497 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
501 VideoListEditorPanel::OnListViewItemSwept(ListView& listView, int index, SweepDirection direction)
503 AppLogDebug("ENTER");
504 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
508 VideoListEditorPanel::OnListViewContextItemStateChanged(ListView& listView, int index, int elementId,
509 ListContextItemStatus status)
511 AppLogDebug("ENTER");
512 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
516 VideoListEditorPanel::OnFileInfoChanged(const ContentType contentType)
518 AppLogDebug("ENTER");
519 if (contentType == CONTENT_TYPE_VIDEO)
521 __pPresentationModel->RefreshCurrentAlbumContentInfoList(CONTENT_TYPE_VIDEO);
522 __itemCount = __pPresentationModel->GetCurrentAlbumContentInfoCount();
523 __pContentIconListView->UpdateList();
525 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
529 VideoListEditorPanel::OnThumbnailDecoded(const int index)
531 AppLogDebug("ENTER : index(%d)", index);
534 __pContentIconListView->RefreshList(index, LIST_REFRESH_TYPE_ITEM_MODIFY);
536 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
540 VideoListEditorPanel::OnSceneActivatedN(const SceneId& previousSceneId,
541 const SceneId& currentSceneId, IList* pArgs)
543 AppLogDebug("ENTER");
544 __pPresentationModel = FileListPresentationModel::GetInstance();
546 if (__pPresentationModel->GetAppControlMode() == APP_CONTROL_MODE_PICK)
548 if (currentSceneId == IDSCN_VIDEO_LIST_EDITOR)
550 if (previousSceneId == IDSCN_ALBUM_LIST)
552 AlbumInfo* pAlbumInfo = static_cast<AlbumInfo*>(pArgs->GetAt(0));
553 if (pAlbumInfo == null)
555 AppLogDebug("EXIT 1(%s)", GetErrorMessage(GetLastResult()));
560 IList* pDirectoryList = pAlbumInfo->GetDirectoryListN();
561 __pPresentationModel->SetCurrentAlbumInfo(pAlbumInfo->GetAlbumName(), *pDirectoryList);
563 if (pDirectoryList != null)
565 delete pDirectoryList;
569 __itemCount = __pPresentationModel->GetCurrentAlbumContentInfoCount();
570 __pContentIconListView->UpdateList();
576 __itemCount = __pPresentationModel->GetCurrentAlbumContentInfoCount();
577 __pContentIconListView->RequestRedraw(true);
580 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
584 VideoListEditorPanel::OnSceneDeactivated(const SceneId& currentSceneId,
585 const SceneId& nextSceneId)
587 AppLogDebug("ENTER");
588 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
592 VideoListEditorPanel::GetItemCheckedCount(void) const
594 AppLogDebug("ENTER");
596 if (__pContentIconListView != null)
598 int loopCount = __pPresentationModel->GetCurrentAlbumContentInfoCount();
599 for (int i = 0; i < loopCount; ++i)
601 if (__pContentIconListView->IsItemChecked(i))
607 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
613 VideoListEditorPanel::GetItemCheckedIndexListN(void) const
615 AppLogDebug("ENTER");
616 IList* pList = new (std::nothrow) ArrayList(SingleObjectDeleter);
617 Integer* pIndex = null;
619 if (__pContentIconListView != null)
621 int loopCount = __pPresentationModel->GetCurrentAlbumContentInfoCount();
622 for (int i = 0; i < loopCount; ++i)
624 if (__pContentIconListView->IsItemChecked(i))
626 pIndex = new (std::nothrow) Integer(i);
631 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
637 VideoListEditorPanel::OnFileOpInvalidate(enum FileActionMode actionId)
639 SceneManager* pSceneManager = SceneManager::GetInstance();
640 FileListEditorForm* pFileListEditorForm =
641 dynamic_cast<FileListEditorForm*>(pSceneManager->GetCurrentScene()->GetForm());
642 TryReturnVoid(pFileListEditorForm != null, "[%s] fail to get SceneManager.",
643 GetErrorMessage(GetLastResult()));
644 pFileListEditorForm->Invalidate(true);
648 VideoListEditorPanel::OnFileOpComplete(enum FileActionMode actionId, enum FileActionCompleteRes res)
653 VideoListEditorPanel::OnRequestAppExitWithMultipleSelectionAppControlResult(void)
655 AppLogDebug("ENTER");
656 IList* pIndexList = GetItemCheckedIndexListN();
658 if (pIndexList->GetCount() <= 0)
661 AppLogDebug("EXIT 1(%s)", GetErrorMessage(GetLastResult()));
665 HashMap* map = new (std::nothrow) HashMap(SingleObjectDeleter);
666 result r = map->Construct();
670 ArrayList* pArrayList = new (std::nothrow) ArrayList(SingleObjectDeleter);
671 r = pArrayList->Construct();
675 Integer* temp = null;
676 int loopCount = pIndexList->GetCount();
678 for (int i = 0; i < loopCount; ++i)
680 temp = static_cast<Integer*>(pIndexList->GetAt(i));
681 pArrayList->Add(new (std::nothrow) String(__pPresentationModel->GetContentFilePath(temp->ToInt())));
684 map->Add(new (std::nothrow) String(APPCONTROL_KEY_DATA_SELECTED), (Object*)pArrayList);
686 GalleryApp* pApp = dynamic_cast<GalleryApp*>(UiApp::GetInstance());
689 pApp->SendAppControlResult(APP_CTRL_RESULT_SUCCEEDED, map);
709 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
713 VideoListEditorPanel::SelectAllPressed(void)
715 bool needToSelectAll = true;
716 int checkedCount = GetItemCheckedCount();
717 int totalFileCount = __pPresentationModel->GetCurrentAlbumContentInfoCount();
718 if (checkedCount == totalFileCount)
720 needToSelectAll = false;
723 if (needToSelectAll == true)
725 for (int i = 0 ; i < totalFileCount; ++i)
727 if (__pContentIconListView->IsItemChecked(i) == false)
729 __pContentIconListView->SetItemChecked(i,true);
730 __pContentIconListView->RefreshList(i, LIST_REFRESH_TYPE_ITEM_MODIFY);
736 for (int i = 0 ; i < totalFileCount; ++i)
738 if (__pContentIconListView->IsItemChecked(i) == true)
740 __pContentIconListView->SetItemChecked(i, false);
741 __pContentIconListView->RefreshList(i, LIST_REFRESH_TYPE_ITEM_MODIFY);
747 if (needToSelectAll == true)
749 tempString.Format(LENGTH_COUNT_LABEL,
750 ResourceManager::GetString(L"IDS_VR_POP_PD_ITEMS_SELECTED").GetPointer(), totalFileCount);
754 tempString = ResourceManager::GetString(L"IDS_ST_POP_NO_ITEMS_SELECTED");
757 __pLabelSelectCnt->SetText(tempString);
758 __pLabelSelectCnt->RequestRedraw(true);