#include "IvFileUpdateEventListener.h"
#include "IvImageProvider.h"
#include "IvImageViewerEventListener.h"
+#include "IvSlideShowPopUp.h"
+#include "IvSlideSettingListener.h"
#include "IvTypes.h"
class ImageInfo;
class ImageViewerPresentationModel;
class SettingPresentationModel;
+
class ImageViewerForm
: public BaseForm
, public Tizen::App::IAppControlResponseListener
, public Tizen::Ui::Scenes::ISceneEventListener
, public IImageViewerEventListener
, public IFileUpdateEventListener
+ , public ISlideSettingListener
{
public:
ImageViewerForm(void);
virtual void OnFormFileEventOccuered(const int index, const unsigned long eventId);
+ virtual void OnSlideSettingPopUpItemSelected(int index);
+
private:
enum AppControlMode
{
Tizen::Base::String __downLordFileName;
RequestId __requestId;
Tizen::Content::ContentTransfer __contentTransfer;
+ SlideShowPopUp* __pPopUp;
ImageViewerPresentationModel* __pPresentationModel;
SettingPresentationModel* __pSettingPresentationModel;
};
--- /dev/null
+//
+// Copyright (c) 2012 Samsung Electronics Co., Ltd.
+//
+// Licensed under the Flora License, Version 1.0 (the License);
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://floralicense.org/license/
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an AS IS BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+
+/**
+ * @file ISlideSettingListener.h
+ * @brief This is the header file for ISlideSettingListener class.
+ */
+
+#ifndef _IV_SLIDE_SETTING_LISTENER_H_
+#define _IV_SLIDE_SETTING_LISTENER_H_
+
+#include <FBase.h>
+
+
+class ISlideSettingListener
+{
+public:
+ ISlideSettingListener(void){};
+ virtual ~ISlideSettingListener(void) {};
+
+ virtual void OnSlideSettingPopUpItemSelected(int index ) = 0 ;
+};
+
+#endif /* _IV_SLIDE_SETTING_LISTENER_H_ */
--- /dev/null
+//
+// Tizen Native SDK
+// Copyright (c) 2012 Samsung Electronics Co., Ltd.
+//
+// Licensed under the Flora License, Version 1.0 (the License);
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.tizenopensource.org/license
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an AS IS BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+
+
+/**
+ * @file SlideShowPopUp.h
+ * @brief This header file contains the declarations of the SlideShowPopUp
+ *
+ */
+
+#ifndef _SLIDE_SHOW_POPUP_H_
+#define _SLIDE_SHOW_POPUP_H_
+
+#include <FApp.h>
+#include <FBase.h>
+#include <FUi.h>
+
+
+class ISlideSettingListener;
+
+class SlideShowPopUp
+ : public Tizen::Ui::Controls::IListViewItemEventListener
+ , public Tizen::Ui::Controls::IListViewItemProvider
+ , public Tizen::Ui::Controls::Popup
+ , public Tizen::Ui::IActionEventListener
+ {
+ public:
+ /**
+ * @brief The Default Constructor
+ */
+ SlideShowPopUp(void);
+
+ /**
+ * @brief The Default Destructor
+ */
+ ~SlideShowPopUp(void);
+
+ /**
+ * @brief Initializes this SettingForm Form.
+ *
+ * @return An error code
+ * @exception true The method is succeIOrientationEventListenerssful.
+ * @exception false An error Occured.
+ */
+ bool Initialize(void);
+
+ /**
+ * This function terminates all the controls
+ *
+ * @return result type
+ * @param No parameter
+ */
+ virtual result OnTerminating(void);
+
+ public:
+
+ //IListViewItemProvider
+ virtual Tizen::Ui::Controls::ListItemBase* CreateItem(int index, int itemWidth);
+ virtual bool DeleteItem(int index, Tizen::Ui::Controls::ListItemBase* pItem, int itemWidth);
+ virtual int GetItemCount(void);
+
+ //IActionEventListener
+ virtual void OnActionPerformed(const Tizen::Ui::Control& source, int actionId);
+
+ // IListViewItemEventListener
+ virtual void OnListViewContextItemStateChanged(Tizen::Ui::Controls::ListView& listView, int index, int elementId, Tizen::Ui::Controls::ListContextItemStatus state){};
+ virtual void OnListViewItemStateChanged(Tizen::Ui::Controls::ListView& listView, int index, int elementId, Tizen::Ui::Controls::ListItemStatus status);
+ virtual void OnListViewItemSwept(Tizen::Ui::Controls::ListView& listView, int index, Tizen::Ui::Controls::SweepDirection direction){};
+ virtual void OnListViewItemLongPressed(Tizen::Ui::Controls::ListView& listView, int index, int elementId, bool& invokeListViewItemCallback){};
+
+ void SetEventListner(ISlideSettingListener* listner);
+
+ private:
+ Tizen::Ui::Controls::ListView* __pList;
+ ISlideSettingListener* __pListener;
+ };
+
+
+#endif /* _SLIDE_SHOW_POPUP_H_ */
extern const wchar_t* APPCONTROL_PROVIDER_ID_EMAIL;
extern const wchar_t* APPCONTROL_PROVIDER_ID_CONTACTS;
extern const wchar_t* APPCONTROL_PROVIDER_ID_VIDEO_PLAYER;
+extern const wchar_t* APPCONTROL_PROVIDER_ID_GALLERY;
extern const wchar_t* APPCONTROL_OPERATION_ID_PICK;
extern const wchar_t* APPCONTROL_OPERATION_ID_VIEW;
extern const wchar_t* APPCONTROL_OPERATION_ID_COMPOSE;
extern const wchar_t* APPCONTROL_OPERATION_ID_MAIN;
+extern const wchar_t* APPCONTROL_OPERATION_ID_CONFIGURE;
extern const wchar_t* APPCONTROL_KEY_TYPE;
extern const wchar_t* APPCONTROL_KEY_PATH;
--- /dev/null
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!--
+ This XML file was automatically generated by UiBuilder - do not modify by hand.
+-->
+<!DOCTYPE ScenePopup SYSTEM "UIForm.dtd">
+<ScenePopup Bversion="2.0.0.201303280947" Dversion="20120315">
+ <Popup id="IDL_SLIDESHOW_SETTING_POPUP">
+ <property accessibilityHint="" color="#FFFFFF" titleText="SlideShow" titleTextColor=""/>
+ <layout height="440.0" mode="Portrait" style="" type="LAYOUT_RELATIVE" width="580.0"/>
+ <layout height="400.0" mode="Landscape" style="" type="LAYOUT_RELATIVE" width="600.0"/>
+ </Popup>
+ <ListView id="IDC_POPUP_LIST" parent="IDL_SLIDESHOW_SETTING_POPUP">
+ <property backgroundBitmapPath="" backgroundColor="#FFFFFF" backgroundColorOpacity="0" bitmapPathOfEmptyList="" colorOfEmptyListText="" fastScroll="false" itemDivider="true" itemDividerColor="" scrollInputMode="SCROLL_INPUT_MODE_ALLOW_ANY_DIRECTION" sweepEnabled="false" textOfEmptyList=""/>
+ <layout bottomRelation="" bottomRelationType="" centerHorizontal="false" centerVertical="false" height="226.0" horizontalFitPolicy="FIT_POLICY_FIXED" leftRelation="" leftRelationType="" marginBottom="0.0" marginLeft="0.0" marginRight="0.0" marginTop="0.0" mode="Portrait" rightRelation="" rightRelationType="" topRelation="" topRelationType="" verticalFitPolicy="FIT_POLICY_FIXED" width="540.0" x="0.0" y="3.0"/>
+ <layout bottomRelation="" bottomRelationType="" centerHorizontal="false" centerVertical="false" height="224.0" horizontalFitPolicy="FIT_POLICY_FIXED" leftRelation="" leftRelationType="" marginBottom="0.0" marginLeft="0.0" marginRight="0.0" marginTop="0.0" mode="Landscape" rightRelation="" rightRelationType="" topRelation="" topRelationType="" verticalFitPolicy="FIT_POLICY_FIXED" width="560.0" x="-1.0" y="2.0"/>
+ </ListView>
+ <Button id="IDC_BUTTON" parent="IDL_SLIDESHOW_SETTING_POPUP">
+ <property DisabledBitmapX="0.0" DisabledBitmapY="0.0" NormalBitmapX="0.0" NormalBitmapY="0.0" PressedBitmapX="0.0" PressedBitmapY="0.0" accessibilityHint="" disableTextColor="" disabledBGBitmapPath="" disabledBitmapPath="" disabledColor="" disabledColorOpacity="100" highlightedBGBitmapPath="" highlightedBitmapPath="" highlightedBitmapX="0.0" highlightedBitmapY="0.0" highlightedColor="" highlightedColorOpacity="100" highlightedTextColor="" horizontalAlign="ALIGN_CENTER" normalBGBitmapPath="" normalBitmapPath="" normalColor="" normalColorOpacity="100" normalTextColor="" pressedBGBitmapPath="" pressedBitmapPath="" pressedColor="" pressedColorOpacity="100" pressedTextColor="" text="Cancel" textSize="33.0" verticalAlign="ALIGN_MIDDLE"/>
+ <layout bottomRelation="" bottomRelationType="" centerHorizontal="false" centerVertical="false" height="72.0" horizontalFitPolicy="FIT_POLICY_FIXED" leftRelation="" leftRelationType="" marginBottom="0.0" marginLeft="0.0" marginRight="0.0" marginTop="0.0" mode="Portrait" rightRelation="" rightRelationType="" topRelation="" topRelationType="" verticalFitPolicy="FIT_POLICY_FIXED" width="432.0" x="44.0" y="263.0"/>
+ <layout bottomRelation="" bottomRelationType="" centerHorizontal="false" centerVertical="false" height="67.0" horizontalFitPolicy="FIT_POLICY_FIXED" leftRelation="" leftRelationType="" marginBottom="0.0" marginLeft="0.0" marginRight="0.0" marginTop="0.0" mode="Landscape" rightRelation="" rightRelationType="" topRelation="" topRelationType="" verticalFitPolicy="FIT_POLICY_FIXED" width="381.0" x="90.0" y="236.0"/>
+ </Button>
+</ScenePopup>
#include "IvImageViewerPresentationModel.h"
#include "IvResourceManager.h"
#include "IvSettingPresentationModel.h"
+#include "IvSlideShowPopUp.h"
#include "IvTypes.h"
using namespace Tizen::App;
}
__pLabel->SetBackgroundColor(COLOR_HEADER_CONTORL_PANEL);
SetControlAlwaysOnTop(*__pLabel,true);
-
int allCount = __pPresentationModel->GetFileCount();
- int index = 1 ;
- String displayText;
- displayText.Append(index);
- displayText.Append("/");
- displayText.Append(allCount);
+ int index = 1 ;
+ String displayText;
+ displayText.Append(index);
+ displayText.Append("/");
+ displayText.Append(allCount);
- __pLabel->SetText(displayText);
+ __pLabel->SetText(displayText);
CreateGallery();
InitializeDisplay(__initializeDisplayModeCurrent);
InitializePanelDetail();
InitializePopup();
+
+ __pPopUp = new (std::nothrow) SlideShowPopUp();
+
+ if (__pPopUp != null)
+ {
+ __pPopUp->Initialize();
+ __pPopUp->SetEventListner(this);
+ AddControl(*__pPopUp);
+ }
+
+
if (__initializeDisplayModeCurrent == APPCONTROL_MODE_NORMAL
- || __initializeDisplayModeCurrent == APPCONTROL_MODE_MESSAGE
- || __initializeDisplayModeCurrent == APPCONTROL_MODE_EMAIL)
+ || __initializeDisplayModeCurrent == APPCONTROL_MODE_MESSAGE
+ || __initializeDisplayModeCurrent == APPCONTROL_MODE_EMAIL)
{
int index = __pPresentationModel->GetStartIndex();
__pGallery->UpdateGallery();
}
if (filePath.StartsWith(Environment::GetMediaPath(), 0) == true
- || filePath.StartsWith(Environment::GetExternalStoragePath(), 0) == true)
+ || filePath.StartsWith(Environment::GetExternalStoragePath(), 0) == true)
{
ContentManager::ScanFile(filePath);
}
break;
case ACTION_ID_FOOTER_BUTTON_SLIDE:
{
- int repeatValue = 0;
-
- if (__pPresentationModel->GetFileCount() > 1)
+ if (__pPopUp != null)
{
- __pGallery->UpdateGallery();
- if (__detail == false)
- {
- ShowPanelDetail(false);
- }
-
- __pSettingPresentationModel->GetValue(SECTION_NAME_IMAGE_VIEWER,
- ENTRY_NAME_IMAGE_VIEWER_REPEAT_VALUE, repeatValue);
-
- if (repeatValue == 0)
- {
- __pGallery->StartSlideShow(false);
- }
- else
- {
- __pGallery->StartSlideShow(true);
- }
+ __pPopUp->SetShowState(true);
+ __pPopUp->Show();
}
+
break;
}
case ACTION_ID_FOOTER_BUTTON_CROP:
delete pRotatedBuffer;
return;
-CATCH:
+ CATCH:
if (pRotatedBuffer != null) //this buffer is no longer used
{
delete pRotatedBuffer;
if (r == E_SUCCESS)
{
if (imageBuffer->GetExifOrientation() == EXIF_ORIENTATION_RIGHT_TOP
- || imageBuffer->GetExifOrientation() == EXIF_ORIENTATION_LEFT_BOTTOM)
+ || imageBuffer->GetExifOrientation() == EXIF_ORIENTATION_LEFT_BOTTOM)
{
Dimension srcDim(imageBuffer->GetHeight(), imageBuffer->GetWidth());
pBitmap->Scale(srcDim);
Invalidate(true);
AppLogDebug("EXIT");
}
+
+void
+ImageViewerForm::OnSlideSettingPopUpItemSelected(int index)
+{
+
+ if ( __pPopUp != NULL)
+ {
+ __pPopUp->SetShowState(false);
+ }
+
+ if (index == 0) // start slide show
+ {
+ int repeatValue = 0;
+
+ if (__pPresentationModel->GetFileCount() > 1)
+ {
+ __pGallery->UpdateGallery();
+
+ if (__detail == false)
+ {
+ ShowPanelDetail(false);
+ }
+
+ __pSettingPresentationModel->GetValue(SECTION_NAME_IMAGE_VIEWER,
+ ENTRY_NAME_IMAGE_VIEWER_REPEAT_VALUE, repeatValue);
+
+ if (repeatValue == 0)
+ {
+ __pGallery->StartSlideShow(false);
+ }
+ else
+ {
+ __pGallery->StartSlideShow(true);
+ }
+ }
+ }
+ else if (index == 1) // launch settings
+ {
+
+ HashMap* pDataList = new (std::nothrow) HashMap(SingleObjectDeleter);
+ pDataList->Construct();
+
+ __pPresentationModel->StartAppControl(APPCONTROL_PROVIDER_ID_GALLERY,
+ APPCONTROL_OPERATION_ID_CONFIGURE, null, pDataList, this);
+
+ }
+}
--- /dev/null
+//
+// Tizen Native SDK
+// Copyright (c) 2012 Samsung Electronics Co., Ltd.
+//
+// Licensed under the Flora License, Version 1.0 (the License);
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.tizenopensource.org/license
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an AS IS BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+
+/**
+ * @file SlideShowPopUp.cpp
+ * @brief This file contains the definitions of the SlideShowPopUp class.
+ */
+
+#include <FAppUiApp.h>
+#include <FUiScenes.h>
+
+#include "IvSlideShowPopUp.h"
+#include "IvSlideSettingListener.h"
+
+using namespace Tizen::App;
+using namespace Tizen::Base;
+using namespace Tizen::Base::Collection;
+using namespace Tizen::Graphics;
+using namespace Tizen::Ui;
+using namespace Tizen::Ui::Controls;
+using namespace Tizen::Ui::Scenes;
+
+
+static const int ID_FORMAT_START = 501;
+static const int ID_FORMAT_SETTING = 502;
+static const int ID_CANCEL_BUTTON = 503;
+
+
+SlideShowPopUp::SlideShowPopUp(void)
+:__pList(null)
+{
+
+}
+
+SlideShowPopUp::~SlideShowPopUp(void)
+{
+
+}
+
+bool
+SlideShowPopUp::Initialize(void)
+{
+ Button* pCancelButton = null;
+ Popup::Construct(L"IDL_SLIDESHOW_SETTING_POPUP");
+
+ __pList = static_cast<ListView*>(GetControl(L"IDC_POPUP_LIST"));
+
+ if (__pList == null)
+ {
+ return false;
+ }
+
+ __pList->SetItemProvider(*this);
+ __pList->AddListViewItemEventListener(*this);
+
+ pCancelButton = static_cast< Button* >(GetControl(L"IDC_BUTTON", true));
+
+ if (pCancelButton != null)
+ {
+ pCancelButton->AddActionEventListener(*this);
+ pCancelButton->SetActionId(ID_CANCEL_BUTTON);
+ }
+
+ return true;
+
+}
+
+result
+SlideShowPopUp::OnTerminating(void)
+{
+ result r = E_SUCCESS;
+ return r;
+}
+
+void
+SlideShowPopUp::OnActionPerformed(const Control& source, int actionId)
+{
+ switch (actionId)
+ {
+ case ID_CANCEL_BUTTON:
+ {
+ Popup::SetShowState(false);
+ Popup::Show();
+ }
+ break;
+ default:
+ break;
+ }
+ return;
+}
+
+void
+SlideShowPopUp::OnListViewItemStateChanged(ListView& listView, int index, int elementId, ListItemStatus status)
+{
+
+ if (__pListener != null)
+ {
+ __pListener->OnSlideSettingPopUpItemSelected(index);
+ }
+
+}
+
+ListItemBase*
+SlideShowPopUp::CreateItem(int index, int itemWidth)
+{
+ result r = E_FAILURE;
+ ListAnnexStyle style = LIST_ANNEX_STYLE_NORMAL;
+ int listItemHeight = 112;
+
+ CustomItem* pItem = new (std::nothrow) CustomItem();
+ r = pItem->Construct(Dimension(GetClientAreaBounds().width, listItemHeight), style);
+ pItem->SetBackgroundColor(LIST_ITEM_DRAWING_STATUS_NORMAL, Color::GetColor(COLOR_ID_WHITE));
+
+ if (IsFailed(r))
+ {
+ AppLogDebug("Create Item Failed with error %s", GetErrorMessage(r));
+ return null;
+ }
+
+ switch (index)
+ {
+
+ case 0:
+ {
+ pItem->AddElement(Rectangle(0, 0, GetClientAreaBounds().width, listItemHeight), ID_FORMAT_START, L"Start slideshow", true);
+ }
+ break;
+
+ case 1:
+ {
+ pItem->AddElement(Rectangle(0, 0, GetClientAreaBounds().width, listItemHeight), ID_FORMAT_SETTING, L"Slideshow settings", true);
+ }
+ break;
+
+ break;
+ default:
+ break;
+ }
+
+ return pItem;
+}
+
+bool
+SlideShowPopUp::DeleteItem(int index, ListItemBase* pItem, int itemWidth)
+{
+ return true;
+}
+
+int
+SlideShowPopUp::GetItemCount(void)
+{
+ return 2;
+}
+
+void
+SlideShowPopUp::SetEventListner(ISlideSettingListener* listner)
+{
+ __pListener = listner;
+}
+
const wchar_t* APPCONTROL_OPERATION_ID_VIEW = L"http://tizen.org/appcontrol/operation/view";
const wchar_t* APPCONTROL_OPERATION_ID_COMPOSE = L"http://tizen.org/appcontrol/operation/compose";
const wchar_t* APPCONTROL_OPERATION_ID_MAIN = L"http://tizen.org/appcontrol/operation/main";
+const wchar_t* APPCONTROL_OPERATION_ID_CONFIGURE = L"http://tizen.org/appcontrol/operation/configure";
+const wchar_t* APPCONTROL_PROVIDER_ID_GALLERY = L"tizen.gallery";
const wchar_t* APPCONTROL_KEY_TYPE = L"http://tizen.org/appcontrol/data/type";
const wchar_t* APPCONTROL_KEY_PATH = L"http://tizen.org/appcontrol/data/path";