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.
23 #include "GlAlbumInfo.h"
24 #include "GlAlbumListEditorForm.h"
25 #include "GlAlbumListPresentationModel.h"
26 #include "GlResourceManager.h"
29 using namespace Tizen::App;
30 using namespace Tizen::Base;
31 using namespace Tizen::Base::Collection;
32 using namespace Tizen::Content;
33 using namespace Tizen::Graphics;
34 using namespace Tizen::Io;
35 using namespace Tizen::Media;
36 using namespace Tizen::System;
37 using namespace Tizen::Ui;
38 using namespace Tizen::Ui::Controls;
39 using namespace Tizen::Ui::Scenes;
41 static const unsigned int COLOR_DELETE_BUTTON_NORMAL = Color32<208, 82, 82>::Value;
42 static const unsigned int COLOR_DELETE_BUTTON_PRESSED = Color32<194, 71, 71>::Value;
43 static const unsigned int COLOR_DELETE_BUTTON_TEXT = Color32<248, 246, 239>::Value;
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 = 1150;
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()
64 , __pSelectCountLabel(null)
65 , __pEditorFolderIconList(null)
66 , __pShareContextMenu(null)
67 , __pDeletePopup(null)
68 , __pPresentationModel(null)
69 , __pFileDeleteTimer(null)
73 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
76 AlbumListEditorForm::~AlbumListEditorForm()
79 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
83 AlbumListEditorForm::Initialize(void)
86 result r = Form::Construct(IDL_FORM_ALBUM_LIST_EDITOR);
87 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
93 AlbumListEditorForm::OnInitializing(void)
96 __pPresentationModel = AlbumListPresentationModel::GetInstance();
97 __pPresentationModel->ClearThumbnailRequests();
98 __pPresentationModel->AddPresentationModelListener(this);
100 SetFormBackEventListener(this);
101 GetHeader()->AddActionEventListener(*this);
102 GetFooter()->AddActionEventListener(*this);
104 result 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 __pPresentationModel->RemovePresentationModelListener(*this);
121 if (__pDeletePopup != null)
123 delete __pDeletePopup;
124 __pDeletePopup = null;
126 if (__pFileDeleteTimer != null)
128 delete __pFileDeleteTimer;
129 __pFileDeleteTimer = null;
131 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
137 AlbumListEditorForm::OnContentUpdated()
139 AppLogDebug("ENTER");
140 SceneManager* pSceneManager = SceneManager::GetInstance();
141 pSceneManager->GoForward(ForwardSceneTransition(IDSCN_ALBUM_LIST));
142 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
146 AlbumListEditorForm::InitializeControl()
148 AppLogDebug("ENTER");
151 CreateIconListView();
152 __checkedCount = GetCheckedFolderCount();
154 __pSelectCountLabel = static_cast<Label*>(GetControl(L"IDC_LABEL_ALBUM_LIST_EDITOR_SELECTED"));
155 AppAssert(__pSelectCountLabel);
157 __pShareContextMenu = new ContextMenu();
158 __pShareContextMenu->Construct(Point(X_POSITION_SHARE_CONTEXTMENU, Y_POSITION_SHARE_CONTEXTMENU),
159 CONTEXT_MENU_STYLE_LIST);
160 __pShareContextMenu->AddItem(ResourceManager::GetString(L"IDS_COM_BODY_MESSAGE"),
161 ACTION_ID_CONTEXT_MENU_MESSAGE);
162 __pShareContextMenu->AddItem(ResourceManager::GetString(L"IDS_COM_BODY_EMAIL"), ACTION_ID_CONTEXT_MENU_EMAIL);
163 __pShareContextMenu->AddActionEventListener(*this);
166 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
172 AlbumListEditorForm::InitializePopup(void)
174 AppLogDebug("ENTER");
175 if (__pDeletePopup == null)
177 __pDeletePopup = new (std::nothrow) Popup();
178 __pDeletePopup->Construct(false, Dimension(W_DELETE_POPUP, H_DELETE_POPUP));
180 Rectangle popupClientBounds = __pDeletePopup->GetClientAreaBounds();
182 Label* pLabel = new (std::nothrow) Label();
183 pLabel->Construct(Rectangle(0, 0, popupClientBounds.width, H_DELETE_LABEL),
184 ResourceManager::GetString(L"IDS_COM_POP_DELETE_Q"));
186 Button* pDeleteButton = new (std::nothrow) Button();
187 pDeleteButton->Construct(
188 Rectangle(0, Y_DELETE_BUTTON, popupClientBounds.width / 2 - GAP_W_POPUP_ITEM, H_DELETE_BUTTON),
189 ResourceManager::GetString(L"IDS_COM_BODY_DELETE"));
190 pDeleteButton->SetColor(BUTTON_STATUS_NORMAL, COLOR_DELETE_BUTTON_NORMAL);
191 pDeleteButton->SetColor(BUTTON_STATUS_PRESSED, COLOR_DELETE_BUTTON_PRESSED);
192 pDeleteButton->SetTextColor(COLOR_DELETE_BUTTON_TEXT);
193 pDeleteButton->SetActionId(ACTION_ID_DELETE_POPUP_DEL);
194 pDeleteButton->AddActionEventListener(*this);
196 Button* pCancelButton = new (std::nothrow) Button();
197 pCancelButton->Construct(
198 Rectangle(popupClientBounds.width / 2 + GAP_W_POPUP_ITEM, Y_DELETE_BUTTON,
199 popupClientBounds.width / 2 - GAP_W_POPUP_ITEM, H_DELETE_BUTTON),
200 ResourceManager::GetString(L"IDS_COM_POP_CANCEL"));
201 pCancelButton->SetActionId(ACTION_ID_DELETE_POPUP_CANCEL);
202 pCancelButton->AddActionEventListener(*this);
204 __pDeletePopup->AddControl(*pLabel);
205 __pDeletePopup->AddControl(*pDeleteButton);
206 __pDeletePopup->AddControl(*pCancelButton);
210 __pDeletePopup->SetShowState(true);
211 __pDeletePopup->Show();
213 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
219 AlbumListEditorForm::CreateIconListView(void)
221 AppLogDebug("ENTER");
222 __pEditorFolderIconList = static_cast< IconListView* >(GetControl(L"IDC_ICONLISTVIEW_ALBUM_LIST_EDITOR"));
223 AppAssert(__pEditorFolderIconList);
225 __pEditorFolderIconList->SetItemProvider(*this);
226 __pEditorFolderIconList->AddIconListViewItemEventListener(*this);
227 __pEditorFolderIconList->SetShowState(true);
228 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
232 AlbumListEditorForm::GetItemCount(void)
234 AppLogDebug("ENTER");
235 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
237 return __pPresentationModel->GetFolderCount();
241 AlbumListEditorForm::CreateItem(int index)
243 AppLogDebug("ENTER : index(%d)", index);
244 Bitmap* pBitmap = null;
245 Canvas* pEditAlbumCanvas = null;
246 Bitmap* pEditAlbumBitmap = null;
247 Bitmap* pBitmapRenameBg = null;
248 Bitmap* pBitmapRename = null;
250 int canvasWidth = 64;
251 int canvasHeight = 64;
253 IconListViewItem* pIconListviewItem = new IconListViewItem();
255 IList* pAlbumInfoList = __pPresentationModel->GetAlbumInfoList();
256 AlbumInfo* pAlbumInfo = static_cast<AlbumInfo*>(pAlbumInfoList->GetAt(index));
258 Bitmap* pAlbumBitmap = pAlbumInfo->GetFolderThumnailBitmap();
259 if (pAlbumBitmap == null)
261 __pPresentationModel->RequestThumbnail(index, 0);
264 pBitmap = __pPresentationModel->CreateMergeBitmapN(index);
266 if (__pEditorFolderIconList->IsItemChecked(index) == true)
270 BufferInfo bufferInfo;
271 pBitmap->Lock(bufferInfo, INFINITE);
273 Color dimColor(COLOR_FOLDER_BITMAP_DIM);
274 dimColor.SetAlpha(ALPHA_FOLDER_BITMAP_DIM);
276 canvas.Construct(bufferInfo);
277 canvas.FillRectangle(dimColor, canvas.GetBounds());
278 Bitmap* pSelectedBitmap = new (std::nothrow) Bitmap();
279 pSelectedBitmap->Construct(canvas, canvas.GetBounds());
280 pIconListviewItem->Construct(*pBitmap, null, pSelectedBitmap);
281 delete pSelectedBitmap;
286 pIconListviewItem->Construct(*pBitmap);
294 pBitmapRenameBg = ResourceManager::GetBitmapN(IDB_ALBUM_EDIT_RENAME_BG);
295 pBitmapRename = ResourceManager::GetBitmapN(IDB_ALBUM_EDIT_RENAME);
297 if (pBitmapRenameBg != null && pBitmapRename != null)
300 pEditAlbumCanvas = new (std::nothrow) Canvas();
301 pEditAlbumCanvas->Construct(Rectangle(0,0,canvasWidth,canvasHeight));
302 pEditAlbumCanvas->DrawBitmap(Point(0,0),*pBitmapRenameBg);
303 pEditAlbumCanvas->DrawBitmap(Point(0,0),*pBitmapRename);
306 pEditAlbumBitmap = new (std::nothrow) Bitmap();
308 if (pEditAlbumBitmap != NULL)
310 pEditAlbumBitmap->Construct(*pEditAlbumCanvas,Rectangle(0,0,canvasWidth,canvasHeight));
311 delete pEditAlbumCanvas;
314 albumName = pAlbumInfo->GetAlbumName();
315 String reservedCameraName = ResourceManager::GetString(L"IDS_MEDIABR_BODY_CAMERA_ROLL_ABB");
317 if (index == 0 || reservedCameraName.Equals(albumName,true))
323 pIconListviewItem->SetOverlayBitmap(IDA_ALBUM_EDIT, pEditAlbumBitmap, ALIGNMENT_RIGHT, ALIGNMENT_TOP);
328 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
330 return pIconListviewItem;
334 AlbumListEditorForm::OnIconListViewItemStateChanged(IconListView& view, int index, IconListViewItemStatus status)
336 AppLogDebug("ENTER");
338 if (status == ICON_LIST_VIEW_ITEM_CHECKED || status == ICON_LIST_VIEW_ITEM_UNCHECKED)
340 if (status == ICON_LIST_VIEW_ITEM_CHECKED) //to be unchecked after this call
344 else if (status == ICON_LIST_VIEW_ITEM_UNCHECKED) //will get checked after this call hence increment
350 if (__checkedCount == 0)
352 tempString = ResourceManager::GetString(L"IDS_ST_POP_NO_ITEMS_SELECTED");
354 else if (__checkedCount == 1)
356 tempString = ResourceManager::GetString(L"IDS_VR_POP_1_ITEM_SELECTED");
360 tempString.Format(FORMAT_BUFFER_SIZE, ResourceManager::GetString(L"IDS_VR_POP_PD_ITEMS_SELECTED").GetPointer(), __checkedCount);
363 __pSelectCountLabel->SetText(tempString);
364 __pSelectCountLabel->RequestRedraw();
365 __pEditorFolderIconList->RefreshList(index, LIST_REFRESH_TYPE_ITEM_MODIFY);
368 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
372 AlbumListEditorForm::OnIconListViewOverlayBitmapSelected (IconListView &iconListView, int index,
375 AppLogDebug("ENTER");
376 SceneManager* pSceneManager = SceneManager::GetInstance();
378 ArrayList* pSelectedIndex = new (std::nothrow) ArrayList(SingleObjectDeleter);
379 pSelectedIndex->Construct();
380 //Adding the Action Type
381 pSelectedIndex->Add(new (std::nothrow) Integer(ALBUM_RENAME));
382 pSelectedIndex->Add(new (std::nothrow) Integer(FILE_MOVE_ACTION));
383 pSelectedIndex->Add(new (std::nothrow) Integer(index));
385 pSceneManager->GoForward(ForwardSceneTransition(IDSCN_ALBUM_NAME_EDITOR), pSelectedIndex);
386 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
390 AlbumListEditorForm::DeleteItem(int index, IconListViewItem* pItem)
392 AppLogDebug("ENTER");
394 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
400 AlbumListEditorForm::DeleteFolder()
403 AppLogDebug("ENTER");
404 IList* pIndexList = GetItemCheckedIndexListN();
405 if (pIndexList->GetCount() <= 0)
408 AppLogDebug("EXIT 1(%s)", GetErrorMessage(GetLastResult()));
412 if (__pFileDeleteTimer != null)
414 delete __pFileDeleteTimer;
416 __pFileDeleteTimer = new FileDeleteTimer(pIndexList, __pPresentationModel, this);
417 result r = __pFileDeleteTimer->StartTimer();
421 delete __pFileDeleteTimer;
422 __pFileDeleteTimer = null;
427 __pPresentationModel->SetUpdateProgressStatus(true);
433 AlbumListEditorForm::GetItemCheckedIndexListN(void) const
435 AppLogDebug("ENTER");
436 IList* pList = new (std::nothrow) ArrayList(SingleObjectDeleter);
437 Integer* pIndex = null;
439 if (__pEditorFolderIconList!=null)
441 int loopCount = __pPresentationModel->GetFolderCount();
442 for (int i = 0; i < loopCount; ++i)
444 if (__pEditorFolderIconList->IsItemChecked(i) == true)
446 pIndex = new (std::nothrow) Integer(i);
448 AppLogDebug("checked index(%d)", i);
452 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
458 AlbumListEditorForm::SetAllCheckState(bool state)
460 AppLogDebug("ENTER");
461 int maxCount = __pPresentationModel->GetFolderCount();
468 tempString = ResourceManager::GetString(L"IDS_VR_POP_1_ITEM_SELECTED;");
472 tempString.Format(FORMAT_BUFFER_SIZE,
473 ResourceManager::GetString(L"IDS_VR_POP_PD_ITEMS_SELECTED").GetPointer(), maxCount);
478 tempString = ResourceManager::GetString(L"IDS_ST_POP_NO_ITEMS_SELECTED");
481 for (int i = 0 ; i < maxCount; ++i)
483 __pEditorFolderIconList->SetItemChecked(i, state);
484 __pEditorFolderIconList->RefreshList(i, LIST_REFRESH_TYPE_ITEM_MODIFY);
487 __pEditorFolderIconList->Draw();
488 __pSelectCountLabel->SetText(tempString);
489 __pSelectCountLabel->RequestRedraw();
490 __checkedCount = GetCheckedFolderCount();
493 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
497 AlbumListEditorForm::GetCheckedFolderCount()
499 AppLogDebug("ENTER");
500 int maxCount = __pPresentationModel->GetFolderCount();
503 for (int i = 0 ; i < maxCount; ++i)
505 if (__pEditorFolderIconList->IsItemChecked (i))
510 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
516 AlbumListEditorForm::OnActionPerformed(const Control& source, int actionId)
518 AppLogDebug("ENTER");
521 case ACTION_ID_ALBUM_LIST_SELECT_ALL:
522 if (__pPresentationModel->GetFolderCount() == GetCheckedFolderCount())
524 SetAllCheckState(false);
528 SetAllCheckState(true);
531 case ACTION_ID_FOOTER_DELETE:
533 __pDeletePopup->SetShowState(true);
534 __pDeletePopup->Show();
537 case ACTION_ID_FOOTER_SHARE:
538 __pShareContextMenu->SetShowState(true);
539 __pShareContextMenu->Show();
541 case ACTION_ID_CONTEXT_MENU_MESSAGE:
546 case ACTION_ID_CONTEXT_MENU_EMAIL:
551 case ACTION_ID_DELETE_POPUP_DEL:
553 __pDeletePopup->SetShowState(false);
554 __pDeletePopup->Show();
558 case ACTION_ID_DELETE_POPUP_CANCEL:
560 __pDeletePopup->SetShowState(false);
561 __pDeletePopup->Show();
567 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
571 AlbumListEditorForm::OnFormBackRequested(Form& source)
573 AppLogDebug("ENTER");
574 SceneManager* pSceneManager = SceneManager::GetInstance();
575 pSceneManager->GoForward(ForwardSceneTransition(IDSCN_ALBUM_LIST));
576 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
580 AlbumListEditorForm::OnSceneActivatedN(const SceneId& previousSceneId,
581 const SceneId& currentSceneId, IList* pArgs)
583 AppLogDebug("ENTER OnSceneActivatedN");
584 __pPresentationModel->InitializeAlbumInfoList(CONTENT_TYPE_ALL);
585 __pEditorFolderIconList->UpdateList();
586 __pPresentationModel->AddContentEventListener(this);
588 __checkedCount = GetCheckedFolderCount();
592 if (__checkedCount == 0)
594 tempString = ResourceManager::GetString(L"IDS_ST_POP_NO_ITEMS_SELECTED");
596 else if (__checkedCount == 1)
598 tempString = ResourceManager::GetString(L"IDS_VR_POP_1_ITEM_SELECTED");
602 tempString.Format(FORMAT_BUFFER_SIZE,
603 ResourceManager::GetString(L"IDS_VR_POP_PD_ITEMS_SELECTED").GetPointer(), __checkedCount);
606 __pSelectCountLabel->SetText(tempString);
607 __pSelectCountLabel->RequestRedraw();
610 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
614 AlbumListEditorForm::OnSceneDeactivated(const SceneId& currentSceneId, const SceneId& nextSceneId)
616 AppLogDebug("ENTER");
617 __pPresentationModel->RemoveContentEventListener(*this);
618 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
622 AlbumListEditorForm::OnFileInfoChanged(const ContentType contentType)
624 AppLogDebug("ENTER");
626 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
630 AlbumListEditorForm::OnThumbnailDecoded(const int index)
632 AppLogDebug("ENTER : index(%d)", index);
633 __pEditorFolderIconList->RefreshList(index, LIST_REFRESH_TYPE_ITEM_MODIFY);
634 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
637 void AlbumListEditorForm::OnFileOpInvalidate(enum FileActionMode actionId)
642 void AlbumListEditorForm::OnFileOpComplete(enum FileActionMode actionId, enum FileActionCompleteRes res)
644 AppLogDebug("ENTER");
645 __pPresentationModel->SetUpdateProgressStatus(false);
646 SetAllCheckState(false);
647 __pPresentationModel->InitializeAlbumInfoList(CONTENT_TYPE_ALL);
648 __pEditorFolderIconList->UpdateList();
650 SceneManager* pSceneManager = SceneManager::GetInstance();
651 AppAssert(pSceneManager);
652 pSceneManager->GoForward(ForwardSceneTransition(IDSCN_ALBUM_LIST));
656 AlbumListEditorForm::Update(void)
658 AppLogDebug("ENTER");
659 result r = __pEditorFolderIconList->UpdateList();
660 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
666 AlbumListEditorForm::OnRequestMessage(void)
668 AppLogDebug("ENTER");
670 int checkCount = GetCheckedFolderCount();
674 AppLogDebug("EXIT 1(%s)", GetErrorMessage(GetLastResult()));
679 IList* pAlbumInfoList = __pPresentationModel->GetAlbumInfoList();
681 int maxCount = __pPresentationModel->GetFolderCount();
682 ContentManager contentManager;
683 result r = contentManager.Construct();
688 AppLogDebug("EXIT 2(%s)", GetErrorMessage(GetLastResult()));
692 ArrayList* pArrayList = new (std::nothrow) ArrayList(SingleObjectDeleter);
693 pArrayList->Construct();
694 for (int i = 0 ; i < maxCount; ++i)
696 if (__pEditorFolderIconList->IsItemChecked (i))
698 AlbumInfo* pAlbumInfo = static_cast<AlbumInfo*>(pAlbumInfoList->GetAt(i));
699 IList* pContentIdList = pAlbumInfo->GetContentIdListN();
700 int loopCount = pContentIdList->GetCount();
701 for (int k = 0; k < loopCount; ++k)
703 ContentId* pContentId = static_cast<ContentId*>(pContentIdList->GetAt(k));
704 ContentInfo* pContentInfo = contentManager.GetContentInfoN(*pContentId);
706 if (pContentInfo == null)
710 pArrayList->Add(new (std::nothrow) String(pContentInfo->GetContentPath()));
720 HashMap* pDataList = new (std::nothrow) HashMap(SingleObjectDeleter);
721 pDataList->Construct();
722 pDataList->Add(new (std::nothrow) String(APPCONTROL_KEY_MESSAGE_TYPE), new (std::nothrow) String(APPCONTROL_DATA_MMS));
723 pDataList->Add(new (std::nothrow) String(APPCONTROL_KEY_PATH), (Object*)pArrayList);
725 __pPresentationModel->StartAppControl(APPCONTROL_PROVIDER_ID_MESSAGE, APPCONTROL_OPERATION_ID_COMPOSE,
726 null, null, pDataList, null);
728 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
732 AlbumListEditorForm::OnRequestEmail(void)
734 AppLogDebug("ENTER");
736 int checkCount = GetCheckedFolderCount();
740 AppLogDebug("EXIT 1(%s)", GetErrorMessage(GetLastResult()));
745 IList* pAlbumInfoList = __pPresentationModel->GetAlbumInfoList();
747 int maxCount = __pPresentationModel->GetFolderCount();
748 ContentManager contentManager;
749 result r = contentManager.Construct();
754 AppLogDebug("EXIT 2(%s)", GetErrorMessage(GetLastResult()));
758 ArrayList* pArrayList = new (std::nothrow) ArrayList(SingleObjectDeleter);
759 pArrayList->Construct();
760 for (int i = 0 ; i < maxCount; ++i)
762 if (__pEditorFolderIconList->IsItemChecked (i))
764 AlbumInfo* pAlbumInfo = static_cast<AlbumInfo*>(pAlbumInfoList->GetAt(i));
765 IList* pContentIdList = pAlbumInfo->GetContentIdListN();
766 int loopCount = pContentIdList->GetCount();
767 for (int k = 0; k < loopCount; ++k)
769 ContentId* pContentId = static_cast<ContentId*>(pContentIdList->GetAt(k));
770 ContentInfo* pContentInfo = contentManager.GetContentInfoN(*pContentId);
772 if (pContentInfo == null)
776 pArrayList->Add(new (std::nothrow) String(pContentInfo->GetContentPath()));
786 HashMap* pDataList = new (std::nothrow) HashMap(SingleObjectDeleter);
787 pDataList->Construct();
788 pDataList->Add(new (std::nothrow) String(APPCONTROL_KEY_PATH), (Object*)pArrayList);
790 __pPresentationModel->StartAppControl(APPCONTROL_PROVIDER_ID_EMAIL, APPCONTROL_OPERATION_ID_COMPOSE,
791 new (std::nothrow) String(APPCONTROL_URI_MAIL_TO), null, pDataList, null);
793 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
797 AlbumListEditorForm::SetFooterButtonsState(bool enableState)
799 AppLogDebug("ENTER");
800 Footer* pFooter = GetFooter();
803 if (enableState == true)
805 pFooter->SetItemEnabled(0, true);
806 pFooter->SetItemEnabled(1, true);
810 pFooter->SetItemEnabled(0, false);
811 pFooter->SetItemEnabled(1, false);
814 pFooter->RequestRedraw(true);
815 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
819 AlbumListEditorForm::SetButtonState(void)
821 AppLogDebug("ENTER");
822 if (GetCheckedFolderCount() > 0)
824 AppLogDebug("BUTTONSTATE : Request Enable");
825 SetFooterButtonsState(true);
829 AppLogDebug("BUTTONSTATE : Request disable");
830 SetFooterButtonsState(false);
832 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));