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 GlAllListEditorPanel.cpp
19 * @brief This is the implementation file for AllListEditorPanel class.
24 #include "GlAllListEditorPanel.h"
25 #include "GlCommonUtil.h"
26 #include "GlFileListEditorForm.h"
27 #include "GlFileListPresentationModel.h"
28 #include "GlResourceManager.h"
30 #include "GlFileDeleteTimer.h"
32 using namespace Tizen::App;
33 using namespace Tizen::Base;
34 using namespace Tizen::Base::Collection;
35 using namespace Tizen::Base::Utility;
36 using namespace Tizen::Content;
37 using namespace Tizen::Graphics;
38 using namespace Tizen::Media;
39 using namespace Tizen::Ui::Controls;
40 using namespace Tizen::Ui::Scenes;
42 static const int H_SELECTALL_REGION = 112;
43 static const int H_COUNT_LABEL = 48;
44 static const int H_COUNT_LABEL_BUTTON = 42;
45 static const int W_COUNT_LABEL_BUTTON = 42;
46 static const int H_CONTENT_MARGIN = 9;
47 static const int W_CONTENT_MARGIN = 6;
48 static const int W_CONTENT_SPACE = 6;
49 static const int H_CONTENT_SPACE = 6;
50 static const int LENGTH_COUNT_LABEL = 256;
51 static const unsigned int COLOR_COUNT_LABEL = Color32<68, 68, 68>::Value;
52 static const unsigned int COLOR_SELECT_COUNT_FONT = Color32<255, 255, 255>::Value;
53 static const unsigned int COLOR_COUNT_LABEL_BUTTON = Color32<120, 120, 120>::Value;
54 static const unsigned int COLOR_SELECTALL_REGION = Color32<0x2A, 0x36, 0x4A>::Value;
55 static const Color COLOR_THUMBNAIL_DIM (Color::GetColor(COLOR_ID_BLACK));
56 static const int ALPHA_THUMBNAIL_DIM = 70;
58 static const Rectangle RECT_INITIAL (0, 0, 10, 10);
60 AllListEditorPanel::AllListEditorPanel(void)
61 : __pContentIconListView(null)
62 , __pCheckButton(null)
63 , __pLabelSelectCnt(null)
64 , __pButtonSelectRegion(null)
66 , __deleteInProgress(false)
67 , __pPresentationModel(null)
71 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
74 AllListEditorPanel::~AllListEditorPanel(void)
78 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
82 AllListEditorPanel::Initialize(void)
85 result r = Construct(RECT_INITIAL);
86 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
92 AllListEditorPanel::OnInitializing(void)
95 const Form* pForm = dynamic_cast<Form*>(GetParent());
96 TryReturn(pForm != null, E_FAILURE, "[%s] fail to get the form.", GetErrorMessage(GetLastResult()));
98 __pPresentationModel = FileListPresentationModel::GetInstance();
99 __pPresentationModel->ClearThumbnailRequests();
100 __pPresentationModel->AddPresentationModelListener(this);
102 Rectangle clientAreaBounds = pForm->GetClientAreaBounds();
103 clientAreaBounds.x = clientAreaBounds.y = 0;
104 result r = SetBounds(clientAreaBounds);
106 Panel* pCheckPanel = new (std::nothrow) Panel();
107 pCheckPanel->Construct(Rectangle(0, 0, clientAreaBounds.width, H_SELECTALL_REGION));
108 pCheckPanel->SetBackgroundColor(COLOR_SELECTALL_REGION);
109 __pCheckButton = new (std::nothrow) CheckButton();
110 __pCheckButton->Construct(pCheckPanel->GetBounds(), CHECK_BUTTON_STYLE_MARK, BACKGROUND_STYLE_DEFAULT, false,
111 ResourceManager::GetString(L"IDS_COM_BODY_SELECT_ALL"));
112 __pCheckButton->SetActionId(ACTION_ID_BUTTON_CHECKED, ACTION_ID_BUTTON_UNCHECKED);
113 __pCheckButton->AddActionEventListener(*this);
114 pCheckPanel->AddControl(*__pCheckButton);
115 AddControl(*pCheckPanel);
117 __pContentIconListView = new (std::nothrow) IconListView();
118 __pContentIconListView->Construct(Rectangle(0, H_SELECTALL_REGION, clientAreaBounds.width,
119 clientAreaBounds.height - H_COUNT_LABEL - H_SELECTALL_REGION), DIMENSION_DEFAULT_THUMBNAIL,
120 ICON_LIST_VIEW_STYLE_MARK, ICON_LIST_VIEW_SCROLL_DIRECTION_VERTICAL);
121 Bitmap* pBitmapEmpty = ResourceManager::GetBitmapN(IDB_LISTVIEW_EMPTY);
122 if (pBitmapEmpty != null)
124 __pContentIconListView->SetBitmapOfEmptyList(pBitmapEmpty);
128 __pContentIconListView->SetTextOfEmptyList(ResourceManager::GetString(L"IDS_COM_BODY_NO_ITEMS"));
129 __pContentIconListView->SetMargin(MARGIN_TYPE_LEFT, W_CONTENT_MARGIN);
130 __pContentIconListView->SetMargin(MARGIN_TYPE_RIGHT, W_CONTENT_MARGIN);
131 __pContentIconListView->SetMargin(MARGIN_TYPE_TOP, H_CONTENT_MARGIN);
132 __pContentIconListView->SetItemSpacing(W_CONTENT_SPACE, H_CONTENT_SPACE);
133 __pContentIconListView->SetItemBorderStyle(ICON_LIST_VIEW_ITEM_BORDER_STYLE_NONE);
134 __pContentIconListView->SetItemProvider(*this);
135 __pContentIconListView->SetCheckBoxPosition(ICON_LIST_VIEW_CHECK_BOX_POSITION_TOP_LEFT);
136 __pContentIconListView->AddIconListViewItemEventListener(*this);
137 __pContentIconListView->SetTouchAnimationEnabled(false);
138 AddControl(*__pContentIconListView);
139 __pContentIconListView->SetShowState(true);
141 __pLabelSelectCnt = new (std::nothrow) Label();
143 strTmp.Format(LENGTH_COUNT_LABEL, L"%ls (%d)",
144 ResourceManager::GetString(L"IDS_COM_BODY_SELECTED").GetPointer(), 0);
145 __pLabelSelectCnt->Construct(
146 Rectangle(0, clientAreaBounds.height-H_COUNT_LABEL, clientAreaBounds.width, H_COUNT_LABEL), strTmp);
147 __pLabelSelectCnt->SetTextVerticalAlignment(ALIGNMENT_MIDDLE);
148 __pLabelSelectCnt->SetTextHorizontalAlignment(ALIGNMENT_CENTER);
149 __pLabelSelectCnt->SetBackgroundColor(COLOR_COUNT_LABEL);
150 __pLabelSelectCnt->SetTextColor(Color(COLOR_SELECT_COUNT_FONT));
151 AddControl(*__pLabelSelectCnt);
152 __pLabelSelectCnt->Invalidate(true);
154 __pButtonSelectRegion = new (std::nothrow) Button();
155 __pButtonSelectRegion->Construct(Rectangle(clientAreaBounds.width - W_COUNT_LABEL_BUTTON - 10,
156 clientAreaBounds.height - H_COUNT_LABEL_BUTTON - 4, W_COUNT_LABEL_BUTTON, H_COUNT_LABEL_BUTTON),
158 __pButtonSelectRegion->SetActionId(ACTION_ID_BUTTON_MOVE_TO_SELECTION);
159 __pButtonSelectRegion->SetColor(BUTTON_STATUS_NORMAL, COLOR_COUNT_LABEL_BUTTON);
160 Bitmap* pSelectionBitmap = ResourceManager::GetBitmapN(IDB_BUTTON_MOVE_SELECTION);
161 if (pSelectionBitmap != null)
163 Rectangle buttonRegionRect = __pButtonSelectRegion->GetBounds();
164 pSelectionBitmap->Scale(Dimension(buttonRegionRect.width, buttonRegionRect.height));
165 __pButtonSelectRegion->SetNormalBitmap(Point(buttonRegionRect.width, buttonRegionRect.height),
168 AddControl(*__pButtonSelectRegion);
170 if (pSelectionBitmap != null)
172 delete pSelectionBitmap;
173 pSelectionBitmap = null;
175 __pButtonSelectRegion->AddActionEventListener(*this);
178 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
184 AllListEditorPanel::OnTerminating(void)
186 AppLogDebug("ENTER");
187 __pPresentationModel->RemovePresentationModelListener(*this);
188 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
194 AllListEditorPanel::OnUpdateContentList()
196 AppLogDebug("ENTER");
197 SceneManager* pSceneManager = SceneManager::GetInstance();
198 FileListEditorForm* pFileListEditorForm =
199 dynamic_cast<FileListEditorForm*>(pSceneManager->GetCurrentScene()->GetForm());
200 TryReturnVoid(pFileListEditorForm != null, "[%s] fail to get SceneManager.",
201 GetErrorMessage(GetLastResult()));
203 if ( pFileListEditorForm->GetOverlayStatus() == false && __deleteInProgress == false )
205 SceneManager* pSceneManager = SceneManager::GetInstance();
206 pSceneManager->GoForward(ForwardSceneTransition(IDSCN_ALL_LIST));
207 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
212 AllListEditorPanel::OnActionPerformed(const Control& source, int actionId)
214 AppLogDebug("ENTER");
215 SceneManager* pSceneManager = SceneManager::GetInstance();
216 TryReturnVoid(pSceneManager != null, "[%s] fail to get SceneManager.", GetErrorMessage(GetLastResult()));
220 case ACTION_ID_BUTTON_CHECKED:
222 int loopCount = __pPresentationModel->GetCurrentAlbumContentInfoCount();
223 for (int i=0 ; i < loopCount; ++i)
225 if (__pContentIconListView->IsItemChecked(i) == false)
227 __pContentIconListView->SetItemChecked(i,true);
228 __pContentIconListView->RefreshList(i, LIST_REFRESH_TYPE_ITEM_MODIFY);
231 int checkedCount = GetItemCheckedCount();
233 strTmp.Format(LENGTH_COUNT_LABEL, L"%ls (%d)",
234 ResourceManager::GetString(L"IDS_COM_BODY_SELECTED").GetPointer(), checkedCount);
235 __pLabelSelectCnt->SetText(strTmp);
236 __pLabelSelectCnt->RequestRedraw(true);
240 case ACTION_ID_BUTTON_UNCHECKED:
242 int loopCount = __pPresentationModel->GetCurrentAlbumContentInfoCount();
243 for (int i = 0; i < loopCount; ++i)
245 if (__pContentIconListView->IsItemChecked(i) == true)
247 __pContentIconListView->SetItemChecked(i,false);
250 int checkedCount = GetItemCheckedCount();
252 strTmp.Format(LENGTH_COUNT_LABEL, L"%ls (%d)",
253 ResourceManager::GetString(L"IDS_COM_BODY_SELECTED").GetPointer(), checkedCount);
254 __pLabelSelectCnt->SetText(strTmp);
255 __pLabelSelectCnt->RequestRedraw(true);
256 __pContentIconListView->UpdateList();
260 case ACTION_ID_BUTTON_MOVE_TO_SELECTION:
262 if (pSceneManager->GetCurrentSceneId() == IDSCN_ALL_LIST_EDITOR)
264 IList* pList = GetItemCheckedIndexListN();
267 pList = new (std::nothrow) ArrayList(SingleObjectDeleter);
269 pSceneManager->GoForward(ForwardSceneTransition(IDSCN_ALL_LIST_SELECTION), pList);
273 pSceneManager->GoForward(ForwardSceneTransition(IDSCN_ALL_LIST_SELECTION));
282 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
286 AllListEditorPanel::GetItemCount(void)
288 AppLogDebug("ENTER");
289 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
295 AllListEditorPanel::CreateItem(int index)
297 AppLogDebug("ENTER : index(%d)", index);
298 IconListViewItem* pIconListviewItem;
299 Bitmap* pBitmap=null;
300 String* pItemText=null;
301 result r = __pPresentationModel->GetThumbnailInSyncCacheN(index, pItemText, pBitmap);
302 if (pBitmap == null || r == E_FAILURE)
304 __pPresentationModel->RequestThumbnail(index);
305 pBitmap = CommonUtil::GetEmptyThumbnailN();
308 if (pItemText == null)
310 pItemText = new (std::nothrow) String(ResourceManager::GetString(L"EMPTY_SPACE"));
312 else if ((*pItemText) != ResourceManager::GetString(L"EMPTY_SPACE"))
315 pItemText = new (std::nothrow) String(ResourceManager::GetString(L"EMPTY_SPACE"));
318 if (__pContentIconListView->IsItemChecked(index) == true)
322 BufferInfo bufferInfo;
323 pBitmap->Lock(bufferInfo, INFINITE);
325 Color dimColor(COLOR_THUMBNAIL_DIM);
326 dimColor.SetAlpha(ALPHA_THUMBNAIL_DIM);
329 canvas.Construct(bufferInfo);
330 canvas.FillRectangle(dimColor, canvas.GetBounds());
332 Bitmap* pSelectedBitmap = new (std::nothrow) Bitmap();
333 pSelectedBitmap->Construct(canvas, canvas.GetBounds());
334 pIconListviewItem = new (std::nothrow) IconListViewItem();
335 pIconListviewItem->Construct(*pBitmap, pItemText, pSelectedBitmap);
336 delete pSelectedBitmap;
337 pSelectedBitmap = null;
341 AppLogDebug("EXIT 1(%s)", GetErrorMessage(GetLastResult()));
347 pIconListviewItem = new (std::nothrow) IconListViewItem();
348 pIconListviewItem->Construct(*pBitmap, pItemText);
356 if (pItemText != null)
361 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
363 return pIconListviewItem;
367 AllListEditorPanel::DeleteItem(int index, IconListViewItem* pItem)
369 AppLogDebug("ENTER");
371 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
377 AllListEditorPanel::OnIconListViewItemStateChanged(IconListView& view, int index, IconListViewItemStatus status)
379 AppLogDebug("ENTER");
380 if (status == ICON_LIST_VIEW_ITEM_CHECKED || status == ICON_LIST_VIEW_ITEM_UNCHECKED)
382 int checkedCount = GetItemCheckedCount();
384 strTmp.Format(LENGTH_COUNT_LABEL, L"%ls (%d)",
385 ResourceManager::GetString(L"IDS_COM_BODY_SELECTED").GetPointer(), checkedCount);
386 __pLabelSelectCnt->SetText(strTmp);
387 __pLabelSelectCnt->RequestRedraw(true);
388 if (__pCheckButton->IsSelected() == true)
390 __pCheckButton->SetSelected(false);
394 if (checkedCount != 0 && checkedCount == __pPresentationModel->GetCurrentAlbumContentInfoCount())
396 __pCheckButton->SetSelected(true);
399 __pContentIconListView->RefreshList(index, LIST_REFRESH_TYPE_ITEM_MODIFY);
402 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
406 AllListEditorPanel::OnFileInfoChanged(const ContentType contentType)
408 AppLogDebug("ENTER");
409 if (contentType == CONTENT_TYPE_ALL
410 || contentType == CONTENT_TYPE_IMAGE
411 || contentType == CONTENT_TYPE_VIDEO)
413 __pPresentationModel->RefreshCurrentAlbumContentInfoList(CONTENT_TYPE_ALL);
414 __itemCount = __pPresentationModel->GetCurrentAlbumContentInfoCount();
415 __pContentIconListView->UpdateList();
417 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
421 AllListEditorPanel::OnThumbnailDecoded(const int index)
423 AppLogDebug("ENTER : index(%d)", index);
426 __pContentIconListView->RefreshList(index, LIST_REFRESH_TYPE_ITEM_MODIFY);
428 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
432 AllListEditorPanel::OnSceneActivatedN(const SceneId& previousSceneId,
433 const SceneId& currentSceneId, IList* pArgs)
435 AppLogDebug("ENTER");
436 __pPresentationModel = FileListPresentationModel::GetInstance();
438 SceneManager* pSceneManager = SceneManager::GetInstance();
439 TryReturnVoid(pSceneManager != null, "[%s] fail to get SceneManager.", GetErrorMessage(GetLastResult()));
441 if (previousSceneId == IDSCN_ALL_LIST_SELECTION)
445 else if (previousSceneId == IDSCN_ALL_LIST)
452 FileListEditorForm* pFileListEditorForm =
453 dynamic_cast<FileListEditorForm*>(pSceneManager->GetCurrentScene()->GetForm());
454 TryReturnVoid(pFileListEditorForm != null, "[%s] fail to get SceneManager.",
455 GetErrorMessage(GetLastResult()));
457 pFileListEditorForm->SetTitleText(ResourceManager::GetString(L"IDS_COM_BODY_EDIT"));
459 if (pArgs != null && pArgs->GetCount() > 0)
461 String* pDirectory = static_cast<String*>(pArgs->GetAt(0));
462 if (pDirectory != null && pDirectory->GetLength() > 0)
464 pFileListEditorForm->MoveToAlbum(*pDirectory);
468 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
472 AllListEditorPanel::OnSceneDeactivated(const SceneId& currentSceneId, const SceneId& nextSceneId)
474 AppLogDebug("ENTER");
475 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
479 AllListEditorPanel::GetItemCheckedCount(void) const
481 AppLogDebug("ENTER");
483 if (__pContentIconListView != null)
485 int loopCount = __pPresentationModel->GetCurrentAlbumContentInfoCount();
486 for (int i = 0; i < loopCount; ++i)
488 if (__pContentIconListView->IsItemChecked(i))
494 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
500 AllListEditorPanel::GetItemCheckedIndexListN(void) const
502 AppLogDebug("ENTER");
503 IList* pList = new (std::nothrow) ArrayList(SingleObjectDeleter);
504 Integer* pIndex = null;
506 if (__pContentIconListView!=null)
508 int loopCount = __pPresentationModel->GetCurrentAlbumContentInfoCount();
509 for (int i = 0; i < loopCount; ++i)
511 if (__pContentIconListView->IsItemChecked(i) == true)
513 pIndex = new (std::nothrow) Integer(i);
515 AppLogDebug("checked index(%d)", i);
519 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
525 AllListEditorPanel::OnRequestDelete(void)
527 AppLogDebug("ENTER");
528 IList* pIndexList = GetItemCheckedIndexListN();
529 if (pIndexList->GetCount() <= 0)
532 AppLogDebug("EXIT 1(%s)", GetErrorMessage(GetLastResult()));
537 delete __pFileDelete;
538 __pFileDelete = new FileDeleteTimer(pIndexList,
539 __pPresentationModel,
541 result r = __pFileDelete->StartTimer();
545 delete __pFileDelete;
546 __pFileDelete = null;
551 __deleteInProgress = true;
556 void AllListEditorPanel::OnFileOpInvalidate(enum FileActionMode actionId)
558 SceneManager* pSceneManager = SceneManager::GetInstance();
559 FileListEditorForm* pFileListEditorForm =
560 dynamic_cast<FileListEditorForm*>(pSceneManager->GetCurrentScene()->GetForm());
561 TryReturnVoid(pFileListEditorForm != null, "[%s] fail to get SceneManager.",
562 GetErrorMessage(GetLastResult()));
563 pFileListEditorForm->Invalidate(true);
566 void AllListEditorPanel::OnFileOpComplete(enum FileActionMode actionId, enum FileActionCompleteRes res)
568 __pCheckButton->SetSelected(false);
569 __deleteInProgress = false;
572 strTmp.Format(LENGTH_COUNT_LABEL, L"%ls (%d)",
573 ResourceManager::GetString(L"IDS_COM_BODY_SELECTED").GetPointer(), 0);
574 __pLabelSelectCnt->SetText(strTmp);
575 __pLabelSelectCnt->RequestRedraw(true);
577 __pPresentationModel->RefreshCurrentAlbumContentInfoList(CONTENT_TYPE_ALL);
578 __itemCount = __pPresentationModel->GetCurrentAlbumContentInfoCount();
579 __pContentIconListView->UpdateList();
581 SceneManager* pSceneManager = SceneManager::GetInstance();
582 if (GetItemCount() > 0)
584 pSceneManager->GoForward(ForwardSceneTransition(IDSCN_ALL_LIST));
588 pSceneManager->GoForward(ForwardSceneTransition(IDSCN_ALBUM_LIST));
590 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
594 AllListEditorPanel::OnRequestMessage(void)
596 AppLogDebug("ENTER");
597 IList* pIndexList = GetItemCheckedIndexListN();
598 if (pIndexList == null || pIndexList->GetCount() <= 0)
600 AppLogDebug("EXIT 1(%s)", GetErrorMessage(GetLastResult()));
607 Integer* pIndex = null;
610 int loopCount = pIndexList->GetCount();
611 AppLogDebug("pIndexList->GetCount(%d)", loopCount);
612 for (int i = 0; i < loopCount; ++i)
614 pIndex = static_cast<Integer*>(pIndexList->GetAt(i));
617 checkedIndex = pIndex->ToInt();
618 path = __pPresentationModel->GetContentFilePath(checkedIndex);
621 if (combineText.CompareTo(EMPTY_SPACE) != 0)
623 combineText.Append(L";");
625 combineText.Append(path);
628 HashMap* pDataList = new (std::nothrow) HashMap(SingleObjectDeleter);
629 pDataList->Construct();
630 pDataList->Add(new (std::nothrow) String(APPCONTROL_KEY_TYPE), new (std::nothrow) String(APPCONTROL_DATA_MMS));
631 pDataList->Add(new (std::nothrow) String(APPCONTROL_KEY_ATTACHMENTS), new (std::nothrow) String(combineText));
633 __pPresentationModel->StartAppControl(APPCONTROL_PROVIDER_ID_MESSAGE, APPCONTROL_OPERATION_ID_COMPOSE,
635 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
641 AllListEditorPanel::OnRequestEmail(void)
643 AppLogDebug("ENTER");
644 IList* pIndexList = GetItemCheckedIndexListN();
645 if (pIndexList == null || pIndexList->GetCount() <= 0)
647 AppLogDebug("EXIT 1(%s)", GetErrorMessage(GetLastResult()));
654 Integer* pIndex = null;
657 int loopCount = pIndexList->GetCount();
658 AppLogDebug("pIndexList->GetCount(%d)", loopCount);
659 for (int i = 0; i < loopCount; ++i)
661 pIndex = static_cast<Integer*>(pIndexList->GetAt(i));
664 checkedIndex = pIndex->ToInt();
665 path = __pPresentationModel->GetContentFilePath(checkedIndex);
668 if (combineText.CompareTo(EMPTY_SPACE) != 0)
670 combineText.Append(L";");
672 combineText.Append(path);
675 HashMap* pDataList = new (std::nothrow) HashMap(SingleObjectDeleter);
676 pDataList->Construct();
677 pDataList->Add(new (std::nothrow) String(APPCONTROL_KEY_ATTACHMENTS), new (std::nothrow) String(combineText));
679 __pPresentationModel->StartAppControl(APPCONTROL_PROVIDER_ID_EMAIL, APPCONTROL_OPERATION_ID_COMPOSE,
681 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
687 AllListEditorPanel::OnRequestSlideShow(void)
689 AppLogDebug("ENTER");
690 IList* pIndexList = GetItemCheckedIndexListN();
691 if (pIndexList == null)
693 AppLogDebug("EXIT 1(%s)", GetErrorMessage(GetLastResult()));
698 HashMap* pDataList = new (std::nothrow) HashMap(SingleObjectDeleter);
699 result r = pDataList->Construct();
706 AppLogDebug("EXIT 2(%s)", GetErrorMessage(GetLastResult()));
711 pDataList->Add(new (std::nothrow) String(APPCONTROL_KEY_TYPE),
712 new (std::nothrow) String(APPCONTROL_DATA_SLIDE_SHOW));
714 Integer* pRealIndex = null;
719 int loopCount = pIndexList->GetCount();
722 for (int i = 0; i < loopCount; ++i)
724 pRealIndex = static_cast<Integer*>(pIndexList->GetAt(i));
725 if (pRealIndex != null)
727 realIndex = pRealIndex->ToInt();
730 path = __pPresentationModel->GetContentFilePath(realIndex);
731 if (combineText.CompareTo(EMPTY_SPACE) != 0)
733 combineText.Append(L";");
735 combineText.Append(path);
737 pDataList->Add(new (std::nothrow) String(APPCONTROL_KEY_PATH), new (std::nothrow) String(combineText));
742 __pPresentationModel->StartAppControl(APPCONTROL_PROVIDER_ID_IMAGE,
743 APPCONTROL_OPERATION_ID_VIEW, pDataList, null);
744 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
750 AllListEditorPanel::ResetSelection(void)
752 AppLogDebug("ENTER");
753 __pPresentationModel->RefreshCurrentAlbumContentInfoList(CONTENT_TYPE_ALL);
754 __itemCount = __pPresentationModel->GetCurrentAlbumContentInfoCount();
755 __pContentIconListView->UpdateList();
757 int checkedCount = GetItemCheckedCount();
759 strTmp.Format(LENGTH_COUNT_LABEL, L"%ls (%d)",
760 ResourceManager::GetString(L"IDS_COM_BODY_SELECTED").GetPointer(), checkedCount);
761 __pLabelSelectCnt->SetText(strTmp);
762 __pLabelSelectCnt->RequestRedraw(true);
763 __pCheckButton->SetSelected(false);
765 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
769 AllListEditorPanel::SetButtonState(void)
771 AppLogDebug("ENTER");
772 SceneManager* pSceneManager = SceneManager::GetInstance();
773 TryReturnVoid(pSceneManager != null, "[%s] fail to get SceneManager.", GetErrorMessage(GetLastResult()));
775 FileListEditorForm* pFileListEditorForm =
776 dynamic_cast<FileListEditorForm*>(pSceneManager->GetCurrentScene()->GetForm());
777 TryReturnVoid(pFileListEditorForm != null, "[%s] fail to get SceneManager.",
778 GetErrorMessage(GetLastResult()));
780 if (GetItemCheckedCount() > 0)
782 AppLogDebug("BUTTONSTATE : Request Enable");
783 pFileListEditorForm->SetFooterButtonsState(true);
784 __pButtonSelectRegion->SetShowState(true);
788 AppLogDebug("BUTTONSTATE : Request disable");
789 pFileListEditorForm->SetFooterButtonsState(false);
790 __pButtonSelectRegion->SetShowState(false);
792 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));