TizenRefApp-8669 [Gallery] Refactor directory structure 27/133727/1
authorIgor Nazarov <i.nazarov@samsung.com>
Tue, 13 Jun 2017 07:49:38 +0000 (10:49 +0300)
committerIgor Nazarov <i.nazarov@samsung.com>
Tue, 13 Jun 2017 07:49:38 +0000 (10:49 +0300)
Change-Id: I82d1a4e2c01c05ad823f74c1ce4c161f3a97374b

108 files changed:
inc/config.h [deleted file]
inc/gallery/config.h [new file with mode: 0644]
inc/gallery/model/Gallery.h [new file with mode: 0644]
inc/gallery/model/IJob.h [new file with mode: 0644]
inc/gallery/model/IMediaAlbum.h [new file with mode: 0644]
inc/gallery/model/IMediaAlbum.hpp [new file with mode: 0644]
inc/gallery/model/MediaItem.h [new file with mode: 0644]
inc/gallery/model/SoundManager.h [new file with mode: 0644]
inc/gallery/model/types.h [new file with mode: 0644]
inc/gallery/presenters/AlertDialog.h [new file with mode: 0644]
inc/gallery/presenters/AtspiHighlightHelper.h [new file with mode: 0644]
inc/gallery/presenters/Instance.h [new file with mode: 0644]
inc/gallery/presenters/InstanceManager.h [new file with mode: 0644]
inc/gallery/presenters/MoreOptionsPresenter.h [new file with mode: 0644]
inc/gallery/presenters/NoContentPage.h [new file with mode: 0644]
inc/gallery/presenters/Page.h [new file with mode: 0644]
inc/gallery/presenters/Page.hpp [new file with mode: 0644]
inc/gallery/presenters/Presenter.h [new file with mode: 0644]
inc/gallery/presenters/PreviewPage.h [new file with mode: 0644]
inc/gallery/presenters/ProcessingPresenter.h [new file with mode: 0644]
inc/gallery/presenters/SelectModePresenter.h [new file with mode: 0644]
inc/gallery/presenters/ThumbnailPage.h [new file with mode: 0644]
inc/gallery/presenters/VideoPlayerPage.h [new file with mode: 0644]
inc/gallery/presenters/ViewerPage.h [new file with mode: 0644]
inc/gallery/presenters/types.h [new file with mode: 0644]
inc/gallery/resources.h [new file with mode: 0644]
inc/gallery/types.h [new file with mode: 0644]
inc/gallery/view/ImageGrid.h [new file with mode: 0644]
inc/gallery/view/ImageViewer.h [new file with mode: 0644]
inc/gallery/view/PageContent.h [new file with mode: 0644]
inc/gallery/view/TouchParser.h [new file with mode: 0644]
inc/gallery/view/helpers.h [new file with mode: 0644]
inc/gallery/view/types.h [new file with mode: 0644]
inc/model/Gallery.h [deleted file]
inc/model/IJob.h [deleted file]
inc/model/IMediaAlbum.h [deleted file]
inc/model/IMediaAlbum.hpp [deleted file]
inc/model/MediaItem.h [deleted file]
inc/model/SoundManager.h [deleted file]
inc/model/types.h [deleted file]
inc/presenters/AlertDialog.h [deleted file]
inc/presenters/AtspiHighlightHelper.h [deleted file]
inc/presenters/Instance.h [deleted file]
inc/presenters/InstanceManager.h [deleted file]
inc/presenters/MoreOptionsPresenter.h [deleted file]
inc/presenters/NoContentPage.h [deleted file]
inc/presenters/Page.h [deleted file]
inc/presenters/Page.hpp [deleted file]
inc/presenters/Presenter.h [deleted file]
inc/presenters/PreviewPage.h [deleted file]
inc/presenters/ProcessingPresenter.h [deleted file]
inc/presenters/SelectModePresenter.h [deleted file]
inc/presenters/ThumbnailPage.h [deleted file]
inc/presenters/VideoPlayerPage.h [deleted file]
inc/presenters/ViewerPage.h [deleted file]
inc/presenters/types.h [deleted file]
inc/resources.h [deleted file]
inc/types.h [deleted file]
inc/view/ImageGrid.h [deleted file]
inc/view/ImageViewer.h [deleted file]
inc/view/PageContent.h [deleted file]
inc/view/TouchParser.h [deleted file]
inc/view/helpers.h [deleted file]
inc/view/types.h [deleted file]
src/common.h
src/helpers.h [new file with mode: 0644]
src/helpers.hpp [new file with mode: 0644]
src/internal.h [deleted file]
src/internal.hpp [deleted file]
src/main.cpp
src/model/BaseJob.h
src/model/Gallery.cpp
src/model/GalleryAlbum.h
src/model/MediaItem.cpp
src/model/SoundManager.cpp
src/model/common.h
src/model/helpers.cpp [new file with mode: 0644]
src/model/helpers.h [new file with mode: 0644]
src/model/helpers.hpp [new file with mode: 0644]
src/model/internal.cpp [deleted file]
src/model/internal.h [deleted file]
src/model/internal.hpp [deleted file]
src/presenters/AlertDialog.cpp
src/presenters/AtspiHighlightHelper.cpp
src/presenters/Instance.cpp
src/presenters/InstanceManager.cpp
src/presenters/MoreOptionsPresenter.cpp
src/presenters/NoContentPage.cpp
src/presenters/Page.cpp
src/presenters/Presenter.cpp
src/presenters/PreviewPage.cpp
src/presenters/ProcessingPresenter.cpp
src/presenters/SelectModePresenter.cpp
src/presenters/ThumbnailPage.cpp
src/presenters/VideoPlayerPage.cpp
src/presenters/ViewerPage.cpp
src/presenters/common.h
src/presenters/helpers.cpp [new file with mode: 0644]
src/presenters/helpers.h [new file with mode: 0644]
src/presenters/internal.cpp [deleted file]
src/presenters/internal.h [deleted file]
src/resources.cpp
src/view/ImageGrid.cpp
src/view/ImageViewer.cpp
src/view/PageContent.cpp
src/view/TouchParser.cpp
src/view/common.h
src/view/helpers.cpp

diff --git a/inc/config.h b/inc/config.h
deleted file mode 100644 (file)
index debdc9a..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * Copyright 2017 Samsung Electronics Co., Ltd
- *
- * 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
- *
- *     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.
- */
-
-#ifndef __GALLERY_CONFIG_H__
-#define __GALLERY_CONFIG_H__
-
-#define GALLERY_LOG_TAG "GALLERY"
-
-namespace gallery {
-
-       constexpr auto WINDOW_NAME = "org.tizen.gallery";
-
-       constexpr auto BASE_SCALE = 1.3;
-
-       // TODO Temporary feature while support only offline mode
-       constexpr auto SCAN_MEDIA_ON_RESUME = false;
-}
-
-#endif // __GALLERY_CONFIG_H__
diff --git a/inc/gallery/config.h b/inc/gallery/config.h
new file mode 100644 (file)
index 0000000..debdc9a
--- /dev/null
@@ -0,0 +1,32 @@
+/*
+ * Copyright 2017 Samsung Electronics Co., Ltd
+ *
+ * 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
+ *
+ *     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.
+ */
+
+#ifndef __GALLERY_CONFIG_H__
+#define __GALLERY_CONFIG_H__
+
+#define GALLERY_LOG_TAG "GALLERY"
+
+namespace gallery {
+
+       constexpr auto WINDOW_NAME = "org.tizen.gallery";
+
+       constexpr auto BASE_SCALE = 1.3;
+
+       // TODO Temporary feature while support only offline mode
+       constexpr auto SCAN_MEDIA_ON_RESUME = false;
+}
+
+#endif // __GALLERY_CONFIG_H__
diff --git a/inc/gallery/model/Gallery.h b/inc/gallery/model/Gallery.h
new file mode 100644 (file)
index 0000000..1a711f9
--- /dev/null
@@ -0,0 +1,45 @@
+/*
+ * Copyright 2017 Samsung Electronics Co., Ltd
+ *
+ * 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
+ *
+ *     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.
+ */
+
+#ifndef __GALLERY_MODEL_GALLERY_H__
+#define __GALLERY_MODEL_GALLERY_H__
+
+#include "IMediaAlbum.h"
+
+namespace gallery {
+
+       UCL_DECLARE_REF_ALIASES(Gallery);
+
+       class Gallery final : public ucl::NonCopyable {
+       public:
+               static GallerySRef newInstance();
+               ~Gallery();
+
+               IMediaAlbumSRef getAlbum();
+
+       private:
+               friend class ucl::RefCountObj<Gallery>;
+               Gallery();
+
+               ucl::Result prepare();
+
+       private:
+               IMediaAlbumSRef m_album;
+               bool m_isMediaDbConnected;
+       };
+}
+
+#endif // __GALLERY_MODEL_GALLERY_H__
diff --git a/inc/gallery/model/IJob.h b/inc/gallery/model/IJob.h
new file mode 100644 (file)
index 0000000..8c7d56e
--- /dev/null
@@ -0,0 +1,34 @@
+/*
+ * Copyright 2017 Samsung Electronics Co., Ltd
+ *
+ * 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
+ *
+ *     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.
+ */
+
+#ifndef __GALLERY_MODEL_I_JOB_H__
+#define __GALLERY_MODEL_I_JOB_H__
+
+#include "types.h"
+
+namespace gallery {
+
+       UCL_DECLARE_REF_ALIASES(IJob);
+
+       class IJob : public ucl::Polymorphic {
+       public:
+               virtual ucl::Result getResult() const = 0;
+               virtual bool isCancelable() const = 0;
+               virtual ucl::Result cancel() = 0;
+       };
+}
+
+#endif // __GALLERY_MODEL_I_JOB_H__
diff --git a/inc/gallery/model/IMediaAlbum.h b/inc/gallery/model/IMediaAlbum.h
new file mode 100644 (file)
index 0000000..80eb222
--- /dev/null
@@ -0,0 +1,47 @@
+/*
+ * Copyright 2017 Samsung Electronics Co., Ltd
+ *
+ * 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
+ *
+ *     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.
+ */
+
+#ifndef __GALLERY_MODEL_I_MEDIA_ALBUM_H__
+#define __GALLERY_MODEL_I_MEDIA_ALBUM_H__
+
+#include "MediaItem.h"
+
+namespace gallery {
+
+       UCL_DECLARE_REF_ALIASES(IMediaAlbum);
+
+       class IMediaAlbum : public ucl::Polymorphic {
+       public:
+               using EachCb = ucl::Delegate<bool(MediaItemSRef &&media)>;
+
+       public:
+               virtual void addChangeHandler(const NotiHandler &handler) = 0;
+               virtual void delChangeHandler(const NotiHandler &handler) = 0;
+
+               virtual ucl::Result forEachMedia(EachCb cb) const = 0;
+               virtual ucl::Result getMediaCount(int &count) const = 0;
+
+               virtual void defragment() = 0;
+       };
+
+       // Non-member functions //
+
+       bool isEmpty(const IMediaAlbum &album);
+}
+
+#include "IMediaAlbum.hpp"
+
+#endif // __GALLERY_MODEL_I_MEDIA_ALBUM_H__
diff --git a/inc/gallery/model/IMediaAlbum.hpp b/inc/gallery/model/IMediaAlbum.hpp
new file mode 100644 (file)
index 0000000..5793dfc
--- /dev/null
@@ -0,0 +1,30 @@
+/*
+ * Copyright 2017 Samsung Electronics Co., Ltd
+ *
+ * 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
+ *
+ *     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.
+ */
+
+#include "ucl/util/logging.h"
+
+namespace gallery {
+
+       // Non-member functions //
+
+       inline bool isEmpty(const IMediaAlbum &album)
+       {
+               int count = 0;
+               UCL_FAIL_RETURN_VALUE(album.getMediaCount(count), true,
+                               "album.getMediaCount() failed!");
+               return (count == 0);
+       }
+}
diff --git a/inc/gallery/model/MediaItem.h b/inc/gallery/model/MediaItem.h
new file mode 100644 (file)
index 0000000..df35b8d
--- /dev/null
@@ -0,0 +1,128 @@
+/*
+ * Copyright 2017 Samsung Electronics Co., Ltd
+ *
+ * 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
+ *
+ *     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.
+ */
+
+#ifndef __GALLERY_MODEL_MEDIA_ITEM_H__
+#define __GALLERY_MODEL_MEDIA_ITEM_H__
+
+#include <vector>
+
+#include <media_content.h>
+
+#include "ucl/misc/AutoHandle.h"
+
+#include "IJob.h"
+
+namespace gallery {
+
+       UCL_DECLARE_REF_ALIASES(MediaItem);
+
+       using MediaItems = std::vector<MediaItemSRef>;
+
+       class MediaItem : public ucl::Polymorphic {
+       public:
+               using ThumbnailPathGetCb =
+                               ucl::WeakDelegate<void(ucl::Result, const std::string &path)>;
+
+               class Remover;
+               class RemoverBuilder final {
+               public:
+                       RemoverBuilder &setItems(MediaItems items);
+                       IJobSRef build(const NotiHandler &onComplete) const;
+               private:
+                       ucl::SharedRef<MediaItems> m_items;
+               };
+
+               class Saver;
+               class SaverBuilder final {
+               public:
+                       SaverBuilder &setItem(const MediaItemSRef &item);
+                       IJobSRef build(const NotiHandler &onComplete) const;
+               private:
+                       MediaItemSRef m_item;
+               };
+
+               enum {
+                       FLAG_THUMBNAIL = 1,
+                       FLAG_REMOVE = 2,
+                       FLAG_SAVE = 4,
+                       FLAG_RESOLUTION = 8,
+
+                       FLAGS_FROM_MEDIA_DB = (FLAG_THUMBNAIL | FLAG_REMOVE |
+                                       FLAG_RESOLUTION),
+                       FLAGS_SIMPLE_FILE = (FLAG_SAVE)
+               };
+
+       public:
+               static MediaItemSRef newInstance(media_info_h media);
+               static MediaItemSRef newInstance(std::string filePath);
+               virtual ~MediaItem();
+
+               bool isValid() const;
+               int getFlags() const;
+               MediaType getType() const;
+
+               const std::string &getId() const;
+
+               ucl::Result getResolution(int &x, int &y) const;
+
+               const std::string &getFilePath() const;
+
+               ucl::Result getThumbnailPath(const ThumbnailPathGetCb &cb) const;
+               void cancelThumbnailPathGet() const;
+
+               ucl::Result removeFile();
+               ucl::Result saveToDevice();
+
+       protected:
+               friend class ucl::RefCountObj<MediaItem>;
+               MediaItem(int flags, MediaType type);
+
+               ucl::Result prepare(media_info_h media);
+               ucl::Result prepareImage(media_info_h media);
+               ucl::Result prepare(std::string filePath);
+
+       private:
+               ucl::Result initThumbPath(media_info_h media) const;
+
+       private:
+               // XXX This proxy is needed to deal with cases when
+               // media_thumbnail_completed_cb can't be cancelled
+               struct ThumbCbProxy {
+                       const MediaItem *item;
+                       ThumbnailPathGetCb callback;
+
+                       void completeCb(media_content_error_e error, const char *path);
+               };
+
+       private:
+               using AutoMediaInfo = ucl::AutoHandle<
+                               media_info_h, int, media_info_destroy>;
+
+       private:
+               const int m_flags;
+               const MediaType m_type;
+               std::string m_mediaId;
+               std::string m_filePath;
+               int m_resolutionX;
+               int m_resolutionY;
+               mutable AutoMediaInfo m_media;
+               mutable std::string m_thumbPath;
+               mutable std::unique_ptr<ThumbCbProxy> m_thumbCbProxy;
+               bool m_isValid;
+       };
+}
+
+#endif // __GALLERY_MODEL_MEDIA_ITEM_H__
diff --git a/inc/gallery/model/SoundManager.h b/inc/gallery/model/SoundManager.h
new file mode 100644 (file)
index 0000000..df5e36a
--- /dev/null
@@ -0,0 +1,74 @@
+/*
+ * Copyright 2017 Samsung Electronics Co., Ltd
+ *
+ * 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
+ *
+ *     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.
+ */
+
+#ifndef __GALLERY_MODEL_SOUND_MANAGER_H__
+#define __GALLERY_MODEL_SOUND_MANAGER_H__
+
+#include <sound_manager.h>
+
+#include "ucl/misc/Event.h"
+
+#include "types.h"
+
+namespace gallery {
+
+       UCL_DECLARE_REF_ALIASES(SoundManager);
+
+       class SoundManager final : public ucl::NonCopyable {
+       public:
+               static SoundManagerSRef newInstance();
+
+               bool isMediaDeviceReady() const;
+
+               int getCurrentMediaVolume() const;
+               int getMaxMediaVolume() const;
+
+               void addMediaDeviceStateChangeHandler(const NotiHandler &handler);
+               void delMediaDeviceStateChangeHandler(const NotiHandler &handler);
+
+               void addMediaVolumeChangeHandler(const NotiHandler &handler);
+               void delMediaVolumeChangeHandler(const NotiHandler &handler);
+
+       private:
+               friend class ucl::RefCountObj<SoundManager>;
+               SoundManager();
+               ~SoundManager();
+
+               ucl::Result prepare();
+
+               void setMediaDeviceState(bool isReady);
+               void setCurrentMediaVolume(int value);
+
+               ucl::Result updateMediaDeviceState();
+
+               void onDeviceConnectionChanged(sound_device_h device, bool isConnected);
+               void onDeviceStateChanged(sound_device_h device,
+                               sound_device_state_e state);
+               void onVolumeChanged(sound_type_e type, unsigned int volume);
+
+       private:
+               ucl::Event<NotiHandler> m_onMediaDeviceStateChange;
+               ucl::Event<NotiHandler> m_onMediaVolumeChange;
+               int m_devConnChangedCbId;
+               int m_devStateChangedCbId;
+               int m_volumeChangedCbId;
+               int m_currentMediaVolume;
+               int m_maxMediaVolume;
+               bool m_isMediaDeviceReady;
+       };
+}
+
+#endif // __GALLERY_MODEL_SOUND_MANAGER_H__
diff --git a/inc/gallery/model/types.h b/inc/gallery/model/types.h
new file mode 100644 (file)
index 0000000..38feee5
--- /dev/null
@@ -0,0 +1,33 @@
+/*
+ * Copyright 2017 Samsung Electronics Co., Ltd
+ *
+ * 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
+ *
+ *     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.
+ */
+
+#ifndef __GALLERY_MODEL_TYPES_H__
+#define __GALLERY_MODEL_TYPES_H__
+
+#include "gallery/types.h"
+
+namespace gallery {
+
+       enum class MediaType {
+               IMAGE,
+               VIDEO,
+               SOUND,
+               MUSIC,
+               OTHERS
+       };
+}
+
+#endif // __GALLERY_MODEL_TYPES_H__
diff --git a/inc/gallery/presenters/AlertDialog.h b/inc/gallery/presenters/AlertDialog.h
new file mode 100644 (file)
index 0000000..59274a2
--- /dev/null
@@ -0,0 +1,100 @@
+/*
+ * Copyright 2017 Samsung Electronics Co., Ltd
+ *
+ * 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
+ *
+ *     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.
+ */
+
+#ifndef __GALLERY_PRESENTERS_ALERT_DIALOG_H__
+#define __GALLERY_PRESENTERS_ALERT_DIALOG_H__
+
+#include "ucl/gui/StyledWidget.h"
+#include "ucl/gui/Layout.h"
+
+#include "Presenter.h"
+
+namespace gallery {
+
+       UCL_DECLARE_REF_ALIASES(AlertDialog);
+
+       class AlertDialog final : public Presenter,
+                       public ucl::IDisposable {
+       public:
+               enum class Type {
+                       OK_CANCEL
+               };
+
+               enum Event {
+                       EVENT_CANCEL,
+                       EVENT_OK,
+                       EVENT_BACK
+               };
+
+               using EventHandler = ucl::WeakDelegate<
+                               bool(AlertDialog &dialog, int event)>;
+
+               class Builder {
+               public:
+                       Builder();
+                       Builder &setType(Type type);
+                       Builder &setTitle(ucl::TString title);
+                       Builder &setText(ucl::TString text);
+                       Builder &setHandler(const EventHandler &handler);
+                       AlertDialogWRef build(ucl::ElmWidget &parent) const;
+               private:
+                       Type m_type;
+                       ucl::TString m_title;
+                       ucl::TString m_text;
+                       EventHandler m_handler;
+               };
+
+       public:
+               void dismiss();
+
+               // ucl::IDisposable //
+
+               virtual void dispose() final override;
+               virtual bool isDisposed() const final override;
+
+       private:
+               friend class ucl::RefCountObj<AlertDialog>;
+               AlertDialog(ucl::RefCountObjBase &rc,
+                               const EventHandler &handler);
+               virtual ~AlertDialog();
+
+               ucl::Result prepare(ucl::ElmWidget &parent, Type type);
+               ucl::Result createPopup(ucl::ElmWidget &parent, ucl::ElmStyle style);
+               ucl::Result createLayout(ucl::LayoutTheme theme);
+               ucl::Result createButton(Event event, ucl::EdjePart part,
+                               ucl::ElmStyle btnStyle, ucl::LayoutTheme iconTheme,
+                               const ucl::TString &text = nullptr);
+
+               void setTitle(const ucl::TString &title);
+               void setText(const ucl::TString &text);
+
+               void handleEvent(Event event);
+               bool dispatchEvent(Event event);
+
+               void onPopupDismissed(ucl::Widget &widget, void *eventInfo);
+               void onPopupHWBackKey(Evas_Object *obj, void *eventInfo);
+
+               void onBtnClick(ucl::Widget &widget, void *eventInfo);
+
+       private:
+               const EventHandler m_handler;
+               ucl::StyledWidgetSRef m_popup;
+               ucl::LayoutWRef m_layout;
+               bool m_isDismissed;
+       };
+}
+
+#endif // __GALLERY_PRESENTERS_ALERT_DIALOG_H__
diff --git a/inc/gallery/presenters/AtspiHighlightHelper.h b/inc/gallery/presenters/AtspiHighlightHelper.h
new file mode 100644 (file)
index 0000000..b84471e
--- /dev/null
@@ -0,0 +1,52 @@
+/*
+ * Copyright 2017 Samsung Electronics Co., Ltd
+ *
+ * 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
+ *
+ *     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.
+ */
+
+#ifndef __GALLERY_PRESENTERS_ATSPI_HIGHLIGH_HELPER_H__
+#define __GALLERY_PRESENTERS_ATSPI_HIGHLIGH_HELPER_H__
+
+#include "Presenter.h"
+
+namespace gallery {
+
+       UCL_DECLARE_REF_ALIASES(AtspiHighlightHelper);
+
+       class AtspiHighlightHelper final : public Presenter {
+       public:
+               using EventHandler = ucl::WeakDelegate<Elm_Interface_Atspi_Accessible *(
+                               ucl::Widget &widget, Elm_Atspi_Relation_Type flowRelation)>;
+
+       public:
+               static AtspiHighlightHelperSRef newInstance(ucl::ElmWidget &rootWidget);
+
+               void setEventHandler(EventHandler handler);
+               void registerWidget(ucl::ElmWidget &widget);
+
+       private:
+               friend class ucl::RefCountObj<AtspiHighlightHelper>;
+               AtspiHighlightHelper(ucl::RefCountObjBase &rc);
+               virtual ~AtspiHighlightHelper();
+
+               ucl::Result prepare(ucl::ElmWidget &rootWidget);
+
+       private:
+               void onAtspiGesture(ucl::Widget &widget, void *eventInfo);
+
+       private:
+               EventHandler m_eventHandler;
+       };
+}
+
+#endif // __GALLERY_PRESENTERS_ATSPI_HIGHLIGH_HELPER_H__
diff --git a/inc/gallery/presenters/Instance.h b/inc/gallery/presenters/Instance.h
new file mode 100644 (file)
index 0000000..2fee458
--- /dev/null
@@ -0,0 +1,94 @@
+/*
+ * Copyright 2017 Samsung Electronics Co., Ltd
+ *
+ * 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
+ *
+ *     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.
+ */
+
+#ifndef __GALLERY_PRESENTERS_INSTANCE_H__
+#define __GALLERY_PRESENTERS_INSTANCE_H__
+
+#include "ucl/appfw/IInstance.h"
+#include "ucl/appfw/IInstanceAppControlExt.h"
+#include "ucl/appfw/SysEventProvider.h"
+
+#include "ucl/gui/Theme.h"
+#include "ucl/gui/Naviframe.h"
+
+#include "gallery/model/Gallery.h"
+#include "Page.h"
+
+namespace gallery {
+
+       class Instance final : public ucl::RefCountAware,
+                       public ucl::IInstance,
+                       public ucl::IInstanceAppControlExt {
+       public:
+               Instance(ucl::RefCountObjBase &rc,
+                               ucl::SysEventProvider &sysEventProvider);
+               virtual ~Instance();
+
+               // IInstance //
+
+               virtual ucl::Result onCreate(
+                               ucl::IInstanceContext *context) final override;
+               virtual void onPause() final override;
+               virtual void onResume() final override;
+
+               // IInstanceAppControlExt //
+
+               virtual void onAppControl(app_control_h appControl) final override;
+
+       private:
+               ucl::Result setupTheme();
+
+               void rescanMediaContent();
+               void stopMediaContentScan();
+               void startMediaContentScan();
+               void onScanComplete(media_content_error_e error);
+
+               ucl::Result handleAppControl(app_control_h appControl);
+               ucl::Result handleSingleMode(const std::string &operation,
+                               app_control_h appControl);
+               ucl::Result handleGroupMode(const std::string &operation,
+                               app_control_h appControl);
+
+               ucl::Result ensureGalleryModel();
+
+               void createNoContentPage();
+               void createThumbnailPage();
+               void createViewerPage(const MediaItemSRef &media);
+               void createVideoPlayerPage(const MediaItemSRef &media);
+
+               void onAlbumChanged();
+               void onPageExitRequest(Page &page);
+
+               void onSysEvent(const ucl::SysEvent sysEvent);
+
+       private:
+               ucl::SysEventProvider &m_sysEventProvider;
+               ucl::IInstanceContext *m_context;
+
+               GallerySRef m_gallery;
+               bool m_isScanInProgress;
+
+               ucl::WindowSRef m_win;
+               ucl::Theme m_theme;
+               ucl::NaviframeSRef m_navi;
+
+               PageWRef m_page;
+
+               bool m_isGroupMode;
+       };
+}
+
+#endif // __GALLERY_PRESENTERS_INSTANCE_H__
diff --git a/inc/gallery/presenters/InstanceManager.h b/inc/gallery/presenters/InstanceManager.h
new file mode 100644 (file)
index 0000000..b83b576
--- /dev/null
@@ -0,0 +1,36 @@
+/*
+ * Copyright 2017 Samsung Electronics Co., Ltd
+ *
+ * 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
+ *
+ *     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.
+ */
+
+#ifndef __GALLERY_PRESENTERS_INSTANCE_MANAGER_H__
+#define __GALLERY_PRESENTERS_INSTANCE_MANAGER_H__
+
+#include "ucl/appfw/InstanceManagerBase.h"
+
+#include "types.h"
+
+namespace gallery {
+
+       class InstanceManager : public ucl::InstanceManagerBase {
+       public:
+               InstanceManager();
+
+               // ucl::InstanceManagerBase //
+
+               virtual ucl::IInstanceSRef newInstance() const final override;
+       };
+}
+
+#endif // __GALLERY_PRESENTERS_INSTANCE_MANAGER_H__
diff --git a/inc/gallery/presenters/MoreOptionsPresenter.h b/inc/gallery/presenters/MoreOptionsPresenter.h
new file mode 100644 (file)
index 0000000..c959b3c
--- /dev/null
@@ -0,0 +1,107 @@
+/*
+ * Copyright 2017 Samsung Electronics Co., Ltd
+ *
+ * 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
+ *
+ *     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.
+ */
+
+#ifndef __GALLERY_PRESENTERS_MORE_OPTIONS_PRESENTER_H__
+#define __GALLERY_PRESENTERS_MORE_OPTIONS_PRESENTER_H__
+
+#include <list>
+
+#include "ucl/misc/HashMap.h"
+
+#include "Presenter.h"
+
+namespace gallery {
+
+       UCL_DECLARE_REF_ALIASES(MoreOptionsPresenter);
+
+       class MoreOptionsPresenter final : public Presenter {
+       public:
+               UCL_DECLARE_REF_ALIASES(IListener);
+
+               struct Option {
+                       int id;
+                       ucl::TString text;
+                       ucl::TString subText;
+                       ucl::LayoutTheme iconTheme;
+               };
+
+               using MoreOptions = std::list<Option>;
+
+               class Builder {
+               public:
+                       Builder();
+                       ~Builder();
+                       bool isEmpty() const;
+                       Builder &clear();
+                       Builder &addOption(Option option);
+                       MoreOptionsPresenterSRef build(ucl::ElmWidget &parent) const;
+               private:
+                       ucl::SharedRef<MoreOptions> m_options;
+               };
+
+               class IListener : public ucl::Polymorphic {
+               public:
+                       virtual void onMoreOptionClicked(MoreOptionsPresenter &sender,
+                                       const Option &option) = 0;
+                       virtual void onMoreOptionSelected(MoreOptionsPresenter &sender,
+                                       const Option &option) {};
+                       virtual void onMoreOptionsOpened(MoreOptionsPresenter &sender) {};
+                       virtual void onMoreOptionsClosed(MoreOptionsPresenter &sender) {};
+               };
+
+       public:
+               void setListener(const IListenerWRef &listener);
+
+               ucl::Widget &getWidget();
+
+               void setOpened(bool isOpened);
+               bool isOpened() const;
+
+               void setOpenedDelayed(bool isOpened, double timeout);
+
+       private:
+               using MoreOptionsCSRef = ucl::SharedRef<const MoreOptions>;
+
+       private:
+               friend class ucl::RefCountObj<MoreOptionsPresenter>;
+               MoreOptionsPresenter(ucl::RefCountObjBase &rc,
+                               const MoreOptionsCSRef &options);
+               virtual ~MoreOptionsPresenter();
+
+               ucl::Result prepare(ucl::ElmWidget &parent);
+               ucl::Result addItem(const Option &option);
+
+               bool resetTimer(double timeout);
+               void stopTimer();
+
+               Eina_Bool onTimer();
+
+               void onOpened(ucl::Widget &widget, void *eventInfo);
+               void onClosed(ucl::Widget &widget, void *eventInfo);
+               void onItemClicked(ucl::Widget &widget, void *eventInfo);
+               void onItemSelected(ucl::Widget &widget, void *eventInfo);
+
+       private:
+               const MoreOptionsCSRef m_options;
+               ucl::HashMap<void *, const Option *> m_map;
+               ucl::ElmWidgetSRef m_widget;
+               IListenerWRef m_listener;
+               Ecore_Timer *m_timer;
+               bool m_newOpenedState;
+       };
+}
+
+#endif // __GALLERY_PRESENTERS_MORE_OPTIONS_PRESENTER_H__
diff --git a/inc/gallery/presenters/NoContentPage.h b/inc/gallery/presenters/NoContentPage.h
new file mode 100644 (file)
index 0000000..b02900d
--- /dev/null
@@ -0,0 +1,49 @@
+/*
+ * Copyright 2017 Samsung Electronics Co., Ltd
+ *
+ * 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
+ *
+ *     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.
+ */
+
+#ifndef __GALLERY_PRESENTERS_NO_CONTENT_PAGE_H__
+#define __GALLERY_PRESENTERS_NO_CONTENT_PAGE_H__
+
+#include "Page.h"
+
+namespace gallery {
+
+       UCL_DECLARE_REF_ALIASES(NoContentPage);
+
+       class NoContentPage final : public Page {
+       public:
+               class Builder {
+               public:
+                       Builder();
+                       ~Builder();
+                       Builder &setNaviframe(const ucl::NaviframeSRef &navi);
+                       NoContentPageWRef build(
+                                       const ExitRequestHandler &onExitRequest) const;
+               private:
+                       ucl::NaviframeSRef m_navi;
+               };
+
+       private:
+               friend class ucl::RefCountObj<NoContentPage>;
+               NoContentPage(ucl::RefCountObjBase &rc, const ucl::NaviframeSRef &navi,
+                               const ExitRequestHandler &onExitRequest);
+               virtual ~NoContentPage();
+
+               ucl::Result prepare();
+       };
+}
+
+#endif // __GALLERY_PRESENTERS_NO_CONTENT_PAGE_H__
diff --git a/inc/gallery/presenters/Page.h b/inc/gallery/presenters/Page.h
new file mode 100644 (file)
index 0000000..4be629e
--- /dev/null
@@ -0,0 +1,92 @@
+/*
+ * Copyright 2017 Samsung Electronics Co., Ltd
+ *
+ * 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
+ *
+ *     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.
+ */
+
+#ifndef __GALLERY_PRESENTERS_PAGE_H__
+#define __GALLERY_PRESENTERS_PAGE_H__
+
+#include "ucl/gui/Naviframe.h"
+
+#include "Presenter.h"
+
+namespace gallery {
+
+       UCL_DECLARE_REF_ALIASES(Page);
+
+       class Page : public Presenter {
+       public:
+               using ExitRequestHandler = ucl::WeakDelegate<void(Page &page)>;
+
+       public:
+               ucl::Naviframe &getNaviframe();
+
+               bool isAtTop() const;
+               bool isAtBottom() const;
+
+               void exit();
+               void exitNoTransition();
+
+               void popTo();
+               void deleteTo();
+               void promote();
+
+               template <class ...ARGS>
+               ucl::NaviItem insertAfter(ARGS &&...args);
+
+               template <class ...ARGS>
+               ucl::NaviItem insertBefore(ARGS &&...args);
+
+       protected:
+               Page(ucl::RefCountObjBase &rc, const ucl::NaviframeSRef &navi,
+                               const ExitRequestHandler &onExitRequest);
+               virtual ~Page();
+
+               template <class ITEM_FACTORY>
+               ucl::Result prepare(ITEM_FACTORY &&makeItem);
+
+               ucl::NaviItem getItem();
+
+               void requestExit();
+
+               virtual void onBackKey();
+
+       private:
+               ucl::Result preparePart2();
+
+               void dispatchTopPageChanged();
+
+               void updateActiveState();
+
+               void onTransitionStarted(ucl::Widget &widget, void *eventInfo);
+               void onTransitionFinished(ucl::Widget &widget, void *eventInfo);
+               void onTopPageChanged(ucl::Widget &widget, void *eventInfo);
+
+               void onHWBackKey(Evas_Object *obj, void *eventInfo);
+               void onItemDel(Evas_Object *obj, void *eventInfo);
+
+       private:
+               const ucl::NaviframeSRef m_navi;
+               const ExitRequestHandler m_onExitRequest;
+               ucl::NaviItem m_item;
+       };
+
+       // Non-member functions //
+
+       bool isLast(const Page &page);
+}
+
+#include "Page.hpp"
+
+#endif // __GALLERY_PRESENTERS_PAGE_H__
diff --git a/inc/gallery/presenters/Page.hpp b/inc/gallery/presenters/Page.hpp
new file mode 100644 (file)
index 0000000..b0e1ae7
--- /dev/null
@@ -0,0 +1,65 @@
+/*
+ * Copyright 2017 Samsung Electronics Co., Ltd
+ *
+ * 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
+ *
+ *     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.
+ */
+
+#include "ucl/util/logging.h"
+
+namespace gallery {
+
+       template <class ITEM_FACTORY>
+       inline ucl::Result Page::prepare(ITEM_FACTORY &&makeItem)
+       {
+               m_item = makeItem();
+               if (!m_item) {
+                       UCL_LOG_RETURN(ucl::RES_FAIL, "m_item is NULL");
+               }
+               return preparePart2();
+       }
+
+       template <class ...ARGS>
+       inline ucl::NaviItem Page::insertAfter(ARGS &&...args)
+       {
+               return m_navi->insertAfter(m_item, std::forward<ARGS>(args)...);
+       }
+
+       template <class ...ARGS>
+       inline ucl::NaviItem Page::insertBefore(ARGS &&...args)
+       {
+               return m_navi->insertBefore(m_item, std::forward<ARGS>(args)...);
+       }
+
+       inline ucl::Naviframe &Page::getNaviframe()
+       {
+               UCL_ASSERT(m_navi, "m_navi is NULL");
+               return *m_navi;
+       }
+
+       inline bool Page::isAtTop() const
+       {
+               return (m_navi->getTopItem() == m_item);
+       }
+
+       inline bool Page::isAtBottom() const
+       {
+               return (m_navi->getBottomItem() == m_item);
+       }
+
+       // Non-member functions //
+
+       inline bool isLast(const Page &page)
+       {
+               return (page.isAtBottom() && page.isAtTop());
+       }
+}
diff --git a/inc/gallery/presenters/Presenter.h b/inc/gallery/presenters/Presenter.h
new file mode 100644 (file)
index 0000000..4ed3530
--- /dev/null
@@ -0,0 +1,89 @@
+/*
+ * Copyright 2017 Samsung Electronics Co., Ltd
+ *
+ * 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
+ *
+ *     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.
+ */
+
+#ifndef __GALLERY_PRESENTERS_PRESENTER_H__
+#define __GALLERY_PRESENTERS_PRESENTER_H__
+
+#include <unordered_set>
+
+#include "ucl/gui/Window.h"
+
+#include "types.h"
+
+namespace gallery {
+
+       UCL_DECLARE_REF_ALIASES(Presenter);
+
+       class Presenter : public ucl::RefCountAware {
+       public:
+               struct DeactivatorInfo {
+                       void *deactivator;
+                       bool isBroadcast;
+               };
+
+       public:
+               bool isActive() const;
+               bool isDeactivatedBy(void *deactivator) const;
+
+               void activateBy(void *deactivator);
+               void deactivateBy(void *deactivator);
+
+       protected:
+               Presenter(ucl::RefCountObjBase &rc);
+               virtual ~Presenter();
+
+               ucl::Result prepare(ucl::ElmWidget &widget);
+
+               ucl::Window &getWindow();
+               bool isWindowReady() const;
+
+               void addDeactivatorSource(ucl::Widget &source);
+               void addDeactivatorException(void *deactivator);
+
+               void sendActivateBy(ucl::Widget &sender, void *deactivator);
+               void sendDeactivateBy(ucl::Widget &sender, void *deactivator);
+
+               void broadcastActivateBy(void *deactivator);
+               void broadcastDeactivateBy(void *deactivator);
+
+               virtual void onActivate();
+               virtual void onDeactivate();
+               virtual void onActivateBy(const DeactivatorInfo &info);
+               virtual void onDeactivateBy(const DeactivatorInfo &info);
+
+       private:
+               void sendDeactivator(ucl::Widget &sender,
+                               ucl::SmartEvent event, void *deactivator);
+               void broadcastDeactivator(ucl::SmartEvent event, void *deactivator);
+
+               void sendDeactivatorInfo(ucl::Widget &sender, ucl::SmartEvent event,
+                               const DeactivatorInfo &info);
+
+               void activateByImpl(const DeactivatorInfo &info);
+               void deactivateByImpl(const DeactivatorInfo &info);
+
+               void onActivateBySmart(ucl::Widget &widget, void *eventInfo);
+               void onDeactivateBySmart(ucl::Widget &widget, void *eventInfo);
+
+       private:
+               std::unordered_set<void *> m_deactivatorExceptions;
+               std::unordered_set<void *> m_deactivators;
+               ucl::WindowSRef m_window;
+               bool m_isPrepared;
+       };
+}
+
+#endif // __GALLERY_PRESENTERS_PRESENTER_H__
diff --git a/inc/gallery/presenters/PreviewPage.h b/inc/gallery/presenters/PreviewPage.h
new file mode 100644 (file)
index 0000000..a93691b
--- /dev/null
@@ -0,0 +1,151 @@
+/*
+ * Copyright 2017 Samsung Electronics Co., Ltd
+ *
+ * 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
+ *
+ *     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.
+ */
+
+#ifndef __GALLERY_PRESENTERS_PREVIEW_PAGE_H__
+#define __GALLERY_PRESENTERS_PREVIEW_PAGE_H__
+
+#include "Page.h"
+
+#include "gallery/model/IMediaAlbum.h"
+
+#include "gallery/view/PageContent.h"
+#include "gallery/view/ImageGrid.h"
+
+#include "MoreOptionsPresenter.h"
+#include "SelectModePresenter.h"
+#include "AlertDialog.h"
+#include "ProcessingPresenter.h"
+#include "AtspiHighlightHelper.h"
+
+namespace gallery {
+
+       UCL_DECLARE_REF_ALIASES(PreviewPage);
+
+       class PreviewPage final : public Page,
+                       private ImageGrid::IListener,
+                       private MoreOptionsPresenter::IListener,
+                       private SelectModePresenter::IListener {
+       public:
+               class Builder {
+               public:
+                       Builder();
+                       ~Builder();
+                       Builder &setNaviframe(const ucl::NaviframeSRef &navi);
+                       Builder &setAlbum(const IMediaAlbumSRef &album);
+                       Builder &setStartItemIndex(int index);
+                       Builder &setSelectModeStartup(bool value);
+                       Builder &setAutoSelectStartItem(bool value);
+                       PreviewPageWRef build(
+                                       const ExitRequestHandler &onExitRequest) const;
+               private:
+                       ucl::NaviframeSRef m_navi;
+                       IMediaAlbumSRef m_album;
+                       int m_startItemIndex;
+                       bool m_selectModeStartup;
+                       bool m_autoSelectStartItem;
+               };
+
+       public:
+               int getCurrentItemIndex() const;
+
+       private:
+               friend class ucl::RefCountObj<PreviewPage>;
+               PreviewPage(ucl::RefCountObjBase &rc, const ucl::NaviframeSRef &navi,
+                               const ExitRequestHandler &onExitRequest,
+                               const IMediaAlbumSRef &album, bool selectModeStartup);
+               virtual ~PreviewPage();
+
+               ucl::Result prepare(int startItemIndex);
+               void showItem(int itemIndex);
+               void selectItem(int itemIndex);
+               int getSafeItemIndex(int itemIndex) const;
+
+               void reload();
+               void checkViewerPage();
+
+               void onAlbumChanged();
+               bool onEachMedia(MediaItemSRef &&media);
+
+               void closeTempViews();
+               void switchToSelectMode();
+               void switchToNormalMode();
+               void toggleItemSelected(int itemIndex);
+               void confirmItemsDelete();
+               void openViewer(int itemIndex, int x, int y);
+
+               void onPageExitRequest(Page &page);
+
+               bool onAlertEvent(AlertDialog &dialog, int event);
+               void onJobComplete();
+
+               Elm_Interface_Atspi_Accessible *onAtspiHighlight(
+                               ucl::Widget &widget, Elm_Atspi_Relation_Type flowRelation);
+
+               // Presenter //
+
+               virtual void onActivateBy(const DeactivatorInfo &info) final override;
+               virtual void onDeactivateBy(const DeactivatorInfo &info) final override;
+
+               // Page //
+
+               virtual void onBackKey() final override;
+
+               // ImageGrid::IListener //
+
+               virtual void onItemRealized(int itemIndex) final override;
+               virtual void onItemUnrealized(int itemIndex) final override;
+               virtual void onItemEvent(int itemIndex,
+                               ImageGrid::ItemEvent event, int x, int y) final override;
+               virtual void onTransitionFinished() final override;
+               virtual Elm_Interface_Atspi_Accessible *onAccessObjectRequest(
+                               bool isFlowsTo) final override;
+
+               // MoreOptionsPresenter::IListener //
+
+               virtual void onMoreOptionClicked(MoreOptionsPresenter &sender,
+                               const MoreOptionsPresenter::Option &option) final override;
+
+               // SelectModePresenter::IListener //
+
+               virtual void onSelectModeEvent(
+                               SelectModePresenter::Event event) final override;
+
+       private:
+               class Item;
+               using ItemSRef = ucl::SharedRef<Item>;
+
+       private:
+               const IMediaAlbumSRef m_album;
+               const bool m_selectModeStartup;
+               ImageGridSRef m_imageGrid;
+               std::vector<ItemSRef> m_items;
+               IJobSRef m_job;
+
+               PageContentSRef m_content;
+               MoreOptionsPresenterSRef m_more;
+               SelectModePresenterSRef m_smp;
+               AlertDialogWRef m_alert;
+               ProcessingPresenterSRef m_processing;
+               AtspiHighlightHelperSRef m_atspiHelper;
+
+               PageWRef m_page;
+               int m_selectCount;
+               bool m_isInSelectMode;
+               bool m_needReload;
+       };
+}
+
+#endif // __GALLERY_PRESENTERS_PREVIEW_PAGE_H__
diff --git a/inc/gallery/presenters/ProcessingPresenter.h b/inc/gallery/presenters/ProcessingPresenter.h
new file mode 100644 (file)
index 0000000..59ff50f
--- /dev/null
@@ -0,0 +1,109 @@
+/*
+ * Copyright 2017 Samsung Electronics Co., Ltd
+ *
+ * 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
+ *
+ *     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.
+ */
+
+#ifndef __GALLERY_PRESENTERS_PROCESSING_PRESENTER_H__
+#define __GALLERY_PRESENTERS_PROCESSING_PRESENTER_H__
+
+#include "ucl/gui/Layout.h"
+#include "ucl/gui/StyledWidget.h"
+
+#include "Presenter.h"
+
+namespace gallery {
+
+       UCL_DECLARE_REF_ALIASES(ProcessingPresenter);
+
+       class ProcessingPresenter final : public Presenter {
+       public:
+               enum class IconType {
+                       NONE,
+                       CHECK
+               };
+
+               class Builder {
+               public:
+                       Builder();
+                       Builder &setProcessingText(ucl::TString text);
+                       Builder &setForceProgress(bool value);
+                       ProcessingPresenterSRef build(ucl::ElmWidget &parent) const;
+               private:
+                       ucl::TString m_processingText;
+                       bool m_forceProgress;
+               };
+
+               using DismissHandler = ucl::WeakDelegate<void()>;
+
+       public:
+               void complete(const ucl::TString &completeText,
+                               IconType iconType = IconType::NONE);
+
+               void setDismissHandler(const DismissHandler &handler);
+
+       private:
+               friend class ucl::RefCountObj<ProcessingPresenter>;
+               ProcessingPresenter(ucl::RefCountObjBase &rc);
+               virtual ~ProcessingPresenter();
+
+               ucl::Result prepare(ucl::ElmWidget &parent,
+                               const ucl::TString &processingText,
+                               bool forceProgress);
+
+               ucl::Result createWidget(ucl::ElmWidget &parent,
+                               const ucl::TString &processingText);
+               ucl::Result moveWidget();
+               ucl::Result createProgress();
+               ucl::Result createPopup();
+               ucl::Result createIcon();
+
+               bool resetTimer(double timeout);
+               void stopTimer();
+
+               void showProgress();
+
+               void tryShowPopup();
+               void dismissPopup();
+               void deletePopup();
+
+               void animateIcon();
+
+               Eina_Bool onTimer();
+
+               void onPopupDismissed(ucl::Widget &widget, void *eventInfo);
+               void onPopupHWBackKey(Evas_Object *obj, void *eventInfo);
+
+       private:
+               enum class State {
+                       WAITING,
+                       PROCESSING,
+                       POPUP_ANIMATION,
+                       COMPLETE
+               };
+
+       private:
+               ucl::LayoutSRef m_widget;
+               ucl::StyledWidgetSRef m_popup;
+               ucl::LayoutWRef m_icon;
+               IconType m_iconType;
+               DismissHandler m_dismissHandler;
+               Ecore_Timer *m_timer;
+               State m_state;
+               bool m_mayComplete;
+               bool m_isComplete;
+               bool m_isDismissed;
+       };
+}
+
+#endif // __GALLERY_PRESENTERS_PROCESSING_PRESENTER_H__
diff --git a/inc/gallery/presenters/SelectModePresenter.h b/inc/gallery/presenters/SelectModePresenter.h
new file mode 100644 (file)
index 0000000..72c014f
--- /dev/null
@@ -0,0 +1,118 @@
+/*
+ * Copyright 2017 Samsung Electronics Co., Ltd
+ *
+ * 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
+ *
+ *     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.
+ */
+
+#ifndef __GALLERY_PRESENTERS_SELECT_MODE_PRESENTER_H__
+#define __GALLERY_PRESENTERS_SELECT_MODE_PRESENTER_H__
+
+#include "ucl/gui/StyledWidget.h"
+
+#include "Presenter.h"
+
+#include "gallery/view/PageContent.h"
+
+namespace gallery {
+
+       UCL_DECLARE_REF_ALIASES(SelectModePresenter);
+
+       class SelectModePresenter final : public Presenter {
+       public:
+               UCL_DECLARE_REF_ALIASES(IListener);
+
+               enum {
+                       FLAG_NO_BOTTOM_BUTTON = 1,
+                       FLAG_NO_MORE_OPTIONS = 2,
+                       FLAG_NO_DIM_ON_ZERO_SELECT = 4,
+                       FLAG_NO_DISMISS_ON_ROTARY = 8
+               };
+
+               class Builder {
+               public:
+                       Builder();
+                       Builder &setFlags(int flags);
+                       SelectModePresenterSRef build(PageContent &content) const;
+               private:
+                       int m_flags;
+               };
+
+               enum class Event {
+                       SELECT_ALL,
+                       DESELECT_ALL,
+                       BOTTOM_BUTTON_CLICK
+               };
+
+               class IListener : public ucl::Polymorphic {
+               public:
+                       virtual void onSelectModeEvent(Event event) = 0;
+               };
+
+       public:
+               void setListener(const IListenerWRef &listener);
+
+               void setVisible(bool value);
+               bool isVisible() const;
+
+               ucl::ElmWidget &getSelectButton();
+               ucl::ElmWidget &getBottomButton();
+
+               void setBottomButtonText(const ucl::TString &value);
+
+               void update(int selectCount, int totalCount = -1);
+
+       private:
+               friend class ucl::RefCountObj<SelectModePresenter>;
+               SelectModePresenter(ucl::RefCountObjBase &rc,
+                               PageContent &content, int flags);
+               virtual ~SelectModePresenter();
+
+               ucl::Result prepare();
+
+               void doUpdate();
+
+               void showPopup();
+               void movePopup();
+               void dismissPopup();
+               void deletePopup();
+
+               void dispatchEvent(Event event);
+
+               void onPopupDismissed(ucl::Widget &widget, void *eventInfo);
+               void onPopupHWBackKey(Evas_Object *obj, void *eventInfo);
+
+               void onSelectAll(Evas_Object *obj, void *eventInfo);
+               void onDeselectAll(Evas_Object *obj, void *eventInfo);
+
+               void onSelectBtnClick(ucl::Widget &widget, void *eventInfo);
+               void onBottomBtnClick(ucl::Widget &widget, void *eventInfo);
+               Eina_Bool onRotary(Eext_Rotary_Event_Info *info);
+
+               // Presenter //
+               virtual void onDeactivate() final override;
+
+       private:
+               const PageContentSRef m_content;
+               const int m_flags;
+               ucl::StyledWidgetSRef m_selectButton;
+               ucl::StyledWidgetSRef m_bottomButton;
+               ucl::StyledWidgetSRef m_popup;
+               IListenerWRef m_listener;
+               int m_totalCount;
+               int m_selectCount;
+               bool m_isVisible;
+               bool m_isPopupDismissed;
+       };
+}
+
+#endif // __GALLERY_PRESENTERS_SELECT_MODE_PRESENTER_H__
diff --git a/inc/gallery/presenters/ThumbnailPage.h b/inc/gallery/presenters/ThumbnailPage.h
new file mode 100644 (file)
index 0000000..ccfe14e
--- /dev/null
@@ -0,0 +1,108 @@
+/*
+ * Copyright 2017 Samsung Electronics Co., Ltd
+ *
+ * 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
+ *
+ *     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.
+ */
+
+#ifndef __GALLERY_PRESENTERS_THUMBNAIL_PAGE_H__
+#define __GALLERY_PRESENTERS_THUMBNAIL_PAGE_H__
+
+#include "Page.h"
+
+#include "gallery/model/IMediaAlbum.h"
+
+#include "gallery/view/PageContent.h"
+#include "gallery/view/ImageGrid.h"
+
+#include "MoreOptionsPresenter.h"
+#include "AtspiHighlightHelper.h"
+
+namespace gallery {
+
+       UCL_DECLARE_REF_ALIASES(ThumbnailPage);
+
+       class ThumbnailPage final : public Page,
+                       private ImageGrid::IListener,
+                       private MoreOptionsPresenter::IListener {
+       public:
+               class Builder {
+               public:
+                       Builder();
+                       ~Builder();
+                       Builder &setNaviframe(const ucl::NaviframeSRef &navi);
+                       Builder &setAlbum(const IMediaAlbumSRef &album);
+                       ThumbnailPageWRef build(
+                                       const ExitRequestHandler &onExitRequest) const;
+               private:
+                       ucl::NaviframeSRef m_navi;
+                       IMediaAlbumSRef m_album;
+               };
+
+       private:
+               friend class ucl::RefCountObj<ThumbnailPage>;
+               ThumbnailPage(ucl::RefCountObjBase &rc, const ucl::NaviframeSRef &navi,
+                               const ExitRequestHandler &onExitRequest,
+                               const IMediaAlbumSRef &album);
+               virtual ~ThumbnailPage();
+
+               ucl::Result prepare();
+
+               void reload();
+
+               int getSafeItemIndex(int itemIndex) const;
+
+               void onAlbumChanged();
+               bool onEachMedia(MediaItemSRef &&media);
+
+               void onPageExitRequest(Page &page);
+
+               Elm_Interface_Atspi_Accessible *onAtspiHighlight(
+                               ucl::Widget &widget, Elm_Atspi_Relation_Type flowRelation);
+
+               // Presenter //
+
+               virtual void onActivateBy(const DeactivatorInfo &info) final override;
+               virtual void onDeactivateBy(const DeactivatorInfo &info) final override;
+
+               // ImageGrid::IListener //
+
+               virtual void onItemRealized(int itemIndex) final override;
+               virtual void onItemUnrealized(int itemIndex) final override;
+               virtual void onItemEvent(int itemIndex,
+                               ImageGrid::ItemEvent event, int x, int y) final override;
+
+               // MoreOptionsPresenter::IListener //
+
+               virtual void onMoreOptionClicked(MoreOptionsPresenter &sender,
+                               const MoreOptionsPresenter::Option &option) final override;
+
+       private:
+               class RealizedItem;
+               using RealizedItemSRef = ucl::SharedRef<RealizedItem>;
+
+       private:
+               const IMediaAlbumSRef m_album;
+               MediaItems m_mediaItems;
+
+               std::vector<RealizedItemSRef> m_realizedItems;
+
+               PageContentSRef m_content;
+               ImageGridSRef m_imageGrid;
+               MoreOptionsPresenterSRef m_more;
+               AtspiHighlightHelperSRef m_atspiHelper;
+
+               PageWRef m_page;
+       };
+}
+
+#endif // __GALLERY_PRESENTERS_THUMBNAIL_PAGE_H__
diff --git a/inc/gallery/presenters/VideoPlayerPage.h b/inc/gallery/presenters/VideoPlayerPage.h
new file mode 100644 (file)
index 0000000..64732fa
--- /dev/null
@@ -0,0 +1,137 @@
+/*
+ * Copyright 2017 Samsung Electronics Co., Ltd
+ *
+ * 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
+ *
+ *     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.
+ */
+
+#ifndef __GALLERY_PRESENTERS_VIDEO_PLAYER_PAGE_H__
+#define __GALLERY_PRESENTERS_VIDEO_PLAYER_PAGE_H__
+
+#include <player.h>
+
+#include "ucl/gui/Layout.h"
+
+#include "Page.h"
+
+#include "gallery/model/SoundManager.h"
+#include "gallery/model/MediaItem.h"
+
+#include "gallery/view/TouchParser.h"
+
+namespace gallery {
+
+       UCL_DECLARE_REF_ALIASES(VideoPlayerPage);
+
+       class VideoPlayerPage final : public Page {
+       public:
+               class Builder {
+               public:
+                       Builder();
+                       ~Builder();
+                       Builder &setNaviframe(const ucl::NaviframeSRef &navi);
+                       Builder &setMedia(const MediaItemSRef &media);
+                       VideoPlayerPageWRef build(
+                                       const ExitRequestHandler &onExitRequest) const;
+               private:
+                       ucl::NaviframeSRef m_navi;
+                       MediaItemSRef m_media;
+               };
+
+       private:
+               friend class ucl::RefCountObj<VideoPlayerPage>;
+               VideoPlayerPage(ucl::RefCountObjBase &rc,
+                               const ucl::NaviframeSRef &navi,
+                               const ExitRequestHandler &onExitRequest,
+                               const MediaItemSRef &media);
+               virtual ~VideoPlayerPage();
+
+               ucl::Result prepare();
+
+               ucl::Result prepareSoundManager();
+
+               void createImage();
+               ucl::Result preparePlayer();
+               ucl::Result seekToStart();
+
+               void createControls();
+               ucl::StyledWidgetSRef createButton(ucl::ElmStyle style,
+                               ucl::EdjePart part, const ucl::WidgetEventHandler &handler);
+
+               bool resetTimer(Ecore_Timer *&timer, double timeout, Ecore_Task_Cb func);
+               void stopTimer(Ecore_Timer *&timer);
+
+               bool resetAutoStartTimer();
+               bool resetControlsHideTimer();
+               bool resetTickTimer();
+
+               void showControls();
+               void hideControls();
+               void showVolumeBtn();
+
+               bool updatePlayTimeText();
+               void updatePlayTimeText(int timeMs);
+
+               player_state_e getPlayerState() const;
+               void startPlayback();
+               void pausePlayback();
+
+               void setScreenAlwaysOn(bool isAlwaysOn);
+
+               ucl::Result launchVolumeSettings();
+
+               void onMediaDeviceStateChanged();
+               void onMediaVolumeChanged();
+
+               void onPlaybackComplete();
+               void onPlaybackInterrupted(player_interrupted_code_e code);
+               void onSeekComplete();
+
+               Eina_Bool onAutoStartTimer();
+               Eina_Bool onControlsHideTimer();
+               Eina_Bool onTickTimer();
+
+               void onVolumeBtnClick(ucl::Widget &sender, void *eventInfo);
+               void onPlayBtnClick(ucl::Widget &sender, void *eventInfo);
+               void onPauseBtnClick(ucl::Widget &sender, void *eventInfo);
+               void onTap(int x, int y);
+               Eina_Bool onRotary(Eext_Rotary_Event_Info *info);
+
+               void onInstancePaused(ucl::Widget &sender, void *eventInfo);
+               void onInstanceResumed(ucl::Widget &sender, void *eventInfo);
+
+       private:
+               enum class State {
+                       PAUSED,
+                       PLAYING
+               };
+
+       private:
+               const MediaItemSRef m_media;
+               SoundManagerSRef m_soundMgr;
+               ucl::LayoutSRef m_content;
+               ucl::WidgetSRef m_image;
+               ucl::StyledWidgetSRef m_volumeMuteBtn;
+               TouchParserSRef m_touchParser;
+               player_h m_player;
+               int m_videoDuration;
+               Ecore_Timer *m_autoStartTimer;
+               Ecore_Timer *m_controlsHideTimer;
+               Ecore_Timer *m_tickTimer;
+               State m_state;
+               bool m_isControlsVisible;
+               bool m_needAutoStart;
+               bool m_isPlaybackCompleted;
+       };
+}
+
+#endif // __GALLERY_PRESENTERS_VIDEO_PLAYER_PAGE_H__
diff --git a/inc/gallery/presenters/ViewerPage.h b/inc/gallery/presenters/ViewerPage.h
new file mode 100644 (file)
index 0000000..6cb80ad
--- /dev/null
@@ -0,0 +1,105 @@
+/*
+ * Copyright 2017 Samsung Electronics Co., Ltd
+ *
+ * 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
+ *
+ *     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.
+ */
+
+#ifndef __GALLERY_PRESENTERS_VIEWER_PAGE_H__
+#define __GALLERY_PRESENTERS_VIEWER_PAGE_H__
+
+#include "Page.h"
+
+#include "gallery/model/MediaItem.h"
+
+#include "gallery/view/PageContent.h"
+#include "gallery/view/ImageViewer.h"
+#include "gallery/view/TouchParser.h"
+
+#include "MoreOptionsPresenter.h"
+#include "ProcessingPresenter.h"
+
+namespace gallery {
+
+       UCL_DECLARE_REF_ALIASES(ViewerPage);
+
+       class ViewerPage final : public Page,
+                       private MoreOptionsPresenter::IListener {
+       public:
+               class Builder {
+               public:
+                       Builder();
+                       ~Builder();
+                       Builder &setNaviframe(const ucl::NaviframeSRef &navi);
+                       Builder &setMedia(const MediaItemSRef &media);
+                       Builder &setZoomIn(int x, int y);
+                       Builder &setImageLoadSize(int size, bool isFull);
+                       Builder &setExitOnZoomOut(bool value);
+                       ViewerPageWRef build(
+                                       const ExitRequestHandler &onExitRequest) const;
+               private:
+                       ucl::NaviframeSRef m_navi;
+                       MediaItemSRef m_media;
+                       int m_zoomInX;
+                       int m_zoomInY;
+                       int m_imageLoadSize;
+                       bool m_isImageLoadSizeFull;
+                       bool m_exitOnZoomOut;
+               };
+
+       public:
+               const std::string &getMediaId() const;
+
+       private:
+               friend class ucl::RefCountObj<ViewerPage>;
+               ViewerPage(ucl::RefCountObjBase &rc, const ucl::NaviframeSRef &navi,
+                               const ExitRequestHandler &onExitRequest,
+                               const MediaItemSRef &media, bool exitOnZoomOut);
+               virtual ~ViewerPage();
+
+               ucl::Result prepare(int imageLoadSize, bool isImageLoadSizeFull);
+
+               void zoomIn(int originX, int originY);
+
+               void onThumbnail(ucl::Result result, const std::string &path);
+               void onZoomEnd(ucl::Widget &widget, void *eventInfo);
+               void onDoubleTap(int x, int y);
+
+               void onJobComplete();
+
+               // Presenter //
+
+               virtual void onActivateBy(const DeactivatorInfo &info) final override;
+               virtual void onDeactivateBy(const DeactivatorInfo &info) final override;
+
+               // Page //
+
+               virtual void onBackKey() final override;
+
+               // MoreOptionsPresenter::IListener //
+
+               virtual void onMoreOptionClicked(MoreOptionsPresenter &sender,
+                               const MoreOptionsPresenter::Option &option) final override;
+
+       private:
+               const MediaItemSRef m_media;
+               const bool m_exitOnZoomOut;
+               ImageViewerSRef m_imageViewer;
+               TouchParserSRef m_touchParser;
+               IJobSRef m_job;
+               PageContentSRef m_content;
+               MoreOptionsPresenterSRef m_more;
+               ProcessingPresenterSRef m_processing;
+       };
+}
+
+#endif // __GALLERY_PRESENTERS_VIEWER_PAGE_H__
diff --git a/inc/gallery/presenters/types.h b/inc/gallery/presenters/types.h
new file mode 100644 (file)
index 0000000..2d862ff
--- /dev/null
@@ -0,0 +1,23 @@
+/*
+ * Copyright 2017 Samsung Electronics Co., Ltd
+ *
+ * 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
+ *
+ *     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.
+ */
+
+#ifndef __GALLERY_PRESENTERS_TYPES_H__
+#define __GALLERY_PRESENTERS_TYPES_H__
+
+#include "gallery/view/types.h"
+#include "gallery/model/types.h"
+
+#endif // __GALLERY_PRESENTERS_TYPES_H__
diff --git a/inc/gallery/resources.h b/inc/gallery/resources.h
new file mode 100644 (file)
index 0000000..9403a67
--- /dev/null
@@ -0,0 +1,53 @@
+/*
+ * Copyright 2017 Samsung Electronics Co., Ltd
+ *
+ * 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
+ *
+ *     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.
+ */
+
+#ifndef __GALLERY_RESOURCES_H__
+#define __GALLERY_RESOURCES_H__
+
+#include "ucl/misc/TString.h"
+
+#include "config.h"
+
+namespace gallery {
+
+       constexpr auto THEME_EDJE_PATH = "edje/theme.edj";
+
+       constexpr auto ICON_NO_PHOTOS = "gallery_icon_no_photos.png";
+
+       constexpr auto ICON_MORE_OPT_DELETE = "gallery_more_opt_delete.png";
+       constexpr auto ICON_MORE_OPT_SAVE = "gallery_more_opt_save.png";
+       constexpr auto ICON_MORE_OPT_SEND = "gallery_more_opt_send_to_mobile.png";
+
+       constexpr auto ICON_POPUP_OK = "tw_ic_popup_btn_check.png";
+       constexpr auto ICON_POPUP_CANCEL = "tw_ic_popup_btn_delete.png";
+
+       extern const ucl::TString STR_APP_NAME;
+       extern const ucl::TString STR_NO_PHOTOS;
+       extern const ucl::TString STR_SELECT_ALL;
+       extern const ucl::TString STR_DESELECT_ALL;
+       extern const ucl::TString STR_DELETE;
+       extern const ucl::TString STR_DELETE_CAPS;
+       extern const ucl::TString STR_DELETE_1_PHOTO;
+       extern const ucl::TString STR_DELETE_N_PHOTO;
+       extern const ucl::TString STR_DELETING;
+       extern const ucl::TString STR_DELETED;
+       extern const ucl::TString STR_FAILED;
+       extern const ucl::TString STR_SAVE_TO_GEAR;
+       extern const ucl::TString STR_SAVING;
+       extern const ucl::TString STR_SAVED;
+}
+
+#endif // __GALLERY_RESOURCES_H__
diff --git a/inc/gallery/types.h b/inc/gallery/types.h
new file mode 100644 (file)
index 0000000..9a1476e
--- /dev/null
@@ -0,0 +1,32 @@
+/*
+ * Copyright 2017 Samsung Electronics Co., Ltd
+ *
+ * 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
+ *
+ *     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.
+ */
+
+#ifndef __GALLERY_TYPES_H__
+#define __GALLERY_TYPES_H__
+
+#include "config.h"
+
+#include "ucl/util/types.h"
+#include "ucl/util/memory.h"
+#include "ucl/util/delegation.h"
+#include "ucl/util/smartDelegation.h"
+
+namespace gallery {
+
+       using NotiHandler = ucl::WeakDelegate<void()>;
+}
+
+#endif // __GALLERY_TYPES_H__
diff --git a/inc/gallery/view/ImageGrid.h b/inc/gallery/view/ImageGrid.h
new file mode 100644 (file)
index 0000000..31aa0a5
--- /dev/null
@@ -0,0 +1,287 @@
+/*
+ * Copyright 2017 Samsung Electronics Co., Ltd
+ *
+ * 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
+ *
+ *     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.
+ */
+
+#ifndef __GALLERY_VIEW_IMAGE_GRID_H__
+#define __GALLERY_VIEW_IMAGE_GRID_H__
+
+#include <deque>
+
+#include "ucl/gui/StyledWidget.h"
+
+#include "ucl/misc/Timeout.h"
+
+namespace gallery {
+
+       UCL_DECLARE_REF_ALIASES(ImageGrid);
+
+       class ImageGrid : public ucl::ElmWidget {
+       public:
+               UCL_DECLARE_REF_ALIASES(IListener);
+
+               enum class Type {
+                       HCOMB_3X3,
+                       LINEAR
+               };
+
+               class Builder {
+               public:
+                       Builder();
+                       Builder &setType(Type value);
+                       Builder &setListener(const IListenerWRef &value);
+                       Builder &setSelectModeStartup(bool value);
+                       ImageGridSRef build(ElmWidget &parent) const;
+               private:
+                       Type m_type;
+                       IListenerWRef m_listener;
+                       bool m_selectModeStartup;
+               };
+
+               enum class ItemEvent {
+                       CLICK,
+                       DOUBLE_TAP,
+                       TAP_AND_HOLD
+               };
+
+               class IListener : public ucl::Polymorphic {
+               public:
+                       virtual void onItemRealized(int itemIndex) = 0;
+                       virtual void onItemUnrealized(int itemIndex) = 0;
+                       virtual void onItemEvent(int itemIndex,
+                                       ItemEvent event, int x, int y) = 0;
+                       virtual void onTransitionFinished() {}
+                       virtual Elm_Interface_Atspi_Accessible *onAccessObjectRequest(
+                                       bool isFlowsTo) { return nullptr; }
+               };
+
+               enum {
+                       UF_LOSE_IMAGE = 1,
+                       UF_LOSE_BG = 2,
+                       UF_BLOCK_CLICKS = 4,
+                       UF_SELECTED = 8
+               };
+
+               struct ItemParams {
+                       std::string imagePath;
+                       std::string bgImagePath;
+                       int imageWidth;
+                       int imageHeight;
+                       int flags;
+               };
+
+               struct ItemInfo {
+                       int imageLoadSize;
+                       bool isImageLoadSizeFull;
+                       bool isImageLoaded;
+               };
+
+               class Unrealizer : ucl::NonCopyable {
+               public:
+                       Unrealizer(ImageGrid &imageGrid);
+                       ~Unrealizer();
+               private:
+                       ImageGrid &m_imageGrid;
+               };
+
+       public:
+               void setListener(const IListenerWRef &listener);
+
+               ucl::Result setItemCount(int count);
+
+               ucl::Result setSelectModeEnabled(bool enabled);
+               bool isInSelectMode() const;
+               bool isInTransition() const;
+
+               void update();
+
+               ucl::Result updateItem(int itemIndex, const ItemParams &params);
+
+               ucl::Result isItemRealized(int itemIndex) const;
+
+               ucl::Result getItemInfo(int itemIndex, ItemInfo &info) const;
+               Elm_Interface_Atspi_Accessible *getAccessObject(bool isFlowsTo);
+
+               int getScrolledToItemIndex() const;
+               ucl::Result scrollToItem(int itemIndex);
+               ucl::Result bringInItem(int itemIndex);
+
+               void activateRotary();
+               void deactivateRotary();
+
+       private:
+               class Slot;
+               using SlotUPtr = std::unique_ptr<Slot>;
+
+               struct Info;
+               struct HcombInfo;
+               struct LinearInfo;
+
+       private:
+               friend class ucl::RefCountObj<ImageGrid>;
+               ImageGrid(ucl::RefCountObjBase *rc, Evas_Object *scroller,
+                               Type type, bool selectModeStartup);
+               virtual ~ImageGrid();
+
+               static const Info &getInfo(Type type);
+
+               template <class FUNC>
+               ucl::Result doWithItem(int itemIndex, FUNC &&func) const;
+               template <class FUNC>
+               ucl::Result doWithCell(int itemIndex, FUNC &&func) const;
+
+               template <class SHOW_FUNC>
+               ucl::Result showItem(int itemIndex, SHOW_FUNC &&showFunc);
+
+               bool isItemFullyVisible(int itemIndex);
+               bool isItemFullyVisible(int itemIndex,
+                               int &minVisibleOffset, int &maxVisibleOffset) const;
+               bool isItemFullyVisible(int slotIndex, int itemOffset,
+                               int &minVisibleOffset, int &maxVisibleOffset) const;
+
+               void forceBoxSizeCalculate();
+
+               void addUnrealizeLock();
+               void removeUnrealizeLock();
+
+               void handleItemEvent(int itemIndex,
+                               ItemEvent event, int x, int y) const;
+
+               // Accessibility
+
+               void onItemHighlighted(int itemIndex);
+               void onItemUnhighlighted(int itemIndex);
+               void onKeeperUnhighlighted(Widget &sender, void *eventInfo);
+
+               void updateHighlightTimeout();
+               void onHighlightTimeout(ucl::Timeout *sender);
+
+               Elm_Interface_Atspi_Accessible *requestAtspi(int itemIndex);
+               Elm_Interface_Atspi_Accessible *getItemAtspi(int itemIndex);
+
+               // Selection mode hanling
+               void evalSlotSizes();
+               void finalizeTransition();
+               Eina_Bool onAnimationFrame();
+               void onSlotResize(Widget &widget, void *eventInfo);
+               void onBoxResize(Evas *e, Evas_Object *obj, void *eventInfo);
+               void onTransitonFinished(Evas_Object *obj, const char *emission,
+                               const char *source);
+
+               // Initialization
+               void prepare();
+               void createCircleScroller();
+               void createHighlighKeeper();
+
+               // Actual slots count
+               bool updateSlotCount();
+               int calcSlotCount();
+               void setSlotCount(int newSlotCount);
+
+               // Optimal slots count
+               bool updateOptimalSlotCount();
+               int calcOptimalSlotCount();
+
+               // Maximum slots count
+               bool updateMaxSlotCount();
+               int calcMaxSlotCount();
+
+               // Actual begin slot index
+               bool updateBeginSlotIndex();
+               int calcBeginSlotIndex();
+               void setBeginSlotIndex(int newBeginSlotIndex);
+
+               // Maximum begin slot index
+               bool updateMaxBeginSlotIndex();
+               int calcMaxBeginSlotIndex();
+
+               // Misc
+               void updatePadSizes();
+               void updateScrollBias();
+               void updateRectMins();
+
+               // Slot size
+               bool updateSlotSize();
+               void setSlotSize(int newSlotSize);
+
+               // Scroller size
+               bool updateScrollerSize();
+               int calcScrollerSize();
+
+               // Scroller scroll offset
+               bool updateScrollOffset();
+               int calcScrollOffset();
+
+               // Slots rotations
+               void rotateSlotsRight(int count);
+               void rotateSlotsLeft(int count);
+
+               // Slots realization/unrealization
+               void realizeSlots();
+               void unrealizeSlots(int beginSlotOffset, int endSlotOffset);
+
+               // Event handling
+               void handleScrolling();
+               void handleResize();
+
+               // Events
+               void onScrollerResize(Widget &sender, void *eventInfo);
+               void onScrollerMove(Widget &sender, void *eventInfo);
+               void onBoxMove(Widget &sender, void *eventInfo);
+
+       private:
+               const Info &m_info;
+
+               ucl::StyledWidgetWRef m_scroller;
+               ucl::ElmWidget m_box;
+               ucl::Widget m_rect1;
+               ucl::Widget m_rect2;
+               Evas_Object *m_circleScroller;
+
+               IListenerWRef m_listener;
+               int m_itemCount;
+
+               std::deque<SlotUPtr> m_slots;
+
+               int m_slotCount;
+               int m_optimalSlotCount;
+               int m_maxSlotCount;
+
+               int m_beginSlotIndex;
+               int m_maxBeginSlotIndex;
+
+               int m_scrollBias;
+               int m_padSize1;
+               int m_padSize2;
+
+               int m_slotSize;
+               int m_scrollerSize;
+               int m_scrollOffset;
+
+               int m_unrealizeLock;
+               int m_eventsLock;
+
+               Ecore_Animator *m_animator;
+               int m_scrollLockIndex;
+               bool m_isInSelectMode;
+               bool m_isRotaryActive;
+
+               ucl::ElmWidgetSRef m_highlighKeeper;
+               ucl::TimeoutSRef m_highlightTimeout;
+               int m_highlightID;
+               bool m_isHighlightLocked;
+       };
+}
+
+#endif // __GALLERY_VIEW_IMAGE_GRID_H__
diff --git a/inc/gallery/view/ImageViewer.h b/inc/gallery/view/ImageViewer.h
new file mode 100644 (file)
index 0000000..5b6f215
--- /dev/null
@@ -0,0 +1,116 @@
+/*
+ * Copyright 2017 Samsung Electronics Co., Ltd
+ *
+ * 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
+ *
+ *     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.
+ */
+
+#ifndef __GALLERY_VIEW_IMAGE_VIEWER_H__
+#define __GALLERY_VIEW_IMAGE_VIEWER_H__
+
+#include "ucl/gui/StyledWidget.h"
+#include "ucl/gui/Layout.h"
+
+#include "types.h"
+
+namespace gallery {
+
+       constexpr ucl::SmartEvent IMAGE_VIEWER_ZOOM_END {"gallery,zoom,end"};
+
+       UCL_DECLARE_REF_ALIASES(ImageViewer);
+
+       class ImageViewer final : public ucl::ElmWidget {
+       public:
+               class Builder {
+               public:
+                       Builder();
+                       Builder &setHighResImagePath(std::string path);
+                       Builder &setLoadSize(int value);
+                       Builder &setForceLoad(bool value);
+                       ImageViewerSRef build(ucl::ElmWidget &parent) const;
+               private:
+                       std::string m_highResPath;
+                       int m_loadSize;
+                       bool m_forceLoad;
+               };
+
+       public:
+               void setLowResImagePath(const std::string &path);
+               bool zoomIn(int originX, int originY);
+               bool zoomOut();
+
+               bool isZooming() const;
+               bool isZoomedIn() const;
+               bool isZoomedOut() const;
+
+       private:
+               friend class ucl::RefCountObj<ImageViewer>;
+               ImageViewer(ucl::RefCountObjBase &rc, Evas_Object *scroller,
+                               const std::string &highResPath, int loadSize, bool forceLoad);
+               virtual ~ImageViewer();
+
+               void prepare(const std::string &highResPath,
+                               int loadSize, bool forceLoad);
+
+               void onImagePreloaded(ucl::Widget &widget, void *eventInfo);
+               void onScrollerResize(ucl::Widget &widget, void *eventInfo);
+
+               bool updateScrollerSize();
+               void updateScales();
+               void updateGridSize();
+               void updateScrollOffset();
+
+               void calcZoomInFactors(int originX, int originY);
+               void calcZoomOutFactors();
+               void startAnimation();
+
+               Eina_Bool onAnimationStartTimer();
+               Eina_Bool onAnimationFrame(double pos);
+
+       private:
+               enum class State {
+                       ZOOMED_OUT,
+                       ZOOMED_IN,
+                       ZOOMING_OUT,
+                       ZOOMING_IN
+               };
+
+       private:
+               ucl::StyledWidgetWRef m_scroller;
+               ucl::Layout m_layout;
+               ucl::Widget m_grid;
+               ucl::Widget m_lowResImage;
+               ucl::Widget m_highResImage;
+
+               int m_imageW;
+               int m_imageH;
+
+               int m_scrollerW;
+               int m_scrollerH;
+               int m_gridW;
+               int m_gridH;
+               double m_scale0;
+               double m_scale1;
+
+               double m_xf1;
+               double m_yf1;
+               double m_xf2;
+               double m_yf2;
+               double m_zoom;
+
+               Ecore_Timer *m_animationStartTimer;
+               Ecore_Animator *m_animator;
+               State m_state;
+       };
+}
+
+#endif // __GALLERY_VIEW_IMAGE_VIEWER_H__
diff --git a/inc/gallery/view/PageContent.h b/inc/gallery/view/PageContent.h
new file mode 100644 (file)
index 0000000..9e581b4
--- /dev/null
@@ -0,0 +1,85 @@
+/*
+ * Copyright 2017 Samsung Electronics Co., Ltd
+ *
+ * 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
+ *
+ *     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.
+ */
+
+#ifndef __GALLERY_VIEW_PAGE_CONTENT_H__
+#define __GALLERY_VIEW_PAGE_CONTENT_H__
+
+#include "ucl/gui/Layout.h"
+
+#include "types.h"
+
+namespace gallery {
+
+       UCL_DECLARE_REF_ALIASES(PageContent);
+
+       class PageContent : public ucl::ElmWidget {
+       public:
+               class Builder {
+               public:
+                       Builder();
+                       Builder &setFlags(int flags);
+                       PageContentSRef build(ucl::ElmWidget &parent) const;
+               private:
+                       int m_flags;
+               };
+
+               enum {
+                       FLAG_MORE_OPTIONS = 1,
+                       FLAG_SELECT_BUTTON = 2,
+                       FLAG_BOTTOM_BUTTON = 4,
+
+                       FLAGS_SELECT_MODE = (FLAG_SELECT_BUTTON | FLAG_BOTTOM_BUTTON),
+                       FLAGS_ALL = (FLAG_MORE_OPTIONS | FLAGS_SELECT_MODE)
+               };
+
+               enum class Part {
+                       DEFAULT,
+                       OVERLAY,
+                       MORE_OPTIONS,
+                       SELECT_BUTTON,
+                       BOTTOM_BUTTON
+               };
+
+       public:
+               ucl::Result set(Evas_Object *eo, Part part = Part::DEFAULT);
+               Evas_Object *unset(Part part = Part::DEFAULT);
+
+               Evas_Object *get(Part part = Part::DEFAULT) const;
+
+               ucl::Result setSelectButtonVisible(bool visible);
+               ucl::Result setMoreOptionsVisible(bool visible);
+
+       private:
+               friend class ucl::RefCountObj<PageContent>;
+               PageContent(ucl::RefCountObjBase &rc,
+                               const ucl::LayoutSRef &layout, int flags);
+               virtual ~PageContent();
+
+               void prepare(int flags);
+
+               template <class FUNC>
+               ucl::Result doWithPart(Part part, FUNC &&func) const;
+
+               ucl::Layout *getTopLayout() const;
+
+       private:
+               ucl::LayoutWRef m_moreOptions;
+               ucl::LayoutSRef m_selectMode;
+               ucl::LayoutSRef m_bottomButton;
+       };
+}
+
+#endif // __GALLERY_VIEW_PAGE_CONTENT_H__
diff --git a/inc/gallery/view/TouchParser.h b/inc/gallery/view/TouchParser.h
new file mode 100644 (file)
index 0000000..484fb84
--- /dev/null
@@ -0,0 +1,70 @@
+/*
+ * Copyright 2017 Samsung Electronics Co., Ltd
+ *
+ * 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
+ *
+ *     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.
+ */
+
+#ifndef __GALLERY_VIEW_TOUCH_PARSER_H__
+#define __GALLERY_VIEW_TOUCH_PARSER_H__
+
+#include "ucl/gui/Widget.h"
+
+#include "types.h"
+
+namespace gallery {
+
+       UCL_DECLARE_REF_ALIASES(TouchParser);
+
+       class TouchParser final : public ucl::RefCountAware {
+       public:
+               using TapHandler = ucl::WeakDelegate<void(int x, int y)>;
+
+       private:
+               friend class ucl::RefCountObj<TouchParser>;
+               TouchParser(ucl::RefCountObjBase &rc, ucl::Widget &eventSource);
+               virtual ~TouchParser();
+
+       public:
+               void setTapHandler(const TapHandler &handler);
+               void setDoubleTapHandler(const TapHandler &handler);
+               void setTapAndHoldHandler(const TapHandler &handler);
+
+       private:
+               void onMouseDown(ucl::Widget &widget, void *eventInfo);
+               void onMouseUp(ucl::Widget &widget, void *eventInfo);
+               void onMouseMove(ucl::Widget &widget, void *eventInfo);
+
+               void updateIsTapPossible(int flags, int curX, int curY);
+
+               bool isFastTap(ucl::UInt curTime, int curX, int curY) const;
+               double calcDownDistance(int curX, int curY) const;
+
+               void restartHoldTimer();
+               void stopHoldTimer();
+               Eina_Bool onHoldTimer();
+
+       private:
+               TapHandler m_tapHandler;
+               TapHandler m_doubleTapHandler;
+               TapHandler m_tapAndHoldHandler;
+               Ecore_Timer *m_holdTimer;
+               ucl::UInt m_downTime;
+               int m_downX;
+               int m_downY;
+               int m_tapCounter;
+               bool m_isMouseDown;
+               bool m_isTapPossible;
+       };
+}
+
+#endif // __GALLERY_VIEW_TOUCH_PARSER_H__
diff --git a/inc/gallery/view/helpers.h b/inc/gallery/view/helpers.h
new file mode 100644 (file)
index 0000000..5a13ab4
--- /dev/null
@@ -0,0 +1,42 @@
+/*
+ * Copyright 2017 Samsung Electronics Co., Ltd
+ *
+ * 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
+ *
+ *     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.
+ */
+
+#ifndef __GALLERY_VIEW_HELPERS_H__
+#define __GALLERY_VIEW_HELPERS_H__
+
+#include "ucl/gui/Naviframe.h"
+
+#include "types.h"
+
+namespace gallery { namespace util {
+
+       ucl::Result createCircleSurface(ucl::Naviframe &navi);
+       Eext_Circle_Surface *getCircleSurface(const ucl::ElmWidget &widget);
+
+       ucl::ElmWidgetSRef createFakeAccessObject(ucl::ElmWidget &parent);
+}}
+
+namespace gallery {
+
+       void addRotaryEventHandler(Eext_Rotary_Handler_Cb func, void *data);
+       void delRotaryEventHandler(Eext_Rotary_Handler_Cb func, void *data);
+
+       ucl::LayoutTheme getImageTheme(const char *fileName);
+
+       Elm_Atspi_Relation_Type getFlowRelation(Elm_Atspi_Gesture_Info gestureInfo);
+}
+
+#endif // __GALLERY_VIEW_HELPERS_H__
diff --git a/inc/gallery/view/types.h b/inc/gallery/view/types.h
new file mode 100644 (file)
index 0000000..35b0594
--- /dev/null
@@ -0,0 +1,26 @@
+/*
+ * Copyright 2017 Samsung Electronics Co., Ltd
+ *
+ * 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
+ *
+ *     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.
+ */
+
+#ifndef __GALLERY_VIEW_TYPES_H__
+#define __GALLERY_VIEW_TYPES_H__
+
+#include <efl_extension.h>
+
+#include "ucl/gui/types.h"
+
+#include "gallery/types.h"
+
+#endif // __GALLERY_VIEW_TYPES_H__
diff --git a/inc/model/Gallery.h b/inc/model/Gallery.h
deleted file mode 100644 (file)
index 1a711f9..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * Copyright 2017 Samsung Electronics Co., Ltd
- *
- * 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
- *
- *     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.
- */
-
-#ifndef __GALLERY_MODEL_GALLERY_H__
-#define __GALLERY_MODEL_GALLERY_H__
-
-#include "IMediaAlbum.h"
-
-namespace gallery {
-
-       UCL_DECLARE_REF_ALIASES(Gallery);
-
-       class Gallery final : public ucl::NonCopyable {
-       public:
-               static GallerySRef newInstance();
-               ~Gallery();
-
-               IMediaAlbumSRef getAlbum();
-
-       private:
-               friend class ucl::RefCountObj<Gallery>;
-               Gallery();
-
-               ucl::Result prepare();
-
-       private:
-               IMediaAlbumSRef m_album;
-               bool m_isMediaDbConnected;
-       };
-}
-
-#endif // __GALLERY_MODEL_GALLERY_H__
diff --git a/inc/model/IJob.h b/inc/model/IJob.h
deleted file mode 100644 (file)
index 8c7d56e..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * Copyright 2017 Samsung Electronics Co., Ltd
- *
- * 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
- *
- *     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.
- */
-
-#ifndef __GALLERY_MODEL_I_JOB_H__
-#define __GALLERY_MODEL_I_JOB_H__
-
-#include "types.h"
-
-namespace gallery {
-
-       UCL_DECLARE_REF_ALIASES(IJob);
-
-       class IJob : public ucl::Polymorphic {
-       public:
-               virtual ucl::Result getResult() const = 0;
-               virtual bool isCancelable() const = 0;
-               virtual ucl::Result cancel() = 0;
-       };
-}
-
-#endif // __GALLERY_MODEL_I_JOB_H__
diff --git a/inc/model/IMediaAlbum.h b/inc/model/IMediaAlbum.h
deleted file mode 100644 (file)
index 80eb222..0000000
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * Copyright 2017 Samsung Electronics Co., Ltd
- *
- * 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
- *
- *     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.
- */
-
-#ifndef __GALLERY_MODEL_I_MEDIA_ALBUM_H__
-#define __GALLERY_MODEL_I_MEDIA_ALBUM_H__
-
-#include "MediaItem.h"
-
-namespace gallery {
-
-       UCL_DECLARE_REF_ALIASES(IMediaAlbum);
-
-       class IMediaAlbum : public ucl::Polymorphic {
-       public:
-               using EachCb = ucl::Delegate<bool(MediaItemSRef &&media)>;
-
-       public:
-               virtual void addChangeHandler(const NotiHandler &handler) = 0;
-               virtual void delChangeHandler(const NotiHandler &handler) = 0;
-
-               virtual ucl::Result forEachMedia(EachCb cb) const = 0;
-               virtual ucl::Result getMediaCount(int &count) const = 0;
-
-               virtual void defragment() = 0;
-       };
-
-       // Non-member functions //
-
-       bool isEmpty(const IMediaAlbum &album);
-}
-
-#include "IMediaAlbum.hpp"
-
-#endif // __GALLERY_MODEL_I_MEDIA_ALBUM_H__
diff --git a/inc/model/IMediaAlbum.hpp b/inc/model/IMediaAlbum.hpp
deleted file mode 100644 (file)
index 5793dfc..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * Copyright 2017 Samsung Electronics Co., Ltd
- *
- * 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
- *
- *     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.
- */
-
-#include "ucl/util/logging.h"
-
-namespace gallery {
-
-       // Non-member functions //
-
-       inline bool isEmpty(const IMediaAlbum &album)
-       {
-               int count = 0;
-               UCL_FAIL_RETURN_VALUE(album.getMediaCount(count), true,
-                               "album.getMediaCount() failed!");
-               return (count == 0);
-       }
-}
diff --git a/inc/model/MediaItem.h b/inc/model/MediaItem.h
deleted file mode 100644 (file)
index df35b8d..0000000
+++ /dev/null
@@ -1,128 +0,0 @@
-/*
- * Copyright 2017 Samsung Electronics Co., Ltd
- *
- * 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
- *
- *     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.
- */
-
-#ifndef __GALLERY_MODEL_MEDIA_ITEM_H__
-#define __GALLERY_MODEL_MEDIA_ITEM_H__
-
-#include <vector>
-
-#include <media_content.h>
-
-#include "ucl/misc/AutoHandle.h"
-
-#include "IJob.h"
-
-namespace gallery {
-
-       UCL_DECLARE_REF_ALIASES(MediaItem);
-
-       using MediaItems = std::vector<MediaItemSRef>;
-
-       class MediaItem : public ucl::Polymorphic {
-       public:
-               using ThumbnailPathGetCb =
-                               ucl::WeakDelegate<void(ucl::Result, const std::string &path)>;
-
-               class Remover;
-               class RemoverBuilder final {
-               public:
-                       RemoverBuilder &setItems(MediaItems items);
-                       IJobSRef build(const NotiHandler &onComplete) const;
-               private:
-                       ucl::SharedRef<MediaItems> m_items;
-               };
-
-               class Saver;
-               class SaverBuilder final {
-               public:
-                       SaverBuilder &setItem(const MediaItemSRef &item);
-                       IJobSRef build(const NotiHandler &onComplete) const;
-               private:
-                       MediaItemSRef m_item;
-               };
-
-               enum {
-                       FLAG_THUMBNAIL = 1,
-                       FLAG_REMOVE = 2,
-                       FLAG_SAVE = 4,
-                       FLAG_RESOLUTION = 8,
-
-                       FLAGS_FROM_MEDIA_DB = (FLAG_THUMBNAIL | FLAG_REMOVE |
-                                       FLAG_RESOLUTION),
-                       FLAGS_SIMPLE_FILE = (FLAG_SAVE)
-               };
-
-       public:
-               static MediaItemSRef newInstance(media_info_h media);
-               static MediaItemSRef newInstance(std::string filePath);
-               virtual ~MediaItem();
-
-               bool isValid() const;
-               int getFlags() const;
-               MediaType getType() const;
-
-               const std::string &getId() const;
-
-               ucl::Result getResolution(int &x, int &y) const;
-
-               const std::string &getFilePath() const;
-
-               ucl::Result getThumbnailPath(const ThumbnailPathGetCb &cb) const;
-               void cancelThumbnailPathGet() const;
-
-               ucl::Result removeFile();
-               ucl::Result saveToDevice();
-
-       protected:
-               friend class ucl::RefCountObj<MediaItem>;
-               MediaItem(int flags, MediaType type);
-
-               ucl::Result prepare(media_info_h media);
-               ucl::Result prepareImage(media_info_h media);
-               ucl::Result prepare(std::string filePath);
-
-       private:
-               ucl::Result initThumbPath(media_info_h media) const;
-
-       private:
-               // XXX This proxy is needed to deal with cases when
-               // media_thumbnail_completed_cb can't be cancelled
-               struct ThumbCbProxy {
-                       const MediaItem *item;
-                       ThumbnailPathGetCb callback;
-
-                       void completeCb(media_content_error_e error, const char *path);
-               };
-
-       private:
-               using AutoMediaInfo = ucl::AutoHandle<
-                               media_info_h, int, media_info_destroy>;
-
-       private:
-               const int m_flags;
-               const MediaType m_type;
-               std::string m_mediaId;
-               std::string m_filePath;
-               int m_resolutionX;
-               int m_resolutionY;
-               mutable AutoMediaInfo m_media;
-               mutable std::string m_thumbPath;
-               mutable std::unique_ptr<ThumbCbProxy> m_thumbCbProxy;
-               bool m_isValid;
-       };
-}
-
-#endif // __GALLERY_MODEL_MEDIA_ITEM_H__
diff --git a/inc/model/SoundManager.h b/inc/model/SoundManager.h
deleted file mode 100644 (file)
index df5e36a..0000000
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * Copyright 2017 Samsung Electronics Co., Ltd
- *
- * 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
- *
- *     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.
- */
-
-#ifndef __GALLERY_MODEL_SOUND_MANAGER_H__
-#define __GALLERY_MODEL_SOUND_MANAGER_H__
-
-#include <sound_manager.h>
-
-#include "ucl/misc/Event.h"
-
-#include "types.h"
-
-namespace gallery {
-
-       UCL_DECLARE_REF_ALIASES(SoundManager);
-
-       class SoundManager final : public ucl::NonCopyable {
-       public:
-               static SoundManagerSRef newInstance();
-
-               bool isMediaDeviceReady() const;
-
-               int getCurrentMediaVolume() const;
-               int getMaxMediaVolume() const;
-
-               void addMediaDeviceStateChangeHandler(const NotiHandler &handler);
-               void delMediaDeviceStateChangeHandler(const NotiHandler &handler);
-
-               void addMediaVolumeChangeHandler(const NotiHandler &handler);
-               void delMediaVolumeChangeHandler(const NotiHandler &handler);
-
-       private:
-               friend class ucl::RefCountObj<SoundManager>;
-               SoundManager();
-               ~SoundManager();
-
-               ucl::Result prepare();
-
-               void setMediaDeviceState(bool isReady);
-               void setCurrentMediaVolume(int value);
-
-               ucl::Result updateMediaDeviceState();
-
-               void onDeviceConnectionChanged(sound_device_h device, bool isConnected);
-               void onDeviceStateChanged(sound_device_h device,
-                               sound_device_state_e state);
-               void onVolumeChanged(sound_type_e type, unsigned int volume);
-
-       private:
-               ucl::Event<NotiHandler> m_onMediaDeviceStateChange;
-               ucl::Event<NotiHandler> m_onMediaVolumeChange;
-               int m_devConnChangedCbId;
-               int m_devStateChangedCbId;
-               int m_volumeChangedCbId;
-               int m_currentMediaVolume;
-               int m_maxMediaVolume;
-               bool m_isMediaDeviceReady;
-       };
-}
-
-#endif // __GALLERY_MODEL_SOUND_MANAGER_H__
diff --git a/inc/model/types.h b/inc/model/types.h
deleted file mode 100644 (file)
index 87beb8f..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * Copyright 2017 Samsung Electronics Co., Ltd
- *
- * 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
- *
- *     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.
- */
-
-#ifndef __GALLERY_MODEL_TYPES_H__
-#define __GALLERY_MODEL_TYPES_H__
-
-#include "../types.h"
-
-namespace gallery {
-
-       enum class MediaType {
-               IMAGE,
-               VIDEO,
-               SOUND,
-               MUSIC,
-               OTHERS
-       };
-}
-
-#endif // __GALLERY_MODEL_TYPES_H__
diff --git a/inc/presenters/AlertDialog.h b/inc/presenters/AlertDialog.h
deleted file mode 100644 (file)
index 59274a2..0000000
+++ /dev/null
@@ -1,100 +0,0 @@
-/*
- * Copyright 2017 Samsung Electronics Co., Ltd
- *
- * 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
- *
- *     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.
- */
-
-#ifndef __GALLERY_PRESENTERS_ALERT_DIALOG_H__
-#define __GALLERY_PRESENTERS_ALERT_DIALOG_H__
-
-#include "ucl/gui/StyledWidget.h"
-#include "ucl/gui/Layout.h"
-
-#include "Presenter.h"
-
-namespace gallery {
-
-       UCL_DECLARE_REF_ALIASES(AlertDialog);
-
-       class AlertDialog final : public Presenter,
-                       public ucl::IDisposable {
-       public:
-               enum class Type {
-                       OK_CANCEL
-               };
-
-               enum Event {
-                       EVENT_CANCEL,
-                       EVENT_OK,
-                       EVENT_BACK
-               };
-
-               using EventHandler = ucl::WeakDelegate<
-                               bool(AlertDialog &dialog, int event)>;
-
-               class Builder {
-               public:
-                       Builder();
-                       Builder &setType(Type type);
-                       Builder &setTitle(ucl::TString title);
-                       Builder &setText(ucl::TString text);
-                       Builder &setHandler(const EventHandler &handler);
-                       AlertDialogWRef build(ucl::ElmWidget &parent) const;
-               private:
-                       Type m_type;
-                       ucl::TString m_title;
-                       ucl::TString m_text;
-                       EventHandler m_handler;
-               };
-
-       public:
-               void dismiss();
-
-               // ucl::IDisposable //
-
-               virtual void dispose() final override;
-               virtual bool isDisposed() const final override;
-
-       private:
-               friend class ucl::RefCountObj<AlertDialog>;
-               AlertDialog(ucl::RefCountObjBase &rc,
-                               const EventHandler &handler);
-               virtual ~AlertDialog();
-
-               ucl::Result prepare(ucl::ElmWidget &parent, Type type);
-               ucl::Result createPopup(ucl::ElmWidget &parent, ucl::ElmStyle style);
-               ucl::Result createLayout(ucl::LayoutTheme theme);
-               ucl::Result createButton(Event event, ucl::EdjePart part,
-                               ucl::ElmStyle btnStyle, ucl::LayoutTheme iconTheme,
-                               const ucl::TString &text = nullptr);
-
-               void setTitle(const ucl::TString &title);
-               void setText(const ucl::TString &text);
-
-               void handleEvent(Event event);
-               bool dispatchEvent(Event event);
-
-               void onPopupDismissed(ucl::Widget &widget, void *eventInfo);
-               void onPopupHWBackKey(Evas_Object *obj, void *eventInfo);
-
-               void onBtnClick(ucl::Widget &widget, void *eventInfo);
-
-       private:
-               const EventHandler m_handler;
-               ucl::StyledWidgetSRef m_popup;
-               ucl::LayoutWRef m_layout;
-               bool m_isDismissed;
-       };
-}
-
-#endif // __GALLERY_PRESENTERS_ALERT_DIALOG_H__
diff --git a/inc/presenters/AtspiHighlightHelper.h b/inc/presenters/AtspiHighlightHelper.h
deleted file mode 100644 (file)
index b84471e..0000000
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * Copyright 2017 Samsung Electronics Co., Ltd
- *
- * 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
- *
- *     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.
- */
-
-#ifndef __GALLERY_PRESENTERS_ATSPI_HIGHLIGH_HELPER_H__
-#define __GALLERY_PRESENTERS_ATSPI_HIGHLIGH_HELPER_H__
-
-#include "Presenter.h"
-
-namespace gallery {
-
-       UCL_DECLARE_REF_ALIASES(AtspiHighlightHelper);
-
-       class AtspiHighlightHelper final : public Presenter {
-       public:
-               using EventHandler = ucl::WeakDelegate<Elm_Interface_Atspi_Accessible *(
-                               ucl::Widget &widget, Elm_Atspi_Relation_Type flowRelation)>;
-
-       public:
-               static AtspiHighlightHelperSRef newInstance(ucl::ElmWidget &rootWidget);
-
-               void setEventHandler(EventHandler handler);
-               void registerWidget(ucl::ElmWidget &widget);
-
-       private:
-               friend class ucl::RefCountObj<AtspiHighlightHelper>;
-               AtspiHighlightHelper(ucl::RefCountObjBase &rc);
-               virtual ~AtspiHighlightHelper();
-
-               ucl::Result prepare(ucl::ElmWidget &rootWidget);
-
-       private:
-               void onAtspiGesture(ucl::Widget &widget, void *eventInfo);
-
-       private:
-               EventHandler m_eventHandler;
-       };
-}
-
-#endif // __GALLERY_PRESENTERS_ATSPI_HIGHLIGH_HELPER_H__
diff --git a/inc/presenters/Instance.h b/inc/presenters/Instance.h
deleted file mode 100644 (file)
index bdd20f6..0000000
+++ /dev/null
@@ -1,94 +0,0 @@
-/*
- * Copyright 2017 Samsung Electronics Co., Ltd
- *
- * 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
- *
- *     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.
- */
-
-#ifndef __GALLERY_PRESENTERS_INSTANCE_H__
-#define __GALLERY_PRESENTERS_INSTANCE_H__
-
-#include "ucl/appfw/IInstance.h"
-#include "ucl/appfw/IInstanceAppControlExt.h"
-#include "ucl/appfw/SysEventProvider.h"
-
-#include "ucl/gui/Theme.h"
-#include "ucl/gui/Naviframe.h"
-
-#include "model/Gallery.h"
-#include "Page.h"
-
-namespace gallery {
-
-       class Instance final : public ucl::RefCountAware,
-                       public ucl::IInstance,
-                       public ucl::IInstanceAppControlExt {
-       public:
-               Instance(ucl::RefCountObjBase &rc,
-                               ucl::SysEventProvider &sysEventProvider);
-               virtual ~Instance();
-
-               // IInstance //
-
-               virtual ucl::Result onCreate(
-                               ucl::IInstanceContext *context) final override;
-               virtual void onPause() final override;
-               virtual void onResume() final override;
-
-               // IInstanceAppControlExt //
-
-               virtual void onAppControl(app_control_h appControl) final override;
-
-       private:
-               ucl::Result setupTheme();
-
-               void rescanMediaContent();
-               void stopMediaContentScan();
-               void startMediaContentScan();
-               void onScanComplete(media_content_error_e error);
-
-               ucl::Result handleAppControl(app_control_h appControl);
-               ucl::Result handleSingleMode(const std::string &operation,
-                               app_control_h appControl);
-               ucl::Result handleGroupMode(const std::string &operation,
-                               app_control_h appControl);
-
-               ucl::Result ensureGalleryModel();
-
-               void createNoContentPage();
-               void createThumbnailPage();
-               void createViewerPage(const MediaItemSRef &media);
-               void createVideoPlayerPage(const MediaItemSRef &media);
-
-               void onAlbumChanged();
-               void onPageExitRequest(Page &page);
-
-               void onSysEvent(const ucl::SysEvent sysEvent);
-
-       private:
-               ucl::SysEventProvider &m_sysEventProvider;
-               ucl::IInstanceContext *m_context;
-
-               GallerySRef m_gallery;
-               bool m_isScanInProgress;
-
-               ucl::WindowSRef m_win;
-               ucl::Theme m_theme;
-               ucl::NaviframeSRef m_navi;
-
-               PageWRef m_page;
-
-               bool m_isGroupMode;
-       };
-}
-
-#endif // __GALLERY_PRESENTERS_INSTANCE_H__
diff --git a/inc/presenters/InstanceManager.h b/inc/presenters/InstanceManager.h
deleted file mode 100644 (file)
index b83b576..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * Copyright 2017 Samsung Electronics Co., Ltd
- *
- * 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
- *
- *     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.
- */
-
-#ifndef __GALLERY_PRESENTERS_INSTANCE_MANAGER_H__
-#define __GALLERY_PRESENTERS_INSTANCE_MANAGER_H__
-
-#include "ucl/appfw/InstanceManagerBase.h"
-
-#include "types.h"
-
-namespace gallery {
-
-       class InstanceManager : public ucl::InstanceManagerBase {
-       public:
-               InstanceManager();
-
-               // ucl::InstanceManagerBase //
-
-               virtual ucl::IInstanceSRef newInstance() const final override;
-       };
-}
-
-#endif // __GALLERY_PRESENTERS_INSTANCE_MANAGER_H__
diff --git a/inc/presenters/MoreOptionsPresenter.h b/inc/presenters/MoreOptionsPresenter.h
deleted file mode 100644 (file)
index c959b3c..0000000
+++ /dev/null
@@ -1,107 +0,0 @@
-/*
- * Copyright 2017 Samsung Electronics Co., Ltd
- *
- * 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
- *
- *     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.
- */
-
-#ifndef __GALLERY_PRESENTERS_MORE_OPTIONS_PRESENTER_H__
-#define __GALLERY_PRESENTERS_MORE_OPTIONS_PRESENTER_H__
-
-#include <list>
-
-#include "ucl/misc/HashMap.h"
-
-#include "Presenter.h"
-
-namespace gallery {
-
-       UCL_DECLARE_REF_ALIASES(MoreOptionsPresenter);
-
-       class MoreOptionsPresenter final : public Presenter {
-       public:
-               UCL_DECLARE_REF_ALIASES(IListener);
-
-               struct Option {
-                       int id;
-                       ucl::TString text;
-                       ucl::TString subText;
-                       ucl::LayoutTheme iconTheme;
-               };
-
-               using MoreOptions = std::list<Option>;
-
-               class Builder {
-               public:
-                       Builder();
-                       ~Builder();
-                       bool isEmpty() const;
-                       Builder &clear();
-                       Builder &addOption(Option option);
-                       MoreOptionsPresenterSRef build(ucl::ElmWidget &parent) const;
-               private:
-                       ucl::SharedRef<MoreOptions> m_options;
-               };
-
-               class IListener : public ucl::Polymorphic {
-               public:
-                       virtual void onMoreOptionClicked(MoreOptionsPresenter &sender,
-                                       const Option &option) = 0;
-                       virtual void onMoreOptionSelected(MoreOptionsPresenter &sender,
-                                       const Option &option) {};
-                       virtual void onMoreOptionsOpened(MoreOptionsPresenter &sender) {};
-                       virtual void onMoreOptionsClosed(MoreOptionsPresenter &sender) {};
-               };
-
-       public:
-               void setListener(const IListenerWRef &listener);
-
-               ucl::Widget &getWidget();
-
-               void setOpened(bool isOpened);
-               bool isOpened() const;
-
-               void setOpenedDelayed(bool isOpened, double timeout);
-
-       private:
-               using MoreOptionsCSRef = ucl::SharedRef<const MoreOptions>;
-
-       private:
-               friend class ucl::RefCountObj<MoreOptionsPresenter>;
-               MoreOptionsPresenter(ucl::RefCountObjBase &rc,
-                               const MoreOptionsCSRef &options);
-               virtual ~MoreOptionsPresenter();
-
-               ucl::Result prepare(ucl::ElmWidget &parent);
-               ucl::Result addItem(const Option &option);
-
-               bool resetTimer(double timeout);
-               void stopTimer();
-
-               Eina_Bool onTimer();
-
-               void onOpened(ucl::Widget &widget, void *eventInfo);
-               void onClosed(ucl::Widget &widget, void *eventInfo);
-               void onItemClicked(ucl::Widget &widget, void *eventInfo);
-               void onItemSelected(ucl::Widget &widget, void *eventInfo);
-
-       private:
-               const MoreOptionsCSRef m_options;
-               ucl::HashMap<void *, const Option *> m_map;
-               ucl::ElmWidgetSRef m_widget;
-               IListenerWRef m_listener;
-               Ecore_Timer *m_timer;
-               bool m_newOpenedState;
-       };
-}
-
-#endif // __GALLERY_PRESENTERS_MORE_OPTIONS_PRESENTER_H__
diff --git a/inc/presenters/NoContentPage.h b/inc/presenters/NoContentPage.h
deleted file mode 100644 (file)
index b02900d..0000000
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * Copyright 2017 Samsung Electronics Co., Ltd
- *
- * 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
- *
- *     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.
- */
-
-#ifndef __GALLERY_PRESENTERS_NO_CONTENT_PAGE_H__
-#define __GALLERY_PRESENTERS_NO_CONTENT_PAGE_H__
-
-#include "Page.h"
-
-namespace gallery {
-
-       UCL_DECLARE_REF_ALIASES(NoContentPage);
-
-       class NoContentPage final : public Page {
-       public:
-               class Builder {
-               public:
-                       Builder();
-                       ~Builder();
-                       Builder &setNaviframe(const ucl::NaviframeSRef &navi);
-                       NoContentPageWRef build(
-                                       const ExitRequestHandler &onExitRequest) const;
-               private:
-                       ucl::NaviframeSRef m_navi;
-               };
-
-       private:
-               friend class ucl::RefCountObj<NoContentPage>;
-               NoContentPage(ucl::RefCountObjBase &rc, const ucl::NaviframeSRef &navi,
-                               const ExitRequestHandler &onExitRequest);
-               virtual ~NoContentPage();
-
-               ucl::Result prepare();
-       };
-}
-
-#endif // __GALLERY_PRESENTERS_NO_CONTENT_PAGE_H__
diff --git a/inc/presenters/Page.h b/inc/presenters/Page.h
deleted file mode 100644 (file)
index 4be629e..0000000
+++ /dev/null
@@ -1,92 +0,0 @@
-/*
- * Copyright 2017 Samsung Electronics Co., Ltd
- *
- * 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
- *
- *     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.
- */
-
-#ifndef __GALLERY_PRESENTERS_PAGE_H__
-#define __GALLERY_PRESENTERS_PAGE_H__
-
-#include "ucl/gui/Naviframe.h"
-
-#include "Presenter.h"
-
-namespace gallery {
-
-       UCL_DECLARE_REF_ALIASES(Page);
-
-       class Page : public Presenter {
-       public:
-               using ExitRequestHandler = ucl::WeakDelegate<void(Page &page)>;
-
-       public:
-               ucl::Naviframe &getNaviframe();
-
-               bool isAtTop() const;
-               bool isAtBottom() const;
-
-               void exit();
-               void exitNoTransition();
-
-               void popTo();
-               void deleteTo();
-               void promote();
-
-               template <class ...ARGS>
-               ucl::NaviItem insertAfter(ARGS &&...args);
-
-               template <class ...ARGS>
-               ucl::NaviItem insertBefore(ARGS &&...args);
-
-       protected:
-               Page(ucl::RefCountObjBase &rc, const ucl::NaviframeSRef &navi,
-                               const ExitRequestHandler &onExitRequest);
-               virtual ~Page();
-
-               template <class ITEM_FACTORY>
-               ucl::Result prepare(ITEM_FACTORY &&makeItem);
-
-               ucl::NaviItem getItem();
-
-               void requestExit();
-
-               virtual void onBackKey();
-
-       private:
-               ucl::Result preparePart2();
-
-               void dispatchTopPageChanged();
-
-               void updateActiveState();
-
-               void onTransitionStarted(ucl::Widget &widget, void *eventInfo);
-               void onTransitionFinished(ucl::Widget &widget, void *eventInfo);
-               void onTopPageChanged(ucl::Widget &widget, void *eventInfo);
-
-               void onHWBackKey(Evas_Object *obj, void *eventInfo);
-               void onItemDel(Evas_Object *obj, void *eventInfo);
-
-       private:
-               const ucl::NaviframeSRef m_navi;
-               const ExitRequestHandler m_onExitRequest;
-               ucl::NaviItem m_item;
-       };
-
-       // Non-member functions //
-
-       bool isLast(const Page &page);
-}
-
-#include "Page.hpp"
-
-#endif // __GALLERY_PRESENTERS_PAGE_H__
diff --git a/inc/presenters/Page.hpp b/inc/presenters/Page.hpp
deleted file mode 100644 (file)
index b0e1ae7..0000000
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- * Copyright 2017 Samsung Electronics Co., Ltd
- *
- * 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
- *
- *     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.
- */
-
-#include "ucl/util/logging.h"
-
-namespace gallery {
-
-       template <class ITEM_FACTORY>
-       inline ucl::Result Page::prepare(ITEM_FACTORY &&makeItem)
-       {
-               m_item = makeItem();
-               if (!m_item) {
-                       UCL_LOG_RETURN(ucl::RES_FAIL, "m_item is NULL");
-               }
-               return preparePart2();
-       }
-
-       template <class ...ARGS>
-       inline ucl::NaviItem Page::insertAfter(ARGS &&...args)
-       {
-               return m_navi->insertAfter(m_item, std::forward<ARGS>(args)...);
-       }
-
-       template <class ...ARGS>
-       inline ucl::NaviItem Page::insertBefore(ARGS &&...args)
-       {
-               return m_navi->insertBefore(m_item, std::forward<ARGS>(args)...);
-       }
-
-       inline ucl::Naviframe &Page::getNaviframe()
-       {
-               UCL_ASSERT(m_navi, "m_navi is NULL");
-               return *m_navi;
-       }
-
-       inline bool Page::isAtTop() const
-       {
-               return (m_navi->getTopItem() == m_item);
-       }
-
-       inline bool Page::isAtBottom() const
-       {
-               return (m_navi->getBottomItem() == m_item);
-       }
-
-       // Non-member functions //
-
-       inline bool isLast(const Page &page)
-       {
-               return (page.isAtBottom() && page.isAtTop());
-       }
-}
diff --git a/inc/presenters/Presenter.h b/inc/presenters/Presenter.h
deleted file mode 100644 (file)
index 4ed3530..0000000
+++ /dev/null
@@ -1,89 +0,0 @@
-/*
- * Copyright 2017 Samsung Electronics Co., Ltd
- *
- * 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
- *
- *     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.
- */
-
-#ifndef __GALLERY_PRESENTERS_PRESENTER_H__
-#define __GALLERY_PRESENTERS_PRESENTER_H__
-
-#include <unordered_set>
-
-#include "ucl/gui/Window.h"
-
-#include "types.h"
-
-namespace gallery {
-
-       UCL_DECLARE_REF_ALIASES(Presenter);
-
-       class Presenter : public ucl::RefCountAware {
-       public:
-               struct DeactivatorInfo {
-                       void *deactivator;
-                       bool isBroadcast;
-               };
-
-       public:
-               bool isActive() const;
-               bool isDeactivatedBy(void *deactivator) const;
-
-               void activateBy(void *deactivator);
-               void deactivateBy(void *deactivator);
-
-       protected:
-               Presenter(ucl::RefCountObjBase &rc);
-               virtual ~Presenter();
-
-               ucl::Result prepare(ucl::ElmWidget &widget);
-
-               ucl::Window &getWindow();
-               bool isWindowReady() const;
-
-               void addDeactivatorSource(ucl::Widget &source);
-               void addDeactivatorException(void *deactivator);
-
-               void sendActivateBy(ucl::Widget &sender, void *deactivator);
-               void sendDeactivateBy(ucl::Widget &sender, void *deactivator);
-
-               void broadcastActivateBy(void *deactivator);
-               void broadcastDeactivateBy(void *deactivator);
-
-               virtual void onActivate();
-               virtual void onDeactivate();
-               virtual void onActivateBy(const DeactivatorInfo &info);
-               virtual void onDeactivateBy(const DeactivatorInfo &info);
-
-       private:
-               void sendDeactivator(ucl::Widget &sender,
-                               ucl::SmartEvent event, void *deactivator);
-               void broadcastDeactivator(ucl::SmartEvent event, void *deactivator);
-
-               void sendDeactivatorInfo(ucl::Widget &sender, ucl::SmartEvent event,
-                               const DeactivatorInfo &info);
-
-               void activateByImpl(const DeactivatorInfo &info);
-               void deactivateByImpl(const DeactivatorInfo &info);
-
-               void onActivateBySmart(ucl::Widget &widget, void *eventInfo);
-               void onDeactivateBySmart(ucl::Widget &widget, void *eventInfo);
-
-       private:
-               std::unordered_set<void *> m_deactivatorExceptions;
-               std::unordered_set<void *> m_deactivators;
-               ucl::WindowSRef m_window;
-               bool m_isPrepared;
-       };
-}
-
-#endif // __GALLERY_PRESENTERS_PRESENTER_H__
diff --git a/inc/presenters/PreviewPage.h b/inc/presenters/PreviewPage.h
deleted file mode 100644 (file)
index aa0c70d..0000000
+++ /dev/null
@@ -1,151 +0,0 @@
-/*
- * Copyright 2017 Samsung Electronics Co., Ltd
- *
- * 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
- *
- *     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.
- */
-
-#ifndef __GALLERY_PRESENTERS_PREVIEW_PAGE_H__
-#define __GALLERY_PRESENTERS_PREVIEW_PAGE_H__
-
-#include "Page.h"
-
-#include "model/IMediaAlbum.h"
-
-#include "view/PageContent.h"
-#include "view/ImageGrid.h"
-
-#include "MoreOptionsPresenter.h"
-#include "SelectModePresenter.h"
-#include "AlertDialog.h"
-#include "ProcessingPresenter.h"
-#include "AtspiHighlightHelper.h"
-
-namespace gallery {
-
-       UCL_DECLARE_REF_ALIASES(PreviewPage);
-
-       class PreviewPage final : public Page,
-                       private ImageGrid::IListener,
-                       private MoreOptionsPresenter::IListener,
-                       private SelectModePresenter::IListener {
-       public:
-               class Builder {
-               public:
-                       Builder();
-                       ~Builder();
-                       Builder &setNaviframe(const ucl::NaviframeSRef &navi);
-                       Builder &setAlbum(const IMediaAlbumSRef &album);
-                       Builder &setStartItemIndex(int index);
-                       Builder &setSelectModeStartup(bool value);
-                       Builder &setAutoSelectStartItem(bool value);
-                       PreviewPageWRef build(
-                                       const ExitRequestHandler &onExitRequest) const;
-               private:
-                       ucl::NaviframeSRef m_navi;
-                       IMediaAlbumSRef m_album;
-                       int m_startItemIndex;
-                       bool m_selectModeStartup;
-                       bool m_autoSelectStartItem;
-               };
-
-       public:
-               int getCurrentItemIndex() const;
-
-       private:
-               friend class ucl::RefCountObj<PreviewPage>;
-               PreviewPage(ucl::RefCountObjBase &rc, const ucl::NaviframeSRef &navi,
-                               const ExitRequestHandler &onExitRequest,
-                               const IMediaAlbumSRef &album, bool selectModeStartup);
-               virtual ~PreviewPage();
-
-               ucl::Result prepare(int startItemIndex);
-               void showItem(int itemIndex);
-               void selectItem(int itemIndex);
-               int getSafeItemIndex(int itemIndex) const;
-
-               void reload();
-               void checkViewerPage();
-
-               void onAlbumChanged();
-               bool onEachMedia(MediaItemSRef &&media);
-
-               void closeTempViews();
-               void switchToSelectMode();
-               void switchToNormalMode();
-               void toggleItemSelected(int itemIndex);
-               void confirmItemsDelete();
-               void openViewer(int itemIndex, int x, int y);
-
-               void onPageExitRequest(Page &page);
-
-               bool onAlertEvent(AlertDialog &dialog, int event);
-               void onJobComplete();
-
-               Elm_Interface_Atspi_Accessible *onAtspiHighlight(
-                               ucl::Widget &widget, Elm_Atspi_Relation_Type flowRelation);
-
-               // Presenter //
-
-               virtual void onActivateBy(const DeactivatorInfo &info) final override;
-               virtual void onDeactivateBy(const DeactivatorInfo &info) final override;
-
-               // Page //
-
-               virtual void onBackKey() final override;
-
-               // ImageGrid::IListener //
-
-               virtual void onItemRealized(int itemIndex) final override;
-               virtual void onItemUnrealized(int itemIndex) final override;
-               virtual void onItemEvent(int itemIndex,
-                               ImageGrid::ItemEvent event, int x, int y) final override;
-               virtual void onTransitionFinished() final override;
-               virtual Elm_Interface_Atspi_Accessible *onAccessObjectRequest(
-                               bool isFlowsTo) final override;
-
-               // MoreOptionsPresenter::IListener //
-
-               virtual void onMoreOptionClicked(MoreOptionsPresenter &sender,
-                               const MoreOptionsPresenter::Option &option) final override;
-
-               // SelectModePresenter::IListener //
-
-               virtual void onSelectModeEvent(
-                               SelectModePresenter::Event event) final override;
-
-       private:
-               class Item;
-               using ItemSRef = ucl::SharedRef<Item>;
-
-       private:
-               const IMediaAlbumSRef m_album;
-               const bool m_selectModeStartup;
-               ImageGridSRef m_imageGrid;
-               std::vector<ItemSRef> m_items;
-               IJobSRef m_job;
-
-               PageContentSRef m_content;
-               MoreOptionsPresenterSRef m_more;
-               SelectModePresenterSRef m_smp;
-               AlertDialogWRef m_alert;
-               ProcessingPresenterSRef m_processing;
-               AtspiHighlightHelperSRef m_atspiHelper;
-
-               PageWRef m_page;
-               int m_selectCount;
-               bool m_isInSelectMode;
-               bool m_needReload;
-       };
-}
-
-#endif // __GALLERY_PRESENTERS_PREVIEW_PAGE_H__
diff --git a/inc/presenters/ProcessingPresenter.h b/inc/presenters/ProcessingPresenter.h
deleted file mode 100644 (file)
index 59ff50f..0000000
+++ /dev/null
@@ -1,109 +0,0 @@
-/*
- * Copyright 2017 Samsung Electronics Co., Ltd
- *
- * 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
- *
- *     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.
- */
-
-#ifndef __GALLERY_PRESENTERS_PROCESSING_PRESENTER_H__
-#define __GALLERY_PRESENTERS_PROCESSING_PRESENTER_H__
-
-#include "ucl/gui/Layout.h"
-#include "ucl/gui/StyledWidget.h"
-
-#include "Presenter.h"
-
-namespace gallery {
-
-       UCL_DECLARE_REF_ALIASES(ProcessingPresenter);
-
-       class ProcessingPresenter final : public Presenter {
-       public:
-               enum class IconType {
-                       NONE,
-                       CHECK
-               };
-
-               class Builder {
-               public:
-                       Builder();
-                       Builder &setProcessingText(ucl::TString text);
-                       Builder &setForceProgress(bool value);
-                       ProcessingPresenterSRef build(ucl::ElmWidget &parent) const;
-               private:
-                       ucl::TString m_processingText;
-                       bool m_forceProgress;
-               };
-
-               using DismissHandler = ucl::WeakDelegate<void()>;
-
-       public:
-               void complete(const ucl::TString &completeText,
-                               IconType iconType = IconType::NONE);
-
-               void setDismissHandler(const DismissHandler &handler);
-
-       private:
-               friend class ucl::RefCountObj<ProcessingPresenter>;
-               ProcessingPresenter(ucl::RefCountObjBase &rc);
-               virtual ~ProcessingPresenter();
-
-               ucl::Result prepare(ucl::ElmWidget &parent,
-                               const ucl::TString &processingText,
-                               bool forceProgress);
-
-               ucl::Result createWidget(ucl::ElmWidget &parent,
-                               const ucl::TString &processingText);
-               ucl::Result moveWidget();
-               ucl::Result createProgress();
-               ucl::Result createPopup();
-               ucl::Result createIcon();
-
-               bool resetTimer(double timeout);
-               void stopTimer();
-
-               void showProgress();
-
-               void tryShowPopup();
-               void dismissPopup();
-               void deletePopup();
-
-               void animateIcon();
-
-               Eina_Bool onTimer();
-
-               void onPopupDismissed(ucl::Widget &widget, void *eventInfo);
-               void onPopupHWBackKey(Evas_Object *obj, void *eventInfo);
-
-       private:
-               enum class State {
-                       WAITING,
-                       PROCESSING,
-                       POPUP_ANIMATION,
-                       COMPLETE
-               };
-
-       private:
-               ucl::LayoutSRef m_widget;
-               ucl::StyledWidgetSRef m_popup;
-               ucl::LayoutWRef m_icon;
-               IconType m_iconType;
-               DismissHandler m_dismissHandler;
-               Ecore_Timer *m_timer;
-               State m_state;
-               bool m_mayComplete;
-               bool m_isComplete;
-               bool m_isDismissed;
-       };
-}
-
-#endif // __GALLERY_PRESENTERS_PROCESSING_PRESENTER_H__
diff --git a/inc/presenters/SelectModePresenter.h b/inc/presenters/SelectModePresenter.h
deleted file mode 100644 (file)
index b7de8bf..0000000
+++ /dev/null
@@ -1,118 +0,0 @@
-/*
- * Copyright 2017 Samsung Electronics Co., Ltd
- *
- * 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
- *
- *     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.
- */
-
-#ifndef __GALLERY_PRESENTERS_SELECT_MODE_PRESENTER_H__
-#define __GALLERY_PRESENTERS_SELECT_MODE_PRESENTER_H__
-
-#include "ucl/gui/StyledWidget.h"
-
-#include "Presenter.h"
-
-#include "view/PageContent.h"
-
-namespace gallery {
-
-       UCL_DECLARE_REF_ALIASES(SelectModePresenter);
-
-       class SelectModePresenter final : public Presenter {
-       public:
-               UCL_DECLARE_REF_ALIASES(IListener);
-
-               enum {
-                       FLAG_NO_BOTTOM_BUTTON = 1,
-                       FLAG_NO_MORE_OPTIONS = 2,
-                       FLAG_NO_DIM_ON_ZERO_SELECT = 4,
-                       FLAG_NO_DISMISS_ON_ROTARY = 8
-               };
-
-               class Builder {
-               public:
-                       Builder();
-                       Builder &setFlags(int flags);
-                       SelectModePresenterSRef build(PageContent &content) const;
-               private:
-                       int m_flags;
-               };
-
-               enum class Event {
-                       SELECT_ALL,
-                       DESELECT_ALL,
-                       BOTTOM_BUTTON_CLICK
-               };
-
-               class IListener : public ucl::Polymorphic {
-               public:
-                       virtual void onSelectModeEvent(Event event) = 0;
-               };
-
-       public:
-               void setListener(const IListenerWRef &listener);
-
-               void setVisible(bool value);
-               bool isVisible() const;
-
-               ucl::ElmWidget &getSelectButton();
-               ucl::ElmWidget &getBottomButton();
-
-               void setBottomButtonText(const ucl::TString &value);
-
-               void update(int selectCount, int totalCount = -1);
-
-       private:
-               friend class ucl::RefCountObj<SelectModePresenter>;
-               SelectModePresenter(ucl::RefCountObjBase &rc,
-                               PageContent &content, int flags);
-               virtual ~SelectModePresenter();
-
-               ucl::Result prepare();
-
-               void doUpdate();
-
-               void showPopup();
-               void movePopup();
-               void dismissPopup();
-               void deletePopup();
-
-               void dispatchEvent(Event event);
-
-               void onPopupDismissed(ucl::Widget &widget, void *eventInfo);
-               void onPopupHWBackKey(Evas_Object *obj, void *eventInfo);
-
-               void onSelectAll(Evas_Object *obj, void *eventInfo);
-               void onDeselectAll(Evas_Object *obj, void *eventInfo);
-
-               void onSelectBtnClick(ucl::Widget &widget, void *eventInfo);
-               void onBottomBtnClick(ucl::Widget &widget, void *eventInfo);
-               Eina_Bool onRotary(Eext_Rotary_Event_Info *info);
-
-               // Presenter //
-               virtual void onDeactivate() final override;
-
-       private:
-               const PageContentSRef m_content;
-               const int m_flags;
-               ucl::StyledWidgetSRef m_selectButton;
-               ucl::StyledWidgetSRef m_bottomButton;
-               ucl::StyledWidgetSRef m_popup;
-               IListenerWRef m_listener;
-               int m_totalCount;
-               int m_selectCount;
-               bool m_isVisible;
-               bool m_isPopupDismissed;
-       };
-}
-
-#endif // __GALLERY_PRESENTERS_SELECT_MODE_PRESENTER_H__
diff --git a/inc/presenters/ThumbnailPage.h b/inc/presenters/ThumbnailPage.h
deleted file mode 100644 (file)
index 066a017..0000000
+++ /dev/null
@@ -1,108 +0,0 @@
-/*
- * Copyright 2017 Samsung Electronics Co., Ltd
- *
- * 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
- *
- *     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.
- */
-
-#ifndef __GALLERY_PRESENTERS_THUMBNAIL_PAGE_H__
-#define __GALLERY_PRESENTERS_THUMBNAIL_PAGE_H__
-
-#include "Page.h"
-
-#include "model/IMediaAlbum.h"
-
-#include "view/PageContent.h"
-#include "view/ImageGrid.h"
-
-#include "MoreOptionsPresenter.h"
-#include "AtspiHighlightHelper.h"
-
-namespace gallery {
-
-       UCL_DECLARE_REF_ALIASES(ThumbnailPage);
-
-       class ThumbnailPage final : public Page,
-                       private ImageGrid::IListener,
-                       private MoreOptionsPresenter::IListener {
-       public:
-               class Builder {
-               public:
-                       Builder();
-                       ~Builder();
-                       Builder &setNaviframe(const ucl::NaviframeSRef &navi);
-                       Builder &setAlbum(const IMediaAlbumSRef &album);
-                       ThumbnailPageWRef build(
-                                       const ExitRequestHandler &onExitRequest) const;
-               private:
-                       ucl::NaviframeSRef m_navi;
-                       IMediaAlbumSRef m_album;
-               };
-
-       private:
-               friend class ucl::RefCountObj<ThumbnailPage>;
-               ThumbnailPage(ucl::RefCountObjBase &rc, const ucl::NaviframeSRef &navi,
-                               const ExitRequestHandler &onExitRequest,
-                               const IMediaAlbumSRef &album);
-               virtual ~ThumbnailPage();
-
-               ucl::Result prepare();
-
-               void reload();
-
-               int getSafeItemIndex(int itemIndex) const;
-
-               void onAlbumChanged();
-               bool onEachMedia(MediaItemSRef &&media);
-
-               void onPageExitRequest(Page &page);
-
-               Elm_Interface_Atspi_Accessible *onAtspiHighlight(
-                               ucl::Widget &widget, Elm_Atspi_Relation_Type flowRelation);
-
-               // Presenter //
-
-               virtual void onActivateBy(const DeactivatorInfo &info) final override;
-               virtual void onDeactivateBy(const DeactivatorInfo &info) final override;
-
-               // ImageGrid::IListener //
-
-               virtual void onItemRealized(int itemIndex) final override;
-               virtual void onItemUnrealized(int itemIndex) final override;
-               virtual void onItemEvent(int itemIndex,
-                               ImageGrid::ItemEvent event, int x, int y) final override;
-
-               // MoreOptionsPresenter::IListener //
-
-               virtual void onMoreOptionClicked(MoreOptionsPresenter &sender,
-                               const MoreOptionsPresenter::Option &option) final override;
-
-       private:
-               class RealizedItem;
-               using RealizedItemSRef = ucl::SharedRef<RealizedItem>;
-
-       private:
-               const IMediaAlbumSRef m_album;
-               MediaItems m_mediaItems;
-
-               std::vector<RealizedItemSRef> m_realizedItems;
-
-               PageContentSRef m_content;
-               ImageGridSRef m_imageGrid;
-               MoreOptionsPresenterSRef m_more;
-               AtspiHighlightHelperSRef m_atspiHelper;
-
-               PageWRef m_page;
-       };
-}
-
-#endif // __GALLERY_PRESENTERS_THUMBNAIL_PAGE_H__
diff --git a/inc/presenters/VideoPlayerPage.h b/inc/presenters/VideoPlayerPage.h
deleted file mode 100644 (file)
index 440a336..0000000
+++ /dev/null
@@ -1,137 +0,0 @@
-/*
- * Copyright 2017 Samsung Electronics Co., Ltd
- *
- * 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
- *
- *     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.
- */
-
-#ifndef __GALLERY_PRESENTERS_VIDEO_PLAYER_PAGE_H__
-#define __GALLERY_PRESENTERS_VIDEO_PLAYER_PAGE_H__
-
-#include <player.h>
-
-#include "ucl/gui/Layout.h"
-
-#include "Page.h"
-
-#include "model/SoundManager.h"
-#include "model/MediaItem.h"
-
-#include "view/TouchParser.h"
-
-namespace gallery {
-
-       UCL_DECLARE_REF_ALIASES(VideoPlayerPage);
-
-       class VideoPlayerPage final : public Page {
-       public:
-               class Builder {
-               public:
-                       Builder();
-                       ~Builder();
-                       Builder &setNaviframe(const ucl::NaviframeSRef &navi);
-                       Builder &setMedia(const MediaItemSRef &media);
-                       VideoPlayerPageWRef build(
-                                       const ExitRequestHandler &onExitRequest) const;
-               private:
-                       ucl::NaviframeSRef m_navi;
-                       MediaItemSRef m_media;
-               };
-
-       private:
-               friend class ucl::RefCountObj<VideoPlayerPage>;
-               VideoPlayerPage(ucl::RefCountObjBase &rc,
-                               const ucl::NaviframeSRef &navi,
-                               const ExitRequestHandler &onExitRequest,
-                               const MediaItemSRef &media);
-               virtual ~VideoPlayerPage();
-
-               ucl::Result prepare();
-
-               ucl::Result prepareSoundManager();
-
-               void createImage();
-               ucl::Result preparePlayer();
-               ucl::Result seekToStart();
-
-               void createControls();
-               ucl::StyledWidgetSRef createButton(ucl::ElmStyle style,
-                               ucl::EdjePart part, const ucl::WidgetEventHandler &handler);
-
-               bool resetTimer(Ecore_Timer *&timer, double timeout, Ecore_Task_Cb func);
-               void stopTimer(Ecore_Timer *&timer);
-
-               bool resetAutoStartTimer();
-               bool resetControlsHideTimer();
-               bool resetTickTimer();
-
-               void showControls();
-               void hideControls();
-               void showVolumeBtn();
-
-               bool updatePlayTimeText();
-               void updatePlayTimeText(int timeMs);
-
-               player_state_e getPlayerState() const;
-               void startPlayback();
-               void pausePlayback();
-
-               void setScreenAlwaysOn(bool isAlwaysOn);
-
-               ucl::Result launchVolumeSettings();
-
-               void onMediaDeviceStateChanged();
-               void onMediaVolumeChanged();
-
-               void onPlaybackComplete();
-               void onPlaybackInterrupted(player_interrupted_code_e code);
-               void onSeekComplete();
-
-               Eina_Bool onAutoStartTimer();
-               Eina_Bool onControlsHideTimer();
-               Eina_Bool onTickTimer();
-
-               void onVolumeBtnClick(ucl::Widget &sender, void *eventInfo);
-               void onPlayBtnClick(ucl::Widget &sender, void *eventInfo);
-               void onPauseBtnClick(ucl::Widget &sender, void *eventInfo);
-               void onTap(int x, int y);
-               Eina_Bool onRotary(Eext_Rotary_Event_Info *info);
-
-               void onInstancePaused(ucl::Widget &sender, void *eventInfo);
-               void onInstanceResumed(ucl::Widget &sender, void *eventInfo);
-
-       private:
-               enum class State {
-                       PAUSED,
-                       PLAYING
-               };
-
-       private:
-               const MediaItemSRef m_media;
-               SoundManagerSRef m_soundMgr;
-               ucl::LayoutSRef m_content;
-               ucl::WidgetSRef m_image;
-               ucl::StyledWidgetSRef m_volumeMuteBtn;
-               TouchParserSRef m_touchParser;
-               player_h m_player;
-               int m_videoDuration;
-               Ecore_Timer *m_autoStartTimer;
-               Ecore_Timer *m_controlsHideTimer;
-               Ecore_Timer *m_tickTimer;
-               State m_state;
-               bool m_isControlsVisible;
-               bool m_needAutoStart;
-               bool m_isPlaybackCompleted;
-       };
-}
-
-#endif // __GALLERY_PRESENTERS_VIDEO_PLAYER_PAGE_H__
diff --git a/inc/presenters/ViewerPage.h b/inc/presenters/ViewerPage.h
deleted file mode 100644 (file)
index 3e44887..0000000
+++ /dev/null
@@ -1,105 +0,0 @@
-/*
- * Copyright 2017 Samsung Electronics Co., Ltd
- *
- * 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
- *
- *     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.
- */
-
-#ifndef __GALLERY_PRESENTERS_VIEWER_PAGE_H__
-#define __GALLERY_PRESENTERS_VIEWER_PAGE_H__
-
-#include "Page.h"
-
-#include "model/MediaItem.h"
-
-#include "view/PageContent.h"
-#include "view/ImageViewer.h"
-#include "view/TouchParser.h"
-
-#include "MoreOptionsPresenter.h"
-#include "ProcessingPresenter.h"
-
-namespace gallery {
-
-       UCL_DECLARE_REF_ALIASES(ViewerPage);
-
-       class ViewerPage final : public Page,
-                       private MoreOptionsPresenter::IListener {
-       public:
-               class Builder {
-               public:
-                       Builder();
-                       ~Builder();
-                       Builder &setNaviframe(const ucl::NaviframeSRef &navi);
-                       Builder &setMedia(const MediaItemSRef &media);
-                       Builder &setZoomIn(int x, int y);
-                       Builder &setImageLoadSize(int size, bool isFull);
-                       Builder &setExitOnZoomOut(bool value);
-                       ViewerPageWRef build(
-                                       const ExitRequestHandler &onExitRequest) const;
-               private:
-                       ucl::NaviframeSRef m_navi;
-                       MediaItemSRef m_media;
-                       int m_zoomInX;
-                       int m_zoomInY;
-                       int m_imageLoadSize;
-                       bool m_isImageLoadSizeFull;
-                       bool m_exitOnZoomOut;
-               };
-
-       public:
-               const std::string &getMediaId() const;
-
-       private:
-               friend class ucl::RefCountObj<ViewerPage>;
-               ViewerPage(ucl::RefCountObjBase &rc, const ucl::NaviframeSRef &navi,
-                               const ExitRequestHandler &onExitRequest,
-                               const MediaItemSRef &media, bool exitOnZoomOut);
-               virtual ~ViewerPage();
-
-               ucl::Result prepare(int imageLoadSize, bool isImageLoadSizeFull);
-
-               void zoomIn(int originX, int originY);
-
-               void onThumbnail(ucl::Result result, const std::string &path);
-               void onZoomEnd(ucl::Widget &widget, void *eventInfo);
-               void onDoubleTap(int x, int y);
-
-               void onJobComplete();
-
-               // Presenter //
-
-               virtual void onActivateBy(const DeactivatorInfo &info) final override;
-               virtual void onDeactivateBy(const DeactivatorInfo &info) final override;
-
-               // Page //
-
-               virtual void onBackKey() final override;
-
-               // MoreOptionsPresenter::IListener //
-
-               virtual void onMoreOptionClicked(MoreOptionsPresenter &sender,
-                               const MoreOptionsPresenter::Option &option) final override;
-
-       private:
-               const MediaItemSRef m_media;
-               const bool m_exitOnZoomOut;
-               ImageViewerSRef m_imageViewer;
-               TouchParserSRef m_touchParser;
-               IJobSRef m_job;
-               PageContentSRef m_content;
-               MoreOptionsPresenterSRef m_more;
-               ProcessingPresenterSRef m_processing;
-       };
-}
-
-#endif // __GALLERY_PRESENTERS_VIEWER_PAGE_H__
diff --git a/inc/presenters/types.h b/inc/presenters/types.h
deleted file mode 100644 (file)
index 86e3572..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-/*
- * Copyright 2017 Samsung Electronics Co., Ltd
- *
- * 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
- *
- *     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.
- */
-
-#ifndef __GALLERY_PRESENTERS_TYPES_H__
-#define __GALLERY_PRESENTERS_TYPES_H__
-
-#include "view/types.h"
-#include "model/types.h"
-
-#endif // __GALLERY_PRESENTERS_TYPES_H__
diff --git a/inc/resources.h b/inc/resources.h
deleted file mode 100644 (file)
index 9403a67..0000000
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Copyright 2017 Samsung Electronics Co., Ltd
- *
- * 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
- *
- *     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.
- */
-
-#ifndef __GALLERY_RESOURCES_H__
-#define __GALLERY_RESOURCES_H__
-
-#include "ucl/misc/TString.h"
-
-#include "config.h"
-
-namespace gallery {
-
-       constexpr auto THEME_EDJE_PATH = "edje/theme.edj";
-
-       constexpr auto ICON_NO_PHOTOS = "gallery_icon_no_photos.png";
-
-       constexpr auto ICON_MORE_OPT_DELETE = "gallery_more_opt_delete.png";
-       constexpr auto ICON_MORE_OPT_SAVE = "gallery_more_opt_save.png";
-       constexpr auto ICON_MORE_OPT_SEND = "gallery_more_opt_send_to_mobile.png";
-
-       constexpr auto ICON_POPUP_OK = "tw_ic_popup_btn_check.png";
-       constexpr auto ICON_POPUP_CANCEL = "tw_ic_popup_btn_delete.png";
-
-       extern const ucl::TString STR_APP_NAME;
-       extern const ucl::TString STR_NO_PHOTOS;
-       extern const ucl::TString STR_SELECT_ALL;
-       extern const ucl::TString STR_DESELECT_ALL;
-       extern const ucl::TString STR_DELETE;
-       extern const ucl::TString STR_DELETE_CAPS;
-       extern const ucl::TString STR_DELETE_1_PHOTO;
-       extern const ucl::TString STR_DELETE_N_PHOTO;
-       extern const ucl::TString STR_DELETING;
-       extern const ucl::TString STR_DELETED;
-       extern const ucl::TString STR_FAILED;
-       extern const ucl::TString STR_SAVE_TO_GEAR;
-       extern const ucl::TString STR_SAVING;
-       extern const ucl::TString STR_SAVED;
-}
-
-#endif // __GALLERY_RESOURCES_H__
diff --git a/inc/types.h b/inc/types.h
deleted file mode 100644 (file)
index 9a1476e..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * Copyright 2017 Samsung Electronics Co., Ltd
- *
- * 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
- *
- *     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.
- */
-
-#ifndef __GALLERY_TYPES_H__
-#define __GALLERY_TYPES_H__
-
-#include "config.h"
-
-#include "ucl/util/types.h"
-#include "ucl/util/memory.h"
-#include "ucl/util/delegation.h"
-#include "ucl/util/smartDelegation.h"
-
-namespace gallery {
-
-       using NotiHandler = ucl::WeakDelegate<void()>;
-}
-
-#endif // __GALLERY_TYPES_H__
diff --git a/inc/view/ImageGrid.h b/inc/view/ImageGrid.h
deleted file mode 100644 (file)
index 31aa0a5..0000000
+++ /dev/null
@@ -1,287 +0,0 @@
-/*
- * Copyright 2017 Samsung Electronics Co., Ltd
- *
- * 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
- *
- *     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.
- */
-
-#ifndef __GALLERY_VIEW_IMAGE_GRID_H__
-#define __GALLERY_VIEW_IMAGE_GRID_H__
-
-#include <deque>
-
-#include "ucl/gui/StyledWidget.h"
-
-#include "ucl/misc/Timeout.h"
-
-namespace gallery {
-
-       UCL_DECLARE_REF_ALIASES(ImageGrid);
-
-       class ImageGrid : public ucl::ElmWidget {
-       public:
-               UCL_DECLARE_REF_ALIASES(IListener);
-
-               enum class Type {
-                       HCOMB_3X3,
-                       LINEAR
-               };
-
-               class Builder {
-               public:
-                       Builder();
-                       Builder &setType(Type value);
-                       Builder &setListener(const IListenerWRef &value);
-                       Builder &setSelectModeStartup(bool value);
-                       ImageGridSRef build(ElmWidget &parent) const;
-               private:
-                       Type m_type;
-                       IListenerWRef m_listener;
-                       bool m_selectModeStartup;
-               };
-
-               enum class ItemEvent {
-                       CLICK,
-                       DOUBLE_TAP,
-                       TAP_AND_HOLD
-               };
-
-               class IListener : public ucl::Polymorphic {
-               public:
-                       virtual void onItemRealized(int itemIndex) = 0;
-                       virtual void onItemUnrealized(int itemIndex) = 0;
-                       virtual void onItemEvent(int itemIndex,
-                                       ItemEvent event, int x, int y) = 0;
-                       virtual void onTransitionFinished() {}
-                       virtual Elm_Interface_Atspi_Accessible *onAccessObjectRequest(
-                                       bool isFlowsTo) { return nullptr; }
-               };
-
-               enum {
-                       UF_LOSE_IMAGE = 1,
-                       UF_LOSE_BG = 2,
-                       UF_BLOCK_CLICKS = 4,
-                       UF_SELECTED = 8
-               };
-
-               struct ItemParams {
-                       std::string imagePath;
-                       std::string bgImagePath;
-                       int imageWidth;
-                       int imageHeight;
-                       int flags;
-               };
-
-               struct ItemInfo {
-                       int imageLoadSize;
-                       bool isImageLoadSizeFull;
-                       bool isImageLoaded;
-               };
-
-               class Unrealizer : ucl::NonCopyable {
-               public:
-                       Unrealizer(ImageGrid &imageGrid);
-                       ~Unrealizer();
-               private:
-                       ImageGrid &m_imageGrid;
-               };
-
-       public:
-               void setListener(const IListenerWRef &listener);
-
-               ucl::Result setItemCount(int count);
-
-               ucl::Result setSelectModeEnabled(bool enabled);
-               bool isInSelectMode() const;
-               bool isInTransition() const;
-
-               void update();
-
-               ucl::Result updateItem(int itemIndex, const ItemParams &params);
-
-               ucl::Result isItemRealized(int itemIndex) const;
-
-               ucl::Result getItemInfo(int itemIndex, ItemInfo &info) const;
-               Elm_Interface_Atspi_Accessible *getAccessObject(bool isFlowsTo);
-
-               int getScrolledToItemIndex() const;
-               ucl::Result scrollToItem(int itemIndex);
-               ucl::Result bringInItem(int itemIndex);
-
-               void activateRotary();
-               void deactivateRotary();
-
-       private:
-               class Slot;
-               using SlotUPtr = std::unique_ptr<Slot>;
-
-               struct Info;
-               struct HcombInfo;
-               struct LinearInfo;
-
-       private:
-               friend class ucl::RefCountObj<ImageGrid>;
-               ImageGrid(ucl::RefCountObjBase *rc, Evas_Object *scroller,
-                               Type type, bool selectModeStartup);
-               virtual ~ImageGrid();
-
-               static const Info &getInfo(Type type);
-
-               template <class FUNC>
-               ucl::Result doWithItem(int itemIndex, FUNC &&func) const;
-               template <class FUNC>
-               ucl::Result doWithCell(int itemIndex, FUNC &&func) const;
-
-               template <class SHOW_FUNC>
-               ucl::Result showItem(int itemIndex, SHOW_FUNC &&showFunc);
-
-               bool isItemFullyVisible(int itemIndex);
-               bool isItemFullyVisible(int itemIndex,
-                               int &minVisibleOffset, int &maxVisibleOffset) const;
-               bool isItemFullyVisible(int slotIndex, int itemOffset,
-                               int &minVisibleOffset, int &maxVisibleOffset) const;
-
-               void forceBoxSizeCalculate();
-
-               void addUnrealizeLock();
-               void removeUnrealizeLock();
-
-               void handleItemEvent(int itemIndex,
-                               ItemEvent event, int x, int y) const;
-
-               // Accessibility
-
-               void onItemHighlighted(int itemIndex);
-               void onItemUnhighlighted(int itemIndex);
-               void onKeeperUnhighlighted(Widget &sender, void *eventInfo);
-
-               void updateHighlightTimeout();
-               void onHighlightTimeout(ucl::Timeout *sender);
-
-               Elm_Interface_Atspi_Accessible *requestAtspi(int itemIndex);
-               Elm_Interface_Atspi_Accessible *getItemAtspi(int itemIndex);
-
-               // Selection mode hanling
-               void evalSlotSizes();
-               void finalizeTransition();
-               Eina_Bool onAnimationFrame();
-               void onSlotResize(Widget &widget, void *eventInfo);
-               void onBoxResize(Evas *e, Evas_Object *obj, void *eventInfo);
-               void onTransitonFinished(Evas_Object *obj, const char *emission,
-                               const char *source);
-
-               // Initialization
-               void prepare();
-               void createCircleScroller();
-               void createHighlighKeeper();
-
-               // Actual slots count
-               bool updateSlotCount();
-               int calcSlotCount();
-               void setSlotCount(int newSlotCount);
-
-               // Optimal slots count
-               bool updateOptimalSlotCount();
-               int calcOptimalSlotCount();
-
-               // Maximum slots count
-               bool updateMaxSlotCount();
-               int calcMaxSlotCount();
-
-               // Actual begin slot index
-               bool updateBeginSlotIndex();
-               int calcBeginSlotIndex();
-               void setBeginSlotIndex(int newBeginSlotIndex);
-
-               // Maximum begin slot index
-               bool updateMaxBeginSlotIndex();
-               int calcMaxBeginSlotIndex();
-
-               // Misc
-               void updatePadSizes();
-               void updateScrollBias();
-               void updateRectMins();
-
-               // Slot size
-               bool updateSlotSize();
-               void setSlotSize(int newSlotSize);
-
-               // Scroller size
-               bool updateScrollerSize();
-               int calcScrollerSize();
-
-               // Scroller scroll offset
-               bool updateScrollOffset();
-               int calcScrollOffset();
-
-               // Slots rotations
-               void rotateSlotsRight(int count);
-               void rotateSlotsLeft(int count);
-
-               // Slots realization/unrealization
-               void realizeSlots();
-               void unrealizeSlots(int beginSlotOffset, int endSlotOffset);
-
-               // Event handling
-               void handleScrolling();
-               void handleResize();
-
-               // Events
-               void onScrollerResize(Widget &sender, void *eventInfo);
-               void onScrollerMove(Widget &sender, void *eventInfo);
-               void onBoxMove(Widget &sender, void *eventInfo);
-
-       private:
-               const Info &m_info;
-
-               ucl::StyledWidgetWRef m_scroller;
-               ucl::ElmWidget m_box;
-               ucl::Widget m_rect1;
-               ucl::Widget m_rect2;
-               Evas_Object *m_circleScroller;
-
-               IListenerWRef m_listener;
-               int m_itemCount;
-
-               std::deque<SlotUPtr> m_slots;
-
-               int m_slotCount;
-               int m_optimalSlotCount;
-               int m_maxSlotCount;
-
-               int m_beginSlotIndex;
-               int m_maxBeginSlotIndex;
-
-               int m_scrollBias;
-               int m_padSize1;
-               int m_padSize2;
-
-               int m_slotSize;
-               int m_scrollerSize;
-               int m_scrollOffset;
-
-               int m_unrealizeLock;
-               int m_eventsLock;
-
-               Ecore_Animator *m_animator;
-               int m_scrollLockIndex;
-               bool m_isInSelectMode;
-               bool m_isRotaryActive;
-
-               ucl::ElmWidgetSRef m_highlighKeeper;
-               ucl::TimeoutSRef m_highlightTimeout;
-               int m_highlightID;
-               bool m_isHighlightLocked;
-       };
-}
-
-#endif // __GALLERY_VIEW_IMAGE_GRID_H__
diff --git a/inc/view/ImageViewer.h b/inc/view/ImageViewer.h
deleted file mode 100644 (file)
index 5b6f215..0000000
+++ /dev/null
@@ -1,116 +0,0 @@
-/*
- * Copyright 2017 Samsung Electronics Co., Ltd
- *
- * 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
- *
- *     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.
- */
-
-#ifndef __GALLERY_VIEW_IMAGE_VIEWER_H__
-#define __GALLERY_VIEW_IMAGE_VIEWER_H__
-
-#include "ucl/gui/StyledWidget.h"
-#include "ucl/gui/Layout.h"
-
-#include "types.h"
-
-namespace gallery {
-
-       constexpr ucl::SmartEvent IMAGE_VIEWER_ZOOM_END {"gallery,zoom,end"};
-
-       UCL_DECLARE_REF_ALIASES(ImageViewer);
-
-       class ImageViewer final : public ucl::ElmWidget {
-       public:
-               class Builder {
-               public:
-                       Builder();
-                       Builder &setHighResImagePath(std::string path);
-                       Builder &setLoadSize(int value);
-                       Builder &setForceLoad(bool value);
-                       ImageViewerSRef build(ucl::ElmWidget &parent) const;
-               private:
-                       std::string m_highResPath;
-                       int m_loadSize;
-                       bool m_forceLoad;
-               };
-
-       public:
-               void setLowResImagePath(const std::string &path);
-               bool zoomIn(int originX, int originY);
-               bool zoomOut();
-
-               bool isZooming() const;
-               bool isZoomedIn() const;
-               bool isZoomedOut() const;
-
-       private:
-               friend class ucl::RefCountObj<ImageViewer>;
-               ImageViewer(ucl::RefCountObjBase &rc, Evas_Object *scroller,
-                               const std::string &highResPath, int loadSize, bool forceLoad);
-               virtual ~ImageViewer();
-
-               void prepare(const std::string &highResPath,
-                               int loadSize, bool forceLoad);
-
-               void onImagePreloaded(ucl::Widget &widget, void *eventInfo);
-               void onScrollerResize(ucl::Widget &widget, void *eventInfo);
-
-               bool updateScrollerSize();
-               void updateScales();
-               void updateGridSize();
-               void updateScrollOffset();
-
-               void calcZoomInFactors(int originX, int originY);
-               void calcZoomOutFactors();
-               void startAnimation();
-
-               Eina_Bool onAnimationStartTimer();
-               Eina_Bool onAnimationFrame(double pos);
-
-       private:
-               enum class State {
-                       ZOOMED_OUT,
-                       ZOOMED_IN,
-                       ZOOMING_OUT,
-                       ZOOMING_IN
-               };
-
-       private:
-               ucl::StyledWidgetWRef m_scroller;
-               ucl::Layout m_layout;
-               ucl::Widget m_grid;
-               ucl::Widget m_lowResImage;
-               ucl::Widget m_highResImage;
-
-               int m_imageW;
-               int m_imageH;
-
-               int m_scrollerW;
-               int m_scrollerH;
-               int m_gridW;
-               int m_gridH;
-               double m_scale0;
-               double m_scale1;
-
-               double m_xf1;
-               double m_yf1;
-               double m_xf2;
-               double m_yf2;
-               double m_zoom;
-
-               Ecore_Timer *m_animationStartTimer;
-               Ecore_Animator *m_animator;
-               State m_state;
-       };
-}
-
-#endif // __GALLERY_VIEW_IMAGE_VIEWER_H__
diff --git a/inc/view/PageContent.h b/inc/view/PageContent.h
deleted file mode 100644 (file)
index 9e581b4..0000000
+++ /dev/null
@@ -1,85 +0,0 @@
-/*
- * Copyright 2017 Samsung Electronics Co., Ltd
- *
- * 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
- *
- *     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.
- */
-
-#ifndef __GALLERY_VIEW_PAGE_CONTENT_H__
-#define __GALLERY_VIEW_PAGE_CONTENT_H__
-
-#include "ucl/gui/Layout.h"
-
-#include "types.h"
-
-namespace gallery {
-
-       UCL_DECLARE_REF_ALIASES(PageContent);
-
-       class PageContent : public ucl::ElmWidget {
-       public:
-               class Builder {
-               public:
-                       Builder();
-                       Builder &setFlags(int flags);
-                       PageContentSRef build(ucl::ElmWidget &parent) const;
-               private:
-                       int m_flags;
-               };
-
-               enum {
-                       FLAG_MORE_OPTIONS = 1,
-                       FLAG_SELECT_BUTTON = 2,
-                       FLAG_BOTTOM_BUTTON = 4,
-
-                       FLAGS_SELECT_MODE = (FLAG_SELECT_BUTTON | FLAG_BOTTOM_BUTTON),
-                       FLAGS_ALL = (FLAG_MORE_OPTIONS | FLAGS_SELECT_MODE)
-               };
-
-               enum class Part {
-                       DEFAULT,
-                       OVERLAY,
-                       MORE_OPTIONS,
-                       SELECT_BUTTON,
-                       BOTTOM_BUTTON
-               };
-
-       public:
-               ucl::Result set(Evas_Object *eo, Part part = Part::DEFAULT);
-               Evas_Object *unset(Part part = Part::DEFAULT);
-
-               Evas_Object *get(Part part = Part::DEFAULT) const;
-
-               ucl::Result setSelectButtonVisible(bool visible);
-               ucl::Result setMoreOptionsVisible(bool visible);
-
-       private:
-               friend class ucl::RefCountObj<PageContent>;
-               PageContent(ucl::RefCountObjBase &rc,
-                               const ucl::LayoutSRef &layout, int flags);
-               virtual ~PageContent();
-
-               void prepare(int flags);
-
-               template <class FUNC>
-               ucl::Result doWithPart(Part part, FUNC &&func) const;
-
-               ucl::Layout *getTopLayout() const;
-
-       private:
-               ucl::LayoutWRef m_moreOptions;
-               ucl::LayoutSRef m_selectMode;
-               ucl::LayoutSRef m_bottomButton;
-       };
-}
-
-#endif // __GALLERY_VIEW_PAGE_CONTENT_H__
diff --git a/inc/view/TouchParser.h b/inc/view/TouchParser.h
deleted file mode 100644 (file)
index 484fb84..0000000
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * Copyright 2017 Samsung Electronics Co., Ltd
- *
- * 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
- *
- *     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.
- */
-
-#ifndef __GALLERY_VIEW_TOUCH_PARSER_H__
-#define __GALLERY_VIEW_TOUCH_PARSER_H__
-
-#include "ucl/gui/Widget.h"
-
-#include "types.h"
-
-namespace gallery {
-
-       UCL_DECLARE_REF_ALIASES(TouchParser);
-
-       class TouchParser final : public ucl::RefCountAware {
-       public:
-               using TapHandler = ucl::WeakDelegate<void(int x, int y)>;
-
-       private:
-               friend class ucl::RefCountObj<TouchParser>;
-               TouchParser(ucl::RefCountObjBase &rc, ucl::Widget &eventSource);
-               virtual ~TouchParser();
-
-       public:
-               void setTapHandler(const TapHandler &handler);
-               void setDoubleTapHandler(const TapHandler &handler);
-               void setTapAndHoldHandler(const TapHandler &handler);
-
-       private:
-               void onMouseDown(ucl::Widget &widget, void *eventInfo);
-               void onMouseUp(ucl::Widget &widget, void *eventInfo);
-               void onMouseMove(ucl::Widget &widget, void *eventInfo);
-
-               void updateIsTapPossible(int flags, int curX, int curY);
-
-               bool isFastTap(ucl::UInt curTime, int curX, int curY) const;
-               double calcDownDistance(int curX, int curY) const;
-
-               void restartHoldTimer();
-               void stopHoldTimer();
-               Eina_Bool onHoldTimer();
-
-       private:
-               TapHandler m_tapHandler;
-               TapHandler m_doubleTapHandler;
-               TapHandler m_tapAndHoldHandler;
-               Ecore_Timer *m_holdTimer;
-               ucl::UInt m_downTime;
-               int m_downX;
-               int m_downY;
-               int m_tapCounter;
-               bool m_isMouseDown;
-               bool m_isTapPossible;
-       };
-}
-
-#endif // __GALLERY_VIEW_TOUCH_PARSER_H__
diff --git a/inc/view/helpers.h b/inc/view/helpers.h
deleted file mode 100644 (file)
index 5a13ab4..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * Copyright 2017 Samsung Electronics Co., Ltd
- *
- * 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
- *
- *     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.
- */
-
-#ifndef __GALLERY_VIEW_HELPERS_H__
-#define __GALLERY_VIEW_HELPERS_H__
-
-#include "ucl/gui/Naviframe.h"
-
-#include "types.h"
-
-namespace gallery { namespace util {
-
-       ucl::Result createCircleSurface(ucl::Naviframe &navi);
-       Eext_Circle_Surface *getCircleSurface(const ucl::ElmWidget &widget);
-
-       ucl::ElmWidgetSRef createFakeAccessObject(ucl::ElmWidget &parent);
-}}
-
-namespace gallery {
-
-       void addRotaryEventHandler(Eext_Rotary_Handler_Cb func, void *data);
-       void delRotaryEventHandler(Eext_Rotary_Handler_Cb func, void *data);
-
-       ucl::LayoutTheme getImageTheme(const char *fileName);
-
-       Elm_Atspi_Relation_Type getFlowRelation(Elm_Atspi_Gesture_Info gestureInfo);
-}
-
-#endif // __GALLERY_VIEW_HELPERS_H__
diff --git a/inc/view/types.h b/inc/view/types.h
deleted file mode 100644 (file)
index d458dc3..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- * Copyright 2017 Samsung Electronics Co., Ltd
- *
- * 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
- *
- *     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.
- */
-
-#ifndef __GALLERY_VIEW_TYPES_H__
-#define __GALLERY_VIEW_TYPES_H__
-
-#include <efl_extension.h>
-
-#include "ucl/gui/types.h"
-
-#include "../types.h"
-
-#endif // __GALLERY_VIEW_TYPES_H__
index 57d60ad118e3e7e83d528f9eedd2a77edeff4b1d..d6d7bae76df6c22d03759260bd2ed7bb2b702216 100644 (file)
@@ -26,7 +26,7 @@
 #undef UCL_LOG_TAG
 #define UCL_LOG_TAG GALLERY_LOG_TAG
 
-#include "internal.h"
+#include "helpers.h"
 
 namespace gallery {
 
diff --git a/src/helpers.h b/src/helpers.h
new file mode 100644 (file)
index 0000000..666ebc6
--- /dev/null
@@ -0,0 +1,36 @@
+/*
+ * Copyright 2017 Samsung Electronics Co., Ltd
+ *
+ * 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
+ *
+ *     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.
+ */
+
+#ifndef __GALLERY_HELPERS_H__
+#define __GALLERY_HELPERS_H__
+
+#include "gallery/types.h"
+
+namespace gallery { namespace util {
+
+       template <class GETTER, class V, class ...ARGS>
+       ucl::Result get(GETTER &&getter, V &result, ARGS &&...args);
+
+       template <class GETTER, class V, class ...ARGS>
+       ucl::Result getNz(GETTER &&getter, V &result, ARGS &&...args);
+
+       template <class FUNC, class ...ARGS>
+       ucl::Result call(FUNC &&func, ARGS &&...args);
+}}
+
+#include "helpers.hpp"
+
+#endif // __GALLERY_HELPERS_H__
diff --git a/src/helpers.hpp b/src/helpers.hpp
new file mode 100644 (file)
index 0000000..1ed8f2b
--- /dev/null
@@ -0,0 +1,87 @@
+/*
+ * Copyright 2017 Samsung Electronics Co., Ltd
+ *
+ * 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
+ *
+ *     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.
+ */
+
+#include "ucl/util/helpers.h"
+#include "ucl/util/logging.h"
+
+namespace gallery { namespace util { namespace himpl {
+
+       template <class GETTER, class ...ARGS>
+       inline ucl::Result get(GETTER &&getter, bool optional,
+                       std::string &result, ARGS &&...args)
+       {
+               char *value = nullptr;
+               const int ret = getter(std::forward<ARGS>(args)..., &value);
+               if ((ret != 0) || (!optional && ucl::isEmpty(value))) {
+                       UCL_ELOG("get() failed: %d", ret);
+                       return ucl::RES_FAIL;
+               }
+
+               if (value) {
+                       result = value;
+                       free(value);
+               } else {
+                       result.clear();
+               }
+
+               return ucl::RES_OK;
+       }
+
+       template <class GETTER, class V, class ...ARGS>
+       inline ucl::Result get(GETTER &&getter, bool optional,
+                       V &result, ARGS &&...args)
+       {
+               typename std::remove_pointer<decltype(&result)>::type value = {};
+
+               const int ret = getter(std::forward<ARGS>(args)..., &value);
+               if ((ret != 0) || (!optional && !value)) {
+                       UCL_ELOG("get() failed: %d", ret);
+                       return ucl::RES_FAIL;
+               }
+
+               result = value;
+
+               return ucl::RES_OK;
+       }
+}}}
+
+namespace gallery { namespace util {
+
+       template <class GETTER, class V, class ...ARGS>
+       inline ucl::Result get(GETTER &&getter, V &result, ARGS &&...args)
+       {
+               return himpl::get(std::forward<GETTER>(getter), true,
+                               result, std::forward<ARGS>(args)...);
+       }
+
+       template <class GETTER, class V, class ...ARGS>
+       inline ucl::Result getNz(GETTER &&getter, V &result, ARGS &&...args)
+       {
+               return himpl::get(std::forward<GETTER>(getter), false,
+                               result, std::forward<ARGS>(args)...);
+       }
+
+       template <class FUNC, class ...ARGS>
+       inline ucl::Result call(FUNC &&func, ARGS &&...args)
+       {
+               const int ret = func(std::forward<ARGS>(args)...);
+               if (ret != 0) {
+                       UCL_ELOG("func() failed: %d", ret);
+                       return ucl::RES_FAIL;
+               }
+               return ucl::RES_OK;
+       }
+}}
diff --git a/src/internal.h b/src/internal.h
deleted file mode 100644 (file)
index 504f985..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * Copyright 2017 Samsung Electronics Co., Ltd
- *
- * 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
- *
- *     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.
- */
-
-#ifndef __GALLERY_INTERNAL_H__
-#define __GALLERY_INTERNAL_H__
-
-#include "types.h"
-
-namespace gallery { namespace util {
-
-       template <class GETTER, class V, class ...ARGS>
-       ucl::Result get(GETTER &&getter, V &result, ARGS &&...args);
-
-       template <class GETTER, class V, class ...ARGS>
-       ucl::Result getNz(GETTER &&getter, V &result, ARGS &&...args);
-
-       template <class FUNC, class ...ARGS>
-       ucl::Result call(FUNC &&func, ARGS &&...args);
-}}
-
-#include "internal.hpp"
-
-#endif // __GALLERY_INTERNAL_H__
diff --git a/src/internal.hpp b/src/internal.hpp
deleted file mode 100644 (file)
index 1ed8f2b..0000000
+++ /dev/null
@@ -1,87 +0,0 @@
-/*
- * Copyright 2017 Samsung Electronics Co., Ltd
- *
- * 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
- *
- *     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.
- */
-
-#include "ucl/util/helpers.h"
-#include "ucl/util/logging.h"
-
-namespace gallery { namespace util { namespace himpl {
-
-       template <class GETTER, class ...ARGS>
-       inline ucl::Result get(GETTER &&getter, bool optional,
-                       std::string &result, ARGS &&...args)
-       {
-               char *value = nullptr;
-               const int ret = getter(std::forward<ARGS>(args)..., &value);
-               if ((ret != 0) || (!optional && ucl::isEmpty(value))) {
-                       UCL_ELOG("get() failed: %d", ret);
-                       return ucl::RES_FAIL;
-               }
-
-               if (value) {
-                       result = value;
-                       free(value);
-               } else {
-                       result.clear();
-               }
-
-               return ucl::RES_OK;
-       }
-
-       template <class GETTER, class V, class ...ARGS>
-       inline ucl::Result get(GETTER &&getter, bool optional,
-                       V &result, ARGS &&...args)
-       {
-               typename std::remove_pointer<decltype(&result)>::type value = {};
-
-               const int ret = getter(std::forward<ARGS>(args)..., &value);
-               if ((ret != 0) || (!optional && !value)) {
-                       UCL_ELOG("get() failed: %d", ret);
-                       return ucl::RES_FAIL;
-               }
-
-               result = value;
-
-               return ucl::RES_OK;
-       }
-}}}
-
-namespace gallery { namespace util {
-
-       template <class GETTER, class V, class ...ARGS>
-       inline ucl::Result get(GETTER &&getter, V &result, ARGS &&...args)
-       {
-               return himpl::get(std::forward<GETTER>(getter), true,
-                               result, std::forward<ARGS>(args)...);
-       }
-
-       template <class GETTER, class V, class ...ARGS>
-       inline ucl::Result getNz(GETTER &&getter, V &result, ARGS &&...args)
-       {
-               return himpl::get(std::forward<GETTER>(getter), false,
-                               result, std::forward<ARGS>(args)...);
-       }
-
-       template <class FUNC, class ...ARGS>
-       inline ucl::Result call(FUNC &&func, ARGS &&...args)
-       {
-               const int ret = func(std::forward<ARGS>(args)...);
-               if (ret != 0) {
-                       UCL_ELOG("func() failed: %d", ret);
-                       return ucl::RES_FAIL;
-               }
-               return ucl::RES_OK;
-       }
-}}
index 0165f6f7c5873ceb3ed320f1c4e7914e4ea4e257..826f6c33a3277439233b17109ff4b4bb3d45b952 100644 (file)
@@ -16,7 +16,7 @@
 
 #include "ucl/appfw/UIApp.h"
 
-#include "presenters/InstanceManager.h"
+#include "gallery/presenters/InstanceManager.h"
 
 #include "common.h"
 
index 33c28cd155601e26def30ad3f0a80ff4b3712a96..5b12d542ac79e51c74c84449bf2a7448630ee161 100644 (file)
@@ -21,7 +21,7 @@
 
 #include "ucl/util/threading/Thread.h"
 
-#include "model/IJob.h"
+#include "gallery/model/IJob.h"
 
 namespace gallery {
 
index 9e4fae8f588358faabce14bf89647a59e0483233..a2c9accca74d8455a875a04594c577f896ce9d7c 100644 (file)
@@ -14,7 +14,7 @@
  * limitations under the License.
  */
 
-#include "model/Gallery.h"
+#include "gallery/model/Gallery.h"
 
 #include "GalleryAlbum.h"
 
index 9a030439667467222d02368bdddbd7cd5b719f78..57f7e4858120e119a61dc92ef71b1a5a2a8ccc57 100644 (file)
@@ -23,7 +23,7 @@
 
 #include "ucl/misc/Event.h"
 
-#include "model/IMediaAlbum.h"
+#include "gallery/model/IMediaAlbum.h"
 
 namespace gallery {
 
index 67f8212c5d9fe48b394b160cc1c8ed0cddf4dea0..ac8c3ef085a6742b605517eedb08487e30db4c40 100644 (file)
@@ -14,7 +14,7 @@
  * limitations under the License.
  */
 
-#include "model/MediaItem.h"
+#include "gallery/model/MediaItem.h"
 
 #include <Ecore_File.h>
 #include <storage.h>
index efdf651e4c0e6891e856ead4babf89894a5520ac..0d83a73c20cb25cbbf379c0a49072644ace72f5a 100644 (file)
@@ -14,7 +14,7 @@
  * limitations under the License.
  */
 
-#include "model/SoundManager.h"
+#include "gallery/model/SoundManager.h"
 
 #include "common.h"
 
index c1e6306274f6b15552035e521d1b774be09f78f2..7581a14041f081e8002e349ae1c499b54d9060ce 100644 (file)
@@ -17,7 +17,7 @@
 #ifndef __GALLERY_MODEL_COMMON_H__
 #define __GALLERY_MODEL_COMMON_H__
 
-#include "internal.h"
+#include "helpers.h"
 
 #include "../common.h"
 
diff --git a/src/model/helpers.cpp b/src/model/helpers.cpp
new file mode 100644 (file)
index 0000000..452abb7
--- /dev/null
@@ -0,0 +1,157 @@
+/*
+ * Copyright 2017 Samsung Electronics Co., Ltd
+ *
+ * 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
+ *
+ *     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.
+ */
+
+#include "helpers.h"
+
+#include <Ecore_File.h>
+#include <storage.h>
+
+#include "common.h"
+
+namespace gallery { namespace { namespace impl {
+
+       constexpr auto UNIQUE_PATH_RESERVE = 10;
+}}}
+
+namespace gallery {
+
+       using ucl::Mutex;
+
+       Mutex &getMediaMutex()
+       {
+               static Mutex mutex{true};
+               return mutex;
+       }
+
+       Result getInternalStorageId(int &result)
+       {
+               struct StorageIdRec {
+                       int id;
+                       bool valid;
+               } storageIdRec {0, false};
+
+               const int ret = storage_foreach_device_supported(
+                       [](int storageId, storage_type_e type,
+                                       storage_state_e state, const char *path, void *userData)
+                       {
+                               if ((type != STORAGE_TYPE_INTERNAL) ||
+                                               (state != STORAGE_STATE_MOUNTED)) {
+                                       return true;
+                               }
+                               auto &storageIdRec = *static_cast<StorageIdRec *>(userData);
+                               storageIdRec.id = storageId;
+                               storageIdRec.valid = true;
+                               return false;
+                       },
+                       &storageIdRec);
+               if (ret != 0) {
+                       LOG_RETURN(RES_FAIL,
+                                       "storage_foreach_device_supported() failed: %d", ret);
+               }
+
+               if (!storageIdRec.valid) {
+                       LOG_RETURN(RES_FAIL, "Writable internal storage not found!");
+               }
+
+               result = storageIdRec.id;
+
+               return RES_OK;
+       }
+}
+
+namespace gallery { namespace util {
+
+       std::string extractFileName(const std::string &path)
+       {
+               const auto bsPos = path.rfind('/');
+               if (bsPos == (path.size() - 1)) {
+                       return {};
+               }
+               return path.substr(bsPos + 1);
+       }
+
+       std::string extractFileExtension(const std::string &name)
+       {
+               const auto dotPos = name.rfind('.');
+               if ((dotPos == std::string::npos) ||
+                               (dotPos == 0) || (dotPos == (name.size() - 1))) {
+                       return {};
+               }
+               return name.substr(dotPos + 1);
+       }
+
+       void splitFilePath(const std::string &path, std::string &directory,
+                       std::string &baseName, std::string &extension)
+       {
+               splitFileName(path, baseName, extension);
+               if (isNotEmpty(baseName)) {
+                       directory = path.substr(0, (path.size() - baseName.size() -
+                                       (isNotEmpty(extension) ? (extension.size() - 1) : 0)));
+               } else {
+                       directory = path;
+               }
+       }
+
+       void splitFileName(const std::string &path,
+                       std::string &baseName, std::string &extension)
+       {
+               baseName = extractFileName(path);
+               if (isNotEmpty(baseName)) {
+                       extension = extractFileExtension(baseName);
+                       if (isNotEmpty(extension)) {
+                               baseName.resize(baseName.size() - extension.size() - 1);
+                       }
+               } else {
+                       extension.clear();
+               }
+       }
+
+       std::string makeUniqueFilePath(const std::string &srcPath,
+                       const std::string &dstDir)
+       {
+               std::string baseName;
+               std::string extension;
+               splitFileName(srcPath, baseName, extension);
+
+               std::string result;
+               result.reserve(dstDir.size() + baseName.size() +
+                               extension.size() + impl::UNIQUE_PATH_RESERVE);
+
+               result = dstDir;
+               if (isNotEmpty(result) && (result.back() != '/')) {
+                       result += '/';
+               }
+               result += baseName;
+
+               const auto baseSize = result.size();
+
+               for (int counter = 2; ; ++counter) {
+                       if (isNotEmpty(extension)) {
+                               result += '.';
+                               result += extension;
+                       }
+                       if (!ecore_file_exists(result.c_str())) {
+                               break;
+                       }
+                       result.resize(baseSize);
+                       result += " (";
+                       result += std::to_string(counter);
+                       result += ')';
+               }
+
+               return result;
+       }
+}}
diff --git a/src/model/helpers.h b/src/model/helpers.h
new file mode 100644 (file)
index 0000000..4fa988f
--- /dev/null
@@ -0,0 +1,58 @@
+/*
+ * Copyright 2017 Samsung Electronics Co., Ltd
+ *
+ * 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
+ *
+ *     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.
+ */
+
+#ifndef __GALLERY_MODEL_HELPERS_H__
+#define __GALLERY_MODEL_HELPERS_H__
+
+#include <media_content.h>
+
+#include "ucl/util/threading.h"
+
+#include "gallery/model/types.h"
+
+namespace gallery {
+
+       MediaType toMediaType(media_content_type_e contentType);
+
+       ucl::Mutex &getMediaMutex();
+
+       ucl::Result getInternalStorageId(int &result);
+}
+
+namespace gallery { namespace util {
+
+       std::string extractFileName(const std::string &path);
+
+       std::string extractFileExtension(const std::string &name);
+
+       void splitFilePath(const std::string &path, std::string &directory,
+                       std::string &baseName, std::string &extension);
+
+       void splitFileName(const std::string &path,
+                       std::string &baseName, std::string &extension);
+
+       std::string makeUniqueFilePath(const std::string &srcPath,
+                       const std::string &dstDir);
+
+       bool beginsWith(const std::string &str, const std::string &prefix,
+                       bool caseSensitive = true);
+       bool removePrefix(std::string &str, const std::string &prefix,
+                       bool caseSensitive = true);
+}}
+
+#include "helpers.hpp"
+
+#endif // __GALLERY_MODEL_HELPERS_H__
diff --git a/src/model/helpers.hpp b/src/model/helpers.hpp
new file mode 100644 (file)
index 0000000..56efe64
--- /dev/null
@@ -0,0 +1,53 @@
+/*
+ * Copyright 2017 Samsung Electronics Co., Ltd
+ *
+ * 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
+ *
+ *     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.
+ */
+
+namespace gallery {
+
+       inline MediaType toMediaType(const media_content_type_e contentType)
+       {
+               switch (contentType) {
+               case MEDIA_CONTENT_TYPE_IMAGE: return MediaType::IMAGE;
+               case MEDIA_CONTENT_TYPE_VIDEO: return MediaType::VIDEO;
+               case MEDIA_CONTENT_TYPE_SOUND: return MediaType::SOUND;
+               case MEDIA_CONTENT_TYPE_MUSIC: return MediaType::MUSIC;
+               default:
+                       break;
+               }
+               return MediaType::OTHERS;
+       }
+}
+
+namespace gallery { namespace util {
+
+       inline bool beginsWith(const std::string &str, const std::string &prefix,
+                       bool caseSensitive)
+       {
+               if (caseSensitive) {
+                       return (str.compare(0, prefix.size(), prefix) == 0);
+               }
+               return (strncasecmp(str.c_str(), prefix.c_str(), prefix.size()) == 0);
+       }
+
+       inline bool removePrefix(std::string &str, const std::string &prefix,
+                       bool caseSensitive)
+       {
+               if (beginsWith(str, prefix, caseSensitive)) {
+                       str = str.substr(prefix.size());
+                       return true;
+               }
+               return false;
+       }
+}}
diff --git a/src/model/internal.cpp b/src/model/internal.cpp
deleted file mode 100644 (file)
index 9f0e5cf..0000000
+++ /dev/null
@@ -1,157 +0,0 @@
-/*
- * Copyright 2017 Samsung Electronics Co., Ltd
- *
- * 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
- *
- *     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.
- */
-
-#include "internal.h"
-
-#include <Ecore_File.h>
-#include <storage.h>
-
-#include "common.h"
-
-namespace gallery { namespace { namespace impl {
-
-       constexpr auto UNIQUE_PATH_RESERVE = 10;
-}}}
-
-namespace gallery {
-
-       using ucl::Mutex;
-
-       Mutex &getMediaMutex()
-       {
-               static Mutex mutex{true};
-               return mutex;
-       }
-
-       Result getInternalStorageId(int &result)
-       {
-               struct StorageIdRec {
-                       int id;
-                       bool valid;
-               } storageIdRec {0, false};
-
-               const int ret = storage_foreach_device_supported(
-                       [](int storageId, storage_type_e type,
-                                       storage_state_e state, const char *path, void *userData)
-                       {
-                               if ((type != STORAGE_TYPE_INTERNAL) ||
-                                               (state != STORAGE_STATE_MOUNTED)) {
-                                       return true;
-                               }
-                               auto &storageIdRec = *static_cast<StorageIdRec *>(userData);
-                               storageIdRec.id = storageId;
-                               storageIdRec.valid = true;
-                               return false;
-                       },
-                       &storageIdRec);
-               if (ret != 0) {
-                       LOG_RETURN(RES_FAIL,
-                                       "storage_foreach_device_supported() failed: %d", ret);
-               }
-
-               if (!storageIdRec.valid) {
-                       LOG_RETURN(RES_FAIL, "Writable internal storage not found!");
-               }
-
-               result = storageIdRec.id;
-
-               return RES_OK;
-       }
-}
-
-namespace gallery { namespace util {
-
-       std::string extractFileName(const std::string &path)
-       {
-               const auto bsPos = path.rfind('/');
-               if (bsPos == (path.size() - 1)) {
-                       return {};
-               }
-               return path.substr(bsPos + 1);
-       }
-
-       std::string extractFileExtension(const std::string &name)
-       {
-               const auto dotPos = name.rfind('.');
-               if ((dotPos == std::string::npos) ||
-                               (dotPos == 0) || (dotPos == (name.size() - 1))) {
-                       return {};
-               }
-               return name.substr(dotPos + 1);
-       }
-
-       void splitFilePath(const std::string &path, std::string &directory,
-                       std::string &baseName, std::string &extension)
-       {
-               splitFileName(path, baseName, extension);
-               if (isNotEmpty(baseName)) {
-                       directory = path.substr(0, (path.size() - baseName.size() -
-                                       (isNotEmpty(extension) ? (extension.size() - 1) : 0)));
-               } else {
-                       directory = path;
-               }
-       }
-
-       void splitFileName(const std::string &path,
-                       std::string &baseName, std::string &extension)
-       {
-               baseName = extractFileName(path);
-               if (isNotEmpty(baseName)) {
-                       extension = extractFileExtension(baseName);
-                       if (isNotEmpty(extension)) {
-                               baseName.resize(baseName.size() - extension.size() - 1);
-                       }
-               } else {
-                       extension.clear();
-               }
-       }
-
-       std::string makeUniqueFilePath(const std::string &srcPath,
-                       const std::string &dstDir)
-       {
-               std::string baseName;
-               std::string extension;
-               splitFileName(srcPath, baseName, extension);
-
-               std::string result;
-               result.reserve(dstDir.size() + baseName.size() +
-                               extension.size() + impl::UNIQUE_PATH_RESERVE);
-
-               result = dstDir;
-               if (isNotEmpty(result) && (result.back() != '/')) {
-                       result += '/';
-               }
-               result += baseName;
-
-               const auto baseSize = result.size();
-
-               for (int counter = 2; ; ++counter) {
-                       if (isNotEmpty(extension)) {
-                               result += '.';
-                               result += extension;
-                       }
-                       if (!ecore_file_exists(result.c_str())) {
-                               break;
-                       }
-                       result.resize(baseSize);
-                       result += " (";
-                       result += std::to_string(counter);
-                       result += ')';
-               }
-
-               return result;
-       }
-}}
diff --git a/src/model/internal.h b/src/model/internal.h
deleted file mode 100644 (file)
index 61a9176..0000000
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Copyright 2017 Samsung Electronics Co., Ltd
- *
- * 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
- *
- *     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.
- */
-
-#ifndef __GALLERY_MODEL_INTERNAL_H__
-#define __GALLERY_MODEL_INTERNAL_H__
-
-#include <media_content.h>
-
-#include "ucl/util/threading.h"
-
-#include "model/types.h"
-
-namespace gallery {
-
-       MediaType toMediaType(media_content_type_e contentType);
-
-       ucl::Mutex &getMediaMutex();
-
-       ucl::Result getInternalStorageId(int &result);
-}
-
-namespace gallery { namespace util {
-
-       std::string extractFileName(const std::string &path);
-
-       std::string extractFileExtension(const std::string &name);
-
-       void splitFilePath(const std::string &path, std::string &directory,
-                       std::string &baseName, std::string &extension);
-
-       void splitFileName(const std::string &path,
-                       std::string &baseName, std::string &extension);
-
-       std::string makeUniqueFilePath(const std::string &srcPath,
-                       const std::string &dstDir);
-
-       bool beginsWith(const std::string &str, const std::string &prefix,
-                       bool caseSensitive = true);
-       bool removePrefix(std::string &str, const std::string &prefix,
-                       bool caseSensitive = true);
-}}
-
-#include "internal.hpp"
-
-#endif // __GALLERY_MODEL_INTERNAL_H__
diff --git a/src/model/internal.hpp b/src/model/internal.hpp
deleted file mode 100644 (file)
index 56efe64..0000000
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Copyright 2017 Samsung Electronics Co., Ltd
- *
- * 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
- *
- *     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.
- */
-
-namespace gallery {
-
-       inline MediaType toMediaType(const media_content_type_e contentType)
-       {
-               switch (contentType) {
-               case MEDIA_CONTENT_TYPE_IMAGE: return MediaType::IMAGE;
-               case MEDIA_CONTENT_TYPE_VIDEO: return MediaType::VIDEO;
-               case MEDIA_CONTENT_TYPE_SOUND: return MediaType::SOUND;
-               case MEDIA_CONTENT_TYPE_MUSIC: return MediaType::MUSIC;
-               default:
-                       break;
-               }
-               return MediaType::OTHERS;
-       }
-}
-
-namespace gallery { namespace util {
-
-       inline bool beginsWith(const std::string &str, const std::string &prefix,
-                       bool caseSensitive)
-       {
-               if (caseSensitive) {
-                       return (str.compare(0, prefix.size(), prefix) == 0);
-               }
-               return (strncasecmp(str.c_str(), prefix.c_str(), prefix.size()) == 0);
-       }
-
-       inline bool removePrefix(std::string &str, const std::string &prefix,
-                       bool caseSensitive)
-       {
-               if (beginsWith(str, prefix, caseSensitive)) {
-                       str = str.substr(prefix.size());
-                       return true;
-               }
-               return false;
-       }
-}}
index 85ec84b278e8e45a87c446454484135d8a11ad95..57b06d656855cf34ed60bffc868b530511a6ef1f 100644 (file)
  * limitations under the License.
  */
 
-#include "presenters/AlertDialog.h"
+#include "gallery/presenters/AlertDialog.h"
+
+#include "gallery/resources.h"
 
-#include "resources.h"
 #include "common.h"
 
 namespace gallery { namespace { namespace impl {
index 8e6ae07f61d92316f3fc4c1853bdb846c4d6707e..08cd14e21173b8232497f41697b5440351783679 100644 (file)
@@ -14,7 +14,7 @@
  * limitations under the License.
  */
 
-#include "presenters/AtspiHighlightHelper.h"
+#include "gallery/presenters/AtspiHighlightHelper.h"
 
 #include "common.h"
 
index cceb71896be60703c31102b82d8402373ed1941f..fbefd8e56045dfa7b16ae789da9ed31ee5caf84b 100644 (file)
  * limitations under the License.
  */
 
-#include "presenters/Instance.h"
+#include "gallery/presenters/Instance.h"
 
 #include <system_settings.h>
 
 #include "ucl/appfw/helpers.h"
 
-#include "presenters/NoContentPage.h"
-#include "presenters/ThumbnailPage.h"
-#include "presenters/ViewerPage.h"
-#include "presenters/VideoPlayerPage.h"
+#include "gallery/presenters/NoContentPage.h"
+#include "gallery/presenters/ThumbnailPage.h"
+#include "gallery/presenters/ViewerPage.h"
+#include "gallery/presenters/VideoPlayerPage.h"
+
+#include "gallery/resources.h"
 
-#include "resources.h"
 #include "common.h"
 
 namespace gallery { namespace { namespace impl {
index 826362efce4e83414115b7dfdda40d258069e67b..dd187d7862036bebec43cd1d7dc1ec74342d97b8 100644 (file)
@@ -14,9 +14,9 @@
  * limitations under the License.
  */
 
-#include "presenters/InstanceManager.h"
+#include "gallery/presenters/InstanceManager.h"
 
-#include "presenters/Instance.h"
+#include "gallery/presenters/Instance.h"
 
 #include "common.h"
 
index c718ff986d6b47ecbcd5feeda5ff129b1ca83ccb..f0d902f1cb6fe8eb6a49b170e42e41dc15183eea 100644 (file)
@@ -14,7 +14,7 @@
  * limitations under the License.
  */
 
-#include "presenters/MoreOptionsPresenter.h"
+#include "gallery/presenters/MoreOptionsPresenter.h"
 
 #include "ucl/gui/Layout.h"
 
index f2537fed24a84ea54fd0b544f907571e251c44a6..db5c2d6f98806233fea98f36a287000bbda0e0ef 100644 (file)
  * limitations under the License.
  */
 
-#include "presenters/NoContentPage.h"
+#include "gallery/presenters/NoContentPage.h"
 
 #include "ucl/gui/Layout.h"
 
-#include "resources.h"
+#include "gallery/resources.h"
+
 #include "common.h"
 
 namespace gallery {
index 2bc1870bc550963570099b7e4912c40b064b9b85..39a69302c77eda5cc5291bfa79d7cdcca6c0d7d7 100644 (file)
@@ -14,7 +14,7 @@
  * limitations under the License.
  */
 
-#include "presenters/Page.h"
+#include "gallery/presenters/Page.h"
 
 #include "common.h"
 
index 7d86b0602882c4281ab15082c8b6fbadbca8c345..13f2856261b2cf37afb361308af323497c6e9dca 100644 (file)
@@ -14,7 +14,7 @@
  * limitations under the License.
  */
 
-#include "presenters/Presenter.h"
+#include "gallery/presenters/Presenter.h"
 
 #include "common.h"
 
index b741e7499b4772fe0cc1a64882639a4e6207eab9..05f3f12b55a7f4e3aa026fab96833dccad1bd35e 100644 (file)
  * limitations under the License.
  */
 
-#include "presenters/PreviewPage.h"
+#include "gallery/presenters/PreviewPage.h"
 
-#include "presenters/ViewerPage.h"
+#include "gallery/presenters/ViewerPage.h"
+
+#include "gallery/resources.h"
 
-#include "resources.h"
 #include "common.h"
 
 namespace gallery { namespace { namespace impl {
index 4eea1d4e6d4313a7534661ac1e018b0c7c548517..90e679e357351b6ce6ca72084412d6aec4be1fe6 100644 (file)
@@ -14,7 +14,7 @@
  * limitations under the License.
  */
 
-#include "presenters/ProcessingPresenter.h"
+#include "gallery/presenters/ProcessingPresenter.h"
 
 #include "common.h"
 
index 7b2e02f843382e6b6f9e57c71de6e120a61c27c7..d0fec2c2041e298b8e2a08608bfa9f74612e4385 100644 (file)
  * limitations under the License.
  */
 
-#include "presenters/SelectModePresenter.h"
+#include "gallery/presenters/SelectModePresenter.h"
 
 #include "ucl/gui/WidgetItem.h"
 
-#include "resources.h"
+#include "gallery/resources.h"
+
 #include "common.h"
 
 namespace gallery { namespace { namespace impl {
index d341a5bbf57e8be8490f535d48fcc645f0ef7ece..4d96ab69d2909c13eda977b62c67a3facf92a4cf 100644 (file)
  * limitations under the License.
  */
 
-#include "presenters/ThumbnailPage.h"
+#include "gallery/presenters/ThumbnailPage.h"
 
-#include "presenters/PreviewPage.h"
+#include "gallery/presenters/PreviewPage.h"
+
+#include "gallery/resources.h"
 
-#include "resources.h"
 #include "common.h"
 
 namespace gallery { namespace { namespace impl {
index e9e1cdb2c4b37fe76c7688f0e97f0dd4916128bc..96c384ded2a3ebd953a9834b7293d882dc7f7485 100644 (file)
  * limitations under the License.
  */
 
-#include "presenters/VideoPlayerPage.h"
+#include "gallery/presenters/VideoPlayerPage.h"
 
 #include <efl_util.h>
 
 #include "ucl/appfw/types.h"
 
-#include "resources.h"
+#include "gallery/resources.h"
+
 #include "common.h"
 
 namespace gallery { namespace { namespace impl {
index 2e2805c66ac828d156fd6077f65eb0dcba295ef2..e8a7d85b8339ba213b4f056214887f42820758dc 100644 (file)
  * limitations under the License.
  */
 
-#include "presenters/ViewerPage.h"
+#include "gallery/presenters/ViewerPage.h"
+
+#include "gallery/resources.h"
 
-#include "resources.h"
 #include "common.h"
 
 namespace gallery { namespace { namespace impl {
index 8a5ab5cf2bd453280291db326feb2b378564a16f..a769b95b963ee72bca2f7f70f9dd0897df40487f 100644 (file)
@@ -17,7 +17,7 @@
 #ifndef __GALLERY_PRESENTERS_COMMON_H__
 #define __GALLERY_PRESENTERS_COMMON_H__
 
-#include "internal.h"
+#include "helpers.h"
 
 #include "../view/common.h"
 
diff --git a/src/presenters/helpers.cpp b/src/presenters/helpers.cpp
new file mode 100644 (file)
index 0000000..c325932
--- /dev/null
@@ -0,0 +1,41 @@
+/*
+ * Copyright 2017 Samsung Electronics Co., Ltd
+ *
+ * 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
+ *
+ *     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.
+ */
+
+#include "helpers.h"
+
+#include "common.h"
+
+namespace gallery { namespace { namespace impl {
+
+       constexpr EoDataKey INSTANCE_PTR {"gallery,instance,data,ptr"};
+}}}
+
+namespace gallery {
+
+       using ucl::Window;
+
+       void setInstancePaused(Window &win, const bool value)
+       {
+               win.setData(impl::INSTANCE_PTR, reinterpret_cast<void *>(value));
+               win.callEvent((value ? INSTANCE_PAUSED : INSTANCE_RESUMED), nullptr);
+       }
+
+       bool isInstancePaused(const Window &win)
+       {
+               return (reinterpret_cast<intptr_t>(
+                               win.getData(impl::INSTANCE_PTR)) != 0);
+       }
+}
diff --git a/src/presenters/helpers.h b/src/presenters/helpers.h
new file mode 100644 (file)
index 0000000..0540406
--- /dev/null
@@ -0,0 +1,31 @@
+/*
+ * Copyright 2017 Samsung Electronics Co., Ltd
+ *
+ * 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
+ *
+ *     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.
+ */
+
+#ifndef __GALLERY_PRESENTERS_HELPERS_H__
+#define __GALLERY_PRESENTERS_HELPERS_H__
+
+#include "ucl/gui/Window.h"
+
+namespace gallery {
+
+       constexpr ucl::SmartEvent INSTANCE_PAUSED {"gallery,instance,paused"};
+       constexpr ucl::SmartEvent INSTANCE_RESUMED {"gallery,instance,resumed"};
+
+       void setInstancePaused(ucl::Window &win, bool value);
+       bool isInstancePaused(const ucl::Window &win);
+}
+
+#endif // __GALLERY_PRESENTERS_HELPERS_H__
diff --git a/src/presenters/internal.cpp b/src/presenters/internal.cpp
deleted file mode 100644 (file)
index 207fdb1..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * Copyright 2017 Samsung Electronics Co., Ltd
- *
- * 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
- *
- *     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.
- */
-
-#include "internal.h"
-
-#include "common.h"
-
-namespace gallery { namespace { namespace impl {
-
-       constexpr EoDataKey INSTANCE_PTR {"gallery,instance,data,ptr"};
-}}}
-
-namespace gallery {
-
-       using ucl::Window;
-
-       void setInstancePaused(Window &win, const bool value)
-       {
-               win.setData(impl::INSTANCE_PTR, reinterpret_cast<void *>(value));
-               win.callEvent((value ? INSTANCE_PAUSED : INSTANCE_RESUMED), nullptr);
-       }
-
-       bool isInstancePaused(const Window &win)
-       {
-               return (reinterpret_cast<intptr_t>(
-                               win.getData(impl::INSTANCE_PTR)) != 0);
-       }
-}
diff --git a/src/presenters/internal.h b/src/presenters/internal.h
deleted file mode 100644 (file)
index a0f7ecb..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * Copyright 2017 Samsung Electronics Co., Ltd
- *
- * 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
- *
- *     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.
- */
-
-#ifndef __GALLERY_PRESENTERS_INTERNAL_H__
-#define __GALLERY_PRESENTERS_INTERNAL_H__
-
-#include "ucl/gui/Window.h"
-
-namespace gallery {
-
-       constexpr ucl::SmartEvent INSTANCE_PAUSED {"gallery,instance,paused"};
-       constexpr ucl::SmartEvent INSTANCE_RESUMED {"gallery,instance,resumed"};
-
-       void setInstancePaused(ucl::Window &win, bool value);
-       bool isInstancePaused(const ucl::Window &win);
-}
-
-#endif // __GALLERY_PRESENTERS_INTERNAL_H__
index 83291cdb3e8f83e8a5f3b8e68d83e9fc4a5b751a..f685c91d32be4ca64ae456f94446ec0863bc8209 100644 (file)
@@ -14,7 +14,7 @@
  * limitations under the License.
  */
 
-#include "resources.h"
+#include "gallery/resources.h"
 
 namespace gallery {
 
index c3a2b7cfdaa3e0ccf30da05f6cb795dfa4ac2129..ece8828da420ffd0c0af91d0ab887d230ebe14cb 100644 (file)
@@ -14,7 +14,7 @@
  * limitations under the License.
  */
 
-#include "view/ImageGrid.h"
+#include "gallery/view/ImageGrid.h"
 
 #include <array>
 #include <vector>
@@ -22,7 +22,7 @@
 #include "ucl/gui/Layout.h"
 #include "ucl/gui/Window.h"
 
-#include "view/TouchParser.h"
+#include "gallery/view/TouchParser.h"
 
 #include "common.h"
 
index 5e90e416e041df4f3805724d5de18d8ee589af78..606e376ee922a68b6fef747a1f0e03f91b151a8e 100644 (file)
@@ -14,7 +14,7 @@
  * limitations under the License.
  */
 
-#include "view/ImageViewer.h"
+#include "gallery/view/ImageViewer.h"
 
 #include "common.h"
 
index 39c2505cca00e9299f7da97c6456c968a872ef61..21d601d050513157b2bbe55e1eb76f8c809dba40 100644 (file)
@@ -14,7 +14,7 @@
  * limitations under the License.
  */
 
-#include "view/PageContent.h"
+#include "gallery/view/PageContent.h"
 
 #include "common.h"
 
index bed06bf97ded4b42d0043544ec1d77f5aba5ce49..d06d2f1fce184c7a85d5f8299ee2312bd45c6d85 100644 (file)
@@ -14,7 +14,7 @@
  * limitations under the License.
  */
 
-#include "view/TouchParser.h"
+#include "gallery/view/TouchParser.h"
 
 #include "common.h"
 
index d56f144e282483b7700d122bfb4405cb447dc154..e72c13bb73085759380b3cb7f6baf93542b538e6 100644 (file)
@@ -21,7 +21,7 @@
 #include "ucl/gui/stdTheme.h"
 #include "ucl/gui/helpers.h"
 
-#include "view/helpers.h"
+#include "gallery/view/helpers.h"
 
 #include "../common.h"
 
index 2a9fe7fdc7626f331c0cd28200bfe0606de6e57b..f9361da72b8a74eefa70d5a2987df99b2ad73d0d 100644 (file)
@@ -14,7 +14,7 @@
  * limitations under the License.
  */
 
-#include "view/helpers.h"
+#include "gallery/view/helpers.h"
 
 #include <vector>