2 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
4 // Licensed under the Flora License, Version 1.1 (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(void)
68 : __pContentIconListView(null)
69 , __pCheckButton(null)
70 , __pLabelSelectCnt(null)
72 , __pPresentationModel(null)
74 , __pFileListEditorForm(null)
77 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
80 VideoListEditorPanel::~VideoListEditorPanel(void)
84 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
88 VideoListEditorPanel::Initialize(void)
91 result r = Construct(RECT_INITIAL);
92 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
98 VideoListEditorPanel::OnInitializing(void)
100 AppLogDebug("ENTER");
101 const Form* pForm = dynamic_cast<Form*>(GetParent());
102 TryReturn(pForm != null, E_FAILURE, "[%s] fail to get the form.", GetErrorMessage(GetLastResult()));
104 __pPresentationModel = FileListPresentationModel::GetInstance();
105 __pPresentationModel->ClearThumbnailRequests();
106 __pPresentationModel->AddPresentationModelListener(this);
109 Rectangle clientAreaBounds = pForm->GetClientAreaBounds();
110 clientAreaBounds.x = clientAreaBounds.y = 0;
111 SetBounds(clientAreaBounds);
113 if (__pPresentationModel->GetAppControlMode() == APPCONTROL_MODE_PICK)
115 __pContentIconListView = new (std::nothrow) ListView();
117 if (__pPresentationModel->GetAppControlSelectionMode() == APPCONTROL_SELECTION_MODE_MULTIPLE)
119 __pContentIconListView->Construct(Rectangle(0, 0, clientAreaBounds.width, clientAreaBounds.height), true, false);
120 Bitmap* pBitmapEmpty = ResourceManager::GetBitmapN(IDB_LISTVIEW_EMPTY);
121 if (pBitmapEmpty != null)
123 __pContentIconListView->SetBitmapOfEmptyList(pBitmapEmpty);
126 __pContentIconListView->SetTextOfEmptyList(ResourceManager::GetString(L"IDS_COM_BODY_NO_ITEMS"));
127 __pContentIconListView->SetItemProvider(*this);
128 __pContentIconListView->AddListViewItemEventListener(*this);
129 AddControl(__pContentIconListView);
130 __pContentIconListView->SetShowState(true);
132 __pLabelSelectCnt = new (std::nothrow) Label();
133 __pLabelSelectCnt->Construct(Rectangle(0, clientAreaBounds.height - H_COUNT_LABEL,
134 clientAreaBounds.width, H_COUNT_LABEL), ResourceManager::GetString(L"IDS_ST_POP_NO_ITEMS_SELECTED"));
135 __pLabelSelectCnt->SetTextVerticalAlignment(ALIGNMENT_MIDDLE);
136 __pLabelSelectCnt->SetTextHorizontalAlignment(ALIGNMENT_LEFT);
137 __pLabelSelectCnt->SetBackgroundColor(COLOR_COUNT_LABEL);
138 __pLabelSelectCnt->SetTextColor(Color(COLOR_SELECT_COUNT_FONT));
139 __pLabelSelectCnt->SetTextConfig(COUNT_LABEL_FONT_SIZE, LABEL_TEXT_STYLE_BOLD);
140 AddControl(__pLabelSelectCnt);
144 __pContentIconListView->Construct(Rectangle(0, 0, clientAreaBounds.width,
145 clientAreaBounds.height), true, false);
146 Bitmap* pBitmapEmpty = ResourceManager::GetBitmapN(IDB_LISTVIEW_EMPTY);
147 if (pBitmapEmpty != null)
149 __pContentIconListView->SetBitmapOfEmptyList(pBitmapEmpty);
152 __pContentIconListView->SetTextOfEmptyList(ResourceManager::GetString(L"IDS_COM_BODY_NO_ITEMS"));
153 __pContentIconListView->SetItemProvider(*this);
154 __pContentIconListView->AddListViewItemEventListener(*this);
155 AddControl(__pContentIconListView);
156 __pContentIconListView->SetShowState(true);
161 __pContentIconListView = new (std::nothrow) ListView();
162 __pContentIconListView->Construct(
163 Rectangle(0, H_SELECTALL_REGION, W_CLIENT_REGION, clientAreaBounds.height - H_SELECTALL_REGION),
165 Bitmap* pBitmapEmpty = ResourceManager::GetBitmapN(IDB_LISTVIEW_EMPTY);
166 if (pBitmapEmpty != null)
168 __pContentIconListView->SetBitmapOfEmptyList(pBitmapEmpty);
171 __pContentIconListView->SetTextOfEmptyList(ResourceManager::GetString(L"IDS_COM_BODY_NO_ITEMS"));
172 __pContentIconListView->SetItemProvider(*this);
173 __pContentIconListView->AddListViewItemEventListener(*this);
174 AddControl(__pContentIconListView);
175 __pContentIconListView->SetShowState(true);
177 __pLabelSelectCnt = new (std::nothrow) Label();
178 __pLabelSelectCnt->Construct(
179 Rectangle(0, clientAreaBounds.height - H_COUNT_LABEL, clientAreaBounds.width, H_COUNT_LABEL),
180 ResourceManager::GetString(L"IDS_ST_POP_NO_ITEMS_SELECTED"));
181 __pLabelSelectCnt->SetTextVerticalAlignment(ALIGNMENT_MIDDLE);
182 __pLabelSelectCnt->SetTextHorizontalAlignment(ALIGNMENT_LEFT);
183 __pLabelSelectCnt->SetBackgroundColor(COLOR_COUNT_LABEL);
184 __pLabelSelectCnt->SetTextColor(Color(COLOR_SELECT_COUNT_FONT));
185 __pLabelSelectCnt->SetTextConfig(COUNT_LABEL_FONT_SIZE, LABEL_TEXT_STYLE_BOLD);
186 AddControl(__pLabelSelectCnt);
189 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
195 VideoListEditorPanel::OnTerminating(void)
197 AppLogDebug("ENTER");
198 __pPresentationModel->RemovePresentationModelListener(*this);
199 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
205 VideoListEditorPanel::GetItemCount(void)
207 AppLogDebug("ENTER");
208 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
214 VideoListEditorPanel::CreateItem(int index, int itemWidth)
216 AppLogDebug("ENTER : index(%d)", index);
217 CustomItem* pItem = new (std::nothrow) CustomItem();
219 Bitmap* pBitmap = null;
220 String* pItemText = null;
221 String* pTitle = null;
222 String* pDuration = null;
224 result r = __pPresentationModel->GetThumbnailVideoInSyncCacheN(index, pItemText, pBitmap, pDuration);
225 if (pBitmap == null || r == E_FAILURE)
227 __pPresentationModel->RequestThumbnail(index);
228 pBitmap = CommonUtil::GetEmptyThumbnailN();
231 if (pItemText == null)
233 pItemText = new (std::nothrow) String(ResourceManager::GetString(L"EMPTY_SPACE"));
236 pTitle = new (std::nothrow) String(ResourceManager::GetString(L"EMPTY_SPACE"));
238 if (pDuration == null)
240 pDuration = new (std::nothrow) String(ResourceManager::GetString(L"EMPTY_SPACE"));
243 if (__pPresentationModel->GetAppControlMode() == APPCONTROL_MODE_PICK)
245 if (__pPresentationModel->GetAppControlSelectionMode() == APPCONTROL_SELECTION_MODE_MULTIPLE)
247 pItem->Construct(Dimension(itemWidth, H_VIDEO_ITEM), LIST_ANNEX_STYLE_MARK);
249 if (__pContentIconListView->IsItemChecked(index) == true)
253 BufferInfo bufferInfo;
254 pBitmap->Lock(bufferInfo, INFINITE);
257 Color dimColor(COLOR_THUMBNAIL_DIM);
258 dimColor.SetAlpha(ALPHA_THUMBNAIL_DIM);
261 canvas.Construct(bufferInfo);
262 canvas.FillRectangle(dimColor, canvas.GetBounds());
264 Bitmap* pSelectedBitmap = new (std::nothrow) Bitmap();
265 pSelectedBitmap->Construct(canvas, canvas.GetBounds());
266 pItem->AddElement(RECT_VIDEO_THUMBNAIL, IDA_FORMAT_THUMBNAIL, *pBitmap, pSelectedBitmap);
267 delete pSelectedBitmap;
271 AppLogDebug("EXIT 1(%s)", GetErrorMessage(GetLastResult()));
280 pItem->AddElement(RECT_VIDEO_THUMBNAIL, IDA_FORMAT_THUMBNAIL, *pBitmap);
285 pTitle = new (std::nothrow) String(SINGLE_SPACE);
287 else if (pTitle->IsEmpty() == true)
290 pTitle = new (std::nothrow) String(SINGLE_SPACE);
293 Rectangle titleRect(GAP_W_VIDEO_TITLE, GAP_H_VIDEO_TITLE, itemWidth-W_VIDEO_TITLE, H_VIDEO_TITLE);
294 pItem->AddElement(titleRect, IDA_FORMAT_TITLE, *pTitle, FONT_SIZE_TITLE,
295 Color::GetColor(COLOR_ID_BLACK),null,null,false);
297 Rectangle durationRect(GAP_W_VIDEO_DURATION, GAP_H_VIDEO_DURATION, itemWidth-W_VIDEO_DURATION,
299 pItem->AddElement(durationRect, IDA_FORMAT_DURATION, *pDuration, FONT_SIZE_DURATION,
300 Color::GetColor(COLOR_ID_GREY),null,null,false);
304 pItem->Construct(Dimension(itemWidth, H_VIDEO_ITEM), LIST_ANNEX_STYLE_NORMAL);
305 pItem->AddElement(RECT_VIDEO_THUMBNAIL, IDA_FORMAT_THUMBNAIL, *pBitmap);
309 pTitle = new (std::nothrow) String(SINGLE_SPACE);
311 else if (pTitle->IsEmpty() == true)
314 pTitle = new (std::nothrow) String(SINGLE_SPACE);
317 Rectangle titleRect(GAP_W_VIDEO_TITLE, GAP_H_VIDEO_TITLE, itemWidth-W_VIDEO_TITLE, H_VIDEO_TITLE);
318 pItem->AddElement(titleRect, IDA_FORMAT_TITLE, *pTitle, FONT_SIZE_TITLE,
319 Color::GetColor(COLOR_ID_BLACK), null, null, false);
321 Rectangle durationRect(GAP_W_VIDEO_DURATION, GAP_H_VIDEO_DURATION, itemWidth-W_VIDEO_DURATION,
323 pItem->AddElement(durationRect, IDA_FORMAT_DURATION, *pDuration, FONT_SIZE_DURATION,
324 Color::GetColor(COLOR_ID_GREY), null, null, false);
329 pItem->Construct(Dimension(itemWidth, H_VIDEO_ITEM), LIST_ANNEX_STYLE_MARK);
330 if (__pContentIconListView->IsItemChecked(index) == true)
334 BufferInfo bufferInfo;
335 pBitmap->Lock(bufferInfo, INFINITE);
337 Color dimColor(COLOR_THUMBNAIL_DIM);
338 dimColor.SetAlpha(ALPHA_THUMBNAIL_DIM);
341 canvas.Construct(bufferInfo);
342 canvas.FillRectangle(dimColor, canvas.GetBounds());
344 Bitmap* pSelectedBitmap = new (std::nothrow) Bitmap();
345 pSelectedBitmap->Construct(canvas, canvas.GetBounds());
346 pItem->AddElement(RECT_VIDEO_THUMBNAIL, IDA_FORMAT_THUMBNAIL, *pBitmap, pSelectedBitmap);
347 delete pSelectedBitmap;
351 pItem->AddElement(RECT_VIDEO_THUMBNAIL, IDA_FORMAT_THUMBNAIL, *pBitmap);
356 pItem->AddElement(RECT_VIDEO_THUMBNAIL, IDA_FORMAT_THUMBNAIL, *pBitmap);
361 pTitle = new (std::nothrow) String(SINGLE_SPACE);
363 else if (pTitle->IsEmpty() == true)
366 pTitle = new (std::nothrow) String(SINGLE_SPACE);
369 Rectangle titleRect(GAP_W_VIDEO_TITLE, GAP_H_VIDEO_TITLE, itemWidth-W_VIDEO_TITLE, H_VIDEO_TITLE);
370 pItem->AddElement(titleRect, IDA_FORMAT_TITLE, *pTitle, FONT_SIZE_TITLE,
371 Color::GetColor(COLOR_ID_BLACK), null, null, false);
373 Rectangle durationRect(GAP_W_VIDEO_DURATION, GAP_H_VIDEO_DURATION, itemWidth - W_VIDEO_DURATION,
375 pItem->AddElement(durationRect, IDA_FORMAT_DURATION, *pDuration, FONT_SIZE_DURATION,
376 Color::GetColor(COLOR_ID_GREY), null, null, false);
383 if (pItemText != null)
391 if (pDuration != null)
395 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
401 VideoListEditorPanel::DeleteItem(int index, ListItemBase* pItem, int itemWidth)
403 AppLogDebug("ENTER");
405 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
411 VideoListEditorPanel::OnListViewItemStateChanged(ListView& listView, int index, int elementId,
412 ListItemStatus status)
414 AppLogDebug("ENTER");
416 if (status == LIST_ITEM_STATUS_CHECKED || status == LIST_ITEM_STATUS_UNCHECKED)
418 if (__pPresentationModel->GetAppControlMode() == APPCONTROL_MODE_PICK)
420 if (__pPresentationModel->GetAppControlSelectionMode() == APPCONTROL_SELECTION_MODE_MULTIPLE)
422 int checkedCount = GetItemCheckedCount();
424 if (checkedCount == 0)
426 strTmp = ResourceManager::GetString(L"IDS_ST_POP_NO_ITEMS_SELECTED");
428 else if (checkedCount == 1)
430 strTmp = ResourceManager::GetString(L"IDS_VR_POP_1_ITEM_SELECTED");
434 strTmp.Format(LENGTH_COUNT_LABEL,
435 ResourceManager::GetString(L"IDS_VR_POP_PD_ITEMS_SELECTED").GetPointer(), checkedCount);
438 __pLabelSelectCnt->SetText(strTmp);
439 __pLabelSelectCnt->RequestRedraw(true);
440 __pContentIconListView->RefreshList(index, LIST_REFRESH_TYPE_ITEM_MODIFY);
445 int checkedCount = GetItemCheckedCount();
447 if (checkedCount == 0)
449 strTmp = ResourceManager::GetString(L"IDS_ST_POP_NO_ITEMS_SELECTED");
451 else if (checkedCount == 1)
453 strTmp = ResourceManager::GetString(L"IDS_VR_POP_1_ITEM_SELECTED");
457 strTmp.Format(LENGTH_COUNT_LABEL,
458 ResourceManager::GetString(L"IDS_VR_POP_PD_ITEMS_SELECTED").GetPointer(), checkedCount);
461 __pLabelSelectCnt->SetText(strTmp);
462 __pLabelSelectCnt->RequestRedraw(true);
463 if (__pCheckButton->IsSelected())
465 __pCheckButton->SetSelected(false);
467 __pContentIconListView->RefreshList(index, LIST_REFRESH_TYPE_ITEM_MODIFY);
471 if ( __pPresentationModel->GetAppControlMode() == APPCONTROL_MODE_PICK
472 && __pPresentationModel->GetAppControlSelectionMode() != APPCONTROL_SELECTION_MODE_MULTIPLE)
474 if (status == LIST_ITEM_STATUS_SELECTED)
476 HashMap* pMap = new (std::nothrow) HashMap(SingleObjectDeleter);
477 result r = pMap->Construct();
480 ArrayList* pArrayList = new (std::nothrow) ArrayList(SingleObjectDeleter);
481 pArrayList->Construct();
485 pArrayList->Add(new (std::nothrow) String(__pPresentationModel->GetContentFilePath(index)));
486 pMap->Add(new (std::nothrow) String(APPCONTROL_KEY_DATA_SELECTED), (Object*)pArrayList);
488 GalleryApp* pApp = dynamic_cast<GalleryApp*>(UiApp::GetInstance());
491 pApp->SendAppControlResult(APP_CTRL_RESULT_SUCCEEDED, pMap);
507 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
511 VideoListEditorPanel::OnFileInfoChanged(const ContentType contentType)
513 AppLogDebug("ENTER");
514 if (contentType == CONTENT_TYPE_VIDEO)
516 __pPresentationModel->RefreshCurrentAlbumContentInfoList(CONTENT_TYPE_VIDEO);
517 __itemCount = __pPresentationModel->GetCurrentAlbumContentInfoCount();
518 __pContentIconListView->UpdateList();
520 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
524 VideoListEditorPanel::OnThumbnailDecoded(const int index)
526 AppLogDebug("ENTER : index(%d)", index);
529 __pContentIconListView->RefreshList(index, LIST_REFRESH_TYPE_ITEM_MODIFY);
531 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
535 VideoListEditorPanel::OnSceneActivatedN(const SceneId& previousSceneId,
536 const SceneId& currentSceneId, IList* pArgs)
538 AppLogDebug("ENTER");
539 SceneManager* pSceneManager = SceneManager::GetInstance();
540 __pFileListEditorForm = dynamic_cast<FileListEditorForm*>(pSceneManager->GetCurrentScene()->GetForm());
542 __pPresentationModel = FileListPresentationModel::GetInstance();
544 if (__pPresentationModel->GetAppControlMode() == APPCONTROL_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::OnRequestAppExitWithMultipleSelectionAppControlResult(void)
648 AppLogDebug("ENTER");
649 IList* pIndexList = GetItemCheckedIndexListN();
651 if (pIndexList->GetCount() <= 0)
654 AppLogDebug("EXIT 1(%s)", GetErrorMessage(GetLastResult()));
658 HashMap* pMap = new (std::nothrow) HashMap(SingleObjectDeleter);
659 result r = pMap->Construct();
663 ArrayList* pArrayList = new (std::nothrow) ArrayList(SingleObjectDeleter);
664 r = pArrayList->Construct();
668 Integer* pTemp = null;
669 int loopCount = pIndexList->GetCount();
671 for (int i = 0; i < loopCount; ++i)
673 pTemp = static_cast<Integer*>(pIndexList->GetAt(i));
674 pArrayList->Add(new (std::nothrow) String(__pPresentationModel->GetContentFilePath(pTemp->ToInt())));
677 pMap->Add(new (std::nothrow) String(APPCONTROL_KEY_DATA_SELECTED), (Object*)pArrayList);
679 GalleryApp* pApp = dynamic_cast<GalleryApp*>(UiApp::GetInstance());
682 pApp->SendAppControlResult(APP_CTRL_RESULT_SUCCEEDED, pMap);
702 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
706 VideoListEditorPanel::OnSelectAllPressed(void)
708 bool needToSelectAll = true;
709 int checkedCount = GetItemCheckedCount();
710 int totalFileCount = __pPresentationModel->GetCurrentAlbumContentInfoCount();
711 if (checkedCount == totalFileCount)
713 needToSelectAll = false;
716 if (needToSelectAll == true)
718 for (int i = 0; i < totalFileCount; ++i)
720 if (__pContentIconListView->IsItemChecked(i) == false)
722 __pContentIconListView->SetItemChecked(i, true);
723 __pContentIconListView->RefreshList(i, LIST_REFRESH_TYPE_ITEM_MODIFY);
725 __pFileListEditorForm->SetFooterButtonsState(true);
730 for (int i = 0; i < totalFileCount; ++i)
732 if (__pContentIconListView->IsItemChecked(i) == true)
734 __pContentIconListView->SetItemChecked(i, false);
735 __pContentIconListView->RefreshList(i, LIST_REFRESH_TYPE_ITEM_MODIFY);
737 __pFileListEditorForm->SetFooterButtonsState(false);
742 if (needToSelectAll == true)
744 tempString.Format(LENGTH_COUNT_LABEL,
745 ResourceManager::GetString(L"IDS_VR_POP_PD_ITEMS_SELECTED").GetPointer(), totalFileCount);
749 tempString = ResourceManager::GetString(L"IDS_ST_POP_NO_ITEMS_SELECTED");
752 __pLabelSelectCnt->SetText(tempString);
753 __pLabelSelectCnt->RequestRedraw(true);
757 VideoListEditorPanel::SetButtonState(void)
759 AppLogDebug("ENTER");
761 SceneManager* pSceneManager = SceneManager::GetInstance();
762 TryReturnVoid(pSceneManager != null, "[%s] fail to get SceneManager.", GetErrorMessage(GetLastResult()));
764 if (GetItemCheckedCount() > 0)
766 __pFileListEditorForm->SetFooterButtonsState(true);
770 __pFileListEditorForm->SetFooterButtonsState(false);
773 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
777 VideoListEditorPanel::ChangeOrientation(void)
779 AppLogDebug("ENTER");
780 SceneManager* pSceneManager = SceneManager::GetInstance();
781 const Form* pForm = dynamic_cast<Form*>(pSceneManager->GetCurrentScene()->GetForm());
782 TryReturn(pForm != null, , "[%s] fail to get the form.", GetErrorMessage(GetLastResult()));
784 Rectangle clientAreaBounds = pForm->GetClientAreaBounds();
785 SetBounds(0, 0, clientAreaBounds.width, clientAreaBounds.height);
786 __pContentIconListView->SetBounds(0, 0, clientAreaBounds.width, clientAreaBounds.height);