//
// Copyright (c) 2012 Samsung Electronics Co., Ltd.
//
-// Licensed under the Flora License, Version 1.0 (the License);
+// Licensed under the Flora License, Version 1.1 (the License);
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
#include "GlAllListPanel.h"
#include "GlFileListForm.h"
#include "GlFileListPresentationModel.h"
+#include "GlGalleryApp.h"
#include "GlResourceManager.h"
#include "GlSlideSettingListener.h"
+#include "GlSlideShowPopUp.h"
#include "GlTypes.h"
using namespace Tizen::App;
using namespace Tizen::Content;
FileListForm::FileListForm(void)
- : __pContextMenuMore(null)
+ : __pOptionMenu(null)
+ , __pPopUp(null)
, __pPresentationModel(null)
{
AppLogDebug("ENTER");
Header* pHeader = GetHeader();
TryReturn(pHeader != null, E_FAILURE, "[%s] fail to get the Header.", GetErrorMessage(GetLastResult()));
+ SetFormMenuEventListener(this);
+
__pPresentationModel = FileListPresentationModel::GetInstance();
__pPresentationModel->ClearThumbnailRequests();
{
__pPopUp->Initialize();
__pPopUp->SetEventListner(this);
- AddControl(*__pPopUp);
+ AddControl(__pPopUp);
}
InitializeFooter();
{
AppLogDebug("ENTER");
- if (__pContextMenuMore != null)
+ if ( __pOptionMenu != null )
{
- delete __pContextMenuMore;
- __pContextMenuMore = null;
+ delete __pOptionMenu;
+ __pOptionMenu = null;
}
+
AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
return E_SUCCESS;
switch (actionId)
{
- case ACTION_ID_FOOTER_MORE:
- {
- AppLogDebug("ITEMCOUNT(%d)", __pPresentationModel->GetCurrentAlbumContentInfoCount());
-
- InitializeFooter();
-
- if (__pContextMenuMore->GetShowState() == false)
- {
- Rectangle rect = source.GetBounds();
- __pContextMenuMore->SetAnchorPosition(Point(rect.width/8, rect.y));
- __pContextMenuMore->SetShowState(true);
- __pContextMenuMore->Show();
- }
- else
- {
- __pContextMenuMore->SetShowState(false);
- }
- break;
- }
- case ACTION_ID_FOOTER_EDIT:
+ case IDA_FOOTER_EDIT:
{
if (pSceneManager->GetCurrentSceneId() == IDSCN_ALL_LIST)
{
{
pSceneManager->GoForward(ForwardSceneTransition(IDSCN_ALL_LIST_EDITOR));
}
- break;
}
- case ACTION_ID_FOOTER_SLIDESHOW:
+ break;
+
+ case IDA_FOOTER_SLIDESHOW:
{
if (__pPopUp != null)
__pPopUp->SetShowState(true);
__pPopUp->Show();
}
-
- break;
}
- case ACTION_ID_FOOTER_CAMERA:
+ break;
+
+ case IDA_FOOTER_CAMERA:
{
HashMap* pDataList = new (std::nothrow) HashMap(SingleObjectDeleter);
pDataList->Construct();
pDataList->Add(new (std::nothrow) String(APPCONTROL_KEY_CAMERA_ALLOW_SWITCH), new (std::nothrow) String(APPCONTROL_DATA_TRUE));
__pPresentationModel->StartAppControl(APPCONTROL_PROVIDER_ID_CAMERA, APPCONTROL_OPERATION_ID_CREATE_CONTENT,
null, new (std::nothrow) String(APPCONTROL_MIME_IMAGE_JPG), pDataList, null);
- break;
}
+ break;
+
default:
break;
}
pFooter->RemoveAllItems();
pFooter->SetStyle(FOOTER_STYLE_BUTTON_ICON);
-
- ButtonItem footerMore;
- footerMore.Construct(BUTTON_ITEM_STYLE_ICON, ACTION_ID_FOOTER_MORE);
- Bitmap* pBitmapMore = ResourceManager::GetBitmapN(IDB_CONTROLBAR_MORE);
- if (pBitmapMore != null)
- {
- footerMore.SetIcon(BUTTON_ITEM_STATUS_NORMAL, pBitmapMore);
- }
- pFooter->SetButton(BUTTON_POSITION_LEFT,footerMore);
+ pFooter->SetMenuButton();
+ pFooter->SetBackButton();
FooterItem itemCamera;
- itemCamera.Construct(ACTION_ID_FOOTER_CAMERA);
+ itemCamera.Construct(IDA_FOOTER_CAMERA);
Bitmap* pBitmapCamera = ResourceManager::GetBitmapN(IDB_CONTROLBAR_CAMERA);
if (pBitmapCamera != null)
{
}
pFooter->AddItem(itemCamera);
- if (__pContextMenuMore != null)
+
+ if (__pOptionMenu != null)
{
- delete __pContextMenuMore;
- __pContextMenuMore = null;
+ delete __pOptionMenu;
+ __pOptionMenu = null;
}
- __pContextMenuMore = new (std::nothrow) ContextMenu();
- __pContextMenuMore->Construct(Point(0, 0), CONTEXT_MENU_STYLE_LIST);
+ __pOptionMenu = new (std::nothrow) OptionMenu();
+ __pOptionMenu->Construct();
if (__pPresentationModel->GetCurrentAlbumContentInfoCount() > 1)
{
- __pContextMenuMore->AddItem(ResourceManager::GetString(L"IDS_MEDIABR_BUTTON_SLIDE_SHOW"), ACTION_ID_FOOTER_SLIDESHOW);
+ __pOptionMenu->AddItem(ResourceManager::GetString(L"IDS_MEDIABR_OPT_SLIDESHOW"), IDA_FOOTER_SLIDESHOW);
}
if (__pPresentationModel->GetCurrentAlbumContentInfoCount() == 0)
{
- __pContextMenuMore->SetEnabled(false);
+ __pOptionMenu->SetEnabled(false);
}
else
{
- __pContextMenuMore->AddItem(ResourceManager::GetString(L"IDS_COM_HEADER_EDIT"), ACTION_ID_FOOTER_EDIT);
- __pContextMenuMore->SetShowState(false);
- __pContextMenuMore->AddActionEventListener(*this);
+ __pOptionMenu->AddItem(ResourceManager::GetString(L"IDS_COM_HEADER_EDIT"), IDA_FOOTER_EDIT);
+ __pOptionMenu->AddActionEventListener(*this);
}
- pFooter->SetBackButton();
-
pFooter->AddActionEventListener(*this);
AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
if (index == 0)
{
+ result r = E_SUCCESS;
ArrayList* pArrayList = new (std::nothrow) ArrayList(SingleObjectDeleter);
pArrayList->Construct();
int loopCount = __pPresentationModel->GetCurrentAlbumContentInfoCount();
pDataList->Add(new (std::nothrow) String(APPCONTROL_KEY_TYPE), new (std::nothrow) String(APPCONTROL_DATA_SLIDE_SHOW));
pDataList->Add(new (std::nothrow) String(APPCONTROL_KEY_PATH), (Object*)pArrayList);
- __pPresentationModel->StartAppControl(APPCONTROL_PROVIDER_ID_IMAGE, APPCONTROL_OPERATION_ID_VIEW, null,
+ r = __pPresentationModel->StartAppControl(APPCONTROL_PROVIDER_ID_IMAGE, APPCONTROL_OPERATION_ID_VIEW, null,
new (std::nothrow) String(APPCONTROL_MIME_IMAGE_ALL), pDataList, null);
+
+ if (r == E_MAX_EXCEEDED)
+ {
+ MessageBox messageBox;
+ messageBox.Construct(L"", ResourceManager::GetString(L"IDS_RCS_BODY_MAXIMUM_NUMBER_OF_FILES_EXCEEDED"),
+ MSGBOX_STYLE_NONE, 3000);
+ int modalResult;
+ messageBox.ShowAndWait(modalResult);
+ }
}
else if (index == 1)
{
pSceneManager->GoForward(ForwardSceneTransition(IDSCN_SETTING_MAIN));
}
}
+
+void
+FileListForm::SetFooterState(bool state)
+{
+ GetFooter()->SetMenuButtonEnabled(state);
+ GetFooter()->Invalidate(true);
+}
+
+void
+FileListForm::OnFormMenuRequested (Tizen::Ui::Controls::Form &source)
+{
+
+ InitializeFooter();
+
+ if ( __pOptionMenu == null )
+ {
+ return ;
+ }
+
+ __pOptionMenu->SetShowState(true);
+ __pOptionMenu->Show();
+
+}