#ifndef ADD_BUTTON_ITEM_H
#define ADD_BUTTON_ITEM_H
-#include "Ui/GengridItem.h"
+#include "Ui/GenItem.h"
-class AddButtonItem : public Ui::GengridItem
+class AddButtonItem : public Ui::GenItem
{
+public:
+ AddButtonItem();
+
private:
virtual Elm_Gengrid_Item_Class *getItemClass() const override;
virtual Evas_Object *getContent(Evas_Object *parent, const char *part) override;
namespace Ui
{
class Gengrid;
- class GengridItem;
+ class GenItem;
}
class WidgetGengridItem;
Evas_Object *m_Layout;
Evas_Object *m_EditButton;
Ui::Gengrid *m_Gengrid;
- Ui::GengridItem *m_AddButton;
+ Ui::GenItem *m_AddButton;
};
#endif /* WIDGET_H */
#ifndef WIDGET_GENGRID_ITEM_H
#define WIDGET_GENGRID_ITEM_H
-#include "Ui/GengridItem.h"
+#include "Ui/GenItem.h"
class WidgetItem;
/**
* @brief Widget gengrid item.
*/
-class WidgetGengridItem : public Ui::GengridItem
+class WidgetGengridItem : public Ui::GenItem
{
public:
typedef std::function<void()> DeleteCallback;
const std::string layoutPath = App::getResourcePath(WIDGET_LAYOUT_EDJ);
}
+AddButtonItem::AddButtonItem()
+ : GenItem(Ui::GenContainer::TypeGengrid)
+{
+}
+
Elm_Gengrid_Item_Class *AddButtonItem::getItemClass() const
{
static Elm_Gengrid_Item_Class itc = createItemClass(WIDGET_ITEM_STYLE);
}
WidgetGengridItem::WidgetGengridItem(WidgetItem &item)
- : m_Item(item), m_EditMode(false)
+ : GenItem(Ui::GenContainer::TypeGengrid), m_Item(item), m_EditMode(false)
{
m_Item.setChangeCallback(std::bind(&WidgetGengridItem::onItemChanged, this, _1));
}
*
*/
-#ifndef UI_GENLIST_CHECK_ITEM
-#define UI_GENLIST_CHECK_ITEM
+#ifndef UI_CHECK_ITEM
+#define UI_CHECK_ITEM
-#include "Ui/GenlistItem.h"
+#include "Ui/GenItem.h"
namespace Ui
{
/**
- * @brief Genlist check item
+ * @brief GenContainer check item
*/
- class EXPORT_API GenlistCheckItem : public Ui::GenlistItem
+ class EXPORT_API CheckItem : public Ui::GenItem
{
public:
/**
*/
typedef std::function<bool(bool)> CheckCallback;
- GenlistCheckItem();
- virtual ~GenlistCheckItem() override;
+ CheckItem();
+ virtual ~CheckItem() override;
/**
* @return Whether the item is checked.
* @brief Set item which "checked" state should be synchronized with this item.
* @param[in] item Item to link with
*/
- void setLinkedItem(GenlistCheckItem *item);
+ void setLinkedItem(CheckItem *item);
/**
* @brief Unset linked item.
void updateCheckPart();
/**
- * @see GenlistItem::getContent()
+ * @see GenItem::getContent()
* @remark Use it in derived class to create check component
*/
virtual Evas_Object *getContent(Evas_Object *parent, const char *part) override;
/**
- * @see GenlistItem::onSelected()
+ * @see GenItem::onSelected()
*/
virtual void onSelected() override;
Eina_Bool m_IsChecked;
bool m_IsChecking;
CheckCallback m_OnChecked;
- GenlistCheckItem *m_LinkedItem;
+ CheckItem *m_LinkedItem;
};
}
-#endif /* UI_GENLIST_CHECK_ITEM */
+#endif /* UI_CHECK_ITEM */
*
*/
-#ifndef UI_GENLIST_GROUP_ITEM_H
-#define UI_GENLIST_GROUP_ITEM_H
+#ifndef UI_GEN_GROUP_ITEM_H
+#define UI_GEN_GROUP_ITEM_H
-#include "Ui/Genlist.h"
-#include "Ui/GenlistItem.h"
+#include "Ui/GenContainer.h"
+#include "Ui/GenItem.h"
#include <vector>
namespace Ui
{
- class EXPORT_API GenlistGroupItem : virtual public GenlistItem
+ class EXPORT_API GenGroupItem : virtual public GenItem
{
public:
- virtual ~GenlistGroupItem() override;
+ virtual ~GenGroupItem() override;
/**
* @return Group first child Item.
*/
- GenlistItem *getFirstItem() const;
+ GenItem *getFirstItem() const;
/**
* @return Group last child Item.
*/
- GenlistItem *getLastItem() const;
+ GenItem *getLastItem() const;
/**
* @return Group begin iterator.
/**
* @return Group item of the next group or nullptr if none.
*/
- GenlistGroupItem *getNextGroupItem() const;
+ GenGroupItem *getNextGroupItem() const;
/**
* @return Group item of the previous group or nullptr if none.
*/
- GenlistGroupItem *getPrevGroupItem() const;
+ GenGroupItem *getPrevGroupItem() const;
/**
* @brief Insert sub item to the group.
* @details If group item is not yet inserted itself, sub item is cached
- * and inserted into genlist when it's parent is inserted.
- * @see Genlist::insert()
+ * and inserted into container when it's parent is inserted.
+ * @see GenContainer::insert()
*/
- void insertSubItem(GenlistItem *item,
- GenlistItem *sibling = nullptr,
- Genlist::Position position = Genlist::Before);
+ void insertSubItem(GenItem *item, GenItem *sibling = nullptr,
+ GenContainer::Position position = GenContainer::Before);
protected:
/**
- * @see GenlistItem::isGroupItem()
+ * @see GenItem::isGroupItem()
*/
virtual bool isGroupItem() const override { return true; }
/**
- * @see GenlistItem::getType()
+ * @see GenItem::getType()
*/
virtual Elm_Genlist_Item_Type getType() const override { return ELM_GENLIST_ITEM_GROUP; }
/**
- * @see GenlistItem::getItemClass()
+ * @see GenItem::getItemClass()
*/
- virtual Elm_Genlist_Item_Class *getItemClass() const override;
+ virtual Elm_Gen_Item_Class *getItemClass() const override;
/**
- * @see GenlistItem::onInserted()
+ * @see GenItem::onInserted()
*/
virtual void onInserted() override;
/**
- * @see GenlistItem::onPop()
+ * @see GenItem::onPop()
*/
virtual void onPop() override;
};
}
-#endif /* UI_GENLIST_GROUP_ITEM_H */
+#endif /* UI_GEN_GROUP_ITEM_H */
namespace Ui
{
class GenItem;
+ class GenGroupItem;
typedef std::weak_ptr<GenItem> GenItemPtr;
class EXPORT_API GenItem
* @brief Create generic container item.
* @param[in] type Parent container type
*/
- GenItem(GenContainer::Type type);
+ GenItem(GenContainer::Type type = GenContainer::TypeGenlist);
virtual ~GenItem();
/**
bool isInserted() const;
/**
+ * @return Whether the item is a group item.
+ */
+ virtual bool isGroupItem() const { return false; }
+
+ /**
+ * @return Whether the item can receive focus.
+ */
+ virtual bool isFocusable() const { return false; }
+
+ /**
* @return Item type.
*/
virtual Elm_Genlist_Item_Type getType() const { return ELM_GENLIST_ITEM_NONE; }
GenContainer *getParent() const;
/**
+ * @return Parent group item or nullptr if none.
+ */
+ GenGroupItem *getParentItem() const;
+
+ /**
* @return Next item in container or nullptr if none.
*/
GenItem *getNextItem() const;
void setDestroyCallback(SelectCallback callback);
/**
- * @brief Scroll genlist to item.
+ * @brief Scroll to the item.
* @param[in] position Item position on screen
* @param[in] isAnimated Whether scrolling is animated or immediate
* @see Elm_Genlist_Item_Scrollto_Type or Elm_Gengrid_Item_Scrollto_Type
bool isAnimated = false);
/**
+ * @brief Scroll to the item and give it focus.
+ * @see GenItem::scrollTo()
+ */
+ void focus(Elm_Genlist_Item_Scrollto_Type position = ELM_GENLIST_ITEM_SCROLLTO_IN,
+ bool isAnimated = false);
+
+ /**
* @brief Remove item from genlist without destroying it.
*/
void pop();
*/
virtual void onUnrealized() { }
+ /**
+ * @brief Called when item is focused by calling focus().
+ */
+ virtual void onFocused() { }
+
private:
friend class GenContainer;
void onInserted(Elm_Object_Item *item);
Elm_Object_Item *m_Item;
bool m_Preserve;
bool m_IsRealized;
+ bool m_IsFocusPending;
std::shared_ptr<GenItem> m_SelfPtr;
SelectCallback m_OnSelected;
+++ /dev/null
-/*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd All Rights Reserved
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * 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 UI_GENGRID_ITEM_H
-#define UI_GENGRID_ITEM_H
-
-#include "Ui/GenItem.h"
-
-namespace Ui
-{
- class EXPORT_API GengridItem : public GenItem
- {
- public:
- GengridItem()
- : GenItem(GenContainer::TypeGengrid)
- { }
- };
-}
-
-#endif /* UI_GENGRID_ITEM_H */
+++ /dev/null
-/*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd All Rights Reserved
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * 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 UI_GENLIST_ITEM_H
-#define UI_GENLIST_ITEM_H
-
-#include "Ui/GenItem.h"
-
-namespace Ui
-{
- class GenlistGroupItem;
-
- class EXPORT_API GenlistItem : public GenItem
- {
- public:
- GenlistItem();
-
- /**
- * @return Whether the item is a group item.
- */
- virtual bool isGroupItem() const { return false; }
-
- /**
- * @return Whether the item can receive focus.
- */
- virtual bool isFocusable() const { return false; }
-
- /**
- * @return Parent genlist group item or nullptr if none.
- */
- GenlistGroupItem *getParentItem() const;
-
- /**
- * @brief Scroll to the item and give it focus.
- * @see GenlItem::scrollTo()
- */
- void focus(Elm_Genlist_Item_Scrollto_Type position = ELM_GENLIST_ITEM_SCROLLTO_IN,
- bool isAnimated = false);
-
- protected:
- /**
- * @brief Called when item is focused by calling focus().
- */
- virtual void onFocused() { }
-
- /**
- * @brief Provides deferred focus if item was not realized when focus() was called.
- * @see GenItem::onRealized()
- */
- virtual void onRealized();
-
- private:
- friend class Genlist;
-
- bool m_IsFocusPending;
- };
-}
-
-#endif /* UI_GENLIST_ITEM_H */
#ifndef UX_SELECT_ALL_ITEM_H
#define UX_SELECT_ALL_ITEM_H
-#include "Ui/GenlistCheckItem.h"
+#include "Ui/CheckItem.h"
namespace Ux
{
/**
* @brief "Select all" genlist item
*/
- class SelectAllItem : public Ui::GenlistCheckItem
+ class SelectAllItem : public Ui::CheckItem
{
public:
/**
protected:
/**
- * @see GenlistItem::getText()
+ * @see GenItem::getText()
*/
virtual char *getText(Evas_Object *parent, const char *part) override;
/**
- * @see GenlistItem::getContent()
+ * @see GenItem::getContent()
*/
virtual Evas_Object *getContent(Evas_Object *parent, const char *part) override;
#ifndef UX_SELECT_ITEM_H
#define UX_SELECT_ITEM_H
-#include "Ui/GenlistCheckItem.h"
+#include "Ui/CheckItem.h"
#include "Ux/SelectTypes.h"
namespace Ux
class SelectView;
/**
- * @brief Genlist item for SelectView that supports selection mode switching.
+ * @brief GenContainer item for SelectView that supports selection mode switching.
*/
- class EXPORT_API SelectItem : public Ui::GenlistCheckItem
+ class EXPORT_API SelectItem : public Ui::CheckItem
{
public:
SelectItem();
virtual SelectResult getDefaultResult() const = 0;
/**
- * @see GenlistItem::getContent()
+ * @see GenItem::getContent()
*/
virtual Evas_Object *getContent(Evas_Object *parent, const char *part) override;
/**
- * @see GenlistItem::onSelected()
+ * @see GenItem::onSelected()
*/
virtual void onSelected() override;
/**
- * @see GenlistCheckItem::onChecked()
+ * @see CheckItem::onChecked()
*/
virtual bool onChecked(bool isChecked) override;
namespace Ui
{
- class GenlistItem;
+ class GenItem;
}
namespace Ux
* @brief Called when "Select All" item should be inserted.
* @param[in] item "Select All" genlist item
*/
- virtual void onSelectAllInsert(Ui::GenlistItem *item) { }
+ virtual void onSelectAllInsert(Ui::GenItem *item) { }
/**
* @brief Called when selection mode was changed.
*
*/
-#include "Ui/GenlistCheckItem.h"
+#include "Ui/CheckItem.h"
#include "Utils/Callback.h"
using namespace Ui;
-GenlistCheckItem::GenlistCheckItem()
+CheckItem::CheckItem()
: m_CheckPart("*"), m_IsChecked(false), m_IsChecking(false),
m_LinkedItem(nullptr)
{
}
-GenlistCheckItem::~GenlistCheckItem()
+CheckItem::~CheckItem()
{
unsetLinkedItem();
}
-bool GenlistCheckItem::isChecked() const
+bool CheckItem::isChecked() const
{
return m_IsChecked;
}
-bool GenlistCheckItem::setChecked(bool isChecked)
+bool CheckItem::setChecked(bool isChecked)
{
if (isChecked == m_IsChecked) {
return true;
return true;
}
-void GenlistCheckItem::setCheckCallback(CheckCallback callback)
+void CheckItem::setCheckCallback(CheckCallback callback)
{
m_OnChecked = std::move(callback);
}
-void GenlistCheckItem::setLinkedItem(GenlistCheckItem *item)
+void CheckItem::setLinkedItem(CheckItem *item)
{
if (!item) {
return;
m_LinkedItem = item;
}
-void GenlistCheckItem::unsetLinkedItem()
+void CheckItem::unsetLinkedItem()
{
if (m_LinkedItem) {
m_LinkedItem->m_LinkedItem = nullptr;
}
}
-void GenlistCheckItem::updateCheckPart()
+void CheckItem::updateCheckPart()
{
elm_genlist_item_fields_update(getObjectItem(), m_CheckPart.c_str(), ELM_GENLIST_ITEM_FIELD_CONTENT);
}
-Evas_Object *GenlistCheckItem::getContent(Evas_Object *parent, const char *part)
+Evas_Object *CheckItem::getContent(Evas_Object *parent, const char *part)
{
m_CheckPart = part;
elm_check_state_pointer_set(check, &m_IsChecked);
evas_object_propagate_events_set(check, EINA_FALSE);
evas_object_smart_callback_add(check, "changed",
- makeCallback(&GenlistCheckItem::onCheckChanged), this);
+ makeCallback(&CheckItem::onCheckChanged), this);
return check;
}
-void GenlistCheckItem::onSelected()
+void CheckItem::onSelected()
{
setChecked(!m_IsChecked);
}
-void GenlistCheckItem::onCheckChanged(Evas_Object *check, void *eventInfo)
+void CheckItem::onCheckChanged(Evas_Object *check, void *eventInfo)
{
if (!notifyCheck()) {
elm_check_state_set(check, !m_IsChecked);
}
}
-bool GenlistCheckItem::notifyCheck()
+bool CheckItem::notifyCheck()
{
if (m_IsChecking) {
return false;
*
*/
-#include "Ui/GenlistGroupItem.h"
-#include "Ui/Genlist.h"
+#include "Ui/GenGroupItem.h"
#include <algorithm>
using namespace Ui;
-GenlistGroupItem::~GenlistGroupItem()
+GenGroupItem::~GenGroupItem()
{
for (auto &&itemPtr : m_ItemsCache) {
if (auto item = itemPtr.lock()) {
}
}
-GenlistItem *GenlistGroupItem::getFirstItem() const
+GenItem *GenGroupItem::getFirstItem() const
{
const Eina_List *subitems = elm_genlist_item_subitems_get(getObjectItem());
Elm_Object_Item *item = (Elm_Object_Item *) eina_list_data_get(subitems);
- return (GenlistItem *) elm_object_item_data_get(item);
+ return (GenItem *) elm_object_item_data_get(item);
}
-GenlistItem *GenlistGroupItem::getLastItem() const
+GenItem *GenGroupItem::getLastItem() const
{
const Eina_List *subitems = elm_genlist_item_subitems_get(getObjectItem());
Elm_Object_Item *item = (Elm_Object_Item *) eina_list_last_data_get(subitems);
- return (GenlistItem *) elm_object_item_data_get(item);
+ return (GenItem *) elm_object_item_data_get(item);
}
-GenIterator GenlistGroupItem::begin()
+GenIterator GenGroupItem::begin()
{
return getFirstItem();
}
-GenIterator GenlistGroupItem::end()
+GenIterator GenGroupItem::end()
{
- GenlistItem *lastItem = getLastItem();
+ GenItem *lastItem = getLastItem();
return lastItem ? lastItem->getNextItem() : nullptr;
}
-size_t GenlistGroupItem::getItemCount() const
+size_t GenGroupItem::getItemCount() const
{
if (!m_ItemsCache.empty()) {
return std::count_if(m_ItemsCache.begin(), m_ItemsCache.end(),
return eina_list_count(subitems);
}
-bool GenlistGroupItem::isEmpty() const
+bool GenGroupItem::isEmpty() const
{
return getItemCount() == 0;
}
-bool GenlistGroupItem::isExpanded() const
+bool GenGroupItem::isExpanded() const
{
Elm_Object_Item *item = getObjectItem();
if (!item) {
return true;
}
-GenlistGroupItem *GenlistGroupItem::getNextGroupItem() const
+GenGroupItem *GenGroupItem::getNextGroupItem() const
{
- GenlistItem *lastItem = getLastItem();
- GenlistItem *item = static_cast<GenlistItem *>(lastItem ? lastItem->getNextItem() : getNextItem());
+ GenItem *lastItem = getLastItem();
+ GenItem *item = lastItem ? lastItem->getNextItem() : getNextItem();
if (item && item->isGroupItem()) {
- return dynamic_cast<GenlistGroupItem *>(item);
+ return dynamic_cast<GenGroupItem *>(item);
}
return nullptr;
}
-GenlistGroupItem *GenlistGroupItem::getPrevGroupItem() const
+GenGroupItem *GenGroupItem::getPrevGroupItem() const
{
- GenlistItem *item = static_cast<GenlistItem *>(getPrevItem());
+ GenItem *item = getPrevItem();
if (item) {
if (item->isGroupItem()) {
- return dynamic_cast<GenlistGroupItem *>(item);
+ return dynamic_cast<GenGroupItem *>(item);
} else {
return item->getParentItem();
}
return nullptr;
}
-void GenlistGroupItem::insertSubItem(GenlistItem *item, GenlistItem *sibling,
- Genlist::Position position)
+void GenGroupItem::insertSubItem(GenItem *item, GenItem *sibling,
+ GenContainer::Position position)
{
if (!item) {
return;
}
- Genlist *genlist = static_cast<Genlist *>(getParent());
- if (genlist && isExpanded()) {
- genlist->insert(item, this, sibling, position);
+ GenContainer *container = getParent();
+ if (container && isExpanded()) {
+ container->insert(item, this, sibling, position);
} else {
auto pos = m_ItemsCache.end();
if (sibling) {
}
if (pos != m_ItemsCache.end()) {
- if (position == Genlist::After) {
+ if (position == GenContainer::After) {
++pos;
}
} else {
- if (position == Genlist::After) {
+ if (position == GenContainer::After) {
pos = m_ItemsCache.begin();
}
}
}
}
-Elm_Genlist_Item_Class *GenlistGroupItem::getItemClass() const
+Elm_Gen_Item_Class *GenGroupItem::getItemClass() const
{
- static Elm_Genlist_Item_Class itc = createItemClass("group_index");
+ static Elm_Gen_Item_Class itc = createItemClass("group_index");
return &itc;
}
-void GenlistGroupItem::onInserted()
+void GenGroupItem::onInserted()
{
if (isExpanded()) {
insertSubItems();
}
}
-void GenlistGroupItem::onPop()
+void GenGroupItem::onPop()
{
popSubItems();
}
-void GenlistGroupItem::onExpanded(bool isExpanded)
+void GenGroupItem::onExpanded(bool isExpanded)
{
if (isExpanded) {
insertSubItems();
}
}
-void GenlistGroupItem::insertSubItems()
+void GenGroupItem::insertSubItems()
{
- Genlist *genlist = static_cast<Genlist *>(getParent());
- if (genlist) {
+ GenContainer *container = getParent();
+ if (container) {
for (auto &&itemPtr : m_ItemsCache) {
if (auto item = itemPtr.lock()) {
- genlist->insert(item.get(), this);
+ container->insert(item.get(), this);
}
}
m_ItemsCache.clear();
}
}
-void GenlistGroupItem::popSubItems()
+void GenGroupItem::popSubItems()
{
for (auto it = begin(), endIt = end(); it != endIt; ) {
- GenlistItem *item = static_cast<GenlistItem *>(*it++);
+ GenItem *item = *it++;
item->pop();
m_ItemsCache.push_back(item->getWeakPtr());
}
#include "Ui/GenItem.h"
#include "Ui/GenContainer.h"
+#include "Ui/GenGroupItem.h"
#include "Utils/Callback.h"
using namespace Ui;
struct Ui::GenItemApi
{
+ Elm_Object_Item *(*getParent)(const Elm_Object_Item *item);
Elm_Object_Item *(*getNext)(const Elm_Object_Item *item);
Elm_Object_Item *(*getPrev)(const Elm_Object_Item *item);
ScrollFunc bringIn;
namespace
{
const GenItemApi api[] = {
- { elm_genlist_item_next_get,
+ { elm_genlist_item_parent_get,
+ elm_genlist_item_next_get,
elm_genlist_item_prev_get,
(ScrollFunc) elm_genlist_item_bring_in,
(ScrollFunc) elm_genlist_item_show,
elm_genlist_item_selected_set },
- { elm_gengrid_item_next_get,
+ { [](const Elm_Object_Item *item) -> Elm_Object_Item * { return nullptr; },
+ elm_gengrid_item_next_get,
elm_gengrid_item_prev_get,
(ScrollFunc) elm_gengrid_item_bring_in,
(ScrollFunc) elm_gengrid_item_show,
}
GenItem::GenItem(GenContainer::Type type)
- : m_Item(nullptr), m_Preserve(false), m_IsRealized(false),
+ : m_Item(nullptr), m_Preserve(false), m_IsRealized(false), m_IsFocusPending(false),
m_Api(&api[type])
{
}
return m_Item;
}
+GenGroupItem *GenItem::getParentItem() const
+{
+ Elm_Object_Item *objectItem = m_Api->getParent(getObjectItem());
+ GenItem *item = (GenItem *) elm_object_item_data_get(objectItem);
+ return dynamic_cast<GenGroupItem *>(item);
+}
+
GenContainer *GenItem::getParent() const
{
Evas_Object *genlist = elm_object_item_widget_get(getObjectItem());
scroll(getObjectItem(), position);
}
+void GenItem::focus(Elm_Genlist_Item_Scrollto_Type position, bool isAnimated)
+{
+ scrollTo(position, isAnimated);
+ if (isRealized()) {
+ onFocused();
+ } else {
+ m_IsFocusPending = true;
+ }
+}
+
void GenItem::pop()
{
onPop();
}
m_IsRealized = true;
+ if (m_IsFocusPending) {
+ onFocused();
+ m_IsFocusPending = false;
+ }
+
onRealized();
}
*/
#include "Ui/Genlist.h"
-#include "Ui/GenlistGroupItem.h"
+#include "Ui/GenGroupItem.h"
using namespace Ui;
void Genlist::onItemExpanded(void *data, Evas_Object *obj, Elm_Object_Item *objectItem)
{
- GenlistItem *item = (GenlistItem *) elm_object_item_data_get(objectItem);
+ GenItem *item = (GenItem *) elm_object_item_data_get(objectItem);
if (item && item->isGroupItem()) {
- GenlistGroupItem *groupItem = dynamic_cast<GenlistGroupItem *>(item);
+ GenGroupItem *groupItem = dynamic_cast<GenGroupItem *>(item);
if (groupItem) {
groupItem->onExpanded(true);
}
void Genlist::onItemContracted(void *data, Evas_Object *obj, Elm_Object_Item *objectItem)
{
- GenlistItem *item = (GenlistItem *) elm_object_item_data_get(objectItem);
+ GenItem *item = (GenItem *) elm_object_item_data_get(objectItem);
if (item && item->isGroupItem()) {
- GenlistGroupItem *groupItem = dynamic_cast<GenlistGroupItem *>(item);
+ GenGroupItem *groupItem = dynamic_cast<GenGroupItem *>(item);
if (groupItem) {
groupItem->onExpanded(false);
}
+++ /dev/null
-/*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd All Rights Reserved
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * 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 "Ui/GenlistItem.h"
-#include "Ui/GenlistGroupItem.h"
-
-using namespace Ui;
-
-GenlistItem::GenlistItem()
- : GenItem(GenContainer::TypeGenlist), m_IsFocusPending(false)
-{
-}
-
-GenlistGroupItem *GenlistItem::getParentItem() const
-{
- Elm_Object_Item *objectItem = elm_genlist_item_parent_get(getObjectItem());
- GenlistItem *item = (GenlistItem *) elm_object_item_data_get(objectItem);
- return dynamic_cast<GenlistGroupItem *>(item);
-}
-
-void GenlistItem::focus(Elm_Genlist_Item_Scrollto_Type position, bool isAnimated)
-{
- scrollTo(position, isAnimated);
- if (isRealized()) {
- onFocused();
- } else {
- m_IsFocusPending = true;
- }
-}
-
-void GenlistItem::onRealized()
-{
- if (m_IsFocusPending) {
- onFocused();
- m_IsFocusPending = false;
- }
-}
Evas_Object *SelectAllItem::getContent(Evas_Object *parent, const char *part)
{
if (strcmp(part, "elm.swallow.end") == 0) {
- return GenlistCheckItem::getContent(parent, part);
+ return CheckItem::getContent(parent, part);
}
return nullptr;
Evas_Object *SelectItem::getContent(Evas_Object *parent, const char *part)
{
if (m_SelectMode == SelectMulti) {
- return GenlistCheckItem::getContent(parent, part);
+ return CheckItem::getContent(parent, part);
}
return nullptr;
m_SelectView->onItemSelected(this);
}
} else if (m_SelectMode == SelectMulti) {
- GenlistCheckItem::onSelected();
+ CheckItem::onSelected();
}
}
protected:
/**
- * @see GenlistItem::getContent()
+ * @see GenItem::getContent()
*/
virtual Evas_Object *getContent(Evas_Object *parent, const char *part) override;
/**
- * @see GenlistItem::onSelected()
+ * @see GenItem::onSelected()
*/
virtual void onSelected() override;
#ifndef CONTACTS_DETAILS_BASIC_INFO_ITEM_H
#define CONTACTS_DETAILS_BASIC_INFO_ITEM_H
-#include "Ui/GenlistItem.h"
+#include "Ui/GenItem.h"
#include "Ux/SelectTypes.h"
#include <contacts.h>
* @brief Genlist item displaying contact's image, name, phonetic name,
* company and favorite status.
*/
- class BasicInfoItem : public Ui::GenlistItem
+ class BasicInfoItem : public Ui::GenItem
{
public:
/**
protected:
/**
- * @see GenlistItem::getItemClass()
+ * @see GenItem::getItemClass()
*/
virtual Elm_Genlist_Item_Class *getItemClass() const override;
/**
- * @see GenlistItem::getText()
+ * @see GenItem::getText()
*/
virtual char *getText(Evas_Object *parent, const char *part) override;
/**
- * @see GenlistItem::getContent()
+ * @see GenItem::getContent()
*/
virtual Evas_Object *getContent(Evas_Object *parent, const char *part) override;
/**
- * @see GenlistItem::getState()
+ * @see GenItem::getState()
*/
virtual Eina_Bool getState(Evas_Object *parent, const char *part) override;
virtual void onCreated() override;
virtual void onMenuPressed() override;
- virtual void onSelectAllInsert(Ui::GenlistItem *item) override;
+ virtual void onSelectAllInsert(Ui::GenItem *item) override;
virtual void onSelectModeChanged(Ux::SelectMode selectMode) override;
FieldItem *createFieldItem(Model::ContactObject &field);
friend class DetailsView;
/**
- * @see GenlistItem::getItemClass()
+ * @see GenItem::getItemClass()
*/
virtual Elm_Genlist_Item_Class *getItemClass() const override;
/**
- * @see GenlistItem::getText()
+ * @see GenItem::getText()
*/
virtual char *getText(Evas_Object *parent, const char *part) override;
/**
- * @see GenlistCheckItem::getContent()
+ * @see GenItem::getContent()
*/
virtual Evas_Object *getContent(Evas_Object *parent, const char *part) override;
protected:
/**
- * @see GenlistItem::getText()
+ * @see GenItem::getText()
*/
virtual char *getText(Evas_Object *parent, const char *part) override;
protected:
/**
- * @see GenlistItem::getItemClass()
+ * @see GenItem::getItemClass()
*/
virtual Elm_Genlist_Item_Class *getItemClass() const override;
/**
- * @see GenlistItem::getText()
+ * @see GenItem::getText()
*/
virtual char *getText(Evas_Object *parent, const char *part) override;
protected:
/**
- * @see GenlistItem::getText()
+ * @see GenItem::getText()
*/
virtual char *getText(Evas_Object *parent, const char *part) override;
};
protected:
/**
- * @see GenlistItem::getText()
+ * @see GenItem::getText()
*/
virtual char *getText(Evas_Object *parent, const char *part) override;
#ifndef CONTACTS_GROUPS_ADD_MEMBERS_ITEM_H
#define CONTACTS_GROUPS_ADD_MEMBERS_ITEM_H
-#include "Ui/GenlistItem.h"
+#include "Ui/GenItem.h"
#include "Ux/SelectTypes.h"
#include <vector>
/**
* @brief Genlist item representing group's add members item
*/
- class AddMembersItem : public Ui::GenlistItem
+ class AddMembersItem : public Ui::GenItem
{
public:
/**
#ifndef CONTACTS_GROUPS_CREATE_GROUP_ITEM_H
#define CONTACTS_GROUPS_CREATE_GROUP_ITEM_H
-#include "Ui/GenlistItem.h"
+#include "Ui/GenItem.h"
namespace Contacts
{
/**
* @brief "Create Group" genlist item.
*/
- class CreateGroupItem : public Ui::GenlistItem
+ class CreateGroupItem : public Ui::GenItem
{
public:
/**
namespace Ui
{
class Genlist;
- class GenlistItem;
+ class GenItem;
}
namespace Contacts
private:
virtual Evas_Object *onCreate(Evas_Object *parent) override;
virtual void onMenuPressed() override;
- virtual void onSelectAllInsert(Ui::GenlistItem *item) override;
+ virtual void onSelectAllInsert(Ui::GenItem *item) override;
void updateCreateItem();
void onInserted(::Model::DataItem &data);
void insertItem(GroupItem *item);
void updateItem(GroupItem *item, int changes);
void deleteItem(GroupItem *item);
- Ui::GenlistItem *getNextItem(Model::Group &group);
+ Ui::GenItem *getNextItem(Model::Group &group);
Ui::Genlist *m_Genlist;
CreateGroupItem *m_CreateItem;
#ifndef CONTACTS_GROUPS_NAME_ITEM_H
#define CONTACTS_GROUPS_NAME_ITEM_H
-#include "Ui/GenlistItem.h"
+#include "Ui/GenItem.h"
#include <string>
{
namespace Groups
{
- class NameItem : public Ui::GenlistItem
+ class NameItem : public Ui::GenItem
{
public:
/**
#ifndef CONTACTS_GROUPS_RINGTONE_ITEM_H
#define CONTACTS_GROUPS_RINGTONE_ITEM_H
-#include "Ui/GenlistItem.h"
+#include "Ui/GenItem.h"
#include "App/AppControl.h"
/**
* @brief Genlist item representing group's ringtone item
*/
- class RingtoneItem : public Ui::GenlistItem
+ class RingtoneItem : public Ui::GenItem
{
public:
/**
#define CONTACTS_INPUT_ADD_FIELDS_ITEM_H
#include "Contacts/Model/ContactFields.h"
-#include "Ui/GenlistItem.h"
+#include "Ui/GenItem.h"
#include <functional>
namespace Contacts
/**
* @brief Genlist item with buttons for adding contact fields.
*/
- class AddFieldsItem : public Ui::GenlistItem
+ class AddFieldsItem : public Ui::GenItem
{
public:
/**
* @param[in] parent Parent genlist item
* @param[in] object Contact compound object
*/
- ContactCompoundFieldControl(Ui::GenlistItem *parent,
+ ContactCompoundFieldControl(Ui::GenItem *parent,
Model::ContactCompoundObject &object);
/**
protected:
/**
- * @see GenlistItem::getContent()
+ * @see GenItem::getContent()
*/
virtual Evas_Object *getContent(Evas_Object *parent, const char *part) override;
virtual void onInserted() override;
/**
- * @see GenlistItem::onExpanded()
+ * @see GenItem::onExpanded()
*/
virtual void onExpanded(bool isExpanded) override;
#define CONTACTS_INPUT_CONTACT_FIELD_ITEM_H
#include "Contacts/Input/ContactFieldSubItem.h"
-#include "Ui/GenlistGroupItem.h"
+#include "Ui/GenGroupItem.h"
#include <functional>
namespace Contacts
* @brief Genlist item representing ContactObject and its first field.
*/
class ContactFieldItem :
- public Ui::GenlistGroupItem,
+ public Ui::GenGroupItem,
public ContactFieldSubItem
{
public:
friend class ContactFieldSubItem;
/**
- * @see GenlistItem::getType()
+ * @see GenItem::getType()
*/
virtual Elm_Genlist_Item_Type getType() const override { return ELM_GENLIST_ITEM_TREE; }
/**
- * @see GenlistItem::getItemClass()
+ * @see GenItem::getItemClass()
*/
virtual Elm_Genlist_Item_Class *getItemClass() const override;
/**
- * @see GenlistItem::getContent()
+ * @see GenItem::getContent()
*/
virtual Evas_Object *getContent(Evas_Object *parent, const char *part) override;
/**
- * @see GenlistItem::onInserted()
+ * @see GenItem::onInserted()
*/
virtual void onInserted() override;
#ifndef CONTACTS_INPUT_CONTACT_FIELD_SUB_ITEM_H
#define CONTACTS_INPUT_CONTACT_FIELD_SUB_ITEM_H
-#include "Ui/GenlistItem.h"
+#include "Ui/GenItem.h"
namespace Ui
{
/**
* @brief Genlist item representing contact field of TypeText or TypeDate type.
*/
- class ContactFieldSubItem : virtual public Ui::GenlistItem
+ class ContactFieldSubItem : virtual public Ui::GenItem
{
public:
/**
Ui::Control *getFieldControl() const;
/**
- * @see GenlistItem::isFocusable()
+ * @see GenItem::isFocusable()
*/
virtual bool isFocusable() const override;
protected:
/**
- * @see GenlistItem::getItemClass()
+ * @see GenItem::getItemClass()
*/
virtual Elm_Genlist_Item_Class *getItemClass() const override;
/**
- * @see GenlistItem::getContent()
+ * @see GenItem::getContent()
*/
virtual Evas_Object *getContent(Evas_Object *parent, const char *part) override;
/**
- * @see GenlistItem::getState()
+ * @see GenItem::getState()
*/
virtual Eina_Bool getState(Evas_Object *parent, const char *part) override;
/**
- * @see GenlistItem::onInserted()
+ * @see GenItem::onInserted()
*/
virtual void onInserted() override;
/**
- * @see GenlistItem::onFocused()
+ * @see GenItem::onFocused()
*/
virtual void onFocused() override;
ContactGroupsFieldItem(Model::ContactObject &object);
/**
- * @see GenlistItem::isFocusable()
+ * @see GenItem::isFocusable()
*/
virtual bool isFocusable() const override;
using ContactFieldItem::ContactFieldItem;
/**
- * @see GenlistItem::isFocusable()
+ * @see GenItem::isFocusable()
*/
virtual bool isFocusable() const override;
namespace Ui
{
- class GenlistItem;
+ class GenItem;
}
namespace Contacts
* @param[in] parent Parent genlist item
* @param[in] field Contact text field to edit
*/
- ContactTextFieldControl(Ui::GenlistItem *parent,
+ ContactTextFieldControl(Ui::GenItem *parent,
Model::ContactTextField &field);
virtual ~ContactTextFieldControl() override;
private:
virtual void onCreated() override;
- static Ui::GenlistItem *findNextItem(Ui::GenlistItem *item);
- void setNextItem(Ui::GenlistItem *item);
+ static Ui::GenItem *findNextItem(Ui::GenItem *item);
+ void setNextItem(Ui::GenItem *item);
void unsetNextItem();
void onChanged(Evas_Object *entry, void *eventInfo);
void onUnfocused(Evas_Object *entry, void *eventInfo);
void onActivated(Evas_Object *entry, void *eventInfo);
- Ui::GenlistItem *m_ParentItem;
- Ui::GenlistItem *m_NextItem;
+ Ui::GenItem *m_ParentItem;
+ Ui::GenItem *m_NextItem;
Model::ContactTextField &m_Field;
bool m_IsEmpty;
const Model::ContactTypedObject &getTypedObject() const;
/**
- * @see GenlistItem::getContent()
+ * @see GenItem::getContent()
*/
virtual Evas_Object *getContent(Evas_Object *parent, const char *part) override;
/**
- * @see GenlistItem::getState()
+ * @see GenItem::getState()
*/
virtual Eina_Bool getState(Evas_Object *parent, const char *part) override;
namespace Ui
{
class Genlist;
- class GenlistItem;
+ class GenItem;
}
namespace Contacts
virtual bool onBackPressed() override;
ContactFieldItem *createFieldItem(Model::ContactObject &field);
- Ui::GenlistItem *getNextFieldItem(Model::ContactFieldId fieldId);
+ Ui::GenItem *getNextFieldItem(Model::ContactFieldId fieldId);
Model::ContactObject &addField(Model::ContactFieldId fieldId);
void removeField(Model::ContactObject &field);
#ifndef CONTACTS_LIST_LIST_SECTION_H
#define CONTACTS_LIST_LIST_SECTION_H
-#include "Ui/GenlistGroupItem.h"
+#include "Ui/GenGroupItem.h"
#include "Common/DataTypes.h"
namespace Model
/**
* @brief Represents list section containing genlist items.
*/
- class ListSection : public Ui::GenlistGroupItem
+ class ListSection : public Ui::GenGroupItem
{
public:
enum SectionMode {
namespace Ui
{
class Genlist;
- class GenlistGroupItem;
+ class GenGroupItem;
}
namespace Contacts
private:
struct Section
{
- Ui::GenlistGroupItem *m_Item = nullptr;
+ Ui::GenGroupItem *m_Item = nullptr;
bool m_IsVisible = true;
};
bool onSelectFinished();
void onManageFavoritesSelected();
- virtual void onSelectAllInsert(Ui::GenlistItem *item) override;
+ virtual void onSelectAllInsert(Ui::GenItem *item) override;
virtual void onSelectModeChanged(Ux::SelectMode selectMode) override;
void setState(State state, bool isEnabled);
- Ui::GenlistGroupItem *createMyProfileSection();
- Ui::GenlistGroupItem *createListSection(SectionId sectionId);
+ Ui::GenGroupItem *createMyProfileSection();
+ Ui::GenGroupItem *createListSection(SectionId sectionId);
void fillPersonList();
Ui::Genlist *createGenlist(Evas_Object *parent);
void updateEmptyLayout();
void updateEmptyState();
- Ui::GenlistGroupItem *createSection(SectionId sectionId);
- void insertSection(Ui::GenlistGroupItem *section, SectionId sectionId);
+ Ui::GenGroupItem *createSection(SectionId sectionId);
+ void insertSection(Ui::GenGroupItem *section, SectionId sectionId);
void updateSection(SectionId sectionId);
void updateSections();
- Ui::GenlistItem *getNextSectionItem(SectionId sectionId);
+ Ui::GenItem *getNextSectionItem(SectionId sectionId);
bool getSectionVisibility(SectionId sectionId);
SearchItem *createSearchItem();
#ifndef CONTACTS_LIST_MY_PROFILE_GROUP_H
#define CONTACTS_LIST_MY_PROFILE_GROUP_H
-#include "Ui/GenlistGroupItem.h"
+#include "Ui/GenGroupItem.h"
namespace Contacts
{
/**
* @brief Represents the group containing "My Profile" genlist item.
*/
- class MyProfileGroup : public Ui::GenlistGroupItem
+ class MyProfileGroup : public Ui::GenGroupItem
{
public:
MyProfileGroup();
#ifndef CONTACTS_LIST_PERSON_GROUP_ITEM_H
#define CONTACTS_LIST_PERSON_GROUP_ITEM_H
-#include "Ui/GenlistGroupItem.h"
+#include "Ui/GenGroupItem.h"
#include "Utils/UniString.h"
#include <string>
/**
* @brief Person alphabet group item
*/
- class PersonGroupItem : public Ui::GenlistGroupItem
+ class PersonGroupItem : public Ui::GenGroupItem
{
public:
/**
namespace Ui
{
class Genlist;
- class GenlistGroupItem;
+ class GenGroupItem;
}
namespace Contacts
virtual Evas_Object *onCreate(Evas_Object *parent) override;
virtual void onDestroy() override;
- virtual void onSelectAllInsert(Ui::GenlistItem *item) override;
+ virtual void onSelectAllInsert(Ui::GenItem *item) override;
- Ui::GenlistGroupItem *createListSection(SectionId sectionId);
+ Ui::GenGroupItem *createListSection(SectionId sectionId);
void createSections();
- void insertSection(Ui::GenlistGroupItem *section, SectionId sectionId);
+ void insertSection(Ui::GenGroupItem *section, SectionId sectionId);
void updateSection(SectionId sectionId);
void updateSections();
- Ui::GenlistItem *getNextSectionItem(SectionId sectionId);
+ Ui::GenItem *getNextSectionItem(SectionId sectionId);
void onSectionUpdated(ContactItem *item, ::Common::ChangeType change, SectionId sectionId);
Ui::Genlist *m_Genlist;
- Ui::GenlistGroupItem *m_Sections[SectionMax];
+ Ui::GenGroupItem *m_Sections[SectionMax];
};
}
}
Evas_Object *m_CancelButton;
Evas_Object *m_DoneButton;
Ui::Genlist *m_Genlist;
- Ui::GenlistItem *m_Section;
+ Ui::GenItem *m_Section;
std::vector<ReorderData> m_ReorderDatas;
ReorderItemCallback m_OnItemReordered;
};
#ifndef CONTACTS_LIST_CONTACT_SEARCH_ITEM_H
#define CONTACTS_LIST_CONTACT_SEARCH_ITEM_H
-#include "Ui/GenlistItem.h"
+#include "Ui/GenItem.h"
#include <string>
namespace Contacts
/**
* @brief Contact search item
*/
- class SearchItem : public Ui::GenlistItem
+ class SearchItem : public Ui::GenItem
{
public:
/**
private:
virtual Evas_Object *onCreate(Evas_Object *parent) override;
- virtual void onSelectAllInsert(Ui::GenlistItem *item) override;
+ virtual void onSelectAllInsert(Ui::GenItem *item) override;
bool onSelectResult(Ux::SelectResults results);
void onImportFinished(Settings::ImportController *importer);
#define CONTACTS_SETTINGS_EXPORT_ITEM_H
#include "App/AppControl.h"
-#include "Ui/GenlistItem.h"
+#include "Ui/GenItem.h"
namespace Contacts
{
/**
* @brief Export item
*/
- class ExportItem : public Ui::GenlistItem
+ class ExportItem : public Ui::GenItem
{
private:
virtual char *getText(Evas_Object *parent, const char *part) override;
#define CONTACTS_SETTINGS_IMPORT_ITEM_H
#include "App/AppControl.h"
-#include "Ui/GenlistItem.h"
+#include "Ui/GenItem.h"
namespace Contacts
{
/**
* @brief Import item
*/
- class ImportItem : public Ui::GenlistItem
+ class ImportItem : public Ui::GenItem
{
private:
virtual char *getText(Evas_Object *parent, const char *part) override;
#ifndef CONTACTS_SETTINGS_NAME_FORMAT_ITEM_H
#define CONTACTS_SETTINGS_NAME_FORMAT_ITEM_H
-#include "Ui/GenlistItem.h"
+#include "Ui/GenItem.h"
#include <contacts_setting.h>
namespace Contacts
/**
* @brief Name format item
*/
- class NameFormatItem : public Ui::GenlistItem
+ class NameFormatItem : public Ui::GenItem
{
public:
NameFormatItem();
#ifndef CONTACTS_SETTINGS_SORT_BY_ITEM_H
#define CONTACTS_SETTINGS_SORT_BY_ITEM_H
-#include "Ui/GenlistItem.h"
+#include "Ui/GenItem.h"
#include <contacts_setting.h>
namespace Contacts
/**
* @brief SortBy item
*/
- class SortByItem : public Ui::GenlistItem
+ class SortByItem : public Ui::GenItem
{
public:
SortByItem();
menu->show();
}
-void DetailsView::onSelectAllInsert(Ui::GenlistItem *item)
+void DetailsView::onSelectAllInsert(Ui::GenItem *item)
{
m_Genlist->insert(item, nullptr, m_BasicInfoItem, Ui::Genlist::After);
}
{
if (getSelectMode() == Ux::SelectMulti) {
if (strcmp(part, "elm.swallow.end") == 0) {
- return GenlistCheckItem::getContent(parent, part);
+ return CheckItem::getContent(parent, part);
}
}
menu->show();
}
-void GroupsView::onSelectAllInsert(Ui::GenlistItem *item)
+void GroupsView::onSelectAllInsert(Ui::GenItem *item)
{
m_Genlist->insert(item, nullptr, nullptr, Ui::Genlist::After);
}
delete item;
}
-Ui::GenlistItem *GroupsView::getNextItem(Group &group)
+Ui::GenItem *GroupsView::getNextItem(Group &group)
{
for (auto &&item : getSelectItems()) {
GroupItem *groupItem = static_cast<GroupItem *>(item);
using namespace Contacts::Input;
using namespace Contacts::Model;
-ContactCompoundFieldControl::ContactCompoundFieldControl(Ui::GenlistItem *parent,
+ContactCompoundFieldControl::ContactCompoundFieldControl(Ui::GenItem *parent,
ContactCompoundObject &object)
: ContactTextFieldControl(parent, *object.getField<ContactTextField>(0)),
m_Object(object), m_IsCompoundMode(true)
auto control = static_cast<ContactCompoundFieldControl *>(getFieldControl());
control->save();
- GenlistGroupItem::onExpanded(isExpanded);
+ GenGroupItem::onExpanded(isExpanded);
updateExpandIcon(isExpanded);
control->setCompoundMode(!isExpanded);
#include "Contacts/Model/ContactTextField.h"
#include "Contacts/Common/Strings.h"
-#include "Ui/GenlistItem.h"
+#include "Ui/GenItem.h"
#include "Utils/Callback.h"
#include "Utils/Range.h"
};
}
-ContactTextFieldControl::ContactTextFieldControl(Ui::GenlistItem *parent,
+ContactTextFieldControl::ContactTextFieldControl(Ui::GenItem *parent,
Model::ContactTextField &field)
: m_ParentItem(parent), m_NextItem(nullptr), m_Field(field),
m_IsEmpty(true), m_IsChanged(false), m_IsUpdating(false)
update();
}
-Ui::GenlistItem *ContactTextFieldControl::findNextItem(Ui::GenlistItem *item)
+Ui::GenItem *ContactTextFieldControl::findNextItem(Ui::GenItem *item)
{
- while ((item = (Ui::GenlistItem *) item->getNextItem())) {
+ while ((item = (Ui::GenItem *) item->getNextItem())) {
if (item->isFocusable()) {
return item;
}
return nullptr;
}
-void ContactTextFieldControl::setNextItem(Ui::GenlistItem *item)
+void ContactTextFieldControl::setNextItem(Ui::GenItem *item)
{
unsetNextItem();
if (!item) {
return item;
}
-Ui::GenlistItem *InputView::getNextFieldItem(ContactFieldId fieldId)
+Ui::GenItem *InputView::getNextFieldItem(ContactFieldId fieldId)
{
for (unsigned id = fieldId + 1; id < Utils::count(m_Items); ++id) {
if (m_Items[id]) {
manageFavPopup->create(getEvasObject());
}
-void ListView::onSelectAllInsert(Ui::GenlistItem *item)
+void ListView::onSelectAllInsert(Ui::GenItem *item)
{
m_Genlist->insert(item, nullptr, m_SearchItem, Ui::Genlist::After);
}
}
}
-Ui::GenlistGroupItem *ListView::createMyProfileSection()
+Ui::GenGroupItem *ListView::createMyProfileSection()
{
MyProfileGroup *section = new MyProfileGroup();
insertSection(section, SectionMyProfile);
return section;
}
-Ui::GenlistGroupItem *ListView::createListSection(SectionId sectionId)
+Ui::GenGroupItem *ListView::createListSection(SectionId sectionId)
{
const char *title = nullptr;
PersonProvider *provider = nullptr;
m_IsEmpty = isEmpty;
}
-Ui::GenlistGroupItem *ListView::createSection(SectionId sectionId)
+Ui::GenGroupItem *ListView::createSection(SectionId sectionId)
{
- Ui::GenlistGroupItem *section = nullptr;
+ Ui::GenGroupItem *section = nullptr;
switch (sectionId) {
case SectionMyProfile:
section = createMyProfileSection();
return section;
}
-void ListView::insertSection(Ui::GenlistGroupItem *section, SectionId sectionId)
+void ListView::insertSection(Ui::GenGroupItem *section, SectionId sectionId)
{
m_Genlist->insert(section, nullptr, getNextSectionItem(sectionId));
elm_genlist_item_select_mode_set(section->getObjectItem(), ELM_OBJECT_SELECT_MODE_NONE);
void ListView::updateSection(SectionId sectionId)
{
- Ui::GenlistGroupItem *section = m_Sections[sectionId].m_Item;
+ Ui::GenGroupItem *section = m_Sections[sectionId].m_Item;
if (!section) {
if (getSectionVisibility(sectionId)) {
createSection(sectionId);
}
}
-Ui::GenlistItem *ListView::getNextSectionItem(SectionId sectionId)
+Ui::GenItem *ListView::getNextSectionItem(SectionId sectionId)
{
for (unsigned section = sectionId + 1; section < SectionMax; ++section) {
if (m_Sections[section].m_Item && m_Sections[section].m_Item->isInserted()) {
elm_genlist_item_select_mode_set(item->getObjectItem(), ELM_OBJECT_SELECT_MODE_NONE);
Elm_Object_Item *indexItem = insertIndexItem(SYMBOL_MAGNIFIER, nullptr);
- elm_object_item_data_set(indexItem, static_cast<Ui::GenlistItem *>(item));
+ elm_object_item_data_set(indexItem, static_cast<Ui::GenItem *>(item));
return item;
}
void ListView::onIndexChanged(Evas_Object *index, Elm_Object_Item *indexItem)
{
- Ui::GenlistItem *item = (Ui::GenlistItem *) elm_object_item_data_get(indexItem);
+ Ui::GenItem *item = (Ui::GenItem *) elm_object_item_data_get(indexItem);
item->scrollTo(ELM_GENLIST_ITEM_SCROLLTO_TOP);
}
void PersonGroupItem::setIndexItem(Elm_Object_Item *item)
{
m_IndexItem = item;
- elm_object_item_data_set(m_IndexItem, static_cast<GenlistItem *>(this));
+ elm_object_item_data_set(m_IndexItem, static_cast<GenItem *>(this));
}
char *PersonGroupItem::getText(Evas_Object *parent, const char *part)
}
}
-void RemoveFavView::onSelectAllInsert(Ui::GenlistItem *item)
+void RemoveFavView::onSelectAllInsert(Ui::GenItem *item)
{
m_Genlist->insert(item, nullptr, nullptr, Ui::Genlist::After);
}
-Ui::GenlistGroupItem *RemoveFavView::createListSection(SectionId sectionId)
+Ui::GenGroupItem *RemoveFavView::createListSection(SectionId sectionId)
{
const char *title = nullptr;
PersonProvider *provider = nullptr;
}
}
-void RemoveFavView::insertSection(Ui::GenlistGroupItem *section, SectionId sectionId)
+void RemoveFavView::insertSection(Ui::GenGroupItem *section, SectionId sectionId)
{
m_Genlist->insert(section, nullptr, getNextSectionItem(sectionId));
elm_genlist_item_select_mode_set(section->getObjectItem(), ELM_OBJECT_SELECT_MODE_NONE);
void RemoveFavView::updateSection(SectionId sectionId)
{
- Ui::GenlistGroupItem *section = m_Sections[sectionId];
+ Ui::GenGroupItem *section = m_Sections[sectionId];
if (!section->isEmpty()) {
if (!section->isInserted()) {
}
}
-Ui::GenlistItem *RemoveFavView::getNextSectionItem(SectionId sectionId)
+Ui::GenItem *RemoveFavView::getNextSectionItem(SectionId sectionId)
{
for (unsigned section = sectionId + 1; section < SectionMax; ++section) {
if (m_Sections[section] && m_Sections[section]->isInserted()) {
#include "Contacts/List/ReorderView.h"
#include "Contacts/Model/ContactData.h"
+#include "Ui/Genlist.h"
#include "Utils/Callback.h"
#include "Utils/Logger.h"
return m_Genlist->getEvasObject();
}
-void VcardView::onSelectAllInsert(Ui::GenlistItem *item)
+void VcardView::onSelectAllInsert(Ui::GenItem *item)
{
m_Genlist->insert(item, nullptr, nullptr, Ui::Genlist::After);
}
#define LOGS_DETAILS_ACTION_ITEM_H
#include "Logs/Model/LogGroup.h"
-#include "Ui/GenlistItem.h"
+#include "Ui/GenItem.h"
#include "Common/Actions.h"
namespace Logs
* @brief Genlist item representing a item which value can be used to
* initiate some external action.
*/
- class ActionItem : public Ui::GenlistItem
+ class ActionItem : public Ui::GenItem
{
public:
/**
protected:
/**
- * @see GenlistItem::getItemClass()
+ * @see GenItem::getItemClass()
*/
virtual Elm_Genlist_Item_Class *getItemClass() const override;
/**
- * @see GenlistItem::getText()
+ * @see GenItem::getText()
*/
virtual char *getText(Evas_Object *parent, const char *part) override;
/**
- * @see GenlistItem::getContent()
+ * @see GenItem::getContent()
*/
virtual Evas_Object *getContent(Evas_Object *parent, const char *part) override;
/**
- * @see GenlistItem::onSelected()
+ * @see GenItem::onSelected()
*/
virtual void onSelected() override;
#ifndef LOGS_DETAILS_BASIC_INFO_ITEM_H
#define LOGS_DETAILS_BASIC_INFO_ITEM_H
-#include "Ui/GenlistItem.h"
+#include "Ui/GenItem.h"
#include "App/AppControl.h"
#include "Logs/Model/LogGroup.h"
/**
* @brief Genlist item displaying contact's image, name.
*/
- class BasicInfoItem : public Ui::GenlistItem
+ class BasicInfoItem : public Ui::GenItem
{
public:
/**
protected:
/**
- * @see GenlistItem::getItemClass()
+ * @see GenItem::getItemClass()
*/
virtual Elm_Genlist_Item_Class *getItemClass() const override;
/**
- * @see GenlistItem::getText()
+ * @see GenItem::getText()
*/
virtual char *getText(Evas_Object *parent, const char *part) override;
/**
- * @see GenlistItem::getContent()
+ * @see GenItem::getContent()
*/
virtual Evas_Object *getContent(Evas_Object *parent, const char *part) override;
/**
- * @see GenlistItem::getState()
+ * @see GenItem::getState()
*/
virtual Eina_Bool getState(Evas_Object *parent, const char *part) override;
/**
- * @see GenlistItem::onSelected()
+ * @see GenItem::onSelected()
*/
virtual void onSelected() override;
virtual void onMenuPressed() override;
virtual void onSelectModeChanged(Ux::SelectMode selectMode) override;
- virtual void onSelectAllInsert(Ui::GenlistItem *item) override;
+ virtual void onSelectAllInsert(Ui::GenItem *item) override;
void fillGenList();
void insertBasicInfoItem();
#ifndef LOGS_LIST_LOG_GROUP_ITEM_H
#define LOGS_LIST_LOG_GROUP_ITEM_H
-#include "Ui/GenlistGroupItem.h"
+#include "Ui/GenGroupItem.h"
#include <time.h>
namespace Logs
/**
* @brief Group log item object
*/
- class LogGroupItem : public Ui::GenlistGroupItem
+ class LogGroupItem : public Ui::GenGroupItem
{
public:
/**
virtual void onCreated() override;
virtual void onNavigation(bool isCurrentView) override;
virtual void onMenuPressed() override;
- virtual void onSelectAllInsert(Ui::GenlistItem *item) override;
+ virtual void onSelectAllInsert(Ui::GenItem *item) override;
void fillLayout();
void updateLayout(bool isEmpty);
}
}
-void DetailsView::onSelectAllInsert(Ui::GenlistItem *item)
+void DetailsView::onSelectAllInsert(Ui::GenItem *item)
{
m_Genlist->insert(item, nullptr, nullptr, Ui::Genlist::After);
}
{
if (!m_LastGroupItem) {
for (auto &&item : *m_Genlist) {
- if (((Ui::GenlistItem *)item)->isGroupItem()) {
+ if (((Ui::GenItem *)item)->isGroupItem()) {
setLastGroupItem(dynamic_cast<LogGroupItem *>(item));
break;
}
menu->show();
}
-void LogsView::onSelectAllInsert(Ui::GenlistItem *item)
+void LogsView::onSelectAllInsert(Ui::GenItem *item)
{
m_Genlist->insert(item, nullptr, nullptr, Ui::Genlist::After);
}
{
if (!m_LastGroupItem) {
for (auto &&item : *m_Genlist) {
- auto genlistItem = static_cast<Ui::GenlistItem *>(item);
- if (genlistItem->isGroupItem()) {
- setLastGroupItem(dynamic_cast<LogGroupItem *>(genlistItem));
+ if (item->isGroupItem()) {
+ setLastGroupItem(dynamic_cast<LogGroupItem *>(item));
break;
}
}
void LogsView::onLogItemDelete(LogItem *item)
{
- Ui::GenlistGroupItem *groupItem = item->getParentItem();
+ Ui::GenGroupItem *groupItem = item->getParentItem();
removeSelectItem(item);
delete item;