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::Media;
35 using namespace Tizen::Io;
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_SELECT_COUNT_LABEL = Color32<68, 68, 68>::Value;
42 static const unsigned int COLOR_SELECT_COUNT_FONT = Color32<255, 255, 255>::Value;
43 static const unsigned int COLOR_DELETE_BUTTON_NORMAL = Color32<208, 82, 82>::Value;
44 static const unsigned int COLOR_DELETE_BUTTON_PRESSED = Color32<194, 71, 71>::Value;
45 static const unsigned int COLOR_DELETE_BUTTON_TEXT = Color32<248, 246, 239>::Value;
47 static const int W_FOLDER_SIZE = 334;
48 static const int H_FOLDER_SIZE = 334;
50 static const int W_BUTTON_RENAME_SIZE = 64;
51 static const int H_BUTTON_RENAME_SIZE = 64;
53 static const int GAP_W_POPUP_ITEM = 5;
54 static const int W_DELETE_POPUP = 600;
55 static const int H_DELETE_POPUP = 300;
56 static const int H_DELETE_LABEL = 180;
57 static const int Y_DELETE_BUTTON = 180;
58 static const int H_DELETE_BUTTON = 80;
60 static const int H_CHECKBOX = 80;
61 static const int GAP_H_ICON_LIST_VIEW = 40;
63 static const int H_SELECT_COUNT_LABEL = 48;
65 static const int FORMAT_BUFFER_SIZE = 256;
67 static const int X_POSITION_SHARE_CONTEXTMENU = 300;
68 static const int Y_POSITION_SHARE_CONTEXTMENU = 1180;
70 static const Color COLOR_FOLDER_BITMAP_DIM(Color::GetColor(COLOR_ID_BLACK));
71 static const int ALPHA_FOLDER_BITMAP_DIM = 70;
73 AlbumListEditorForm::AlbumListEditorForm()
75 , __pSelectCountLabel(null)
76 , __pEditorFolderIconList(null)
77 , __pShareContextMenu(null)
78 , __pDeletePopup(null)
79 , __pEditFolderBitmap(null)
80 , __pPresentationModel(null)
84 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
87 AlbumListEditorForm::~AlbumListEditorForm()
90 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
94 AlbumListEditorForm::Initialize(void)
97 result r = Form::Construct(IDL_FORM_ALBUM_LIST_EDITOR);
98 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
104 AlbumListEditorForm::OnInitializing(void)
106 AppLogDebug("ENTER");
107 result r = E_SUCCESS;
109 SetRenameButtonImage();
111 __pPresentationModel = AlbumListPresentationModel::GetInstance();
112 __pPresentationModel->ClearThumbnailRequests();
113 __pPresentationModel->AddPresentationModelListener(this);
115 r = InitializeHeader();
118 AppLogDebug("[%s] Unable to InitializeHeader.", GetErrorMessage(r));
121 r = InitializeFooter();
124 AppLogDebug("[%s] Unable to set InitializeFooter.", GetErrorMessage(r));
127 r = InitializeControl();
130 AppLogDebug("[%s] Unable to set InitializeControl.", GetErrorMessage(r));
133 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
139 AlbumListEditorForm::OnTerminating(void)
141 AppLogDebug("ENTER");
142 __pPresentationModel->RemovePresentationModelListener(*this);
144 if (__pDeletePopup != null)
146 delete __pDeletePopup;
147 __pDeletePopup = null;
150 if (__pEditFolderBitmap != null)
152 delete __pEditFolderBitmap;
153 __pEditFolderBitmap = null;
155 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
161 AlbumListEditorForm::OnUpdateContentList()
163 AppLogDebug("ENTER");
164 SceneManager* pSceneManager = SceneManager::GetInstance();
165 pSceneManager->GoForward(ForwardSceneTransition(IDSCN_ALBUM_LIST));
166 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
170 AlbumListEditorForm::SetRenameButtonImage(void)
172 AppLogDebug("ENTER");
173 Bitmap* pSrcBitmap1 = ResourceManager::GetBitmapN(IDB_BUTTON_CIRCLE_BACKGROUND);
174 Bitmap* pSrcBitmap2 = ResourceManager::GetBitmapN(IDB_BUTTON_RENAME);
176 Bitmap* pBitmap = new (std::nothrow) Bitmap();
177 BufferInfo bufferinfo;
179 Dimension size(W_BUTTON_RENAME_SIZE, H_BUTTON_RENAME_SIZE);
180 result r = pBitmap->Construct(size, BITMAP_PIXEL_FORMAT_ARGB8888);
181 r = pBitmap->Lock(bufferinfo);
182 r = canvas.Construct(bufferinfo);
184 if (pSrcBitmap1 != null)
186 canvas.DrawBitmap(Point(0, 0), *pSrcBitmap1);
190 if (pSrcBitmap2 != null)
192 canvas.DrawBitmap(Point(0, 0), *pSrcBitmap2);
199 __pEditFolderBitmap = pBitmap;
200 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
206 AlbumListEditorForm::InitializeHeader(void)
208 AppLogDebug("ENTER");
209 Header* pHeader = GetHeader();
212 AppLogDebug("EXIT 1");
217 result r = pHeader->SetStyle(HEADER_STYLE_TITLE);
220 AppLogDebug("EXIT 2");
225 pHeader->SetTitleText(ResourceManager::GetString(L"IDS_COM_BODY_GALLERY"));
226 pHeader->AddActionEventListener(*this);
228 ButtonItem selectAll;
229 selectAll.Construct(BUTTON_ITEM_STYLE_ICON, ACTION_ID_ALBUM_LIST_SELECT_ALL);
230 Bitmap* pBitmapSelectAll = ResourceManager::GetBitmapN(IDB_ICON_SELECT_ALL);
231 Bitmap* pBitmapSelectAllPress = ResourceManager::GetBitmapN(IDB_ICON_SELECT_ALL_PRESS);
232 if (pBitmapSelectAll != null)
234 selectAll.SetIcon(BUTTON_ITEM_STATUS_NORMAL, pBitmapSelectAll);
236 if (pBitmapSelectAll != null)
238 selectAll.SetIcon(BUTTON_ITEM_STATUS_PRESSED, pBitmapSelectAllPress);
240 pHeader->SetButton(BUTTON_POSITION_RIGHT, selectAll);
241 delete pBitmapSelectAll;
243 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
249 AlbumListEditorForm::InitializeFooter(void)
251 AppLogDebug("ENTER");
252 Footer* pFooter = GetFooter();
255 AppLogDebug("EXIT 1");
260 pFooter->SetStyle(FOOTER_STYLE_BUTTON_ICON);
261 pFooter->RemoveAllItems();
262 pFooter->SetBackButtonEnabled(true);
263 pFooter->SetBackButton();
264 SetFormBackEventListener(this);
266 FooterItem itemShare;
267 itemShare.Construct(ACTION_ID_FOOTER_SHARE);
268 itemShare.SetText(ResourceManager::GetString(L"EMPTY_SPACE"));
269 Bitmap* pShareBitmap = ResourceManager::GetBitmapN(IDB_CONTROLBAR_SHARE);
270 Bitmap* pShareBitmapDim = ResourceManager::GetBitmapN(IDB_CONTROLBAR_SHARE_DIM);
271 if (pShareBitmap != null && pShareBitmapDim !=null )
273 itemShare.SetIcon(FOOTER_ITEM_STATUS_NORMAL, pShareBitmap);
274 itemShare.SetIcon(FOOTER_ITEM_STATUS_DISABLED, pShareBitmapDim);
277 pFooter->AddItem(itemShare);
279 delete pShareBitmapDim;
281 FooterItem itemDelete;
282 itemDelete.Construct(ACTION_ID_FOOTER_DELETE);
283 itemDelete.SetText(ResourceManager::GetString(L"EMPTY_SPACE"));
284 Bitmap* pBitmapDelete = ResourceManager::GetBitmapN(IDB_CONTROLBAR_DELETE);
285 Bitmap* pBitmapDeleteDim = ResourceManager::GetBitmapN(IDB_CONTROLBAR_DELETE_DIM);
287 if (pBitmapDelete != null)
289 itemDelete.SetIcon(FOOTER_ITEM_STATUS_NORMAL, pBitmapDelete);
292 if( pBitmapDeleteDim != null)
294 itemDelete.SetIcon(FOOTER_ITEM_STATUS_DISABLED, pBitmapDeleteDim);
297 pFooter->AddItem(itemDelete);
298 delete pBitmapDelete;
299 delete pBitmapDeleteDim;
301 pFooter->AddActionEventListener(*this);
302 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
308 AlbumListEditorForm::InitializeControl()
310 AppLogDebug("ENTER");
313 CreateIconListView();
314 __checkedCount = GetCheckedFolder();
315 tempString.Format(FORMAT_BUFFER_SIZE, L"%ls (%d)",
316 ResourceManager::GetString(L"IDS_COM_BODY_SELECTED").GetPointer(), __checkedCount);
318 __pSelectCountLabel = new (std::nothrow) Label();
319 __pSelectCountLabel->Construct(Rectangle(0, GetClientAreaBounds().height - H_SELECT_COUNT_LABEL,
320 GetClientAreaBounds().width, H_SELECT_COUNT_LABEL), tempString);
322 __pSelectCountLabel->SetTextVerticalAlignment(ALIGNMENT_MIDDLE);
323 __pSelectCountLabel->SetTextHorizontalAlignment(ALIGNMENT_CENTER);
324 __pSelectCountLabel->SetBackgroundColor(Color(COLOR_SELECT_COUNT_LABEL));
325 __pSelectCountLabel->SetTextColor(Color(COLOR_SELECT_COUNT_FONT));
326 AddControl(*__pSelectCountLabel);
328 __pShareContextMenu = new ContextMenu();
329 __pShareContextMenu->Construct(Point(X_POSITION_SHARE_CONTEXTMENU, Y_POSITION_SHARE_CONTEXTMENU),
330 CONTEXT_MENU_STYLE_LIST);
331 __pShareContextMenu->AddItem(ResourceManager::GetString(L"IDS_COM_BODY_MESSAGE"),
332 ACTION_ID_CONTEXT_MENU_MESSAGE);
333 __pShareContextMenu->AddItem(ResourceManager::GetString(L"IDS_COM_BODY_EMAIL"), ACTION_ID_CONTEXT_MENU_EMAIL);
334 __pShareContextMenu->AddActionEventListener(*this);
337 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
343 AlbumListEditorForm::InitializePopup(void)
345 AppLogDebug("ENTER");
346 if (__pDeletePopup == null)
348 __pDeletePopup = new (std::nothrow) Popup();
349 __pDeletePopup->Construct(false, Dimension(W_DELETE_POPUP, H_DELETE_POPUP));
351 Rectangle popupClientBounds = __pDeletePopup->GetClientAreaBounds();
353 Label* pLabel = new (std::nothrow) Label();
354 pLabel->Construct(Rectangle(0, 0, popupClientBounds.width, H_DELETE_LABEL),
355 ResourceManager::GetString(L"IDS_COM_POP_DELETE_Q"));
357 Button* pDeleteButton = new (std::nothrow) Button();
358 pDeleteButton->Construct(
359 Rectangle(0, Y_DELETE_BUTTON, popupClientBounds.width / 2 - GAP_W_POPUP_ITEM, H_DELETE_BUTTON),
360 ResourceManager::GetString(L"IDS_COM_BODY_DELETE"));
361 pDeleteButton->SetColor(BUTTON_STATUS_NORMAL, COLOR_DELETE_BUTTON_NORMAL);
362 pDeleteButton->SetColor(BUTTON_STATUS_PRESSED, COLOR_DELETE_BUTTON_PRESSED);
363 pDeleteButton->SetTextColor(COLOR_DELETE_BUTTON_TEXT);
364 pDeleteButton->SetActionId(ACTION_ID_DELETE_POPUP_DEL);
365 pDeleteButton->AddActionEventListener(*this);
367 Button* pCancelButton = new (std::nothrow) Button();
368 pCancelButton->Construct(
369 Rectangle(popupClientBounds.width / 2 + GAP_W_POPUP_ITEM, Y_DELETE_BUTTON,
370 popupClientBounds.width / 2 - GAP_W_POPUP_ITEM, H_DELETE_BUTTON),
371 ResourceManager::GetString(L"IDS_COM_POP_CANCEL"));
372 pCancelButton->SetActionId(ACTION_ID_DELETE_POPUP_CANCEL);
373 pCancelButton->AddActionEventListener(*this);
375 __pDeletePopup->AddControl(*pLabel);
376 __pDeletePopup->AddControl(*pDeleteButton);
377 __pDeletePopup->AddControl(*pCancelButton);
381 __pDeletePopup->SetShowState(true);
382 __pDeletePopup->Show();
384 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
390 AlbumListEditorForm::CreateIconListView(void)
392 AppLogDebug("ENTER");
393 Dimension itemSize(W_FOLDER_SIZE, H_FOLDER_SIZE);
394 __pEditorFolderIconList = new (std::nothrow) IconListView();
395 __pEditorFolderIconList->Construct(Rectangle(0, 0, GetClientAreaBounds().width,
396 GetClientAreaBounds().height - H_CHECKBOX - GAP_H_ICON_LIST_VIEW), itemSize,
397 ICON_LIST_VIEW_STYLE_MARK, ICON_LIST_VIEW_SCROLL_DIRECTION_VERTICAL);
398 Bitmap* pBitmap = ResourceManager::GetBitmapN(IDB_LISTVIEW_EMPTY);
401 __pEditorFolderIconList->SetBitmapOfEmptyList(pBitmap);
404 __pEditorFolderIconList->SetTextOfEmptyList(ResourceManager::GetString(L"IDS_COM_BODY_NO_ITEMS"));
405 __pEditorFolderIconList->SetItemBorderStyle(ICON_LIST_VIEW_ITEM_BORDER_STYLE_NONE);
406 __pEditorFolderIconList->SetItemProvider(*this);
407 __pEditorFolderIconList->SetTouchAnimationEnabled(false);
408 __pEditorFolderIconList->AddIconListViewItemEventListener(*this);
409 AddControl(*__pEditorFolderIconList);
410 __pEditorFolderIconList->SetShowState(true);
411 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
415 AlbumListEditorForm::GetItemCount(void)
417 AppLogDebug("ENTER");
418 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
420 return __pPresentationModel->GetFolderCount();
424 AlbumListEditorForm::CreateItem(int index)
426 AppLogDebug("ENTER : index(%d)", index);
427 Bitmap* pBitmap = null;
428 IconListViewItem* pIconListview = new IconListViewItem();
430 IList* pAlbumInfoList = __pPresentationModel->GetAlbumInfoList();
431 AlbumInfo* pAlbumInfo = static_cast<AlbumInfo*>(pAlbumInfoList->GetAt(index));
433 Bitmap* pAlbumBitmap = pAlbumInfo->GetFolderThumnailBitmap();
434 if (pAlbumBitmap == null)
436 __pPresentationModel->RequestThumbnail(index, 0);
439 pBitmap = __pPresentationModel->CreateMergeBitmapN(index);
441 if (__pEditorFolderIconList->IsItemChecked(index) == true)
445 BufferInfo bufferInfo;
446 pBitmap->Lock(bufferInfo, INFINITE);
448 Color dimColor(COLOR_FOLDER_BITMAP_DIM);
449 dimColor.SetAlpha(ALPHA_FOLDER_BITMAP_DIM);
451 canvas.Construct(bufferInfo);
452 canvas.FillRectangle(dimColor, canvas.GetBounds());
453 Bitmap* pSelectedBitmap = new (std::nothrow) Bitmap();
454 pSelectedBitmap->Construct(canvas, canvas.GetBounds());
455 pIconListview->Construct(*pBitmap, null, pSelectedBitmap);
456 delete pSelectedBitmap;
461 pIconListview->Construct(*pBitmap);
468 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
470 return pIconListview;
474 AlbumListEditorForm::OnIconListViewItemStateChanged(IconListView& view, int index, IconListViewItemStatus status)
476 AppLogDebug("ENTER");
479 if (status == ICON_LIST_VIEW_ITEM_CHECKED || status == ICON_LIST_VIEW_ITEM_UNCHECKED)
481 __checkedCount = GetCheckedFolder();
482 tempString.Format(FORMAT_BUFFER_SIZE, L"%ls (%d)",
483 ResourceManager::GetString(L"IDS_COM_BODY_SELECTED").GetPointer(), __checkedCount);
484 __pSelectCountLabel->SetText(tempString);
485 __pSelectCountLabel->RequestRedraw();
486 __pEditorFolderIconList->RefreshList(index, LIST_REFRESH_TYPE_ITEM_MODIFY);
489 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
493 AlbumListEditorForm::OnIconListViewOverlayBitmapSelected (IconListView &iconListView, int index,
496 AppLogDebug("ENTER");
497 SceneManager* pSceneManager = SceneManager::GetInstance();
499 if (overlayBitmapId == ACTION_ID_EDITE_FOLDER)
501 ArrayList* pSelectedIndex = new (std::nothrow) ArrayList(SingleObjectDeleter);
502 pSelectedIndex->Construct();
503 pSelectedIndex->Add(new (std::nothrow) Integer(index));
505 pSceneManager->GoForward(ForwardSceneTransition(IDSCN_ALBUM_NAME_EDITOR), pSelectedIndex);
507 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
511 AlbumListEditorForm::DeleteItem(int index, IconListViewItem* pItem)
513 AppLogDebug("ENTER");
515 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
521 AlbumListEditorForm::DeleteFolder()
523 AppLogDebug("ENTER");
524 int maxCount = __pPresentationModel->GetFolderCount();
525 result r = E_FAILURE;
527 int checkedCount = 0;
529 for (int i = 0 ; i < maxCount; ++i)
531 if (__pEditorFolderIconList->IsItemChecked(i) == true)
534 __pPresentationModel->DeleteContentInfoInDirectory(i, CONTENT_TYPE_ALL);
542 if (checkedCount == 0)
551 SetAllCheckState(false);
552 __pPresentationModel->InitializeAlbumInfoList(CONTENT_TYPE_ALL);
553 __pEditorFolderIconList->UpdateList();
554 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
560 AlbumListEditorForm::SetAllCheckState(bool state)
562 AppLogDebug("ENTER");
563 int maxCount = __pPresentationModel->GetFolderCount();
568 tempString.Format(FORMAT_BUFFER_SIZE, L"%ls (%d)",
569 ResourceManager::GetString(L"IDS_COM_BODY_SELECTED").GetPointer(), maxCount);
573 tempString.Format(FORMAT_BUFFER_SIZE, L"%ls (%d)",
574 ResourceManager::GetString(L"IDS_COM_BODY_SELECTED").GetPointer(), 0);
577 for (int i = 0 ; i < maxCount; ++i)
579 __pEditorFolderIconList->SetItemChecked(i, state);
580 __pEditorFolderIconList->RefreshList(i, LIST_REFRESH_TYPE_ITEM_MODIFY);
583 __pEditorFolderIconList->Draw();
584 __pSelectCountLabel->SetText(tempString);
585 __pSelectCountLabel->RequestRedraw();
586 __checkedCount = GetCheckedFolder();
589 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
593 AlbumListEditorForm::GetCheckedFolder()
595 AppLogDebug("ENTER");
596 int maxCount = __pPresentationModel->GetFolderCount();
599 for (int i = 0 ; i < maxCount; ++i)
601 if (__pEditorFolderIconList->IsItemChecked (i))
606 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
612 AlbumListEditorForm::OnActionPerformed(const Control& source, int actionId)
614 AppLogDebug("ENTER");
617 case ACTION_ID_ALBUM_LIST_SELECT_ALL:
618 SetAllCheckState(true);
620 case ACTION_ID_FOOTER_DELETE:
621 if (__checkedCount > 0)
623 __pDeletePopup->SetShowState(true);
624 __pDeletePopup->Show();
627 case ACTION_ID_FOOTER_SHARE:
628 __pShareContextMenu->SetShowState(true);
629 __pShareContextMenu->Show();
631 case ACTION_ID_CONTEXT_MENU_MESSAGE:
636 case ACTION_ID_CONTEXT_MENU_EMAIL:
641 case ACTION_ID_DELETE_POPUP_DEL:
643 __pDeletePopup->SetShowState(false);
644 __pDeletePopup->Show();
645 result r = DeleteFolder();
646 AppLogDebug("CHECKBUTTONSTATE : R1");
649 AppLogDebug("CHECKBUTTONSTATE : R2");
650 SceneManager* pSceneManager = SceneManager::GetInstance();
651 AppAssert(pSceneManager);
652 pSceneManager->GoForward(ForwardSceneTransition(IDSCN_ALBUM_LIST));
654 AppLogDebug("CHECKBUTTONSTATE : R3");
657 case ACTION_ID_DELETE_POPUP_CANCEL:
659 __pDeletePopup->SetShowState(false);
660 __pDeletePopup->Show();
666 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
670 AlbumListEditorForm::OnFormBackRequested(Form& source)
672 AppLogDebug("ENTER");
673 SceneManager* pSceneManager = SceneManager::GetInstance();
674 pSceneManager->GoForward(ForwardSceneTransition(IDSCN_ALBUM_LIST));
675 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
679 AlbumListEditorForm::OnSceneActivatedN(const SceneId& previousSceneId,
680 const SceneId& currentSceneId, IList* pArgs)
682 AppLogDebug("ENTER OnSceneActivatedN");
683 __pPresentationModel->InitializeAlbumInfoList(CONTENT_TYPE_ALL);
684 __pEditorFolderIconList->UpdateList();
686 __checkedCount = GetCheckedFolder();
689 tempString.Format(FORMAT_BUFFER_SIZE, L"%ls (%d)",
690 ResourceManager::GetString(L"IDS_COM_BODY_SELECTED").GetPointer(), __checkedCount);
691 __pSelectCountLabel->SetText(tempString);
692 __pSelectCountLabel->RequestRedraw();
695 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
699 AlbumListEditorForm::OnSceneDeactivated(const SceneId& currentSceneId,
700 const SceneId& nextSceneId)
702 AppLogDebug("ENTER");
703 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
707 AlbumListEditorForm::OnFileInfoChanged(const ContentType contentType)
709 AppLogDebug("ENTER");
711 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
715 AlbumListEditorForm::OnThumbnailDecoded(const int index)
717 AppLogDebug("ENTER : index(%d)", index);
718 __pEditorFolderIconList->RefreshList(index, LIST_REFRESH_TYPE_ITEM_MODIFY);
719 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
723 AlbumListEditorForm::Update(void)
725 AppLogDebug("ENTER");
726 result r = __pEditorFolderIconList->UpdateList();
727 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
733 AlbumListEditorForm::OnRequestMessage(void)
735 AppLogDebug("ENTER");
737 int checkCount = GetCheckedFolder();
741 AppLogDebug("EXIT 1(%s)", GetErrorMessage(GetLastResult()));
748 IList* pAlbumInfoList = __pPresentationModel->GetAlbumInfoList();
750 int maxCount = __pPresentationModel->GetFolderCount();
751 ContentManager contentManager;
752 result r = contentManager.Construct();
757 AppLogDebug("EXIT 2(%s)", GetErrorMessage(GetLastResult()));
761 for (int i = 0 ; i < maxCount; ++i)
763 if (__pEditorFolderIconList->IsItemChecked (i))
765 AlbumInfo* pAlbumInfo = static_cast<AlbumInfo*>(pAlbumInfoList->GetAt(i));
766 IList* pContentIdList = pAlbumInfo->GetContentIdListN();
767 int loopCount = pContentIdList->GetCount();
768 for (int k = 0; k < loopCount; ++k)
770 ContentId* pContentId = static_cast<ContentId*>(pContentIdList->GetAt(k));
771 ContentInfo* pContentInfo = contentManager.GetContentInfoN(*pContentId);
773 if (pContentInfo == null)
777 String path = pContentInfo->GetContentPath();
778 if (combineText.CompareTo(EMPTY_SPACE) != 0)
780 combineText.Append(L";");
782 combineText.Append(path);
792 HashMap* pDataList = new (std::nothrow) HashMap(SingleObjectDeleter);
793 pDataList->Construct();
794 pDataList->Add(new (std::nothrow) String(APPCONTROL_KEY_TYPE),
795 new (std::nothrow) String(APPCONTROL_DATA_MMS));
796 pDataList->Add(new (std::nothrow) String(APPCONTROL_KEY_ATTACHMENTS),
797 new (std::nothrow) String(combineText));
799 __pPresentationModel->StartAppControl(APPCONTROL_PROVIDER_ID_MESSAGE, APPCONTROL_OPERATION_ID_COMPOSE,
802 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
806 AlbumListEditorForm::OnRequestEmail(void)
808 AppLogDebug("ENTER");
810 int checkCount = GetCheckedFolder();
814 AppLogDebug("EXIT 1(%s)", GetErrorMessage(GetLastResult()));
821 IList* pAlbumInfoList = __pPresentationModel->GetAlbumInfoList();
823 int maxCount = __pPresentationModel->GetFolderCount();
824 ContentManager contentManager;
825 result r = contentManager.Construct();
830 AppLogDebug("EXIT 2(%s)", GetErrorMessage(GetLastResult()));
834 for (int i = 0 ; i < maxCount; ++i)
836 if (__pEditorFolderIconList->IsItemChecked (i))
838 AlbumInfo* pAlbumInfo = static_cast<AlbumInfo*>(pAlbumInfoList->GetAt(i));
839 IList* pContentIdList = pAlbumInfo->GetContentIdListN();
840 int loopCount = pContentIdList->GetCount();
841 for (int k = 0; k < loopCount; ++k)
843 ContentId* pContentId = static_cast<ContentId*>(pContentIdList->GetAt(k));
844 ContentInfo* pContentInfo = contentManager.GetContentInfoN(*pContentId);
846 if (pContentInfo == null)
850 String path = pContentInfo->GetContentPath();
851 if (combineText.CompareTo(EMPTY_SPACE) != 0)
853 combineText.Append(L";");
855 combineText.Append(path);
865 HashMap* pDataList = new (std::nothrow) HashMap(SingleObjectDeleter);
866 pDataList->Construct();
867 pDataList->Add(new (std::nothrow) String(APPCONTROL_KEY_ATTACHMENTS),
868 new (std::nothrow) String(combineText));
870 __pPresentationModel->StartAppControl(APPCONTROL_PROVIDER_ID_EMAIL,
871 APPCONTROL_OPERATION_ID_COMPOSE, pDataList, null);
873 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
877 AlbumListEditorForm::SetFooterButtonsState(bool enableState)
879 AppLogDebug("ENTER");
880 Footer* pFooter = GetFooter();
883 if (enableState == true)
885 pFooter->SetItemEnabled(0, true);
886 pFooter->SetItemEnabled(1, true);
890 pFooter->SetItemEnabled(0, false);
891 pFooter->SetItemEnabled(1, false);
894 pFooter->RequestRedraw(true);
895 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
899 AlbumListEditorForm::SetButtonState(void)
901 AppLogDebug("ENTER");
902 if (GetCheckedFolder() > 0)
904 AppLogDebug("BUTTONSTATE : Request Enable");
905 SetFooterButtonsState(true);
909 AppLogDebug("BUTTONSTATE : Request disable");
910 SetFooterButtonsState(false);
912 AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));