use version as an actual version and bring back macros for setting up
[framework/uifw/elementary.git] / src / lib / elm_genlist.h
index c2c0fb0..b9e5661 100644 (file)
  *
  * @ingroup Genlist
  */
-//XXX: Elm_Genlist_Item_Type
  typedef enum
 {
    ELM_GENLIST_ITEM_NONE = 0, /**< simple item */
+   //XXX: ELM_GENLIST_ITEM_TREE
    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_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
@@ -624,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
@@ -639,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.
@@ -648,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
@@ -663,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
@@ -673,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
@@ -688,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
@@ -698,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
@@ -713,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
@@ -722,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.
@@ -739,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 */
 /**
@@ -1123,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.
@@ -1131,7 +1131,7 @@ EAPI unsigned int elm_genlist_items_count(const Evas_Object *obj);
  *
  * This adds genlist item class for the genlist widget. When adding a item,
  * genlist_item_{append, prepend, insert} function needs item class of the item.
- * Given callback paramters are used at retrieving {text, content} of
+ * Given callback parameters are used at retrieving {text, content} of
  * added item. Set as NULL if it's not used.
  * If there's no available memory, return can be NULL.
  *
@@ -1463,6 +1463,7 @@ EAPI Eina_Bool                     elm_genlist_item_cursor_engine_only_get(const
  *
  * @ingroup Genlist
  */
+// XXX: kill this. elm_genlist_height_for_width_mode_set() covers this.
 EAPI void                          elm_genlist_compress_mode_set(Evas_Object *obj, Eina_Bool compress);
 
 /**
@@ -1501,6 +1502,7 @@ EAPI Eina_Bool                     elm_genlist_compress_mode_get(const Evas_Obje
  *
  * @ingroup Genlist
  */
+//aspect 
 //XXX: API name is ambiguous.. How about elm_genlist_mode_fixed_width_set? 
 EAPI void                          elm_genlist_height_for_width_mode_set(Evas_Object *obj, Eina_Bool height_for_width);
 
@@ -1513,7 +1515,7 @@ EAPI void                          elm_genlist_height_for_width_mode_set(Evas_Ob
  *
  * @ingroup Genlist
  */
-//XXX: API name is ambigious elm_genlist_mode_fixed_width_get() ?????
+//XXX: API name is ambiguous elm_genlist_mode_fixed_width_get() ?????
 EAPI Eina_Bool                     elm_genlist_height_for_width_mode_get(const Evas_Object *obj);
 
 /**
@@ -1734,7 +1736,7 @@ EAPI int                           elm_genlist_item_expanded_depth_get(const Elm
  *
  * @ingroup Genlist
  */
-//XXX: elm_genlist_item_event_freeze_set()?
+//XXX: elm_genlist_item_no_select_mode_set()?
 EAPI void                          elm_genlist_item_display_only_set(Elm_Object_Item *it, Eina_Bool display_only);
 
 /**
@@ -1748,13 +1750,14 @@ EAPI void                          elm_genlist_item_display_only_set(Elm_Object_
  *
  * @ingroup Genlist
  */
-//XXX: elm_genlist_item_event_freeze_get()?
+//XXX: elm_genlist_item_no_select_mode_get()?
 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
@@ -1763,8 +1766,7 @@ EAPI Eina_Bool                     elm_genlist_item_display_only_get(const Elm_O
  *
  * @ingroup Genlist
  */
-//XXX: 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
@@ -1789,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
@@ -1804,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
@@ -1846,7 +1848,7 @@ EAPI void                          elm_genlist_item_fields_update(Elm_Object_Ite
  *
  * @ingroup Genlist
  */
-//XXX: How bout elm_genlist_mode_item_set
+//XXX: How bout elm_genlist_effect_mode_set 
 EAPI void                          elm_genlist_item_mode_set(Elm_Object_Item *it, const char *mode_type, Eina_Bool mode_set);
 
 /**
@@ -1905,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
@@ -1929,6 +1930,7 @@ EAPI Elm_Genlist_Item_Flags        elm_genlist_item_flags_get(const Elm_Object_I
  *
  * @ingroup Genlist
  */
+//XXX: elm_genlist_effect_mode_set();
 EAPI void               elm_genlist_edit_mode_set(Evas_Object *obj, Eina_Bool edit_mode);
 
 /**
@@ -1940,8 +1942,43 @@ EAPI void               elm_genlist_edit_mode_set(Evas_Object *obj, Eina_Bool ed
  *
  * @ingroup Genlist
  */
+//XXX: elm_genlist_all_items_effect_mode_get();
 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);
+
+/**
  * @}
  */