TizenRefApp-8726 [Gallery] Implement ucl::Genlist and ucl::GenlistItem 95/135295/5
authorIgor Nazarov <i.nazarov@samsung.com>
Wed, 21 Jun 2017 13:25:20 +0000 (16:25 +0300)
committerIgor Nazarov <i.nazarov@samsung.com>
Thu, 22 Jun 2017 12:28:52 +0000 (15:28 +0300)
- Implemented ucl::Genlist widget class;
- Implemented ucl::GenlistItem;
- Added "final" keyword to struct/class declarations.

Change-Id: I1a3db74ac759813acd37ebda149ea301e9b5fa24

38 files changed:
inc/gallery/model/MediaItem.h
inc/gallery/presenters/AlertDialog.h
inc/gallery/presenters/InstanceManager.h
inc/gallery/presenters/MoreOptionsPresenter.h
inc/gallery/presenters/NoContentPage.h
inc/gallery/presenters/PreviewPage.h
inc/gallery/presenters/ProcessingPresenter.h
inc/gallery/presenters/SelectModePresenter.h
inc/gallery/presenters/ThumbnailPage.h
inc/gallery/presenters/VideoPlayerPage.h
inc/gallery/presenters/ViewerPage.h
inc/gallery/view/ImageGrid.h
inc/gallery/view/ImageViewer.h
inc/gallery/view/PageContent.h
src/model/helpers.cpp
src/view/ImageGrid.cpp
ucl/inc/ucl/appfw/SysEventProvider.h
ucl/inc/ucl/appfw/UIApp.h
ucl/inc/ucl/gui/Genlist.h [new file with mode: 0644]
ucl/inc/ucl/gui/Genlist.hpp [new file with mode: 0644]
ucl/inc/ucl/gui/GenlistItem.h [new file with mode: 0644]
ucl/inc/ucl/gui/GenlistItem.hpp [new file with mode: 0644]
ucl/inc/ucl/gui/Layout.h
ucl/inc/ucl/gui/Naviframe.h
ucl/inc/ucl/gui/Window.h
ucl/inc/ucl/gui/types.h
ucl/inc/ucl/misc/Aspect.h
ucl/inc/ucl/misc/Event.h
ucl/inc/ucl/misc/HashMap.h
ucl/inc/ucl/misc/TString.h
ucl/inc/ucl/misc/Variant.h
ucl/inc/ucl/mvp/GuiPresenter.h
ucl/inc/ucl/util/threading/CondVar.h
ucl/inc/ucl/util/threading/Mutex.h
ucl/inc/ucl/util/threading/MutexLock.h
ucl/inc/ucl/util/types/Result.h
ucl/inc/ucl/util/types/classTypes.h
ucl/src/gui/Genlist.cpp [new file with mode: 0644]

index 7b6eea0597454b0d1cbfa2bccc6167c95d9f6ced..98491b1abe332e328b11977af896dbefe85b1ea2 100644 (file)
@@ -100,7 +100,7 @@ namespace gallery {
        private:
                // XXX This proxy is needed to deal with cases when
                // media_thumbnail_completed_cb can't be cancelled
-               struct ThumbCbProxy {
+               struct ThumbCbProxy final {
                        const MediaItem *item;
                        ThumbnailPathGetCb callback;
 
index 1842609975317d9b272a3365091c6af1350918d4..641c53682840fb23ce1223c574e45d77f2c4b7b2 100644 (file)
@@ -41,7 +41,7 @@ namespace gallery {
                using EventHandler = ucl::WeakDelegate<
                                bool(AlertDialog &dialog, Event event)>;
 
-               class Builder {
+               class Builder final {
                public:
                        Builder();
                        Builder &setType(Type type);
index b83b5763921bbfdcf92c851229a8e368099196c5..66710aea2b30932fa557da89ad36e7a4103b4573 100644 (file)
@@ -23,7 +23,7 @@
 
 namespace gallery {
 
-       class InstanceManager : public ucl::InstanceManagerBase {
+       class InstanceManager final : public ucl::InstanceManagerBase {
        public:
                InstanceManager();
 
index 72c605a84ec7d4c02d423abb3a3c57ccf754f055..461bc7e6546a05ee83e5d8a718e8a506bb8eba9a 100644 (file)
@@ -31,7 +31,7 @@ namespace gallery {
        public:
                UCL_DECLARE_REF_ALIASES(IListener);
 
-               struct Option {
+               struct Option final {
                        int id;
                        ucl::TString text;
                        ucl::TString subText;
@@ -40,7 +40,7 @@ namespace gallery {
 
                using MoreOptions = std::list<Option>;
 
-               class Builder {
+               class Builder final {
                public:
                        Builder();
                        ~Builder();
index 4b8575c2f7d78ff11f66c9a34b6a9e8439141460..aeb1ff865a052c328d704a75cc67f2b5e7ce65ec 100644 (file)
@@ -25,7 +25,7 @@ namespace gallery {
 
        class NoContentPage final : public Page {
        public:
-               class Builder {
+               class Builder final {
                public:
                        Builder();
                        ~Builder();
index 5773ee49d13900e6b1291fd67891d05fd50e3d3a..2f417521236213aba744180b2f2ab45aec2125f5 100644 (file)
@@ -39,7 +39,7 @@ namespace gallery {
                        private MoreOptionsPresenter::IListener,
                        private SelectModePresenter::IListener {
        public:
-               class Builder {
+               class Builder final {
                public:
                        Builder();
                        ~Builder();
index 9b547675bcb9b043a50c7c996d8acdc03829c1c4..12760931b82fffc7588e6c9109fdc0085fe45c0f 100644 (file)
@@ -33,7 +33,7 @@ namespace gallery {
                        CHECK
                };
 
-               class Builder {
+               class Builder final {
                public:
                        Builder();
                        Builder &setProcessingText(ucl::TString text);
index 75c2e1485d4da149e15a39c18e68a1a62fc18417..b7b78f1a3bd78a1eb4043a07601b05a8187c935b 100644 (file)
@@ -38,7 +38,7 @@ namespace gallery {
                        FLAG_NO_DISMISS_ON_ROTARY = 8
                };
 
-               class Builder {
+               class Builder final {
                public:
                        Builder();
                        Builder &setFlags(int flags);
index 46beeed228c51352a993ae565ab3d5c91c83e3bf..5222e86a30d756ec948ce3ffbd356f4d3d9b9cd9 100644 (file)
@@ -35,7 +35,7 @@ namespace gallery {
                        private ImageGrid::IListener,
                        private MoreOptionsPresenter::IListener {
        public:
-               class Builder {
+               class Builder final {
                public:
                        Builder();
                        ~Builder();
index 8004c481afbe5908151b924132b3c1d8fad7fd63..36d3262b78e6c6eb8280d3d5bc02b7effdf7c084 100644 (file)
@@ -36,7 +36,7 @@ namespace gallery {
 
        class VideoPlayerPage final : public Page {
        public:
-               class Builder {
+               class Builder final {
                public:
                        Builder();
                        ~Builder();
index 3a577d9087288f50875aae4df86070ef7ca00e41..30a8fe433dd1276d9b455c038a09816534349e39 100644 (file)
@@ -35,7 +35,7 @@ namespace gallery {
        class ViewerPage final : public Page,
                        private MoreOptionsPresenter::IListener {
        public:
-               class Builder {
+               class Builder final {
                public:
                        Builder();
                        ~Builder();
index e21a3678dfdb28157b4ffb21ee2fa345e879f280..ddcae7ab9f504618823298c56e55b958a8b8bccb 100644 (file)
@@ -36,7 +36,7 @@ namespace gallery {
                        LINEAR
                };
 
-               class Builder {
+               class Builder final {
                public:
                        Builder();
                        Builder &setType(Type value);
@@ -73,7 +73,7 @@ namespace gallery {
                        UF_SELECTED = 8
                };
 
-               struct ItemParams {
+               struct ItemParams final {
                        std::string imagePath;
                        std::string bgImagePath;
                        int imageWidth;
@@ -81,13 +81,13 @@ namespace gallery {
                        int flags;
                };
 
-               struct ItemInfo {
+               struct ItemInfo final {
                        int imageLoadSize;
                        bool isImageLoadSizeFull;
                        bool isImageLoaded;
                };
 
-               class Unrealizer : ucl::NonCopyable {
+               class Unrealizer final : ucl::NonCopyable {
                public:
                        Unrealizer(ImageGrid &imageGrid);
                        ~Unrealizer();
index 9b6e5d8f3f7134bb8c14e422842d22bd72fdcd57..409b010d16af01f927c8b0286d4d061c3e3f13fb 100644 (file)
@@ -30,7 +30,7 @@ namespace gallery {
 
        class ImageViewer final : public ucl::ElmWidget {
        public:
-               class Builder {
+               class Builder final {
                public:
                        Builder();
                        Builder &setHighResImagePath(std::string path);
index 194c97b668733b0a3a1e87ab10b27f6776466623..85a6c5992d89e624cb2b484d4590370956cf9a3c 100644 (file)
@@ -25,9 +25,9 @@ namespace gallery {
 
        UCL_DECLARE_REF_ALIASES(PageContent);
 
-       class PageContent : public ucl::ElmWidget {
+       class PageContent final : public ucl::ElmWidget {
        public:
-               class Builder {
+               class Builder final {
                public:
                        Builder();
                        Builder &setFlags(int flags);
index 452abb776d8fdfc2365d103e885eeb8c8992df9a..34c5a00aa0eb5a43cef824909553f02de5e484f3 100644 (file)
@@ -38,7 +38,7 @@ namespace gallery {
 
        Result getInternalStorageId(int &result)
        {
-               struct StorageIdRec {
+               struct StorageIdRec final {
                        int id;
                        bool valid;
                } storageIdRec {0, false};
index a2725b961578f77a6d9c6b33bda8dad9395b96da..bce22f37bd80fb6a7edd3c3bf2d4ca385f7a1770 100644 (file)
@@ -247,7 +247,7 @@ namespace gallery {
 
        class ImageGrid::Slot {
        private:
-               class Item : public RefCountAware {
+               class Item final : public RefCountAware {
                public:
                        friend class ReffedObj<Item>;
                        Item(IRefCountObj &rc,
index 64c6f5ff66cc5e6693bd4247f26799822f0b4e18..8a72758ef9bf6a71fcbe179378714012c63f337e 100644 (file)
@@ -26,7 +26,7 @@ namespace ucl {
        class SysEventProvider;
        using SysEventProviderUPtr = std::unique_ptr<SysEventProvider>;
 
-       class SysEventProvider : public NonCopyable {
+       class SysEventProvider final : public NonCopyable {
        public:
                using EventHandlerAddFunc = int (*)(app_event_handler_h *,
                                app_event_type_e, app_event_cb, void *);
index f482ce43c11ee72e82a9afb703854bd57ace1965..a8b4dbc7fa6d48cdf81f6e71d81fadbb9a368ef6 100644 (file)
@@ -23,7 +23,7 @@
 
 namespace ucl {
 
-       class UIApp : private IInstanceContext {
+       class UIApp final : private IInstanceContext {
        public:
                UIApp(InstanceManagerBase &instanceMgr);
                virtual ~UIApp();
diff --git a/ucl/inc/ucl/gui/Genlist.h b/ucl/inc/ucl/gui/Genlist.h
new file mode 100644 (file)
index 0000000..ea2e660
--- /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 __UCL_GUI_GENLIST_H__
+#define __UCL_GUI_GENLIST_H__
+
+#include "StyledWidget.h"
+#include "GenlistItem.h"
+
+namespace ucl {
+
+       UCL_DECLARE_REF_ALIASES(Genlist);
+
+       class Genlist : public StyledWidget {
+       public:
+               enum class Mode {
+                       COMPRESS = ELM_LIST_COMPRESS,
+                       SCROLL = ELM_LIST_SCROLL,
+                       LIMIT = ELM_LIST_LIMIT,
+                       EXPAND = ELM_LIST_EXPAND
+               };
+
+               class Builder final {
+               public:
+                       Builder();
+                       Builder &setStyle(ElmStyle style);
+                       Builder &setMode(Mode mode);
+                       Builder &setHomogeneous(bool value);
+                       Builder &setIsOwner(bool value);
+                       Builder &setNeedBindToEo(bool value);
+                       GenlistSRef build(ElmWidget &parent) const;
+               private:
+                       ElmStyle m_style;
+                       Mode m_mode;
+                       bool m_isHomogeneous;
+                       bool m_isOwner;
+                       bool m_needBindToEo;
+               };
+
+       public:
+               friend class ReffedObj<Genlist>;
+               using StyledWidget::StyledWidget;
+
+               void setMode(Mode mode);
+               Mode getMode() const;
+
+               void setHomogeneous(bool isHomogeneous);
+               bool isHomogeneous() const;
+
+               void updateRealizedItems();
+               void clear();
+
+               GenlistItem append(const Elm_Genlist_Item_Class *itc,
+                               const void *data, SmartCbHandler onSelect = nullptr,
+                               GenlistItem parent = nullptr,
+                               GenlistItem::Type type = GenlistItem::Type::SIMPLE);
+
+               GenlistItem prepend(const Elm_Genlist_Item_Class *itc,
+                               const void *data, SmartCbHandler onSelect = nullptr,
+                               GenlistItem parent = nullptr,
+                               GenlistItem::Type type = GenlistItem::Type::SIMPLE);
+
+               GenlistItem insertAfter(GenlistItem after,
+                               const Elm_Genlist_Item_Class *itc, const void *data,
+                               SmartCbHandler onSelect = nullptr,
+                               GenlistItem parent = nullptr,
+                               GenlistItem::Type type = GenlistItem::Type::SIMPLE);
+
+               GenlistItem insertBefore(GenlistItem before,
+                               const Elm_Genlist_Item_Class *itc, const void *data,
+                               SmartCbHandler onSelect = nullptr,
+                               GenlistItem parent = nullptr,
+                               GenlistItem::Type type = GenlistItem::Type::SIMPLE);
+       };
+}
+
+#include "Genlist.hpp"
+
+#endif // __UCL_GUI_GENLIST_H__
diff --git a/ucl/inc/ucl/gui/Genlist.hpp b/ucl/inc/ucl/gui/Genlist.hpp
new file mode 100644 (file)
index 0000000..83eed72
--- /dev/null
@@ -0,0 +1,132 @@
+/*
+ * 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 ucl {
+
+       // Genlist::Builder //
+
+       inline Genlist::Builder::Builder() :
+               m_mode(Mode::COMPRESS),
+               m_isHomogeneous(true),
+               m_isOwner(false),
+               m_needBindToEo(false)
+       {
+       }
+
+       inline Genlist::Builder &Genlist::Builder::setStyle(const ElmStyle style)
+       {
+               m_style = style;
+               return *this;
+       }
+
+       inline Genlist::Builder &Genlist::Builder::setMode(const Mode mode)
+       {
+               m_mode = mode;
+               return *this;
+       }
+
+       inline Genlist::Builder &Genlist::Builder::setHomogeneous(const bool value)
+       {
+               m_isHomogeneous = value;
+               return *this;
+       }
+
+       inline Genlist::Builder &Genlist::Builder::setIsOwner(const bool value)
+       {
+               m_isOwner = value;
+               return *this;
+       }
+
+       inline Genlist::Builder &Genlist::Builder::setNeedBindToEo(const bool value)
+       {
+               m_needBindToEo = value;
+               return *this;
+       }
+
+       // Genlist //
+
+       inline void Genlist::setMode(const Mode mode)
+       {
+               elm_genlist_mode_set(getEo(), static_cast<Elm_List_Mode>(mode));
+       }
+
+       inline Genlist::Mode Genlist::getMode() const
+       {
+               return static_cast<Mode>(elm_genlist_mode_get(getEo()));
+       }
+
+       inline void Genlist::setHomogeneous(const bool isHomogeneous)
+       {
+               elm_genlist_homogeneous_set(getEo(), toEina(isHomogeneous));
+       }
+
+       inline bool Genlist::isHomogeneous() const
+       {
+               return elm_genlist_homogeneous_get(getEo());
+       }
+
+       inline void Genlist::updateRealizedItems()
+       {
+               elm_genlist_realized_items_update(getEo());
+       }
+
+       inline void Genlist::clear()
+       {
+               elm_genlist_clear(getEo());
+       }
+
+       inline GenlistItem Genlist::append(const Elm_Genlist_Item_Class *const itc,
+                       const void *const data, const SmartCbHandler onSelect,
+                       const GenlistItem parent, const GenlistItem::Type type)
+       {
+               return GenlistItem(elm_genlist_item_append(
+                               getEo(), itc, data, parent,
+                               static_cast<Elm_Genlist_Item_Type>(type),
+                               onSelect.getStubA(), onSelect.getData()));
+       }
+
+       inline GenlistItem Genlist::prepend(const Elm_Genlist_Item_Class *const itc,
+                       const void *const data, SmartCbHandler onSelect,
+                       const GenlistItem parent, const GenlistItem::Type type)
+       {
+               return GenlistItem(elm_genlist_item_prepend(
+                               getEo(), itc, data, parent,
+                               static_cast<Elm_Genlist_Item_Type>(type),
+                               onSelect.getStubA(), onSelect.getData()));
+       }
+
+       inline GenlistItem Genlist::insertAfter(const GenlistItem after,
+                       const Elm_Genlist_Item_Class *const itc, const void *const data,
+                       const SmartCbHandler onSelect, const GenlistItem parent,
+                       const GenlistItem::Type type)
+       {
+               return GenlistItem(elm_genlist_item_insert_after(
+                               getEo(), itc, data, parent, after,
+                               static_cast<Elm_Genlist_Item_Type>(type),
+                               onSelect.getStubA(), onSelect.getData()));
+       }
+
+       inline GenlistItem Genlist::insertBefore(const GenlistItem before,
+                       const Elm_Genlist_Item_Class *itc, const void *data,
+                       const SmartCbHandler onSelect, const GenlistItem parent,
+                       const GenlistItem::Type type)
+       {
+               return GenlistItem(elm_genlist_item_insert_before(
+                               getEo(), itc, data, parent, before,
+                               static_cast<Elm_Genlist_Item_Type>(type),
+                               onSelect.getStubA(), onSelect.getData()));
+       }
+}
diff --git a/ucl/inc/ucl/gui/GenlistItem.h b/ucl/inc/ucl/gui/GenlistItem.h
new file mode 100644 (file)
index 0000000..fddf153
--- /dev/null
@@ -0,0 +1,63 @@
+/*
+ * 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 __UCL_GUI_GENLIST_ITEM_H__
+#define __UCL_GUI_GENLIST_ITEM_H__
+
+#include "WidgetItem.h"
+
+namespace ucl {
+
+       class GenlistItem final : public WidgetItem {
+       public:
+               enum class Type {
+                       SIMPLE = ELM_GENLIST_ITEM_NONE,
+                       TREE = ELM_GENLIST_ITEM_TREE,
+                       GROUP = ELM_GENLIST_ITEM_GROUP
+               };
+
+               enum class SelectMode {
+                       DEFAULT = ELM_OBJECT_SELECT_MODE_DEFAULT,
+                       ALWAYS = ELM_OBJECT_SELECT_MODE_ALWAYS,
+                       NONE = ELM_OBJECT_SELECT_MODE_NONE,
+                       DISPLAY_ONLY = ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY
+               };
+
+               enum {
+                       FIELD_ALL = ELM_GENLIST_ITEM_FIELD_ALL,
+                       FIELD_TEXT = ELM_GENLIST_ITEM_FIELD_TEXT,
+                       FIELD_CONTENT = ELM_GENLIST_ITEM_FIELD_CONTENT,
+                       FIELD_STATE = ELM_GENLIST_ITEM_FIELD_STATE,
+               };
+
+       public:
+               using WidgetItem::WidgetItem;
+
+               void setSelectMode(SelectMode mode);
+               SelectMode getSelectMode() const;
+
+               void setSelected(bool isSelected);
+               bool isSelected() const;
+
+               void update();
+               void update(const Elm_Genlist_Item_Class *newItc);
+               void update(const char *parts, int fields = FIELD_ALL);
+       };
+}
+
+#include "GenlistItem.hpp"
+
+#endif // __UCL_GUI_GENLIST_ITEM_H__
diff --git a/ucl/inc/ucl/gui/GenlistItem.hpp b/ucl/inc/ucl/gui/GenlistItem.hpp
new file mode 100644 (file)
index 0000000..b711464
--- /dev/null
@@ -0,0 +1,56 @@
+/*
+ * 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 ucl {
+
+       inline void GenlistItem::setSelectMode(const SelectMode mode)
+       {
+               elm_genlist_item_select_mode_set(getIt(),
+                               static_cast<Elm_Object_Select_Mode>(mode));
+       }
+
+       inline GenlistItem::SelectMode GenlistItem::getSelectMode() const
+       {
+               return static_cast<GenlistItem::SelectMode>(
+                               elm_genlist_item_select_mode_get(getIt()));
+       }
+
+       inline void GenlistItem::setSelected(const bool isSelected)
+       {
+               elm_genlist_item_selected_set(getIt(), toEina(isSelected));
+       }
+
+       inline bool GenlistItem::isSelected() const
+       {
+               return elm_genlist_item_selected_get(getIt());
+       }
+
+       inline void GenlistItem::update()
+       {
+               elm_genlist_item_update(getIt());
+       }
+
+       inline void GenlistItem::update(const Elm_Genlist_Item_Class *const newItc)
+       {
+               elm_genlist_item_item_class_update(getIt(), newItc);
+       }
+
+       inline void GenlistItem::update(const char *const parts, const int fields)
+       {
+               elm_genlist_item_fields_update(getIt(), parts,
+                               static_cast<Elm_Genlist_Item_Field_Type>(fields));
+       }
+}
index 37732ce7ef3991b8a8135ed436dbe337e2f7de40..9eb108e7cfacb66545e4880102ac126b25e8d506 100644 (file)
@@ -25,7 +25,7 @@ namespace ucl {
 
        class Layout : public EdjeWidget {
        public:
-               class Builder {
+               class Builder final {
                public:
                        Builder();
                        Builder &setTheme(const LayoutTheme &value);
index 4e4336c792c3cb628d86b98c46ed37c6444559a5..66693f23e97c153a036b9d116ad4c9b5a181a1c5 100644 (file)
@@ -31,7 +31,7 @@ namespace ucl {
 
        class Naviframe final : public StyledWidget {
        public:
-               class Builder {
+               class Builder final {
                public:
                        Builder();
                        Builder &setStyle(ElmStyle value);
index b611b2569ebc411cdd1e5d43cd02812b628c0c6c..9aa598d7e55fa7bc799d3a76c31b2dfeba5e2133 100644 (file)
@@ -33,7 +33,7 @@ namespace ucl {
                        BASIC = ELM_WIN_BASIC
                };
 
-               class Builder {
+               class Builder final {
                public:
                        Builder();
 
index 454b6bc8cfbd7d96838399a49959f41e36eee569..4063b330bb87cff69b12576a274639ebb71c925e 100644 (file)
@@ -45,6 +45,10 @@ namespace ucl {
 
        struct EoDataKey : Aspect<EoDataKey> { using Aspect::Aspect; };
 
+       // Delegates //
+
+       using SmartCbHandler = Delegate<void(Evas_Object *obj, void *eventInfo)>;
+
        // WidgetEventHandler //
 
        class Widget;
@@ -89,7 +93,7 @@ namespace ucl {
 
        // AtspiGestureEventInfo //
 
-       struct AtspiGestureEventInfo {
+       struct AtspiGestureEventInfo final {
                Elm_Atspi_Gesture_Info gestureInfo;
                bool preventDefault;
                bool stopPropagation;
@@ -107,7 +111,7 @@ namespace ucl {
 
        // LayoutTheme //
 
-       struct LayoutTheme {
+       struct LayoutTheme final {
                const char *klass;
                const char *group;
                const char *style;
index 6459c55695246db3c5402d95a5a2986c2b88f817..0c55bf63db2a70452ba68ce5b2f45e2b82783673 100644 (file)
@@ -31,7 +31,7 @@ namespace ucl {
 
                constexpr operator const char *() const;
 
-               struct Hash {
+               struct Hash final {
                        size_t operator()(const Aspect &key) const;
                };
        };
index 420954ae25494eb4c4daee96c7b783d341f860c2..cd27f298bef42c3c9453249077076888520a5168 100644 (file)
@@ -24,7 +24,7 @@
 namespace ucl {
 
        template <class DELEGATE>
-       class Event {
+       class Event final {
        public:
                Event();
 
index f505a4b5ba3a41dfcefdb3809cd40483bf541899..af41cdbf28abd4e99bae36c529ca0816db770a20 100644 (file)
@@ -32,7 +32,7 @@ namespace ucl {
        using VarDict = Dict<Variant>;
 
        template <class KEY, class VALUE>
-       class HashMap {
+       class HashMap final {
        public:
                template <class VALUE2>
                HashMap &set(const KEY &key, VALUE2 &&value);
@@ -44,14 +44,14 @@ namespace ucl {
 
        private:
                template <class ENUM_CLASS>
-               struct EnumClassHash {
+               struct EnumClassHash final {
                        size_t operator()(ENUM_CLASS key) const {
                                return static_cast<size_t>(key);
                        }
                };
 
                template <class KEY2, class = void>
-               struct GetHash {
+               struct GetHash final {
                        using Type = std::hash<KEY2>;
                };
 
index 5ad240d85f0df33878dfab11c11bb19d670e22d5..71ca2d994c5a9643a69d6de86abc9c6fff4e3090 100644 (file)
@@ -21,7 +21,7 @@
 
 namespace ucl {
 
-       class TString {
+       class TString final {
        public:
                TString();
 
index 6ad0b23552d6d134b9d08a75fc3fd20f7e71de87..654235880c6b719bb842f13a412c36d54f9a4c60 100644 (file)
@@ -32,12 +32,12 @@ namespace ucl {
        template <size_t N>
        using VarArray = std::array<Variant, N>;
 
-       struct VarInitList {
+       struct VarInitList final {
                VarInitList(const std::initializer_list<Variant> &il) : il(il) {}
                const std::initializer_list<Variant> &il;
        };
 
-       class Variant {
+       class Variant final {
        public:
                enum Type {
                        TYPE_NIL,
index f81bcace5f954e623adac73625d7f544e0863e6f..5a94af45ddaa1edad092dcaf8aea01b924f39c11 100644 (file)
@@ -29,7 +29,7 @@ namespace ucl {
 
        class GuiPresenter : public RefCountAware {
        public:
-               struct DeactivatorInfo {
+               struct DeactivatorInfo final {
                        const void *deactivator;
                        bool isBroadcast;
                };
index 58d16d3027c662c84f2202fbf37ea07edd821759..e73a7639c64f00568887420512e16ffb4b2df30d 100644 (file)
@@ -21,7 +21,7 @@
 
 namespace ucl {
 
-       class CondVar : public NonCopyable {
+       class CondVar final : public NonCopyable {
        public:
                CondVar();
                ~CondVar();
index e1951bc49a26386ee9701ded03a560ef9a5dd75b..eda90ff217460ca454f352ec95105de71cb722ac 100644 (file)
@@ -25,7 +25,7 @@
 
 namespace ucl {
 
-       class Mutex : public NonCopyable {
+       class Mutex final : public NonCopyable {
        public:
                Mutex(bool recursive = false);
                ~Mutex();
index 854d0b34fd2d0ba15b5bf9a2ffe16cab40445af5..062837f6c2b71db3450f88980c0d4590af1a305c 100644 (file)
@@ -21,7 +21,7 @@
 
 namespace ucl {
 
-       class MutexLock : public NonCopyable {
+       class MutexLock final : public NonCopyable {
        public:
                MutexLock(Mutex &mutex);
                ~MutexLock();
index 69815a77e918a0ea52c6357311fd59884bb333cc..099223f6bb4a3ea86223f3bfe76b0c933b6f2e70 100644 (file)
@@ -23,14 +23,14 @@ namespace ucl {
 
        // ResultData declaration //
 
-       struct ResultData {
+       struct ResultData final {
                const char *name;
                int logPrio;
        };
 
        // Result declaration //
 
-       struct Result {
+       struct Result final {
                int value;
 
                Result() = default;
index 1b1402da4b33a842f83d62104780e8ef6d14cf71..5c708d21f3718da2b5e6b05f2d14fe60ede932d5 100644 (file)
@@ -55,7 +55,7 @@ namespace ucl {
        };
 
        template <class PRODUCT, class IPRODUCT>
-       class Factory : public IFactory<IPRODUCT> {
+       class Factory final : public IFactory<IPRODUCT> {
        public:
                using Product = PRODUCT;
        public:
diff --git a/ucl/src/gui/Genlist.cpp b/ucl/src/gui/Genlist.cpp
new file mode 100644 (file)
index 0000000..b0e31a5
--- /dev/null
@@ -0,0 +1,48 @@
+/*
+ * 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/gui/Genlist.h"
+
+#include "common.h"
+
+namespace ucl {
+
+       // Genlist::Builder //
+
+       GenlistSRef Genlist::Builder::build(ElmWidget &parent) const
+       {
+               Evas_Object *const eo = elm_genlist_add(parent);
+               if (!eo) {
+                       LOG_RETURN_VALUE(RES_FAIL, {}, "elm_genlist_add() failed!");
+               }
+
+               auto result = makeShared<Genlist>(eo, m_isOwner);
+
+               if (m_needBindToEo) {
+                       result->bindToEo();
+               }
+
+               if (isValid(m_style)) {
+                       result->setStyle(m_style);
+               }
+
+               result->setMode(m_mode);
+               result->setHomogeneous(m_isHomogeneous);
+
+               show(*result);
+
+               return result;
+       }
+}