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;
using EventHandler = ucl::WeakDelegate<
bool(AlertDialog &dialog, Event event)>;
- class Builder {
+ class Builder final {
public:
Builder();
Builder &setType(Type type);
namespace gallery {
- class InstanceManager : public ucl::InstanceManagerBase {
+ class InstanceManager final : public ucl::InstanceManagerBase {
public:
InstanceManager();
public:
UCL_DECLARE_REF_ALIASES(IListener);
- struct Option {
+ struct Option final {
int id;
ucl::TString text;
ucl::TString subText;
using MoreOptions = std::list<Option>;
- class Builder {
+ class Builder final {
public:
Builder();
~Builder();
class NoContentPage final : public Page {
public:
- class Builder {
+ class Builder final {
public:
Builder();
~Builder();
private MoreOptionsPresenter::IListener,
private SelectModePresenter::IListener {
public:
- class Builder {
+ class Builder final {
public:
Builder();
~Builder();
CHECK
};
- class Builder {
+ class Builder final {
public:
Builder();
Builder &setProcessingText(ucl::TString text);
FLAG_NO_DISMISS_ON_ROTARY = 8
};
- class Builder {
+ class Builder final {
public:
Builder();
Builder &setFlags(int flags);
private ImageGrid::IListener,
private MoreOptionsPresenter::IListener {
public:
- class Builder {
+ class Builder final {
public:
Builder();
~Builder();
class VideoPlayerPage final : public Page {
public:
- class Builder {
+ class Builder final {
public:
Builder();
~Builder();
class ViewerPage final : public Page,
private MoreOptionsPresenter::IListener {
public:
- class Builder {
+ class Builder final {
public:
Builder();
~Builder();
LINEAR
};
- class Builder {
+ class Builder final {
public:
Builder();
Builder &setType(Type value);
UF_SELECTED = 8
};
- struct ItemParams {
+ struct ItemParams final {
std::string imagePath;
std::string bgImagePath;
int imageWidth;
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();
class ImageViewer final : public ucl::ElmWidget {
public:
- class Builder {
+ class Builder final {
public:
Builder();
Builder &setHighResImagePath(std::string path);
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);
Result getInternalStorageId(int &result)
{
- struct StorageIdRec {
+ struct StorageIdRec final {
int id;
bool valid;
} storageIdRec {0, false};
class ImageGrid::Slot {
private:
- class Item : public RefCountAware {
+ class Item final : public RefCountAware {
public:
friend class ReffedObj<Item>;
Item(IRefCountObj &rc,
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 *);
namespace ucl {
- class UIApp : private IInstanceContext {
+ class UIApp final : private IInstanceContext {
public:
UIApp(InstanceManagerBase &instanceMgr);
virtual ~UIApp();
--- /dev/null
+/*
+ * 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__
--- /dev/null
+/*
+ * 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()));
+ }
+}
--- /dev/null
+/*
+ * 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__
--- /dev/null
+/*
+ * 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));
+ }
+}
class Layout : public EdjeWidget {
public:
- class Builder {
+ class Builder final {
public:
Builder();
Builder &setTheme(const LayoutTheme &value);
class Naviframe final : public StyledWidget {
public:
- class Builder {
+ class Builder final {
public:
Builder();
Builder &setStyle(ElmStyle value);
BASIC = ELM_WIN_BASIC
};
- class Builder {
+ class Builder final {
public:
Builder();
struct EoDataKey : Aspect<EoDataKey> { using Aspect::Aspect; };
+ // Delegates //
+
+ using SmartCbHandler = Delegate<void(Evas_Object *obj, void *eventInfo)>;
+
// WidgetEventHandler //
class Widget;
// AtspiGestureEventInfo //
- struct AtspiGestureEventInfo {
+ struct AtspiGestureEventInfo final {
Elm_Atspi_Gesture_Info gestureInfo;
bool preventDefault;
bool stopPropagation;
// LayoutTheme //
- struct LayoutTheme {
+ struct LayoutTheme final {
const char *klass;
const char *group;
const char *style;
constexpr operator const char *() const;
- struct Hash {
+ struct Hash final {
size_t operator()(const Aspect &key) const;
};
};
namespace ucl {
template <class DELEGATE>
- class Event {
+ class Event final {
public:
Event();
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);
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>;
};
namespace ucl {
- class TString {
+ class TString final {
public:
TString();
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,
class GuiPresenter : public RefCountAware {
public:
- struct DeactivatorInfo {
+ struct DeactivatorInfo final {
const void *deactivator;
bool isBroadcast;
};
namespace ucl {
- class CondVar : public NonCopyable {
+ class CondVar final : public NonCopyable {
public:
CondVar();
~CondVar();
namespace ucl {
- class Mutex : public NonCopyable {
+ class Mutex final : public NonCopyable {
public:
Mutex(bool recursive = false);
~Mutex();
namespace ucl {
- class MutexLock : public NonCopyable {
+ class MutexLock final : public NonCopyable {
public:
MutexLock(Mutex &mutex);
~MutexLock();
// ResultData declaration //
- struct ResultData {
+ struct ResultData final {
const char *name;
int logPrio;
};
// Result declaration //
- struct Result {
+ struct Result final {
int value;
Result() = default;
};
template <class PRODUCT, class IPRODUCT>
- class Factory : public IFactory<IPRODUCT> {
+ class Factory final : public IFactory<IPRODUCT> {
public:
using Product = PRODUCT;
public:
--- /dev/null
+/*
+ * 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;
+ }
+}