use version as an actual version and bring back macros for setting up
[framework/uifw/elementary.git] / src / lib / elm_genlist.h
index b941c6b..b9e5661 100644 (file)
  *
  * @ingroup Genlist
  */
-//XXX: Elm_Genlist_Item_Type
  typedef enum
 {
    ELM_GENLIST_ITEM_NONE = 0, /**< simple item */
    ELM_GENLIST_ITEM_GROUP = (1 << 1), /**< index of a group of items */
 
    ELM_GENLIST_ITEM_MAX = (1 << 2)
-} Elm_Genlist_Item_Flags;
+} Elm_Genlist_Item_Type;
 
-//XXX: Elm_Genlist_Item_Field_Type
 typedef enum
 {
    ELM_GENLIST_ITEM_FIELD_ALL = 0,
    ELM_GENLIST_ITEM_FIELD_TEXT = (1 << 0),
    ELM_GENLIST_ITEM_FIELD_CONTENT = (1 << 1),
    ELM_GENLIST_ITEM_FIELD_STATE = (1 << 2)
-} Elm_Genlist_Item_Field_Flags;
+} Elm_Genlist_Item_Field_Type;
 typedef struct _Elm_Genlist_Item_Class      Elm_Genlist_Item_Class; /**< Genlist item class definition structs */
 
 #define Elm_Genlist_Item_Class Elm_Gen_Item_Class
@@ -625,7 +623,7 @@ EAPI void                          elm_genlist_bounce_get(const Evas_Object *obj
  * @param itc The item class for the item
  * @param data The item data
  * @param parent The parent item, or NULL if none
- * @param flags Item flags
+ * @param type Item type
  * @param func Convenience function called when the item is selected
  * @param func_data Data passed to @p func above.
  * @return A handle to the item added or @c NULL if not possible
@@ -640,7 +638,7 @@ EAPI void                          elm_genlist_bounce_get(const Evas_Object *obj
  *
  * @ingroup Genlist
  */
-EAPI Elm_Object_Item             *elm_genlist_item_append(Evas_Object *obj, const Elm_Genlist_Item_Class *itc, const void *data, Elm_Object_Item *parent, Elm_Genlist_Item_Flags flags, Evas_Smart_Cb func, const void *func_data);
+EAPI Elm_Object_Item             *elm_genlist_item_append(Evas_Object *obj, const Elm_Genlist_Item_Class *itc, const void *data, Elm_Object_Item *parent, Elm_Genlist_Item_Type type, Evas_Smart_Cb func, const void *func_data);
 
 /**
  * Prepend a new item in a given genlist widget.
@@ -649,7 +647,7 @@ EAPI Elm_Object_Item             *elm_genlist_item_append(Evas_Object *obj, cons
  * @param itc The item class for the item
  * @param data The item data
  * @param parent The parent item, or NULL if none
- * @param flags Item flags
+ * @param type Item type
  * @param func Convenience function called when the item is selected
  * @param func_data Data passed to @p func above.
  * @return A handle to the item added or NULL if not possible
@@ -664,7 +662,7 @@ EAPI Elm_Object_Item             *elm_genlist_item_append(Evas_Object *obj, cons
  *
  * @ingroup Genlist
  */
-EAPI Elm_Object_Item             *elm_genlist_item_prepend(Evas_Object *obj, const Elm_Genlist_Item_Class *itc, const void *data, Elm_Object_Item *parent, Elm_Genlist_Item_Flags flags, Evas_Smart_Cb func, const void *func_data);
+EAPI Elm_Object_Item             *elm_genlist_item_prepend(Evas_Object *obj, const Elm_Genlist_Item_Class *itc, const void *data, Elm_Object_Item *parent, Elm_Genlist_Item_Type type, Evas_Smart_Cb func, const void *func_data);
 
 /**
  * Insert an item before another in a genlist widget
@@ -674,7 +672,7 @@ EAPI Elm_Object_Item             *elm_genlist_item_prepend(Evas_Object *obj, con
  * @param data The item data
  * @param parent The parent item, or NULL if none
  * @param before The item to place this new one before.
- * @param flags Item flags
+ * @param type Item type
  * @param func Convenience function called when the item is selected
  * @param func_data Data passed to @p func above.
  * @return A handle to the item added or @c NULL if not possible
@@ -689,7 +687,7 @@ EAPI Elm_Object_Item             *elm_genlist_item_prepend(Evas_Object *obj, con
  *
  * @ingroup Genlist
  */
-EAPI Elm_Object_Item             *elm_genlist_item_insert_before(Evas_Object *obj, const Elm_Genlist_Item_Class *itc, const void *data, Elm_Object_Item *parent, Elm_Object_Item *before, Elm_Genlist_Item_Flags flags, Evas_Smart_Cb func, const void *func_data);
+EAPI Elm_Object_Item             *elm_genlist_item_insert_before(Evas_Object *obj, const Elm_Genlist_Item_Class *itc, const void *data, Elm_Object_Item *parent, Elm_Object_Item *before, Elm_Genlist_Item_Type type, Evas_Smart_Cb func, const void *func_data);
 
 /**
  * Insert an item after another in a genlist widget
@@ -699,7 +697,7 @@ EAPI Elm_Object_Item             *elm_genlist_item_insert_before(Evas_Object *ob
  * @param data The item data
  * @param parent The parent item, or NULL if none
  * @param after The item to place this new one after.
- * @param flags Item flags
+ * @param type Item type
  * @param func Convenience function called when the item is selected
  * @param func_data Data passed to @p func above.
  * @return A handle to the item added or @c NULL if not possible
@@ -714,7 +712,7 @@ EAPI Elm_Object_Item             *elm_genlist_item_insert_before(Evas_Object *ob
  *
  * @ingroup Genlist
  */
-EAPI Elm_Object_Item             *elm_genlist_item_insert_after(Evas_Object *obj, const Elm_Genlist_Item_Class *itc, const void *data, Elm_Object_Item *parent, Elm_Object_Item *after, Elm_Genlist_Item_Flags flags, Evas_Smart_Cb func, const void *func_data);
+EAPI Elm_Object_Item             *elm_genlist_item_insert_after(Evas_Object *obj, const Elm_Genlist_Item_Class *itc, const void *data, Elm_Object_Item *parent, Elm_Object_Item *after, Elm_Genlist_Item_Type type, Evas_Smart_Cb func, const void *func_data);
 
 /**
  * Insert a new item into the sorted genlist object
@@ -723,7 +721,7 @@ EAPI Elm_Object_Item             *elm_genlist_item_insert_after(Evas_Object *obj
  * @param itc The item class for the item
  * @param data The item data
  * @param parent The parent item, or NULL if none
- * @param flags Item flags
+ * @param type Item type
  * @param comp The function called for the sort
  * @param func Convenience function called when item selected
  * @param func_data Data passed to @p func above.
@@ -740,7 +738,7 @@ EAPI Elm_Object_Item             *elm_genlist_item_insert_after(Evas_Object *obj
 
  * @ingroup Genlist
  */
-EAPI Elm_Object_Item             *elm_genlist_item_sorted_insert(Evas_Object *obj, const Elm_Genlist_Item_Class *itc, const void *data, Elm_Object_Item *parent, Elm_Genlist_Item_Flags flags, Eina_Compare_Cb comp, Evas_Smart_Cb func, const void *func_data);
+EAPI Elm_Object_Item             *elm_genlist_item_sorted_insert(Evas_Object *obj, const Elm_Genlist_Item_Class *itc, const void *data, Elm_Object_Item *parent, Elm_Genlist_Item_Type type, Eina_Compare_Cb comp, Evas_Smart_Cb func, const void *func_data);
 
 /* operations to retrieve existing items */
 /**
@@ -1124,6 +1122,7 @@ EAPI void                          elm_genlist_realized_items_update(Evas_Object
 EAPI unsigned int elm_genlist_items_count(const Evas_Object *obj);
 
 #define ELM_GENLIST_ITEM_CLASS_VERSION 2 /* current version number */
+#define ELM_GENLIST_ITEM_CLASS_HEADER ELM_GENLIST_ITEM_CLASS_VERSION, 0, 0
 
 /**
  * Add a new genlist item class in a given genlist widget.
@@ -1755,9 +1754,10 @@ EAPI void                          elm_genlist_item_display_only_set(Elm_Object_
 EAPI Eina_Bool                     elm_genlist_item_display_only_get(const Elm_Object_Item *it);
 
 /**
- * Tells genlist to "orphan" contents fetched by the item class
+ * Unset all contents fetched by the item class
  *
  * @param it The item
+ * @param l The contents list to return
  *
  * This instructs genlist to release references to contents in the item,
  * meaning that they will no longer be managed by genlist and are
@@ -1766,8 +1766,7 @@ EAPI Eina_Bool                     elm_genlist_item_display_only_get(const Elm_O
  *
  * @ingroup Genlist
  */
-//XXX: Eina_List *elm_genlist_item_all_contents_unset() ??
-EAPI void                          elm_genlist_item_contents_orphan(Elm_Object_Item *it);
+EAPI void                          elm_genlist_item_all_contents_unset(Elm_Object_Item *it, Eina_List **l);
 
 /**
  * Promote an item to the top of the list
@@ -1792,7 +1791,7 @@ EAPI void                          elm_genlist_item_demote(Elm_Object_Item *it);
  *
  * @param it The item
  * @param parts The name of item's part
- * @param itf The flags of item's part type
+ * @param itf The type of item's part type
  *
  * This updates an item's part by calling item's fetching functions again
  * to get the contents, texts and states. Use this when the original
@@ -1807,7 +1806,7 @@ EAPI void                          elm_genlist_item_demote(Elm_Object_Item *it);
  *
  * @ingroup Genlist
  */
-EAPI void                          elm_genlist_item_fields_update(Elm_Object_Item *it, const char *parts, Elm_Genlist_Item_Field_Flags itf);
+EAPI void                          elm_genlist_item_fields_update(Elm_Object_Item *it, const char *parts, Elm_Genlist_Item_Field_Type itf);
 
 /**
  * Activate a genlist mode on an item
@@ -1908,18 +1907,17 @@ 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
+ * Get the Item's Type 
  *
  * @param it The genlist item
- * @return The item flags.
+ * @return The item type.
  *
  * This function returns the item's type. Normally the item's type.
  * If it failed, return value is ELM_GENLIST_ITEM_MAX
  *
  * @ingroup Genlist
  */
-//XXX: type would be more intuitive...
-EAPI Elm_Genlist_Item_Flags        elm_genlist_item_flags_get(const Elm_Object_Item *it);
+EAPI Elm_Genlist_Item_Type        elm_genlist_item_type_get(const Elm_Object_Item *it);
 
 /**
  * Set Genlist edit mode
@@ -1948,5 +1946,39 @@ EAPI void               elm_genlist_edit_mode_set(Evas_Object *obj, Eina_Bool ed
 EAPI Eina_Bool          elm_genlist_edit_mode_get(const Evas_Object *obj);
 
 /**
+ * Set the flip state of a given genlist item.
+ *
+ * @param it The genlist item object
+ * @param flip The flip mode
+ * (EINA_TRUE = on, EINA_FALSE = off)
+ *
+ * This function sets the flip state of a given genlist item.
+ * Flip mode overrides current item object.
+ * It can be used for on-the-fly item replace.
+ * Flip mode can be used with/without edit mode.
+ *
+ * @see elm_genlist_item_flip_get()
+ *
+ * @ingroup Genlist
+ */
+
+EAPI void elm_genlist_item_flip_set(Elm_Object_Item *it, Eina_Bool flip);
+
+/**
+ * Get the flip state of a given genlist item.
+ *
+ * @param it The genlist item object
+ *
+ * This function returns the flip state of a given genlist item.
+ * If the parameter is invalid, it returns EINA_FALSE.
+ *
+ * @see elm_genlist_item_flip_set()
+ *
+ * @ingroup Genlist
+ */
+
+EAPI Eina_Bool elm_genlist_item_flip_get(const Elm_Object_Item *it);
+
+/**
  * @}
  */