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 GlAlbumListEditorForm.cpp
19 * @brief This is the implementation file for AlbumListEditorForm class.
22 #include "GlAlbumInfo.h"
23 #include "GlAlbumListEditorForm.h"
24 #include "GlAlbumListPresentationModel.h"
25 #include "GlResourceManager.h"
28 using namespace Tizen::App;
29 using namespace Tizen::Base;
30 using namespace Tizen::Base::Collection;
31 using namespace Tizen::Content;
32 using namespace Tizen::Graphics;
33 using namespace Tizen::Io;
34 using namespace Tizen::Media;
35 using namespace Tizen::System;
36 using namespace Tizen::Ui;
37 using namespace Tizen::Ui::Controls;
38 using namespace Tizen::Ui::Scenes;
40 static const unsigned int COLOR_DELETE_BUTTON_NORMAL = Color32<208, 82, 82>::Value;
41 static const unsigned int COLOR_DELETE_BUTTON_PRESSED = Color32<194, 71, 71>::Value;
42 static const unsigned int COLOR_DELETE_BUTTON_TEXT = Color32<248, 246, 239>::Value;
43 static const String RESERVED_MEDIA_PATH = Environment::GetMediaPath();
45 static const int GAP_W_POPUP_ITEM = 5;
46 static const int W_DELETE_POPUP = 600;
47 static const int H_DELETE_POPUP = 300;
48 static const int H_DELETE_LABEL = 180;
49 static const int Y_DELETE_BUTTON = 180;
50 static const int H_DELETE_BUTTON = 80;
52 static const int FORMAT_BUFFER_SIZE = 256;
54 static const int X_POSITION_SHARE_CONTEXTMENU = 280;
55 static const int Y_POSITION_SHARE_CONTEXTMENU = 1140;
57 static const Color COLOR_FOLDER_BITMAP_DIM(Color::GetColor(COLOR_ID_BLACK));
58 static const int ALPHA_FOLDER_BITMAP_DIM = 70;
60 static const int IDA_ALBUM_EDIT = 503 ;
62 AlbumListEditorForm::AlbumListEditorForm(void)
64 , __pSelectCountLabel(null)
65 , __pEditorFolderIconList(null)
66 , __pShareContextMenu(null)
67 , __pDeletePopup(null)
68 , __pFileUpdateTimer(null)
69 , __pPresentationModel(null)
72 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
75 AlbumListEditorForm::~AlbumListEditorForm(void)
78 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
82 AlbumListEditorForm::Initialize(void)
85 result r = Form::Construct(IDL_FORM_ALBUM_LIST_EDITOR);
86 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
92 AlbumListEditorForm::OnInitializing(void)
96 __pPresentationModel = AlbumListPresentationModel::GetInstance();
97 __pPresentationModel->ClearThumbnailRequests();
98 r = __pPresentationModel->AddPresentationModelListener(this);
100 SetFormBackEventListener(this);
101 GetHeader()->AddActionEventListener(*this);
102 GetFooter()->AddActionEventListener(*this);
104 r = InitializeControl();
107 AppLogDebug("[%s] Unable to set InitializeControl.", GetErrorMessage(r));
110 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
116 AlbumListEditorForm::OnTerminating(void)
118 AppLogDebug("ENTER");
119 result r = E_SUCCESS;
120 r = __pPresentationModel->RemovePresentationModelListener(*this);
122 if (__pDeletePopup != null)
124 delete __pDeletePopup;
125 __pDeletePopup = null;
127 if (__pFileUpdateTimer != null)
129 delete __pFileUpdateTimer;
130 __pFileUpdateTimer = null;
132 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
138 AlbumListEditorForm::OnContentUpdated(void)
140 AppLogDebug("ENTER");
141 SceneManager* pSceneManager = SceneManager::GetInstance();
142 pSceneManager->GoForward(ForwardSceneTransition(IDSCN_ALBUM_LIST));
143 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
147 AlbumListEditorForm::InitializeControl(void)
149 AppLogDebug("ENTER");
150 result r = E_SUCCESS;
153 CreateIconListView();
154 __checkedCount = GetCheckedFolderCount();
156 __pSelectCountLabel = static_cast<Label*>(GetControl(L"IDC_LABEL_ALBUM_LIST_EDITOR_SELECTED"));
157 AppAssert(__pSelectCountLabel);
159 __pShareContextMenu = new (std::nothrow) ContextMenu();
160 r = __pShareContextMenu->Construct(Point(X_POSITION_SHARE_CONTEXTMENU, Y_POSITION_SHARE_CONTEXTMENU),
161 CONTEXT_MENU_STYLE_LIST);
162 r = __pShareContextMenu->AddItem(ResourceManager::GetString(L"IDS_COM_BODY_MESSAGE"),
163 IDA_CONTEXT_MENU_MESSAGE);
164 r = __pShareContextMenu->AddItem(ResourceManager::GetString(L"IDS_COM_BODY_EMAIL"), IDA_CONTEXT_MENU_EMAIL);
165 __pShareContextMenu->AddActionEventListener(*this);
167 r = InitializePopup();
168 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
174 AlbumListEditorForm::InitializePopup(void)
176 AppLogDebug("ENTER");
177 if (__pDeletePopup == null)
179 __pDeletePopup = new (std::nothrow) Popup();
180 __pDeletePopup->Construct(false, Dimension(W_DELETE_POPUP, H_DELETE_POPUP));
182 Rectangle popupClientBounds = __pDeletePopup->GetClientAreaBounds();
184 Label* pLabel = new (std::nothrow) Label();
185 pLabel->Construct(Rectangle(0, 0, popupClientBounds.width, H_DELETE_LABEL),
186 ResourceManager::GetString(L"IDS_COM_POP_DELETE_Q"));
188 Button* pDeleteButton = new (std::nothrow) Button();
189 pDeleteButton->Construct(
190 Rectangle(0, Y_DELETE_BUTTON, popupClientBounds.width / 2 - GAP_W_POPUP_ITEM, H_DELETE_BUTTON),
191 ResourceManager::GetString(L"IDS_COM_BODY_DELETE"));
192 pDeleteButton->SetColor(BUTTON_STATUS_NORMAL, COLOR_DELETE_BUTTON_NORMAL);
193 pDeleteButton->SetColor(BUTTON_STATUS_PRESSED, COLOR_DELETE_BUTTON_PRESSED);
194 pDeleteButton->SetTextColor(COLOR_DELETE_BUTTON_TEXT);
195 pDeleteButton->SetActionId(IDA_DELETE_POPUP_DEL);
196 pDeleteButton->AddActionEventListener(*this);
198 Button* pCancelButton = new (std::nothrow) Button();
199 pCancelButton->Construct(
200 Rectangle(popupClientBounds.width / 2 + GAP_W_POPUP_ITEM, Y_DELETE_BUTTON,
201 popupClientBounds.width / 2 - GAP_W_POPUP_ITEM, H_DELETE_BUTTON),
202 ResourceManager::GetString(L"IDS_COM_POP_CANCEL"));
203 pCancelButton->SetActionId(IDA_DELETE_POPUP_CANCEL);
204 pCancelButton->AddActionEventListener(*this);
206 __pDeletePopup->AddControl(*pLabel);
207 __pDeletePopup->AddControl(*pDeleteButton);
208 __pDeletePopup->AddControl(*pCancelButton);
212 __pDeletePopup->SetShowState(true);
213 __pDeletePopup->Show();
215 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
221 AlbumListEditorForm::CreateIconListView(void)
223 AppLogDebug("ENTER");
224 __pEditorFolderIconList = static_cast<IconListView*>(GetControl(L"IDC_ICONLISTVIEW_ALBUM_LIST_EDITOR"));
225 AppAssert(__pEditorFolderIconList);
227 __pEditorFolderIconList->SetItemProvider(*this);
228 __pEditorFolderIconList->AddIconListViewItemEventListener(*this);
229 __pEditorFolderIconList->SetShowState(true);
230 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
234 AlbumListEditorForm::GetItemCount(void)
236 AppLogDebug("ENTER");
237 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
239 return __pPresentationModel->GetFolderCount();
243 AlbumListEditorForm::CreateItem(int index)
245 AppLogDebug("ENTER : index(%d)", index);
246 Bitmap* pBitmap = null;
247 Canvas* pEditAlbumCanvas = null;
248 Bitmap* pEditAlbumBitmap = null;
249 Bitmap* pBitmapRenameBg = null;
250 Bitmap* pBitmapRename = null;
252 int canvasWidth = 64;
253 int canvasHeight = 64;
255 IconListViewItem* pIconListviewItem = new (std::nothrow) IconListViewItem();
257 IList* pAlbumInfoList = __pPresentationModel->GetAlbumInfoList();
258 AlbumInfo* pAlbumInfo = static_cast<AlbumInfo*>(pAlbumInfoList->GetAt(index));
260 Bitmap* pAlbumBitmap = pAlbumInfo->GetFolderThumnailBitmap();
261 if (pAlbumBitmap == null)
263 __pPresentationModel->RequestThumbnail(index, 0);
266 pBitmap = __pPresentationModel->CreateMergeBitmapN(index);
268 if (__pEditorFolderIconList->IsItemChecked(index) == true)
272 BufferInfo bufferInfo;
273 pBitmap->Lock(bufferInfo, INFINITE);
275 Color dimColor(COLOR_FOLDER_BITMAP_DIM);
276 dimColor.SetAlpha(ALPHA_FOLDER_BITMAP_DIM);
278 canvas.Construct(bufferInfo);
279 canvas.FillRectangle(dimColor, canvas.GetBounds());
280 Bitmap* pSelectedBitmap = new (std::nothrow) Bitmap();
281 pSelectedBitmap->Construct(canvas, canvas.GetBounds());
282 pIconListviewItem->Construct(*pBitmap, null, pSelectedBitmap);
283 delete pSelectedBitmap;
288 pIconListviewItem->Construct(*pBitmap);
296 pBitmapRenameBg = ResourceManager::GetBitmapN(IDB_ALBUM_EDIT_RENAME_BG);
297 pBitmapRename = ResourceManager::GetBitmapN(IDB_ALBUM_EDIT_RENAME);
299 if (pBitmapRenameBg != null && pBitmapRename != null)
302 pEditAlbumCanvas = new (std::nothrow) Canvas();
303 pEditAlbumCanvas->Construct(Rectangle(0, 0, canvasWidth, canvasHeight));
304 pEditAlbumCanvas->DrawBitmap(Point(0, 0), *pBitmapRenameBg);
305 pEditAlbumCanvas->DrawBitmap(Point(0, 0), *pBitmapRename);
308 pEditAlbumBitmap = new (std::nothrow) Bitmap();
310 if (pEditAlbumBitmap != NULL)
312 pEditAlbumBitmap->Construct(*pEditAlbumCanvas, Rectangle(0, 0, canvasWidth, canvasHeight));
313 delete pEditAlbumCanvas;
316 albumName = pAlbumInfo->GetAlbumName();
317 String reservedCameraName = ResourceManager::GetString(L"IDS_MEDIABR_BODY_CAMERA_ROLL_ABB");
318 String albumPath = pAlbumInfo->GetDirectory(0);
319 albumPath.Append("/");
321 if (index == 0 || reservedCameraName.Equals(albumName, true) || RESERVED_MEDIA_PATH.Equals(albumPath, true))
327 pIconListviewItem->SetOverlayBitmap(IDA_ALBUM_EDIT, pEditAlbumBitmap, ALIGNMENT_RIGHT, ALIGNMENT_TOP);
330 if (pEditAlbumBitmap != null)
332 delete pEditAlbumBitmap;
336 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
338 return pIconListviewItem;
342 AlbumListEditorForm::OnIconListViewItemStateChanged(IconListView& view, int index, IconListViewItemStatus status)
344 AppLogDebug("ENTER");
346 if (status == ICON_LIST_VIEW_ITEM_CHECKED || status == ICON_LIST_VIEW_ITEM_UNCHECKED)
348 if (status == ICON_LIST_VIEW_ITEM_CHECKED)
352 else if (status == ICON_LIST_VIEW_ITEM_UNCHECKED)
358 if (__checkedCount == 0)
360 tempString = ResourceManager::GetString(L"IDS_ST_POP_NO_ITEMS_SELECTED");
362 else if (__checkedCount == 1)
364 tempString = ResourceManager::GetString(L"IDS_VR_POP_1_ITEM_SELECTED");
368 tempString.Format(FORMAT_BUFFER_SIZE, ResourceManager::GetString(L"IDS_VR_POP_PD_ITEMS_SELECTED").GetPointer(), __checkedCount);
371 __pSelectCountLabel->SetText(tempString);
372 __pSelectCountLabel->RequestRedraw();
373 __pEditorFolderIconList->RefreshList(index, LIST_REFRESH_TYPE_ITEM_MODIFY);
377 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
381 AlbumListEditorForm::OnIconListViewOverlayBitmapSelected (IconListView &iconListView, int index,
384 AppLogDebug("ENTER");
385 SceneManager* pSceneManager = SceneManager::GetInstance();
387 ArrayList* pSelectedIndex = new (std::nothrow) ArrayList(SingleObjectDeleter);
388 pSelectedIndex->Construct();
389 //Adding the Action Type
390 pSelectedIndex->Add(new (std::nothrow) Integer(ALBUM_RENAME));
391 pSelectedIndex->Add(new (std::nothrow) Integer(FILE_ACTION_MOVE));
392 pSelectedIndex->Add(new (std::nothrow) Integer(index));
394 pSceneManager->GoForward(ForwardSceneTransition(IDSCN_ALBUM_NAME_EDITOR), pSelectedIndex);
395 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
399 AlbumListEditorForm::DeleteItem(int index, IconListViewItem* pItem)
401 AppLogDebug("ENTER");
403 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
409 AlbumListEditorForm::DeleteFolder(void)
412 AppLogDebug("ENTER");
413 IList* pIndexList = GetItemCheckedIndexListN();
414 if (pIndexList->GetCount() <= 0)
417 AppLogDebug("EXIT 1(%s)", GetErrorMessage(GetLastResult()));
421 if (__pFileUpdateTimer != null)
423 delete __pFileUpdateTimer;
425 __pFileUpdateTimer = new (std::nothrow) FileUpdateTimer(pIndexList, __pPresentationModel, this, FILE_ACTION_DELETE);
426 result r = __pFileUpdateTimer->StartTimer();
430 delete __pFileUpdateTimer;
431 __pFileUpdateTimer = null;
436 __pPresentationModel->SetUpdateProgressStatus(true);
442 AlbumListEditorForm::GetItemCheckedIndexListN(void) const
444 AppLogDebug("ENTER");
445 IList* pList = new (std::nothrow) ArrayList(SingleObjectDeleter);
446 Integer* pIndex = null;
448 if (__pEditorFolderIconList!=null)
450 int loopCount = __pPresentationModel->GetFolderCount();
451 for (int i = 0; i < loopCount; ++i)
453 if (__pEditorFolderIconList->IsItemChecked(i) == true)
455 pIndex = new (std::nothrow) Integer(i);
457 AppLogDebug("checked index(%d)", i);
461 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
467 AlbumListEditorForm::SetAllCheckState(const bool state)
469 AppLogDebug("ENTER");
471 int maxCount = __pPresentationModel->GetFolderCount();
478 tempString = ResourceManager::GetString(L"IDS_VR_POP_1_ITEM_SELECTED;");
482 tempString.Format(FORMAT_BUFFER_SIZE,
483 ResourceManager::GetString(L"IDS_VR_POP_PD_ITEMS_SELECTED").GetPointer(), maxCount);
488 tempString = ResourceManager::GetString(L"IDS_ST_POP_NO_ITEMS_SELECTED");
491 for (int i = 0; i < maxCount; ++i)
493 __pEditorFolderIconList->SetItemChecked(i, state);
494 __pEditorFolderIconList->RefreshList(i, LIST_REFRESH_TYPE_ITEM_MODIFY);
497 __pEditorFolderIconList->Draw();
498 __pSelectCountLabel->SetText(tempString);
499 __pSelectCountLabel->RequestRedraw();
500 __checkedCount = GetCheckedFolderCount();
504 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
508 AlbumListEditorForm::GetCheckedFolderCount(void) const
510 AppLogDebug("ENTER");
511 int maxCount = __pPresentationModel->GetFolderCount();
514 for (int i = 0 ; i < maxCount; ++i)
516 if (__pEditorFolderIconList->IsItemChecked (i))
521 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
527 AlbumListEditorForm::OnActionPerformed(const Control& source, int actionId)
529 AppLogDebug("ENTER");
532 case IDA_ALBUM_LIST_SELECT_ALL:
534 if (__pPresentationModel->GetFolderCount() == GetCheckedFolderCount())
536 SetAllCheckState(false);
540 SetAllCheckState(true);
545 case IDA_FOOTER_DELETE:
547 __pDeletePopup->SetShowState(true);
548 __pDeletePopup->Show();
552 case IDA_FOOTER_SHARE:
554 __pShareContextMenu->SetShowState(true);
555 __pShareContextMenu->Show();
559 case IDA_CONTEXT_MENU_MESSAGE:
565 case IDA_CONTEXT_MENU_EMAIL:
571 case IDA_DELETE_POPUP_DEL:
573 __pDeletePopup->SetShowState(false);
574 __pDeletePopup->Show();
579 case IDA_DELETE_POPUP_CANCEL:
581 __pDeletePopup->SetShowState(false);
582 __pDeletePopup->Show();
589 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
593 AlbumListEditorForm::OnFormBackRequested(Form& source)
595 AppLogDebug("ENTER");
596 SceneManager* pSceneManager = SceneManager::GetInstance();
597 pSceneManager->GoForward(ForwardSceneTransition(IDSCN_ALBUM_LIST));
598 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
602 AlbumListEditorForm::OnSceneActivatedN(const SceneId& previousSceneId,
603 const SceneId& currentSceneId, IList* pArgs)
605 AppLogDebug("ENTER OnSceneActivatedN");
606 __pPresentationModel->InitializeAlbumInfoList(CONTENT_TYPE_ALL);
607 __pEditorFolderIconList->UpdateList();
608 __pPresentationModel->AddContentEventListener(this);
610 __checkedCount = GetCheckedFolderCount();
614 if (__checkedCount == 0)
616 tempString = ResourceManager::GetString(L"IDS_ST_POP_NO_ITEMS_SELECTED");
618 else if (__checkedCount == 1)
620 tempString = ResourceManager::GetString(L"IDS_VR_POP_1_ITEM_SELECTED");
624 tempString.Format(FORMAT_BUFFER_SIZE,
625 ResourceManager::GetString(L"IDS_VR_POP_PD_ITEMS_SELECTED").GetPointer(), __checkedCount);
628 __pSelectCountLabel->SetText(tempString);
629 __pSelectCountLabel->RequestRedraw();
632 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
636 AlbumListEditorForm::OnSceneDeactivated(const SceneId& currentSceneId, const SceneId& nextSceneId)
638 AppLogDebug("ENTER");
639 __pPresentationModel->RemoveContentEventListener(*this);
640 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
644 AlbumListEditorForm::OnFileInfoChanged(const ContentType contentType)
646 AppLogDebug("ENTER");
648 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
652 AlbumListEditorForm::OnThumbnailDecoded(const int index)
654 AppLogDebug("ENTER : index(%d)", index);
655 __pEditorFolderIconList->RefreshList(index, LIST_REFRESH_TYPE_ITEM_MODIFY);
656 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
659 void AlbumListEditorForm::OnFileOpInvalidate(enum FileActionMode actionId)
664 void AlbumListEditorForm::OnFileOpComplete(enum FileActionMode actionId, enum FileActionCompleteRes res)
666 AppLogDebug("ENTER");
667 __pPresentationModel->SetUpdateProgressStatus(false);
668 SetAllCheckState(false);
669 __pPresentationModel->InitializeAlbumInfoList(CONTENT_TYPE_ALL);
670 __pEditorFolderIconList->UpdateList();
672 SceneManager* pSceneManager = SceneManager::GetInstance();
673 AppAssert(pSceneManager);
674 pSceneManager->GoForward(ForwardSceneTransition(IDSCN_ALBUM_LIST));
678 AlbumListEditorForm::Update(void)
680 AppLogDebug("ENTER");
681 result r = __pEditorFolderIconList->UpdateList();
682 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
688 AlbumListEditorForm::OnRequestMessage(void)
690 AppLogDebug("ENTER");
692 int checkCount = GetCheckedFolderCount();
696 AppLogDebug("EXIT 1(%s)", GetErrorMessage(GetLastResult()));
701 IList* pAlbumInfoList = __pPresentationModel->GetAlbumInfoList();
703 int maxCount = __pPresentationModel->GetFolderCount();
704 ContentManager contentManager;
705 result r = contentManager.Construct();
710 AppLogDebug("EXIT 2(%s)", GetErrorMessage(GetLastResult()));
714 ArrayList* pArrayList = new (std::nothrow) ArrayList(SingleObjectDeleter);
715 pArrayList->Construct();
716 for (int i = 0; i < maxCount; ++i)
718 if (__pEditorFolderIconList->IsItemChecked (i))
720 AlbumInfo* pAlbumInfo = static_cast<AlbumInfo*>(pAlbumInfoList->GetAt(i));
721 IList* pContentIdList = pAlbumInfo->GetContentIdListN();
722 int loopCount = pContentIdList->GetCount();
723 for (int k = 0; k < loopCount; ++k)
725 ContentId* pContentId = static_cast<ContentId*>(pContentIdList->GetAt(k));
726 ContentInfo* pContentInfo = contentManager.GetContentInfoN(*pContentId);
728 if (pContentInfo == null)
733 pArrayList->Add(new (std::nothrow) String(pContentInfo->GetContentPath()));
743 HashMap* pDataList = new (std::nothrow) HashMap(SingleObjectDeleter);
744 pDataList->Construct();
745 pDataList->Add(new (std::nothrow) String(APPCONTROL_KEY_MESSAGE_TYPE), new (std::nothrow) String(APPCONTROL_DATA_MMS));
746 pDataList->Add(new (std::nothrow) String(APPCONTROL_KEY_PATH), (Object*)pArrayList);
748 __pPresentationModel->StartAppControl(APPCONTROL_PROVIDER_ID_MESSAGE, APPCONTROL_OPERATION_ID_COMPOSE,
749 null, null, pDataList, null);
751 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
755 AlbumListEditorForm::OnRequestEmail(void)
757 AppLogDebug("ENTER");
759 int checkCount = GetCheckedFolderCount();
763 AppLogDebug("EXIT 1(%s)", GetErrorMessage(GetLastResult()));
768 IList* pAlbumInfoList = __pPresentationModel->GetAlbumInfoList();
770 int maxCount = __pPresentationModel->GetFolderCount();
771 ContentManager contentManager;
772 result r = contentManager.Construct();
777 AppLogDebug("EXIT 2(%s)", GetErrorMessage(GetLastResult()));
781 ArrayList* pArrayList = new (std::nothrow) ArrayList(SingleObjectDeleter);
782 pArrayList->Construct();
783 for (int i = 0; i < maxCount; ++i)
785 if (__pEditorFolderIconList->IsItemChecked(i))
787 AlbumInfo* pAlbumInfo = static_cast<AlbumInfo*>(pAlbumInfoList->GetAt(i));
788 IList* pContentIdList = pAlbumInfo->GetContentIdListN();
789 int loopCount = pContentIdList->GetCount();
790 for (int k = 0; k < loopCount; ++k)
792 ContentId* pContentId = static_cast<ContentId*>(pContentIdList->GetAt(k));
793 ContentInfo* pContentInfo = contentManager.GetContentInfoN(*pContentId);
795 if (pContentInfo == null)
800 pArrayList->Add(new (std::nothrow) String(pContentInfo->GetContentPath()));
810 HashMap* pDataList = new (std::nothrow) HashMap(SingleObjectDeleter);
811 pDataList->Construct();
812 pDataList->Add(new (std::nothrow) String(APPCONTROL_KEY_PATH), (Object*)pArrayList);
814 __pPresentationModel->StartAppControl(APPCONTROL_PROVIDER_ID_EMAIL, APPCONTROL_OPERATION_ID_COMPOSE,
815 new (std::nothrow) String(APPCONTROL_URI_MAIL_TO), null, pDataList, null);
817 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
821 AlbumListEditorForm::SetFooterButtonsState(const bool enableState)
823 AppLogDebug("ENTER");
824 Footer* pFooter = GetFooter();
827 if (enableState == true)
829 pFooter->SetItemEnabled(0, true);
830 pFooter->SetItemEnabled(1, true);
834 pFooter->SetItemEnabled(0, false);
835 pFooter->SetItemEnabled(1, false);
838 pFooter->RequestRedraw(true);
839 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
843 AlbumListEditorForm::SetButtonState(void)
845 AppLogDebug("ENTER");
846 if (GetCheckedFolderCount() > 0)
848 AppLogDebug("BUTTONSTATE : Request Enable");
849 SetFooterButtonsState(true);
853 AppLogDebug("BUTTONSTATE : Request disable");
854 SetFooterButtonsState(false);
856 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));