From: Hyoyoung Chang <hyoyoung@gmail.com>
authorraster <raster@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Tue, 14 Feb 2012 02:51:40 +0000 (02:51 +0000)
committerraster <raster@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Tue, 14 Feb 2012 02:51:40 +0000 (02:51 +0000)
Subject: [E-devel] [patch] elm_genlist - add a getting item flag
function

Sometimes it is needed to get genlist item's type.
It will help to get item's type.

git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/elementary@67890 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

src/lib/elm_genlist.c
src/lib/elm_genlist.h

index b3f8bc0..b36e4cf 100644 (file)
@@ -5323,6 +5323,14 @@ elm_genlist_reorder_mode_get(const Evas_Object *obj)
    return wd->reorder_mode;
 }
 
+EAPI Elm_Genlist_Item_Flags
+elm_genlist_item_flags_get(const Elm_Object_Item *it)
+{
+   ELM_OBJ_ITEM_CHECK_OR_RETURN(it, ELM_GENLIST_ITEM_MAX);
+   Elm_Gen_Item *_it = (Elm_Gen_Item *) it;
+   return _it->item->flags;
+}
+
 /* for gengrid as of now */
 void
 _elm_genlist_page_relative_set(Evas_Object *obj,
index 7854893..384e195 100644 (file)
@@ -351,7 +351,9 @@ typedef enum
 {
    ELM_GENLIST_ITEM_NONE = 0, /**< simple item */
    ELM_GENLIST_ITEM_SUBITEMS = (1 << 0), /**< may expand and have child items */
-   ELM_GENLIST_ITEM_GROUP = (1 << 1) /**< index of a group of items */
+   ELM_GENLIST_ITEM_GROUP = (1 << 1), /**< index of a group of items */
+
+   ELM_GENLIST_ITEM_MAX = (1 << 2)
 } Elm_Genlist_Item_Flags;
 
 typedef enum
@@ -1832,5 +1834,18 @@ EAPI void                          elm_genlist_reorder_mode_set(Evas_Object *obj
 EAPI Eina_Bool                     elm_genlist_reorder_mode_get(const Evas_Object *obj);
 
 /**
+ * Get the Item's Flags
+ *
+ * @param item The genlist item
+ * @return The item flags.
+ *
+ * This function returns the item's type. Normally the item's type.
+ * If it failed, return value is ELM_GENLIST_ITEM_MAX
+ *
+ * @ingroup Genlist
+ */
+EAPI Elm_Genlist_Item_Flags        elm_genlist_item_flags_get(const Elm_Object_Item *it);
+
+/**
  * @}
  */