[elm_gengrid] Added elm_gengrid_item_update API
authorjh0506.yun <jh0506.yun@samsung.com>
Mon, 20 Sep 2010 00:54:18 +0000 (09:54 +0900)
committerjh0506.yun <jh0506.yun@samsung.com>
Mon, 20 Sep 2010 00:54:18 +0000 (09:54 +0900)
src/lib/Elementary.h.in
src/lib/elm_gengrid.c

index 376bd2d..ef6e094 100755 (executable)
@@ -646,6 +646,7 @@ extern "C" {
    EAPI void         elm_gengrid_item_disabled_set(Elm_Gengrid_Item *item, Eina_Bool disabled);
    EAPI Eina_Bool    elm_gengrid_item_disabled_get(const Elm_Gengrid_Item *item);
    EAPI Elm_Gengrid_Item *elm_gengrid_item_append(Evas_Object *obj, const Elm_Gengrid_Item_Class *gcc,  const void *data, Evas_Smart_Cb func, const void *func_data);
+   EAPI void         elm_gengrid_item_update(Elm_Gengrid_Item *it);
    /* smart callbacks called:
     *
     * selected - User has selected a item.
index ee144f6..796c4cf 100644 (file)
@@ -1600,3 +1600,29 @@ elm_gengrid_items_get(const Evas_Object *obj)
    if (!wd) return NULL;
    return wd->items;
 }
+
+/**
+ * Update the contents of an item
+ * 
+ * This updates an item by calling all the item class functions again to get
+ * the icons, labels and states. Use this when he original item data has
+ * changed and the changes are desired to be reflected.
+ * 
+ * @param it The item
+ * 
+ * @ingroup Gengrid
+ */
+EAPI void
+elm_gengrid_item_update(Elm_Gengrid_Item *item)
+{
+   if (item->realized)
+   {
+      _item_unrealize(item);
+      _item_realize(item);
+      evas_object_smart_callback_call(item->wd->self, "realized", it);
+
+      if (item->wd->calc_job) ecore_job_del(item->wd->calc_job);
+         item->wd->calc_job = ecore_job_add(_calc_job, item->wd);
+   }
+}
+