From f03db69f8f40f4a0af7ae658f068939c9f5e5e63 Mon Sep 17 00:00:00 2001 From: Daniel Zaoui Date: Sun, 28 Apr 2013 15:04:57 +0300 Subject: [PATCH] Elementary: Split headers for Gengrid, genlist, grid, image and index --- legacy/elementary/src/lib/Makefile.am | 14 + legacy/elementary/src/lib/elm_gengrid.h | 2044 +---------------- .../elementary/src/lib/elm_gengrid_common.h | 567 +++++ legacy/elementary/src/lib/elm_gengrid_eo.h | 602 +++++ .../elementary/src/lib/elm_gengrid_legacy.h | 868 +++++++ legacy/elementary/src/lib/elm_genlist.h | 1984 +--------------- .../elementary/src/lib/elm_genlist_common.h | 824 +++++++ legacy/elementary/src/lib/elm_genlist_eo.h | 508 ++++ .../elementary/src/lib/elm_genlist_legacy.h | 645 ++++++ legacy/elementary/src/lib/elm_grid.h | 208 +- legacy/elementary/src/lib/elm_grid_eo.h | 98 + legacy/elementary/src/lib/elm_grid_legacy.h | 107 + legacy/elementary/src/lib/elm_image.h | 1038 +-------- legacy/elementary/src/lib/elm_image_common.h | 22 + legacy/elementary/src/lib/elm_image_eo.h | 544 +++++ legacy/elementary/src/lib/elm_image_legacy.h | 468 ++++ legacy/elementary/src/lib/elm_index.h | 691 +----- legacy/elementary/src/lib/elm_index_common.h | 21 + legacy/elementary/src/lib/elm_index_eo.h | 308 +++ legacy/elementary/src/lib/elm_index_legacy.h | 357 +++ 20 files changed, 5987 insertions(+), 5931 deletions(-) create mode 100644 legacy/elementary/src/lib/elm_gengrid_common.h create mode 100644 legacy/elementary/src/lib/elm_gengrid_eo.h create mode 100644 legacy/elementary/src/lib/elm_gengrid_legacy.h create mode 100644 legacy/elementary/src/lib/elm_genlist_common.h create mode 100644 legacy/elementary/src/lib/elm_genlist_eo.h create mode 100644 legacy/elementary/src/lib/elm_genlist_legacy.h create mode 100644 legacy/elementary/src/lib/elm_grid_eo.h create mode 100644 legacy/elementary/src/lib/elm_grid_legacy.h create mode 100644 legacy/elementary/src/lib/elm_image_common.h create mode 100644 legacy/elementary/src/lib/elm_image_eo.h create mode 100644 legacy/elementary/src/lib/elm_image_legacy.h create mode 100644 legacy/elementary/src/lib/elm_index_common.h create mode 100644 legacy/elementary/src/lib/elm_index_eo.h create mode 100644 legacy/elementary/src/lib/elm_index_legacy.h diff --git a/legacy/elementary/src/lib/Makefile.am b/legacy/elementary/src/lib/Makefile.am index 0b251f77a9..57beee09e0 100644 --- a/legacy/elementary/src/lib/Makefile.am +++ b/legacy/elementary/src/lib/Makefile.am @@ -221,7 +221,13 @@ elm_frame_legacy.h \ elm_gen.h \ elm_general.h \ elm_gengrid.h \ +elm_gengrid_common.h \ +elm_gengrid_eo.h \ +elm_gengrid_legacy.h \ elm_genlist.h \ +elm_genlist_common.h \ +elm_genlist_eo.h \ +elm_genlist_legacy.h \ elm_gesture_layer.h \ elm_gesture_layer_common.h \ elm_gesture_layer_eo.h \ @@ -232,6 +238,8 @@ elm_glview_common.h \ elm_glview_eo.h \ elm_glview_legacy.h \ elm_grid.h \ +elm_grid_eo.h \ +elm_grid_legacy.h \ elm_hover.h \ elm_hover_common.h \ elm_hover_eo.h \ @@ -241,7 +249,13 @@ elm_icon_common.h \ elm_icon_eo.h \ elm_icon_legacy.h \ elm_image.h \ +elm_image_common.h \ +elm_image_eo.h \ +elm_image_legacy.h \ elm_index.h \ +elm_index_common.h \ +elm_index_eo.h \ +elm_index_legacy.h \ elm_intro.h \ elm_inwin.h \ elm_inwin_eo.h \ diff --git a/legacy/elementary/src/lib/elm_gengrid.h b/legacy/elementary/src/lib/elm_gengrid.h index d4cd7cff49..41c00956aa 100644 --- a/legacy/elementary/src/lib/elm_gengrid.h +++ b/legacy/elementary/src/lib/elm_gengrid.h @@ -245,2048 +245,18 @@ * @li @ref gengrid_example */ -#define ELM_OBJ_GENGRID_PAN_CLASS elm_obj_gengrid_pan_class_get() - -const Eo_Class *elm_obj_gengrid_pan_class_get(void) EINA_CONST; - -#define ELM_OBJ_GENGRID_CLASS elm_obj_gengrid_class_get() - -const Eo_Class *elm_obj_gengrid_class_get(void) EINA_CONST; - -extern EAPI Eo_Op ELM_OBJ_GENGRID_BASE_ID; - -enum -{ - ELM_OBJ_GENGRID_SUB_ID_ITEM_SIZE_SET, - ELM_OBJ_GENGRID_SUB_ID_ITEM_SIZE_GET, - ELM_OBJ_GENGRID_SUB_ID_GROUP_ITEM_SIZE_SET, - ELM_OBJ_GENGRID_SUB_ID_GROUP_ITEM_SIZE_GET, - ELM_OBJ_GENGRID_SUB_ID_ALIGN_SET, - ELM_OBJ_GENGRID_SUB_ID_ALIGN_GET, - ELM_OBJ_GENGRID_SUB_ID_ITEM_APPEND, - ELM_OBJ_GENGRID_SUB_ID_ITEM_PREPEND, - ELM_OBJ_GENGRID_SUB_ID_ITEM_INSERT_BEFORE, - ELM_OBJ_GENGRID_SUB_ID_ITEM_INSERT_AFTER, - ELM_OBJ_GENGRID_SUB_ID_ITEM_SORTED_INSERT, - ELM_OBJ_GENGRID_SUB_ID_HORIZONTAL_SET, - ELM_OBJ_GENGRID_SUB_ID_HORIZONTAL_GET, - ELM_OBJ_GENGRID_SUB_ID_CLEAR, - ELM_OBJ_GENGRID_SUB_ID_MULTI_SELECT_SET, - ELM_OBJ_GENGRID_SUB_ID_MULTI_SELECT_GET, - ELM_OBJ_GENGRID_SUB_ID_SELECTED_ITEM_GET, - ELM_OBJ_GENGRID_SUB_ID_SELECTED_ITEMS_GET, - ELM_OBJ_GENGRID_SUB_ID_REALIZED_ITEMS_GET, - ELM_OBJ_GENGRID_SUB_ID_REALIZED_ITEMS_UPDATE, - ELM_OBJ_GENGRID_SUB_ID_REORDER_MODE_SET, - ELM_OBJ_GENGRID_SUB_ID_REORDER_MODE_GET, - ELM_OBJ_GENGRID_SUB_ID_PAGE_RELATIVE_SET, - ELM_OBJ_GENGRID_SUB_ID_PAGE_RELATIVE_GET, - ELM_OBJ_GENGRID_SUB_ID_PAGE_SIZE_SET, - ELM_OBJ_GENGRID_SUB_ID_FIRST_ITEM_GET, - ELM_OBJ_GENGRID_SUB_ID_LAST_ITEM_GET, - ELM_OBJ_GENGRID_SUB_ID_FILLED_SET, - ELM_OBJ_GENGRID_SUB_ID_FILLED_GET, - ELM_OBJ_GENGRID_SUB_ID_ITEMS_COUNT, - ELM_OBJ_GENGRID_SUB_ID_SELECT_MODE_SET, - ELM_OBJ_GENGRID_SUB_ID_SELECT_MODE_GET, - ELM_OBJ_GENGRID_SUB_ID_HIGHLIGHT_MODE_SET, - ELM_OBJ_GENGRID_SUB_ID_HIGHLIGHT_MODE_GET, - ELM_OBJ_GENGRID_SUB_ID_LAST -}; - -#define ELM_OBJ_GENGRID_ID(sub_id) (ELM_OBJ_GENGRID_BASE_ID + sub_id) - - -/** - * @def elm_obj_gengrid_item_size_set - * @since 1.8 - * - * Set the size for the items of a given gengrid widget - * - * @param[in] w - * @param[in] h - * - * @see elm_gengrid_item_size_set - */ -#define elm_obj_gengrid_item_size_set(w, h) ELM_OBJ_GENGRID_ID(ELM_OBJ_GENGRID_SUB_ID_ITEM_SIZE_SET), EO_TYPECHECK(Evas_Coord, w), EO_TYPECHECK(Evas_Coord, h) - -/** - * @def elm_obj_gengrid_item_size_get - * @since 1.8 - * - * Get the size set for the items of a given gengrid widget - * - * @param[out] w - * @param[out] h - * - * @see elm_gengrid_item_size_get - */ -#define elm_obj_gengrid_item_size_get(w, h) ELM_OBJ_GENGRID_ID(ELM_OBJ_GENGRID_SUB_ID_ITEM_SIZE_GET), EO_TYPECHECK(Evas_Coord *, w), EO_TYPECHECK(Evas_Coord *, h) - -/** - * @def elm_obj_gengrid_group_item_size_set - * @since 1.8 - * - * Set the size for the group items of a given gengrid widget - * - * @param[in] w - * @param[in] h - * - * @see elm_gengrid_group_item_size_set - */ -#define elm_obj_gengrid_group_item_size_set(w, h) ELM_OBJ_GENGRID_ID(ELM_OBJ_GENGRID_SUB_ID_GROUP_ITEM_SIZE_SET), EO_TYPECHECK(Evas_Coord, w), EO_TYPECHECK(Evas_Coord, h) - -/** - * @def elm_obj_gengrid_group_item_size_get - * @since 1.8 - * - * Get the size set for the group items of a given gengrid widget - * - * @param[out] w - * @param[out] h - * - * @see elm_gengrid_group_item_size_get - */ -#define elm_obj_gengrid_group_item_size_get(w, h) ELM_OBJ_GENGRID_ID(ELM_OBJ_GENGRID_SUB_ID_GROUP_ITEM_SIZE_GET), EO_TYPECHECK(Evas_Coord *, w), EO_TYPECHECK(Evas_Coord *, h) - -/** - * @def elm_obj_gengrid_align_set - * @since 1.8 - * - * Set the items grid's alignment within a given gengrid widget - * - * @param[in] align_x - * @param[in] align_y - * - * @see elm_gengrid_align_set - */ -#define elm_obj_gengrid_align_set(align_x, align_y) ELM_OBJ_GENGRID_ID(ELM_OBJ_GENGRID_SUB_ID_ALIGN_SET), EO_TYPECHECK(double, align_x), EO_TYPECHECK(double, align_y) - -/** - * @def elm_obj_gengrid_align_get - * @since 1.8 - * - * Get the items grid's alignment values within a given gengrid - * - * @param[out] align_x - * @param[out] align_y - * - * @see elm_gengrid_align_get - */ -#define elm_obj_gengrid_align_get(align_x, align_y) ELM_OBJ_GENGRID_ID(ELM_OBJ_GENGRID_SUB_ID_ALIGN_GET), EO_TYPECHECK(double *, align_x), EO_TYPECHECK(double *, align_y) - -/** - * @def elm_obj_gengrid_item_append - * @since 1.8 - * - * Append a new item in a given gengrid widget. - * - * @param[in] itc - * @param[in] data - * @param[in] func - * @param[in] func_data - * @param[out] ret - * - * @see elm_gengrid_item_append - */ -#define elm_obj_gengrid_item_append(itc, data, func, func_data, ret) ELM_OBJ_GENGRID_ID(ELM_OBJ_GENGRID_SUB_ID_ITEM_APPEND), EO_TYPECHECK(const Elm_Gengrid_Item_Class *, itc), EO_TYPECHECK(const void *, data), EO_TYPECHECK(Evas_Smart_Cb, func), EO_TYPECHECK(const void *, func_data), EO_TYPECHECK(Elm_Object_Item **, ret) - -/** - * @def elm_obj_gengrid_item_prepend - * @since 1.8 - * - * Prepend a new item in a given gengrid widget. - * - * @param[in] itc - * @param[in] data - * @param[in] func - * @param[in] func_data - * @param[out] ret - * - * @see elm_gengrid_item_prepend - */ -#define elm_obj_gengrid_item_prepend(itc, data, func, func_data, ret) ELM_OBJ_GENGRID_ID(ELM_OBJ_GENGRID_SUB_ID_ITEM_PREPEND), EO_TYPECHECK(const Elm_Gengrid_Item_Class *, itc), EO_TYPECHECK(const void *, data), EO_TYPECHECK(Evas_Smart_Cb, func), EO_TYPECHECK(const void *, func_data), EO_TYPECHECK(Elm_Object_Item **, ret) - -/** - * @def elm_obj_gengrid_item_insert_before - * @since 1.8 - * - * Insert an item before another in a gengrid widget - * - * @param[in] itc - * @param[in] data - * @param[in] relative - * @param[in] func - * @param[in] func_data - * @param[out] ret - * - * @see elm_gengrid_item_insert_before - */ -#define elm_obj_gengrid_item_insert_before(itc, data, relative, func, func_data, ret) ELM_OBJ_GENGRID_ID(ELM_OBJ_GENGRID_SUB_ID_ITEM_INSERT_BEFORE), EO_TYPECHECK(const Elm_Gengrid_Item_Class *, itc), EO_TYPECHECK(const void *, data), EO_TYPECHECK(Elm_Object_Item *, relative), EO_TYPECHECK(Evas_Smart_Cb, func), EO_TYPECHECK(const void *, func_data), EO_TYPECHECK(Elm_Object_Item **, ret) - -/** - * @def elm_obj_gengrid_item_insert_after - * @since 1.8 - * - * Insert an item after another in a gengrid widget - * - * @param[in] itc - * @param[in] data - * @param[in] relative - * @param[in] func - * @param[in] func_data - * @param[out] ret - * - * @see elm_gengrid_item_insert_after - */ -#define elm_obj_gengrid_item_insert_after(itc, data, relative, func, func_data, ret) ELM_OBJ_GENGRID_ID(ELM_OBJ_GENGRID_SUB_ID_ITEM_INSERT_AFTER), EO_TYPECHECK(const Elm_Gengrid_Item_Class *, itc), EO_TYPECHECK(const void *, data), EO_TYPECHECK(Elm_Object_Item *, relative), EO_TYPECHECK(Evas_Smart_Cb, func), EO_TYPECHECK(const void *, func_data), EO_TYPECHECK(Elm_Object_Item **, ret) - -/** - * @def elm_obj_gengrid_item_sorted_insert - * @since 1.8 - * - * Insert an item in a gengrid widget using a user-defined sort function. - * - * @param[in] itc - * @param[in] data - * @param[in] comp - * @param[in] func - * @param[in] func_data - * @param[out] ret - * - * @see elm_gengrid_item_sorted_insert - */ -#define elm_obj_gengrid_item_sorted_insert(itc, data, comp, func, func_data, ret) ELM_OBJ_GENGRID_ID(ELM_OBJ_GENGRID_SUB_ID_ITEM_SORTED_INSERT), EO_TYPECHECK(const Elm_Gengrid_Item_Class *, itc), EO_TYPECHECK(const void *, data), EO_TYPECHECK(Eina_Compare_Cb, comp), EO_TYPECHECK(Evas_Smart_Cb, func), EO_TYPECHECK(const void *, func_data), EO_TYPECHECK(Elm_Object_Item **, ret) - -/** - * @def elm_obj_gengrid_horizontal_set - * @since 1.8 - * - * Set the direction in which a given gengrid widget will expand while - * placing its items. - * - * @param[in] horizontal - * - * @see elm_gengrid_horizontal_set - */ -#define elm_obj_gengrid_horizontal_set(horizontal) ELM_OBJ_GENGRID_ID(ELM_OBJ_GENGRID_SUB_ID_HORIZONTAL_SET), EO_TYPECHECK(Eina_Bool, horizontal) - -/** - * @def elm_obj_gengrid_horizontal_get - * @since 1.8 - * - * Get for what direction a given gengrid widget will expand while - * placing its items. - * - * @param[out] ret - * - * @see elm_gengrid_horizontal_get - */ -#define elm_obj_gengrid_horizontal_get(ret) ELM_OBJ_GENGRID_ID(ELM_OBJ_GENGRID_SUB_ID_HORIZONTAL_GET), EO_TYPECHECK(Eina_Bool *, ret) - -/** - * @def elm_obj_gengrid_clear - * @since 1.8 - * - * Remove all items from a given gengrid widget - * - * - * @see elm_gengrid_clear - */ -#define elm_obj_gengrid_clear() ELM_OBJ_GENGRID_ID(ELM_OBJ_GENGRID_SUB_ID_CLEAR) - -/** - * @def elm_obj_gengrid_multi_select_set - * @since 1.8 - * - * Enable or disable multi-selection in a given gengrid widget - * - * @param[in] multi - * - * @see elm_gengrid_multi_select_set - */ -#define elm_obj_gengrid_multi_select_set(multi) ELM_OBJ_GENGRID_ID(ELM_OBJ_GENGRID_SUB_ID_MULTI_SELECT_SET), EO_TYPECHECK(Eina_Bool, multi) - -/** - * @def elm_obj_gengrid_multi_select_get - * @since 1.8 - * - * Get whether multi-selection is enabled or disabled for a given - * gengrid widget - * - * @param[out] ret - * - * @see elm_gengrid_multi_select_get - */ -#define elm_obj_gengrid_multi_select_get(ret) ELM_OBJ_GENGRID_ID(ELM_OBJ_GENGRID_SUB_ID_MULTI_SELECT_GET), EO_TYPECHECK(Eina_Bool *, ret) - -/** - * @def elm_obj_gengrid_selected_item_get - * @since 1.8 - * - * Get the selected item in a given gengrid widget - * - * @param[out] ret - * - * @see elm_gengrid_selected_item_get - */ -#define elm_obj_gengrid_selected_item_get(ret) ELM_OBJ_GENGRID_ID(ELM_OBJ_GENGRID_SUB_ID_SELECTED_ITEM_GET), EO_TYPECHECK(Elm_Object_Item **, ret) - -/** - * @def elm_obj_gengrid_selected_items_get - * @since 1.8 - * - * Get a list of selected items in a given gengrid - * - * @param[out] ret - * - * @see elm_gengrid_selected_items_get - */ -#define elm_obj_gengrid_selected_items_get(ret) ELM_OBJ_GENGRID_ID(ELM_OBJ_GENGRID_SUB_ID_SELECTED_ITEMS_GET), EO_TYPECHECK(const Eina_List **, ret) - -/** - * @def elm_obj_gengrid_realized_items_get - * @since 1.8 - * - * Get a list of realized items in gengrid - * - * @param[out] ret - * - * @see elm_gengrid_realized_items_get - */ -#define elm_obj_gengrid_realized_items_get(ret) ELM_OBJ_GENGRID_ID(ELM_OBJ_GENGRID_SUB_ID_REALIZED_ITEMS_GET), EO_TYPECHECK(Eina_List **, ret) - -/** - * @def elm_obj_gengrid_realized_items_update - * @since 1.8 - * - * Update the contents of all realized items. - * - * - * @see elm_gengrid_realized_items_update - */ -#define elm_obj_gengrid_realized_items_update() ELM_OBJ_GENGRID_ID(ELM_OBJ_GENGRID_SUB_ID_REALIZED_ITEMS_UPDATE) - -/** - * @def elm_obj_gengrid_reorder_mode_set - * @since 1.8 - * - * Set whether a given gengrid widget is or not able have items - * - * @param[in] reorder_mode - * - * @see elm_gengrid_reorder_mode_set - */ -#define elm_obj_gengrid_reorder_mode_set(reorder_mode) ELM_OBJ_GENGRID_ID(ELM_OBJ_GENGRID_SUB_ID_REORDER_MODE_SET), EO_TYPECHECK(Eina_Bool, reorder_mode) - -/** - * @def elm_obj_gengrid_reorder_mode_get - * @since 1.8 - * - * Get whether a given gengrid widget is or not able have items - * - * @param[out] ret - * - * @see elm_gengrid_reorder_mode_get - */ -#define elm_obj_gengrid_reorder_mode_get(ret) ELM_OBJ_GENGRID_ID(ELM_OBJ_GENGRID_SUB_ID_REORDER_MODE_GET), EO_TYPECHECK(Eina_Bool *, ret) - -/** - * @def elm_obj_gengrid_bounce_set - * @since 1.8 - * - * Enable or disable bouncing effect for a given gengrid widget - * - * @param[in] h_bounce - * @param[in] v_bounce - * - * @see elm_gengrid_bounce_set - */ -#define elm_obj_gengrid_bounce_set(h_bounce, v_bounce) ELM_OBJ_GENGRID_ID(ELM_OBJ_GENGRID_SUB_ID_BOUNCE_SET), EO_TYPECHECK(Eina_Bool, h_bounce), EO_TYPECHECK(Eina_Bool, v_bounce) - -/** - * @def elm_obj_gengrid_bounce_get - * @since 1.8 - * - * Get whether bouncing effects are enabled or disabled, for a - * given gengrid widget, on each axis - * - * @param[out] h_bounce - * @param[out] v_bounce - * - * @see elm_gengrid_bounce_get - */ -#define elm_obj_gengrid_bounce_get(h_bounce, v_bounce) ELM_OBJ_GENGRID_ID(ELM_OBJ_GENGRID_SUB_ID_BOUNCE_GET), EO_TYPECHECK(Eina_Bool *, h_bounce), EO_TYPECHECK(Eina_Bool *, v_bounce) - -/** - * @def elm_obj_gengrid_page_relative_set - * @since 1.8 - * - * Set a given gengrid widget's scrolling page size, relative to - * its viewport size. - * - * @param[in] h_pagerel - * @param[in] v_pagerel - * - * @see elm_gengrid_page_relative_set - */ -#define elm_obj_gengrid_page_relative_set(h_pagerel, v_pagerel) ELM_OBJ_GENGRID_ID(ELM_OBJ_GENGRID_SUB_ID_PAGE_RELATIVE_SET), EO_TYPECHECK(double, h_pagerel), EO_TYPECHECK(double, v_pagerel) - -/** - * @def elm_obj_gengrid_page_relative_get - * @since 1.8 - * - * Get a given gengrid widget's scrolling page size, relative to - * its viewport size. - * - * @param[out] h_pagerel - * @param[out] v_pagerel - * - * @see elm_gengrid_page_relative_get - */ -#define elm_obj_gengrid_page_relative_get(h_pagerel, v_pagerel) ELM_OBJ_GENGRID_ID(ELM_OBJ_GENGRID_SUB_ID_PAGE_RELATIVE_GET), EO_TYPECHECK(double *, h_pagerel), EO_TYPECHECK(double *, v_pagerel) - -/** - * @def elm_obj_gengrid_page_size_set - * @since 1.8 - * - * Set a given gengrid widget's scrolling page size - * - * @param[in] h_pagesize - * @param[in] v_pagesize - * - * @see elm_gengrid_page_size_set - */ -#define elm_obj_gengrid_page_size_set(h_pagesize, v_pagesize) ELM_OBJ_GENGRID_ID(ELM_OBJ_GENGRID_SUB_ID_PAGE_SIZE_SET), EO_TYPECHECK(Evas_Coord, h_pagesize), EO_TYPECHECK(Evas_Coord, v_pagesize) - -/** - * @def elm_obj_gengrid_current_page_get - * @since 1.8 - * - * @brief Get gengrid current page number. - * - * @param[out] h_pagenumber - * @param[out] v_pagenumber - * - * @see elm_gengrid_current_page_get - */ -#define elm_obj_gengrid_current_page_get(h_pagenumber, v_pagenumber) ELM_OBJ_GENGRID_ID(ELM_OBJ_GENGRID_SUB_ID_CURRENT_PAGE_GET), EO_TYPECHECK(int *, h_pagenumber), EO_TYPECHECK(int *, v_pagenumber) - -/** - * @def elm_obj_gengrid_last_page_get - * @since 1.8 - * - * @brief Get gengrid last page number. - * - * @param[out] h_pagenumber - * @param[out] v_pagenumber - * - * @see elm_gengrid_last_page_get - */ -#define elm_obj_gengrid_last_page_get(h_pagenumber, v_pagenumber) ELM_OBJ_GENGRID_ID(ELM_OBJ_GENGRID_SUB_ID_LAST_PAGE_GET), EO_TYPECHECK(int *, h_pagenumber), EO_TYPECHECK(int *, v_pagenumber) - -/** - * @def elm_obj_gengrid_page_show - * @since 1.8 - * - * Show a specific virtual region within the gengrid content object by page number. - * - * @param[in] h_pagenumber - * @param[in] v_pagenumber - * - * @see elm_gengrid_page_show - */ -#define elm_obj_gengrid_page_show(h_pagenumber, v_pagenumber) ELM_OBJ_GENGRID_ID(ELM_OBJ_GENGRID_SUB_ID_PAGE_SHOW), EO_TYPECHECK(int, h_pagenumber), EO_TYPECHECK(int, v_pagenumber) - -/** - * @def elm_obj_gengrid_page_bring_in - * @since 1.8 - * - * Show a specific virtual region within the gengrid content object by page number. - * - * @param[in] h_pagenumber - * @param[in] v_pagenumber - * - * @see elm_gengrid_page_bring_in - */ -#define elm_obj_gengrid_page_bring_in(h_pagenumber, v_pagenumber) ELM_OBJ_GENGRID_ID(ELM_OBJ_GENGRID_SUB_ID_PAGE_BRING_IN), EO_TYPECHECK(int, h_pagenumber), EO_TYPECHECK(int, v_pagenumber) - -/** - * @def elm_obj_gengrid_scroller_policy_set - * @since 1.8 - * - * Set the scrollbar policy - * - * @param[in] policy_h - * @param[in] policy_v - * - * @see elm_gengrid_scroller_policy_set - */ -#define elm_obj_gengrid_scroller_policy_set(policy_h, policy_v) ELM_OBJ_GENGRID_ID(ELM_OBJ_GENGRID_SUB_ID_SCROLLER_POLICY_SET), EO_TYPECHECK(Elm_Scroller_Policy, policy_h), EO_TYPECHECK(Elm_Scroller_Policy, policy_v) - -/** - * @def elm_obj_gengrid_scroller_policy_get - * @since 1.8 - * - * Get the scrollbar policy - * - * @param[out] policy_h - * @param[out] policy_v - * - * @see elm_gengrid_scroller_policy_get - */ -#define elm_obj_gengrid_scroller_policy_get(policy_h, policy_v) ELM_OBJ_GENGRID_ID(ELM_OBJ_GENGRID_SUB_ID_SCROLLER_POLICY_GET), EO_TYPECHECK(Elm_Scroller_Policy *, policy_h), EO_TYPECHECK(Elm_Scroller_Policy *, policy_v) - -/** - * @def elm_obj_gengrid_first_item_get - * @since 1.8 - * - * Get the first item in a given gengrid widget - * - * @param[out] ret - * - * @see elm_gengrid_first_item_get - */ -#define elm_obj_gengrid_first_item_get(ret) ELM_OBJ_GENGRID_ID(ELM_OBJ_GENGRID_SUB_ID_FIRST_ITEM_GET), EO_TYPECHECK(Elm_Object_Item **, ret) - -/** - * @def elm_obj_gengrid_last_item_get - * @since 1.8 - * - * Get the last item in a given gengrid widget - * - * @param[out] ret - * - * @see elm_gengrid_last_item_get - */ -#define elm_obj_gengrid_last_item_get(ret) ELM_OBJ_GENGRID_ID(ELM_OBJ_GENGRID_SUB_ID_LAST_ITEM_GET), EO_TYPECHECK(Elm_Object_Item **, ret) - -/** - * @def elm_obj_gengrid_filled_set - * @since 1.8 - * - * Set how the items grid's filled within a given gengrid widget - * - * @param[in] fill - * - * @see elm_gengrid_filled_set - */ -#define elm_obj_gengrid_filled_set(fill) ELM_OBJ_GENGRID_ID(ELM_OBJ_GENGRID_SUB_ID_FILLED_SET), EO_TYPECHECK(Eina_Bool, fill) - -/** - * @def elm_obj_gengrid_filled_get - * @since 1.8 - * - * Get how the items grid's filled within a given gengrid widget - * - * @param[out] ret - * - * @see elm_gengrid_filled_get - */ -#define elm_obj_gengrid_filled_get(ret) ELM_OBJ_GENGRID_ID(ELM_OBJ_GENGRID_SUB_ID_FILLED_GET), EO_TYPECHECK(Eina_Bool *, ret) - -/** - * @def elm_obj_gengrid_items_count - * @since 1.8 - * - * Return how many items are currently in a list - * - * @param[out] ret - * - * @see elm_gengrid_items_count - */ -#define elm_obj_gengrid_items_count(ret) ELM_OBJ_GENGRID_ID(ELM_OBJ_GENGRID_SUB_ID_ITEMS_COUNT), EO_TYPECHECK(unsigned int *, ret) - -/** - * @def elm_obj_gengrid_select_mode_set - * @since 1.8 - * - * Set the gengrid select mode. - * - * @param[in] mode - * - * @see elm_gengrid_select_mode_set - */ -#define elm_obj_gengrid_select_mode_set(mode) ELM_OBJ_GENGRID_ID(ELM_OBJ_GENGRID_SUB_ID_SELECT_MODE_SET), EO_TYPECHECK(Elm_Object_Select_Mode, mode) - -/** - * @def elm_obj_gengrid_select_mode_get - * @since 1.8 - * - * Get the gengrid select mode. - * - * @param[out] ret - * - * @see elm_gengrid_select_mode_get - */ -#define elm_obj_gengrid_select_mode_get(ret) ELM_OBJ_GENGRID_ID(ELM_OBJ_GENGRID_SUB_ID_SELECT_MODE_GET), EO_TYPECHECK(Elm_Object_Select_Mode *, ret) - -/** - * @def elm_obj_gengrid_highlight_mode_set - * @since 1.8 - * - * Set whether the gengrid items' should be highlighted when item selected. - * - * @param[in] highlight - * - * @see elm_gengrid_highlight_mode_set - */ -#define elm_obj_gengrid_highlight_mode_set(highlight) ELM_OBJ_GENGRID_ID(ELM_OBJ_GENGRID_SUB_ID_HIGHLIGHT_MODE_SET), EO_TYPECHECK(Eina_Bool, highlight) - -/** - * @def elm_obj_gengrid_highlight_mode_get - * @since 1.8 - * - * Get whether the gengrid items' should be highlighted when item selected. - * - * @param[out] ret - * - * @see elm_gengrid_highlight_mode_get - */ -#define elm_obj_gengrid_highlight_mode_get(ret) ELM_OBJ_GENGRID_ID(ELM_OBJ_GENGRID_SUB_ID_HIGHLIGHT_MODE_GET), EO_TYPECHECK(Eina_Bool *, ret) - - /** * @addtogroup Gengrid * @{ */ -#define ELM_GENGRID_ITEM_CLASS_VERSION ELM_GEN_ITEM_CLASS_VERSION -#define ELM_GENGRID_ITEM_CLASS_HEADER ELM_GEN_ITEM_CLASS_HEADER - -/** - * Defines where to position the item in the genlist. - * - * @ingroup Genlist - */ -typedef enum -{ - ELM_GENGRID_ITEM_SCROLLTO_NONE = 0, /**< no scrollto */ - ELM_GENGRID_ITEM_SCROLLTO_IN = (1 << 0), /**< to the nearest viewport */ - ELM_GENGRID_ITEM_SCROLLTO_TOP = (1 << 1), /**< to the top of viewport */ - ELM_GENGRID_ITEM_SCROLLTO_MIDDLE = (1 << 2) /**< to the middle of viewport */ -} Elm_Gengrid_Item_Scrollto_Type; - - -/** - * @see Elm_Gen_Item_Class - */ -typedef Elm_Gen_Item_Class Elm_Gengrid_Item_Class; - -/** - * @see Elm_Gen_Item_Text_Get_Cb - */ -typedef Elm_Gen_Item_Text_Get_Cb Elm_Gengrid_Item_Text_Get_Cb; - -/** - * @see Elm_Gen_Item_Content_Get_Cb - */ -typedef Elm_Gen_Item_Content_Get_Cb Elm_Gengrid_Item_Content_Get_Cb; - -/** - * @see Elm_Gen_Item_State_Get_Cb - */ -typedef Elm_Gen_Item_State_Get_Cb Elm_Gengrid_Item_State_Get_Cb; - -/** - * @see Elm_Gen_Item_Del_Cb - */ -typedef Elm_Gen_Item_Del_Cb Elm_Gengrid_Item_Del_Cb; - -/** - * Add a new gengrid widget to the given parent Elementary - * (container) object - * - * @param parent The parent object - * @return a new gengrid widget handle or @c NULL, on errors - * - * This function inserts a new gengrid widget on the canvas. - * - * @see elm_gengrid_item_size_set() - * @see elm_gengrid_group_item_size_set() - * @see elm_gengrid_horizontal_set() - * @see elm_gengrid_item_append() - * @see elm_object_item_del() - * @see elm_gengrid_clear() - * - * @ingroup Gengrid - */ -EAPI Evas_Object *elm_gengrid_add(Evas_Object *parent); - -/** - * Remove all items from a given gengrid widget - * - * @param obj The gengrid object. - * - * This removes (and deletes) all items in @p obj, leaving it - * empty. - * - * @see elm_object_item_del(), to remove just one item. - * - * @ingroup Gengrid - */ -EAPI void elm_gengrid_clear(Evas_Object *obj); - -/** - * Enable or disable multi-selection in a given gengrid widget - * - * @param obj The gengrid object. - * @param multi @c EINA_TRUE, to enable multi-selection, - * @c EINA_FALSE to disable it. - * - * Multi-selection is the ability to have @b more than one - * item selected, on a given gengrid, simultaneously. When it is - * enabled, a sequence of clicks on different items will make them - * all selected, progressively. A click on an already selected item - * will unselect it. If interacting via the keyboard, - * multi-selection is enabled while holding the "Shift" key. - * - * @note By default, multi-selection is @b disabled on gengrids - * - * @see elm_gengrid_multi_select_get() - * - * @ingroup Gengrid - */ -EAPI void elm_gengrid_multi_select_set(Evas_Object *obj, Eina_Bool multi); - -/** - * Get whether multi-selection is enabled or disabled for a given - * gengrid widget - * - * @param obj The gengrid object. - * @return @c EINA_TRUE, if multi-selection is enabled, @c - * EINA_FALSE otherwise - * - * @see elm_gengrid_multi_select_set() for more details - * - * @ingroup Gengrid - */ -EAPI Eina_Bool elm_gengrid_multi_select_get(const Evas_Object *obj); - -/** - * Set the direction in which a given gengrid widget will expand while - * placing its items. - * - * @param obj The gengrid object. - * @param horizontal @c EINA_TRUE to make the gengrid expand horizontally, - * @c EINA_FALSE to expand vertically. - * - * When in "horizontal mode" (@c EINA_TRUE), items will be placed in @b columns, - * from top to bottom and, when the space for a column is filled, another one is - * started on the right, thus expanding the grid horizontally. When in - * "vertical mode" (@c EINA_FALSE), though, items will be placed in @b rows, - * from left to right and, when the space for a row is filled, another one is - * started below, thus expanding the grid vertically. - * - * @note By default, gengrid is in vertical mode, @c EINA_FALSE. - * - * @see elm_gengrid_horizontal_get() - * - * @ingroup Gengrid - */ -EAPI void elm_gengrid_horizontal_set(Evas_Object *obj, Eina_Bool horizontal); - -/** - * Get for what direction a given gengrid widget will expand while - * placing its items. - * - * @param obj The gengrid object. - * @return @c EINA_TRUE, if @p obj is set to expand horizontally, - * @c EINA_FALSE if it's set to expand vertically. - * - * @see elm_gengrid_horizontal_set() for more details - * - * @ingroup Gengrid - */ -EAPI Eina_Bool elm_gengrid_horizontal_get(const Evas_Object *obj); - -/** - * Enable or disable bouncing effect for a given gengrid widget - * - * @param obj The gengrid object - * @param h_bounce @c EINA_TRUE, to enable @b horizontal bouncing, - * @c EINA_FALSE to disable it - * @param v_bounce @c EINA_TRUE, to enable @b vertical bouncing, - * @c EINA_FALSE to disable it - * - * The bouncing effect occurs whenever one reaches the gengrid's - * edge's while panning it -- it will scroll past its limits a - * little bit and return to the edge again, in a animated for, - * automatically. - * - * @note By default, gengrids have bouncing enabled on both axis - * - * @deprecated Use elm_scroller_bounce_set() instead. - * - * @see elm_scroller_bounce_set() - * - * @ingroup Gengrid - */ -EINA_DEPRECATED EAPI void elm_gengrid_bounce_set(Evas_Object *obj, Eina_Bool h_bounce, Eina_Bool v_bounce); - -/** - * Get whether bouncing effects are enabled or disabled, for a - * given gengrid widget, on each axis - * - * @param obj The gengrid object - * @param h_bounce Pointer to a variable where to store the - * horizontal bouncing flag. - * @param v_bounce Pointer to a variable where to store the - * vertical bouncing flag. - * - * @deprecated Use elm_scroller_bounce_get() instead. - * - * @see elm_scroller_bounce_get() - * - * @ingroup Gengrid - */ -EINA_DEPRECATED EAPI void elm_gengrid_bounce_get(const Evas_Object *obj, Eina_Bool *h_bounce, Eina_Bool *v_bounce); - -/** - * Append a new item in a given gengrid widget. - * - * @param obj The gengrid object. - * @param gic The item class for the item. - * @param data The item data. - * @param func Convenience function called when the item is - * selected. - * @param func_data Data to be passed to @p func. - * @return A handle to the item added or @c NULL, on errors. - * - * This adds an item to the beginning of the gengrid. - * - * @see elm_gengrid_item_prepend() - * @see elm_gengrid_item_insert_before() - * @see elm_gengrid_item_insert_after() - * @see elm_object_item_del() - * - * @ingroup Gengrid - */ -EAPI Elm_Object_Item *elm_gengrid_item_append(Evas_Object *obj, const Elm_Gengrid_Item_Class *gic, const void *data, Evas_Smart_Cb func, const void *func_data); - -/** - * Prepend a new item in a given gengrid widget. - * - * @param obj The gengrid object. - * @param gic The item class for the item. - * @param data The item data. - * @param func Convenience function called when the item is - * selected. - * @param func_data Data to be passed to @p func. - * @return A handle to the item added or @c NULL, on errors. - * - * This adds an item to the end of the gengrid. - * - * @see elm_gengrid_item_append() - * @see elm_gengrid_item_insert_before() - * @see elm_gengrid_item_insert_after() - * @see elm_object_item_del() - * - * @ingroup Gengrid - */ -EAPI Elm_Object_Item *elm_gengrid_item_prepend(Evas_Object *obj, const Elm_Gengrid_Item_Class *gic, const void *data, Evas_Smart_Cb func, const void *func_data); - -/** - * Insert an item before another in a gengrid widget - * - * @param obj The gengrid object. - * @param gic The item class for the item. - * @param data The item data. - * @param relative The item to place this new one before. - * @param func Convenience function called when the item is - * selected. - * @param func_data Data to be passed to @p func. - * @return A handle to the item added or @c NULL, on errors. - * - * This inserts an item before another in the gengrid. - * - * @see elm_gengrid_item_append() - * @see elm_gengrid_item_prepend() - * @see elm_gengrid_item_insert_after() - * @see elm_object_item_del() - * - * @ingroup Gengrid - */ -EAPI Elm_Object_Item *elm_gengrid_item_insert_before(Evas_Object *obj, const Elm_Gengrid_Item_Class *gic, const void *data, Elm_Object_Item *relative, Evas_Smart_Cb func, const void *func_data); - -/** - * Insert an item after another in a gengrid widget - * - * @param obj The gengrid object. - * @param gic The item class for the item. - * @param data The item data. - * @param relative The item to place this new one after. - * @param func Convenience function called when the item is - * selected. - * @param func_data Data to be passed to @p func. - * @return A handle to the item added or @c NULL, on errors. - * - * This inserts an item after another in the gengrid. - * - * @see elm_gengrid_item_append() - * @see elm_gengrid_item_prepend() - * @see elm_gengrid_item_insert_after() - * @see elm_object_item_del() - * - * @ingroup Gengrid - */ -EAPI Elm_Object_Item *elm_gengrid_item_insert_after(Evas_Object *obj, const Elm_Gengrid_Item_Class *gic, const void *data, Elm_Object_Item *relative, Evas_Smart_Cb func, const void *func_data); - -/** - * Insert an item in a gengrid widget using a user-defined sort function. - * - * @param obj The gengrid object. - * @param gic The item class for the item. - * @param data The item data. - * @param comp User defined comparison function that defines the sort order - * based on Elm_Gen_Item and its data param. - * @param func Convenience function called when the item is selected. - * @param func_data Data to be passed to @p func. - * @return A handle to the item added or @c NULL, on errors. - * - * This inserts an item in the gengrid based on user defined comparison - * function. The two arguments passed to the function @p func are gengrid - * item handles to compare. - * - * @see elm_gengrid_item_append() - * @see elm_gengrid_item_prepend() - * @see elm_gengrid_item_insert_after() - * @see elm_object_item_del() - * - * @ingroup Gengrid - */ -EAPI Elm_Object_Item *elm_gengrid_item_sorted_insert(Evas_Object *obj, const Elm_Gengrid_Item_Class *gic, const void *data, Eina_Compare_Cb comp, Evas_Smart_Cb func, const void *func_data); - -/** - * Get the selected item in a given gengrid widget - * - * @param obj The gengrid object. - * @return The selected item's handle or @c NULL, if none is - * selected at the moment (and on errors) - * - * This returns the selected item in @p obj. If multi selection is - * enabled on @p obj (@see elm_gengrid_multi_select_set()), only - * the first item in the list is selected, which might not be very - * useful. For that case, see elm_gengrid_selected_items_get(). - * - * @ingroup Gengrid - */ -EAPI Elm_Object_Item *elm_gengrid_selected_item_get(const Evas_Object *obj); - -/** - * Get a list of selected items in a given gengrid - * - * @param obj The gengrid object. - * @return The list of selected items or @c NULL, if none is - * selected at the moment (and on errors) - * - * This returns a list of the selected items, in the order that - * they appear in the grid. This list is only valid as long as no - * more items are selected or unselected (or unselected implicitly - * by deletion). The list contains Gengrid item pointers as - * data, naturally. - * - * @see elm_gengrid_selected_item_get() - * - * @ingroup Gengrid - */ -EAPI const Eina_List *elm_gengrid_selected_items_get(const Evas_Object *obj); - -/** - * Get a list of realized items in gengrid - * - * @param obj The gengrid object - * @return The list of realized items, nor NULL if none are realized. - * - * This returns a list of the realized items in the gengrid. The list - * contains gengrid item pointers. The list must be freed by the - * caller when done with eina_list_free(). The item pointers in the - * list are only valid so long as those items are not deleted or the - * gengrid is not deleted. - * - * @see elm_gengrid_realized_items_update() - * - * @ingroup Gengrid - */ -EAPI Eina_List *elm_gengrid_realized_items_get(const Evas_Object *obj); - -/** - * Update the contents of all realized items. - * - * @param obj The gengrid object. - * - * This updates all realized items by calling all the item class functions again - * to get the contents, texts and states. Use this when the original - * item data has changed and the changes are desired to be reflected. - * - * To update just one item, use elm_gengrid_item_update(). - * - * @see elm_gengrid_realized_items_get() - * @see elm_gengrid_item_update() - * - * @ingroup Gengrid - */ -EAPI void elm_gengrid_realized_items_update(Evas_Object *obj); - -/** - * Get the first item in a given gengrid widget - * - * @param obj The gengrid object - * @return The first item's handle or @c NULL, if there are no - * items in @p obj (and on errors) - * - * This returns the first item in the @p obj's internal list of - * items. - * - * @see elm_gengrid_last_item_get() - * - * @ingroup Gengrid - */ -EAPI Elm_Object_Item *elm_gengrid_first_item_get(const Evas_Object *obj); - -/** - * Get the last item in a given gengrid widget - * - * @param obj The gengrid object - * @return The last item's handle or @c NULL, if there are no - * items in @p obj (and on errors) - * - * This returns the last item in the @p obj's internal list of - * items. - * - * @see elm_gengrid_first_item_get() - * - * @ingroup Gengrid - */ -EAPI Elm_Object_Item *elm_gengrid_last_item_get(const Evas_Object *obj); - -/** - * Set the scrollbar policy - * - * @param obj The gengrid object - * @param policy_h Horizontal scrollbar policy. - * @param policy_v Vertical scrollbar policy. - * - * This sets the scrollbar visibility policy for the given gengrid - * scroller. #ELM_SCROLLER_POLICY_AUTO means the scrollbar is made - * visible if it is needed, and otherwise kept - * hidden. #ELM_SCROLLER_POLICY_ON turns it on all the time, and - * #ELM_SCROLLER_POLICY_OFF always keeps it off. This applies - * respectively for the horizontal and vertical scrollbars. Default - * is #ELM_SCROLLER_POLICY_AUTO. - * - * @deprecated Use elm_scroller_policy_set() instead. - * - * @see elm_scroller_policy_set() - * - * @see elm_gengrid_scroller_policy_get() - * - * @ingroup Gengrid - */ -EINA_DEPRECATED EAPI void elm_gengrid_scroller_policy_set(Evas_Object *obj, Elm_Scroller_Policy policy_h, Elm_Scroller_Policy policy_v); - -/** - * Get the scrollbar policy - * - * @param obj The gengrid object - * @param policy_h Pointer to store the horizontal scrollbar policy. - * @param policy_v Pointer to store the vertical scrollbar policy. - * - * @deprecated Use elm_scroller_policy_get() instead. - * - * @see elm_scroller_policy_get() - * - * @see elm_gengrid_scroller_policy_set() - * - * @ingroup Gengrid - */ -EINA_DEPRECATED EAPI void elm_gengrid_scroller_policy_get(const Evas_Object *obj, Elm_Scroller_Policy *policy_h, Elm_Scroller_Policy *policy_v); - -/** - * Get the @b next item in a gengrid widget's internal list of items, - * given a handle to one of those items. - * - * @param it The gengrid item to fetch next from - * @return The item after @p item, or @c NULL if there's none (and - * on errors) - * - * This returns the item placed after the @p item, on the container - * gengrid. - * - * @see elm_gengrid_item_prev_get() - * - * @ingroup Gengrid - */ -EAPI Elm_Object_Item *elm_gengrid_item_next_get(const Elm_Object_Item *it); - -/** - * Get the @b previous item in a gengrid widget's internal list of items, - * given a handle to one of those items. - * - * @param it The gengrid item to fetch previous from - * @return The item before @p item, or @c NULL if there's none (and - * on errors) - * - * This returns the item placed before the @p item, on the container - * gengrid. - * - * @see elm_gengrid_item_next_get() - * - * @ingroup Gengrid - */ -EAPI Elm_Object_Item *elm_gengrid_item_prev_get(const Elm_Object_Item *it); - -/** - * Set whether a given gengrid item is selected or not - * - * @param it The gengrid item - * @param selected Use @c EINA_TRUE, to make it selected, @c - * EINA_FALSE to make it unselected - * - * This sets the selected state of an item. If multi-selection is - * not enabled on the containing gengrid and @p selected is @c - * EINA_TRUE, any other previously selected items will get - * unselected in favor of this new one. - * - * @see elm_gengrid_item_selected_get() - * - * @ingroup Gengrid - */ -EAPI void elm_gengrid_item_selected_set(Elm_Object_Item *it, Eina_Bool selected); - -/** - * Get whether a given gengrid item is selected or not - * - * @param it The gengrid item - * @return @c EINA_TRUE, if it's selected, @c EINA_FALSE otherwise - * - * This API returns EINA_TRUE for all the items selected in multi-select mode as well. - * - * @see elm_gengrid_item_selected_set() for more details - * - * @ingroup Gengrid - */ -EAPI Eina_Bool elm_gengrid_item_selected_get(const Elm_Object_Item *it); - -/** - * Show the portion of a gengrid's internal grid containing a given - * item, @b immediately. - * - * @param it The item to display - * @param type Where to position the item in the viewport. - * - * This causes gengrid to @b redraw its viewport's contents to the - * region containing the given @p item item, if it is not fully - * visible. - * - * @see elm_gengrid_item_bring_in() - * - * @ingroup Gengrid - */ -EAPI void elm_gengrid_item_show(Elm_Object_Item *it, Elm_Gengrid_Item_Scrollto_Type type); - -/** - * Animatedly bring in, to the visible area of a gengrid, a given - * item on it. - * - * @param it The gengrid item to display - * @param type Where to position the item in the viewport. - * - * This causes gengrid to jump to the given @p item and show - * it (by scrolling), if it is not fully visible. This will use - * animation to do so and take a period of time to complete. - * - * @see elm_gengrid_item_show() - * - * @ingroup Gengrid - */ -EAPI void elm_gengrid_item_bring_in(Elm_Object_Item *it, Elm_Gengrid_Item_Scrollto_Type type); - -/** - * Update the contents of a given gengrid item - * - * @param it The gengrid item - * - * This updates an item by calling all the item class functions - * again to get the contents, texts and states. Use this when the - * original item data has changed and you want the changes to be - * reflected. - * - * @ingroup Gengrid - */ -EAPI void elm_gengrid_item_update(Elm_Object_Item *it); - -/** - * Update the item class of a gengrid item. - * - * This sets another class of the item, changing the way that it is - * displayed. After changing the item class, elm_gengrid_item_update() is - * called on the item @p it. - * - * @param it The gengrid item - * @param gic The gengrid item class describing the function pointers and the item style. - * - * @ingroup Gengrid - */ -EAPI void elm_gengrid_item_item_class_update(Elm_Object_Item *it, const Elm_Gengrid_Item_Class *gic); - -/** - * Get the Gengrid Item class for the given Gengrid Item. - * - * @param it The gengrid item - * - * This returns the Gengrid_Item_Class for the given item. It can be used to examine - * the function pointers and item_style. - * - * @ingroup Gengrid - */ -EAPI const Elm_Gengrid_Item_Class *elm_gengrid_item_item_class_get(const Elm_Object_Item *it); - -/** - * Get the index of the item. It is only valid once displayed. - * - * @param it a gengrid item - * @return the position inside the list of item. - * - * @ingroup Gengrid - */ -EAPI int elm_gengrid_item_index_get(const Elm_Object_Item *it); - -/** - * Return how many items are currently in a list - * - * @param obj The list - * @return The total number of list items in the list - * - * This behavior is O(1) and includes items which may or may not be realized. - * - * @ingroup Gengrid - */ -EAPI unsigned int elm_gengrid_items_count(const Evas_Object *obj); - -/** - * Add a new gengrid item class in a given gengrid widget. - * - * @return New allocated a gengrid item class. - * - * This adds gengrid item class for the gengrid widget. When adding an item, - * gengrid_item_{append, prepend, insert} function needs item class of the item. - * 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. - * - * @see elm_gengrid_item_class_free() - * @see elm_gengrid_item_append() - * - * @ingroup Gengrid - */ -EAPI Elm_Gengrid_Item_Class *elm_gengrid_item_class_new(void); - -/** - * Remove an item class in a given gengrid widget. - * - * @param itc The itc to be removed. - * - * This removes item class from the gengrid widget. - * Whenever it has no more references to it, item class is going to be freed. - * Otherwise it just decreases its reference count. - * - * @see elm_gengrid_item_class_new() - * @see elm_gengrid_item_class_ref() - * @see elm_gengrid_item_class_unref() - * - * @ingroup Gengrid - */ -EAPI void elm_gengrid_item_class_free(Elm_Gengrid_Item_Class *itc); - -/** - * Increments object reference count for the item class. - * - * @param itc The given item class object to reference - * - * This API just increases its reference count for item class management. - * - * @see elm_gengrid_item_class_unref() - * - * @ingroup Gengrid - */ -EAPI void elm_gengrid_item_class_ref(Elm_Gengrid_Item_Class *itc); - -/** - * Decrements object reference count for the item class. - * - * @param itc The given item class object to reference - * - * This API just decreases its reference count for item class management. - * Reference count can't be less than 0. - * - * @see elm_gengrid_item_class_ref() - * @see elm_gengrid_item_class_free() - * - * @ingroup Gengrid - */ -EAPI void elm_gengrid_item_class_unref(Elm_Gengrid_Item_Class *itc); - -/** - * Set the text to be shown in a given gengrid item's tooltips. - * - * @param it The gengrid item - * @param text The text to set in the content - * - * This call will setup the text to be used as tooltip to that item - * (analogous to elm_object_tooltip_text_set(), but being item - * tooltips with higher precedence than object tooltips). It can - * have only one tooltip at a time, so any previous tooltip data - * will get removed. - * - * In order to set a content or something else as a tooltip, look at - * elm_gengrid_item_tooltip_content_cb_set(). - * - * @ingroup Gengrid - */ -EAPI void elm_gengrid_item_tooltip_text_set(Elm_Object_Item *it, const char *text); - -/** - * Set the content to be shown in a given gengrid item's tooltip - * - * @param it The gengrid item. - * @param func The function returning the tooltip contents. - * @param data What to provide to @a func as callback data/context. - * @param del_cb Called when data is not needed anymore, either when - * another callback replaces @p func, the tooltip is unset with - * elm_gengrid_item_tooltip_unset() or the owner @p item - * dies. This callback receives as its first parameter the - * given @p data, being @c event_info the item handle. - * - * This call will setup the tooltip's contents to @p item - * (analogous to elm_object_tooltip_content_cb_set(), but being - * item tooltips with higher precedence than object tooltips). It - * can have only one tooltip at a time, so any previous tooltip - * content will get removed. @p func (with @p data) will be called - * every time Elementary needs to show the tooltip and it should - * return a valid Evas object, which will be fully managed by the - * tooltip system, getting deleted when the tooltip is gone. - * - * In order to set just a text as a tooltip, look at - * elm_gengrid_item_tooltip_text_set(). - * - * @ingroup Gengrid - */ -EAPI void elm_gengrid_item_tooltip_content_cb_set(Elm_Object_Item *it, Elm_Tooltip_Item_Content_Cb func, const void *data, Evas_Smart_Cb del_cb); - -/** - * Unset a tooltip from a given gengrid item - * - * @param it gengrid item to remove a previously set tooltip from. - * - * This call removes any tooltip set on @p item. The callback - * provided as @c del_cb to - * elm_gengrid_item_tooltip_content_cb_set() will be called to - * notify it is not used anymore (and have resources cleaned, if - * need be). - * - * @see elm_gengrid_item_tooltip_content_cb_set() - * - * @ingroup Gengrid - */ -EAPI void elm_gengrid_item_tooltip_unset(Elm_Object_Item *it); - -/** - * Set a different @b style for a given gengrid item's tooltip. - * - * @param it gengrid item with tooltip set - * @param style the theme style to use on tooltips (e.g. @c - * "default", @c "transparent", etc) - * - * Tooltips can have alternate styles to be displayed on, - * which are defined by the theme set on Elementary. This function - * works analogously as elm_object_tooltip_style_set(), but here - * applied only to gengrid item objects. The default style for - * tooltips is @c "default". - * - * @note before you set a style you should define a tooltip with - * elm_gengrid_item_tooltip_content_cb_set() or - * elm_gengrid_item_tooltip_text_set() - * - * @see elm_gengrid_item_tooltip_style_get() - * - * @ingroup Gengrid - */ -EAPI void elm_gengrid_item_tooltip_style_set(Elm_Object_Item *it, const char *style); - -/** - * Get the style set a given gengrid item's tooltip. - * - * @param it gengrid item with tooltip already set on. - * @return style the theme style in use, which defaults to - * "default". If the object does not have a tooltip set, - * then @c NULL is returned. - * - * @see elm_gengrid_item_tooltip_style_set() for more details - * - * @ingroup Gengrid - */ -EAPI const char *elm_gengrid_item_tooltip_style_get(const Elm_Object_Item *it); - -/** - * @brief Disable size restrictions on an object's tooltip - * @param it The tooltip's anchor object - * @param disable If EINA_TRUE, size restrictions are disabled - * @return EINA_FALSE on failure, EINA_TRUE on success - * - * This function allows a tooltip to expand beyond its parent window's canvas. - * It will instead be limited only by the size of the display. - */ -EAPI Eina_Bool elm_gengrid_item_tooltip_window_mode_set(Elm_Object_Item *it, Eina_Bool disable); - -/** - * @brief Retrieve size restriction state of an object's tooltip - * @param it The tooltip's anchor object - * @return If EINA_TRUE, size restrictions are disabled - * - * This function returns whether a tooltip is allowed to expand beyond - * its parent window's canvas. - * It will instead be limited only by the size of the display. - */ -EAPI Eina_Bool elm_gengrid_item_tooltip_window_mode_get(const Elm_Object_Item *it); - -/** - * Set the type of mouse pointer/cursor decoration to be shown, - * when the mouse pointer is over the given gengrid widget item - * - * @param it gengrid item to customize cursor on - * @param cursor the cursor type's name - * - * This function works analogously as elm_object_cursor_set(), but - * here the cursor's changing area is restricted to the item's - * area, and not the whole widget's. Note that that item cursors - * have precedence over widget cursors, so that a mouse over @p - * item will always show cursor @p type. - * - * If this function is called twice for an object, a previously set - * cursor will be unset on the second call. - * - * @see elm_object_cursor_set() - * @see elm_gengrid_item_cursor_get() - * @see elm_gengrid_item_cursor_unset() - * - * @ingroup Gengrid - */ -EAPI void elm_gengrid_item_cursor_set(Elm_Object_Item *it, const char *cursor); - -/** - * Get the type of mouse pointer/cursor decoration set to be shown, - * when the mouse pointer is over the given gengrid widget item - * - * @param it gengrid item with custom cursor set - * @return the cursor type's name or @c NULL, if no custom cursors - * were set to @p item (and on errors) - * - * @see elm_object_cursor_get() - * @see elm_gengrid_item_cursor_set() for more details - * @see elm_gengrid_item_cursor_unset() - * - * @ingroup Gengrid - */ -EAPI const char *elm_gengrid_item_cursor_get(const Elm_Object_Item *it); - -/** - * Unset any custom mouse pointer/cursor decoration set to be - * shown, when the mouse pointer is over the given gengrid widget - * item, thus making it show the @b default cursor again. - * - * @param it a gengrid item - * - * Use this call to undo any custom settings on this item's cursor - * decoration, bringing it back to defaults (no custom style set). - * - * @see elm_object_cursor_unset() - * @see elm_gengrid_item_cursor_set() for more details - * - * @ingroup Gengrid - */ -EAPI void elm_gengrid_item_cursor_unset(Elm_Object_Item *it); - -/** - * Set a different @b style for a given custom cursor set for a - * gengrid item. - * - * @param it gengrid item with custom cursor set - * @param style the theme style to use (e.g. @c "default", - * @c "transparent", etc) - * - * This function only makes sense when one is using custom mouse - * cursor decorations defined in a theme file , which can - * have, given a cursor name/type, alternate styles on - * it. It works analogously as elm_object_cursor_style_set(), but - * here applied only to gengrid item objects. - * - * @warning Before you set a cursor style you should have defined a - * custom cursor previously on the item, with - * elm_gengrid_item_cursor_set() - * - * @see elm_gengrid_item_cursor_engine_only_set() - * @see elm_gengrid_item_cursor_style_get() - * - * @ingroup Gengrid - */ -EAPI void elm_gengrid_item_cursor_style_set(Elm_Object_Item *it, const char *style); - -/** - * Get the current @b style set for a given gengrid item's custom - * cursor - * - * @param it gengrid item with custom cursor set. - * @return style the cursor style in use. If the object does not - * have a cursor set, then @c NULL is returned. - * - * @see elm_gengrid_item_cursor_style_set() for more details - * - * @ingroup Gengrid - */ -EAPI const char *elm_gengrid_item_cursor_style_get(const Elm_Object_Item *it); - -/** - * Set if the (custom) cursor for a given gengrid item should be - * searched in its theme, also, or should only rely on the - * rendering engine. - * - * @param it item with custom (custom) cursor already set on - * @param engine_only Use @c EINA_TRUE to have cursors looked for - * only on those provided by the rendering engine, @c EINA_FALSE to - * have them searched on the widget's theme, as well. - * - * @note This call is of use only if you've set a custom cursor - * for gengrid items, with elm_gengrid_item_cursor_set(). - * - * @note By default, cursors will only be looked for between those - * provided by the rendering engine. - * - * @ingroup Gengrid - */ -EAPI void elm_gengrid_item_cursor_engine_only_set(Elm_Object_Item *it, Eina_Bool engine_only); - -/** - * Get if the (custom) cursor for a given gengrid item is being - * searched in its theme, also, or is only relying on the rendering - * engine. - * - * @param it a gengrid item - * @return @c EINA_TRUE, if cursors are being looked for only on - * those provided by the rendering engine, @c EINA_FALSE if they - * are being searched on the widget's theme, as well. - * - * @see elm_gengrid_item_cursor_engine_only_set(), for more details - * - * @ingroup Gengrid - */ -EAPI Eina_Bool elm_gengrid_item_cursor_engine_only_get(const Elm_Object_Item *it); - -/** - * Set the size for the items of a given gengrid widget - * - * @param obj The gengrid object. - * @param w The items' width. - * @param h The items' height; - * - * A gengrid, after creation, has still no information on the size - * to give to each of its cells. So, you most probably will end up - * with squares one @ref Fingers "finger" wide, the default - * size. Use this function to force a custom size for you items, - * making them as big as you wish. - * - * @see elm_gengrid_item_size_get() - * - * @ingroup Gengrid - */ -EAPI void elm_gengrid_item_size_set(Evas_Object *obj, Evas_Coord w, Evas_Coord h); - -/** - * Get the size set for the items of a given gengrid widget - * - * @param obj The gengrid object. - * @param w Pointer to a variable where to store the items' width. - * @param h Pointer to a variable where to store the items' height. - * - * @note Use @c NULL pointers on the size values you're not - * interested in: they'll be ignored by the function. - * - * @see elm_gengrid_item_size_get() for more details - * - * @ingroup Gengrid - */ -EAPI void elm_gengrid_item_size_get(const Evas_Object *obj, Evas_Coord *w, Evas_Coord *h); - -/** - * Set the size for the group items of a given gengrid widget - * - * @param obj The gengrid object. - * @param w The group items' width. - * @param h The group items' height; - * - * A gengrid, after creation, has still no information on the size - * to give to each of its cells. So, you most probably will end up - * with squares one @ref Fingers "finger" wide, the default - * size. Use this function to force a custom size for you group items, - * making them as big as you wish. - * - * @see elm_gengrid_group_item_size_get() - * - * @ingroup Gengrid - */ -EAPI void elm_gengrid_group_item_size_set(Evas_Object *obj, Evas_Coord w, Evas_Coord h); - -/** - * Get the size set for the group items of a given gengrid widget - * - * @param obj The gengrid object. - * @param w Pointer to a variable where to store the group items' width. - * @param h Pointer to a variable where to store the group items' height. - * - * @note Use @c NULL pointers on the size values you're not - * interested in: they'll be ignored by the function. - * - * @see elm_gengrid_group_item_size_get() for more details - * - * @ingroup Gengrid - */ -EAPI void elm_gengrid_group_item_size_get(const Evas_Object *obj, Evas_Coord *w, Evas_Coord *h); - -/** - * Set the items grid's alignment within a given gengrid widget - * - * @param obj The gengrid object. - * @param align_x Alignment in the horizontal axis (0 <= align_x <= 1). - * @param align_y Alignment in the vertical axis (0 <= align_y <= 1). - * - * This sets the alignment of the whole grid of items of a gengrid - * within its given viewport. By default, those values are both - * 0.5, meaning that the gengrid will have its items grid placed - * exactly in the middle of its viewport. - * - * @note If given alignment values are out of the cited ranges, - * they'll be changed to the nearest boundary values on the valid - * ranges. - * - * @see elm_gengrid_align_get() - * - * @ingroup Gengrid - */ -EAPI void elm_gengrid_align_set(Evas_Object *obj, double align_x, double align_y); - -/** - * Get the items grid's alignment values within a given gengrid - * widget - * - * @param obj The gengrid object. - * @param align_x Pointer to a variable where to store the - * horizontal alignment. - * @param align_y Pointer to a variable where to store the vertical - * alignment. - * - * @note Use @c NULL pointers on the alignment values you're not - * interested in: they'll be ignored by the function. - * - * @see elm_gengrid_align_set() for more details - * - * @ingroup Gengrid - */ -EAPI void elm_gengrid_align_get(const Evas_Object *obj, double *align_x, double *align_y); - -/** - * Set whether a given gengrid widget is or not able have items - * @b reordered - * - * @param obj The gengrid object - * @param reorder_mode Use @c EINA_TRUE to turn reordering on, - * @c EINA_FALSE to turn it off - * - * If a gengrid is set to allow reordering, a click held for more - * than 0.5 over a given item will highlight it specially, - * signaling the gengrid has entered the reordering state. From - * that time on, the user will be able to, while still holding the - * mouse button down, move the item freely in the gengrid's - * viewport, replacing to said item to the locations it goes to. - * The replacements will be animated and, whenever the user - * releases the mouse button, the item being replaced gets a new - * definitive place in the grid. - * - * @see elm_gengrid_reorder_mode_get() - * - * @ingroup Gengrid - */ -EAPI void elm_gengrid_reorder_mode_set(Evas_Object *obj, Eina_Bool reorder_mode); - -/** - * Get whether a given gengrid widget is or not able have items - * @b reordered - * - * @param obj The gengrid object - * @return @c EINA_TRUE, if reordering is on, @c EINA_FALSE if it's - * off - * - * @see elm_gengrid_reorder_mode_set() for more details - * - * @ingroup Gengrid - */ -EAPI Eina_Bool elm_gengrid_reorder_mode_get(const Evas_Object *obj); - - -/** - * Set a given gengrid widget's scrolling page size, relative to - * its viewport size. - * - * @param obj The gengrid object - * @param h_pagerel The horizontal page (relative) size - * @param v_pagerel The vertical page (relative) size - * - * The gengrid's scroller is capable of binding scrolling by the - * user to "pages". It means that, while scrolling and, specially - * after releasing the mouse button, the grid will @b snap to the - * nearest displaying page's area. When page sizes are set, the - * grid's continuous content area is split into (equal) page sized - * pieces. - * - * This function sets the size of a page relatively to the - * viewport dimensions of the gengrid, for each axis. A value - * @c 1.0 means "the exact viewport's size", in that axis, while @c - * 0.0 turns paging off in that axis. Likewise, @c 0.5 means "half - * a viewport". Sane usable values are, than, between @c 0.0 and @c - * 1.0. Values beyond those will make it behave behave - * inconsistently. If you only want one axis to snap to pages, use - * the value @c 0.0 for the other one. - * - * There is a function setting page size values in @b absolute - * values, too -- elm_gengrid_page_size_set(). Naturally, its use - * is mutually exclusive to this one. - * - * @deprecated Use elm_scroller_page_relative_set() instead. - * - * @see elm_scroller_page_relative_set() - * - * @ingroup Gengrid - */ -EINA_DEPRECATED EAPI void elm_gengrid_page_relative_set(Evas_Object *obj, double h_pagerel, double v_pagerel); - -/** - * Get a given gengrid widget's scrolling page size, relative to - * its viewport size. - * - * @param obj The gengrid object - * @param h_pagerel Pointer to a variable where to store the - * horizontal page (relative) size - * @param v_pagerel Pointer to a variable where to store the - * vertical page (relative) size - * - * @deprecated Use elm_scroller_page_relative_get() instead. - * - * @see elm_scroller_page_relative_get() - * - * @ingroup Gengrid - */ -EINA_DEPRECATED EAPI void elm_gengrid_page_relative_get(const Evas_Object *obj, double *h_pagerel, double *v_pagerel); - -/** - * Set a given gengrid widget's scrolling page size - * - * @param obj The gengrid object - * @param h_pagesize The horizontal page size, in pixels - * @param v_pagesize The vertical page size, in pixels - * - * The gengrid's scroller is capable of binding scrolling by the - * user to "pages". It means that, while scrolling and, specially - * after releasing the mouse button, the grid will @b snap to the - * nearest displaying page's area. When page sizes are set, the - * grid's continuous content area is split into (equal) page sized - * pieces. - * - * This function sets the size of a page of the gengrid, in pixels, - * for each axis. Sane usable values are, between @c 0 and the - * dimensions of @p obj, for each axis. Values beyond those will - * make it behave behave inconsistently. If you only want one axis - * to snap to pages, use the value @c 0 for the other one. - * - * There is a function setting page size values in @b relative - * values, too -- elm_gengrid_page_relative_set(). Naturally, its - * use is mutually exclusive to this one. - * - * @deprecated Use elm_scroller_page_size_set() instead. - * - * @see elm_scroller_page_size_set() - * - * @ingroup Gengrid - */ -EINA_DEPRECATED EAPI void elm_gengrid_page_size_set(Evas_Object *obj, Evas_Coord h_pagesize, Evas_Coord v_pagesize); - -/** - * @brief Get gengrid current page number. - * - * @param obj The gengrid object - * @param h_pagenumber The horizontal page number - * @param v_pagenumber The vertical page number - * - * The page number starts from 0. 0 is the first page. - * Current page means the page which meet the top-left of the viewport. - * If there are two or more pages in the viewport, it returns the number of page - * which meet the top-left of the viewport. - * - * @deprecated Use elm_scroller_current_page_set() instead. - * - * @see elm_scroller_current_page_set() - * - * @see elm_gengrid_last_page_get() - * @see elm_gengrid_page_show() - * @see elm_gengrid_page_bring_in() - */ -EINA_DEPRECATED EAPI void elm_gengrid_current_page_get(const Evas_Object *obj, int *h_pagenumber, int *v_pagenumber); - -/** - * @brief Get gengrid last page number. - * - * @param obj The gengrid object - * @param h_pagenumber The horizontal page number - * @param v_pagenumber The vertical page number - * - * The page number starts from 0. 0 is the first page. - * This returns the last page number among the pages. - * - * @deprecated Use elm_scroller_last_page_set() instead. - * - * @see elm_scroller_last_page_set() - * - * @see elm_gengrid_current_page_get() - * @see elm_gengrid_page_show() - * @see elm_gengrid_page_bring_in() - */ -EINA_DEPRECATED EAPI void elm_gengrid_last_page_get(const Evas_Object *obj, int *h_pagenumber, int *v_pagenumber); - -/** - * Show a specific virtual region within the gengrid content object by page number. - * - * @param obj The gengrid object - * @param h_pagenumber The horizontal page number - * @param v_pagenumber The vertical page number - * - * 0, 0 of the indicated page is located at the top-left of the viewport. - * This will jump to the page directly without animation. - * - * Example of usage: - * - * @code - * sc = elm_gengrid_add(win); - * elm_gengrid_content_set(sc, content); - * elm_gengrid_page_relative_set(sc, 1, 0); - * elm_gengrid_current_page_get(sc, &h_page, &v_page); - * elm_gengrid_page_show(sc, h_page + 1, v_page); - * @endcode - * - * @see elm_gengrid_page_bring_in() - */ -EAPI void elm_gengrid_page_show(const Evas_Object *obj, int h_pagenumber, int v_pagenumber); - -/** - * Show a specific virtual region within the gengrid content object by page number. - * - * @param obj The gengrid object - * @param h_pagenumber The horizontal page number - * @param v_pagenumber The vertical page number - * - * 0, 0 of the indicated page is located at the top-left of the viewport. - * This will slide to the page with animation. - * - * Example of usage: - * - * @code - * sc = elm_gengrid_add(win); - * elm_gengrid_content_set(sc, content); - * elm_gengrid_page_relative_set(sc, 1, 0); - * elm_gengrid_last_page_get(sc, &h_page, &v_page); - * elm_gengrid_page_bring_in(sc, h_page, v_page); - * @endcode - * - * @deprecated Use elm_scroller_page_bring_in() instead. - * - * @see elm_scroller_page_bring_in() - * - * @see elm_gengrid_page_show() - */ -EINA_DEPRECATED EAPI void elm_gengrid_page_bring_in(const Evas_Object *obj, int h_pagenumber, int v_pagenumber); - -/** - * Get a given gengrid item's position, relative to the whole - * gengrid's grid area. - * - * @param it The Gengrid item. - * @param x Pointer to variable to store the item's row number. - * @param y Pointer to variable to store the item's column number. - * - * This returns the "logical" position of the item within the - * gengrid. For example, @c (0, 1) would stand for first row, - * second column. - * - * @ingroup Gengrid - */ -EAPI void elm_gengrid_item_pos_get(const Elm_Object_Item *it, unsigned int *x, unsigned int *y); - -/** - * Set how the items grid's filled within a given gengrid widget - * - * @param obj The gengrid object. - * @param fill Filled if True - * - * This sets the fill state of the whole grid of items of a gengrid - * within its given viewport. By default, this value is false, meaning - * that if the first line of items grid's isn't filled, the items are - * centered with the alignment - * - * @see elm_gengrid_filled_get() - * - * @ingroup Gengrid - * - */ -EAPI void elm_gengrid_filled_set(Evas_Object *obj, Eina_Bool fill); - -/** - * Get how the items grid's filled within a given gengrid widget - * - * @param obj The gengrid object. - * @return @c EINA_TRUE, if filled is on, @c EINA_FALSE if it's - * off - * - * @note Use @c NULL pointers on the alignment values you're not - * interested in: they'll be ignored by the function. - * - * @see elm_gengrid_align_set() for more details - * - * @ingroup Gengrid - */ -EAPI Eina_Bool elm_gengrid_filled_get(const Evas_Object *obj); - -/** - * Set the gengrid select mode. - * - * @param obj The gengrid object - * @param mode The select mode - * - * elm_gengrid_select_mode_set() changes item select mode in the gengrid widget. - * - ELM_OBJECT_SELECT_MODE_DEFAULT : Items will only call their selection func and - * callback when first becoming selected. Any further clicks will - * do nothing, unless you set always select mode. - * - ELM_OBJECT_SELECT_MODE_ALWAYS : This means that, even if selected, - * every click will make the selected callbacks be called. - * - ELM_OBJECT_SELECT_MODE_NONE : This will turn off the ability to select items - * entirely and they will neither appear selected nor call selected - * callback functions. - * - * @see elm_gengrid_select_mode_get() - * - * @ingroup Gengrid - */ -EAPI void elm_gengrid_select_mode_set(Evas_Object *obj, Elm_Object_Select_Mode mode); - -/** - * Get the gengrid select mode. - * - * @param obj The gengrid object - * @return The select mode - * (If getting mode is failed, it returns ELM_OBJECT_SELECT_MODE_MAX) - * - * @see elm_gengrid_select_mode_set() - * - * @ingroup Gengrid - */ -EAPI Elm_Object_Select_Mode elm_gengrid_select_mode_get(const Evas_Object *obj); - -/** - * Set whether the gengrid items' should be highlighted when item selected. - * - * @param obj The gengrid object. - * @param highlight @c EINA_TRUE to enable highlight or @c EINA_FALSE to - * disable it. - * - * This will turn on/off the highlight effect when items are selected and - * they will or will not be highlighted. The selected and clicked - * callback functions will still be called. - * - * highlight is enabled by default. - * - * @see elm_gengrid_highlight_mode_get(). - * - * @ingroup Gengrid - */ - -EAPI void elm_gengrid_highlight_mode_set(Evas_Object *obj, Eina_Bool highlight); - -/** - * Get whether the gengrid items' should be highlighted when item selected. - * - * @param obj The gengrid object. - * @return @c EINA_TRUE means items can be highlighted. @c EINA_FALSE indicates - * they can't. If @p obj is @c NULL, @c EINA_FALSE is returned. - * - * @see elm_gengrid_highlight_mode_set() for details. - * - * @ingroup Gengrid - */ - -EAPI Eina_Bool elm_gengrid_highlight_mode_get(const Evas_Object *obj); - -/** - * Set the gengrid item's select mode. - * - * @param it The gengrid item object - * @param mode The select mode - * - * elm_gengrid_select_mode_set() changes item's select mode. - * - ELM_OBJECT_SELECT_MODE_DEFAULT : The item will only call their selection func and - * callback when first becoming selected. Any further clicks will - * do nothing, unless you set always select mode. - * - ELM_OBJECT_SELECT_MODE_ALWAYS : This means that, even if selected, - * every click will make the selected callbacks be called. - * - ELM_OBJECT_SELECT_MODE_NONE : This will turn off the ability to select the item - * entirely and they will neither appear selected nor call selected - * callback functions. - * - ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY : This will apply no-finger-size rule - * with ELM_OBJECT_SELECT_MODE_NONE. No-finger-size rule makes an item can be - * smaller than lower limit. Clickable objects should be bigger than - * human touch point device (your finger) for some touch or - * small screen devices. So it is enabled, the item can be shrink than - * predefined finger-size value. And the item will be updated. - * - * @see elm_gengrid_item_select_mode_get() - * - * @ingroup Gengrid - */ -EAPI void elm_gengrid_item_select_mode_set(Elm_Object_Item *it, Elm_Object_Select_Mode mode); - -/** - * Get the gengrid item's select mode. - * - * @param it The gengrid item object - * @return The select mode - * (If getting mode is failed, it returns ELM_OBJECT_SELECT_MODE_MAX) - * - * @see elm_gengrid_item_select_mode_set() - * - * @ingroup Gengrid - */ -EAPI Elm_Object_Select_Mode elm_gengrid_item_select_mode_get(const Elm_Object_Item *it); - - -/** - * Get the nth item, in a given gengrid widget, placed at position @p nth, in - * its internal items list - * - * @param obj The gengrid object - * @param nth The number of the item to grab (0 being the first) - * - * @return The item stored in @p obj at position @p nth or @c NULL, if there's - * no item with that index (and on errors) - * - * @ingroup Genilst - * @since 1.8 - */ -EAPI Elm_Object_Item *elm_gengrid_nth_item_get(const Evas_Object *obj, unsigned int nth); +#include +#ifdef EFL_EO_API_SUPPORT +#include +#endif +#ifndef EFL_NOLEGACY_API_SUPPORT +#include +#endif /** * @} diff --git a/legacy/elementary/src/lib/elm_gengrid_common.h b/legacy/elementary/src/lib/elm_gengrid_common.h new file mode 100644 index 0000000000..be770388d2 --- /dev/null +++ b/legacy/elementary/src/lib/elm_gengrid_common.h @@ -0,0 +1,567 @@ +#define ELM_GENGRID_ITEM_CLASS_VERSION ELM_GEN_ITEM_CLASS_VERSION +#define ELM_GENGRID_ITEM_CLASS_HEADER ELM_GEN_ITEM_CLASS_HEADER + +/** + * Defines where to position the item in the genlist. + * + * @ingroup Genlist + */ +typedef enum +{ + ELM_GENGRID_ITEM_SCROLLTO_NONE = 0, /**< no scrollto */ + ELM_GENGRID_ITEM_SCROLLTO_IN = (1 << 0), /**< to the nearest viewport */ + ELM_GENGRID_ITEM_SCROLLTO_TOP = (1 << 1), /**< to the top of viewport */ + ELM_GENGRID_ITEM_SCROLLTO_MIDDLE = (1 << 2) /**< to the middle of viewport */ +} Elm_Gengrid_Item_Scrollto_Type; + + +/** + * @see Elm_Gen_Item_Class + */ +typedef Elm_Gen_Item_Class Elm_Gengrid_Item_Class; + +/** + * @see Elm_Gen_Item_Text_Get_Cb + */ +typedef Elm_Gen_Item_Text_Get_Cb Elm_Gengrid_Item_Text_Get_Cb; + +/** + * @see Elm_Gen_Item_Content_Get_Cb + */ +typedef Elm_Gen_Item_Content_Get_Cb Elm_Gengrid_Item_Content_Get_Cb; + +/** + * @see Elm_Gen_Item_State_Get_Cb + */ +typedef Elm_Gen_Item_State_Get_Cb Elm_Gengrid_Item_State_Get_Cb; + +/** + * @see Elm_Gen_Item_Del_Cb + */ +typedef Elm_Gen_Item_Del_Cb Elm_Gengrid_Item_Del_Cb; + +/** + * Get the @b next item in a gengrid widget's internal list of items, + * given a handle to one of those items. + * + * @param it The gengrid item to fetch next from + * @return The item after @p item, or @c NULL if there's none (and + * on errors) + * + * This returns the item placed after the @p item, on the container + * gengrid. + * + * @see elm_gengrid_item_prev_get() + * + * @ingroup Gengrid + */ +EAPI Elm_Object_Item *elm_gengrid_item_next_get(const Elm_Object_Item *it); + +/** + * Get the @b previous item in a gengrid widget's internal list of items, + * given a handle to one of those items. + * + * @param it The gengrid item to fetch previous from + * @return The item before @p item, or @c NULL if there's none (and + * on errors) + * + * This returns the item placed before the @p item, on the container + * gengrid. + * + * @see elm_gengrid_item_next_get() + * + * @ingroup Gengrid + */ +EAPI Elm_Object_Item *elm_gengrid_item_prev_get(const Elm_Object_Item *it); + +/** + * Set whether a given gengrid item is selected or not + * + * @param it The gengrid item + * @param selected Use @c EINA_TRUE, to make it selected, @c + * EINA_FALSE to make it unselected + * + * This sets the selected state of an item. If multi-selection is + * not enabled on the containing gengrid and @p selected is @c + * EINA_TRUE, any other previously selected items will get + * unselected in favor of this new one. + * + * @see elm_gengrid_item_selected_get() + * + * @ingroup Gengrid + */ +EAPI void elm_gengrid_item_selected_set(Elm_Object_Item *it, Eina_Bool selected); + +/** + * Get whether a given gengrid item is selected or not + * + * @param it The gengrid item + * @return @c EINA_TRUE, if it's selected, @c EINA_FALSE otherwise + * + * This API returns EINA_TRUE for all the items selected in multi-select mode as well. + * + * @see elm_gengrid_item_selected_set() for more details + * + * @ingroup Gengrid + */ +EAPI Eina_Bool elm_gengrid_item_selected_get(const Elm_Object_Item *it); + +/** + * Show the portion of a gengrid's internal grid containing a given + * item, @b immediately. + * + * @param it The item to display + * @param type Where to position the item in the viewport. + * + * This causes gengrid to @b redraw its viewport's contents to the + * region containing the given @p item item, if it is not fully + * visible. + * + * @see elm_gengrid_item_bring_in() + * + * @ingroup Gengrid + */ +EAPI void elm_gengrid_item_show(Elm_Object_Item *it, Elm_Gengrid_Item_Scrollto_Type type); + +/** + * Animatedly bring in, to the visible area of a gengrid, a given + * item on it. + * + * @param it The gengrid item to display + * @param type Where to position the item in the viewport. + * + * This causes gengrid to jump to the given @p item and show + * it (by scrolling), if it is not fully visible. This will use + * animation to do so and take a period of time to complete. + * + * @see elm_gengrid_item_show() + * + * @ingroup Gengrid + */ +EAPI void elm_gengrid_item_bring_in(Elm_Object_Item *it, Elm_Gengrid_Item_Scrollto_Type type); + +/** + * Update the contents of a given gengrid item + * + * @param it The gengrid item + * + * This updates an item by calling all the item class functions + * again to get the contents, texts and states. Use this when the + * original item data has changed and you want the changes to be + * reflected. + * + * @ingroup Gengrid + */ +EAPI void elm_gengrid_item_update(Elm_Object_Item *it); + +/** + * Update the item class of a gengrid item. + * + * This sets another class of the item, changing the way that it is + * displayed. After changing the item class, elm_gengrid_item_update() is + * called on the item @p it. + * + * @param it The gengrid item + * @param gic The gengrid item class describing the function pointers and the item style. + * + * @ingroup Gengrid + */ +EAPI void elm_gengrid_item_item_class_update(Elm_Object_Item *it, const Elm_Gengrid_Item_Class *gic); + +/** + * Get the Gengrid Item class for the given Gengrid Item. + * + * @param it The gengrid item + * + * This returns the Gengrid_Item_Class for the given item. It can be used to examine + * the function pointers and item_style. + * + * @ingroup Gengrid + */ +EAPI const Elm_Gengrid_Item_Class *elm_gengrid_item_item_class_get(const Elm_Object_Item *it); + +/** + * Get the index of the item. It is only valid once displayed. + * + * @param it a gengrid item + * @return the position inside the list of item. + * + * @ingroup Gengrid + */ +EAPI int elm_gengrid_item_index_get(const Elm_Object_Item *it); + +/** + * Add a new gengrid item class in a given gengrid widget. + * + * @return New allocated a gengrid item class. + * + * This adds gengrid item class for the gengrid widget. When adding an item, + * gengrid_item_{append, prepend, insert} function needs item class of the item. + * 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. + * + * @see elm_gengrid_item_class_free() + * @see elm_gengrid_item_append() + * + * @ingroup Gengrid + */ +EAPI Elm_Gengrid_Item_Class *elm_gengrid_item_class_new(void); + +/** + * Remove an item class in a given gengrid widget. + * + * @param itc The itc to be removed. + * + * This removes item class from the gengrid widget. + * Whenever it has no more references to it, item class is going to be freed. + * Otherwise it just decreases its reference count. + * + * @see elm_gengrid_item_class_new() + * @see elm_gengrid_item_class_ref() + * @see elm_gengrid_item_class_unref() + * + * @ingroup Gengrid + */ +EAPI void elm_gengrid_item_class_free(Elm_Gengrid_Item_Class *itc); + +/** + * Increments object reference count for the item class. + * + * @param itc The given item class object to reference + * + * This API just increases its reference count for item class management. + * + * @see elm_gengrid_item_class_unref() + * + * @ingroup Gengrid + */ +EAPI void elm_gengrid_item_class_ref(Elm_Gengrid_Item_Class *itc); + +/** + * Decrements object reference count for the item class. + * + * @param itc The given item class object to reference + * + * This API just decreases its reference count for item class management. + * Reference count can't be less than 0. + * + * @see elm_gengrid_item_class_ref() + * @see elm_gengrid_item_class_free() + * + * @ingroup Gengrid + */ +EAPI void elm_gengrid_item_class_unref(Elm_Gengrid_Item_Class *itc); + +/** + * Set the text to be shown in a given gengrid item's tooltips. + * + * @param it The gengrid item + * @param text The text to set in the content + * + * This call will setup the text to be used as tooltip to that item + * (analogous to elm_object_tooltip_text_set(), but being item + * tooltips with higher precedence than object tooltips). It can + * have only one tooltip at a time, so any previous tooltip data + * will get removed. + * + * In order to set a content or something else as a tooltip, look at + * elm_gengrid_item_tooltip_content_cb_set(). + * + * @ingroup Gengrid + */ +EAPI void elm_gengrid_item_tooltip_text_set(Elm_Object_Item *it, const char *text); + +/** + * Set the content to be shown in a given gengrid item's tooltip + * + * @param it The gengrid item. + * @param func The function returning the tooltip contents. + * @param data What to provide to @a func as callback data/context. + * @param del_cb Called when data is not needed anymore, either when + * another callback replaces @p func, the tooltip is unset with + * elm_gengrid_item_tooltip_unset() or the owner @p item + * dies. This callback receives as its first parameter the + * given @p data, being @c event_info the item handle. + * + * This call will setup the tooltip's contents to @p item + * (analogous to elm_object_tooltip_content_cb_set(), but being + * item tooltips with higher precedence than object tooltips). It + * can have only one tooltip at a time, so any previous tooltip + * content will get removed. @p func (with @p data) will be called + * every time Elementary needs to show the tooltip and it should + * return a valid Evas object, which will be fully managed by the + * tooltip system, getting deleted when the tooltip is gone. + * + * In order to set just a text as a tooltip, look at + * elm_gengrid_item_tooltip_text_set(). + * + * @ingroup Gengrid + */ +EAPI void elm_gengrid_item_tooltip_content_cb_set(Elm_Object_Item *it, Elm_Tooltip_Item_Content_Cb func, const void *data, Evas_Smart_Cb del_cb); + +/** + * Unset a tooltip from a given gengrid item + * + * @param it gengrid item to remove a previously set tooltip from. + * + * This call removes any tooltip set on @p item. The callback + * provided as @c del_cb to + * elm_gengrid_item_tooltip_content_cb_set() will be called to + * notify it is not used anymore (and have resources cleaned, if + * need be). + * + * @see elm_gengrid_item_tooltip_content_cb_set() + * + * @ingroup Gengrid + */ +EAPI void elm_gengrid_item_tooltip_unset(Elm_Object_Item *it); + +/** + * Set a different @b style for a given gengrid item's tooltip. + * + * @param it gengrid item with tooltip set + * @param style the theme style to use on tooltips (e.g. @c + * "default", @c "transparent", etc) + * + * Tooltips can have alternate styles to be displayed on, + * which are defined by the theme set on Elementary. This function + * works analogously as elm_object_tooltip_style_set(), but here + * applied only to gengrid item objects. The default style for + * tooltips is @c "default". + * + * @note before you set a style you should define a tooltip with + * elm_gengrid_item_tooltip_content_cb_set() or + * elm_gengrid_item_tooltip_text_set() + * + * @see elm_gengrid_item_tooltip_style_get() + * + * @ingroup Gengrid + */ +EAPI void elm_gengrid_item_tooltip_style_set(Elm_Object_Item *it, const char *style); + +/** + * Get the style set a given gengrid item's tooltip. + * + * @param it gengrid item with tooltip already set on. + * @return style the theme style in use, which defaults to + * "default". If the object does not have a tooltip set, + * then @c NULL is returned. + * + * @see elm_gengrid_item_tooltip_style_set() for more details + * + * @ingroup Gengrid + */ +EAPI const char *elm_gengrid_item_tooltip_style_get(const Elm_Object_Item *it); + +/** + * @brief Disable size restrictions on an object's tooltip + * @param it The tooltip's anchor object + * @param disable If EINA_TRUE, size restrictions are disabled + * @return EINA_FALSE on failure, EINA_TRUE on success + * + * This function allows a tooltip to expand beyond its parent window's canvas. + * It will instead be limited only by the size of the display. + */ +EAPI Eina_Bool elm_gengrid_item_tooltip_window_mode_set(Elm_Object_Item *it, Eina_Bool disable); + +/** + * @brief Retrieve size restriction state of an object's tooltip + * @param it The tooltip's anchor object + * @return If EINA_TRUE, size restrictions are disabled + * + * This function returns whether a tooltip is allowed to expand beyond + * its parent window's canvas. + * It will instead be limited only by the size of the display. + */ +EAPI Eina_Bool elm_gengrid_item_tooltip_window_mode_get(const Elm_Object_Item *it); + +/** + * Set the type of mouse pointer/cursor decoration to be shown, + * when the mouse pointer is over the given gengrid widget item + * + * @param it gengrid item to customize cursor on + * @param cursor the cursor type's name + * + * This function works analogously as elm_object_cursor_set(), but + * here the cursor's changing area is restricted to the item's + * area, and not the whole widget's. Note that that item cursors + * have precedence over widget cursors, so that a mouse over @p + * item will always show cursor @p type. + * + * If this function is called twice for an object, a previously set + * cursor will be unset on the second call. + * + * @see elm_object_cursor_set() + * @see elm_gengrid_item_cursor_get() + * @see elm_gengrid_item_cursor_unset() + * + * @ingroup Gengrid + */ +EAPI void elm_gengrid_item_cursor_set(Elm_Object_Item *it, const char *cursor); + +/** + * Get the type of mouse pointer/cursor decoration set to be shown, + * when the mouse pointer is over the given gengrid widget item + * + * @param it gengrid item with custom cursor set + * @return the cursor type's name or @c NULL, if no custom cursors + * were set to @p item (and on errors) + * + * @see elm_object_cursor_get() + * @see elm_gengrid_item_cursor_set() for more details + * @see elm_gengrid_item_cursor_unset() + * + * @ingroup Gengrid + */ +EAPI const char *elm_gengrid_item_cursor_get(const Elm_Object_Item *it); + +/** + * Unset any custom mouse pointer/cursor decoration set to be + * shown, when the mouse pointer is over the given gengrid widget + * item, thus making it show the @b default cursor again. + * + * @param it a gengrid item + * + * Use this call to undo any custom settings on this item's cursor + * decoration, bringing it back to defaults (no custom style set). + * + * @see elm_object_cursor_unset() + * @see elm_gengrid_item_cursor_set() for more details + * + * @ingroup Gengrid + */ +EAPI void elm_gengrid_item_cursor_unset(Elm_Object_Item *it); + +/** + * Set a different @b style for a given custom cursor set for a + * gengrid item. + * + * @param it gengrid item with custom cursor set + * @param style the theme style to use (e.g. @c "default", + * @c "transparent", etc) + * + * This function only makes sense when one is using custom mouse + * cursor decorations defined in a theme file , which can + * have, given a cursor name/type, alternate styles on + * it. It works analogously as elm_object_cursor_style_set(), but + * here applied only to gengrid item objects. + * + * @warning Before you set a cursor style you should have defined a + * custom cursor previously on the item, with + * elm_gengrid_item_cursor_set() + * + * @see elm_gengrid_item_cursor_engine_only_set() + * @see elm_gengrid_item_cursor_style_get() + * + * @ingroup Gengrid + */ +EAPI void elm_gengrid_item_cursor_style_set(Elm_Object_Item *it, const char *style); + +/** + * Get the current @b style set for a given gengrid item's custom + * cursor + * + * @param it gengrid item with custom cursor set. + * @return style the cursor style in use. If the object does not + * have a cursor set, then @c NULL is returned. + * + * @see elm_gengrid_item_cursor_style_set() for more details + * + * @ingroup Gengrid + */ +EAPI const char *elm_gengrid_item_cursor_style_get(const Elm_Object_Item *it); + +/** + * Set if the (custom) cursor for a given gengrid item should be + * searched in its theme, also, or should only rely on the + * rendering engine. + * + * @param it item with custom (custom) cursor already set on + * @param engine_only Use @c EINA_TRUE to have cursors looked for + * only on those provided by the rendering engine, @c EINA_FALSE to + * have them searched on the widget's theme, as well. + * + * @note This call is of use only if you've set a custom cursor + * for gengrid items, with elm_gengrid_item_cursor_set(). + * + * @note By default, cursors will only be looked for between those + * provided by the rendering engine. + * + * @ingroup Gengrid + */ +EAPI void elm_gengrid_item_cursor_engine_only_set(Elm_Object_Item *it, Eina_Bool engine_only); + +/** + * Get if the (custom) cursor for a given gengrid item is being + * searched in its theme, also, or is only relying on the rendering + * engine. + * + * @param it a gengrid item + * @return @c EINA_TRUE, if cursors are being looked for only on + * those provided by the rendering engine, @c EINA_FALSE if they + * are being searched on the widget's theme, as well. + * + * @see elm_gengrid_item_cursor_engine_only_set(), for more details + * + * @ingroup Gengrid + */ +EAPI Eina_Bool elm_gengrid_item_cursor_engine_only_get(const Elm_Object_Item *it); + +/** + * Get a given gengrid item's position, relative to the whole + * gengrid's grid area. + * + * @param it The Gengrid item. + * @param x Pointer to variable to store the item's row number. + * @param y Pointer to variable to store the item's column number. + * + * This returns the "logical" position of the item within the + * gengrid. For example, @c (0, 1) would stand for first row, + * second column. + * + * @ingroup Gengrid + */ +EAPI void elm_gengrid_item_pos_get(const Elm_Object_Item *it, unsigned int *x, unsigned int *y); + +/** + * Set the gengrid item's select mode. + * + * @param it The gengrid item object + * @param mode The select mode + * + * elm_gengrid_select_mode_set() changes item's select mode. + * - ELM_OBJECT_SELECT_MODE_DEFAULT : The item will only call their selection func and + * callback when first becoming selected. Any further clicks will + * do nothing, unless you set always select mode. + * - ELM_OBJECT_SELECT_MODE_ALWAYS : This means that, even if selected, + * every click will make the selected callbacks be called. + * - ELM_OBJECT_SELECT_MODE_NONE : This will turn off the ability to select the item + * entirely and they will neither appear selected nor call selected + * callback functions. + * - ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY : This will apply no-finger-size rule + * with ELM_OBJECT_SELECT_MODE_NONE. No-finger-size rule makes an item can be + * smaller than lower limit. Clickable objects should be bigger than + * human touch point device (your finger) for some touch or + * small screen devices. So it is enabled, the item can be shrink than + * predefined finger-size value. And the item will be updated. + * + * @see elm_gengrid_item_select_mode_get() + * + * @ingroup Gengrid + */ +EAPI void elm_gengrid_item_select_mode_set(Elm_Object_Item *it, Elm_Object_Select_Mode mode); + +/** + * Get the gengrid item's select mode. + * + * @param it The gengrid item object + * @return The select mode + * (If getting mode is failed, it returns ELM_OBJECT_SELECT_MODE_MAX) + * + * @see elm_gengrid_item_select_mode_set() + * + * @ingroup Gengrid + */ +EAPI Elm_Object_Select_Mode elm_gengrid_item_select_mode_get(const Elm_Object_Item *it); + diff --git a/legacy/elementary/src/lib/elm_gengrid_eo.h b/legacy/elementary/src/lib/elm_gengrid_eo.h new file mode 100644 index 0000000000..d8a50be506 --- /dev/null +++ b/legacy/elementary/src/lib/elm_gengrid_eo.h @@ -0,0 +1,602 @@ +#define ELM_OBJ_GENGRID_PAN_CLASS elm_obj_gengrid_pan_class_get() + +const Eo_Class *elm_obj_gengrid_pan_class_get(void) EINA_CONST; + +#define ELM_OBJ_GENGRID_CLASS elm_obj_gengrid_class_get() + +const Eo_Class *elm_obj_gengrid_class_get(void) EINA_CONST; + +extern EAPI Eo_Op ELM_OBJ_GENGRID_BASE_ID; + +enum +{ + ELM_OBJ_GENGRID_SUB_ID_ITEM_SIZE_SET, + ELM_OBJ_GENGRID_SUB_ID_ITEM_SIZE_GET, + ELM_OBJ_GENGRID_SUB_ID_GROUP_ITEM_SIZE_SET, + ELM_OBJ_GENGRID_SUB_ID_GROUP_ITEM_SIZE_GET, + ELM_OBJ_GENGRID_SUB_ID_ALIGN_SET, + ELM_OBJ_GENGRID_SUB_ID_ALIGN_GET, + ELM_OBJ_GENGRID_SUB_ID_ITEM_APPEND, + ELM_OBJ_GENGRID_SUB_ID_ITEM_PREPEND, + ELM_OBJ_GENGRID_SUB_ID_ITEM_INSERT_BEFORE, + ELM_OBJ_GENGRID_SUB_ID_ITEM_INSERT_AFTER, + ELM_OBJ_GENGRID_SUB_ID_ITEM_SORTED_INSERT, + ELM_OBJ_GENGRID_SUB_ID_HORIZONTAL_SET, + ELM_OBJ_GENGRID_SUB_ID_HORIZONTAL_GET, + ELM_OBJ_GENGRID_SUB_ID_CLEAR, + ELM_OBJ_GENGRID_SUB_ID_MULTI_SELECT_SET, + ELM_OBJ_GENGRID_SUB_ID_MULTI_SELECT_GET, + ELM_OBJ_GENGRID_SUB_ID_SELECTED_ITEM_GET, + ELM_OBJ_GENGRID_SUB_ID_SELECTED_ITEMS_GET, + ELM_OBJ_GENGRID_SUB_ID_REALIZED_ITEMS_GET, + ELM_OBJ_GENGRID_SUB_ID_REALIZED_ITEMS_UPDATE, + ELM_OBJ_GENGRID_SUB_ID_REORDER_MODE_SET, + ELM_OBJ_GENGRID_SUB_ID_REORDER_MODE_GET, + ELM_OBJ_GENGRID_SUB_ID_PAGE_RELATIVE_SET, + ELM_OBJ_GENGRID_SUB_ID_PAGE_RELATIVE_GET, + ELM_OBJ_GENGRID_SUB_ID_PAGE_SIZE_SET, + ELM_OBJ_GENGRID_SUB_ID_FIRST_ITEM_GET, + ELM_OBJ_GENGRID_SUB_ID_LAST_ITEM_GET, + ELM_OBJ_GENGRID_SUB_ID_FILLED_SET, + ELM_OBJ_GENGRID_SUB_ID_FILLED_GET, + ELM_OBJ_GENGRID_SUB_ID_ITEMS_COUNT, + ELM_OBJ_GENGRID_SUB_ID_SELECT_MODE_SET, + ELM_OBJ_GENGRID_SUB_ID_SELECT_MODE_GET, + ELM_OBJ_GENGRID_SUB_ID_HIGHLIGHT_MODE_SET, + ELM_OBJ_GENGRID_SUB_ID_HIGHLIGHT_MODE_GET, + ELM_OBJ_GENGRID_SUB_ID_LAST +}; + +#define ELM_OBJ_GENGRID_ID(sub_id) (ELM_OBJ_GENGRID_BASE_ID + sub_id) + + +/** + * @def elm_obj_gengrid_item_size_set + * @since 1.8 + * + * Set the size for the items of a given gengrid widget + * + * @param[in] w + * @param[in] h + * + * @see elm_gengrid_item_size_set + */ +#define elm_obj_gengrid_item_size_set(w, h) ELM_OBJ_GENGRID_ID(ELM_OBJ_GENGRID_SUB_ID_ITEM_SIZE_SET), EO_TYPECHECK(Evas_Coord, w), EO_TYPECHECK(Evas_Coord, h) + +/** + * @def elm_obj_gengrid_item_size_get + * @since 1.8 + * + * Get the size set for the items of a given gengrid widget + * + * @param[out] w + * @param[out] h + * + * @see elm_gengrid_item_size_get + */ +#define elm_obj_gengrid_item_size_get(w, h) ELM_OBJ_GENGRID_ID(ELM_OBJ_GENGRID_SUB_ID_ITEM_SIZE_GET), EO_TYPECHECK(Evas_Coord *, w), EO_TYPECHECK(Evas_Coord *, h) + +/** + * @def elm_obj_gengrid_group_item_size_set + * @since 1.8 + * + * Set the size for the group items of a given gengrid widget + * + * @param[in] w + * @param[in] h + * + * @see elm_gengrid_group_item_size_set + */ +#define elm_obj_gengrid_group_item_size_set(w, h) ELM_OBJ_GENGRID_ID(ELM_OBJ_GENGRID_SUB_ID_GROUP_ITEM_SIZE_SET), EO_TYPECHECK(Evas_Coord, w), EO_TYPECHECK(Evas_Coord, h) + +/** + * @def elm_obj_gengrid_group_item_size_get + * @since 1.8 + * + * Get the size set for the group items of a given gengrid widget + * + * @param[out] w + * @param[out] h + * + * @see elm_gengrid_group_item_size_get + */ +#define elm_obj_gengrid_group_item_size_get(w, h) ELM_OBJ_GENGRID_ID(ELM_OBJ_GENGRID_SUB_ID_GROUP_ITEM_SIZE_GET), EO_TYPECHECK(Evas_Coord *, w), EO_TYPECHECK(Evas_Coord *, h) + +/** + * @def elm_obj_gengrid_align_set + * @since 1.8 + * + * Set the items grid's alignment within a given gengrid widget + * + * @param[in] align_x + * @param[in] align_y + * + * @see elm_gengrid_align_set + */ +#define elm_obj_gengrid_align_set(align_x, align_y) ELM_OBJ_GENGRID_ID(ELM_OBJ_GENGRID_SUB_ID_ALIGN_SET), EO_TYPECHECK(double, align_x), EO_TYPECHECK(double, align_y) + +/** + * @def elm_obj_gengrid_align_get + * @since 1.8 + * + * Get the items grid's alignment values within a given gengrid + * + * @param[out] align_x + * @param[out] align_y + * + * @see elm_gengrid_align_get + */ +#define elm_obj_gengrid_align_get(align_x, align_y) ELM_OBJ_GENGRID_ID(ELM_OBJ_GENGRID_SUB_ID_ALIGN_GET), EO_TYPECHECK(double *, align_x), EO_TYPECHECK(double *, align_y) + +/** + * @def elm_obj_gengrid_item_append + * @since 1.8 + * + * Append a new item in a given gengrid widget. + * + * @param[in] itc + * @param[in] data + * @param[in] func + * @param[in] func_data + * @param[out] ret + * + * @see elm_gengrid_item_append + */ +#define elm_obj_gengrid_item_append(itc, data, func, func_data, ret) ELM_OBJ_GENGRID_ID(ELM_OBJ_GENGRID_SUB_ID_ITEM_APPEND), EO_TYPECHECK(const Elm_Gengrid_Item_Class *, itc), EO_TYPECHECK(const void *, data), EO_TYPECHECK(Evas_Smart_Cb, func), EO_TYPECHECK(const void *, func_data), EO_TYPECHECK(Elm_Object_Item **, ret) + +/** + * @def elm_obj_gengrid_item_prepend + * @since 1.8 + * + * Prepend a new item in a given gengrid widget. + * + * @param[in] itc + * @param[in] data + * @param[in] func + * @param[in] func_data + * @param[out] ret + * + * @see elm_gengrid_item_prepend + */ +#define elm_obj_gengrid_item_prepend(itc, data, func, func_data, ret) ELM_OBJ_GENGRID_ID(ELM_OBJ_GENGRID_SUB_ID_ITEM_PREPEND), EO_TYPECHECK(const Elm_Gengrid_Item_Class *, itc), EO_TYPECHECK(const void *, data), EO_TYPECHECK(Evas_Smart_Cb, func), EO_TYPECHECK(const void *, func_data), EO_TYPECHECK(Elm_Object_Item **, ret) + +/** + * @def elm_obj_gengrid_item_insert_before + * @since 1.8 + * + * Insert an item before another in a gengrid widget + * + * @param[in] itc + * @param[in] data + * @param[in] relative + * @param[in] func + * @param[in] func_data + * @param[out] ret + * + * @see elm_gengrid_item_insert_before + */ +#define elm_obj_gengrid_item_insert_before(itc, data, relative, func, func_data, ret) ELM_OBJ_GENGRID_ID(ELM_OBJ_GENGRID_SUB_ID_ITEM_INSERT_BEFORE), EO_TYPECHECK(const Elm_Gengrid_Item_Class *, itc), EO_TYPECHECK(const void *, data), EO_TYPECHECK(Elm_Object_Item *, relative), EO_TYPECHECK(Evas_Smart_Cb, func), EO_TYPECHECK(const void *, func_data), EO_TYPECHECK(Elm_Object_Item **, ret) + +/** + * @def elm_obj_gengrid_item_insert_after + * @since 1.8 + * + * Insert an item after another in a gengrid widget + * + * @param[in] itc + * @param[in] data + * @param[in] relative + * @param[in] func + * @param[in] func_data + * @param[out] ret + * + * @see elm_gengrid_item_insert_after + */ +#define elm_obj_gengrid_item_insert_after(itc, data, relative, func, func_data, ret) ELM_OBJ_GENGRID_ID(ELM_OBJ_GENGRID_SUB_ID_ITEM_INSERT_AFTER), EO_TYPECHECK(const Elm_Gengrid_Item_Class *, itc), EO_TYPECHECK(const void *, data), EO_TYPECHECK(Elm_Object_Item *, relative), EO_TYPECHECK(Evas_Smart_Cb, func), EO_TYPECHECK(const void *, func_data), EO_TYPECHECK(Elm_Object_Item **, ret) + +/** + * @def elm_obj_gengrid_item_sorted_insert + * @since 1.8 + * + * Insert an item in a gengrid widget using a user-defined sort function. + * + * @param[in] itc + * @param[in] data + * @param[in] comp + * @param[in] func + * @param[in] func_data + * @param[out] ret + * + * @see elm_gengrid_item_sorted_insert + */ +#define elm_obj_gengrid_item_sorted_insert(itc, data, comp, func, func_data, ret) ELM_OBJ_GENGRID_ID(ELM_OBJ_GENGRID_SUB_ID_ITEM_SORTED_INSERT), EO_TYPECHECK(const Elm_Gengrid_Item_Class *, itc), EO_TYPECHECK(const void *, data), EO_TYPECHECK(Eina_Compare_Cb, comp), EO_TYPECHECK(Evas_Smart_Cb, func), EO_TYPECHECK(const void *, func_data), EO_TYPECHECK(Elm_Object_Item **, ret) + +/** + * @def elm_obj_gengrid_horizontal_set + * @since 1.8 + * + * Set the direction in which a given gengrid widget will expand while + * placing its items. + * + * @param[in] horizontal + * + * @see elm_gengrid_horizontal_set + */ +#define elm_obj_gengrid_horizontal_set(horizontal) ELM_OBJ_GENGRID_ID(ELM_OBJ_GENGRID_SUB_ID_HORIZONTAL_SET), EO_TYPECHECK(Eina_Bool, horizontal) + +/** + * @def elm_obj_gengrid_horizontal_get + * @since 1.8 + * + * Get for what direction a given gengrid widget will expand while + * placing its items. + * + * @param[out] ret + * + * @see elm_gengrid_horizontal_get + */ +#define elm_obj_gengrid_horizontal_get(ret) ELM_OBJ_GENGRID_ID(ELM_OBJ_GENGRID_SUB_ID_HORIZONTAL_GET), EO_TYPECHECK(Eina_Bool *, ret) + +/** + * @def elm_obj_gengrid_clear + * @since 1.8 + * + * Remove all items from a given gengrid widget + * + * + * @see elm_gengrid_clear + */ +#define elm_obj_gengrid_clear() ELM_OBJ_GENGRID_ID(ELM_OBJ_GENGRID_SUB_ID_CLEAR) + +/** + * @def elm_obj_gengrid_multi_select_set + * @since 1.8 + * + * Enable or disable multi-selection in a given gengrid widget + * + * @param[in] multi + * + * @see elm_gengrid_multi_select_set + */ +#define elm_obj_gengrid_multi_select_set(multi) ELM_OBJ_GENGRID_ID(ELM_OBJ_GENGRID_SUB_ID_MULTI_SELECT_SET), EO_TYPECHECK(Eina_Bool, multi) + +/** + * @def elm_obj_gengrid_multi_select_get + * @since 1.8 + * + * Get whether multi-selection is enabled or disabled for a given + * gengrid widget + * + * @param[out] ret + * + * @see elm_gengrid_multi_select_get + */ +#define elm_obj_gengrid_multi_select_get(ret) ELM_OBJ_GENGRID_ID(ELM_OBJ_GENGRID_SUB_ID_MULTI_SELECT_GET), EO_TYPECHECK(Eina_Bool *, ret) + +/** + * @def elm_obj_gengrid_selected_item_get + * @since 1.8 + * + * Get the selected item in a given gengrid widget + * + * @param[out] ret + * + * @see elm_gengrid_selected_item_get + */ +#define elm_obj_gengrid_selected_item_get(ret) ELM_OBJ_GENGRID_ID(ELM_OBJ_GENGRID_SUB_ID_SELECTED_ITEM_GET), EO_TYPECHECK(Elm_Object_Item **, ret) + +/** + * @def elm_obj_gengrid_selected_items_get + * @since 1.8 + * + * Get a list of selected items in a given gengrid + * + * @param[out] ret + * + * @see elm_gengrid_selected_items_get + */ +#define elm_obj_gengrid_selected_items_get(ret) ELM_OBJ_GENGRID_ID(ELM_OBJ_GENGRID_SUB_ID_SELECTED_ITEMS_GET), EO_TYPECHECK(const Eina_List **, ret) + +/** + * @def elm_obj_gengrid_realized_items_get + * @since 1.8 + * + * Get a list of realized items in gengrid + * + * @param[out] ret + * + * @see elm_gengrid_realized_items_get + */ +#define elm_obj_gengrid_realized_items_get(ret) ELM_OBJ_GENGRID_ID(ELM_OBJ_GENGRID_SUB_ID_REALIZED_ITEMS_GET), EO_TYPECHECK(Eina_List **, ret) + +/** + * @def elm_obj_gengrid_realized_items_update + * @since 1.8 + * + * Update the contents of all realized items. + * + * + * @see elm_gengrid_realized_items_update + */ +#define elm_obj_gengrid_realized_items_update() ELM_OBJ_GENGRID_ID(ELM_OBJ_GENGRID_SUB_ID_REALIZED_ITEMS_UPDATE) + +/** + * @def elm_obj_gengrid_reorder_mode_set + * @since 1.8 + * + * Set whether a given gengrid widget is or not able have items + * + * @param[in] reorder_mode + * + * @see elm_gengrid_reorder_mode_set + */ +#define elm_obj_gengrid_reorder_mode_set(reorder_mode) ELM_OBJ_GENGRID_ID(ELM_OBJ_GENGRID_SUB_ID_REORDER_MODE_SET), EO_TYPECHECK(Eina_Bool, reorder_mode) + +/** + * @def elm_obj_gengrid_reorder_mode_get + * @since 1.8 + * + * Get whether a given gengrid widget is or not able have items + * + * @param[out] ret + * + * @see elm_gengrid_reorder_mode_get + */ +#define elm_obj_gengrid_reorder_mode_get(ret) ELM_OBJ_GENGRID_ID(ELM_OBJ_GENGRID_SUB_ID_REORDER_MODE_GET), EO_TYPECHECK(Eina_Bool *, ret) + +/** + * @def elm_obj_gengrid_bounce_set + * @since 1.8 + * + * Enable or disable bouncing effect for a given gengrid widget + * + * @param[in] h_bounce + * @param[in] v_bounce + * + * @see elm_gengrid_bounce_set + */ +#define elm_obj_gengrid_bounce_set(h_bounce, v_bounce) ELM_OBJ_GENGRID_ID(ELM_OBJ_GENGRID_SUB_ID_BOUNCE_SET), EO_TYPECHECK(Eina_Bool, h_bounce), EO_TYPECHECK(Eina_Bool, v_bounce) + +/** + * @def elm_obj_gengrid_bounce_get + * @since 1.8 + * + * Get whether bouncing effects are enabled or disabled, for a + * given gengrid widget, on each axis + * + * @param[out] h_bounce + * @param[out] v_bounce + * + * @see elm_gengrid_bounce_get + */ +#define elm_obj_gengrid_bounce_get(h_bounce, v_bounce) ELM_OBJ_GENGRID_ID(ELM_OBJ_GENGRID_SUB_ID_BOUNCE_GET), EO_TYPECHECK(Eina_Bool *, h_bounce), EO_TYPECHECK(Eina_Bool *, v_bounce) + +/** + * @def elm_obj_gengrid_page_relative_set + * @since 1.8 + * + * Set a given gengrid widget's scrolling page size, relative to + * its viewport size. + * + * @param[in] h_pagerel + * @param[in] v_pagerel + * + * @see elm_gengrid_page_relative_set + */ +#define elm_obj_gengrid_page_relative_set(h_pagerel, v_pagerel) ELM_OBJ_GENGRID_ID(ELM_OBJ_GENGRID_SUB_ID_PAGE_RELATIVE_SET), EO_TYPECHECK(double, h_pagerel), EO_TYPECHECK(double, v_pagerel) + +/** + * @def elm_obj_gengrid_page_relative_get + * @since 1.8 + * + * Get a given gengrid widget's scrolling page size, relative to + * its viewport size. + * + * @param[out] h_pagerel + * @param[out] v_pagerel + * + * @see elm_gengrid_page_relative_get + */ +#define elm_obj_gengrid_page_relative_get(h_pagerel, v_pagerel) ELM_OBJ_GENGRID_ID(ELM_OBJ_GENGRID_SUB_ID_PAGE_RELATIVE_GET), EO_TYPECHECK(double *, h_pagerel), EO_TYPECHECK(double *, v_pagerel) + +/** + * @def elm_obj_gengrid_page_size_set + * @since 1.8 + * + * Set a given gengrid widget's scrolling page size + * + * @param[in] h_pagesize + * @param[in] v_pagesize + * + * @see elm_gengrid_page_size_set + */ +#define elm_obj_gengrid_page_size_set(h_pagesize, v_pagesize) ELM_OBJ_GENGRID_ID(ELM_OBJ_GENGRID_SUB_ID_PAGE_SIZE_SET), EO_TYPECHECK(Evas_Coord, h_pagesize), EO_TYPECHECK(Evas_Coord, v_pagesize) + +/** + * @def elm_obj_gengrid_current_page_get + * @since 1.8 + * + * @brief Get gengrid current page number. + * + * @param[out] h_pagenumber + * @param[out] v_pagenumber + * + * @see elm_gengrid_current_page_get + */ +#define elm_obj_gengrid_current_page_get(h_pagenumber, v_pagenumber) ELM_OBJ_GENGRID_ID(ELM_OBJ_GENGRID_SUB_ID_CURRENT_PAGE_GET), EO_TYPECHECK(int *, h_pagenumber), EO_TYPECHECK(int *, v_pagenumber) + +/** + * @def elm_obj_gengrid_last_page_get + * @since 1.8 + * + * @brief Get gengrid last page number. + * + * @param[out] h_pagenumber + * @param[out] v_pagenumber + * + * @see elm_gengrid_last_page_get + */ +#define elm_obj_gengrid_last_page_get(h_pagenumber, v_pagenumber) ELM_OBJ_GENGRID_ID(ELM_OBJ_GENGRID_SUB_ID_LAST_PAGE_GET), EO_TYPECHECK(int *, h_pagenumber), EO_TYPECHECK(int *, v_pagenumber) + +/** + * @def elm_obj_gengrid_page_show + * @since 1.8 + * + * Show a specific virtual region within the gengrid content object by page number. + * + * @param[in] h_pagenumber + * @param[in] v_pagenumber + * + * @see elm_gengrid_page_show + */ +#define elm_obj_gengrid_page_show(h_pagenumber, v_pagenumber) ELM_OBJ_GENGRID_ID(ELM_OBJ_GENGRID_SUB_ID_PAGE_SHOW), EO_TYPECHECK(int, h_pagenumber), EO_TYPECHECK(int, v_pagenumber) + +/** + * @def elm_obj_gengrid_page_bring_in + * @since 1.8 + * + * Show a specific virtual region within the gengrid content object by page number. + * + * @param[in] h_pagenumber + * @param[in] v_pagenumber + * + * @see elm_gengrid_page_bring_in + */ +#define elm_obj_gengrid_page_bring_in(h_pagenumber, v_pagenumber) ELM_OBJ_GENGRID_ID(ELM_OBJ_GENGRID_SUB_ID_PAGE_BRING_IN), EO_TYPECHECK(int, h_pagenumber), EO_TYPECHECK(int, v_pagenumber) + +/** + * @def elm_obj_gengrid_scroller_policy_set + * @since 1.8 + * + * Set the scrollbar policy + * + * @param[in] policy_h + * @param[in] policy_v + * + * @see elm_gengrid_scroller_policy_set + */ +#define elm_obj_gengrid_scroller_policy_set(policy_h, policy_v) ELM_OBJ_GENGRID_ID(ELM_OBJ_GENGRID_SUB_ID_SCROLLER_POLICY_SET), EO_TYPECHECK(Elm_Scroller_Policy, policy_h), EO_TYPECHECK(Elm_Scroller_Policy, policy_v) + +/** + * @def elm_obj_gengrid_scroller_policy_get + * @since 1.8 + * + * Get the scrollbar policy + * + * @param[out] policy_h + * @param[out] policy_v + * + * @see elm_gengrid_scroller_policy_get + */ +#define elm_obj_gengrid_scroller_policy_get(policy_h, policy_v) ELM_OBJ_GENGRID_ID(ELM_OBJ_GENGRID_SUB_ID_SCROLLER_POLICY_GET), EO_TYPECHECK(Elm_Scroller_Policy *, policy_h), EO_TYPECHECK(Elm_Scroller_Policy *, policy_v) + +/** + * @def elm_obj_gengrid_first_item_get + * @since 1.8 + * + * Get the first item in a given gengrid widget + * + * @param[out] ret + * + * @see elm_gengrid_first_item_get + */ +#define elm_obj_gengrid_first_item_get(ret) ELM_OBJ_GENGRID_ID(ELM_OBJ_GENGRID_SUB_ID_FIRST_ITEM_GET), EO_TYPECHECK(Elm_Object_Item **, ret) + +/** + * @def elm_obj_gengrid_last_item_get + * @since 1.8 + * + * Get the last item in a given gengrid widget + * + * @param[out] ret + * + * @see elm_gengrid_last_item_get + */ +#define elm_obj_gengrid_last_item_get(ret) ELM_OBJ_GENGRID_ID(ELM_OBJ_GENGRID_SUB_ID_LAST_ITEM_GET), EO_TYPECHECK(Elm_Object_Item **, ret) + +/** + * @def elm_obj_gengrid_filled_set + * @since 1.8 + * + * Set how the items grid's filled within a given gengrid widget + * + * @param[in] fill + * + * @see elm_gengrid_filled_set + */ +#define elm_obj_gengrid_filled_set(fill) ELM_OBJ_GENGRID_ID(ELM_OBJ_GENGRID_SUB_ID_FILLED_SET), EO_TYPECHECK(Eina_Bool, fill) + +/** + * @def elm_obj_gengrid_filled_get + * @since 1.8 + * + * Get how the items grid's filled within a given gengrid widget + * + * @param[out] ret + * + * @see elm_gengrid_filled_get + */ +#define elm_obj_gengrid_filled_get(ret) ELM_OBJ_GENGRID_ID(ELM_OBJ_GENGRID_SUB_ID_FILLED_GET), EO_TYPECHECK(Eina_Bool *, ret) + +/** + * @def elm_obj_gengrid_items_count + * @since 1.8 + * + * Return how many items are currently in a list + * + * @param[out] ret + * + * @see elm_gengrid_items_count + */ +#define elm_obj_gengrid_items_count(ret) ELM_OBJ_GENGRID_ID(ELM_OBJ_GENGRID_SUB_ID_ITEMS_COUNT), EO_TYPECHECK(unsigned int *, ret) + +/** + * @def elm_obj_gengrid_select_mode_set + * @since 1.8 + * + * Set the gengrid select mode. + * + * @param[in] mode + * + * @see elm_gengrid_select_mode_set + */ +#define elm_obj_gengrid_select_mode_set(mode) ELM_OBJ_GENGRID_ID(ELM_OBJ_GENGRID_SUB_ID_SELECT_MODE_SET), EO_TYPECHECK(Elm_Object_Select_Mode, mode) + +/** + * @def elm_obj_gengrid_select_mode_get + * @since 1.8 + * + * Get the gengrid select mode. + * + * @param[out] ret + * + * @see elm_gengrid_select_mode_get + */ +#define elm_obj_gengrid_select_mode_get(ret) ELM_OBJ_GENGRID_ID(ELM_OBJ_GENGRID_SUB_ID_SELECT_MODE_GET), EO_TYPECHECK(Elm_Object_Select_Mode *, ret) + +/** + * @def elm_obj_gengrid_highlight_mode_set + * @since 1.8 + * + * Set whether the gengrid items' should be highlighted when item selected. + * + * @param[in] highlight + * + * @see elm_gengrid_highlight_mode_set + */ +#define elm_obj_gengrid_highlight_mode_set(highlight) ELM_OBJ_GENGRID_ID(ELM_OBJ_GENGRID_SUB_ID_HIGHLIGHT_MODE_SET), EO_TYPECHECK(Eina_Bool, highlight) + +/** + * @def elm_obj_gengrid_highlight_mode_get + * @since 1.8 + * + * Get whether the gengrid items' should be highlighted when item selected. + * + * @param[out] ret + * + * @see elm_gengrid_highlight_mode_get + */ +#define elm_obj_gengrid_highlight_mode_get(ret) ELM_OBJ_GENGRID_ID(ELM_OBJ_GENGRID_SUB_ID_HIGHLIGHT_MODE_GET), EO_TYPECHECK(Eina_Bool *, ret) + + + diff --git a/legacy/elementary/src/lib/elm_gengrid_legacy.h b/legacy/elementary/src/lib/elm_gengrid_legacy.h new file mode 100644 index 0000000000..a48e00ec79 --- /dev/null +++ b/legacy/elementary/src/lib/elm_gengrid_legacy.h @@ -0,0 +1,868 @@ +/** + * Add a new gengrid widget to the given parent Elementary + * (container) object + * + * @param parent The parent object + * @return a new gengrid widget handle or @c NULL, on errors + * + * This function inserts a new gengrid widget on the canvas. + * + * @see elm_gengrid_item_size_set() + * @see elm_gengrid_group_item_size_set() + * @see elm_gengrid_horizontal_set() + * @see elm_gengrid_item_append() + * @see elm_object_item_del() + * @see elm_gengrid_clear() + * + * @ingroup Gengrid + */ +EAPI Evas_Object *elm_gengrid_add(Evas_Object *parent); + +/** + * Remove all items from a given gengrid widget + * + * @param obj The gengrid object. + * + * This removes (and deletes) all items in @p obj, leaving it + * empty. + * + * @see elm_object_item_del(), to remove just one item. + * + * @ingroup Gengrid + */ +EAPI void elm_gengrid_clear(Evas_Object *obj); + +/** + * Enable or disable multi-selection in a given gengrid widget + * + * @param obj The gengrid object. + * @param multi @c EINA_TRUE, to enable multi-selection, + * @c EINA_FALSE to disable it. + * + * Multi-selection is the ability to have @b more than one + * item selected, on a given gengrid, simultaneously. When it is + * enabled, a sequence of clicks on different items will make them + * all selected, progressively. A click on an already selected item + * will unselect it. If interacting via the keyboard, + * multi-selection is enabled while holding the "Shift" key. + * + * @note By default, multi-selection is @b disabled on gengrids + * + * @see elm_gengrid_multi_select_get() + * + * @ingroup Gengrid + */ +EAPI void elm_gengrid_multi_select_set(Evas_Object *obj, Eina_Bool multi); + +/** + * Get whether multi-selection is enabled or disabled for a given + * gengrid widget + * + * @param obj The gengrid object. + * @return @c EINA_TRUE, if multi-selection is enabled, @c + * EINA_FALSE otherwise + * + * @see elm_gengrid_multi_select_set() for more details + * + * @ingroup Gengrid + */ +EAPI Eina_Bool elm_gengrid_multi_select_get(const Evas_Object *obj); + +/** + * Set the direction in which a given gengrid widget will expand while + * placing its items. + * + * @param obj The gengrid object. + * @param horizontal @c EINA_TRUE to make the gengrid expand horizontally, + * @c EINA_FALSE to expand vertically. + * + * When in "horizontal mode" (@c EINA_TRUE), items will be placed in @b columns, + * from top to bottom and, when the space for a column is filled, another one is + * started on the right, thus expanding the grid horizontally. When in + * "vertical mode" (@c EINA_FALSE), though, items will be placed in @b rows, + * from left to right and, when the space for a row is filled, another one is + * started below, thus expanding the grid vertically. + * + * @note By default, gengrid is in vertical mode, @c EINA_FALSE. + * + * @see elm_gengrid_horizontal_get() + * + * @ingroup Gengrid + */ +EAPI void elm_gengrid_horizontal_set(Evas_Object *obj, Eina_Bool horizontal); + +/** + * Get for what direction a given gengrid widget will expand while + * placing its items. + * + * @param obj The gengrid object. + * @return @c EINA_TRUE, if @p obj is set to expand horizontally, + * @c EINA_FALSE if it's set to expand vertically. + * + * @see elm_gengrid_horizontal_set() for more details + * + * @ingroup Gengrid + */ +EAPI Eina_Bool elm_gengrid_horizontal_get(const Evas_Object *obj); + +/** + * Enable or disable bouncing effect for a given gengrid widget + * + * @param obj The gengrid object + * @param h_bounce @c EINA_TRUE, to enable @b horizontal bouncing, + * @c EINA_FALSE to disable it + * @param v_bounce @c EINA_TRUE, to enable @b vertical bouncing, + * @c EINA_FALSE to disable it + * + * The bouncing effect occurs whenever one reaches the gengrid's + * edge's while panning it -- it will scroll past its limits a + * little bit and return to the edge again, in a animated for, + * automatically. + * + * @note By default, gengrids have bouncing enabled on both axis + * + * @deprecated Use elm_scroller_bounce_set() instead. + * + * @see elm_scroller_bounce_set() + * + * @ingroup Gengrid + */ +EINA_DEPRECATED EAPI void elm_gengrid_bounce_set(Evas_Object *obj, Eina_Bool h_bounce, Eina_Bool v_bounce); + +/** + * Get whether bouncing effects are enabled or disabled, for a + * given gengrid widget, on each axis + * + * @param obj The gengrid object + * @param h_bounce Pointer to a variable where to store the + * horizontal bouncing flag. + * @param v_bounce Pointer to a variable where to store the + * vertical bouncing flag. + * + * @deprecated Use elm_scroller_bounce_get() instead. + * + * @see elm_scroller_bounce_get() + * + * @ingroup Gengrid + */ +EINA_DEPRECATED EAPI void elm_gengrid_bounce_get(const Evas_Object *obj, Eina_Bool *h_bounce, Eina_Bool *v_bounce); + +/** + * Append a new item in a given gengrid widget. + * + * @param obj The gengrid object. + * @param gic The item class for the item. + * @param data The item data. + * @param func Convenience function called when the item is + * selected. + * @param func_data Data to be passed to @p func. + * @return A handle to the item added or @c NULL, on errors. + * + * This adds an item to the beginning of the gengrid. + * + * @see elm_gengrid_item_prepend() + * @see elm_gengrid_item_insert_before() + * @see elm_gengrid_item_insert_after() + * @see elm_object_item_del() + * + * @ingroup Gengrid + */ +EAPI Elm_Object_Item *elm_gengrid_item_append(Evas_Object *obj, const Elm_Gengrid_Item_Class *gic, const void *data, Evas_Smart_Cb func, const void *func_data); + +/** + * Prepend a new item in a given gengrid widget. + * + * @param obj The gengrid object. + * @param gic The item class for the item. + * @param data The item data. + * @param func Convenience function called when the item is + * selected. + * @param func_data Data to be passed to @p func. + * @return A handle to the item added or @c NULL, on errors. + * + * This adds an item to the end of the gengrid. + * + * @see elm_gengrid_item_append() + * @see elm_gengrid_item_insert_before() + * @see elm_gengrid_item_insert_after() + * @see elm_object_item_del() + * + * @ingroup Gengrid + */ +EAPI Elm_Object_Item *elm_gengrid_item_prepend(Evas_Object *obj, const Elm_Gengrid_Item_Class *gic, const void *data, Evas_Smart_Cb func, const void *func_data); + +/** + * Insert an item before another in a gengrid widget + * + * @param obj The gengrid object. + * @param gic The item class for the item. + * @param data The item data. + * @param relative The item to place this new one before. + * @param func Convenience function called when the item is + * selected. + * @param func_data Data to be passed to @p func. + * @return A handle to the item added or @c NULL, on errors. + * + * This inserts an item before another in the gengrid. + * + * @see elm_gengrid_item_append() + * @see elm_gengrid_item_prepend() + * @see elm_gengrid_item_insert_after() + * @see elm_object_item_del() + * + * @ingroup Gengrid + */ +EAPI Elm_Object_Item *elm_gengrid_item_insert_before(Evas_Object *obj, const Elm_Gengrid_Item_Class *gic, const void *data, Elm_Object_Item *relative, Evas_Smart_Cb func, const void *func_data); + +/** + * Insert an item after another in a gengrid widget + * + * @param obj The gengrid object. + * @param gic The item class for the item. + * @param data The item data. + * @param relative The item to place this new one after. + * @param func Convenience function called when the item is + * selected. + * @param func_data Data to be passed to @p func. + * @return A handle to the item added or @c NULL, on errors. + * + * This inserts an item after another in the gengrid. + * + * @see elm_gengrid_item_append() + * @see elm_gengrid_item_prepend() + * @see elm_gengrid_item_insert_after() + * @see elm_object_item_del() + * + * @ingroup Gengrid + */ +EAPI Elm_Object_Item *elm_gengrid_item_insert_after(Evas_Object *obj, const Elm_Gengrid_Item_Class *gic, const void *data, Elm_Object_Item *relative, Evas_Smart_Cb func, const void *func_data); + +/** + * Insert an item in a gengrid widget using a user-defined sort function. + * + * @param obj The gengrid object. + * @param gic The item class for the item. + * @param data The item data. + * @param comp User defined comparison function that defines the sort order + * based on Elm_Gen_Item and its data param. + * @param func Convenience function called when the item is selected. + * @param func_data Data to be passed to @p func. + * @return A handle to the item added or @c NULL, on errors. + * + * This inserts an item in the gengrid based on user defined comparison + * function. The two arguments passed to the function @p func are gengrid + * item handles to compare. + * + * @see elm_gengrid_item_append() + * @see elm_gengrid_item_prepend() + * @see elm_gengrid_item_insert_after() + * @see elm_object_item_del() + * + * @ingroup Gengrid + */ +EAPI Elm_Object_Item *elm_gengrid_item_sorted_insert(Evas_Object *obj, const Elm_Gengrid_Item_Class *gic, const void *data, Eina_Compare_Cb comp, Evas_Smart_Cb func, const void *func_data); + +/** + * Get the selected item in a given gengrid widget + * + * @param obj The gengrid object. + * @return The selected item's handle or @c NULL, if none is + * selected at the moment (and on errors) + * + * This returns the selected item in @p obj. If multi selection is + * enabled on @p obj (@see elm_gengrid_multi_select_set()), only + * the first item in the list is selected, which might not be very + * useful. For that case, see elm_gengrid_selected_items_get(). + * + * @ingroup Gengrid + */ +EAPI Elm_Object_Item *elm_gengrid_selected_item_get(const Evas_Object *obj); + +/** + * Get a list of selected items in a given gengrid + * + * @param obj The gengrid object. + * @return The list of selected items or @c NULL, if none is + * selected at the moment (and on errors) + * + * This returns a list of the selected items, in the order that + * they appear in the grid. This list is only valid as long as no + * more items are selected or unselected (or unselected implicitly + * by deletion). The list contains Gengrid item pointers as + * data, naturally. + * + * @see elm_gengrid_selected_item_get() + * + * @ingroup Gengrid + */ +EAPI const Eina_List *elm_gengrid_selected_items_get(const Evas_Object *obj); + +/** + * Get a list of realized items in gengrid + * + * @param obj The gengrid object + * @return The list of realized items, nor NULL if none are realized. + * + * This returns a list of the realized items in the gengrid. The list + * contains gengrid item pointers. The list must be freed by the + * caller when done with eina_list_free(). The item pointers in the + * list are only valid so long as those items are not deleted or the + * gengrid is not deleted. + * + * @see elm_gengrid_realized_items_update() + * + * @ingroup Gengrid + */ +EAPI Eina_List *elm_gengrid_realized_items_get(const Evas_Object *obj); + +/** + * Update the contents of all realized items. + * + * @param obj The gengrid object. + * + * This updates all realized items by calling all the item class functions again + * to get the contents, texts and states. Use this when the original + * item data has changed and the changes are desired to be reflected. + * + * To update just one item, use elm_gengrid_item_update(). + * + * @see elm_gengrid_realized_items_get() + * @see elm_gengrid_item_update() + * + * @ingroup Gengrid + */ +EAPI void elm_gengrid_realized_items_update(Evas_Object *obj); + +/** + * Get the first item in a given gengrid widget + * + * @param obj The gengrid object + * @return The first item's handle or @c NULL, if there are no + * items in @p obj (and on errors) + * + * This returns the first item in the @p obj's internal list of + * items. + * + * @see elm_gengrid_last_item_get() + * + * @ingroup Gengrid + */ +EAPI Elm_Object_Item *elm_gengrid_first_item_get(const Evas_Object *obj); + +/** + * Get the last item in a given gengrid widget + * + * @param obj The gengrid object + * @return The last item's handle or @c NULL, if there are no + * items in @p obj (and on errors) + * + * This returns the last item in the @p obj's internal list of + * items. + * + * @see elm_gengrid_first_item_get() + * + * @ingroup Gengrid + */ +EAPI Elm_Object_Item *elm_gengrid_last_item_get(const Evas_Object *obj); + +/** + * Set the scrollbar policy + * + * @param obj The gengrid object + * @param policy_h Horizontal scrollbar policy. + * @param policy_v Vertical scrollbar policy. + * + * This sets the scrollbar visibility policy for the given gengrid + * scroller. #ELM_SCROLLER_POLICY_AUTO means the scrollbar is made + * visible if it is needed, and otherwise kept + * hidden. #ELM_SCROLLER_POLICY_ON turns it on all the time, and + * #ELM_SCROLLER_POLICY_OFF always keeps it off. This applies + * respectively for the horizontal and vertical scrollbars. Default + * is #ELM_SCROLLER_POLICY_AUTO. + * + * @deprecated Use elm_scroller_policy_set() instead. + * + * @see elm_scroller_policy_set() + * + * @see elm_gengrid_scroller_policy_get() + * + * @ingroup Gengrid + */ +EINA_DEPRECATED EAPI void elm_gengrid_scroller_policy_set(Evas_Object *obj, Elm_Scroller_Policy policy_h, Elm_Scroller_Policy policy_v); + +/** + * Get the scrollbar policy + * + * @param obj The gengrid object + * @param policy_h Pointer to store the horizontal scrollbar policy. + * @param policy_v Pointer to store the vertical scrollbar policy. + * + * @deprecated Use elm_scroller_policy_get() instead. + * + * @see elm_scroller_policy_get() + * + * @see elm_gengrid_scroller_policy_set() + * + * @ingroup Gengrid + */ +EINA_DEPRECATED EAPI void elm_gengrid_scroller_policy_get(const Evas_Object *obj, Elm_Scroller_Policy *policy_h, Elm_Scroller_Policy *policy_v); + +/** + * Return how many items are currently in a list + * + * @param obj The list + * @return The total number of list items in the list + * + * This behavior is O(1) and includes items which may or may not be realized. + * + * @ingroup Gengrid + */ +EAPI unsigned int elm_gengrid_items_count(const Evas_Object *obj); + +/** + * Set the size for the items of a given gengrid widget + * + * @param obj The gengrid object. + * @param w The items' width. + * @param h The items' height; + * + * A gengrid, after creation, has still no information on the size + * to give to each of its cells. So, you most probably will end up + * with squares one @ref Fingers "finger" wide, the default + * size. Use this function to force a custom size for you items, + * making them as big as you wish. + * + * @see elm_gengrid_item_size_get() + * + * @ingroup Gengrid + */ +EAPI void elm_gengrid_item_size_set(Evas_Object *obj, Evas_Coord w, Evas_Coord h); + +/** + * Get the size set for the items of a given gengrid widget + * + * @param obj The gengrid object. + * @param w Pointer to a variable where to store the items' width. + * @param h Pointer to a variable where to store the items' height. + * + * @note Use @c NULL pointers on the size values you're not + * interested in: they'll be ignored by the function. + * + * @see elm_gengrid_item_size_get() for more details + * + * @ingroup Gengrid + */ +EAPI void elm_gengrid_item_size_get(const Evas_Object *obj, Evas_Coord *w, Evas_Coord *h); + +/** + * Set the size for the group items of a given gengrid widget + * + * @param obj The gengrid object. + * @param w The group items' width. + * @param h The group items' height; + * + * A gengrid, after creation, has still no information on the size + * to give to each of its cells. So, you most probably will end up + * with squares one @ref Fingers "finger" wide, the default + * size. Use this function to force a custom size for you group items, + * making them as big as you wish. + * + * @see elm_gengrid_group_item_size_get() + * + * @ingroup Gengrid + */ +EAPI void elm_gengrid_group_item_size_set(Evas_Object *obj, Evas_Coord w, Evas_Coord h); + +/** + * Get the size set for the group items of a given gengrid widget + * + * @param obj The gengrid object. + * @param w Pointer to a variable where to store the group items' width. + * @param h Pointer to a variable where to store the group items' height. + * + * @note Use @c NULL pointers on the size values you're not + * interested in: they'll be ignored by the function. + * + * @see elm_gengrid_group_item_size_get() for more details + * + * @ingroup Gengrid + */ +EAPI void elm_gengrid_group_item_size_get(const Evas_Object *obj, Evas_Coord *w, Evas_Coord *h); + +/** + * Set the items grid's alignment within a given gengrid widget + * + * @param obj The gengrid object. + * @param align_x Alignment in the horizontal axis (0 <= align_x <= 1). + * @param align_y Alignment in the vertical axis (0 <= align_y <= 1). + * + * This sets the alignment of the whole grid of items of a gengrid + * within its given viewport. By default, those values are both + * 0.5, meaning that the gengrid will have its items grid placed + * exactly in the middle of its viewport. + * + * @note If given alignment values are out of the cited ranges, + * they'll be changed to the nearest boundary values on the valid + * ranges. + * + * @see elm_gengrid_align_get() + * + * @ingroup Gengrid + */ +EAPI void elm_gengrid_align_set(Evas_Object *obj, double align_x, double align_y); + +/** + * Get the items grid's alignment values within a given gengrid + * widget + * + * @param obj The gengrid object. + * @param align_x Pointer to a variable where to store the + * horizontal alignment. + * @param align_y Pointer to a variable where to store the vertical + * alignment. + * + * @note Use @c NULL pointers on the alignment values you're not + * interested in: they'll be ignored by the function. + * + * @see elm_gengrid_align_set() for more details + * + * @ingroup Gengrid + */ +EAPI void elm_gengrid_align_get(const Evas_Object *obj, double *align_x, double *align_y); + +/** + * Set whether a given gengrid widget is or not able have items + * @b reordered + * + * @param obj The gengrid object + * @param reorder_mode Use @c EINA_TRUE to turn reordering on, + * @c EINA_FALSE to turn it off + * + * If a gengrid is set to allow reordering, a click held for more + * than 0.5 over a given item will highlight it specially, + * signaling the gengrid has entered the reordering state. From + * that time on, the user will be able to, while still holding the + * mouse button down, move the item freely in the gengrid's + * viewport, replacing to said item to the locations it goes to. + * The replacements will be animated and, whenever the user + * releases the mouse button, the item being replaced gets a new + * definitive place in the grid. + * + * @see elm_gengrid_reorder_mode_get() + * + * @ingroup Gengrid + */ +EAPI void elm_gengrid_reorder_mode_set(Evas_Object *obj, Eina_Bool reorder_mode); + +/** + * Get whether a given gengrid widget is or not able have items + * @b reordered + * + * @param obj The gengrid object + * @return @c EINA_TRUE, if reordering is on, @c EINA_FALSE if it's + * off + * + * @see elm_gengrid_reorder_mode_set() for more details + * + * @ingroup Gengrid + */ +EAPI Eina_Bool elm_gengrid_reorder_mode_get(const Evas_Object *obj); + + +/** + * Set a given gengrid widget's scrolling page size, relative to + * its viewport size. + * + * @param obj The gengrid object + * @param h_pagerel The horizontal page (relative) size + * @param v_pagerel The vertical page (relative) size + * + * The gengrid's scroller is capable of binding scrolling by the + * user to "pages". It means that, while scrolling and, specially + * after releasing the mouse button, the grid will @b snap to the + * nearest displaying page's area. When page sizes are set, the + * grid's continuous content area is split into (equal) page sized + * pieces. + * + * This function sets the size of a page relatively to the + * viewport dimensions of the gengrid, for each axis. A value + * @c 1.0 means "the exact viewport's size", in that axis, while @c + * 0.0 turns paging off in that axis. Likewise, @c 0.5 means "half + * a viewport". Sane usable values are, than, between @c 0.0 and @c + * 1.0. Values beyond those will make it behave behave + * inconsistently. If you only want one axis to snap to pages, use + * the value @c 0.0 for the other one. + * + * There is a function setting page size values in @b absolute + * values, too -- elm_gengrid_page_size_set(). Naturally, its use + * is mutually exclusive to this one. + * + * @deprecated Use elm_scroller_page_relative_set() instead. + * + * @see elm_scroller_page_relative_set() + * + * @ingroup Gengrid + */ +EINA_DEPRECATED EAPI void elm_gengrid_page_relative_set(Evas_Object *obj, double h_pagerel, double v_pagerel); + +/** + * Get a given gengrid widget's scrolling page size, relative to + * its viewport size. + * + * @param obj The gengrid object + * @param h_pagerel Pointer to a variable where to store the + * horizontal page (relative) size + * @param v_pagerel Pointer to a variable where to store the + * vertical page (relative) size + * + * @deprecated Use elm_scroller_page_relative_get() instead. + * + * @see elm_scroller_page_relative_get() + * + * @ingroup Gengrid + */ +EINA_DEPRECATED EAPI void elm_gengrid_page_relative_get(const Evas_Object *obj, double *h_pagerel, double *v_pagerel); + +/** + * Set a given gengrid widget's scrolling page size + * + * @param obj The gengrid object + * @param h_pagesize The horizontal page size, in pixels + * @param v_pagesize The vertical page size, in pixels + * + * The gengrid's scroller is capable of binding scrolling by the + * user to "pages". It means that, while scrolling and, specially + * after releasing the mouse button, the grid will @b snap to the + * nearest displaying page's area. When page sizes are set, the + * grid's continuous content area is split into (equal) page sized + * pieces. + * + * This function sets the size of a page of the gengrid, in pixels, + * for each axis. Sane usable values are, between @c 0 and the + * dimensions of @p obj, for each axis. Values beyond those will + * make it behave behave inconsistently. If you only want one axis + * to snap to pages, use the value @c 0 for the other one. + * + * There is a function setting page size values in @b relative + * values, too -- elm_gengrid_page_relative_set(). Naturally, its + * use is mutually exclusive to this one. + * + * @deprecated Use elm_scroller_page_size_set() instead. + * + * @see elm_scroller_page_size_set() + * + * @ingroup Gengrid + */ +EINA_DEPRECATED EAPI void elm_gengrid_page_size_set(Evas_Object *obj, Evas_Coord h_pagesize, Evas_Coord v_pagesize); + +/** + * @brief Get gengrid current page number. + * + * @param obj The gengrid object + * @param h_pagenumber The horizontal page number + * @param v_pagenumber The vertical page number + * + * The page number starts from 0. 0 is the first page. + * Current page means the page which meet the top-left of the viewport. + * If there are two or more pages in the viewport, it returns the number of page + * which meet the top-left of the viewport. + * + * @deprecated Use elm_scroller_current_page_set() instead. + * + * @see elm_scroller_current_page_set() + * + * @see elm_gengrid_last_page_get() + * @see elm_gengrid_page_show() + * @see elm_gengrid_page_bring_in() + */ +EINA_DEPRECATED EAPI void elm_gengrid_current_page_get(const Evas_Object *obj, int *h_pagenumber, int *v_pagenumber); + +/** + * @brief Get gengrid last page number. + * + * @param obj The gengrid object + * @param h_pagenumber The horizontal page number + * @param v_pagenumber The vertical page number + * + * The page number starts from 0. 0 is the first page. + * This returns the last page number among the pages. + * + * @deprecated Use elm_scroller_last_page_set() instead. + * + * @see elm_scroller_last_page_set() + * + * @see elm_gengrid_current_page_get() + * @see elm_gengrid_page_show() + * @see elm_gengrid_page_bring_in() + */ +EINA_DEPRECATED EAPI void elm_gengrid_last_page_get(const Evas_Object *obj, int *h_pagenumber, int *v_pagenumber); + +/** + * Show a specific virtual region within the gengrid content object by page number. + * + * @param obj The gengrid object + * @param h_pagenumber The horizontal page number + * @param v_pagenumber The vertical page number + * + * 0, 0 of the indicated page is located at the top-left of the viewport. + * This will jump to the page directly without animation. + * + * Example of usage: + * + * @code + * sc = elm_gengrid_add(win); + * elm_gengrid_content_set(sc, content); + * elm_gengrid_page_relative_set(sc, 1, 0); + * elm_gengrid_current_page_get(sc, &h_page, &v_page); + * elm_gengrid_page_show(sc, h_page + 1, v_page); + * @endcode + * + * @see elm_gengrid_page_bring_in() + */ +EAPI void elm_gengrid_page_show(const Evas_Object *obj, int h_pagenumber, int v_pagenumber); + +/** + * Show a specific virtual region within the gengrid content object by page number. + * + * @param obj The gengrid object + * @param h_pagenumber The horizontal page number + * @param v_pagenumber The vertical page number + * + * 0, 0 of the indicated page is located at the top-left of the viewport. + * This will slide to the page with animation. + * + * Example of usage: + * + * @code + * sc = elm_gengrid_add(win); + * elm_gengrid_content_set(sc, content); + * elm_gengrid_page_relative_set(sc, 1, 0); + * elm_gengrid_last_page_get(sc, &h_page, &v_page); + * elm_gengrid_page_bring_in(sc, h_page, v_page); + * @endcode + * + * @deprecated Use elm_scroller_page_bring_in() instead. + * + * @see elm_scroller_page_bring_in() + * + * @see elm_gengrid_page_show() + */ +EINA_DEPRECATED EAPI void elm_gengrid_page_bring_in(const Evas_Object *obj, int h_pagenumber, int v_pagenumber); + +/** + * Set how the items grid's filled within a given gengrid widget + * + * @param obj The gengrid object. + * @param fill Filled if True + * + * This sets the fill state of the whole grid of items of a gengrid + * within its given viewport. By default, this value is false, meaning + * that if the first line of items grid's isn't filled, the items are + * centered with the alignment + * + * @see elm_gengrid_filled_get() + * + * @ingroup Gengrid + * + */ +EAPI void elm_gengrid_filled_set(Evas_Object *obj, Eina_Bool fill); + +/** + * Get how the items grid's filled within a given gengrid widget + * + * @param obj The gengrid object. + * @return @c EINA_TRUE, if filled is on, @c EINA_FALSE if it's + * off + * + * @note Use @c NULL pointers on the alignment values you're not + * interested in: they'll be ignored by the function. + * + * @see elm_gengrid_align_set() for more details + * + * @ingroup Gengrid + */ +EAPI Eina_Bool elm_gengrid_filled_get(const Evas_Object *obj); + +/** + * Set the gengrid select mode. + * + * @param obj The gengrid object + * @param mode The select mode + * + * elm_gengrid_select_mode_set() changes item select mode in the gengrid widget. + * - ELM_OBJECT_SELECT_MODE_DEFAULT : Items will only call their selection func and + * callback when first becoming selected. Any further clicks will + * do nothing, unless you set always select mode. + * - ELM_OBJECT_SELECT_MODE_ALWAYS : This means that, even if selected, + * every click will make the selected callbacks be called. + * - ELM_OBJECT_SELECT_MODE_NONE : This will turn off the ability to select items + * entirely and they will neither appear selected nor call selected + * callback functions. + * + * @see elm_gengrid_select_mode_get() + * + * @ingroup Gengrid + */ +EAPI void elm_gengrid_select_mode_set(Evas_Object *obj, Elm_Object_Select_Mode mode); + +/** + * Get the gengrid select mode. + * + * @param obj The gengrid object + * @return The select mode + * (If getting mode is failed, it returns ELM_OBJECT_SELECT_MODE_MAX) + * + * @see elm_gengrid_select_mode_set() + * + * @ingroup Gengrid + */ +EAPI Elm_Object_Select_Mode elm_gengrid_select_mode_get(const Evas_Object *obj); + +/** + * Set whether the gengrid items' should be highlighted when item selected. + * + * @param obj The gengrid object. + * @param highlight @c EINA_TRUE to enable highlight or @c EINA_FALSE to + * disable it. + * + * This will turn on/off the highlight effect when items are selected and + * they will or will not be highlighted. The selected and clicked + * callback functions will still be called. + * + * highlight is enabled by default. + * + * @see elm_gengrid_highlight_mode_get(). + * + * @ingroup Gengrid + */ + +EAPI void elm_gengrid_highlight_mode_set(Evas_Object *obj, Eina_Bool highlight); + +/** + * Get whether the gengrid items' should be highlighted when item selected. + * + * @param obj The gengrid object. + * @return @c EINA_TRUE means items can be highlighted. @c EINA_FALSE indicates + * they can't. If @p obj is @c NULL, @c EINA_FALSE is returned. + * + * @see elm_gengrid_highlight_mode_set() for details. + * + * @ingroup Gengrid + */ + +EAPI Eina_Bool elm_gengrid_highlight_mode_get(const Evas_Object *obj); + +/** + * Get the nth item, in a given gengrid widget, placed at position @p nth, in + * its internal items list + * + * @param obj The gengrid object + * @param nth The number of the item to grab (0 being the first) + * + * @return The item stored in @p obj at position @p nth or @c NULL, if there's + * no item with that index (and on errors) + * + * @ingroup Genilst + * @since 1.8 + */ +EAPI Elm_Object_Item *elm_gengrid_nth_item_get(const Evas_Object *obj, unsigned int nth); diff --git a/legacy/elementary/src/lib/elm_genlist.h b/legacy/elementary/src/lib/elm_genlist.h index d9369f6936..f5a782c8e1 100644 --- a/legacy/elementary/src/lib/elm_genlist.h +++ b/legacy/elementary/src/lib/elm_genlist.h @@ -391,1988 +391,18 @@ * - @ref genlist_example_05 */ -#define ELM_OBJ_GENLIST_PAN_CLASS elm_obj_genlist_pan_class_get() - -const Eo_Class *elm_obj_genlist_pan_class_get(void) EINA_CONST; - -#define ELM_OBJ_GENLIST_CLASS elm_obj_genlist_class_get() - -const Eo_Class *elm_obj_genlist_class_get(void) EINA_CONST; - -extern EAPI Eo_Op ELM_OBJ_GENLIST_BASE_ID; - -enum -{ - ELM_OBJ_GENLIST_SUB_ID_ITEMS_COUNT, - ELM_OBJ_GENLIST_SUB_ID_ITEM_APPEND, - ELM_OBJ_GENLIST_SUB_ID_ITEM_PREPEND, - ELM_OBJ_GENLIST_SUB_ID_ITEM_INSERT_AFTER, - ELM_OBJ_GENLIST_SUB_ID_ITEM_INSERT_BEFORE, - ELM_OBJ_GENLIST_SUB_ID_ITEM_SORTED_INSERT, - ELM_OBJ_GENLIST_SUB_ID_CLEAR, - ELM_OBJ_GENLIST_SUB_ID_MULTI_SELECT_SET, - ELM_OBJ_GENLIST_SUB_ID_MULTI_SELECT_GET, - ELM_OBJ_GENLIST_SUB_ID_SELECTED_ITEM_GET, - ELM_OBJ_GENLIST_SUB_ID_SELECTED_ITEMS_GET, - ELM_OBJ_GENLIST_SUB_ID_REALIZED_ITEMS_GET, - ELM_OBJ_GENLIST_SUB_ID_AT_XY_ITEM_GET, - ELM_OBJ_GENLIST_SUB_ID_FIRST_ITEM_GET, - ELM_OBJ_GENLIST_SUB_ID_LAST_ITEM_GET, - ELM_OBJ_GENLIST_SUB_ID_MODE_SET, - ELM_OBJ_GENLIST_SUB_ID_MODE_GET, - ELM_OBJ_GENLIST_SUB_ID_HOMOGENEOUS_SET, - ELM_OBJ_GENLIST_SUB_ID_HOMOGENEOUS_GET, - ELM_OBJ_GENLIST_SUB_ID_BLOCK_COUNT_SET, - ELM_OBJ_GENLIST_SUB_ID_BLOCK_COUNT_GET, - ELM_OBJ_GENLIST_SUB_ID_LONGPRESS_TIMEOUT_SET, - ELM_OBJ_GENLIST_SUB_ID_LONGPRESS_TIMEOUT_GET, - ELM_OBJ_GENLIST_SUB_ID_REALIZED_ITEMS_UPDATE, - ELM_OBJ_GENLIST_SUB_ID_DECORATED_ITEM_GET, - ELM_OBJ_GENLIST_SUB_ID_DECORATE_MODE_GET, - ELM_OBJ_GENLIST_SUB_ID_DECORATE_MODE_SET, - ELM_OBJ_GENLIST_SUB_ID_REORDER_MODE_SET, - ELM_OBJ_GENLIST_SUB_ID_REORDER_MODE_GET, - ELM_OBJ_GENLIST_SUB_ID_SELECT_MODE_SET, - ELM_OBJ_GENLIST_SUB_ID_SELECT_MODE_GET, - ELM_OBJ_GENLIST_SUB_ID_HIGHLIGHT_MODE_SET, - ELM_OBJ_GENLIST_SUB_ID_HIGHLIGHT_MODE_GET, - ELM_OBJ_GENLIST_SUB_ID_TREE_EFFECT_ENABLED_SET, - ELM_OBJ_GENLIST_SUB_ID_TREE_EFFECT_ENABLED_GET, - ELM_OBJ_GENLIST_SUB_ID_LAST -}; - -#define ELM_OBJ_GENLIST_ID(sub_id) (ELM_OBJ_GENLIST_BASE_ID + sub_id) - - -/** - * @def elm_obj_genlist_items_count - * @since 1.8 - * - * Return how many items are currently in a list - * - * @param[out] ret - * - * @see elm_genlist_items_count - */ -#define elm_obj_genlist_items_count(ret) ELM_OBJ_GENLIST_ID(ELM_OBJ_GENLIST_SUB_ID_ITEMS_COUNT), EO_TYPECHECK(unsigned int *, ret) - -/** - * @def elm_obj_genlist_item_append - * @since 1.8 - * - * Append a new item in a given genlist widget. - * - * @param[in] itc - * @param[in] data - * @param[in] parent - * @param[in] type - * @param[in] func - * @param[in] func_data - * @param[out] ret - * - * @see elm_genlist_item_append - */ -#define elm_obj_genlist_item_append(itc, data, parent, type, func, func_data, ret) ELM_OBJ_GENLIST_ID(ELM_OBJ_GENLIST_SUB_ID_ITEM_APPEND), EO_TYPECHECK(const Elm_Genlist_Item_Class *, itc), EO_TYPECHECK(const void *, data), EO_TYPECHECK(Elm_Object_Item *, parent), EO_TYPECHECK(Elm_Genlist_Item_Type, type), EO_TYPECHECK(Evas_Smart_Cb, func), EO_TYPECHECK(const void *, func_data), EO_TYPECHECK(Elm_Object_Item **, ret) - -/** - * @def elm_obj_genlist_item_prepend - * @since 1.8 - * - * Prepend a new item in a given genlist widget. - * - * @param[in] itc - * @param[in] data - * @param[in] parent - * @param[in] type - * @param[in] func - * @param[in] func_data - * @param[out] ret - * - * @see elm_genlist_item_prepend - */ -#define elm_obj_genlist_item_prepend(itc, data, parent, type, func, func_data, ret) ELM_OBJ_GENLIST_ID(ELM_OBJ_GENLIST_SUB_ID_ITEM_PREPEND), EO_TYPECHECK(const Elm_Genlist_Item_Class *, itc), EO_TYPECHECK(const void *, data), EO_TYPECHECK(Elm_Object_Item *, parent), EO_TYPECHECK(Elm_Genlist_Item_Type, type), EO_TYPECHECK(Evas_Smart_Cb, func), EO_TYPECHECK(const void *, func_data), EO_TYPECHECK(Elm_Object_Item **, ret) - -/** - * @def elm_obj_genlist_item_insert_after - * @since 1.8 - * - * Insert an item after another in a genlist widget - * - * @param[in] itc - * @param[in] data - * @param[in] parent - * @param[in] after_it - * @param[in] type - * @param[in] func - * @param[in] func_data - * @param[out] ret - * - * @see elm_genlist_item_insert_after - */ -#define elm_obj_genlist_item_insert_after(itc, data, parent, after_it, type, func, func_data, ret) ELM_OBJ_GENLIST_ID(ELM_OBJ_GENLIST_SUB_ID_ITEM_INSERT_AFTER), EO_TYPECHECK(const Elm_Genlist_Item_Class *, itc), EO_TYPECHECK(const void *, data), EO_TYPECHECK(Elm_Object_Item *, parent), EO_TYPECHECK(Elm_Object_Item *, after_it), EO_TYPECHECK(Elm_Genlist_Item_Type, type), EO_TYPECHECK(Evas_Smart_Cb, func), EO_TYPECHECK(const void *, func_data), EO_TYPECHECK(Elm_Object_Item **, ret) - -/** - * @def elm_obj_genlist_item_insert_before - * @since 1.8 - * - * Insert an item before another in a genlist widget - * - * @param[in] itc - * @param[in] data - * @param[in] parent - * @param[in] before_it - * @param[in] type - * @param[in] func - * @param[in] func_data - * @param[out] ret - * - * @see elm_genlist_item_insert_before - */ -#define elm_obj_genlist_item_insert_before(itc, data, parent, before_it, type, func, func_data, ret) ELM_OBJ_GENLIST_ID(ELM_OBJ_GENLIST_SUB_ID_ITEM_INSERT_BEFORE), EO_TYPECHECK(const Elm_Genlist_Item_Class *, itc), EO_TYPECHECK(const void *, data), EO_TYPECHECK(Elm_Object_Item *, parent), EO_TYPECHECK(Elm_Object_Item *, before_it), EO_TYPECHECK(Elm_Genlist_Item_Type, type), EO_TYPECHECK(Evas_Smart_Cb, func), EO_TYPECHECK(const void *, func_data), EO_TYPECHECK(Elm_Object_Item **, ret) - -/** - * @def elm_obj_genlist_item_sorted_insert - * @since 1.8 - * - * Insert a new item into the sorted genlist object - * - * @param[in] itc - * @param[in] data - * @param[in] parent - * @param[in] type - * @param[in] comp - * @param[in] func - * @param[in] func_data - * @param[out] ret - * - * @see elm_genlist_item_sorted_insert - */ -#define elm_obj_genlist_item_sorted_insert(itc, data, parent, type, comp, func, func_data, ret) ELM_OBJ_GENLIST_ID(ELM_OBJ_GENLIST_SUB_ID_ITEM_SORTED_INSERT), EO_TYPECHECK(const Elm_Genlist_Item_Class *, itc), EO_TYPECHECK(const void *, data), EO_TYPECHECK(Elm_Object_Item *, parent), EO_TYPECHECK(Elm_Genlist_Item_Type, type), EO_TYPECHECK(Eina_Compare_Cb, comp), EO_TYPECHECK(Evas_Smart_Cb, func), EO_TYPECHECK(const void *, func_data), EO_TYPECHECK(Elm_Object_Item **, ret) - -/** - * @def elm_obj_genlist_clear - * @since 1.8 - * - * Remove all items from a given genlist widget. - * - * - * @see elm_genlist_clear - */ -#define elm_obj_genlist_clear() ELM_OBJ_GENLIST_ID(ELM_OBJ_GENLIST_SUB_ID_CLEAR) - -/** - * @def elm_obj_genlist_multi_select_set - * @since 1.8 - * - * Enable or disable multi-selection in the genlist - * - * @param[in] multi - * - * @see elm_genlist_multi_select_set - */ -#define elm_obj_genlist_multi_select_set(multi) ELM_OBJ_GENLIST_ID(ELM_OBJ_GENLIST_SUB_ID_MULTI_SELECT_SET), EO_TYPECHECK(Eina_Bool, multi) - -/** - * @def elm_obj_genlist_multi_select_get - * @since 1.8 - * - * Gets if multi-selection in genlist is enabled or disabled. - * - * @param[out] ret - * - * @see elm_genlist_multi_select_get - */ -#define elm_obj_genlist_multi_select_get(ret) ELM_OBJ_GENLIST_ID(ELM_OBJ_GENLIST_SUB_ID_MULTI_SELECT_GET), EO_TYPECHECK(Eina_Bool *, ret) - -/** - * @def elm_obj_genlist_selected_item_get - * @since 1.8 - * - * Get the selected item in the genlist. - * - * @param[out] ret - * - * @see elm_genlist_selected_item_get - */ -#define elm_obj_genlist_selected_item_get(ret) ELM_OBJ_GENLIST_ID(ELM_OBJ_GENLIST_SUB_ID_SELECTED_ITEM_GET), EO_TYPECHECK(Elm_Object_Item **, ret) - -/** - * @def elm_obj_genlist_selected_items_get - * @since 1.8 - * - * Get a list of selected items in the genlist. - * - * @param[out] ret - * - * @see elm_genlist_selected_items_get - */ -#define elm_obj_genlist_selected_items_get(ret) ELM_OBJ_GENLIST_ID(ELM_OBJ_GENLIST_SUB_ID_SELECTED_ITEMS_GET), EO_TYPECHECK(const Eina_List **, ret) - -/** - * @def elm_obj_genlist_realized_items_get - * @since 1.8 - * - * Get a list of realized items in genlist - * - * @param[out] ret - * - * @see elm_genlist_realized_items_get - */ -#define elm_obj_genlist_realized_items_get(ret) ELM_OBJ_GENLIST_ID(ELM_OBJ_GENLIST_SUB_ID_REALIZED_ITEMS_GET), EO_TYPECHECK(Eina_List **, ret) - -/** - * @def elm_obj_genlist_at_xy_item_get - * @since 1.8 - * - * Get the item that is at the x, y canvas coords. - * - * @param[in] x - * @param[in] y - * @param[out] posret - * @param[out] ret - * - * @see elm_genlist_at_xy_item_get - */ -#define elm_obj_genlist_at_xy_item_get(x, y, posret, ret) ELM_OBJ_GENLIST_ID(ELM_OBJ_GENLIST_SUB_ID_AT_XY_ITEM_GET), EO_TYPECHECK(Evas_Coord, x), EO_TYPECHECK(Evas_Coord, y), EO_TYPECHECK(int *, posret), EO_TYPECHECK(Elm_Object_Item **, ret) - -/** - * @def elm_obj_genlist_first_item_get - * @since 1.8 - * - * Get the first item in the genlist - * - * @param[out] ret - * - * @see elm_genlist_first_item_get - */ -#define elm_obj_genlist_first_item_get(ret) ELM_OBJ_GENLIST_ID(ELM_OBJ_GENLIST_SUB_ID_FIRST_ITEM_GET), EO_TYPECHECK(Elm_Object_Item **, ret) - -/** - * @def elm_obj_genlist_last_item_get - * @since 1.8 - * - * Get the last item in the genlist - * - * @param[out] ret - * - * @see elm_genlist_last_item_get - */ -#define elm_obj_genlist_last_item_get(ret) ELM_OBJ_GENLIST_ID(ELM_OBJ_GENLIST_SUB_ID_LAST_ITEM_GET), EO_TYPECHECK(Elm_Object_Item **, ret) - -/** - * @def elm_obj_genlist_mode_set - * @since 1.8 - * - * This sets the horizontal stretching mode. - * - * @param[in] mode - * - * @see elm_genlist_mode_set - */ -#define elm_obj_genlist_mode_set(mode) ELM_OBJ_GENLIST_ID(ELM_OBJ_GENLIST_SUB_ID_MODE_SET), EO_TYPECHECK(Elm_List_Mode, mode) - -/** - * @def elm_obj_genlist_mode_get - * @since 1.8 - * - * Gets the horizontal stretching mode. - * - * @param[out] ret - * - * @see elm_genlist_mode_get - */ -#define elm_obj_genlist_mode_get(ret) ELM_OBJ_GENLIST_ID(ELM_OBJ_GENLIST_SUB_ID_MODE_GET), EO_TYPECHECK(Elm_List_Mode *, ret) - -/** - * @def elm_obj_genlist_homogeneous_set - * @since 1.8 - * - * Enable/disable homogeneous mode. - * - * @param[in] homogeneous - * - * @see elm_genlist_homogeneous_set - */ -#define elm_obj_genlist_homogeneous_set(homogeneous) ELM_OBJ_GENLIST_ID(ELM_OBJ_GENLIST_SUB_ID_HOMOGENEOUS_SET), EO_TYPECHECK(Eina_Bool, homogeneous) - -/** - * @def elm_obj_genlist_homogeneous_get - * @since 1.8 - * - * Get whether the homogeneous mode is enabled. - * - * @param[out] ret - * - * @see elm_genlist_homogeneous_get - */ -#define elm_obj_genlist_homogeneous_get(ret) ELM_OBJ_GENLIST_ID(ELM_OBJ_GENLIST_SUB_ID_HOMOGENEOUS_GET), EO_TYPECHECK(Eina_Bool *, ret) - -/** - * @def elm_obj_genlist_block_count_set - * @since 1.8 - * - * Set the maximum number of items within an item block - * - * @param[in] count - * - * @see elm_genlist_block_count_set - */ -#define elm_obj_genlist_block_count_set(count) ELM_OBJ_GENLIST_ID(ELM_OBJ_GENLIST_SUB_ID_BLOCK_COUNT_SET), EO_TYPECHECK(int, count) - -/** - * @def elm_obj_genlist_block_count_get - * @since 1.8 - * - * Get the maximum number of items within an item block - * - * @param[out] ret - * - * @see elm_genlist_block_count_get - */ -#define elm_obj_genlist_block_count_get(ret) ELM_OBJ_GENLIST_ID(ELM_OBJ_GENLIST_SUB_ID_BLOCK_COUNT_GET), EO_TYPECHECK(int *, ret) - -/** - * @def elm_obj_genlist_longpress_timeout_set - * @since 1.8 - * - * Set the timeout in seconds for the longpress event. - * - * @param[in] timeout - * - * @see elm_genlist_longpress_timeout_set - */ -#define elm_obj_genlist_longpress_timeout_set(timeout) ELM_OBJ_GENLIST_ID(ELM_OBJ_GENLIST_SUB_ID_LONGPRESS_TIMEOUT_SET), EO_TYPECHECK(double, timeout) - -/** - * @def elm_obj_genlist_longpress_timeout_get - * @since 1.8 - * - * Get the timeout in seconds for the longpress event. - * - * @param[out] ret - * - * @see elm_genlist_longpress_timeout_get - */ -#define elm_obj_genlist_longpress_timeout_get(ret) ELM_OBJ_GENLIST_ID(ELM_OBJ_GENLIST_SUB_ID_LONGPRESS_TIMEOUT_GET), EO_TYPECHECK(double *, ret) - -/** - * @def elm_obj_genlist_realized_items_update - * @since 1.8 - * - * Update the contents of all realized items. - * - * - * @see elm_genlist_realized_items_update - */ -#define elm_obj_genlist_realized_items_update() ELM_OBJ_GENLIST_ID(ELM_OBJ_GENLIST_SUB_ID_REALIZED_ITEMS_UPDATE) - -/** - * @def elm_obj_genlist_decorated_item_get - * @since 1.8 - * - * Get active genlist mode item - * - * @param[out] ret - * - * @see elm_genlist_decorated_item_get - */ -#define elm_obj_genlist_decorated_item_get(ret) ELM_OBJ_GENLIST_ID(ELM_OBJ_GENLIST_SUB_ID_DECORATED_ITEM_GET), EO_TYPECHECK(Elm_Object_Item **, ret) - -/** - * @def elm_obj_genlist_decorate_mode_get - * @since 1.8 - * - * Get Genlist decorate mode - * - * @param[out] ret - * - * @see elm_genlist_decorate_mode_get - */ -#define elm_obj_genlist_decorate_mode_get(ret) ELM_OBJ_GENLIST_ID(ELM_OBJ_GENLIST_SUB_ID_DECORATE_MODE_GET), EO_TYPECHECK(Eina_Bool *, ret) - -/** - * @def elm_obj_genlist_decorate_mode_set - * @since 1.8 - * - * Set Genlist decorate mode - * - * @param[in] decorated - * - * @see elm_genlist_decorate_mode_set - */ -#define elm_obj_genlist_decorate_mode_set(decorated) ELM_OBJ_GENLIST_ID(ELM_OBJ_GENLIST_SUB_ID_DECORATE_MODE_SET), EO_TYPECHECK(Eina_Bool, decorated) - -/** - * @def elm_obj_genlist_reorder_mode_set - * @since 1.8 - * - * Set reorder mode - * - * @param[in] reorder_mode - * - * @see elm_genlist_reorder_mode_set - */ -#define elm_obj_genlist_reorder_mode_set(reorder_mode) ELM_OBJ_GENLIST_ID(ELM_OBJ_GENLIST_SUB_ID_REORDER_MODE_SET), EO_TYPECHECK(Eina_Bool, reorder_mode) - -/** - * @def elm_obj_genlist_reorder_mode_get - * @since 1.8 - * - * Get the reorder mode - * - * @param[out] ret - * - * @see elm_genlist_reorder_mode_get - */ -#define elm_obj_genlist_reorder_mode_get(ret) ELM_OBJ_GENLIST_ID(ELM_OBJ_GENLIST_SUB_ID_REORDER_MODE_GET), EO_TYPECHECK(Eina_Bool *, ret) - -/** - * @def elm_obj_genlist_select_mode_set - * @since 1.8 - * - * Set the genlist select mode. - * - * @param[in] mode - * - * @see elm_genlist_select_mode_set - */ -#define elm_obj_genlist_select_mode_set(mode) ELM_OBJ_GENLIST_ID(ELM_OBJ_GENLIST_SUB_ID_SELECT_MODE_SET), EO_TYPECHECK(Elm_Object_Select_Mode, mode) - -/** - * @def elm_obj_genlist_select_mode_get - * @since 1.8 - * - * Get the genlist select mode. - * - * @param[out] ret - * - * @see elm_genlist_select_mode_get - */ -#define elm_obj_genlist_select_mode_get(ret) ELM_OBJ_GENLIST_ID(ELM_OBJ_GENLIST_SUB_ID_SELECT_MODE_GET), EO_TYPECHECK(Elm_Object_Select_Mode *, ret) - -/** - * @def elm_obj_genlist_highlight_mode_set - * @since 1.8 - * - * Set whether the genlist items' should be highlighted when item selected. - * - * @param[in] highlight - * - * @see elm_genlist_highlight_mode_set - */ -#define elm_obj_genlist_highlight_mode_set(highlight) ELM_OBJ_GENLIST_ID(ELM_OBJ_GENLIST_SUB_ID_HIGHLIGHT_MODE_SET), EO_TYPECHECK(Eina_Bool, highlight) - -/** - * @def elm_obj_genlist_highlight_mode_get - * @since 1.8 - * - * Get whether the genlist items' should be highlighted when item selected. - * - * @param[out] ret - * - * @see elm_genlist_highlight_mode_get - */ -#define elm_obj_genlist_highlight_mode_get(ret) ELM_OBJ_GENLIST_ID(ELM_OBJ_GENLIST_SUB_ID_HIGHLIGHT_MODE_GET), EO_TYPECHECK(Eina_Bool *, ret) - -/** - * @def elm_obj_genlist_tree_effect_enabled_set - * @since 1.8 - * - * Set Genlist tree effect - * - * @param[in] enabled - * - * @see elm_genlist_tree_effect_enabled_set - */ -#define elm_obj_genlist_tree_effect_enabled_set(enabled) ELM_OBJ_GENLIST_ID(ELM_OBJ_GENLIST_SUB_ID_TREE_EFFECT_ENABLED_SET), EO_TYPECHECK(Eina_Bool, enabled) - -/** - * @def elm_obj_genlist_tree_effect_enabled_get - * @since 1.8 - * - * Get Genlist tree effect - * - * @param[out] ret - * - * @see elm_genlist_tree_effect_enabled_get - */ -#define elm_obj_genlist_tree_effect_enabled_get(ret) ELM_OBJ_GENLIST_ID(ELM_OBJ_GENLIST_SUB_ID_TREE_EFFECT_ENABLED_GET), EO_TYPECHECK(Eina_Bool *, ret) - /** * @addtogroup Genlist * @{ */ -#define ELM_GENLIST_ITEM_CLASS_VERSION ELM_GEN_ITEM_CLASS_VERSION -#define ELM_GENLIST_ITEM_CLASS_HEADER ELM_GEN_ITEM_CLASS_HEADER - -/** - * Defines if the item is of any special type (has subitems or it's the - * index of a group), or is just a simple item. - * - * @ingroup Genlist - */ -typedef enum -{ - ELM_GENLIST_ITEM_NONE = 0, /**< simple item */ - ELM_GENLIST_ITEM_TREE = (1 << 0), /**< this may be expanded and have child items. */ - ELM_GENLIST_ITEM_GROUP = (1 << 1), /**< an index item of a group of items. this item can have child items. */ - - ELM_GENLIST_ITEM_MAX = (1 << 2) -} Elm_Genlist_Item_Type; - -/** - * Defines the type of the item part - * Used while updating item's parts - * It can be used at updating multi fields. - * - * @ingroup Genlist - */ -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_Type; - -/** - * Defines where to position the item in the genlist. - * - * @ingroup Genlist - */ -typedef enum -{ - ELM_GENLIST_ITEM_SCROLLTO_NONE = 0, /**< no scrollto */ - ELM_GENLIST_ITEM_SCROLLTO_IN = (1 << 0), /**< to the nearest viewport */ - ELM_GENLIST_ITEM_SCROLLTO_TOP = (1 << 1), /**< to the top of viewport */ - ELM_GENLIST_ITEM_SCROLLTO_MIDDLE = (1 << 2) /**< to the middle of viewport */ -} Elm_Genlist_Item_Scrollto_Type; - -/** - * @see Elm_Gen_Item_Class - */ -typedef Elm_Gen_Item_Class Elm_Genlist_Item_Class; - -/** - * @see Elm_Gen_Item_Text_Get_Cb - */ -typedef Elm_Gen_Item_Text_Get_Cb Elm_Genlist_Item_Text_Get_Cb; - -/** - * @see Elm_Gen_Item_Content_Get_Cb - */ -typedef Elm_Gen_Item_Content_Get_Cb Elm_Genlist_Item_Content_Get_Cb; - -/** - * @see Elm_Gen_Item_State_Get_Cb - */ -typedef Elm_Gen_Item_State_Get_Cb Elm_Genlist_Item_State_Get_Cb; - -/** - * @see Elm_Gen_Item_Del_Cb - */ -typedef Elm_Gen_Item_Del_Cb Elm_Genlist_Item_Del_Cb; - -/** - * Add a new genlist widget to the given parent Elementary - * (container) object - * - * @param parent The parent object - * @return a new genlist widget handle or @c NULL, on errors - * - * This function inserts a new genlist widget on the canvas. - * - * @see elm_genlist_item_append() - * @see elm_object_item_del() - * @see elm_genlist_clear() - * - * @ingroup Genlist - */ -EAPI Evas_Object *elm_genlist_add(Evas_Object *parent); - -/** - * Remove all items from a given genlist widget. - * - * @param obj The genlist object - * - * This removes (and deletes) all items in @p obj, leaving it empty. - * - * @see elm_object_item_del(), to remove just one item. - * - * @ingroup Genlist - */ -EAPI void elm_genlist_clear(Evas_Object *obj); - -/** - * Enable or disable multi-selection in the genlist - * - * @param obj The genlist object - * @param multi Multi-select enable/disable. Default is disabled. - * - * This enables (@c EINA_TRUE) or disables (@c EINA_FALSE) multi-selection in - * the list. This allows more than 1 item to be selected. To retrieve the list - * of selected items, use elm_genlist_selected_items_get(). - * - * @see elm_genlist_selected_items_get() - * @see elm_genlist_multi_select_get() - * - * @ingroup Genlist - */ -EAPI void elm_genlist_multi_select_set(Evas_Object *obj, Eina_Bool multi); - -/** - * Gets if multi-selection in genlist is enabled or disabled. - * - * @param obj The genlist object - * @return Multi-select enabled/disabled - * (@c EINA_TRUE = enabled/@c EINA_FALSE = disabled). Default is @c EINA_FALSE. - * - * @see elm_genlist_multi_select_set() - * - * @ingroup Genlist - */ -EAPI Eina_Bool elm_genlist_multi_select_get(const Evas_Object *obj); - -/** - * This sets the horizontal stretching mode. - * - * @param obj The genlist object - * @param mode The mode to use (one of #ELM_LIST_SCROLL or #ELM_LIST_LIMIT). - * - * This sets the mode used for sizing items horizontally. Valid modes - * are #ELM_LIST_LIMIT, #ELM_LIST_SCROLL, and #ELM_LIST_COMPRESS. The default is - * ELM_LIST_SCROLL. This mode means that if items are too wide to fit, - * the scroller will scroll horizontally. Otherwise items are expanded - * to fill the width of the viewport of the scroller. If it is - * ELM_LIST_LIMIT, items will be expanded to the viewport width and - * limited to that size. If it is ELM_LIST_COMPRESS, the item width will be - * fixed (restricted to a minimum of) to the list width when calculating its - * size in order to allow the height to be calculated based on it. This allows, - * for instance, text block to wrap lines if the Edje part is configured with - * "text.min: 0 1". - * @note ELM_LIST_COMPRESS will make list resize slower as it will have to - * recalculate every item height again whenever the list width - * changes! - * @note Homogeneous mode is for that all items in the genlist same - * width/height. With ELM_LIST_COMPRESS, it makes genlist items to fast - * initializing. However there's no sub-objects in genlist which can be - * on the flying resizable (such as TEXTBLOCK). If then, some dynamic - * resizable objects in genlist would not diplayed properly. - * - * @see elm_genlist_mode_get() - * - * @ingroup Genlist - */ -EAPI void elm_genlist_mode_set(Evas_Object *obj, Elm_List_Mode mode); - -/** - * Gets the horizontal stretching mode. - * - * @param obj The genlist object - * @return The mode to use - * (#ELM_LIST_LIMIT, #ELM_LIST_SCROLL) - * - * @see elm_genlist_mode_set() - * - * @ingroup Genlist - */ -EAPI Elm_List_Mode elm_genlist_mode_get(const Evas_Object *obj); - -/** - * Append a new item in a given genlist widget. - * - * @param obj The genlist object - * @param itc The item class for the item - * @param data The item data - * @param parent The parent item, or NULL if none - * @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 - * - * This adds the given item to the end of the list or the end of - * the children list if the @p parent is given. - * - * @see elm_genlist_item_prepend() - * @see elm_genlist_item_insert_before() - * @see elm_genlist_item_insert_after() - * @see elm_object_item_del() - * - * @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_Type type, Evas_Smart_Cb func, const void *func_data); - -/** - * Prepend a new item in a given genlist widget. - * - * @param obj The genlist object - * @param itc The item class for the item - * @param data The item data - * @param parent The parent item, or NULL if none - * @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 - * - * This adds an item to the beginning of the list or beginning of the - * children of the parent if given. - * - * @see elm_genlist_item_append() - * @see elm_genlist_item_insert_before() - * @see elm_genlist_item_insert_after() - * @see elm_object_item_del() - * - * @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_Type type, Evas_Smart_Cb func, const void *func_data); - -/** - * Insert an item before another in a genlist widget - * - * @param obj The genlist object - * @param itc The item class for the item - * @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 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 - * - * This inserts an item before another in the list. It will be in the - * same tree level or group as the item it is inserted before. - * - * @see elm_genlist_item_append() - * @see elm_genlist_item_prepend() - * @see elm_genlist_item_insert_after() - * @see elm_object_item_del() - * - * @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_Type type, Evas_Smart_Cb func, const void *func_data); - -/** - * Insert an item after another in a genlist widget - * - * @param obj The genlist object - * @param itc The item class for the item - * @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 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 - * - * This inserts an item after another in the list. It will be in the - * same tree level or group as the item it is inserted after. - * - * @see elm_genlist_item_append() - * @see elm_genlist_item_prepend() - * @see elm_genlist_item_insert_before() - * @see elm_object_item_del() - * - * @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_Type type, Evas_Smart_Cb func, const void *func_data); - -/** - * Insert a new item into the sorted genlist object - * - * @param obj The genlist object - * @param itc The item class for the item - * @param data The item data - * @param parent The parent item, or NULL if none - * @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. - * @return A handle to the item added or NULL if not possible - * - * This inserts an item in the genlist based on user defined comparison - * function. The two arguments passed to the function @p func are genlist item - * handles to compare. - * - * @see elm_genlist_item_append() - * @see elm_genlist_item_prepend() - * @see elm_genlist_item_insert_after() - * @see elm_object_item_del() - - * @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_Type type, Eina_Compare_Cb comp, Evas_Smart_Cb func, const void *func_data); - -/* operations to retrieve existing items */ -/** - * Get the selected item in the genlist. - * - * @param obj The genlist object - * @return The selected item, or NULL if none is selected. - * - * This gets the selected item in the list (if multi-selection is enabled, only - * the item that was first selected in the list is returned - which is not very - * useful, so see elm_genlist_selected_items_get() for when multi-selection is - * used). - * - * If no item is selected, NULL is returned. - * - * @see elm_genlist_selected_items_get() - * - * @ingroup Genlist - */ -EAPI Elm_Object_Item *elm_genlist_selected_item_get(const Evas_Object *obj); - -/** - * Get a list of selected items in the genlist. - * - * @param obj The genlist object - * @return The list of selected items, or NULL if none are selected. - * - * It returns a list of the selected items. This list pointer is only valid so - * long as the selection doesn't change (no items are selected or unselected, or - * unselected implicitly by deletion). The list contains genlist items - * pointers. The order of the items in this list is the order which they were - * selected, i.e. the first item in this list is the first item that was - * selected, and so on. - * - * @note If not in multi-select mode, consider using function - * elm_genlist_selected_item_get() instead. - * - * @see elm_genlist_multi_select_set() - * @see elm_genlist_selected_item_get() - * - * @ingroup Genlist - */ -EAPI const Eina_List *elm_genlist_selected_items_get(const Evas_Object *obj); - -/** - * Get a list of realized items in genlist - * - * @param obj The genlist object - * @return The list of realized items, nor NULL if none are realized. - * - * This returns a list of the realized items in the genlist. The list - * contains genlist item pointers. The list must be freed by the - * caller when done with eina_list_free(). The item pointers in the - * list are only valid so long as those items are not deleted or the - * genlist is not deleted. - * - * @see elm_genlist_realized_items_update() - * - * @ingroup Genlist - */ -EAPI Eina_List *elm_genlist_realized_items_get(const Evas_Object *obj); - -/** - * Get the first item in the genlist - * - * This returns the first item in the list. - * - * @param obj The genlist object - * @return The first item, or NULL if none - * - * @ingroup Genlist - */ -EAPI Elm_Object_Item *elm_genlist_first_item_get(const Evas_Object *obj); - -/** - * Get the last item in the genlist - * - * This returns the last item in the list. - * - * @return The last item, or NULL if none - * - * @ingroup Genlist - */ -EAPI Elm_Object_Item *elm_genlist_last_item_get(const Evas_Object *obj); - -/** - * Get the @b next item in a genlist widget's internal list of items, - * given a handle to one of those items. - * - * @param it The genlist item to fetch next from - * @return The item after @p item, or @c NULL if there's none (and - * on errors) - * - * This returns the item placed after the @p item, on the container - * genlist. - * - * @see elm_genlist_item_prev_get() - * - * @ingroup Genlist - */ -EAPI Elm_Object_Item *elm_genlist_item_next_get(const Elm_Object_Item *it); - -/** - * Get the @b previous item in a genlist widget's internal list of items, - * given a handle to one of those items. - * - * @param it The genlist item to fetch previous from - * @return The item before @p item, or @c NULL if there's none (and - * on errors) - * - * This returns the item placed before the @p item, on the container - * genlist. - * - * @see elm_genlist_item_next_get() - * - * @ingroup Genlist - */ -EAPI Elm_Object_Item *elm_genlist_item_prev_get(const Elm_Object_Item *it); - -/** - * Set whether a given genlist item is selected or not - * - * @param it The item - * @param selected Use @c EINA_TRUE, to make it selected, @c - * EINA_FALSE to make it unselected - * - * This sets the selected state of an item. If multi selection is - * not enabled on the containing genlist and @p selected is @c - * EINA_TRUE, any other previously selected items will get - * unselected in favor of this new one. - * - * @see elm_genlist_item_selected_get() - * - * @ingroup Genlist - */ -EAPI void elm_genlist_item_selected_set(Elm_Object_Item *it, Eina_Bool selected); - -/** - * Get whether a given genlist item is selected or not - * - * @param it The item - * @return @c EINA_TRUE, if it's selected, @c EINA_FALSE otherwise - * - * @see elm_genlist_item_selected_set() for more details - * - * @ingroup Genlist - */ -EAPI Eina_Bool elm_genlist_item_selected_get(const Elm_Object_Item *it); - -/** - * Show the portion of a genlist's internal list containing a given - * item, immediately. - * - * @param it The item to display - * @param type The position to bring in, the given item to. - * @ref Elm_Genlist_Item_Scrollto_Type - * - * This causes genlist to jump to the given item @p it and show it (by - * jumping to that position), if it is not fully visible. - * - * @see elm_genlist_item_bring_in() - * - * @ingroup Genlist - */ -EAPI void elm_genlist_item_show(Elm_Object_Item *it, Elm_Genlist_Item_Scrollto_Type type); - -/** - * Animatedly bring in, to the visible are of a genlist, a given - * item on it. - * - * @param it The item to display - * @param type The position to bring in, the given item to. - * @ref Elm_Genlist_Item_Scrollto_Type - * - * This causes genlist to jump to the given item @p it and show it (by - * animatedly scrolling), if it is not fully visible. - * This may use animation and take a some time to do so. - * - * @see elm_genlist_item_show() - * - * @ingroup Genlist - */ -EAPI void elm_genlist_item_bring_in(Elm_Object_Item *it, Elm_Genlist_Item_Scrollto_Type type); - -/** - * Update all the contents of an item - * - * @param it The item - * - * This updates an item by calling all the item class functions again - * to get the contents, texts and states. Use this when the original - * item data has changed and the changes are desired to be reflected. - * - * Use elm_genlist_realized_items_update() to update all already realized - * items. - * - * @note This also updates internal genlist item object(edje_object as of now). - * So when this is called between mouse down and mouse up, mouse up event will - * be ignored because edje_object is deleted and created again by this API. If - * you want to avoid this, please use @ref elm_genlist_item_fields_update. - * - * @see elm_genlist_realized_items_update() - * - * @ingroup Genlist - */ -EAPI void elm_genlist_item_update(Elm_Object_Item *it); - -/** - * Update the item class of an item - * - * @param it The item - * @param itc The item class for the item - * - * This sets another class of the item, changing the way that it is - * displayed. After changing the item class, elm_genlist_item_update() is - * called on the item @p it. - * - * @ingroup Genlist - */ -EAPI void elm_genlist_item_item_class_update(Elm_Object_Item *it, const Elm_Genlist_Item_Class *itc); - -/** - * Get the Genlist Item class for the given Genlist Item. - * - * @param it The genlist item - * - * This returns the Genlist_Item_Class for the given item. It can be used to - * examine the function pointers and item_style. - * - * @ingroup Genlist - */ -EAPI const Elm_Genlist_Item_Class *elm_genlist_item_item_class_get(const Elm_Object_Item *it); - -/** - * Get the index of the item. It is only valid once displayed. - * - * @param it a genlist item - * @return the position inside the list of item. - * - * @ingroup Genlist - */ -EAPI int elm_genlist_item_index_get(const Elm_Object_Item *it); - -/** - * Update the contents of all realized items. - * - * @param obj The genlist object. - * - * This updates all realized items by calling all the item class functions again - * to get the contents, texts and states. Use this when the original - * item data has changed and the changes are desired to be reflected. - * - * To update just one item, use elm_genlist_item_update(). - * - * @see elm_genlist_realized_items_get() - * @see elm_genlist_item_update() - * - * @ingroup Genlist - */ -EAPI void elm_genlist_realized_items_update(Evas_Object *obj); - -/** - * Return how many items are currently in a list - * - * @param obj The list - * @return The total number of list items in the list - * - * This behavior is O(1) and includes items which may or may not be realized. - * - * @ingroup Genlist - */ -EAPI unsigned int elm_genlist_items_count(const Evas_Object *obj); - -/** - * Create a new genlist item class in a given genlist widget. - * - * @return New allocated a genlist item class. - * - * This adds genlist item class for the genlist widget. When adding an item, - * genlist_item_{append, prepend, insert} function needs item class of the item. - * 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. - * - * @see elm_genlist_item_class_free() - * @see elm_genlist_item_append() - * - * @ingroup Genlist - */ -EAPI Elm_Genlist_Item_Class *elm_genlist_item_class_new(void); - -/** - * Remove an item class in a given genlist widget. - * - * @param itc The itc to be removed. - * - * This removes item class from the genlist widget. - * Whenever it has no more references to it, item class is going to be freed. - * Otherwise it just decreases its reference count. - * - * @see elm_genlist_item_class_new() - * @see elm_genlist_item_class_ref() - * @see elm_genlist_item_class_unref() - * - * @ingroup Genlist - */ -EAPI void elm_genlist_item_class_free(Elm_Genlist_Item_Class *itc); - -/** - * Increments object reference count for the item class. - * - * @param itc The given item class object to reference - * - * This API just increases its reference count for item class management. - * - * @see elm_genlist_item_class_unref() - * - * @ingroup Genlist - */ -EAPI void elm_genlist_item_class_ref(Elm_Genlist_Item_Class *itc); - -/** - * Decrements object reference count for the item class. - * - * @param itc The given item class object to reference - * - * This API just decreases its reference count for item class management. - * Reference count can't be less than 0. - * - * @see elm_genlist_item_class_ref() - * @see elm_genlist_item_class_free() - * - * @ingroup Genlist - */ -EAPI void elm_genlist_item_class_unref(Elm_Genlist_Item_Class *itc); - -/** - * Set the text to be shown in a given genlist item's tooltips. - * - * @param it The genlist item - * @param text The text to set in the content - * - * This call will setup the text to be used as tooltip to that item - * (analogous to elm_object_tooltip_text_set(), but being item - * tooltips with higher precedence than object tooltips). It can - * have only one tooltip at a time, so any previous tooltip data - * will get removed. - * - * In order to set a content or something else as a tooltip, look at - * elm_genlist_item_tooltip_content_cb_set(). - * - * @ingroup Genlist - */ -EAPI void elm_genlist_item_tooltip_text_set(Elm_Object_Item *it, const char *text); - -/** - * Set the content to be shown in a given genlist item's tooltips - * - * @param it The genlist item. - * @param func The function returning the tooltip contents. - * @param data What to provide to @a func as callback data/context. - * @param del_cb Called when data is not needed anymore, either when - * another callback replaces @p func, the tooltip is unset with - * elm_genlist_item_tooltip_unset() or the owner @p item - * dies. This callback receives as its first parameter the - * given @p data, being @c event_info the item handle. - * - * This call will setup the tooltip's contents to @p item - * (analogous to elm_object_tooltip_content_cb_set(), but being - * item tooltips with higher precedence than object tooltips). It - * can have only one tooltip at a time, so any previous tooltip - * content will get removed. @p func (with @p data) will be called - * every time Elementary needs to show the tooltip and it should - * return a valid Evas object, which will be fully managed by the - * tooltip system, getting deleted when the tooltip is gone. - * - * In order to set just a text as a tooltip, look at - * elm_genlist_item_tooltip_text_set(). - * - * @ingroup Genlist - */ -EAPI void elm_genlist_item_tooltip_content_cb_set(Elm_Object_Item *it, Elm_Tooltip_Item_Content_Cb func, const void *data, Evas_Smart_Cb del_cb); - -/** - * Unset a tooltip from a given genlist item - * - * @param it genlist item to remove a previously set tooltip from. - * - * This call removes any tooltip set on @p item. The callback - * provided as @c del_cb to - * elm_genlist_item_tooltip_content_cb_set() will be called to - * notify it is not used anymore (and have resources cleaned, if - * need be). - * - * @see elm_genlist_item_tooltip_content_cb_set() - * - * @ingroup Genlist - */ -EAPI void elm_genlist_item_tooltip_unset(Elm_Object_Item *it); - -/** - * Set a different @b style for a given genlist item's tooltip. - * - * @param it genlist item with tooltip set - * @param style the theme style to use on tooltips (e.g. @c - * "default", @c "transparent", etc) - * - * Tooltips can have alternate styles to be displayed on, - * which are defined by the theme set on Elementary. This function - * works analogously as elm_object_tooltip_style_set(), but here - * applied only to genlist item objects. The default style for - * tooltips is @c "default". - * - * @note before you set a style you should define a tooltip with - * elm_genlist_item_tooltip_content_cb_set() or - * elm_genlist_item_tooltip_text_set() - * - * @see elm_genlist_item_tooltip_style_get() - * - * @ingroup Genlist - */ -EAPI void elm_genlist_item_tooltip_style_set(Elm_Object_Item *it, const char *style); - -/** - * Get the style set a given genlist item's tooltip. - * - * @param it genlist item with tooltip already set on. - * @return style the theme style in use, which defaults to - * "default". If the object does not have a tooltip set, - * then @c NULL is returned. - * - * @see elm_genlist_item_tooltip_style_set() for more details - * - * @ingroup Genlist - */ -EAPI const char *elm_genlist_item_tooltip_style_get(const Elm_Object_Item *it); - -/** - * @brief Disable size restrictions on an object's tooltip - * @param it The tooltip's anchor object - * @param disable If EINA_TRUE, size restrictions are disabled - * @return EINA_FALSE on failure, EINA_TRUE on success - * - * This function allows a tooltip to expand beyond its parent window's canvas. - * It will instead be limited only by the size of the display. - */ -EAPI Eina_Bool elm_genlist_item_tooltip_window_mode_set(Elm_Object_Item *it, Eina_Bool disable); - -/** - * @brief Retrieve size restriction state of an object's tooltip - * @param it The tooltip's anchor object - * @return If EINA_TRUE, size restrictions are disabled - * - * This function returns whether a tooltip is allowed to expand beyond - * its parent window's canvas. - * It will instead be limited only by the size of the display. - */ -EAPI Eina_Bool elm_genlist_item_tooltip_window_mode_get(const Elm_Object_Item *it); - -/** - * Set the type of mouse pointer/cursor decoration to be shown, - * when the mouse pointer is over the given genlist widget item - * - * @param it genlist item to customize cursor on - * @param cursor the cursor type's name - * - * This function works analogously as elm_object_cursor_set(), but - * here the cursor's changing area is restricted to the item's - * area, and not the whole widget's. Note that that item cursors - * have precedence over widget cursors, so that a mouse over @p - * item will always show cursor @p type. - * - * If this function is called twice for an object, a previously set - * cursor will be unset on the second call. - * - * @see elm_object_cursor_set() - * @see elm_genlist_item_cursor_get() - * @see elm_genlist_item_cursor_unset() - * - * @ingroup Genlist - */ -EAPI void elm_genlist_item_cursor_set(Elm_Object_Item *it, const char *cursor); - -/** - * Get the type of mouse pointer/cursor decoration set to be shown, - * when the mouse pointer is over the given genlist widget item - * - * @param it genlist item with custom cursor set - * @return the cursor type's name or @c NULL, if no custom cursors - * were set to @p item (and on errors) - * - * @see elm_object_cursor_get() - * @see elm_genlist_item_cursor_set() for more details - * @see elm_genlist_item_cursor_unset() - * - * @ingroup Genlist - */ -EAPI const char *elm_genlist_item_cursor_get(const Elm_Object_Item *it); - -/** - * Unset any custom mouse pointer/cursor decoration set to be - * shown, when the mouse pointer is over the given genlist widget - * item, thus making it show the @b default cursor again. - * - * @param it a genlist item - * - * Use this call to undo any custom settings on this item's cursor - * decoration, bringing it back to defaults (no custom style set). - * - * @see elm_object_cursor_unset() - * @see elm_genlist_item_cursor_set() for more details - * - * @ingroup Genlist - */ -EAPI void elm_genlist_item_cursor_unset(Elm_Object_Item *it); - -/** - * Set a different @b style for a given custom cursor set for a - * genlist item. - * - * @param it genlist item with custom cursor set - * @param style the theme style to use (e.g. @c "default", - * @c "transparent", etc) - * - * This function only makes sense when one is using custom mouse - * cursor decorations defined in a theme file , which can - * have, given a cursor name/type, alternate styles on - * it. It works analogously as elm_object_cursor_style_set(), but - * here applied only to genlist item objects. - * - * @warning Before you set a cursor style you should have defined a - * custom cursor previously on the item, with - * elm_genlist_item_cursor_set() - * - * @see elm_genlist_item_cursor_engine_only_set() - * @see elm_genlist_item_cursor_style_get() - * - * @ingroup Genlist - */ -EAPI void elm_genlist_item_cursor_style_set(Elm_Object_Item *it, const char *style); - -/** - * Get the current @b style set for a given genlist item's custom - * cursor - * - * @param it genlist item with custom cursor set. - * @return style the cursor style in use. If the object does not - * have a cursor set, then @c NULL is returned. - * - * @see elm_genlist_item_cursor_style_set() for more details - * - * @ingroup Genlist - */ -EAPI const char *elm_genlist_item_cursor_style_get(const Elm_Object_Item *it); - -/** - * Set if the (custom) cursor for a given genlist item should be - * searched in its theme, also, or should only rely on the - * rendering engine. - * - * @param it item with custom (custom) cursor already set on - * @param engine_only Use @c EINA_TRUE to have cursors looked for - * only on those provided by the rendering engine, @c EINA_FALSE to - * have them searched on the widget's theme, as well. - * - * @note This call is of use only if you've set a custom cursor - * for genlist items, with elm_genlist_item_cursor_set(). - * - * @note By default, cursors will only be looked for between those - * provided by the rendering engine. - * - * @ingroup Genlist - */ -EAPI void elm_genlist_item_cursor_engine_only_set(Elm_Object_Item *it, Eina_Bool engine_only); - -/** - * Get if the (custom) cursor for a given genlist item is being - * searched in its theme, also, or is only relying on the rendering - * engine. - * - * @param it a genlist item - * @return @c EINA_TRUE, if cursors are being looked for only on - * those provided by the rendering engine, @c EINA_FALSE if they - * are being searched on the widget's theme, as well. - * - * @see elm_genlist_item_cursor_engine_only_set(), for more details - * - * @ingroup Genlist - */ -EAPI Eina_Bool elm_genlist_item_cursor_engine_only_get(const Elm_Object_Item *it); - -/** - * Enable/disable homogeneous mode. - * - * @param obj The genlist object - * @param homogeneous Assume the items within the genlist are of the - * same height and width (EINA_TRUE = on, EINA_FALSE = off). Default is @c - * EINA_FALSE. - * - * This will enable the homogeneous mode where items are of the same - * height and width so that genlist may do the lazy-loading at its - * maximum (which increases the performance for scrolling the list). - * In the normal mode, genlist will pre-calculate all the items' sizes even - * though they are not in use. So items' callbacks are called many times than - * expected. But homogeneous mode will skip the item size pre-calculation - * process so items' callbacks are called only when the item is needed. - * - * @note This also works well with group index. - * - * @see elm_genlist_mode_set() - * @see elm_genlist_homogeneous_get() - * - * @ingroup Genlist - */ -EAPI void elm_genlist_homogeneous_set(Evas_Object *obj, Eina_Bool homogeneous); - -/** - * Get whether the homogeneous mode is enabled. - * - * @param obj The genlist object - * @return Assume the items within the genlist are of the same height - * and width (EINA_TRUE = on, EINA_FALSE = off) - * - * @see elm_genlist_homogeneous_set() - * - * @ingroup Genlist - */ -EAPI Eina_Bool elm_genlist_homogeneous_get(const Evas_Object *obj); - -/** - * Set the maximum number of items within an item block - * - * @param obj The genlist object - * @param count Maximum number of items within an item block. Default is 32. - * - * This will configure the block count to tune to the target with particular - * performance matrix. - * - * A block of objects will be used to reduce the number of operations due to - * many objects in the screen. It can determine the visibility, or if the - * object has changed, it theme needs to be updated, etc. doing this kind of - * calculation to the entire block, instead of per object. - * - * The default value for the block count is enough for most lists, so unless - * you know you will have a lot of objects visible in the screen at the same - * time, don't try to change this. - * - * @see elm_genlist_block_count_get() - * @see @ref Genlist_Implementation - * - * @ingroup Genlist - */ -EAPI void elm_genlist_block_count_set(Evas_Object *obj, int count); - -/** - * Get the maximum number of items within an item block - * - * @param obj The genlist object - * @return Maximum number of items within an item block - * - * @see elm_genlist_block_count_set() - * - * @ingroup Genlist - */ -EAPI int elm_genlist_block_count_get(const Evas_Object *obj); - -/** - * Set the timeout in seconds for the longpress event. - * - * @param obj The genlist object - * @param timeout timeout in seconds. Default is elm config value(1.0) - * - * This option will change how long it takes to send an event "longpressed" - * after the mouse down signal is sent to the list. If this event occurs, no - * "clicked" event will be sent. - * - * @warning If you set the longpress timeout value with this API, your genlist - * will not be affected by the longpress value of elementary config value - * later. - * - * @see elm_genlist_longpress_timeout_set() - * - * @ingroup Genlist - */ -EAPI void elm_genlist_longpress_timeout_set(Evas_Object *obj, double timeout); - -/** - * Get the timeout in seconds for the longpress event. - * - * @param obj The genlist object - * @return timeout in seconds - * - * @see elm_genlist_longpress_timeout_get() - * - * @ingroup Genlist - */ -EAPI double elm_genlist_longpress_timeout_get(const Evas_Object *obj); - -/** - * Get the item that is at the x, y canvas coords. - * - * @param obj The genlist object. - * @param x The input x coordinate - * @param y The input y coordinate - * @param posret The position relative to the item returned here - * @return The item at the coordinates or NULL if none - * - * This returns the item at the given coordinates (which are canvas - * relative, not object-relative). If an item is at that coordinate, - * that item handle is returned, and if @p posret is not NULL, the - * integer pointed to is set to a value of -1, 0 or 1, depending if - * the coordinate is on the upper portion of that item (-1), on the - * middle section (0) or on the lower part (1). If NULL is returned as - * an item (no item found there), then posret may indicate -1 or 1 - * based if the coordinate is above or below all items respectively in - * the genlist. - * - * @ingroup Genlist - */ -EAPI Elm_Object_Item *elm_genlist_at_xy_item_get(const Evas_Object *obj, Evas_Coord x, Evas_Coord y, int *posret); - -/** - * Get the parent item of the given item - * - * @param it The item - * @return The parent of the item or @c NULL if it has no parent. - * - * This returns the item that was specified as parent of the item @p it on - * elm_genlist_item_append() and insertion related functions. - * - * @ingroup Genlist - */ -EAPI Elm_Object_Item *elm_genlist_item_parent_get(const Elm_Object_Item *it); - -/** - * Remove all sub-items (children) of the given item - * - * @param it The item - * - * This removes all items that are children (and their descendants) of the - * given item @p it. - * - * @see elm_genlist_clear() - * @see elm_object_item_del() - * - * @ingroup Genlist - */ -EAPI void elm_genlist_item_subitems_clear(Elm_Object_Item *it); - -/** - * Sets the expanded state of an item. - * - * @param it The item - * @param expanded The expanded state (@c EINA_TRUE expanded, @c EINA_FALSE not expanded). - * - * This function flags the item of type #ELM_GENLIST_ITEM_TREE as - * expanded or not. - * - * The theme will respond to this change visually, and a signal "expanded" or - * "contracted" will be sent from the genlist with a pointer to the item that - * has been expanded/contracted. - * - * Calling this function won't show or hide any child of this item (if it is - * a parent). You must manually delete and create them on the callbacks of - * the "expanded" or "contracted" signals. - * - * @see elm_genlist_item_expanded_get() - * - * @ingroup Genlist - */ -EAPI void elm_genlist_item_expanded_set(Elm_Object_Item *it, Eina_Bool expanded); - -/** - * Get the expanded state of an item - * - * @param it The item - * @return The expanded state - * - * This gets the expanded state of an item. - * - * @see elm_genlist_item_expanded_set() - * - * @ingroup Genlist - */ -EAPI Eina_Bool elm_genlist_item_expanded_get(const Elm_Object_Item *it); - -/** - * Get the depth of expanded item - * - * @param it The genlist item object - * @return The depth of expanded item - * - * @ingroup Genlist - */ -EAPI int elm_genlist_item_expanded_depth_get(const Elm_Object_Item *it); - -/** - * 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 - * floating "orphans" that can be re-used elsewhere if the user wants - * to. - * - * @ingroup Genlist - */ -EAPI void elm_genlist_item_all_contents_unset(Elm_Object_Item *it, Eina_List **l); - -/** - * Promote an item to the top of the list - * - * @param it The item - * - * @ingroup Genlist - */ -EAPI void elm_genlist_item_promote(Elm_Object_Item *it); - -/** - * Demote an item to the end of the list - * - * @param it The item - * - * @ingroup Genlist - */ -EAPI void elm_genlist_item_demote(Elm_Object_Item *it); - -/** - * Update the part of an item - * - * @param it The item - * @param parts The name of item's part - * @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 - * item data has changed and the changes are desired to be reflected. - * Second parts argument is used for globbing to match '*', '?', and '.' - * It can be used at updating multi fields. - * - * Use elm_genlist_realized_items_update() to update an item's all - * property. - * - * @see elm_genlist_item_update() - * - * @ingroup Genlist - */ -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 - * - * @param it The genlist item - * @param decorate_it_type Mode name - * @param decorate_it_set Boolean to define set or unset mode. - - * - * A genlist mode is a different way of selecting an item. Once a mode is - * activated on an item, any other selected item is immediately unselected. - * This feature provides an easy way of implementing a new kind of animation - * for selecting an item, without having to entirely rewrite the item style - * theme. However, the elm_genlist_selected_* API can't be used to get what - * item is activate for a mode. - * - * The current item style will still be used, but applying a genlist mode to - * an item will select it using a different kind of animation. - * - * The current active item for a mode can be found by - * elm_genlist_decorated_item_get(). - * - * The characteristics of genlist mode are: - * - Only one mode can be active at any time, and for only one item. - * - Genlist handles deactivating other items when one item is activated. - * - A mode is defined in the genlist theme (edc), and more modes can easily - * be added. - * - A mode style and the genlist item style are different things. They - * can be combined to provide a default style to the item, with some kind - * of animation for that item when the mode is activated. - * - * When a mode is activated on an item, a new view for that item is created. - * The theme of this mode defines the animation that will be used to transit - * the item from the old view to the new view. This second (new) view will be - * active for that item while the mode is active on the item, and will be - * destroyed after the mode is totally deactivated from that item. - * - * @see elm_genlist_mode_get() - * @see elm_genlist_decorated_item_get() - * - * @ingroup Genlist - */ -EAPI void elm_genlist_item_decorate_mode_set(Elm_Object_Item *it, const char *decorate_it_type, Eina_Bool decorate_it_set); - -/** - * Get the item's decorate mode. - * - * @param it The genlist item - * - * This function just returns the name of the item's decorate mode. - * - * @see elm_genlist_item_decorate_mode_set() - * @see elm_genlist_decorated_item_get() - * - * @ingroup Genlist - */ -EAPI const char *elm_genlist_item_decorate_mode_get(const Elm_Object_Item *it); - -/** - * Get active genlist mode item - * - * @param obj The genlist object - * @return The active item for that current mode. Or @c NULL if no item is - * activated with any mode. - * - * This function returns the item that was activated with a mode, by the - * function elm_genlist_item_decorate_mode_set(). - * - * @see elm_genlist_item_decorate_mode_set() - * @see elm_genlist_mode_get() - * - * @ingroup Genlist - */ -EAPI Elm_Object_Item *elm_genlist_decorated_item_get(const Evas_Object *obj); - -/** - * Set reorder mode - * - * @param obj The genlist object - * @param reorder_mode The reorder mode - * (EINA_TRUE = on, EINA_FALSE = off) - * - * After turning on the reorder mode, longpress on normal item will trigger - * reordering of the item. You can move the item up and down. However, reorder - * does not work with group item. - * - * @ingroup Genlist - */ -EAPI void elm_genlist_reorder_mode_set(Evas_Object *obj, Eina_Bool reorder_mode); - -/** - * Get the reorder mode - * - * @param obj The genlist object - * @return The reorder mode - * (EINA_TRUE = on, EINA_FALSE = off) - * - * @ingroup Genlist - */ -EAPI Eina_Bool elm_genlist_reorder_mode_get(const Evas_Object *obj); - -/** - * Get the Item's Type - * - * @param it The genlist item - * @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 - */ -EAPI Elm_Genlist_Item_Type elm_genlist_item_type_get(const Elm_Object_Item *it); - -/** - * Set Genlist decorate mode - * - * This sets Genlist decorate mode to all items. - * - * @param obj The Genlist object - * @param decorated The decorate mode status - * (EINA_TRUE = decorate mode, EINA_FALSE = normal mode - * - * @ingroup Genlist - */ -EAPI void elm_genlist_decorate_mode_set(Evas_Object *obj, Eina_Bool decorated); - -/** - * Get Genlist decorate mode - * - * @param obj The genlist object - * @return The decorate mode status - * (EINA_TRUE = decorate mode, EINA_FALSE = normal mode - * - * @ingroup Genlist - */ -EAPI Eina_Bool elm_genlist_decorate_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 decorate 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); - -/** - * Set Genlist tree effect - * - * @param obj The genlist object - * @param enabled The tree effect status - * (EINA_TRUE = enabled, EINA_FALSE = disabled - * - * @ingroup Genlist - */ -EAPI void elm_genlist_tree_effect_enabled_set(Evas_Object *obj, Eina_Bool enabled); - -/** - * Get Genlist tree effect - * - * @param obj The genlist object - * @return The tree effect status - * (EINA_TRUE = enabled, EINA_FALSE = disabled - * - * @ingroup Genlist - */ -EAPI Eina_Bool elm_genlist_tree_effect_enabled_get(const Evas_Object *obj); - -/** - * Set the genlist select mode. - * - * @param obj The genlist object - * @param mode The select mode - * - * elm_genlist_select_mode_set() changes item select mode in the genlist widget. - * - ELM_OBJECT_SELECT_MODE_DEFAULT : Items will call their selection func and - * callback once when first becoming selected. Any further clicks will - * do nothing, unless you set always select mode. - * - ELM_OBJECT_SELECT_MODE_ALWAYS : This means that, even if selected, - * every click will make the selected callbacks be called. - * - ELM_OBJECT_SELECT_MODE_NONE : This will turn off the ability to select items - * entirely and they will neither appear selected nor call selected - * callback functions. - * - * @see elm_genlist_select_mode_get() - * - * @ingroup Genlist - */ -EAPI void elm_genlist_select_mode_set(Evas_Object *obj, Elm_Object_Select_Mode mode); - -/** - * Get the genlist select mode. - * - * @param obj The genlist object - * @return The select mode - * (If getting mode is failed, it returns ELM_OBJECT_SELECT_MODE_MAX) - * - * @see elm_genlist_select_mode_set() - * - * @ingroup Genlist - */ -EAPI Elm_Object_Select_Mode elm_genlist_select_mode_get(const Evas_Object *obj); - -/** - * Set whether the genlist items' should be highlighted when item selected. - * - * @param obj The genlist object. - * @param highlight @c EINA_TRUE to enable highlighting or @c EINA_FALSE to - * disable it. - * - * This will turn on/off the highlight effect when item selection and - * they will, or will not highlighted. The selected and clicked - * callback functions will still be called. - * - * Highlight is enabled by default. - * - * @see elm_genlist_highlight_mode_get(). - * - * @ingroup Genlist - */ -EAPI void elm_genlist_highlight_mode_set(Evas_Object *obj, Eina_Bool highlight); - -/** - * Get whether the genlist items' should be highlighted when item selected. - * - * @param obj The genlist object. - * @return @c EINA_TRUE means items can be highlighted. @c EINA_FALSE indicates - * they can't. If @p obj is @c NULL, @c EINA_FALSE is returned. - * - * @see elm_genlist_highlight_mode_set() for details. - * - * @ingroup Genlist - */ -EAPI Eina_Bool elm_genlist_highlight_mode_get(const Evas_Object *obj); - -/** - * Set the genlist item's select mode. - * - * @param it The genlist item object - * @param mode The select mode - * - * elm_genlist_select_mode_set() changes item's select mode. - * - ELM_OBJECT_SELECT_MODE_DEFAULT : The item will only call their selection func and - * callback when first becoming selected. Any further clicks will - * do nothing, unless you set always select mode. - * - ELM_OBJECT_SELECT_MODE_ALWAYS : This means that, even if selected, - * every click will make the selected callbacks be called. - * - ELM_OBJECT_SELECT_MODE_NONE : This will turn off the ability to select the item - * entirely and they will neither appear selected nor call selected - * callback functions. - * - ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY : This will apply no-finger-size rule - * with ELM_OBJECT_SELECT_MODE_NONE. No-finger-size rule makes an item can be - * smaller than lower limit. Clickable objects should be bigger than - * human touch point device (your finger) for some touch or - * small screen devices. So it is enabled, the item can be shrink than - * predefined finger-size value. And the item will be updated. - * - * @see elm_genlist_item_select_mode_get() - * - * @ingroup Genlist - */ -EAPI void -elm_genlist_item_select_mode_set(Elm_Object_Item *it, - Elm_Object_Select_Mode mode); - -/** - * Get the genlist item's select mode. - * - * @param it The genlist item object - * @return The select mode - * (If getting mode is failed, it returns ELM_OBJECT_SELECT_MODE_MAX) - * - * @see elm_genlist_item_select_mode_set() - * - * @ingroup Genlist - */ -EAPI Elm_Object_Select_Mode -elm_genlist_item_select_mode_get(const Elm_Object_Item *it); - - -/** - * Get the nth item, in a given genlist widget, placed at position @p nth, in - * its internal items list - * - * @param obj The genlist object - * @param nth The number of the item to grab (0 being the first) - * - * @return The item stored in @p obj at position @p nth or @c NULL, if there's - * no item with that index (and on errors) - * - * @ingroup Genilst - * @since 1.8 - */ -EAPI Elm_Object_Item * -elm_genlist_nth_item_get(const Evas_Object *obj, unsigned int nth); +#include +#ifdef EFL_EO_API_SUPPORT +#include +#endif +#ifndef EFL_NOLEGACY_API_SUPPORT +#include +#endif /** * @} diff --git a/legacy/elementary/src/lib/elm_genlist_common.h b/legacy/elementary/src/lib/elm_genlist_common.h new file mode 100644 index 0000000000..d0708a9ab5 --- /dev/null +++ b/legacy/elementary/src/lib/elm_genlist_common.h @@ -0,0 +1,824 @@ +#define ELM_GENLIST_ITEM_CLASS_VERSION ELM_GEN_ITEM_CLASS_VERSION +#define ELM_GENLIST_ITEM_CLASS_HEADER ELM_GEN_ITEM_CLASS_HEADER + +/** + * Defines if the item is of any special type (has subitems or it's the + * index of a group), or is just a simple item. + * + * @ingroup Genlist + */ +typedef enum +{ + ELM_GENLIST_ITEM_NONE = 0, /**< simple item */ + ELM_GENLIST_ITEM_TREE = (1 << 0), /**< this may be expanded and have child items. */ + ELM_GENLIST_ITEM_GROUP = (1 << 1), /**< an index item of a group of items. this item can have child items. */ + + ELM_GENLIST_ITEM_MAX = (1 << 2) +} Elm_Genlist_Item_Type; + +/** + * Defines the type of the item part + * Used while updating item's parts + * It can be used at updating multi fields. + * + * @ingroup Genlist + */ +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_Type; + +/** + * Defines where to position the item in the genlist. + * + * @ingroup Genlist + */ +typedef enum +{ + ELM_GENLIST_ITEM_SCROLLTO_NONE = 0, /**< no scrollto */ + ELM_GENLIST_ITEM_SCROLLTO_IN = (1 << 0), /**< to the nearest viewport */ + ELM_GENLIST_ITEM_SCROLLTO_TOP = (1 << 1), /**< to the top of viewport */ + ELM_GENLIST_ITEM_SCROLLTO_MIDDLE = (1 << 2) /**< to the middle of viewport */ +} Elm_Genlist_Item_Scrollto_Type; + +/** + * @see Elm_Gen_Item_Class + */ +typedef Elm_Gen_Item_Class Elm_Genlist_Item_Class; + +/** + * @see Elm_Gen_Item_Text_Get_Cb + */ +typedef Elm_Gen_Item_Text_Get_Cb Elm_Genlist_Item_Text_Get_Cb; + +/** + * @see Elm_Gen_Item_Content_Get_Cb + */ +typedef Elm_Gen_Item_Content_Get_Cb Elm_Genlist_Item_Content_Get_Cb; + +/** + * @see Elm_Gen_Item_State_Get_Cb + */ +typedef Elm_Gen_Item_State_Get_Cb Elm_Genlist_Item_State_Get_Cb; + +/** + * @see Elm_Gen_Item_Del_Cb + */ +typedef Elm_Gen_Item_Del_Cb Elm_Genlist_Item_Del_Cb; + +/** + * Get the @b next item in a genlist widget's internal list of items, + * given a handle to one of those items. + * + * @param it The genlist item to fetch next from + * @return The item after @p item, or @c NULL if there's none (and + * on errors) + * + * This returns the item placed after the @p item, on the container + * genlist. + * + * @see elm_genlist_item_prev_get() + * + * @ingroup Genlist + */ +EAPI Elm_Object_Item *elm_genlist_item_next_get(const Elm_Object_Item *it); + +/** + * Get the @b previous item in a genlist widget's internal list of items, + * given a handle to one of those items. + * + * @param it The genlist item to fetch previous from + * @return The item before @p item, or @c NULL if there's none (and + * on errors) + * + * This returns the item placed before the @p item, on the container + * genlist. + * + * @see elm_genlist_item_next_get() + * + * @ingroup Genlist + */ +EAPI Elm_Object_Item *elm_genlist_item_prev_get(const Elm_Object_Item *it); + +/** + * Set whether a given genlist item is selected or not + * + * @param it The item + * @param selected Use @c EINA_TRUE, to make it selected, @c + * EINA_FALSE to make it unselected + * + * This sets the selected state of an item. If multi selection is + * not enabled on the containing genlist and @p selected is @c + * EINA_TRUE, any other previously selected items will get + * unselected in favor of this new one. + * + * @see elm_genlist_item_selected_get() + * + * @ingroup Genlist + */ +EAPI void elm_genlist_item_selected_set(Elm_Object_Item *it, Eina_Bool selected); + +/** + * Get whether a given genlist item is selected or not + * + * @param it The item + * @return @c EINA_TRUE, if it's selected, @c EINA_FALSE otherwise + * + * @see elm_genlist_item_selected_set() for more details + * + * @ingroup Genlist + */ +EAPI Eina_Bool elm_genlist_item_selected_get(const Elm_Object_Item *it); + +/** + * Show the portion of a genlist's internal list containing a given + * item, immediately. + * + * @param it The item to display + * @param type The position to bring in, the given item to. + * @ref Elm_Genlist_Item_Scrollto_Type + * + * This causes genlist to jump to the given item @p it and show it (by + * jumping to that position), if it is not fully visible. + * + * @see elm_genlist_item_bring_in() + * + * @ingroup Genlist + */ +EAPI void elm_genlist_item_show(Elm_Object_Item *it, Elm_Genlist_Item_Scrollto_Type type); + +/** + * Animatedly bring in, to the visible are of a genlist, a given + * item on it. + * + * @param it The item to display + * @param type The position to bring in, the given item to. + * @ref Elm_Genlist_Item_Scrollto_Type + * + * This causes genlist to jump to the given item @p it and show it (by + * animatedly scrolling), if it is not fully visible. + * This may use animation and take a some time to do so. + * + * @see elm_genlist_item_show() + * + * @ingroup Genlist + */ +EAPI void elm_genlist_item_bring_in(Elm_Object_Item *it, Elm_Genlist_Item_Scrollto_Type type); + +/** + * Update all the contents of an item + * + * @param it The item + * + * This updates an item by calling all the item class functions again + * to get the contents, texts and states. Use this when the original + * item data has changed and the changes are desired to be reflected. + * + * Use elm_genlist_realized_items_update() to update all already realized + * items. + * + * @note This also updates internal genlist item object(edje_object as of now). + * So when this is called between mouse down and mouse up, mouse up event will + * be ignored because edje_object is deleted and created again by this API. If + * you want to avoid this, please use @ref elm_genlist_item_fields_update. + * + * @see elm_genlist_realized_items_update() + * + * @ingroup Genlist + */ +EAPI void elm_genlist_item_update(Elm_Object_Item *it); + +/** + * Update the item class of an item + * + * @param it The item + * @param itc The item class for the item + * + * This sets another class of the item, changing the way that it is + * displayed. After changing the item class, elm_genlist_item_update() is + * called on the item @p it. + * + * @ingroup Genlist + */ +EAPI void elm_genlist_item_item_class_update(Elm_Object_Item *it, const Elm_Genlist_Item_Class *itc); + +/** + * Get the Genlist Item class for the given Genlist Item. + * + * @param it The genlist item + * + * This returns the Genlist_Item_Class for the given item. It can be used to + * examine the function pointers and item_style. + * + * @ingroup Genlist + */ +EAPI const Elm_Genlist_Item_Class *elm_genlist_item_item_class_get(const Elm_Object_Item *it); + +/** + * Get the index of the item. It is only valid once displayed. + * + * @param it a genlist item + * @return the position inside the list of item. + * + * @ingroup Genlist + */ +EAPI int elm_genlist_item_index_get(const Elm_Object_Item *it); + +/** + * Create a new genlist item class in a given genlist widget. + * + * @return New allocated a genlist item class. + * + * This adds genlist item class for the genlist widget. When adding an item, + * genlist_item_{append, prepend, insert} function needs item class of the item. + * 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. + * + * @see elm_genlist_item_class_free() + * @see elm_genlist_item_append() + * + * @ingroup Genlist + */ +EAPI Elm_Genlist_Item_Class *elm_genlist_item_class_new(void); + +/** + * Remove an item class in a given genlist widget. + * + * @param itc The itc to be removed. + * + * This removes item class from the genlist widget. + * Whenever it has no more references to it, item class is going to be freed. + * Otherwise it just decreases its reference count. + * + * @see elm_genlist_item_class_new() + * @see elm_genlist_item_class_ref() + * @see elm_genlist_item_class_unref() + * + * @ingroup Genlist + */ +EAPI void elm_genlist_item_class_free(Elm_Genlist_Item_Class *itc); + +/** + * Increments object reference count for the item class. + * + * @param itc The given item class object to reference + * + * This API just increases its reference count for item class management. + * + * @see elm_genlist_item_class_unref() + * + * @ingroup Genlist + */ +EAPI void elm_genlist_item_class_ref(Elm_Genlist_Item_Class *itc); + +/** + * Decrements object reference count for the item class. + * + * @param itc The given item class object to reference + * + * This API just decreases its reference count for item class management. + * Reference count can't be less than 0. + * + * @see elm_genlist_item_class_ref() + * @see elm_genlist_item_class_free() + * + * @ingroup Genlist + */ +EAPI void elm_genlist_item_class_unref(Elm_Genlist_Item_Class *itc); + +/** + * Set the text to be shown in a given genlist item's tooltips. + * + * @param it The genlist item + * @param text The text to set in the content + * + * This call will setup the text to be used as tooltip to that item + * (analogous to elm_object_tooltip_text_set(), but being item + * tooltips with higher precedence than object tooltips). It can + * have only one tooltip at a time, so any previous tooltip data + * will get removed. + * + * In order to set a content or something else as a tooltip, look at + * elm_genlist_item_tooltip_content_cb_set(). + * + * @ingroup Genlist + */ +EAPI void elm_genlist_item_tooltip_text_set(Elm_Object_Item *it, const char *text); + +/** + * Set the content to be shown in a given genlist item's tooltips + * + * @param it The genlist item. + * @param func The function returning the tooltip contents. + * @param data What to provide to @a func as callback data/context. + * @param del_cb Called when data is not needed anymore, either when + * another callback replaces @p func, the tooltip is unset with + * elm_genlist_item_tooltip_unset() or the owner @p item + * dies. This callback receives as its first parameter the + * given @p data, being @c event_info the item handle. + * + * This call will setup the tooltip's contents to @p item + * (analogous to elm_object_tooltip_content_cb_set(), but being + * item tooltips with higher precedence than object tooltips). It + * can have only one tooltip at a time, so any previous tooltip + * content will get removed. @p func (with @p data) will be called + * every time Elementary needs to show the tooltip and it should + * return a valid Evas object, which will be fully managed by the + * tooltip system, getting deleted when the tooltip is gone. + * + * In order to set just a text as a tooltip, look at + * elm_genlist_item_tooltip_text_set(). + * + * @ingroup Genlist + */ +EAPI void elm_genlist_item_tooltip_content_cb_set(Elm_Object_Item *it, Elm_Tooltip_Item_Content_Cb func, const void *data, Evas_Smart_Cb del_cb); + +/** + * Unset a tooltip from a given genlist item + * + * @param it genlist item to remove a previously set tooltip from. + * + * This call removes any tooltip set on @p item. The callback + * provided as @c del_cb to + * elm_genlist_item_tooltip_content_cb_set() will be called to + * notify it is not used anymore (and have resources cleaned, if + * need be). + * + * @see elm_genlist_item_tooltip_content_cb_set() + * + * @ingroup Genlist + */ +EAPI void elm_genlist_item_tooltip_unset(Elm_Object_Item *it); + +/** + * Set a different @b style for a given genlist item's tooltip. + * + * @param it genlist item with tooltip set + * @param style the theme style to use on tooltips (e.g. @c + * "default", @c "transparent", etc) + * + * Tooltips can have alternate styles to be displayed on, + * which are defined by the theme set on Elementary. This function + * works analogously as elm_object_tooltip_style_set(), but here + * applied only to genlist item objects. The default style for + * tooltips is @c "default". + * + * @note before you set a style you should define a tooltip with + * elm_genlist_item_tooltip_content_cb_set() or + * elm_genlist_item_tooltip_text_set() + * + * @see elm_genlist_item_tooltip_style_get() + * + * @ingroup Genlist + */ +EAPI void elm_genlist_item_tooltip_style_set(Elm_Object_Item *it, const char *style); + +/** + * Get the style set a given genlist item's tooltip. + * + * @param it genlist item with tooltip already set on. + * @return style the theme style in use, which defaults to + * "default". If the object does not have a tooltip set, + * then @c NULL is returned. + * + * @see elm_genlist_item_tooltip_style_set() for more details + * + * @ingroup Genlist + */ +EAPI const char *elm_genlist_item_tooltip_style_get(const Elm_Object_Item *it); + +/** + * @brief Disable size restrictions on an object's tooltip + * @param it The tooltip's anchor object + * @param disable If EINA_TRUE, size restrictions are disabled + * @return EINA_FALSE on failure, EINA_TRUE on success + * + * This function allows a tooltip to expand beyond its parent window's canvas. + * It will instead be limited only by the size of the display. + */ +EAPI Eina_Bool elm_genlist_item_tooltip_window_mode_set(Elm_Object_Item *it, Eina_Bool disable); + +/** + * @brief Retrieve size restriction state of an object's tooltip + * @param it The tooltip's anchor object + * @return If EINA_TRUE, size restrictions are disabled + * + * This function returns whether a tooltip is allowed to expand beyond + * its parent window's canvas. + * It will instead be limited only by the size of the display. + */ +EAPI Eina_Bool elm_genlist_item_tooltip_window_mode_get(const Elm_Object_Item *it); + +/** + * Set the type of mouse pointer/cursor decoration to be shown, + * when the mouse pointer is over the given genlist widget item + * + * @param it genlist item to customize cursor on + * @param cursor the cursor type's name + * + * This function works analogously as elm_object_cursor_set(), but + * here the cursor's changing area is restricted to the item's + * area, and not the whole widget's. Note that that item cursors + * have precedence over widget cursors, so that a mouse over @p + * item will always show cursor @p type. + * + * If this function is called twice for an object, a previously set + * cursor will be unset on the second call. + * + * @see elm_object_cursor_set() + * @see elm_genlist_item_cursor_get() + * @see elm_genlist_item_cursor_unset() + * + * @ingroup Genlist + */ +EAPI void elm_genlist_item_cursor_set(Elm_Object_Item *it, const char *cursor); + +/** + * Get the type of mouse pointer/cursor decoration set to be shown, + * when the mouse pointer is over the given genlist widget item + * + * @param it genlist item with custom cursor set + * @return the cursor type's name or @c NULL, if no custom cursors + * were set to @p item (and on errors) + * + * @see elm_object_cursor_get() + * @see elm_genlist_item_cursor_set() for more details + * @see elm_genlist_item_cursor_unset() + * + * @ingroup Genlist + */ +EAPI const char *elm_genlist_item_cursor_get(const Elm_Object_Item *it); + +/** + * Unset any custom mouse pointer/cursor decoration set to be + * shown, when the mouse pointer is over the given genlist widget + * item, thus making it show the @b default cursor again. + * + * @param it a genlist item + * + * Use this call to undo any custom settings on this item's cursor + * decoration, bringing it back to defaults (no custom style set). + * + * @see elm_object_cursor_unset() + * @see elm_genlist_item_cursor_set() for more details + * + * @ingroup Genlist + */ +EAPI void elm_genlist_item_cursor_unset(Elm_Object_Item *it); + +/** + * Set a different @b style for a given custom cursor set for a + * genlist item. + * + * @param it genlist item with custom cursor set + * @param style the theme style to use (e.g. @c "default", + * @c "transparent", etc) + * + * This function only makes sense when one is using custom mouse + * cursor decorations defined in a theme file , which can + * have, given a cursor name/type, alternate styles on + * it. It works analogously as elm_object_cursor_style_set(), but + * here applied only to genlist item objects. + * + * @warning Before you set a cursor style you should have defined a + * custom cursor previously on the item, with + * elm_genlist_item_cursor_set() + * + * @see elm_genlist_item_cursor_engine_only_set() + * @see elm_genlist_item_cursor_style_get() + * + * @ingroup Genlist + */ +EAPI void elm_genlist_item_cursor_style_set(Elm_Object_Item *it, const char *style); + +/** + * Get the current @b style set for a given genlist item's custom + * cursor + * + * @param it genlist item with custom cursor set. + * @return style the cursor style in use. If the object does not + * have a cursor set, then @c NULL is returned. + * + * @see elm_genlist_item_cursor_style_set() for more details + * + * @ingroup Genlist + */ +EAPI const char *elm_genlist_item_cursor_style_get(const Elm_Object_Item *it); + +/** + * Set if the (custom) cursor for a given genlist item should be + * searched in its theme, also, or should only rely on the + * rendering engine. + * + * @param it item with custom (custom) cursor already set on + * @param engine_only Use @c EINA_TRUE to have cursors looked for + * only on those provided by the rendering engine, @c EINA_FALSE to + * have them searched on the widget's theme, as well. + * + * @note This call is of use only if you've set a custom cursor + * for genlist items, with elm_genlist_item_cursor_set(). + * + * @note By default, cursors will only be looked for between those + * provided by the rendering engine. + * + * @ingroup Genlist + */ +EAPI void elm_genlist_item_cursor_engine_only_set(Elm_Object_Item *it, Eina_Bool engine_only); + +/** + * Get if the (custom) cursor for a given genlist item is being + * searched in its theme, also, or is only relying on the rendering + * engine. + * + * @param it a genlist item + * @return @c EINA_TRUE, if cursors are being looked for only on + * those provided by the rendering engine, @c EINA_FALSE if they + * are being searched on the widget's theme, as well. + * + * @see elm_genlist_item_cursor_engine_only_set(), for more details + * + * @ingroup Genlist + */ +EAPI Eina_Bool elm_genlist_item_cursor_engine_only_get(const Elm_Object_Item *it); + +/** + * Get the parent item of the given item + * + * @param it The item + * @return The parent of the item or @c NULL if it has no parent. + * + * This returns the item that was specified as parent of the item @p it on + * elm_genlist_item_append() and insertion related functions. + * + * @ingroup Genlist + */ +EAPI Elm_Object_Item *elm_genlist_item_parent_get(const Elm_Object_Item *it); + +/** + * Remove all sub-items (children) of the given item + * + * @param it The item + * + * This removes all items that are children (and their descendants) of the + * given item @p it. + * + * @see elm_genlist_clear() + * @see elm_object_item_del() + * + * @ingroup Genlist + */ +EAPI void elm_genlist_item_subitems_clear(Elm_Object_Item *it); + +/** + * Sets the expanded state of an item. + * + * @param it The item + * @param expanded The expanded state (@c EINA_TRUE expanded, @c EINA_FALSE not expanded). + * + * This function flags the item of type #ELM_GENLIST_ITEM_TREE as + * expanded or not. + * + * The theme will respond to this change visually, and a signal "expanded" or + * "contracted" will be sent from the genlist with a pointer to the item that + * has been expanded/contracted. + * + * Calling this function won't show or hide any child of this item (if it is + * a parent). You must manually delete and create them on the callbacks of + * the "expanded" or "contracted" signals. + * + * @see elm_genlist_item_expanded_get() + * + * @ingroup Genlist + */ +EAPI void elm_genlist_item_expanded_set(Elm_Object_Item *it, Eina_Bool expanded); + +/** + * Get the expanded state of an item + * + * @param it The item + * @return The expanded state + * + * This gets the expanded state of an item. + * + * @see elm_genlist_item_expanded_set() + * + * @ingroup Genlist + */ +EAPI Eina_Bool elm_genlist_item_expanded_get(const Elm_Object_Item *it); + +/** + * Get the depth of expanded item + * + * @param it The genlist item object + * @return The depth of expanded item + * + * @ingroup Genlist + */ +EAPI int elm_genlist_item_expanded_depth_get(const Elm_Object_Item *it); + +/** + * 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 + * floating "orphans" that can be re-used elsewhere if the user wants + * to. + * + * @ingroup Genlist + */ +EAPI void elm_genlist_item_all_contents_unset(Elm_Object_Item *it, Eina_List **l); + +/** + * Promote an item to the top of the list + * + * @param it The item + * + * @ingroup Genlist + */ +EAPI void elm_genlist_item_promote(Elm_Object_Item *it); + +/** + * Demote an item to the end of the list + * + * @param it The item + * + * @ingroup Genlist + */ +EAPI void elm_genlist_item_demote(Elm_Object_Item *it); + +/** + * Update the part of an item + * + * @param it The item + * @param parts The name of item's part + * @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 + * item data has changed and the changes are desired to be reflected. + * Second parts argument is used for globbing to match '*', '?', and '.' + * It can be used at updating multi fields. + * + * Use elm_genlist_realized_items_update() to update an item's all + * property. + * + * @see elm_genlist_item_update() + * + * @ingroup Genlist + */ +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 + * + * @param it The genlist item + * @param decorate_it_type Mode name + * @param decorate_it_set Boolean to define set or unset mode. + + * + * A genlist mode is a different way of selecting an item. Once a mode is + * activated on an item, any other selected item is immediately unselected. + * This feature provides an easy way of implementing a new kind of animation + * for selecting an item, without having to entirely rewrite the item style + * theme. However, the elm_genlist_selected_* API can't be used to get what + * item is activate for a mode. + * + * The current item style will still be used, but applying a genlist mode to + * an item will select it using a different kind of animation. + * + * The current active item for a mode can be found by + * elm_genlist_decorated_item_get(). + * + * The characteristics of genlist mode are: + * - Only one mode can be active at any time, and for only one item. + * - Genlist handles deactivating other items when one item is activated. + * - A mode is defined in the genlist theme (edc), and more modes can easily + * be added. + * - A mode style and the genlist item style are different things. They + * can be combined to provide a default style to the item, with some kind + * of animation for that item when the mode is activated. + * + * When a mode is activated on an item, a new view for that item is created. + * The theme of this mode defines the animation that will be used to transit + * the item from the old view to the new view. This second (new) view will be + * active for that item while the mode is active on the item, and will be + * destroyed after the mode is totally deactivated from that item. + * + * @see elm_genlist_mode_get() + * @see elm_genlist_decorated_item_get() + * + * @ingroup Genlist + */ +EAPI void elm_genlist_item_decorate_mode_set(Elm_Object_Item *it, const char *decorate_it_type, Eina_Bool decorate_it_set); + +/** + * Get the item's decorate mode. + * + * @param it The genlist item + * + * This function just returns the name of the item's decorate mode. + * + * @see elm_genlist_item_decorate_mode_set() + * @see elm_genlist_decorated_item_get() + * + * @ingroup Genlist + */ +EAPI const char *elm_genlist_item_decorate_mode_get(const Elm_Object_Item *it); + +/** + * Get the Item's Type + * + * @param it The genlist item + * @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 + */ +EAPI Elm_Genlist_Item_Type elm_genlist_item_type_get(const Elm_Object_Item *it); + +/** + * 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 decorate 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); + +/** + * Set the genlist item's select mode. + * + * @param it The genlist item object + * @param mode The select mode + * + * elm_genlist_select_mode_set() changes item's select mode. + * - ELM_OBJECT_SELECT_MODE_DEFAULT : The item will only call their selection func and + * callback when first becoming selected. Any further clicks will + * do nothing, unless you set always select mode. + * - ELM_OBJECT_SELECT_MODE_ALWAYS : This means that, even if selected, + * every click will make the selected callbacks be called. + * - ELM_OBJECT_SELECT_MODE_NONE : This will turn off the ability to select the item + * entirely and they will neither appear selected nor call selected + * callback functions. + * - ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY : This will apply no-finger-size rule + * with ELM_OBJECT_SELECT_MODE_NONE. No-finger-size rule makes an item can be + * smaller than lower limit. Clickable objects should be bigger than + * human touch point device (your finger) for some touch or + * small screen devices. So it is enabled, the item can be shrink than + * predefined finger-size value. And the item will be updated. + * + * @see elm_genlist_item_select_mode_get() + * + * @ingroup Genlist + */ +EAPI void +elm_genlist_item_select_mode_set(Elm_Object_Item *it, + Elm_Object_Select_Mode mode); + +/** + * Get the genlist item's select mode. + * + * @param it The genlist item object + * @return The select mode + * (If getting mode is failed, it returns ELM_OBJECT_SELECT_MODE_MAX) + * + * @see elm_genlist_item_select_mode_set() + * + * @ingroup Genlist + */ +EAPI Elm_Object_Select_Mode +elm_genlist_item_select_mode_get(const Elm_Object_Item *it); + + diff --git a/legacy/elementary/src/lib/elm_genlist_eo.h b/legacy/elementary/src/lib/elm_genlist_eo.h new file mode 100644 index 0000000000..ad29b3d514 --- /dev/null +++ b/legacy/elementary/src/lib/elm_genlist_eo.h @@ -0,0 +1,508 @@ +#define ELM_OBJ_GENLIST_PAN_CLASS elm_obj_genlist_pan_class_get() + +const Eo_Class *elm_obj_genlist_pan_class_get(void) EINA_CONST; + +#define ELM_OBJ_GENLIST_CLASS elm_obj_genlist_class_get() + +const Eo_Class *elm_obj_genlist_class_get(void) EINA_CONST; + +extern EAPI Eo_Op ELM_OBJ_GENLIST_BASE_ID; + +enum +{ + ELM_OBJ_GENLIST_SUB_ID_ITEMS_COUNT, + ELM_OBJ_GENLIST_SUB_ID_ITEM_APPEND, + ELM_OBJ_GENLIST_SUB_ID_ITEM_PREPEND, + ELM_OBJ_GENLIST_SUB_ID_ITEM_INSERT_AFTER, + ELM_OBJ_GENLIST_SUB_ID_ITEM_INSERT_BEFORE, + ELM_OBJ_GENLIST_SUB_ID_ITEM_SORTED_INSERT, + ELM_OBJ_GENLIST_SUB_ID_CLEAR, + ELM_OBJ_GENLIST_SUB_ID_MULTI_SELECT_SET, + ELM_OBJ_GENLIST_SUB_ID_MULTI_SELECT_GET, + ELM_OBJ_GENLIST_SUB_ID_SELECTED_ITEM_GET, + ELM_OBJ_GENLIST_SUB_ID_SELECTED_ITEMS_GET, + ELM_OBJ_GENLIST_SUB_ID_REALIZED_ITEMS_GET, + ELM_OBJ_GENLIST_SUB_ID_AT_XY_ITEM_GET, + ELM_OBJ_GENLIST_SUB_ID_FIRST_ITEM_GET, + ELM_OBJ_GENLIST_SUB_ID_LAST_ITEM_GET, + ELM_OBJ_GENLIST_SUB_ID_MODE_SET, + ELM_OBJ_GENLIST_SUB_ID_MODE_GET, + ELM_OBJ_GENLIST_SUB_ID_HOMOGENEOUS_SET, + ELM_OBJ_GENLIST_SUB_ID_HOMOGENEOUS_GET, + ELM_OBJ_GENLIST_SUB_ID_BLOCK_COUNT_SET, + ELM_OBJ_GENLIST_SUB_ID_BLOCK_COUNT_GET, + ELM_OBJ_GENLIST_SUB_ID_LONGPRESS_TIMEOUT_SET, + ELM_OBJ_GENLIST_SUB_ID_LONGPRESS_TIMEOUT_GET, + ELM_OBJ_GENLIST_SUB_ID_REALIZED_ITEMS_UPDATE, + ELM_OBJ_GENLIST_SUB_ID_DECORATED_ITEM_GET, + ELM_OBJ_GENLIST_SUB_ID_DECORATE_MODE_GET, + ELM_OBJ_GENLIST_SUB_ID_DECORATE_MODE_SET, + ELM_OBJ_GENLIST_SUB_ID_REORDER_MODE_SET, + ELM_OBJ_GENLIST_SUB_ID_REORDER_MODE_GET, + ELM_OBJ_GENLIST_SUB_ID_SELECT_MODE_SET, + ELM_OBJ_GENLIST_SUB_ID_SELECT_MODE_GET, + ELM_OBJ_GENLIST_SUB_ID_HIGHLIGHT_MODE_SET, + ELM_OBJ_GENLIST_SUB_ID_HIGHLIGHT_MODE_GET, + ELM_OBJ_GENLIST_SUB_ID_TREE_EFFECT_ENABLED_SET, + ELM_OBJ_GENLIST_SUB_ID_TREE_EFFECT_ENABLED_GET, + ELM_OBJ_GENLIST_SUB_ID_LAST +}; + +#define ELM_OBJ_GENLIST_ID(sub_id) (ELM_OBJ_GENLIST_BASE_ID + sub_id) + + +/** + * @def elm_obj_genlist_items_count + * @since 1.8 + * + * Return how many items are currently in a list + * + * @param[out] ret + * + * @see elm_genlist_items_count + */ +#define elm_obj_genlist_items_count(ret) ELM_OBJ_GENLIST_ID(ELM_OBJ_GENLIST_SUB_ID_ITEMS_COUNT), EO_TYPECHECK(unsigned int *, ret) + +/** + * @def elm_obj_genlist_item_append + * @since 1.8 + * + * Append a new item in a given genlist widget. + * + * @param[in] itc + * @param[in] data + * @param[in] parent + * @param[in] type + * @param[in] func + * @param[in] func_data + * @param[out] ret + * + * @see elm_genlist_item_append + */ +#define elm_obj_genlist_item_append(itc, data, parent, type, func, func_data, ret) ELM_OBJ_GENLIST_ID(ELM_OBJ_GENLIST_SUB_ID_ITEM_APPEND), EO_TYPECHECK(const Elm_Genlist_Item_Class *, itc), EO_TYPECHECK(const void *, data), EO_TYPECHECK(Elm_Object_Item *, parent), EO_TYPECHECK(Elm_Genlist_Item_Type, type), EO_TYPECHECK(Evas_Smart_Cb, func), EO_TYPECHECK(const void *, func_data), EO_TYPECHECK(Elm_Object_Item **, ret) + +/** + * @def elm_obj_genlist_item_prepend + * @since 1.8 + * + * Prepend a new item in a given genlist widget. + * + * @param[in] itc + * @param[in] data + * @param[in] parent + * @param[in] type + * @param[in] func + * @param[in] func_data + * @param[out] ret + * + * @see elm_genlist_item_prepend + */ +#define elm_obj_genlist_item_prepend(itc, data, parent, type, func, func_data, ret) ELM_OBJ_GENLIST_ID(ELM_OBJ_GENLIST_SUB_ID_ITEM_PREPEND), EO_TYPECHECK(const Elm_Genlist_Item_Class *, itc), EO_TYPECHECK(const void *, data), EO_TYPECHECK(Elm_Object_Item *, parent), EO_TYPECHECK(Elm_Genlist_Item_Type, type), EO_TYPECHECK(Evas_Smart_Cb, func), EO_TYPECHECK(const void *, func_data), EO_TYPECHECK(Elm_Object_Item **, ret) + +/** + * @def elm_obj_genlist_item_insert_after + * @since 1.8 + * + * Insert an item after another in a genlist widget + * + * @param[in] itc + * @param[in] data + * @param[in] parent + * @param[in] after_it + * @param[in] type + * @param[in] func + * @param[in] func_data + * @param[out] ret + * + * @see elm_genlist_item_insert_after + */ +#define elm_obj_genlist_item_insert_after(itc, data, parent, after_it, type, func, func_data, ret) ELM_OBJ_GENLIST_ID(ELM_OBJ_GENLIST_SUB_ID_ITEM_INSERT_AFTER), EO_TYPECHECK(const Elm_Genlist_Item_Class *, itc), EO_TYPECHECK(const void *, data), EO_TYPECHECK(Elm_Object_Item *, parent), EO_TYPECHECK(Elm_Object_Item *, after_it), EO_TYPECHECK(Elm_Genlist_Item_Type, type), EO_TYPECHECK(Evas_Smart_Cb, func), EO_TYPECHECK(const void *, func_data), EO_TYPECHECK(Elm_Object_Item **, ret) + +/** + * @def elm_obj_genlist_item_insert_before + * @since 1.8 + * + * Insert an item before another in a genlist widget + * + * @param[in] itc + * @param[in] data + * @param[in] parent + * @param[in] before_it + * @param[in] type + * @param[in] func + * @param[in] func_data + * @param[out] ret + * + * @see elm_genlist_item_insert_before + */ +#define elm_obj_genlist_item_insert_before(itc, data, parent, before_it, type, func, func_data, ret) ELM_OBJ_GENLIST_ID(ELM_OBJ_GENLIST_SUB_ID_ITEM_INSERT_BEFORE), EO_TYPECHECK(const Elm_Genlist_Item_Class *, itc), EO_TYPECHECK(const void *, data), EO_TYPECHECK(Elm_Object_Item *, parent), EO_TYPECHECK(Elm_Object_Item *, before_it), EO_TYPECHECK(Elm_Genlist_Item_Type, type), EO_TYPECHECK(Evas_Smart_Cb, func), EO_TYPECHECK(const void *, func_data), EO_TYPECHECK(Elm_Object_Item **, ret) + +/** + * @def elm_obj_genlist_item_sorted_insert + * @since 1.8 + * + * Insert a new item into the sorted genlist object + * + * @param[in] itc + * @param[in] data + * @param[in] parent + * @param[in] type + * @param[in] comp + * @param[in] func + * @param[in] func_data + * @param[out] ret + * + * @see elm_genlist_item_sorted_insert + */ +#define elm_obj_genlist_item_sorted_insert(itc, data, parent, type, comp, func, func_data, ret) ELM_OBJ_GENLIST_ID(ELM_OBJ_GENLIST_SUB_ID_ITEM_SORTED_INSERT), EO_TYPECHECK(const Elm_Genlist_Item_Class *, itc), EO_TYPECHECK(const void *, data), EO_TYPECHECK(Elm_Object_Item *, parent), EO_TYPECHECK(Elm_Genlist_Item_Type, type), EO_TYPECHECK(Eina_Compare_Cb, comp), EO_TYPECHECK(Evas_Smart_Cb, func), EO_TYPECHECK(const void *, func_data), EO_TYPECHECK(Elm_Object_Item **, ret) + +/** + * @def elm_obj_genlist_clear + * @since 1.8 + * + * Remove all items from a given genlist widget. + * + * + * @see elm_genlist_clear + */ +#define elm_obj_genlist_clear() ELM_OBJ_GENLIST_ID(ELM_OBJ_GENLIST_SUB_ID_CLEAR) + +/** + * @def elm_obj_genlist_multi_select_set + * @since 1.8 + * + * Enable or disable multi-selection in the genlist + * + * @param[in] multi + * + * @see elm_genlist_multi_select_set + */ +#define elm_obj_genlist_multi_select_set(multi) ELM_OBJ_GENLIST_ID(ELM_OBJ_GENLIST_SUB_ID_MULTI_SELECT_SET), EO_TYPECHECK(Eina_Bool, multi) + +/** + * @def elm_obj_genlist_multi_select_get + * @since 1.8 + * + * Gets if multi-selection in genlist is enabled or disabled. + * + * @param[out] ret + * + * @see elm_genlist_multi_select_get + */ +#define elm_obj_genlist_multi_select_get(ret) ELM_OBJ_GENLIST_ID(ELM_OBJ_GENLIST_SUB_ID_MULTI_SELECT_GET), EO_TYPECHECK(Eina_Bool *, ret) + +/** + * @def elm_obj_genlist_selected_item_get + * @since 1.8 + * + * Get the selected item in the genlist. + * + * @param[out] ret + * + * @see elm_genlist_selected_item_get + */ +#define elm_obj_genlist_selected_item_get(ret) ELM_OBJ_GENLIST_ID(ELM_OBJ_GENLIST_SUB_ID_SELECTED_ITEM_GET), EO_TYPECHECK(Elm_Object_Item **, ret) + +/** + * @def elm_obj_genlist_selected_items_get + * @since 1.8 + * + * Get a list of selected items in the genlist. + * + * @param[out] ret + * + * @see elm_genlist_selected_items_get + */ +#define elm_obj_genlist_selected_items_get(ret) ELM_OBJ_GENLIST_ID(ELM_OBJ_GENLIST_SUB_ID_SELECTED_ITEMS_GET), EO_TYPECHECK(const Eina_List **, ret) + +/** + * @def elm_obj_genlist_realized_items_get + * @since 1.8 + * + * Get a list of realized items in genlist + * + * @param[out] ret + * + * @see elm_genlist_realized_items_get + */ +#define elm_obj_genlist_realized_items_get(ret) ELM_OBJ_GENLIST_ID(ELM_OBJ_GENLIST_SUB_ID_REALIZED_ITEMS_GET), EO_TYPECHECK(Eina_List **, ret) + +/** + * @def elm_obj_genlist_at_xy_item_get + * @since 1.8 + * + * Get the item that is at the x, y canvas coords. + * + * @param[in] x + * @param[in] y + * @param[out] posret + * @param[out] ret + * + * @see elm_genlist_at_xy_item_get + */ +#define elm_obj_genlist_at_xy_item_get(x, y, posret, ret) ELM_OBJ_GENLIST_ID(ELM_OBJ_GENLIST_SUB_ID_AT_XY_ITEM_GET), EO_TYPECHECK(Evas_Coord, x), EO_TYPECHECK(Evas_Coord, y), EO_TYPECHECK(int *, posret), EO_TYPECHECK(Elm_Object_Item **, ret) + +/** + * @def elm_obj_genlist_first_item_get + * @since 1.8 + * + * Get the first item in the genlist + * + * @param[out] ret + * + * @see elm_genlist_first_item_get + */ +#define elm_obj_genlist_first_item_get(ret) ELM_OBJ_GENLIST_ID(ELM_OBJ_GENLIST_SUB_ID_FIRST_ITEM_GET), EO_TYPECHECK(Elm_Object_Item **, ret) + +/** + * @def elm_obj_genlist_last_item_get + * @since 1.8 + * + * Get the last item in the genlist + * + * @param[out] ret + * + * @see elm_genlist_last_item_get + */ +#define elm_obj_genlist_last_item_get(ret) ELM_OBJ_GENLIST_ID(ELM_OBJ_GENLIST_SUB_ID_LAST_ITEM_GET), EO_TYPECHECK(Elm_Object_Item **, ret) + +/** + * @def elm_obj_genlist_mode_set + * @since 1.8 + * + * This sets the horizontal stretching mode. + * + * @param[in] mode + * + * @see elm_genlist_mode_set + */ +#define elm_obj_genlist_mode_set(mode) ELM_OBJ_GENLIST_ID(ELM_OBJ_GENLIST_SUB_ID_MODE_SET), EO_TYPECHECK(Elm_List_Mode, mode) + +/** + * @def elm_obj_genlist_mode_get + * @since 1.8 + * + * Gets the horizontal stretching mode. + * + * @param[out] ret + * + * @see elm_genlist_mode_get + */ +#define elm_obj_genlist_mode_get(ret) ELM_OBJ_GENLIST_ID(ELM_OBJ_GENLIST_SUB_ID_MODE_GET), EO_TYPECHECK(Elm_List_Mode *, ret) + +/** + * @def elm_obj_genlist_homogeneous_set + * @since 1.8 + * + * Enable/disable homogeneous mode. + * + * @param[in] homogeneous + * + * @see elm_genlist_homogeneous_set + */ +#define elm_obj_genlist_homogeneous_set(homogeneous) ELM_OBJ_GENLIST_ID(ELM_OBJ_GENLIST_SUB_ID_HOMOGENEOUS_SET), EO_TYPECHECK(Eina_Bool, homogeneous) + +/** + * @def elm_obj_genlist_homogeneous_get + * @since 1.8 + * + * Get whether the homogeneous mode is enabled. + * + * @param[out] ret + * + * @see elm_genlist_homogeneous_get + */ +#define elm_obj_genlist_homogeneous_get(ret) ELM_OBJ_GENLIST_ID(ELM_OBJ_GENLIST_SUB_ID_HOMOGENEOUS_GET), EO_TYPECHECK(Eina_Bool *, ret) + +/** + * @def elm_obj_genlist_block_count_set + * @since 1.8 + * + * Set the maximum number of items within an item block + * + * @param[in] count + * + * @see elm_genlist_block_count_set + */ +#define elm_obj_genlist_block_count_set(count) ELM_OBJ_GENLIST_ID(ELM_OBJ_GENLIST_SUB_ID_BLOCK_COUNT_SET), EO_TYPECHECK(int, count) + +/** + * @def elm_obj_genlist_block_count_get + * @since 1.8 + * + * Get the maximum number of items within an item block + * + * @param[out] ret + * + * @see elm_genlist_block_count_get + */ +#define elm_obj_genlist_block_count_get(ret) ELM_OBJ_GENLIST_ID(ELM_OBJ_GENLIST_SUB_ID_BLOCK_COUNT_GET), EO_TYPECHECK(int *, ret) + +/** + * @def elm_obj_genlist_longpress_timeout_set + * @since 1.8 + * + * Set the timeout in seconds for the longpress event. + * + * @param[in] timeout + * + * @see elm_genlist_longpress_timeout_set + */ +#define elm_obj_genlist_longpress_timeout_set(timeout) ELM_OBJ_GENLIST_ID(ELM_OBJ_GENLIST_SUB_ID_LONGPRESS_TIMEOUT_SET), EO_TYPECHECK(double, timeout) + +/** + * @def elm_obj_genlist_longpress_timeout_get + * @since 1.8 + * + * Get the timeout in seconds for the longpress event. + * + * @param[out] ret + * + * @see elm_genlist_longpress_timeout_get + */ +#define elm_obj_genlist_longpress_timeout_get(ret) ELM_OBJ_GENLIST_ID(ELM_OBJ_GENLIST_SUB_ID_LONGPRESS_TIMEOUT_GET), EO_TYPECHECK(double *, ret) + +/** + * @def elm_obj_genlist_realized_items_update + * @since 1.8 + * + * Update the contents of all realized items. + * + * + * @see elm_genlist_realized_items_update + */ +#define elm_obj_genlist_realized_items_update() ELM_OBJ_GENLIST_ID(ELM_OBJ_GENLIST_SUB_ID_REALIZED_ITEMS_UPDATE) + +/** + * @def elm_obj_genlist_decorated_item_get + * @since 1.8 + * + * Get active genlist mode item + * + * @param[out] ret + * + * @see elm_genlist_decorated_item_get + */ +#define elm_obj_genlist_decorated_item_get(ret) ELM_OBJ_GENLIST_ID(ELM_OBJ_GENLIST_SUB_ID_DECORATED_ITEM_GET), EO_TYPECHECK(Elm_Object_Item **, ret) + +/** + * @def elm_obj_genlist_decorate_mode_get + * @since 1.8 + * + * Get Genlist decorate mode + * + * @param[out] ret + * + * @see elm_genlist_decorate_mode_get + */ +#define elm_obj_genlist_decorate_mode_get(ret) ELM_OBJ_GENLIST_ID(ELM_OBJ_GENLIST_SUB_ID_DECORATE_MODE_GET), EO_TYPECHECK(Eina_Bool *, ret) + +/** + * @def elm_obj_genlist_decorate_mode_set + * @since 1.8 + * + * Set Genlist decorate mode + * + * @param[in] decorated + * + * @see elm_genlist_decorate_mode_set + */ +#define elm_obj_genlist_decorate_mode_set(decorated) ELM_OBJ_GENLIST_ID(ELM_OBJ_GENLIST_SUB_ID_DECORATE_MODE_SET), EO_TYPECHECK(Eina_Bool, decorated) + +/** + * @def elm_obj_genlist_reorder_mode_set + * @since 1.8 + * + * Set reorder mode + * + * @param[in] reorder_mode + * + * @see elm_genlist_reorder_mode_set + */ +#define elm_obj_genlist_reorder_mode_set(reorder_mode) ELM_OBJ_GENLIST_ID(ELM_OBJ_GENLIST_SUB_ID_REORDER_MODE_SET), EO_TYPECHECK(Eina_Bool, reorder_mode) + +/** + * @def elm_obj_genlist_reorder_mode_get + * @since 1.8 + * + * Get the reorder mode + * + * @param[out] ret + * + * @see elm_genlist_reorder_mode_get + */ +#define elm_obj_genlist_reorder_mode_get(ret) ELM_OBJ_GENLIST_ID(ELM_OBJ_GENLIST_SUB_ID_REORDER_MODE_GET), EO_TYPECHECK(Eina_Bool *, ret) + +/** + * @def elm_obj_genlist_select_mode_set + * @since 1.8 + * + * Set the genlist select mode. + * + * @param[in] mode + * + * @see elm_genlist_select_mode_set + */ +#define elm_obj_genlist_select_mode_set(mode) ELM_OBJ_GENLIST_ID(ELM_OBJ_GENLIST_SUB_ID_SELECT_MODE_SET), EO_TYPECHECK(Elm_Object_Select_Mode, mode) + +/** + * @def elm_obj_genlist_select_mode_get + * @since 1.8 + * + * Get the genlist select mode. + * + * @param[out] ret + * + * @see elm_genlist_select_mode_get + */ +#define elm_obj_genlist_select_mode_get(ret) ELM_OBJ_GENLIST_ID(ELM_OBJ_GENLIST_SUB_ID_SELECT_MODE_GET), EO_TYPECHECK(Elm_Object_Select_Mode *, ret) + +/** + * @def elm_obj_genlist_highlight_mode_set + * @since 1.8 + * + * Set whether the genlist items' should be highlighted when item selected. + * + * @param[in] highlight + * + * @see elm_genlist_highlight_mode_set + */ +#define elm_obj_genlist_highlight_mode_set(highlight) ELM_OBJ_GENLIST_ID(ELM_OBJ_GENLIST_SUB_ID_HIGHLIGHT_MODE_SET), EO_TYPECHECK(Eina_Bool, highlight) + +/** + * @def elm_obj_genlist_highlight_mode_get + * @since 1.8 + * + * Get whether the genlist items' should be highlighted when item selected. + * + * @param[out] ret + * + * @see elm_genlist_highlight_mode_get + */ +#define elm_obj_genlist_highlight_mode_get(ret) ELM_OBJ_GENLIST_ID(ELM_OBJ_GENLIST_SUB_ID_HIGHLIGHT_MODE_GET), EO_TYPECHECK(Eina_Bool *, ret) + +/** + * @def elm_obj_genlist_tree_effect_enabled_set + * @since 1.8 + * + * Set Genlist tree effect + * + * @param[in] enabled + * + * @see elm_genlist_tree_effect_enabled_set + */ +#define elm_obj_genlist_tree_effect_enabled_set(enabled) ELM_OBJ_GENLIST_ID(ELM_OBJ_GENLIST_SUB_ID_TREE_EFFECT_ENABLED_SET), EO_TYPECHECK(Eina_Bool, enabled) + +/** + * @def elm_obj_genlist_tree_effect_enabled_get + * @since 1.8 + * + * Get Genlist tree effect + * + * @param[out] ret + * + * @see elm_genlist_tree_effect_enabled_get + */ +#define elm_obj_genlist_tree_effect_enabled_get(ret) ELM_OBJ_GENLIST_ID(ELM_OBJ_GENLIST_SUB_ID_TREE_EFFECT_ENABLED_GET), EO_TYPECHECK(Eina_Bool *, ret) + + diff --git a/legacy/elementary/src/lib/elm_genlist_legacy.h b/legacy/elementary/src/lib/elm_genlist_legacy.h new file mode 100644 index 0000000000..5f76bd2e9f --- /dev/null +++ b/legacy/elementary/src/lib/elm_genlist_legacy.h @@ -0,0 +1,645 @@ +/** + * Add a new genlist widget to the given parent Elementary + * (container) object + * + * @param parent The parent object + * @return a new genlist widget handle or @c NULL, on errors + * + * This function inserts a new genlist widget on the canvas. + * + * @see elm_genlist_item_append() + * @see elm_object_item_del() + * @see elm_genlist_clear() + * + * @ingroup Genlist + */ +EAPI Evas_Object *elm_genlist_add(Evas_Object *parent); + +/** + * Remove all items from a given genlist widget. + * + * @param obj The genlist object + * + * This removes (and deletes) all items in @p obj, leaving it empty. + * + * @see elm_object_item_del(), to remove just one item. + * + * @ingroup Genlist + */ +EAPI void elm_genlist_clear(Evas_Object *obj); + +/** + * Enable or disable multi-selection in the genlist + * + * @param obj The genlist object + * @param multi Multi-select enable/disable. Default is disabled. + * + * This enables (@c EINA_TRUE) or disables (@c EINA_FALSE) multi-selection in + * the list. This allows more than 1 item to be selected. To retrieve the list + * of selected items, use elm_genlist_selected_items_get(). + * + * @see elm_genlist_selected_items_get() + * @see elm_genlist_multi_select_get() + * + * @ingroup Genlist + */ +EAPI void elm_genlist_multi_select_set(Evas_Object *obj, Eina_Bool multi); + +/** + * Gets if multi-selection in genlist is enabled or disabled. + * + * @param obj The genlist object + * @return Multi-select enabled/disabled + * (@c EINA_TRUE = enabled/@c EINA_FALSE = disabled). Default is @c EINA_FALSE. + * + * @see elm_genlist_multi_select_set() + * + * @ingroup Genlist + */ +EAPI Eina_Bool elm_genlist_multi_select_get(const Evas_Object *obj); + +/** + * This sets the horizontal stretching mode. + * + * @param obj The genlist object + * @param mode The mode to use (one of #ELM_LIST_SCROLL or #ELM_LIST_LIMIT). + * + * This sets the mode used for sizing items horizontally. Valid modes + * are #ELM_LIST_LIMIT, #ELM_LIST_SCROLL, and #ELM_LIST_COMPRESS. The default is + * ELM_LIST_SCROLL. This mode means that if items are too wide to fit, + * the scroller will scroll horizontally. Otherwise items are expanded + * to fill the width of the viewport of the scroller. If it is + * ELM_LIST_LIMIT, items will be expanded to the viewport width and + * limited to that size. If it is ELM_LIST_COMPRESS, the item width will be + * fixed (restricted to a minimum of) to the list width when calculating its + * size in order to allow the height to be calculated based on it. This allows, + * for instance, text block to wrap lines if the Edje part is configured with + * "text.min: 0 1". + * @note ELM_LIST_COMPRESS will make list resize slower as it will have to + * recalculate every item height again whenever the list width + * changes! + * @note Homogeneous mode is for that all items in the genlist same + * width/height. With ELM_LIST_COMPRESS, it makes genlist items to fast + * initializing. However there's no sub-objects in genlist which can be + * on the flying resizable (such as TEXTBLOCK). If then, some dynamic + * resizable objects in genlist would not diplayed properly. + * + * @see elm_genlist_mode_get() + * + * @ingroup Genlist + */ +EAPI void elm_genlist_mode_set(Evas_Object *obj, Elm_List_Mode mode); + +/** + * Gets the horizontal stretching mode. + * + * @param obj The genlist object + * @return The mode to use + * (#ELM_LIST_LIMIT, #ELM_LIST_SCROLL) + * + * @see elm_genlist_mode_set() + * + * @ingroup Genlist + */ +EAPI Elm_List_Mode elm_genlist_mode_get(const Evas_Object *obj); + +/** + * Append a new item in a given genlist widget. + * + * @param obj The genlist object + * @param itc The item class for the item + * @param data The item data + * @param parent The parent item, or NULL if none + * @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 + * + * This adds the given item to the end of the list or the end of + * the children list if the @p parent is given. + * + * @see elm_genlist_item_prepend() + * @see elm_genlist_item_insert_before() + * @see elm_genlist_item_insert_after() + * @see elm_object_item_del() + * + * @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_Type type, Evas_Smart_Cb func, const void *func_data); + +/** + * Prepend a new item in a given genlist widget. + * + * @param obj The genlist object + * @param itc The item class for the item + * @param data The item data + * @param parent The parent item, or NULL if none + * @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 + * + * This adds an item to the beginning of the list or beginning of the + * children of the parent if given. + * + * @see elm_genlist_item_append() + * @see elm_genlist_item_insert_before() + * @see elm_genlist_item_insert_after() + * @see elm_object_item_del() + * + * @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_Type type, Evas_Smart_Cb func, const void *func_data); + +/** + * Insert an item before another in a genlist widget + * + * @param obj The genlist object + * @param itc The item class for the item + * @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 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 + * + * This inserts an item before another in the list. It will be in the + * same tree level or group as the item it is inserted before. + * + * @see elm_genlist_item_append() + * @see elm_genlist_item_prepend() + * @see elm_genlist_item_insert_after() + * @see elm_object_item_del() + * + * @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_Type type, Evas_Smart_Cb func, const void *func_data); + +/** + * Insert an item after another in a genlist widget + * + * @param obj The genlist object + * @param itc The item class for the item + * @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 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 + * + * This inserts an item after another in the list. It will be in the + * same tree level or group as the item it is inserted after. + * + * @see elm_genlist_item_append() + * @see elm_genlist_item_prepend() + * @see elm_genlist_item_insert_before() + * @see elm_object_item_del() + * + * @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_Type type, Evas_Smart_Cb func, const void *func_data); + +/** + * Insert a new item into the sorted genlist object + * + * @param obj The genlist object + * @param itc The item class for the item + * @param data The item data + * @param parent The parent item, or NULL if none + * @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. + * @return A handle to the item added or NULL if not possible + * + * This inserts an item in the genlist based on user defined comparison + * function. The two arguments passed to the function @p func are genlist item + * handles to compare. + * + * @see elm_genlist_item_append() + * @see elm_genlist_item_prepend() + * @see elm_genlist_item_insert_after() + * @see elm_object_item_del() + + * @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_Type type, Eina_Compare_Cb comp, Evas_Smart_Cb func, const void *func_data); + +/* operations to retrieve existing items */ +/** + * Get the selected item in the genlist. + * + * @param obj The genlist object + * @return The selected item, or NULL if none is selected. + * + * This gets the selected item in the list (if multi-selection is enabled, only + * the item that was first selected in the list is returned - which is not very + * useful, so see elm_genlist_selected_items_get() for when multi-selection is + * used). + * + * If no item is selected, NULL is returned. + * + * @see elm_genlist_selected_items_get() + * + * @ingroup Genlist + */ +EAPI Elm_Object_Item *elm_genlist_selected_item_get(const Evas_Object *obj); + +/** + * Get a list of selected items in the genlist. + * + * @param obj The genlist object + * @return The list of selected items, or NULL if none are selected. + * + * It returns a list of the selected items. This list pointer is only valid so + * long as the selection doesn't change (no items are selected or unselected, or + * unselected implicitly by deletion). The list contains genlist items + * pointers. The order of the items in this list is the order which they were + * selected, i.e. the first item in this list is the first item that was + * selected, and so on. + * + * @note If not in multi-select mode, consider using function + * elm_genlist_selected_item_get() instead. + * + * @see elm_genlist_multi_select_set() + * @see elm_genlist_selected_item_get() + * + * @ingroup Genlist + */ +EAPI const Eina_List *elm_genlist_selected_items_get(const Evas_Object *obj); + +/** + * Get a list of realized items in genlist + * + * @param obj The genlist object + * @return The list of realized items, nor NULL if none are realized. + * + * This returns a list of the realized items in the genlist. The list + * contains genlist item pointers. The list must be freed by the + * caller when done with eina_list_free(). The item pointers in the + * list are only valid so long as those items are not deleted or the + * genlist is not deleted. + * + * @see elm_genlist_realized_items_update() + * + * @ingroup Genlist + */ +EAPI Eina_List *elm_genlist_realized_items_get(const Evas_Object *obj); + +/** + * Get the first item in the genlist + * + * This returns the first item in the list. + * + * @param obj The genlist object + * @return The first item, or NULL if none + * + * @ingroup Genlist + */ +EAPI Elm_Object_Item *elm_genlist_first_item_get(const Evas_Object *obj); + +/** + * Get the last item in the genlist + * + * This returns the last item in the list. + * + * @return The last item, or NULL if none + * + * @ingroup Genlist + */ +EAPI Elm_Object_Item *elm_genlist_last_item_get(const Evas_Object *obj); + +/** + * Update the contents of all realized items. + * + * @param obj The genlist object. + * + * This updates all realized items by calling all the item class functions again + * to get the contents, texts and states. Use this when the original + * item data has changed and the changes are desired to be reflected. + * + * To update just one item, use elm_genlist_item_update(). + * + * @see elm_genlist_realized_items_get() + * @see elm_genlist_item_update() + * + * @ingroup Genlist + */ +EAPI void elm_genlist_realized_items_update(Evas_Object *obj); + +/** + * Return how many items are currently in a list + * + * @param obj The list + * @return The total number of list items in the list + * + * This behavior is O(1) and includes items which may or may not be realized. + * + * @ingroup Genlist + */ +EAPI unsigned int elm_genlist_items_count(const Evas_Object *obj); + +/** + * Enable/disable homogeneous mode. + * + * @param obj The genlist object + * @param homogeneous Assume the items within the genlist are of the + * same height and width (EINA_TRUE = on, EINA_FALSE = off). Default is @c + * EINA_FALSE. + * + * This will enable the homogeneous mode where items are of the same + * height and width so that genlist may do the lazy-loading at its + * maximum (which increases the performance for scrolling the list). + * In the normal mode, genlist will pre-calculate all the items' sizes even + * though they are not in use. So items' callbacks are called many times than + * expected. But homogeneous mode will skip the item size pre-calculation + * process so items' callbacks are called only when the item is needed. + * + * @note This also works well with group index. + * + * @see elm_genlist_mode_set() + * @see elm_genlist_homogeneous_get() + * + * @ingroup Genlist + */ +EAPI void elm_genlist_homogeneous_set(Evas_Object *obj, Eina_Bool homogeneous); + +/** + * Get whether the homogeneous mode is enabled. + * + * @param obj The genlist object + * @return Assume the items within the genlist are of the same height + * and width (EINA_TRUE = on, EINA_FALSE = off) + * + * @see elm_genlist_homogeneous_set() + * + * @ingroup Genlist + */ +EAPI Eina_Bool elm_genlist_homogeneous_get(const Evas_Object *obj); + +/** + * Set the maximum number of items within an item block + * + * @param obj The genlist object + * @param count Maximum number of items within an item block. Default is 32. + * + * This will configure the block count to tune to the target with particular + * performance matrix. + * + * A block of objects will be used to reduce the number of operations due to + * many objects in the screen. It can determine the visibility, or if the + * object has changed, it theme needs to be updated, etc. doing this kind of + * calculation to the entire block, instead of per object. + * + * The default value for the block count is enough for most lists, so unless + * you know you will have a lot of objects visible in the screen at the same + * time, don't try to change this. + * + * @see elm_genlist_block_count_get() + * @see @ref Genlist_Implementation + * + * @ingroup Genlist + */ +EAPI void elm_genlist_block_count_set(Evas_Object *obj, int count); + +/** + * Get the maximum number of items within an item block + * + * @param obj The genlist object + * @return Maximum number of items within an item block + * + * @see elm_genlist_block_count_set() + * + * @ingroup Genlist + */ +EAPI int elm_genlist_block_count_get(const Evas_Object *obj); + +/** + * Set the timeout in seconds for the longpress event. + * + * @param obj The genlist object + * @param timeout timeout in seconds. Default is elm config value(1.0) + * + * This option will change how long it takes to send an event "longpressed" + * after the mouse down signal is sent to the list. If this event occurs, no + * "clicked" event will be sent. + * + * @warning If you set the longpress timeout value with this API, your genlist + * will not be affected by the longpress value of elementary config value + * later. + * + * @see elm_genlist_longpress_timeout_set() + * + * @ingroup Genlist + */ +EAPI void elm_genlist_longpress_timeout_set(Evas_Object *obj, double timeout); + +/** + * Get the timeout in seconds for the longpress event. + * + * @param obj The genlist object + * @return timeout in seconds + * + * @see elm_genlist_longpress_timeout_get() + * + * @ingroup Genlist + */ +EAPI double elm_genlist_longpress_timeout_get(const Evas_Object *obj); + +/** + * Get the item that is at the x, y canvas coords. + * + * @param obj The genlist object. + * @param x The input x coordinate + * @param y The input y coordinate + * @param posret The position relative to the item returned here + * @return The item at the coordinates or NULL if none + * + * This returns the item at the given coordinates (which are canvas + * relative, not object-relative). If an item is at that coordinate, + * that item handle is returned, and if @p posret is not NULL, the + * integer pointed to is set to a value of -1, 0 or 1, depending if + * the coordinate is on the upper portion of that item (-1), on the + * middle section (0) or on the lower part (1). If NULL is returned as + * an item (no item found there), then posret may indicate -1 or 1 + * based if the coordinate is above or below all items respectively in + * the genlist. + * + * @ingroup Genlist + */ +EAPI Elm_Object_Item *elm_genlist_at_xy_item_get(const Evas_Object *obj, Evas_Coord x, Evas_Coord y, int *posret); + +/** + * Get active genlist mode item + * + * @param obj The genlist object + * @return The active item for that current mode. Or @c NULL if no item is + * activated with any mode. + * + * This function returns the item that was activated with a mode, by the + * function elm_genlist_item_decorate_mode_set(). + * + * @see elm_genlist_item_decorate_mode_set() + * @see elm_genlist_mode_get() + * + * @ingroup Genlist + */ +EAPI Elm_Object_Item *elm_genlist_decorated_item_get(const Evas_Object *obj); + +/** + * Set reorder mode + * + * @param obj The genlist object + * @param reorder_mode The reorder mode + * (EINA_TRUE = on, EINA_FALSE = off) + * + * After turning on the reorder mode, longpress on normal item will trigger + * reordering of the item. You can move the item up and down. However, reorder + * does not work with group item. + * + * @ingroup Genlist + */ +EAPI void elm_genlist_reorder_mode_set(Evas_Object *obj, Eina_Bool reorder_mode); + +/** + * Get the reorder mode + * + * @param obj The genlist object + * @return The reorder mode + * (EINA_TRUE = on, EINA_FALSE = off) + * + * @ingroup Genlist + */ +EAPI Eina_Bool elm_genlist_reorder_mode_get(const Evas_Object *obj); + +/** + * Set Genlist decorate mode + * + * This sets Genlist decorate mode to all items. + * + * @param obj The Genlist object + * @param decorated The decorate mode status + * (EINA_TRUE = decorate mode, EINA_FALSE = normal mode + * + * @ingroup Genlist + */ +EAPI void elm_genlist_decorate_mode_set(Evas_Object *obj, Eina_Bool decorated); + +/** + * Get Genlist decorate mode + * + * @param obj The genlist object + * @return The decorate mode status + * (EINA_TRUE = decorate mode, EINA_FALSE = normal mode + * + * @ingroup Genlist + */ +EAPI Eina_Bool elm_genlist_decorate_mode_get(const Evas_Object *obj); + +/** + * Set Genlist tree effect + * + * @param obj The genlist object + * @param enabled The tree effect status + * (EINA_TRUE = enabled, EINA_FALSE = disabled + * + * @ingroup Genlist + */ +EAPI void elm_genlist_tree_effect_enabled_set(Evas_Object *obj, Eina_Bool enabled); + +/** + * Get Genlist tree effect + * + * @param obj The genlist object + * @return The tree effect status + * (EINA_TRUE = enabled, EINA_FALSE = disabled + * + * @ingroup Genlist + */ +EAPI Eina_Bool elm_genlist_tree_effect_enabled_get(const Evas_Object *obj); + +/** + * Set the genlist select mode. + * + * @param obj The genlist object + * @param mode The select mode + * + * elm_genlist_select_mode_set() changes item select mode in the genlist widget. + * - ELM_OBJECT_SELECT_MODE_DEFAULT : Items will call their selection func and + * callback once when first becoming selected. Any further clicks will + * do nothing, unless you set always select mode. + * - ELM_OBJECT_SELECT_MODE_ALWAYS : This means that, even if selected, + * every click will make the selected callbacks be called. + * - ELM_OBJECT_SELECT_MODE_NONE : This will turn off the ability to select items + * entirely and they will neither appear selected nor call selected + * callback functions. + * + * @see elm_genlist_select_mode_get() + * + * @ingroup Genlist + */ +EAPI void elm_genlist_select_mode_set(Evas_Object *obj, Elm_Object_Select_Mode mode); + +/** + * Get the genlist select mode. + * + * @param obj The genlist object + * @return The select mode + * (If getting mode is failed, it returns ELM_OBJECT_SELECT_MODE_MAX) + * + * @see elm_genlist_select_mode_set() + * + * @ingroup Genlist + */ +EAPI Elm_Object_Select_Mode elm_genlist_select_mode_get(const Evas_Object *obj); + +/** + * Set whether the genlist items' should be highlighted when item selected. + * + * @param obj The genlist object. + * @param highlight @c EINA_TRUE to enable highlighting or @c EINA_FALSE to + * disable it. + * + * This will turn on/off the highlight effect when item selection and + * they will, or will not highlighted. The selected and clicked + * callback functions will still be called. + * + * Highlight is enabled by default. + * + * @see elm_genlist_highlight_mode_get(). + * + * @ingroup Genlist + */ +EAPI void elm_genlist_highlight_mode_set(Evas_Object *obj, Eina_Bool highlight); + +/** + * Get whether the genlist items' should be highlighted when item selected. + * + * @param obj The genlist object. + * @return @c EINA_TRUE means items can be highlighted. @c EINA_FALSE indicates + * they can't. If @p obj is @c NULL, @c EINA_FALSE is returned. + * + * @see elm_genlist_highlight_mode_set() for details. + * + * @ingroup Genlist + */ +EAPI Eina_Bool elm_genlist_highlight_mode_get(const Evas_Object *obj); + +/** + * Get the nth item, in a given genlist widget, placed at position @p nth, in + * its internal items list + * + * @param obj The genlist object + * @param nth The number of the item to grab (0 being the first) + * + * @return The item stored in @p obj at position @p nth or @c NULL, if there's + * no item with that index (and on errors) + * + * @ingroup Genilst + * @since 1.8 + */ +EAPI Elm_Object_Item * +elm_genlist_nth_item_get(const Evas_Object *obj, unsigned int nth); + diff --git a/legacy/elementary/src/lib/elm_grid.h b/legacy/elementary/src/lib/elm_grid.h index 8b99e0520d..1f6e511336 100644 --- a/legacy/elementary/src/lib/elm_grid.h +++ b/legacy/elementary/src/lib/elm_grid.h @@ -17,208 +17,12 @@ * @{ */ -#define ELM_OBJ_GRID_CLASS elm_obj_grid_class_get() - -const Eo_Class *elm_obj_grid_class_get(void) EINA_CONST; - -extern EAPI Eo_Op ELM_OBJ_GRID_BASE_ID; - -enum -{ - ELM_OBJ_GRID_SUB_ID_SIZE_SET, - ELM_OBJ_GRID_SUB_ID_SIZE_GET, - ELM_OBJ_GRID_SUB_ID_PACK, - ELM_OBJ_GRID_SUB_ID_UNPACK, - ELM_OBJ_GRID_SUB_ID_CLEAR, - ELM_OBJ_GRID_SUB_ID_CHILDREN_GET, - ELM_OBJ_GRID_SUB_ID_LAST -}; - -#define ELM_OBJ_GRID_ID(sub_id) (ELM_OBJ_GRID_BASE_ID + sub_id) - -/** - * @def elm_obj_grid_size_set - * @since 1.8 - * - * Set the virtual size of the grid - * - * @param[in] w - * @param[in] h - * - * @see elm_grid_size_set - */ -#define elm_obj_grid_size_set(w, h) ELM_OBJ_GRID_ID(ELM_OBJ_GRID_SUB_ID_SIZE_SET), EO_TYPECHECK(Evas_Coord, w), EO_TYPECHECK(Evas_Coord, h) - -/** - * @def elm_obj_grid_size_get - * @since 1.8 - * - * Get the virtual size of the grid - * - * @param[out] w - * @param[out] h - * - * @see elm_grid_size_get - */ -#define elm_obj_grid_size_get(w, h) ELM_OBJ_GRID_ID(ELM_OBJ_GRID_SUB_ID_SIZE_GET), EO_TYPECHECK(Evas_Coord *, w), EO_TYPECHECK(Evas_Coord *, h) - -/** - * @def elm_obj_grid_pack - * @since 1.8 - * - * Pack child at given position and size - * - * @param[in] subobj - * @param[in] x - * @param[in] y - * @param[in] w - * @param[in] h - * - * @see elm_grid_pack - */ -#define elm_obj_grid_pack(subobj, x, y, w, h) ELM_OBJ_GRID_ID(ELM_OBJ_GRID_SUB_ID_PACK), EO_TYPECHECK(Evas_Object *, subobj), EO_TYPECHECK(Evas_Coord, x), EO_TYPECHECK(Evas_Coord, y), EO_TYPECHECK(Evas_Coord, w), EO_TYPECHECK(Evas_Coord, h) - -/** - * @def elm_obj_grid_unpack - * @since 1.8 - * - * Unpack a child from a grid object - * - * @param[in] subobj - * - * @see elm_grid_unpack - */ -#define elm_obj_grid_unpack(subobj) ELM_OBJ_GRID_ID(ELM_OBJ_GRID_SUB_ID_UNPACK), EO_TYPECHECK(Evas_Object *, subobj) - -/** - * @def elm_obj_grid_clear - * @since 1.8 - * - * Faster way to remove all child objects from a grid object. - * - * @param[in] clear - * - * @see elm_grid_clear - */ -#define elm_obj_grid_clear(clear) ELM_OBJ_GRID_ID(ELM_OBJ_GRID_SUB_ID_CLEAR), EO_TYPECHECK(Eina_Bool, clear) - -/** - * @def elm_obj_grid_children_get - * @since 1.8 - * - * Get the list of the children for the grid. - * - * @param[out] ret - * - * @see elm_grid_children_get - */ -#define elm_obj_grid_children_get(ret) ELM_OBJ_GRID_ID(ELM_OBJ_GRID_SUB_ID_CHILDREN_GET), EO_TYPECHECK(Eina_List **, ret) - -/** - * Add a new grid to the parent - * - * @param parent The parent object - * @return The new object or NULL if it cannot be created - * - * @ingroup Grid - */ -EAPI Evas_Object *elm_grid_add(Evas_Object *parent); - -/** - * Set the virtual size of the grid - * - * @param obj The grid object - * @param w The virtual width of the grid - * @param h The virtual height of the grid - * - * @ingroup Grid - */ -EAPI void elm_grid_size_set(Evas_Object *obj, Evas_Coord w, Evas_Coord h); - -/** - * Get the virtual size of the grid - * - * @param obj The grid object - * @param w Pointer to integer to store the virtual width of the grid - * @param h Pointer to integer to store the virtual height of the grid - * - * @ingroup Grid - */ -EAPI void elm_grid_size_get(const Evas_Object *obj, Evas_Coord *w, Evas_Coord *h); - -/** - * Pack child at given position and size - * - * @param obj The grid object - * @param subobj The child to pack - * @param x The virtual x coord at which to pack it - * @param y The virtual y coord at which to pack it - * @param w The virtual width at which to pack it - * @param h The virtual height at which to pack it - * - * @ingroup Grid - */ -EAPI void elm_grid_pack(Evas_Object *obj, Evas_Object *subobj, Evas_Coord x, Evas_Coord y, Evas_Coord w, Evas_Coord h); - -/** - * Unpack a child from a grid object - * - * @param obj The grid object - * @param subobj The child to unpack - * - * @ingroup Grid - */ -EAPI void elm_grid_unpack(Evas_Object *obj, Evas_Object *subobj); - -/** - * Faster way to remove all child objects from a grid object. - * - * @param obj The grid object - * @param clear If true, it will delete just removed children - * - * @ingroup Grid - */ -EAPI void elm_grid_clear(Evas_Object *obj, Eina_Bool clear); - -/** - * Set packing of an existing child at to position and size - * - * @param subobj The child to set packing of - * @param x The virtual x coord at which to pack it - * @param y The virtual y coord at which to pack it - * @param w The virtual width at which to pack it - * @param h The virtual height at which to pack it - * - * @ingroup Grid - */ -EAPI void elm_grid_pack_set(Evas_Object *subobj, Evas_Coord x, Evas_Coord y, Evas_Coord w, Evas_Coord h); - -/** - * Get packing of a child - * - * @param subobj The child to query - * @param x Pointer to integer to store the virtual x coord - * @param y Pointer to integer to store the virtual y coord - * @param w Pointer to integer to store the virtual width - * @param h Pointer to integer to store the virtual height - * - * @ingroup Grid - */ -EAPI void elm_grid_pack_get(Evas_Object *subobj, Evas_Coord *x, Evas_Coord *y, Evas_Coord *w, Evas_Coord *h); - -/** - * Get the list of the children for the grid. - * - * @param obj The grid object - * - * @note This is a duplicate of the list kept by the grid internally. - * It's up to the user to destroy it when it no longer needs it. - * It's possible to remove objects from the grid when walking this - * list, but these removals won't be reflected on it. - * - * @ingroup Grid - */ -EAPI Eina_List *elm_grid_children_get(const Evas_Object *obj); +#ifdef EFL_EO_API_SUPPORT +#include +#endif +#ifndef EFL_NOLEGACY_API_SUPPORT +#include +#endif /** * @} diff --git a/legacy/elementary/src/lib/elm_grid_eo.h b/legacy/elementary/src/lib/elm_grid_eo.h new file mode 100644 index 0000000000..30858e15aa --- /dev/null +++ b/legacy/elementary/src/lib/elm_grid_eo.h @@ -0,0 +1,98 @@ +#define ELM_OBJ_GRID_CLASS elm_obj_grid_class_get() + +const Eo_Class *elm_obj_grid_class_get(void) EINA_CONST; + +extern EAPI Eo_Op ELM_OBJ_GRID_BASE_ID; + +enum +{ + ELM_OBJ_GRID_SUB_ID_SIZE_SET, + ELM_OBJ_GRID_SUB_ID_SIZE_GET, + ELM_OBJ_GRID_SUB_ID_PACK, + ELM_OBJ_GRID_SUB_ID_UNPACK, + ELM_OBJ_GRID_SUB_ID_CLEAR, + ELM_OBJ_GRID_SUB_ID_CHILDREN_GET, + ELM_OBJ_GRID_SUB_ID_LAST +}; + +#define ELM_OBJ_GRID_ID(sub_id) (ELM_OBJ_GRID_BASE_ID + sub_id) + +/** + * @def elm_obj_grid_size_set + * @since 1.8 + * + * Set the virtual size of the grid + * + * @param[in] w + * @param[in] h + * + * @see elm_grid_size_set + */ +#define elm_obj_grid_size_set(w, h) ELM_OBJ_GRID_ID(ELM_OBJ_GRID_SUB_ID_SIZE_SET), EO_TYPECHECK(Evas_Coord, w), EO_TYPECHECK(Evas_Coord, h) + +/** + * @def elm_obj_grid_size_get + * @since 1.8 + * + * Get the virtual size of the grid + * + * @param[out] w + * @param[out] h + * + * @see elm_grid_size_get + */ +#define elm_obj_grid_size_get(w, h) ELM_OBJ_GRID_ID(ELM_OBJ_GRID_SUB_ID_SIZE_GET), EO_TYPECHECK(Evas_Coord *, w), EO_TYPECHECK(Evas_Coord *, h) + +/** + * @def elm_obj_grid_pack + * @since 1.8 + * + * Pack child at given position and size + * + * @param[in] subobj + * @param[in] x + * @param[in] y + * @param[in] w + * @param[in] h + * + * @see elm_grid_pack + */ +#define elm_obj_grid_pack(subobj, x, y, w, h) ELM_OBJ_GRID_ID(ELM_OBJ_GRID_SUB_ID_PACK), EO_TYPECHECK(Evas_Object *, subobj), EO_TYPECHECK(Evas_Coord, x), EO_TYPECHECK(Evas_Coord, y), EO_TYPECHECK(Evas_Coord, w), EO_TYPECHECK(Evas_Coord, h) + +/** + * @def elm_obj_grid_unpack + * @since 1.8 + * + * Unpack a child from a grid object + * + * @param[in] subobj + * + * @see elm_grid_unpack + */ +#define elm_obj_grid_unpack(subobj) ELM_OBJ_GRID_ID(ELM_OBJ_GRID_SUB_ID_UNPACK), EO_TYPECHECK(Evas_Object *, subobj) + +/** + * @def elm_obj_grid_clear + * @since 1.8 + * + * Faster way to remove all child objects from a grid object. + * + * @param[in] clear + * + * @see elm_grid_clear + */ +#define elm_obj_grid_clear(clear) ELM_OBJ_GRID_ID(ELM_OBJ_GRID_SUB_ID_CLEAR), EO_TYPECHECK(Eina_Bool, clear) + +/** + * @def elm_obj_grid_children_get + * @since 1.8 + * + * Get the list of the children for the grid. + * + * @param[out] ret + * + * @see elm_grid_children_get + */ +#define elm_obj_grid_children_get(ret) ELM_OBJ_GRID_ID(ELM_OBJ_GRID_SUB_ID_CHILDREN_GET), EO_TYPECHECK(Eina_List **, ret) + + diff --git a/legacy/elementary/src/lib/elm_grid_legacy.h b/legacy/elementary/src/lib/elm_grid_legacy.h new file mode 100644 index 0000000000..08a4be7164 --- /dev/null +++ b/legacy/elementary/src/lib/elm_grid_legacy.h @@ -0,0 +1,107 @@ +/** + * Add a new grid to the parent + * + * @param parent The parent object + * @return The new object or NULL if it cannot be created + * + * @ingroup Grid + */ +EAPI Evas_Object *elm_grid_add(Evas_Object *parent); + +/** + * Set the virtual size of the grid + * + * @param obj The grid object + * @param w The virtual width of the grid + * @param h The virtual height of the grid + * + * @ingroup Grid + */ +EAPI void elm_grid_size_set(Evas_Object *obj, Evas_Coord w, Evas_Coord h); + +/** + * Get the virtual size of the grid + * + * @param obj The grid object + * @param w Pointer to integer to store the virtual width of the grid + * @param h Pointer to integer to store the virtual height of the grid + * + * @ingroup Grid + */ +EAPI void elm_grid_size_get(const Evas_Object *obj, Evas_Coord *w, Evas_Coord *h); + +/** + * Pack child at given position and size + * + * @param obj The grid object + * @param subobj The child to pack + * @param x The virtual x coord at which to pack it + * @param y The virtual y coord at which to pack it + * @param w The virtual width at which to pack it + * @param h The virtual height at which to pack it + * + * @ingroup Grid + */ +EAPI void elm_grid_pack(Evas_Object *obj, Evas_Object *subobj, Evas_Coord x, Evas_Coord y, Evas_Coord w, Evas_Coord h); + +/** + * Unpack a child from a grid object + * + * @param obj The grid object + * @param subobj The child to unpack + * + * @ingroup Grid + */ +EAPI void elm_grid_unpack(Evas_Object *obj, Evas_Object *subobj); + +/** + * Faster way to remove all child objects from a grid object. + * + * @param obj The grid object + * @param clear If true, it will delete just removed children + * + * @ingroup Grid + */ +EAPI void elm_grid_clear(Evas_Object *obj, Eina_Bool clear); + +/** + * Set packing of an existing child at to position and size + * + * @param subobj The child to set packing of + * @param x The virtual x coord at which to pack it + * @param y The virtual y coord at which to pack it + * @param w The virtual width at which to pack it + * @param h The virtual height at which to pack it + * + * @ingroup Grid + */ +EAPI void elm_grid_pack_set(Evas_Object *subobj, Evas_Coord x, Evas_Coord y, Evas_Coord w, Evas_Coord h); + +/** + * Get packing of a child + * + * @param subobj The child to query + * @param x Pointer to integer to store the virtual x coord + * @param y Pointer to integer to store the virtual y coord + * @param w Pointer to integer to store the virtual width + * @param h Pointer to integer to store the virtual height + * + * @ingroup Grid + */ +EAPI void elm_grid_pack_get(Evas_Object *subobj, Evas_Coord *x, Evas_Coord *y, Evas_Coord *w, Evas_Coord *h); + +/** + * Get the list of the children for the grid. + * + * @param obj The grid object + * + * @note This is a duplicate of the list kept by the grid internally. + * It's up to the user to destroy it when it no longer needs it. + * It's possible to remove objects from the grid when walking this + * list, but these removals won't be reflected on it. + * + * @ingroup Grid + */ +EAPI Eina_List *elm_grid_children_get(const Evas_Object *obj); + + diff --git a/legacy/elementary/src/lib/elm_image.h b/legacy/elementary/src/lib/elm_image.h index ab1e9afaa5..2041ab1b56 100644 --- a/legacy/elementary/src/lib/elm_image.h +++ b/legacy/elementary/src/lib/elm_image.h @@ -36,1042 +36,18 @@ */ -#define ELM_OBJ_IMAGE_CLASS elm_obj_image_class_get() - -const Eo_Class *elm_obj_image_class_get(void) EINA_CONST; - -extern EAPI Eo_Op ELM_OBJ_IMAGE_BASE_ID; - -enum -{ - ELM_OBJ_IMAGE_SUB_ID_ASPECT_FIXED_SET, - ELM_OBJ_IMAGE_SUB_ID_ASPECT_FIXED_GET, - - ELM_OBJ_IMAGE_SUB_ID_EDITABLE_SET, - ELM_OBJ_IMAGE_SUB_ID_EDITABLE_GET, - - ELM_OBJ_IMAGE_SUB_ID_FILE_SET, - ELM_OBJ_IMAGE_SUB_ID_FILE_GET, - - ELM_OBJ_IMAGE_SUB_ID_SIZING_EVAL, - - ELM_OBJ_IMAGE_SUB_ID_SMOOTH_SCALE_SET, - ELM_OBJ_IMAGE_SUB_ID_SMOOTH_SCALE_GET, - - ELM_OBJ_IMAGE_SUB_ID_FILL_INSIDE_SET, - ELM_OBJ_IMAGE_SUB_ID_FILL_INSIDE_GET, - - ELM_OBJ_IMAGE_SUB_ID_FILL_OUTSIDE_SET, - ELM_OBJ_IMAGE_SUB_ID_FILL_OUTSIDE_GET, - - ELM_OBJ_IMAGE_SUB_ID_OBJECT_GET, - - ELM_OBJ_IMAGE_SUB_ID_LOAD_SIZE_SET, - ELM_OBJ_IMAGE_SUB_ID_LOAD_SIZE_GET, - - ELM_OBJ_IMAGE_SUB_ID_MEMFILE_SET, - - ELM_OBJ_IMAGE_SUB_ID_ORIENT_SET, - ELM_OBJ_IMAGE_SUB_ID_ORIENT_GET, - - ELM_OBJ_IMAGE_SUB_ID_PRELOAD_DISABLED_SET, - - ELM_OBJ_IMAGE_SUB_ID_RESIZE_DOWN_SET, - ELM_OBJ_IMAGE_SUB_ID_RESIZE_DOWN_GET, - - ELM_OBJ_IMAGE_SUB_ID_RESIZE_UP_SET, - ELM_OBJ_IMAGE_SUB_ID_RESIZE_UP_GET, - - ELM_OBJ_IMAGE_SUB_ID_SCALE_SET, - ELM_OBJ_IMAGE_SUB_ID_SCALE_GET, - - ELM_OBJ_IMAGE_SUB_ID_OBJECT_SIZE_GET, - - ELM_OBJ_IMAGE_SUB_ID_SMOOTH_SET, - ELM_OBJ_IMAGE_SUB_ID_SMOOTH_GET, - - ELM_OBJ_IMAGE_SUB_ID_NO_SCALE_SET, - ELM_OBJ_IMAGE_SUB_ID_NO_SCALE_GET, - - ELM_OBJ_IMAGE_SUB_ID_RESIZABLE_SET, - ELM_OBJ_IMAGE_SUB_ID_RESIZABLE_GET, - - ELM_OBJ_IMAGE_SUB_ID_ANIMATED_AVAILABLE_GET, - - ELM_OBJ_IMAGE_SUB_ID_ANIMATED_SET, - ELM_OBJ_IMAGE_SUB_ID_ANIMATED_GET, - - ELM_OBJ_IMAGE_SUB_ID_ANIMATED_PLAY_SET, - ELM_OBJ_IMAGE_SUB_ID_ANIMATED_PLAY_GET, - - ELM_OBJ_IMAGE_SUB_ID_LAST -}; - -#define ELM_OBJ_IMAGE_ID(sub_id) (ELM_OBJ_IMAGE_BASE_ID + sub_id) - - -/** - * @def elm_obj_image_memfile_set - * @since 1.8 - * - * Set a location in memory to be used as an image object's source - * - * @param[in] img - * @param[in] size - * @param[in] format - * @param[in] key - * @param[out] ret - * - * @see elm_image_memfile_set - */ -#define elm_obj_image_memfile_set(img, size, format, key, ret) ELM_OBJ_IMAGE_ID(ELM_OBJ_IMAGE_SUB_ID_MEMFILE_SET), EO_TYPECHECK(const void *, img), EO_TYPECHECK(size_t, size), EO_TYPECHECK(const char *, format), EO_TYPECHECK(const char *, key), EO_TYPECHECK(Eina_Bool *, ret) - -/** - * @def elm_obj_image_file_set - * @since 1.8 - * - * Set the file that will be used as the image's source. - * - * @param[in] file - * @param[in] group - * @param[out] ret - * - * @see elm_image_file_set - */ -#define elm_obj_image_file_set(file, group, ret) ELM_OBJ_IMAGE_ID(ELM_OBJ_IMAGE_SUB_ID_FILE_SET), EO_TYPECHECK(const char *, file), EO_TYPECHECK(const char *, group), EO_TYPECHECK(Eina_Bool *, ret) - -/** - * @def elm_obj_image_file_get - * @since 1.8 - * - * Get the file that will be used as image. - * - * @param[out] file - * @param[out] group - * - * @see elm_image_file_get - */ -#define elm_obj_image_file_get(file, group) ELM_OBJ_IMAGE_ID(ELM_OBJ_IMAGE_SUB_ID_FILE_GET), EO_TYPECHECK(const char **, file), EO_TYPECHECK(const char **, group) - -/** - * @def elm_obj_image_smooth_set - * @since 1.8 - * - * Set the smooth effect for an image. - * - * @param[in] smooth - * - * @see elm_image_smooth_set - */ -#define elm_obj_image_smooth_set(smooth) ELM_OBJ_IMAGE_ID(ELM_OBJ_IMAGE_SUB_ID_SMOOTH_SET), EO_TYPECHECK(Eina_Bool, smooth) - -/** - * @def elm_obj_image_smooth_get - * @since 1.8 - * - * Get the smooth effect for an image. - * - * @param[out] ret - * - * @see elm_image_smooth_get - */ -#define elm_obj_image_smooth_get(ret) ELM_OBJ_IMAGE_ID(ELM_OBJ_IMAGE_SUB_ID_SMOOTH_GET), EO_TYPECHECK(Eina_Bool *, ret) - -/** - * @def elm_obj_image_size_get - * @since 1.8 - * - * No description supplied by the EAPI. - * - * @param[out] w - * @param[out] h - * - * @see elm_image_size_get - */ -#define elm_obj_image_size_get(w, h) ELM_OBJ_IMAGE_ID(ELM_OBJ_IMAGE_SUB_ID_OBJECT_SIZE_GET), EO_TYPECHECK(int *, w), EO_TYPECHECK(int *, h) - -/** - * @def elm_obj_image_no_scale_set - * @since 1.8 - * - * Disable scaling of this object. - * - * @param[in] no_scale - * - * @see elm_image_no_scale_set - */ -#define elm_obj_image_no_scale_set(no_scale) ELM_OBJ_IMAGE_ID(ELM_OBJ_IMAGE_SUB_ID_NO_SCALE_SET), EO_TYPECHECK(Eina_Bool, no_scale) - -/** - * @def elm_obj_image_no_scale_get - * @since 1.8 - * - * Get whether scaling is disabled on the object. - * - * @param[out] ret - * - * @see elm_image_no_scale_get - */ -#define elm_obj_image_no_scale_get(ret) ELM_OBJ_IMAGE_ID(ELM_OBJ_IMAGE_SUB_ID_NO_SCALE_GET), EO_TYPECHECK(Eina_Bool *, ret) - -/** - * @def elm_obj_image_resizable_set - * @since 1.8 - * - * Set if the object is (up/down) resizable. - * - * @param[in] up - * @param[in] down - * - * @see elm_image_resizable_set - */ -#define elm_obj_image_resizable_set(up, down) ELM_OBJ_IMAGE_ID(ELM_OBJ_IMAGE_SUB_ID_RESIZABLE_SET), EO_TYPECHECK(Eina_Bool, up), EO_TYPECHECK(Eina_Bool, down) - -/** - * @def elm_obj_image_resizable_get - * @since 1.8 - * - * Get if the object is (up/down) resizable. - * - * @param[out] size_up - * @param[out] size_down - * - * @see elm_image_resizable_get - */ -#define elm_obj_image_resizable_get(size_up, size_down) ELM_OBJ_IMAGE_ID(ELM_OBJ_IMAGE_SUB_ID_RESIZABLE_GET), EO_TYPECHECK(Eina_Bool *, size_up), EO_TYPECHECK(Eina_Bool *, size_down) - -/** - * @def elm_obj_image_fill_outside_set - * @since 1.8 - * - * Set if the image fills the entire object area, when keeping the aspect ratio. - * - * @param[in] fill_outside - * - * @see elm_image_fill_outside_set - */ -#define elm_obj_image_fill_outside_set(fill_outside) ELM_OBJ_IMAGE_ID(ELM_OBJ_IMAGE_SUB_ID_FILL_OUTSIDE_SET), EO_TYPECHECK(Eina_Bool, fill_outside) - -/** - * @def elm_obj_image_fill_outside_get - * @since 1.8 - * - * Get if the object is filled outside - * - * @param[out] ret - * - * @see elm_image_fill_outside_get - */ -#define elm_obj_image_fill_outside_get(ret) ELM_OBJ_IMAGE_ID(ELM_OBJ_IMAGE_SUB_ID_FILL_OUTSIDE_GET), EO_TYPECHECK(Eina_Bool *, ret) - -/** - * @def elm_obj_image_preload_disabled_set - * @since 1.8 - * - * Enable or disable preloading of the image - * - * @param[in] disabled - * - * @see elm_image_preload_disabled_set - */ -#define elm_obj_image_preload_disabled_set(disabled) ELM_OBJ_IMAGE_ID(ELM_OBJ_IMAGE_SUB_ID_PRELOAD_DISABLED_SET), EO_TYPECHECK(Eina_Bool, disabled) - -/** - * @def elm_obj_image_orient_set - * @since 1.8 - * - * Set the image orientation. - * - * @param[in] orient - * - * @see elm_image_orient_set - */ -#define elm_obj_image_orient_set(orient) ELM_OBJ_IMAGE_ID(ELM_OBJ_IMAGE_SUB_ID_ORIENT_SET), EO_TYPECHECK(Elm_Image_Orient, orient) - -/** - * @def elm_obj_image_orient_get - * @since 1.8 - * - * Get the image orientation. - * - * @param[out] ret - * - * @see elm_image_orient_get - */ -#define elm_obj_image_orient_get(ret) ELM_OBJ_IMAGE_ID(ELM_OBJ_IMAGE_SUB_ID_ORIENT_GET), EO_TYPECHECK(Elm_Image_Orient *, ret) - -/** - * @def elm_obj_image_editable_set - * @since 1.8 - * - * Make the image 'editable'. - * - * @param[in] set - * @param[in] parent - * - * @see elm_image_editable_set - */ -#define elm_obj_image_editable_set(set, parent) ELM_OBJ_IMAGE_ID(ELM_OBJ_IMAGE_SUB_ID_EDITABLE_SET), EO_TYPECHECK(Eina_Bool, set), EO_TYPECHECK(Evas_Object *, parent) - -/** - * @def elm_obj_image_editable_get - * @since 1.8 - * - * Check if the image is 'editable'. - * - * @param[out] ret - * - * @see elm_image_editable_get - */ -#define elm_obj_image_editable_get(ret) ELM_OBJ_IMAGE_ID(ELM_OBJ_IMAGE_SUB_ID_EDITABLE_GET), EO_TYPECHECK(Eina_Bool *, ret) - -/** - * @def elm_obj_image_object_get - * @since 1.8 - * - * Get the inlined image object of the image widget. - * - * @param[out] ret - * - * @see elm_image_object_get - */ -#define elm_obj_image_object_get(ret) ELM_OBJ_IMAGE_ID(ELM_OBJ_IMAGE_SUB_ID_OBJECT_GET), EO_TYPECHECK(Evas_Object **, ret) - -/** - * @def elm_obj_image_aspect_fixed_set - * @since 1.8 - * - * Set whether the original aspect ratio of the image should be kept on resize. - * - * @param[in] fixed - * - * @see elm_image_aspect_fixed_set - */ -#define elm_obj_image_aspect_fixed_set(fixed) ELM_OBJ_IMAGE_ID(ELM_OBJ_IMAGE_SUB_ID_ASPECT_FIXED_SET), EO_TYPECHECK(Eina_Bool, fixed) - -/** - * @def elm_obj_image_aspect_fixed_get - * @since 1.8 - * - * Get if the object retains the original aspect ratio. - * - * @param[out] ret - * - * @see elm_image_aspect_fixed_get - */ -#define elm_obj_image_aspect_fixed_get(ret) ELM_OBJ_IMAGE_ID(ELM_OBJ_IMAGE_SUB_ID_ASPECT_FIXED_GET), EO_TYPECHECK(Eina_Bool *, ret) - -/** - * @def elm_obj_image_animated_available_get - * @since 1.8 - * - * Get whether an image object supports animation or not. - * - * @param[out] ret - * - * @see elm_image_animated_available_get - */ -#define elm_obj_image_animated_available_get(ret) ELM_OBJ_IMAGE_ID(ELM_OBJ_IMAGE_SUB_ID_ANIMATED_AVAILABLE_GET), EO_TYPECHECK(Eina_Bool *, ret) - -/** - * @def elm_obj_image_animated_set - * @since 1.8 - * - * Set whether an image object (which supports animation) is to - * - * @param[in] anim - * - * @see elm_image_animated_set - */ -#define elm_obj_image_animated_set(anim) ELM_OBJ_IMAGE_ID(ELM_OBJ_IMAGE_SUB_ID_ANIMATED_SET), EO_TYPECHECK(Eina_Bool, anim) - -/** - * @def elm_obj_image_animated_get - * @since 1.8 - * - * Get whether an image object has animation enabled or not. - * - * @param[out] ret - * - * @see elm_image_animated_get - */ -#define elm_obj_image_animated_get(ret) ELM_OBJ_IMAGE_ID(ELM_OBJ_IMAGE_SUB_ID_ANIMATED_GET), EO_TYPECHECK(Eina_Bool *, ret) - -/** - * @def elm_obj_image_animated_play_set - * @since 1.8 - * - * Start or stop an image object's animation. - * - * @param[in] play - * - * @see elm_image_animated_play_set - */ -#define elm_obj_image_animated_play_set(play) ELM_OBJ_IMAGE_ID(ELM_OBJ_IMAGE_SUB_ID_ANIMATED_PLAY_SET), EO_TYPECHECK(Eina_Bool, play) - -/** - * @def elm_obj_image_animated_play_get - * @since 1.8 - * - * Get whether an image object is under animation or not. - * - * @param[out] ret - * - * @see elm_image_animated_play_get - */ -#define elm_obj_image_animated_play_get(ret) ELM_OBJ_IMAGE_ID(ELM_OBJ_IMAGE_SUB_ID_ANIMATED_PLAY_GET), EO_TYPECHECK(Eina_Bool *, ret) - -/** - * @def elm_obj_image_sizing_eval - * @since 1.8 - * - * No description supplied by the EAPI. - * - */ -#define elm_obj_image_sizing_eval() ELM_OBJ_IMAGE_ID(ELM_OBJ_IMAGE_SUB_ID_SIZING_EVAL) - -/** - * @def elm_obj_image_smooth_scale_set - * @since 1.8 - * - * No description supplied by the EAPI. - * - * @param[in] smooth - * - * @see elm_image_smooth_scale_set - */ -#define elm_obj_image_smooth_scale_set(smooth) ELM_OBJ_IMAGE_ID(ELM_OBJ_IMAGE_SUB_ID_SMOOTH_SCALE_SET), EO_TYPECHECK(Eina_Bool, smooth) - -/** - * @def elm_obj_image_smooth_scale_get - * @since 1.8 - * - * No description supplied by the EAPI. - * - * @param[out] ret - * - * @see elm_image_smooth_scale_get - */ -#define elm_obj_image_smooth_scale_get(ret) ELM_OBJ_IMAGE_ID(ELM_OBJ_IMAGE_SUB_ID_SMOOTH_SCALE_GET), EO_TYPECHECK(Eina_Bool *, ret) - - -/** - * @def elm_obj_image_fill_inside_set - * @since 1.8 - * - * No description supplied by the EAPI. - * - * @param[in] fill_inside - * - * @see elm_image_fill_inside_set - */ -#define elm_obj_image_fill_inside_set(fill_inside) ELM_OBJ_IMAGE_ID(ELM_OBJ_IMAGE_SUB_ID_FILL_INSIDE_SET), EO_TYPECHECK(Eina_Bool, fill_inside) - -/** - * @def elm_obj_image_fill_inside_get - * @since 1.8 - * - * No description supplied by the EAPI. - * - * @param[out] ret - * - * @see elm_image_fill_inside_get - */ -#define elm_obj_image_fill_inside_get(ret) ELM_OBJ_IMAGE_ID(ELM_OBJ_IMAGE_SUB_ID_FILL_INSIDE_GET), EO_TYPECHECK(Eina_Bool *, ret) - - -/** - * @def elm_obj_image_load_size_set - * @since 1.8 - * - * No description supplied by the EAPI. - * - * @param[in] size - * - * @see elm_image_load_size_set - */ -#define elm_obj_image_load_size_set(size) ELM_OBJ_IMAGE_ID(ELM_OBJ_IMAGE_SUB_ID_LOAD_SIZE_SET), EO_TYPECHECK(int, size) - -/** - * @def elm_obj_image_load_size_get - * @since 1.8 - * - * No description supplied by the EAPI. - * - * @param[out] ret - * - * @see elm_image_load_size_get - */ -#define elm_obj_image_load_size_get(ret) ELM_OBJ_IMAGE_ID(ELM_OBJ_IMAGE_SUB_ID_LOAD_SIZE_GET), EO_TYPECHECK(int *, ret) - - -/** - * @def elm_obj_image_resize_down_set - * @since 1.8 - * - * No description supplied by the EAPI. - * - * @param[in] resize_down - * - * @see elm_image_resize_down_set - */ -#define elm_obj_image_resize_down_set(resize_down) ELM_OBJ_IMAGE_ID(ELM_OBJ_IMAGE_SUB_ID_RESIZE_DOWN_SET), EO_TYPECHECK(Eina_Bool, resize_down) - -/** - * @def elm_obj_image_resize_down_get - * @since 1.8 - * - * No description supplied by the EAPI. - * - * @param[out] ret - * - * @see elm_image_resize_down_get - */ -#define elm_obj_image_resize_down_get(ret) ELM_OBJ_IMAGE_ID(ELM_OBJ_IMAGE_SUB_ID_RESIZE_DOWN_GET), EO_TYPECHECK(Eina_Bool *, ret) - - -/** - * @def elm_obj_image_resize_up_set - * @since 1.8 - * - * No description supplied by the EAPI. - * - * @param[in] resize_up - * - * @see elm_image_resize_up_set - */ -#define elm_obj_image_resize_up_set(resize_up) ELM_OBJ_IMAGE_ID(ELM_OBJ_IMAGE_SUB_ID_RESIZE_UP_SET), EO_TYPECHECK(Eina_Bool, resize_up) - -/** - * @def elm_obj_image_resize_up_get - * @since 1.8 - * - * No description supplied by the EAPI. - * - * @param[out] ret - * - * @see elm_image_resize_up_get - */ -#define elm_obj_image_resize_up_get(ret) ELM_OBJ_IMAGE_ID(ELM_OBJ_IMAGE_SUB_ID_RESIZE_UP_GET), EO_TYPECHECK(Eina_Bool *, ret) - - -/** - * @def elm_obj_image_scale_set - * @since 1.8 - * - * No description supplied by the EAPI. - * - * @param[in] scale - * - * @see elm_image_scale_set - */ -#define elm_obj_image_scale_set(scale) ELM_OBJ_IMAGE_ID(ELM_OBJ_IMAGE_SUB_ID_SCALE_SET), EO_TYPECHECK(double, scale) - -/** - * @def elm_obj_image_scale_get - * @since 1.8 - * - * No description supplied by the EAPI. - * - * @param[out] ret - * - * @see elm_image_scale_get - */ -#define elm_obj_image_scale_get(ret) ELM_OBJ_IMAGE_ID(ELM_OBJ_IMAGE_SUB_ID_SCALE_GET), EO_TYPECHECK(double *, ret) - /** * @addtogroup Image * @{ */ -/** - * Possible orientation options for elm_image_orient_set(). - * - * @image html elm_image_orient_set.png - * @image latex elm_image_orient_set.eps width=\textwidth - * - * @ingroup Image - */ -typedef enum -{ - ELM_IMAGE_ORIENT_NONE = 0, /**< no orientation change */ - ELM_IMAGE_ORIENT_0 = 0, /**< no orientation change */ - ELM_IMAGE_ROTATE_90 = 1, /**< rotate 90 degrees clockwise */ - ELM_IMAGE_ROTATE_180 = 2, /**< rotate 180 degrees clockwise */ - ELM_IMAGE_ROTATE_270 = 3, /**< rotate 90 degrees counter-clockwise (i.e. 270 degrees clockwise) */ - ELM_IMAGE_FLIP_HORIZONTAL = 4, /**< flip image horizontally */ - ELM_IMAGE_FLIP_VERTICAL = 5, /**< flip image vertically */ - ELM_IMAGE_FLIP_TRANSPOSE = 6, /**< flip the image along the y = (width - x) line (bottom-left to top-right) */ - ELM_IMAGE_FLIP_TRANSVERSE = 7 /**< flip the image along the y = x line (top-left to bottom-right) */ -} Elm_Image_Orient; - -/** - * Add a new image to the parent. - * - * @param parent The parent object - * @return The new object or NULL if it cannot be created - * - * @see elm_image_file_set() - * - * @ingroup Image - */ -EAPI Evas_Object *elm_image_add(Evas_Object *parent); - -/** - * Set a location in memory to be used as an image object's source - * bitmap. - * - * @param obj The image object - * @param img The binary data that will be used as image source - * @param size The size of binary data blob @p img - * @param format (Optional) expected format of @p img bytes - * @param key Optional indexing key of @p img to be passed to the - * image loader (eg. if @p img is a memory-mapped EET file) - * - * This function is handy when the contents of an image file are - * mapped in memory, for example. - * - * The @p format string should be something like @c "png", @c "jpg", - * @c "tga", @c "tiff", @c "bmp" etc, when provided (@c NULL, on the - * contrary). This improves the loader performance as it tries the - * "correct" loader first, before trying a range of other possible - * loaders until one succeeds. - * - * @return (@c EINA_TRUE = success, @c EINA_FALSE = error) - * - * @since 1.7 - * - * @ingroup Image - */ -EAPI Eina_Bool elm_image_memfile_set(Evas_Object *obj, const void *img, size_t size, const char *format, const char *key); - -/** - * Set the file that will be used as the image's source. - * - * @param obj The image object - * @param file The path to file that will be used as image source - * @param group The group that the image belongs to, in case it's an - * EET (including Edje case) file - * - * @return (@c EINA_TRUE = success, @c EINA_FALSE = error) - * - * @see elm_image_file_get() - * - * @note This function will trigger the Edje file case based on the - * extension of the @a file string (expects @c ".edj", for this - * case). If one wants to force this type of file independently of the - * extension, elm_image_file_edje_set() must be used, instead. - * - * @ingroup Image - */ -EAPI Eina_Bool elm_image_file_set(Evas_Object *obj, const char *file, const char *group); - -/** - * Get the file that will be used as image. - * - * @param obj The image object - * @param file The path to file - * @param group The group that the image belongs in edje file - * - * @see elm_image_file_set() - * - * @ingroup Image - */ -EAPI void elm_image_file_get(const Evas_Object *obj, const char **file, const char **group); - -/** - * Set the smooth effect for an image. - * - * @param obj The image object - * @param smooth @c EINA_TRUE if smooth scaling should be used, @c EINA_FALSE - * otherwise. Default is @c EINA_TRUE. - * - * Set the scaling algorithm to be used when scaling the image. Smooth - * scaling provides a better resulting image, but is slower. - * - * The smooth scaling should be disabled when making animations that change - * the image size, since it will be faster. Animations that don't require - * resizing of the image can keep the smooth scaling enabled (even if the - * image is already scaled, since the scaled image will be cached). - * - * @see elm_image_smooth_get() - * - * @ingroup Image - */ -EAPI void elm_image_smooth_set(Evas_Object *obj, Eina_Bool smooth); - -/** - * Get the smooth effect for an image. - * - * @param obj The image object - * @return @c EINA_TRUE if smooth scaling is enabled, @c EINA_FALSE otherwise. - * - * @see elm_image_smooth_set() - * - * @ingroup Image - */ -EAPI Eina_Bool elm_image_smooth_get(const Evas_Object *obj); - -/** - * Gets the current size of the image. - * - * @param obj The image object. - * @param w Pointer to store width, or NULL. - * @param h Pointer to store height, or NULL. - * - * This is the real size of the image, not the size of the object. - * - * @ingroup Image - */ -EAPI void elm_image_object_size_get(const Evas_Object *obj, int *w, int *h); - -/** - * Disable scaling of this object. - * - * @param obj The image object. - * @param no_scale @c EINA_TRUE if the object is not scalable, @c EINA_FALSE - * otherwise. Default is @c EINA_FALSE. - * - * This function disables scaling of the elm_image widget through the - * function elm_object_scale_set(). However, this does not affect the widget - * size/resize in any way. For that effect, take a look at - * elm_image_resizable_set(). - * - * @see elm_image_no_scale_get() - * @see elm_image_resizable_set() - * @see elm_object_scale_set() - * - * @ingroup Image - */ -EAPI void elm_image_no_scale_set(Evas_Object *obj, Eina_Bool no_scale); - -/** - * Get whether scaling is disabled on the object. - * - * @param obj The image object - * @return @c EINA_TRUE if scaling is disabled, @c EINA_FALSE otherwise - * - * @see elm_image_no_scale_set() - * - * @ingroup Image - */ -EAPI Eina_Bool elm_image_no_scale_get(const Evas_Object *obj); - -/** - * Set if the object is (up/down) resizable. - * - * @param obj The image object - * @param size_up A bool to set if the object is resizable up. Default is - * @c EINA_TRUE. - * @param size_down A bool to set if the object is resizable down. Default - * is @c EINA_TRUE. - * - * This function limits the image resize ability. If @p size_up is set to - * @c EINA_FALSE, the object can't have its height or width resized to a value - * higher than the original image size. Same is valid for @p size_down. - * - * @see elm_image_resizable_get() - * - * @ingroup Image - */ -EAPI void elm_image_resizable_set(Evas_Object *obj, Eina_Bool size_up, Eina_Bool size_down); - -/** - * Get if the object is (up/down) resizable. - * - * @param obj The image object - * @param size_up A bool to set if the object is resizable up - * @param size_down A bool to set if the object is resizable down - * - * @see elm_image_resizable_set() - * - * @ingroup Image - */ -EAPI void elm_image_resizable_get(const Evas_Object *obj, Eina_Bool *size_up, Eina_Bool *size_down); - -/** - * Set if the image fills the entire object area, when keeping the aspect ratio. - * - * @param obj The image object - * @param fill_outside @c EINA_TRUE if the object is filled outside, - * @c EINA_FALSE otherwise. Default is @c EINA_FALSE. - * - * When the image should keep its aspect ratio even if resized to another - * aspect ratio, there are two possibilities to resize it: keep the entire - * image inside the limits of height and width of the object (@p fill_outside - * is @c EINA_FALSE) or let the extra width or height go outside of the object, - * and the image will fill the entire object (@p fill_outside is @c EINA_TRUE). - * - * @note This option will have no effect if - * elm_image_aspect_fixed_set() is set to @c EINA_FALSE. - * - * @see elm_image_fill_outside_get() - * @see elm_image_aspect_fixed_set() - * - * @ingroup Image - */ -EAPI void elm_image_fill_outside_set(Evas_Object *obj, Eina_Bool fill_outside); - -/** - * Get if the object is filled outside - * - * @param obj The image object - * @return @c EINA_TRUE if the object is filled outside, @c EINA_FALSE otherwise. - * - * @see elm_image_fill_outside_set() - * - * @ingroup Image - */ -EAPI Eina_Bool elm_image_fill_outside_get(const Evas_Object *obj); - -/** - * Enable or disable preloading of the image - * - * @param obj The image object - * @param disabled If EINA_TRUE, preloading will be disabled - * @ingroup Image - */ -EAPI void elm_image_preload_disabled_set(Evas_Object *obj, Eina_Bool disabled); - -/** - * Set the prescale size for the image - * - * @param obj The image object - * @param size The prescale size. This value is used for both width and - * height. - * - * This function sets a new size for pixmap representation of the given - * image. It allows the image to be loaded already in the specified size, - * reducing the memory usage and load time when loading a big image with load - * size set to a smaller size. - * - * It's equivalent to the elm_bg_load_size_set() function for bg. - * - * @note this is just a hint, the real size of the pixmap may differ - * depending on the type of image being loaded, being bigger than requested. - * - * @see elm_image_prescale_get() - * @see elm_bg_load_size_set() - * - * @ingroup Image - */ -EAPI void elm_image_prescale_set(Evas_Object *obj, int size); - -/** - * Get the prescale size for the image - * - * @param obj The image object - * @return The prescale size - * - * @see elm_image_prescale_set() - * - * @ingroup Image - */ -EAPI int elm_image_prescale_get(const Evas_Object *obj); - -/** - * Set the image orientation. - * - * @param obj The image object - * @param orient The image orientation @ref Elm_Image_Orient - * Default is #ELM_IMAGE_ORIENT_NONE. - * - * This function allows to rotate or flip the given image. - * - * @see elm_image_orient_get() - * @see @ref Elm_Image_Orient - * - * @ingroup Image - */ -EAPI void elm_image_orient_set(Evas_Object *obj, Elm_Image_Orient orient); - -/** - * Get the image orientation. - * - * @param obj The image object - * @return The image orientation @ref Elm_Image_Orient - * - * @see elm_image_orient_set() - * @see @ref Elm_Image_Orient - * - * @ingroup Image - */ -EAPI Elm_Image_Orient elm_image_orient_get(const Evas_Object *obj); - -/** - * Make the image 'editable'. - * - * @param obj Image object. - * @param set Turn on or off editability. Default is @c EINA_FALSE. - * - * This means the image is a valid drag target for drag and drop, and can be - * cut or pasted too. - * - * @ingroup Image - */ -EAPI void elm_image_editable_set(Evas_Object *obj, Eina_Bool set); - -/** - * Check if the image is 'editable'. - * - * @param obj Image object. - * @return Editability. - * - * A return value of EINA_TRUE means the image is a valid drag target - * for drag and drop, and can be cut or pasted too. - * - * @ingroup Image - */ -EAPI Eina_Bool elm_image_editable_get(const Evas_Object *obj); - -/** - * Get the inlined image object of the image widget. - * - * @param obj The image object to get the inlined image from - * @return The inlined image object, or NULL if none exists - * - * This function allows one to get the underlying @c Evas_Object of type - * Image from this elementary widget. It can be useful to do things like get - * the pixel data, save the image to a file, etc. - * - * @note Be careful to not manipulate it, as it is under control of - * elementary. - * - * @ingroup Image - */ -EAPI Evas_Object *elm_image_object_get(const Evas_Object *obj); - -/** - * Set whether the original aspect ratio of the image should be kept on resize. - * - * @param obj The image object. - * @param fixed @c EINA_TRUE if the image should retain the aspect, - * @c EINA_FALSE otherwise. - * - * The original aspect ratio (width / height) of the image is usually - * distorted to match the object's size. Enabling this option will retain - * this original aspect, and the way that the image is fit into the object's - * area depends on the option set by elm_image_fill_outside_set(). - * - * @see elm_image_aspect_fixed_get() - * @see elm_image_fill_outside_set() - * - * @ingroup Image - */ -EAPI void elm_image_aspect_fixed_set(Evas_Object *obj, Eina_Bool fixed); - -/** - * Get if the object retains the original aspect ratio. - * - * @param obj The image object. - * @return @c EINA_TRUE if the object keeps the original aspect, @c EINA_FALSE - * otherwise. - * - * @ingroup Image - */ -EAPI Eina_Bool elm_image_aspect_fixed_get(const Evas_Object *obj); - -/** - * Get whether an image object supports animation or not. - * - * @param obj The image object - * @return @c EINA_TRUE if the image supports animation, - * @c EINA_FALSE otherwise. - * - * This function returns if this Elementary image object's internal - * image can be animated. Currently Evas only supports GIF - * animation. If the return value is @b EINA_FALSE, other - * @c elm_image_animated_xxx API calls won't work. - * - * @see elm_image_animated_set() - * - * @ingroup Image - * @since 1.7 - */ -EAPI Eina_Bool elm_image_animated_available_get(const Evas_Object *obj); - -/** - * Set whether an image object (which supports animation) is to - * animate itself or not. - * - * @param obj The image object - - * @param animated @c EINA_TRUE if the object is to animate itself, - * @c EINA_FALSE otherwise. Default is @c EINA_FALSE. - * - * An image object, even if it supports animation, will be displayed - * by default without animation. Call this function with @a animated - * set to @c EINA_TRUE to enable its animation. To start or stop the - * animation, actually, use elm_image_animated_play_set(). - * - * @see elm_image_animated_get() - * @see elm_image_animated_available_get() - * @see elm_image_animated_play_set() - * - * @ingroup Image - * @since 1.7 - */ -EAPI void elm_image_animated_set(Evas_Object *obj, Eina_Bool animated); - -/** - * Get whether an image object has animation enabled or not. - * - * @param obj The image object - * - * @return @c EINA_TRUE if the image has animation enabled, - * @c EINA_FALSE otherwise. - * - * @see elm_image_animated_set() - * - * @ingroup Image - * @since 1.7 - */ -EAPI Eina_Bool elm_image_animated_get(const Evas_Object *obj); - -/** - * Start or stop an image object's animation. - * - * @param obj The image object - * @param play @c EINA_TRUE to start the animation, @c EINA_FALSE - * otherwise. Default is @c EINA_FALSE. - * - * To actually start playing any image object's animation, if it - * supports it, one must do something like: - * - * @code - * if (elm_image_animated_available_get(img)) - * { - * elm_image_animated_set(img, EINA_TRUE); - * elm_image_animated_play_set(img, EINA_TRUE); - * } - * @endcode - * - * elm_image_animated_set() will enable animation on the image, but - * not start it yet. This is the function one uses to start and - * stop animations on image objects. - * - * @see elm_image_animated_available_get() - * @see elm_image_animated_set() - * @see elm_image_animated_play_get() - * - * @ingroup Image - * @since 1.7 - */ -EAPI void elm_image_animated_play_set(Evas_Object *obj, Eina_Bool play); - -/** - * Get whether an image object is under animation or not. - * - * @param obj The image object - * @return @c EINA_TRUE, if the image is being animated, @c EINA_FALSE - * otherwise. - * - * @see elm_image_animated_play_get() - * - * @ingroup Image - * @since 1.7 - */ -EAPI Eina_Bool elm_image_animated_play_get(const Evas_Object *obj); +#include +#ifdef EFL_EO_API_SUPPORT +#include +#endif +#ifndef EFL_NOLEGACY_API_SUPPORT +#include +#endif /** * @} diff --git a/legacy/elementary/src/lib/elm_image_common.h b/legacy/elementary/src/lib/elm_image_common.h new file mode 100644 index 0000000000..7651927c7b --- /dev/null +++ b/legacy/elementary/src/lib/elm_image_common.h @@ -0,0 +1,22 @@ +/** + * Possible orientation options for elm_image_orient_set(). + * + * @image html elm_image_orient_set.png + * @image latex elm_image_orient_set.eps width=\textwidth + * + * @ingroup Image + */ +typedef enum +{ + ELM_IMAGE_ORIENT_NONE = 0, /**< no orientation change */ + ELM_IMAGE_ORIENT_0 = 0, /**< no orientation change */ + ELM_IMAGE_ROTATE_90 = 1, /**< rotate 90 degrees clockwise */ + ELM_IMAGE_ROTATE_180 = 2, /**< rotate 180 degrees clockwise */ + ELM_IMAGE_ROTATE_270 = 3, /**< rotate 90 degrees counter-clockwise (i.e. 270 degrees clockwise) */ + ELM_IMAGE_FLIP_HORIZONTAL = 4, /**< flip image horizontally */ + ELM_IMAGE_FLIP_VERTICAL = 5, /**< flip image vertically */ + ELM_IMAGE_FLIP_TRANSPOSE = 6, /**< flip the image along the y = (width - x) line (bottom-left to top-right) */ + ELM_IMAGE_FLIP_TRANSVERSE = 7 /**< flip the image along the y = x line (top-left to bottom-right) */ +} Elm_Image_Orient; + + diff --git a/legacy/elementary/src/lib/elm_image_eo.h b/legacy/elementary/src/lib/elm_image_eo.h new file mode 100644 index 0000000000..e43a2804a2 --- /dev/null +++ b/legacy/elementary/src/lib/elm_image_eo.h @@ -0,0 +1,544 @@ +#define ELM_OBJ_IMAGE_CLASS elm_obj_image_class_get() + +const Eo_Class *elm_obj_image_class_get(void) EINA_CONST; + +extern EAPI Eo_Op ELM_OBJ_IMAGE_BASE_ID; + +enum +{ + ELM_OBJ_IMAGE_SUB_ID_ASPECT_FIXED_SET, + ELM_OBJ_IMAGE_SUB_ID_ASPECT_FIXED_GET, + + ELM_OBJ_IMAGE_SUB_ID_EDITABLE_SET, + ELM_OBJ_IMAGE_SUB_ID_EDITABLE_GET, + + ELM_OBJ_IMAGE_SUB_ID_FILE_SET, + ELM_OBJ_IMAGE_SUB_ID_FILE_GET, + + ELM_OBJ_IMAGE_SUB_ID_SIZING_EVAL, + + ELM_OBJ_IMAGE_SUB_ID_SMOOTH_SCALE_SET, + ELM_OBJ_IMAGE_SUB_ID_SMOOTH_SCALE_GET, + + ELM_OBJ_IMAGE_SUB_ID_FILL_INSIDE_SET, + ELM_OBJ_IMAGE_SUB_ID_FILL_INSIDE_GET, + + ELM_OBJ_IMAGE_SUB_ID_FILL_OUTSIDE_SET, + ELM_OBJ_IMAGE_SUB_ID_FILL_OUTSIDE_GET, + + ELM_OBJ_IMAGE_SUB_ID_OBJECT_GET, + + ELM_OBJ_IMAGE_SUB_ID_LOAD_SIZE_SET, + ELM_OBJ_IMAGE_SUB_ID_LOAD_SIZE_GET, + + ELM_OBJ_IMAGE_SUB_ID_MEMFILE_SET, + + ELM_OBJ_IMAGE_SUB_ID_ORIENT_SET, + ELM_OBJ_IMAGE_SUB_ID_ORIENT_GET, + + ELM_OBJ_IMAGE_SUB_ID_PRELOAD_DISABLED_SET, + + ELM_OBJ_IMAGE_SUB_ID_RESIZE_DOWN_SET, + ELM_OBJ_IMAGE_SUB_ID_RESIZE_DOWN_GET, + + ELM_OBJ_IMAGE_SUB_ID_RESIZE_UP_SET, + ELM_OBJ_IMAGE_SUB_ID_RESIZE_UP_GET, + + ELM_OBJ_IMAGE_SUB_ID_SCALE_SET, + ELM_OBJ_IMAGE_SUB_ID_SCALE_GET, + + ELM_OBJ_IMAGE_SUB_ID_OBJECT_SIZE_GET, + + ELM_OBJ_IMAGE_SUB_ID_SMOOTH_SET, + ELM_OBJ_IMAGE_SUB_ID_SMOOTH_GET, + + ELM_OBJ_IMAGE_SUB_ID_NO_SCALE_SET, + ELM_OBJ_IMAGE_SUB_ID_NO_SCALE_GET, + + ELM_OBJ_IMAGE_SUB_ID_RESIZABLE_SET, + ELM_OBJ_IMAGE_SUB_ID_RESIZABLE_GET, + + ELM_OBJ_IMAGE_SUB_ID_ANIMATED_AVAILABLE_GET, + + ELM_OBJ_IMAGE_SUB_ID_ANIMATED_SET, + ELM_OBJ_IMAGE_SUB_ID_ANIMATED_GET, + + ELM_OBJ_IMAGE_SUB_ID_ANIMATED_PLAY_SET, + ELM_OBJ_IMAGE_SUB_ID_ANIMATED_PLAY_GET, + + ELM_OBJ_IMAGE_SUB_ID_LAST +}; + +#define ELM_OBJ_IMAGE_ID(sub_id) (ELM_OBJ_IMAGE_BASE_ID + sub_id) + + +/** + * @def elm_obj_image_memfile_set + * @since 1.8 + * + * Set a location in memory to be used as an image object's source + * + * @param[in] img + * @param[in] size + * @param[in] format + * @param[in] key + * @param[out] ret + * + * @see elm_image_memfile_set + */ +#define elm_obj_image_memfile_set(img, size, format, key, ret) ELM_OBJ_IMAGE_ID(ELM_OBJ_IMAGE_SUB_ID_MEMFILE_SET), EO_TYPECHECK(const void *, img), EO_TYPECHECK(size_t, size), EO_TYPECHECK(const char *, format), EO_TYPECHECK(const char *, key), EO_TYPECHECK(Eina_Bool *, ret) + +/** + * @def elm_obj_image_file_set + * @since 1.8 + * + * Set the file that will be used as the image's source. + * + * @param[in] file + * @param[in] group + * @param[out] ret + * + * @see elm_image_file_set + */ +#define elm_obj_image_file_set(file, group, ret) ELM_OBJ_IMAGE_ID(ELM_OBJ_IMAGE_SUB_ID_FILE_SET), EO_TYPECHECK(const char *, file), EO_TYPECHECK(const char *, group), EO_TYPECHECK(Eina_Bool *, ret) + +/** + * @def elm_obj_image_file_get + * @since 1.8 + * + * Get the file that will be used as image. + * + * @param[out] file + * @param[out] group + * + * @see elm_image_file_get + */ +#define elm_obj_image_file_get(file, group) ELM_OBJ_IMAGE_ID(ELM_OBJ_IMAGE_SUB_ID_FILE_GET), EO_TYPECHECK(const char **, file), EO_TYPECHECK(const char **, group) + +/** + * @def elm_obj_image_smooth_set + * @since 1.8 + * + * Set the smooth effect for an image. + * + * @param[in] smooth + * + * @see elm_image_smooth_set + */ +#define elm_obj_image_smooth_set(smooth) ELM_OBJ_IMAGE_ID(ELM_OBJ_IMAGE_SUB_ID_SMOOTH_SET), EO_TYPECHECK(Eina_Bool, smooth) + +/** + * @def elm_obj_image_smooth_get + * @since 1.8 + * + * Get the smooth effect for an image. + * + * @param[out] ret + * + * @see elm_image_smooth_get + */ +#define elm_obj_image_smooth_get(ret) ELM_OBJ_IMAGE_ID(ELM_OBJ_IMAGE_SUB_ID_SMOOTH_GET), EO_TYPECHECK(Eina_Bool *, ret) + +/** + * @def elm_obj_image_size_get + * @since 1.8 + * + * No description supplied by the EAPI. + * + * @param[out] w + * @param[out] h + * + * @see elm_image_size_get + */ +#define elm_obj_image_size_get(w, h) ELM_OBJ_IMAGE_ID(ELM_OBJ_IMAGE_SUB_ID_OBJECT_SIZE_GET), EO_TYPECHECK(int *, w), EO_TYPECHECK(int *, h) + +/** + * @def elm_obj_image_no_scale_set + * @since 1.8 + * + * Disable scaling of this object. + * + * @param[in] no_scale + * + * @see elm_image_no_scale_set + */ +#define elm_obj_image_no_scale_set(no_scale) ELM_OBJ_IMAGE_ID(ELM_OBJ_IMAGE_SUB_ID_NO_SCALE_SET), EO_TYPECHECK(Eina_Bool, no_scale) + +/** + * @def elm_obj_image_no_scale_get + * @since 1.8 + * + * Get whether scaling is disabled on the object. + * + * @param[out] ret + * + * @see elm_image_no_scale_get + */ +#define elm_obj_image_no_scale_get(ret) ELM_OBJ_IMAGE_ID(ELM_OBJ_IMAGE_SUB_ID_NO_SCALE_GET), EO_TYPECHECK(Eina_Bool *, ret) + +/** + * @def elm_obj_image_resizable_set + * @since 1.8 + * + * Set if the object is (up/down) resizable. + * + * @param[in] up + * @param[in] down + * + * @see elm_image_resizable_set + */ +#define elm_obj_image_resizable_set(up, down) ELM_OBJ_IMAGE_ID(ELM_OBJ_IMAGE_SUB_ID_RESIZABLE_SET), EO_TYPECHECK(Eina_Bool, up), EO_TYPECHECK(Eina_Bool, down) + +/** + * @def elm_obj_image_resizable_get + * @since 1.8 + * + * Get if the object is (up/down) resizable. + * + * @param[out] size_up + * @param[out] size_down + * + * @see elm_image_resizable_get + */ +#define elm_obj_image_resizable_get(size_up, size_down) ELM_OBJ_IMAGE_ID(ELM_OBJ_IMAGE_SUB_ID_RESIZABLE_GET), EO_TYPECHECK(Eina_Bool *, size_up), EO_TYPECHECK(Eina_Bool *, size_down) + +/** + * @def elm_obj_image_fill_outside_set + * @since 1.8 + * + * Set if the image fills the entire object area, when keeping the aspect ratio. + * + * @param[in] fill_outside + * + * @see elm_image_fill_outside_set + */ +#define elm_obj_image_fill_outside_set(fill_outside) ELM_OBJ_IMAGE_ID(ELM_OBJ_IMAGE_SUB_ID_FILL_OUTSIDE_SET), EO_TYPECHECK(Eina_Bool, fill_outside) + +/** + * @def elm_obj_image_fill_outside_get + * @since 1.8 + * + * Get if the object is filled outside + * + * @param[out] ret + * + * @see elm_image_fill_outside_get + */ +#define elm_obj_image_fill_outside_get(ret) ELM_OBJ_IMAGE_ID(ELM_OBJ_IMAGE_SUB_ID_FILL_OUTSIDE_GET), EO_TYPECHECK(Eina_Bool *, ret) + +/** + * @def elm_obj_image_preload_disabled_set + * @since 1.8 + * + * Enable or disable preloading of the image + * + * @param[in] disabled + * + * @see elm_image_preload_disabled_set + */ +#define elm_obj_image_preload_disabled_set(disabled) ELM_OBJ_IMAGE_ID(ELM_OBJ_IMAGE_SUB_ID_PRELOAD_DISABLED_SET), EO_TYPECHECK(Eina_Bool, disabled) + +/** + * @def elm_obj_image_orient_set + * @since 1.8 + * + * Set the image orientation. + * + * @param[in] orient + * + * @see elm_image_orient_set + */ +#define elm_obj_image_orient_set(orient) ELM_OBJ_IMAGE_ID(ELM_OBJ_IMAGE_SUB_ID_ORIENT_SET), EO_TYPECHECK(Elm_Image_Orient, orient) + +/** + * @def elm_obj_image_orient_get + * @since 1.8 + * + * Get the image orientation. + * + * @param[out] ret + * + * @see elm_image_orient_get + */ +#define elm_obj_image_orient_get(ret) ELM_OBJ_IMAGE_ID(ELM_OBJ_IMAGE_SUB_ID_ORIENT_GET), EO_TYPECHECK(Elm_Image_Orient *, ret) + +/** + * @def elm_obj_image_editable_set + * @since 1.8 + * + * Make the image 'editable'. + * + * @param[in] set + * @param[in] parent + * + * @see elm_image_editable_set + */ +#define elm_obj_image_editable_set(set, parent) ELM_OBJ_IMAGE_ID(ELM_OBJ_IMAGE_SUB_ID_EDITABLE_SET), EO_TYPECHECK(Eina_Bool, set), EO_TYPECHECK(Evas_Object *, parent) + +/** + * @def elm_obj_image_editable_get + * @since 1.8 + * + * Check if the image is 'editable'. + * + * @param[out] ret + * + * @see elm_image_editable_get + */ +#define elm_obj_image_editable_get(ret) ELM_OBJ_IMAGE_ID(ELM_OBJ_IMAGE_SUB_ID_EDITABLE_GET), EO_TYPECHECK(Eina_Bool *, ret) + +/** + * @def elm_obj_image_object_get + * @since 1.8 + * + * Get the inlined image object of the image widget. + * + * @param[out] ret + * + * @see elm_image_object_get + */ +#define elm_obj_image_object_get(ret) ELM_OBJ_IMAGE_ID(ELM_OBJ_IMAGE_SUB_ID_OBJECT_GET), EO_TYPECHECK(Evas_Object **, ret) + +/** + * @def elm_obj_image_aspect_fixed_set + * @since 1.8 + * + * Set whether the original aspect ratio of the image should be kept on resize. + * + * @param[in] fixed + * + * @see elm_image_aspect_fixed_set + */ +#define elm_obj_image_aspect_fixed_set(fixed) ELM_OBJ_IMAGE_ID(ELM_OBJ_IMAGE_SUB_ID_ASPECT_FIXED_SET), EO_TYPECHECK(Eina_Bool, fixed) + +/** + * @def elm_obj_image_aspect_fixed_get + * @since 1.8 + * + * Get if the object retains the original aspect ratio. + * + * @param[out] ret + * + * @see elm_image_aspect_fixed_get + */ +#define elm_obj_image_aspect_fixed_get(ret) ELM_OBJ_IMAGE_ID(ELM_OBJ_IMAGE_SUB_ID_ASPECT_FIXED_GET), EO_TYPECHECK(Eina_Bool *, ret) + +/** + * @def elm_obj_image_animated_available_get + * @since 1.8 + * + * Get whether an image object supports animation or not. + * + * @param[out] ret + * + * @see elm_image_animated_available_get + */ +#define elm_obj_image_animated_available_get(ret) ELM_OBJ_IMAGE_ID(ELM_OBJ_IMAGE_SUB_ID_ANIMATED_AVAILABLE_GET), EO_TYPECHECK(Eina_Bool *, ret) + +/** + * @def elm_obj_image_animated_set + * @since 1.8 + * + * Set whether an image object (which supports animation) is to + * + * @param[in] anim + * + * @see elm_image_animated_set + */ +#define elm_obj_image_animated_set(anim) ELM_OBJ_IMAGE_ID(ELM_OBJ_IMAGE_SUB_ID_ANIMATED_SET), EO_TYPECHECK(Eina_Bool, anim) + +/** + * @def elm_obj_image_animated_get + * @since 1.8 + * + * Get whether an image object has animation enabled or not. + * + * @param[out] ret + * + * @see elm_image_animated_get + */ +#define elm_obj_image_animated_get(ret) ELM_OBJ_IMAGE_ID(ELM_OBJ_IMAGE_SUB_ID_ANIMATED_GET), EO_TYPECHECK(Eina_Bool *, ret) + +/** + * @def elm_obj_image_animated_play_set + * @since 1.8 + * + * Start or stop an image object's animation. + * + * @param[in] play + * + * @see elm_image_animated_play_set + */ +#define elm_obj_image_animated_play_set(play) ELM_OBJ_IMAGE_ID(ELM_OBJ_IMAGE_SUB_ID_ANIMATED_PLAY_SET), EO_TYPECHECK(Eina_Bool, play) + +/** + * @def elm_obj_image_animated_play_get + * @since 1.8 + * + * Get whether an image object is under animation or not. + * + * @param[out] ret + * + * @see elm_image_animated_play_get + */ +#define elm_obj_image_animated_play_get(ret) ELM_OBJ_IMAGE_ID(ELM_OBJ_IMAGE_SUB_ID_ANIMATED_PLAY_GET), EO_TYPECHECK(Eina_Bool *, ret) + +/** + * @def elm_obj_image_sizing_eval + * @since 1.8 + * + * No description supplied by the EAPI. + * + */ +#define elm_obj_image_sizing_eval() ELM_OBJ_IMAGE_ID(ELM_OBJ_IMAGE_SUB_ID_SIZING_EVAL) + +/** + * @def elm_obj_image_smooth_scale_set + * @since 1.8 + * + * No description supplied by the EAPI. + * + * @param[in] smooth + * + * @see elm_image_smooth_scale_set + */ +#define elm_obj_image_smooth_scale_set(smooth) ELM_OBJ_IMAGE_ID(ELM_OBJ_IMAGE_SUB_ID_SMOOTH_SCALE_SET), EO_TYPECHECK(Eina_Bool, smooth) + +/** + * @def elm_obj_image_smooth_scale_get + * @since 1.8 + * + * No description supplied by the EAPI. + * + * @param[out] ret + * + * @see elm_image_smooth_scale_get + */ +#define elm_obj_image_smooth_scale_get(ret) ELM_OBJ_IMAGE_ID(ELM_OBJ_IMAGE_SUB_ID_SMOOTH_SCALE_GET), EO_TYPECHECK(Eina_Bool *, ret) + + +/** + * @def elm_obj_image_fill_inside_set + * @since 1.8 + * + * No description supplied by the EAPI. + * + * @param[in] fill_inside + * + * @see elm_image_fill_inside_set + */ +#define elm_obj_image_fill_inside_set(fill_inside) ELM_OBJ_IMAGE_ID(ELM_OBJ_IMAGE_SUB_ID_FILL_INSIDE_SET), EO_TYPECHECK(Eina_Bool, fill_inside) + +/** + * @def elm_obj_image_fill_inside_get + * @since 1.8 + * + * No description supplied by the EAPI. + * + * @param[out] ret + * + * @see elm_image_fill_inside_get + */ +#define elm_obj_image_fill_inside_get(ret) ELM_OBJ_IMAGE_ID(ELM_OBJ_IMAGE_SUB_ID_FILL_INSIDE_GET), EO_TYPECHECK(Eina_Bool *, ret) + + +/** + * @def elm_obj_image_load_size_set + * @since 1.8 + * + * No description supplied by the EAPI. + * + * @param[in] size + * + * @see elm_image_load_size_set + */ +#define elm_obj_image_load_size_set(size) ELM_OBJ_IMAGE_ID(ELM_OBJ_IMAGE_SUB_ID_LOAD_SIZE_SET), EO_TYPECHECK(int, size) + +/** + * @def elm_obj_image_load_size_get + * @since 1.8 + * + * No description supplied by the EAPI. + * + * @param[out] ret + * + * @see elm_image_load_size_get + */ +#define elm_obj_image_load_size_get(ret) ELM_OBJ_IMAGE_ID(ELM_OBJ_IMAGE_SUB_ID_LOAD_SIZE_GET), EO_TYPECHECK(int *, ret) + + +/** + * @def elm_obj_image_resize_down_set + * @since 1.8 + * + * No description supplied by the EAPI. + * + * @param[in] resize_down + * + * @see elm_image_resize_down_set + */ +#define elm_obj_image_resize_down_set(resize_down) ELM_OBJ_IMAGE_ID(ELM_OBJ_IMAGE_SUB_ID_RESIZE_DOWN_SET), EO_TYPECHECK(Eina_Bool, resize_down) + +/** + * @def elm_obj_image_resize_down_get + * @since 1.8 + * + * No description supplied by the EAPI. + * + * @param[out] ret + * + * @see elm_image_resize_down_get + */ +#define elm_obj_image_resize_down_get(ret) ELM_OBJ_IMAGE_ID(ELM_OBJ_IMAGE_SUB_ID_RESIZE_DOWN_GET), EO_TYPECHECK(Eina_Bool *, ret) + + +/** + * @def elm_obj_image_resize_up_set + * @since 1.8 + * + * No description supplied by the EAPI. + * + * @param[in] resize_up + * + * @see elm_image_resize_up_set + */ +#define elm_obj_image_resize_up_set(resize_up) ELM_OBJ_IMAGE_ID(ELM_OBJ_IMAGE_SUB_ID_RESIZE_UP_SET), EO_TYPECHECK(Eina_Bool, resize_up) + +/** + * @def elm_obj_image_resize_up_get + * @since 1.8 + * + * No description supplied by the EAPI. + * + * @param[out] ret + * + * @see elm_image_resize_up_get + */ +#define elm_obj_image_resize_up_get(ret) ELM_OBJ_IMAGE_ID(ELM_OBJ_IMAGE_SUB_ID_RESIZE_UP_GET), EO_TYPECHECK(Eina_Bool *, ret) + + +/** + * @def elm_obj_image_scale_set + * @since 1.8 + * + * No description supplied by the EAPI. + * + * @param[in] scale + * + * @see elm_image_scale_set + */ +#define elm_obj_image_scale_set(scale) ELM_OBJ_IMAGE_ID(ELM_OBJ_IMAGE_SUB_ID_SCALE_SET), EO_TYPECHECK(double, scale) + +/** + * @def elm_obj_image_scale_get + * @since 1.8 + * + * No description supplied by the EAPI. + * + * @param[out] ret + * + * @see elm_image_scale_get + */ +#define elm_obj_image_scale_get(ret) ELM_OBJ_IMAGE_ID(ELM_OBJ_IMAGE_SUB_ID_SCALE_GET), EO_TYPECHECK(double *, ret) + + diff --git a/legacy/elementary/src/lib/elm_image_legacy.h b/legacy/elementary/src/lib/elm_image_legacy.h new file mode 100644 index 0000000000..7497437b16 --- /dev/null +++ b/legacy/elementary/src/lib/elm_image_legacy.h @@ -0,0 +1,468 @@ +/** + * Add a new image to the parent. + * + * @param parent The parent object + * @return The new object or NULL if it cannot be created + * + * @see elm_image_file_set() + * + * @ingroup Image + */ +EAPI Evas_Object *elm_image_add(Evas_Object *parent); + +/** + * Set a location in memory to be used as an image object's source + * bitmap. + * + * @param obj The image object + * @param img The binary data that will be used as image source + * @param size The size of binary data blob @p img + * @param format (Optional) expected format of @p img bytes + * @param key Optional indexing key of @p img to be passed to the + * image loader (eg. if @p img is a memory-mapped EET file) + * + * This function is handy when the contents of an image file are + * mapped in memory, for example. + * + * The @p format string should be something like @c "png", @c "jpg", + * @c "tga", @c "tiff", @c "bmp" etc, when provided (@c NULL, on the + * contrary). This improves the loader performance as it tries the + * "correct" loader first, before trying a range of other possible + * loaders until one succeeds. + * + * @return (@c EINA_TRUE = success, @c EINA_FALSE = error) + * + * @since 1.7 + * + * @ingroup Image + */ +EAPI Eina_Bool elm_image_memfile_set(Evas_Object *obj, const void *img, size_t size, const char *format, const char *key); + +/** + * Set the file that will be used as the image's source. + * + * @param obj The image object + * @param file The path to file that will be used as image source + * @param group The group that the image belongs to, in case it's an + * EET (including Edje case) file + * + * @return (@c EINA_TRUE = success, @c EINA_FALSE = error) + * + * @see elm_image_file_get() + * + * @note This function will trigger the Edje file case based on the + * extension of the @a file string (expects @c ".edj", for this + * case). If one wants to force this type of file independently of the + * extension, elm_image_file_edje_set() must be used, instead. + * + * @ingroup Image + */ +EAPI Eina_Bool elm_image_file_set(Evas_Object *obj, const char *file, const char *group); + +/** + * Get the file that will be used as image. + * + * @param obj The image object + * @param file The path to file + * @param group The group that the image belongs in edje file + * + * @see elm_image_file_set() + * + * @ingroup Image + */ +EAPI void elm_image_file_get(const Evas_Object *obj, const char **file, const char **group); + +/** + * Set the smooth effect for an image. + * + * @param obj The image object + * @param smooth @c EINA_TRUE if smooth scaling should be used, @c EINA_FALSE + * otherwise. Default is @c EINA_TRUE. + * + * Set the scaling algorithm to be used when scaling the image. Smooth + * scaling provides a better resulting image, but is slower. + * + * The smooth scaling should be disabled when making animations that change + * the image size, since it will be faster. Animations that don't require + * resizing of the image can keep the smooth scaling enabled (even if the + * image is already scaled, since the scaled image will be cached). + * + * @see elm_image_smooth_get() + * + * @ingroup Image + */ +EAPI void elm_image_smooth_set(Evas_Object *obj, Eina_Bool smooth); + +/** + * Get the smooth effect for an image. + * + * @param obj The image object + * @return @c EINA_TRUE if smooth scaling is enabled, @c EINA_FALSE otherwise. + * + * @see elm_image_smooth_set() + * + * @ingroup Image + */ +EAPI Eina_Bool elm_image_smooth_get(const Evas_Object *obj); + +/** + * Gets the current size of the image. + * + * @param obj The image object. + * @param w Pointer to store width, or NULL. + * @param h Pointer to store height, or NULL. + * + * This is the real size of the image, not the size of the object. + * + * @ingroup Image + */ +EAPI void elm_image_object_size_get(const Evas_Object *obj, int *w, int *h); + +/** + * Disable scaling of this object. + * + * @param obj The image object. + * @param no_scale @c EINA_TRUE if the object is not scalable, @c EINA_FALSE + * otherwise. Default is @c EINA_FALSE. + * + * This function disables scaling of the elm_image widget through the + * function elm_object_scale_set(). However, this does not affect the widget + * size/resize in any way. For that effect, take a look at + * elm_image_resizable_set(). + * + * @see elm_image_no_scale_get() + * @see elm_image_resizable_set() + * @see elm_object_scale_set() + * + * @ingroup Image + */ +EAPI void elm_image_no_scale_set(Evas_Object *obj, Eina_Bool no_scale); + +/** + * Get whether scaling is disabled on the object. + * + * @param obj The image object + * @return @c EINA_TRUE if scaling is disabled, @c EINA_FALSE otherwise + * + * @see elm_image_no_scale_set() + * + * @ingroup Image + */ +EAPI Eina_Bool elm_image_no_scale_get(const Evas_Object *obj); + +/** + * Set if the object is (up/down) resizable. + * + * @param obj The image object + * @param size_up A bool to set if the object is resizable up. Default is + * @c EINA_TRUE. + * @param size_down A bool to set if the object is resizable down. Default + * is @c EINA_TRUE. + * + * This function limits the image resize ability. If @p size_up is set to + * @c EINA_FALSE, the object can't have its height or width resized to a value + * higher than the original image size. Same is valid for @p size_down. + * + * @see elm_image_resizable_get() + * + * @ingroup Image + */ +EAPI void elm_image_resizable_set(Evas_Object *obj, Eina_Bool size_up, Eina_Bool size_down); + +/** + * Get if the object is (up/down) resizable. + * + * @param obj The image object + * @param size_up A bool to set if the object is resizable up + * @param size_down A bool to set if the object is resizable down + * + * @see elm_image_resizable_set() + * + * @ingroup Image + */ +EAPI void elm_image_resizable_get(const Evas_Object *obj, Eina_Bool *size_up, Eina_Bool *size_down); + +/** + * Set if the image fills the entire object area, when keeping the aspect ratio. + * + * @param obj The image object + * @param fill_outside @c EINA_TRUE if the object is filled outside, + * @c EINA_FALSE otherwise. Default is @c EINA_FALSE. + * + * When the image should keep its aspect ratio even if resized to another + * aspect ratio, there are two possibilities to resize it: keep the entire + * image inside the limits of height and width of the object (@p fill_outside + * is @c EINA_FALSE) or let the extra width or height go outside of the object, + * and the image will fill the entire object (@p fill_outside is @c EINA_TRUE). + * + * @note This option will have no effect if + * elm_image_aspect_fixed_set() is set to @c EINA_FALSE. + * + * @see elm_image_fill_outside_get() + * @see elm_image_aspect_fixed_set() + * + * @ingroup Image + */ +EAPI void elm_image_fill_outside_set(Evas_Object *obj, Eina_Bool fill_outside); + +/** + * Get if the object is filled outside + * + * @param obj The image object + * @return @c EINA_TRUE if the object is filled outside, @c EINA_FALSE otherwise. + * + * @see elm_image_fill_outside_set() + * + * @ingroup Image + */ +EAPI Eina_Bool elm_image_fill_outside_get(const Evas_Object *obj); + +/** + * Enable or disable preloading of the image + * + * @param obj The image object + * @param disabled If EINA_TRUE, preloading will be disabled + * @ingroup Image + */ +EAPI void elm_image_preload_disabled_set(Evas_Object *obj, Eina_Bool disabled); + +/** + * Set the prescale size for the image + * + * @param obj The image object + * @param size The prescale size. This value is used for both width and + * height. + * + * This function sets a new size for pixmap representation of the given + * image. It allows the image to be loaded already in the specified size, + * reducing the memory usage and load time when loading a big image with load + * size set to a smaller size. + * + * It's equivalent to the elm_bg_load_size_set() function for bg. + * + * @note this is just a hint, the real size of the pixmap may differ + * depending on the type of image being loaded, being bigger than requested. + * + * @see elm_image_prescale_get() + * @see elm_bg_load_size_set() + * + * @ingroup Image + */ +EAPI void elm_image_prescale_set(Evas_Object *obj, int size); + +/** + * Get the prescale size for the image + * + * @param obj The image object + * @return The prescale size + * + * @see elm_image_prescale_set() + * + * @ingroup Image + */ +EAPI int elm_image_prescale_get(const Evas_Object *obj); + +/** + * Set the image orientation. + * + * @param obj The image object + * @param orient The image orientation @ref Elm_Image_Orient + * Default is #ELM_IMAGE_ORIENT_NONE. + * + * This function allows to rotate or flip the given image. + * + * @see elm_image_orient_get() + * @see @ref Elm_Image_Orient + * + * @ingroup Image + */ +EAPI void elm_image_orient_set(Evas_Object *obj, Elm_Image_Orient orient); + +/** + * Get the image orientation. + * + * @param obj The image object + * @return The image orientation @ref Elm_Image_Orient + * + * @see elm_image_orient_set() + * @see @ref Elm_Image_Orient + * + * @ingroup Image + */ +EAPI Elm_Image_Orient elm_image_orient_get(const Evas_Object *obj); + +/** + * Make the image 'editable'. + * + * @param obj Image object. + * @param set Turn on or off editability. Default is @c EINA_FALSE. + * + * This means the image is a valid drag target for drag and drop, and can be + * cut or pasted too. + * + * @ingroup Image + */ +EAPI void elm_image_editable_set(Evas_Object *obj, Eina_Bool set); + +/** + * Check if the image is 'editable'. + * + * @param obj Image object. + * @return Editability. + * + * A return value of EINA_TRUE means the image is a valid drag target + * for drag and drop, and can be cut or pasted too. + * + * @ingroup Image + */ +EAPI Eina_Bool elm_image_editable_get(const Evas_Object *obj); + +/** + * Get the inlined image object of the image widget. + * + * @param obj The image object to get the inlined image from + * @return The inlined image object, or NULL if none exists + * + * This function allows one to get the underlying @c Evas_Object of type + * Image from this elementary widget. It can be useful to do things like get + * the pixel data, save the image to a file, etc. + * + * @note Be careful to not manipulate it, as it is under control of + * elementary. + * + * @ingroup Image + */ +EAPI Evas_Object *elm_image_object_get(const Evas_Object *obj); + +/** + * Set whether the original aspect ratio of the image should be kept on resize. + * + * @param obj The image object. + * @param fixed @c EINA_TRUE if the image should retain the aspect, + * @c EINA_FALSE otherwise. + * + * The original aspect ratio (width / height) of the image is usually + * distorted to match the object's size. Enabling this option will retain + * this original aspect, and the way that the image is fit into the object's + * area depends on the option set by elm_image_fill_outside_set(). + * + * @see elm_image_aspect_fixed_get() + * @see elm_image_fill_outside_set() + * + * @ingroup Image + */ +EAPI void elm_image_aspect_fixed_set(Evas_Object *obj, Eina_Bool fixed); + +/** + * Get if the object retains the original aspect ratio. + * + * @param obj The image object. + * @return @c EINA_TRUE if the object keeps the original aspect, @c EINA_FALSE + * otherwise. + * + * @ingroup Image + */ +EAPI Eina_Bool elm_image_aspect_fixed_get(const Evas_Object *obj); + +/** + * Get whether an image object supports animation or not. + * + * @param obj The image object + * @return @c EINA_TRUE if the image supports animation, + * @c EINA_FALSE otherwise. + * + * This function returns if this Elementary image object's internal + * image can be animated. Currently Evas only supports GIF + * animation. If the return value is @b EINA_FALSE, other + * @c elm_image_animated_xxx API calls won't work. + * + * @see elm_image_animated_set() + * + * @ingroup Image + * @since 1.7 + */ +EAPI Eina_Bool elm_image_animated_available_get(const Evas_Object *obj); + +/** + * Set whether an image object (which supports animation) is to + * animate itself or not. + * + * @param obj The image object + + * @param animated @c EINA_TRUE if the object is to animate itself, + * @c EINA_FALSE otherwise. Default is @c EINA_FALSE. + * + * An image object, even if it supports animation, will be displayed + * by default without animation. Call this function with @a animated + * set to @c EINA_TRUE to enable its animation. To start or stop the + * animation, actually, use elm_image_animated_play_set(). + * + * @see elm_image_animated_get() + * @see elm_image_animated_available_get() + * @see elm_image_animated_play_set() + * + * @ingroup Image + * @since 1.7 + */ +EAPI void elm_image_animated_set(Evas_Object *obj, Eina_Bool animated); + +/** + * Get whether an image object has animation enabled or not. + * + * @param obj The image object + * + * @return @c EINA_TRUE if the image has animation enabled, + * @c EINA_FALSE otherwise. + * + * @see elm_image_animated_set() + * + * @ingroup Image + * @since 1.7 + */ +EAPI Eina_Bool elm_image_animated_get(const Evas_Object *obj); + +/** + * Start or stop an image object's animation. + * + * @param obj The image object + * @param play @c EINA_TRUE to start the animation, @c EINA_FALSE + * otherwise. Default is @c EINA_FALSE. + * + * To actually start playing any image object's animation, if it + * supports it, one must do something like: + * + * @code + * if (elm_image_animated_available_get(img)) + * { + * elm_image_animated_set(img, EINA_TRUE); + * elm_image_animated_play_set(img, EINA_TRUE); + * } + * @endcode + * + * elm_image_animated_set() will enable animation on the image, but + * not start it yet. This is the function one uses to start and + * stop animations on image objects. + * + * @see elm_image_animated_available_get() + * @see elm_image_animated_set() + * @see elm_image_animated_play_get() + * + * @ingroup Image + * @since 1.7 + */ +EAPI void elm_image_animated_play_set(Evas_Object *obj, Eina_Bool play); + +/** + * Get whether an image object is under animation or not. + * + * @param obj The image object + * @return @c EINA_TRUE, if the image is being animated, @c EINA_FALSE + * otherwise. + * + * @see elm_image_animated_play_get() + * + * @ingroup Image + * @since 1.7 + */ +EAPI Eina_Bool elm_image_animated_play_get(const Evas_Object *obj); + diff --git a/legacy/elementary/src/lib/elm_index.h b/legacy/elementary/src/lib/elm_index.h index b8197f24cd..db06cd93bb 100644 --- a/legacy/elementary/src/lib/elm_index.h +++ b/legacy/elementary/src/lib/elm_index.h @@ -52,695 +52,18 @@ * @li @ref index_example_02 */ -#define ELM_OBJ_INDEX_CLASS elm_obj_index_class_get() - -const Eo_Class *elm_obj_index_class_get(void) EINA_CONST; - -extern EAPI Eo_Op ELM_OBJ_INDEX_BASE_ID; - -enum -{ - ELM_OBJ_INDEX_SUB_ID_AUTOHIDE_DISABLED_SET, - ELM_OBJ_INDEX_SUB_ID_AUTOHIDE_DISABLED_GET, - ELM_OBJ_INDEX_SUB_ID_ITEM_LEVEL_SET, - ELM_OBJ_INDEX_SUB_ID_ITEM_LEVEL_GET, - ELM_OBJ_INDEX_SUB_ID_SELECTED_ITEM_GET, - ELM_OBJ_INDEX_SUB_ID_ITEM_APPEND, - ELM_OBJ_INDEX_SUB_ID_ITEM_PREPEND, - ELM_OBJ_INDEX_SUB_ID_ITEM_INSERT_AFTER, - ELM_OBJ_INDEX_SUB_ID_ITEM_INSERT_BEFORE, - ELM_OBJ_INDEX_SUB_ID_ITEM_SORTED_INSERT, - ELM_OBJ_INDEX_SUB_ID_ITEM_FIND, - ELM_OBJ_INDEX_SUB_ID_ITEM_CLEAR, - ELM_OBJ_INDEX_SUB_ID_LEVEL_GO, - ELM_OBJ_INDEX_SUB_ID_INDICATOR_DISABLED_SET, - ELM_OBJ_INDEX_SUB_ID_INDICATOR_DISABLED_GET, - ELM_OBJ_INDEX_SUB_ID_HORIZONTAL_SET, - ELM_OBJ_INDEX_SUB_ID_HORIZONTAL_GET, - ELM_OBJ_INDEX_SUB_ID_DELAY_CHANGE_TIME_SET, - ELM_OBJ_INDEX_SUB_ID_DELAY_CHANGE_TIME_GET, - ELM_OBJ_INDEX_SUB_ID_OMIT_ENABLED_SET, - ELM_OBJ_INDEX_SUB_ID_OMIT_ENABLED_GET, - ELM_OBJ_INDEX_SUB_ID_LAST -}; - -#define ELM_OBJ_INDEX_ID(sub_id) (ELM_OBJ_INDEX_BASE_ID + sub_id) - - -/** - * @def elm_obj_index_autohide_disabled_set - * @since 1.8 - * - * Enable or disable auto hiding feature for a given index widget. - * - * @param[in] disabled - * - * @see elm_index_autohide_disabled_set - */ -#define elm_obj_index_autohide_disabled_set(disabled) ELM_OBJ_INDEX_ID(ELM_OBJ_INDEX_SUB_ID_AUTOHIDE_DISABLED_SET), EO_TYPECHECK(Eina_Bool, disabled) - -/** - * @def elm_obj_index_autohide_disabled_get - * @since 1.8 - * - * Get whether auto hiding feature is enabled or not for a given index widget. - * - * @param[out] ret - * - * @see elm_index_autohide_disabled_get - */ -#define elm_obj_index_autohide_disabled_get(ret) ELM_OBJ_INDEX_ID(ELM_OBJ_INDEX_SUB_ID_AUTOHIDE_DISABLED_GET), EO_TYPECHECK(Eina_Bool *, ret) - -/** - * @def elm_obj_index_item_level_set - * @since 1.8 - * - * Set the items level for a given index widget. - * - * @param[in] level - * - * @see elm_index_item_level_set - */ -#define elm_obj_index_item_level_set(level) ELM_OBJ_INDEX_ID(ELM_OBJ_INDEX_SUB_ID_ITEM_LEVEL_SET), EO_TYPECHECK(int, level) - -/** - * @def elm_obj_index_item_level_get - * @since 1.8 - * - * Get the items level set for a given index widget. - * - * @param[out] ret - * - * @see elm_index_item_level_get - */ -#define elm_obj_index_item_level_get(ret) ELM_OBJ_INDEX_ID(ELM_OBJ_INDEX_SUB_ID_ITEM_LEVEL_GET), EO_TYPECHECK(int *, ret) - -/** - * @def elm_obj_index_selected_item_get - * @since 1.8 - * - * Returns the last selected item, for a given index widget. - * - * @param[in] level - * @param[out] ret - * - * @see elm_index_selected_item_get - */ -#define elm_obj_index_selected_item_get(level, ret) ELM_OBJ_INDEX_ID(ELM_OBJ_INDEX_SUB_ID_SELECTED_ITEM_GET), EO_TYPECHECK(int, level), EO_TYPECHECK(Elm_Object_Item **, ret) - -/** - * @def elm_obj_index_item_append - * @since 1.8 - * - * Append a new item on a given index widget. - * - * @param[in] letter - * @param[in] func - * @param[in] data - * @param[out] ret - * - * @see elm_index_item_append - */ -#define elm_obj_index_item_append(letter, func, data, ret) ELM_OBJ_INDEX_ID(ELM_OBJ_INDEX_SUB_ID_ITEM_APPEND), EO_TYPECHECK(const char *, letter), EO_TYPECHECK(Evas_Smart_Cb, func), EO_TYPECHECK(const void *, data), EO_TYPECHECK(Elm_Object_Item **, ret) - -/** - * @def elm_obj_index_item_prepend - * @since 1.8 - * - * Prepend a new item on a given index widget. - * - * @param[in] letter - * @param[in] func - * @param[in] data - * @param[out] ret - * - * @see elm_index_item_prepend - */ -#define elm_obj_index_item_prepend(letter, func, data, ret) ELM_OBJ_INDEX_ID(ELM_OBJ_INDEX_SUB_ID_ITEM_PREPEND), EO_TYPECHECK(const char *, letter), EO_TYPECHECK(Evas_Smart_Cb, func), EO_TYPECHECK(const void *, data), EO_TYPECHECK(Elm_Object_Item **, ret) - -/** - * @def elm_obj_index_item_insert_after - * @since 1.8 - * - * Insert a new item into the index object after item after. - * - * @param[in] after - * @param[in] letter - * @param[in] func - * @param[in] data - * @param[out] ret - * - * @see elm_index_item_insert_after - */ -#define elm_obj_index_item_insert_after(after, letter, func, data, ret) ELM_OBJ_INDEX_ID(ELM_OBJ_INDEX_SUB_ID_ITEM_INSERT_AFTER), EO_TYPECHECK(Elm_Object_Item *, after), EO_TYPECHECK(const char *, letter), EO_TYPECHECK(Evas_Smart_Cb, func), EO_TYPECHECK(const void *, data), EO_TYPECHECK(Elm_Object_Item **, ret) - -/** - * @def elm_obj_index_item_insert_before - * @since 1.8 - * - * Insert a new item into the index object before item before. - * - * @param[in] before - * @param[in] letter - * @param[in] func - * @param[in] data - * @param[out] ret - * - * @see elm_index_item_insert_before - */ -#define elm_obj_index_item_insert_before(before, letter, func, data, ret) ELM_OBJ_INDEX_ID(ELM_OBJ_INDEX_SUB_ID_ITEM_INSERT_BEFORE), EO_TYPECHECK(Elm_Object_Item *, before), EO_TYPECHECK(const char *, letter), EO_TYPECHECK(Evas_Smart_Cb, func), EO_TYPECHECK(const void *, data), EO_TYPECHECK(Elm_Object_Item **, ret) - -/** - * @def elm_obj_index_item_sorted_insert - * @since 1.8 - * - * Insert a new item into the given index widget, using cmp_func - * - * @param[in] letter - * @param[in] func - * @param[in] data - * @param[in] cmp_func - * @param[in] cmp_data_func - * @param[out] ret - * - * @see elm_index_item_sorted_insert - */ -#define elm_obj_index_item_sorted_insert(letter, func, data, cmp_func, cmp_data_func, ret) ELM_OBJ_INDEX_ID(ELM_OBJ_INDEX_SUB_ID_ITEM_SORTED_INSERT), EO_TYPECHECK(const char *, letter), EO_TYPECHECK(Evas_Smart_Cb, func), EO_TYPECHECK(const void *, data), EO_TYPECHECK(Eina_Compare_Cb, cmp_func), EO_TYPECHECK(Eina_Compare_Cb, cmp_data_func), EO_TYPECHECK(Elm_Object_Item **, ret) - -/** - * @def elm_obj_index_item_find - * @since 1.8 - * - * Find a given index widget's item, using item data. - * - * @param[in] data - * @param[out] ret - * - * @see elm_index_item_find - */ -#define elm_obj_index_item_find(data, ret) ELM_OBJ_INDEX_ID(ELM_OBJ_INDEX_SUB_ID_ITEM_FIND), EO_TYPECHECK(const void *, data), EO_TYPECHECK(Elm_Object_Item **, ret) - -/** - * @def elm_obj_index_item_clear - * @since 1.8 - * - * Removes all items from a given index widget. - * - * - * @see elm_index_item_clear - */ -#define elm_obj_index_item_clear() ELM_OBJ_INDEX_ID(ELM_OBJ_INDEX_SUB_ID_ITEM_CLEAR) - -/** - * @def elm_obj_index_level_go - * @since 1.8 - * - * Go to a given items level on a index widget - * - * @param[in] level - * - * @see elm_index_level_go - */ -#define elm_obj_index_level_go(level) ELM_OBJ_INDEX_ID(ELM_OBJ_INDEX_SUB_ID_LEVEL_GO), EO_TYPECHECK(int, level) - -/** - * @def elm_obj_index_indicator_disabled_set - * @since 1.8 - * - * Set the indicator as to be disabled. - * - * @param[in] disabled - * - * @see elm_index_indicator_disabled_set - */ -#define elm_obj_index_indicator_disabled_set(disabled) ELM_OBJ_INDEX_ID(ELM_OBJ_INDEX_SUB_ID_INDICATOR_DISABLED_SET), EO_TYPECHECK(Eina_Bool, disabled) - -/** - * @def elm_obj_index_indicator_disabled_get - * @since 1.8 - * - * Get the value of indicator's disabled status. - * - * @param[out] ret - * - * @see elm_index_indicator_disabled_get - */ -#define elm_obj_index_indicator_disabled_get(ret) ELM_OBJ_INDEX_ID(ELM_OBJ_INDEX_SUB_ID_INDICATOR_DISABLED_GET), EO_TYPECHECK(Eina_Bool *, ret) - -/** - * @def elm_obj_index_horizontal_set - * @since 1.8 - * - * Enable or disable horizontal mode on the index object - * - * @param[in] horizontal - * - * @see elm_index_horizontal_set - */ -#define elm_obj_index_horizontal_set(horizontal) ELM_OBJ_INDEX_ID(ELM_OBJ_INDEX_SUB_ID_HORIZONTAL_SET), EO_TYPECHECK(Eina_Bool, horizontal) - -/** - * @def elm_obj_index_horizontal_get - * @since 1.8 - * - * Get a value whether horizontal mode is enabled or not. - * - * @param[out] ret - * - * @see elm_index_horizontal_get - */ -#define elm_obj_index_horizontal_get(ret) ELM_OBJ_INDEX_ID(ELM_OBJ_INDEX_SUB_ID_HORIZONTAL_GET), EO_TYPECHECK(Eina_Bool *, ret) - -/** - * @def elm_obj_index_delay_change_time_set - * @since 1.8 - * - * Change index delay change time. - * - * @param[in] ret - * - * @see elm_index_delay_change_time_get - */ -#define elm_obj_index_delay_change_time_set(dtime) ELM_OBJ_INDEX_ID(ELM_OBJ_INDEX_SUB_ID_DELAY_CHANGE_TIME_SET), EO_TYPECHECK(double, dtime) - -/** - * @def elm_obj_index_delay_change_time_get - * @since 1.8 - * - * Get index delay change time. - * - * @param[out] ret - * - * @see elm_index_delay_change_time_set - */ -#define elm_obj_index_delay_change_time_get(ret) ELM_OBJ_INDEX_ID(ELM_OBJ_INDEX_SUB_ID_DELAY_CHANGE_TIME_GET), EO_TYPECHECK(double *, ret) - -/** - * @def elm_obj_index_omit_enabled_set - * @since 1.8 - * - * Enable or disable omit feature for a given index widget. - * - * @param[in] enabled - * - * @see elm_index_omit_enabled_set - */ -#define elm_obj_index_omit_enabled_set(enabled) ELM_OBJ_INDEX_ID(ELM_OBJ_INDEX_SUB_ID_OMIT_ENABLED_SET), EO_TYPECHECK(Eina_Bool, enabled) - -/** - * @def elm_obj_index_omit_enabled_get - * @since 1.8 - * - * Get whether omit feature is enabled or not for a given index widget. - * - * @param[out] ret - * - * @see elm_index_omit_enabled_get - */ -#define elm_obj_index_omit_enabled_get(ret) ELM_OBJ_INDEX_ID(ELM_OBJ_INDEX_SUB_ID_OMIT_ENABLED_GET), EO_TYPECHECK(Eina_Bool *, ret) - /** * @addtogroup Index * @{ */ -/** - * Add a new index widget to the given parent Elementary - * (container) object - * - * @param parent The parent object - * @return a new index widget handle or @c NULL, on errors - * - * This function inserts a new index widget on the canvas. - * - * @ingroup Index - */ -EAPI Evas_Object *elm_index_add(Evas_Object *parent); - -/** - * Enable or disable auto hiding feature for a given index widget. - * - * @param obj The index object - * @param disabled @c EINA_TRUE to disable auto hiding, @c EINA_FALSE to enable - * - * @see elm_index_autohide_disabled_get() - * - * @ingroup Index - */ -EAPI void elm_index_autohide_disabled_set(Evas_Object *obj, Eina_Bool disabled); - -/** - * Get whether auto hiding feature is enabled or not for a given index widget. - * - * @param obj The index object - * @return @c EINA_TRUE, if auto hiding is disabled, @c EINA_FALSE otherwise - * - * @see elm_index_autohide_disabled_set() for more details - * - * @ingroup Index - */ -EAPI Eina_Bool elm_index_autohide_disabled_get(const Evas_Object *obj); - -/** - * Set the items level for a given index widget. - * - * @param obj The index object. - * @param level @c 0 or @c 1, the currently implemented levels. - * - * @see elm_index_item_level_get() - * - * @ingroup Index - */ -EAPI void elm_index_item_level_set(Evas_Object *obj, int level); - -/** - * Get the items level set for a given index widget. - * - * @param obj The index object. - * @return @c 0 or @c 1, which are the levels @p obj might be at. - * - * @see elm_index_item_level_set() for more information - * - * @ingroup Index - */ -EAPI int elm_index_item_level_get(const Evas_Object *obj); - -/** - * Set the selected state of an item. - * - * @param it The index item - * @param selected The selected state - * - * This sets the selected state of the given item @p it. - * @c EINA_TRUE for selected, @c EINA_FALSE for not selected. - * - * If a new item is selected the previously selected will be unselected. - * Previously selected item can be get with function - * elm_index_selected_item_get(). - * - * Selected items will be highlighted. - * - * @see elm_index_selected_item_get() - * - * @ingroup Index - */ -EAPI void elm_index_item_selected_set(Elm_Object_Item *it, Eina_Bool selected); - -/** - * Returns the last selected item, for a given index widget. - * - * @param obj The index object. - * @param level @c 0 or @c 1, the currently implemented levels. - * @return The last item @b selected on @p obj (or @c NULL, on errors). - * - * @ingroup Index - */ -EAPI Elm_Object_Item *elm_index_selected_item_get(const Evas_Object *obj, int level); - -/** - * Append a new item on a given index widget. - * - * @param obj The index object. - * @param letter Letter under which the item should be indexed - * @param func The function to call when the item is selected. - * @param data The item data to set for the index's item - * @return A handle to the item added or @c NULL, on errors - * - * Despite the most common usage of the @p letter argument is for - * single char strings, one could use arbitrary strings as index - * entries. - * - * @c item will be the pointer returned back on @c "changed", @c - * "delay,changed" and @c "selected" smart events. - * - * @ingroup Index - */ -EAPI Elm_Object_Item *elm_index_item_append(Evas_Object *obj, const char *letter, Evas_Smart_Cb func, const void *data); - -/** - * Prepend a new item on a given index widget. - * - * @param obj The index object. - * @param letter Letter under which the item should be indexed - * @param func The function to call when the item is selected. - * @param data The item data to set for the index's item - * @return A handle to the item added or @c NULL, on errors - * - * Despite the most common usage of the @p letter argument is for - * single char strings, one could use arbitrary strings as index - * entries. - * - * @c item will be the pointer returned back on @c "changed", @c - * "delay,changed" and @c "selected" smart events. - * - * @ingroup Index - */ -EAPI Elm_Object_Item *elm_index_item_prepend(Evas_Object *obj, const char *letter, Evas_Smart_Cb func, const void *data); - -/** - * Insert a new item into the index object after item @p after. - * - * @param obj The index object. - * @param after The index item to insert after. - * @param letter Letter under which the item should be indexed - * @param func The function to call when the item is clicked. - * @param data The item data to set for the index's item - * @return A handle to the item added or @c NULL, on errors - * - * Despite the most common usage of the @p letter argument is for - * single char strings, one could use arbitrary strings as index - * entries. - * - * @c item will be the pointer returned back on @c "changed", @c - * "delay,changed" and @c "selected" smart events. - * - * @note If @p relative is @c NULL this function will behave as - * elm_index_item_append(). - * - * @ingroup Index - */ -EAPI Elm_Object_Item *elm_index_item_insert_after(Evas_Object *obj, Elm_Object_Item *after, const char *letter, Evas_Smart_Cb func, const void *data); - -/** - * Insert a new item into the index object before item @p before. - * - * @param obj The index object. - * @param before The index item to insert after. - * @param letter Letter under which the item should be indexed - * @param func The function to call when the item is clicked. - * @param data The item data to set for the index's item - * @return A handle to the item added or @c NULL, on errors - * - * Despite the most common usage of the @p letter argument is for - * single char strings, one could use arbitrary strings as index - * entries. - * - * @c item will be the pointer returned back on @c "changed", @c - * "delay,changed" and @c "selected" smart events. - * - * @note If @p relative is @c NULL this function will behave as - * elm_index_item_prepend(). - * - * @ingroup Index - */ -EAPI Elm_Object_Item *elm_index_item_insert_before(Evas_Object *obj, Elm_Object_Item *before, const char *letter, Evas_Smart_Cb func, const void *data); - -/** - * Insert a new item into the given index widget, using @p cmp_func - * function to sort items (by item handles). - * - * @param obj The index object. - * @param letter Letter under which the item should be indexed - * @param func The function to call when the item is clicked. - * @param data The item data to set for the index's item - * @param cmp_func The comparing function to be used to sort index - * items by index item handles - * @param cmp_data_func A @b fallback function to be called for the - * sorting of index items by item data). It will be used - * when @p cmp_func returns @c 0 (equality), which means an index - * item with provided item data already exists. To decide which - * data item should be pointed to by the index item in question, @p - * cmp_data_func will be used. If @p cmp_data_func returns a - * non-negative value, the previous index item data will be - * replaced by the given @p item pointer. If the previous data need - * to be freed, it should be done by the @p cmp_data_func function, - * because all references to it will be lost. If this function is - * not provided (@c NULL is given), index items will be @b - * duplicated, if @p cmp_func returns @c 0. - * @return A handle to the item added or @c NULL, on errors - * - * Despite the most common usage of the @p letter argument is for - * single char strings, one could use arbitrary strings as index - * entries. - * - * @c item will be the pointer returned back on @c "changed", @c - * "delay,changed" and @c "selected" smart events. - * - * @ingroup Index - */ -EAPI Elm_Object_Item *elm_index_item_sorted_insert(Evas_Object *obj, const char *letter, Evas_Smart_Cb func, const void *data, Eina_Compare_Cb cmp_func, Eina_Compare_Cb cmp_data_func); - -/** - * Find a given index widget's item, using item data. - * - * @param obj The index object - * @param data The item data pointed to by the desired index item - * @return The index item handle, if found, or @c NULL otherwise - * - * @ingroup Index - */ -EAPI Elm_Object_Item *elm_index_item_find(Evas_Object *obj, const void *data); - -/** - * Removes @b all items from a given index widget. - * - * @param obj The index object. - * - * If deletion callbacks are set, via elm_object_item_del_cb_set(), - * that callback function will be called for each item in @p obj. - * - * @ingroup Index - */ -EAPI void elm_index_item_clear(Evas_Object *obj); - -/** - * Flush the changes made to the index items so they work correctly - * - * This flushes any changes made to items indicating the object is ready to - * go. You should call this before any changes you expect to work. This - * is similar to elm_list_go(). - * - * @param obj The index object - * @param level The index level (one of @c 0 or @c 1) where changes were made - * - * @warning If not called, it won't display the index properly. - * - * @ingroup Index - */ -EAPI void elm_index_level_go(Evas_Object *obj, int level); - -/** - * Get the letter (string) set on a given index widget item. - * - * @param item The index item handle - * @return The letter string set on @p it - * - * @ingroup Index - */ -EAPI const char *elm_index_item_letter_get(const Elm_Object_Item *item); - -/** - * Set the indicator as to be disabled. - * - * @param obj The index object - * @param disabled @c EINA_TRUE to disable it, @c EINA_FALSE to enable it - * - * In Index widget, Indicator notes popup text, which shows a letter has been selecting. - * - * @see elm_index_indicator_disabled_get() - * - * @ingroup Index - */ -EAPI void elm_index_indicator_disabled_set(Evas_Object *obj, Eina_Bool disabled); - -/** - * Get the value of indicator's disabled status. - * - * @param obj The index object - * @return EINA_TRUE if the indicator is disabled. - * - * @see elm_index_indicator_disabled_set() - * - * @ingroup Index - */ -EAPI Eina_Bool elm_index_indicator_disabled_get(const Evas_Object *obj); - -/** - * Enable or disable horizontal mode on the index object - * - * @param obj The index object. - * @param horizontal @c EINA_TRUE to enable horizontal or @c EINA_FALSE to - * disable it, i.e., to enable vertical mode. it's an area one @ref Fingers - * "finger" wide on the bottom side of the index widget's container. - * - * @note Vertical mode is set by default. - * - * On horizontal mode items are displayed on index from left to right, - * instead of from top to bottom. Also, the index will scroll horizontally. - * - * @see elm_index_horizontal_get() - * - * @ingroup Index - */ -EAPI void elm_index_horizontal_set(Evas_Object *obj, Eina_Bool horizontal); - -/** - * Get a value whether horizontal mode is enabled or not. - * - * @param obj The index object. - * @return @c EINA_TRUE means horizontal mode selection is enabled. - * @c EINA_FALSE indicates it's disabled. If @p obj is @c NULL, - * @c EINA_FALSE is returned. - * - * @see elm_index_horizontal_set() for details. - * - * @ingroup Index - */ -EAPI Eina_Bool elm_index_horizontal_get(const Evas_Object *obj); - -/** - * Set a delay change time for index object. - * - * @param obj The index object. - * @param delay_change_time The delay change time to set. - * - * @note delay time is 0.2 sec by default. - * - * @see elm_index_delay_change_time_get - * - * @ingroup Index - */ -EAPI void elm_index_delay_change_time_set(Evas_Object *obj, double delay_change_time); - -/** - * Get a delay change time for index object. - * - * @param obj The index object. - * @return delay change time in seconds - * - * @see elm_index_delay_change_time_set - * - * @ingroup Index - */ -EAPI double elm_index_delay_change_time_get(const Evas_Object *obj); - -/** - * Enable or disable omit feature for a given index widget. - * - * @param obj The index object - * @param enabled @c EINA_TRUE to enable omit feature, @c EINA_FALSE to disable - * - * @see elm_index_omit_enabled_get() - * - * @since 1.8 - * - * @ingroup Index - */ -EAPI void elm_index_omit_enabled_set(Evas_Object *obj, Eina_Bool enabled); - -/** - * Get whether omit feature is enabled or not for a given index widget. - * - * @param obj The index object - * @return @c EINA_TRUE, if omit feature is enabled, @c EINA_FALSE otherwise - * - * @see elm_index_omit_enabled_set() - * - * @since 1.8 - * - * @ingroup Index - */ -EAPI Eina_Bool elm_index_omit_enabled_get(const Evas_Object *obj); +#include +#ifdef EFL_EO_API_SUPPORT +#include +#endif +#ifndef EFL_NOLEGACY_API_SUPPORT +#include +#endif /** * @} diff --git a/legacy/elementary/src/lib/elm_index_common.h b/legacy/elementary/src/lib/elm_index_common.h new file mode 100644 index 0000000000..ccacf184ba --- /dev/null +++ b/legacy/elementary/src/lib/elm_index_common.h @@ -0,0 +1,21 @@ +/** + * Set the selected state of an item. + * + * @param it The index item + * @param selected The selected state + * + * This sets the selected state of the given item @p it. + * @c EINA_TRUE for selected, @c EINA_FALSE for not selected. + * + * If a new item is selected the previously selected will be unselected. + * Previously selected item can be get with function + * elm_index_selected_item_get(). + * + * Selected items will be highlighted. + * + * @see elm_index_selected_item_get() + * + * @ingroup Index + */ +EAPI void elm_index_item_selected_set(Elm_Object_Item *it, Eina_Bool selected); + diff --git a/legacy/elementary/src/lib/elm_index_eo.h b/legacy/elementary/src/lib/elm_index_eo.h new file mode 100644 index 0000000000..c928e4b795 --- /dev/null +++ b/legacy/elementary/src/lib/elm_index_eo.h @@ -0,0 +1,308 @@ +#define ELM_OBJ_INDEX_CLASS elm_obj_index_class_get() + +const Eo_Class *elm_obj_index_class_get(void) EINA_CONST; + +extern EAPI Eo_Op ELM_OBJ_INDEX_BASE_ID; + +enum +{ + ELM_OBJ_INDEX_SUB_ID_AUTOHIDE_DISABLED_SET, + ELM_OBJ_INDEX_SUB_ID_AUTOHIDE_DISABLED_GET, + ELM_OBJ_INDEX_SUB_ID_ITEM_LEVEL_SET, + ELM_OBJ_INDEX_SUB_ID_ITEM_LEVEL_GET, + ELM_OBJ_INDEX_SUB_ID_SELECTED_ITEM_GET, + ELM_OBJ_INDEX_SUB_ID_ITEM_APPEND, + ELM_OBJ_INDEX_SUB_ID_ITEM_PREPEND, + ELM_OBJ_INDEX_SUB_ID_ITEM_INSERT_AFTER, + ELM_OBJ_INDEX_SUB_ID_ITEM_INSERT_BEFORE, + ELM_OBJ_INDEX_SUB_ID_ITEM_SORTED_INSERT, + ELM_OBJ_INDEX_SUB_ID_ITEM_FIND, + ELM_OBJ_INDEX_SUB_ID_ITEM_CLEAR, + ELM_OBJ_INDEX_SUB_ID_LEVEL_GO, + ELM_OBJ_INDEX_SUB_ID_INDICATOR_DISABLED_SET, + ELM_OBJ_INDEX_SUB_ID_INDICATOR_DISABLED_GET, + ELM_OBJ_INDEX_SUB_ID_HORIZONTAL_SET, + ELM_OBJ_INDEX_SUB_ID_HORIZONTAL_GET, + ELM_OBJ_INDEX_SUB_ID_DELAY_CHANGE_TIME_SET, + ELM_OBJ_INDEX_SUB_ID_DELAY_CHANGE_TIME_GET, + ELM_OBJ_INDEX_SUB_ID_OMIT_ENABLED_SET, + ELM_OBJ_INDEX_SUB_ID_OMIT_ENABLED_GET, + ELM_OBJ_INDEX_SUB_ID_LAST +}; + +#define ELM_OBJ_INDEX_ID(sub_id) (ELM_OBJ_INDEX_BASE_ID + sub_id) + + +/** + * @def elm_obj_index_autohide_disabled_set + * @since 1.8 + * + * Enable or disable auto hiding feature for a given index widget. + * + * @param[in] disabled + * + * @see elm_index_autohide_disabled_set + */ +#define elm_obj_index_autohide_disabled_set(disabled) ELM_OBJ_INDEX_ID(ELM_OBJ_INDEX_SUB_ID_AUTOHIDE_DISABLED_SET), EO_TYPECHECK(Eina_Bool, disabled) + +/** + * @def elm_obj_index_autohide_disabled_get + * @since 1.8 + * + * Get whether auto hiding feature is enabled or not for a given index widget. + * + * @param[out] ret + * + * @see elm_index_autohide_disabled_get + */ +#define elm_obj_index_autohide_disabled_get(ret) ELM_OBJ_INDEX_ID(ELM_OBJ_INDEX_SUB_ID_AUTOHIDE_DISABLED_GET), EO_TYPECHECK(Eina_Bool *, ret) + +/** + * @def elm_obj_index_item_level_set + * @since 1.8 + * + * Set the items level for a given index widget. + * + * @param[in] level + * + * @see elm_index_item_level_set + */ +#define elm_obj_index_item_level_set(level) ELM_OBJ_INDEX_ID(ELM_OBJ_INDEX_SUB_ID_ITEM_LEVEL_SET), EO_TYPECHECK(int, level) + +/** + * @def elm_obj_index_item_level_get + * @since 1.8 + * + * Get the items level set for a given index widget. + * + * @param[out] ret + * + * @see elm_index_item_level_get + */ +#define elm_obj_index_item_level_get(ret) ELM_OBJ_INDEX_ID(ELM_OBJ_INDEX_SUB_ID_ITEM_LEVEL_GET), EO_TYPECHECK(int *, ret) + +/** + * @def elm_obj_index_selected_item_get + * @since 1.8 + * + * Returns the last selected item, for a given index widget. + * + * @param[in] level + * @param[out] ret + * + * @see elm_index_selected_item_get + */ +#define elm_obj_index_selected_item_get(level, ret) ELM_OBJ_INDEX_ID(ELM_OBJ_INDEX_SUB_ID_SELECTED_ITEM_GET), EO_TYPECHECK(int, level), EO_TYPECHECK(Elm_Object_Item **, ret) + +/** + * @def elm_obj_index_item_append + * @since 1.8 + * + * Append a new item on a given index widget. + * + * @param[in] letter + * @param[in] func + * @param[in] data + * @param[out] ret + * + * @see elm_index_item_append + */ +#define elm_obj_index_item_append(letter, func, data, ret) ELM_OBJ_INDEX_ID(ELM_OBJ_INDEX_SUB_ID_ITEM_APPEND), EO_TYPECHECK(const char *, letter), EO_TYPECHECK(Evas_Smart_Cb, func), EO_TYPECHECK(const void *, data), EO_TYPECHECK(Elm_Object_Item **, ret) + +/** + * @def elm_obj_index_item_prepend + * @since 1.8 + * + * Prepend a new item on a given index widget. + * + * @param[in] letter + * @param[in] func + * @param[in] data + * @param[out] ret + * + * @see elm_index_item_prepend + */ +#define elm_obj_index_item_prepend(letter, func, data, ret) ELM_OBJ_INDEX_ID(ELM_OBJ_INDEX_SUB_ID_ITEM_PREPEND), EO_TYPECHECK(const char *, letter), EO_TYPECHECK(Evas_Smart_Cb, func), EO_TYPECHECK(const void *, data), EO_TYPECHECK(Elm_Object_Item **, ret) + +/** + * @def elm_obj_index_item_insert_after + * @since 1.8 + * + * Insert a new item into the index object after item after. + * + * @param[in] after + * @param[in] letter + * @param[in] func + * @param[in] data + * @param[out] ret + * + * @see elm_index_item_insert_after + */ +#define elm_obj_index_item_insert_after(after, letter, func, data, ret) ELM_OBJ_INDEX_ID(ELM_OBJ_INDEX_SUB_ID_ITEM_INSERT_AFTER), EO_TYPECHECK(Elm_Object_Item *, after), EO_TYPECHECK(const char *, letter), EO_TYPECHECK(Evas_Smart_Cb, func), EO_TYPECHECK(const void *, data), EO_TYPECHECK(Elm_Object_Item **, ret) + +/** + * @def elm_obj_index_item_insert_before + * @since 1.8 + * + * Insert a new item into the index object before item before. + * + * @param[in] before + * @param[in] letter + * @param[in] func + * @param[in] data + * @param[out] ret + * + * @see elm_index_item_insert_before + */ +#define elm_obj_index_item_insert_before(before, letter, func, data, ret) ELM_OBJ_INDEX_ID(ELM_OBJ_INDEX_SUB_ID_ITEM_INSERT_BEFORE), EO_TYPECHECK(Elm_Object_Item *, before), EO_TYPECHECK(const char *, letter), EO_TYPECHECK(Evas_Smart_Cb, func), EO_TYPECHECK(const void *, data), EO_TYPECHECK(Elm_Object_Item **, ret) + +/** + * @def elm_obj_index_item_sorted_insert + * @since 1.8 + * + * Insert a new item into the given index widget, using cmp_func + * + * @param[in] letter + * @param[in] func + * @param[in] data + * @param[in] cmp_func + * @param[in] cmp_data_func + * @param[out] ret + * + * @see elm_index_item_sorted_insert + */ +#define elm_obj_index_item_sorted_insert(letter, func, data, cmp_func, cmp_data_func, ret) ELM_OBJ_INDEX_ID(ELM_OBJ_INDEX_SUB_ID_ITEM_SORTED_INSERT), EO_TYPECHECK(const char *, letter), EO_TYPECHECK(Evas_Smart_Cb, func), EO_TYPECHECK(const void *, data), EO_TYPECHECK(Eina_Compare_Cb, cmp_func), EO_TYPECHECK(Eina_Compare_Cb, cmp_data_func), EO_TYPECHECK(Elm_Object_Item **, ret) + +/** + * @def elm_obj_index_item_find + * @since 1.8 + * + * Find a given index widget's item, using item data. + * + * @param[in] data + * @param[out] ret + * + * @see elm_index_item_find + */ +#define elm_obj_index_item_find(data, ret) ELM_OBJ_INDEX_ID(ELM_OBJ_INDEX_SUB_ID_ITEM_FIND), EO_TYPECHECK(const void *, data), EO_TYPECHECK(Elm_Object_Item **, ret) + +/** + * @def elm_obj_index_item_clear + * @since 1.8 + * + * Removes all items from a given index widget. + * + * + * @see elm_index_item_clear + */ +#define elm_obj_index_item_clear() ELM_OBJ_INDEX_ID(ELM_OBJ_INDEX_SUB_ID_ITEM_CLEAR) + +/** + * @def elm_obj_index_level_go + * @since 1.8 + * + * Go to a given items level on a index widget + * + * @param[in] level + * + * @see elm_index_level_go + */ +#define elm_obj_index_level_go(level) ELM_OBJ_INDEX_ID(ELM_OBJ_INDEX_SUB_ID_LEVEL_GO), EO_TYPECHECK(int, level) + +/** + * @def elm_obj_index_indicator_disabled_set + * @since 1.8 + * + * Set the indicator as to be disabled. + * + * @param[in] disabled + * + * @see elm_index_indicator_disabled_set + */ +#define elm_obj_index_indicator_disabled_set(disabled) ELM_OBJ_INDEX_ID(ELM_OBJ_INDEX_SUB_ID_INDICATOR_DISABLED_SET), EO_TYPECHECK(Eina_Bool, disabled) + +/** + * @def elm_obj_index_indicator_disabled_get + * @since 1.8 + * + * Get the value of indicator's disabled status. + * + * @param[out] ret + * + * @see elm_index_indicator_disabled_get + */ +#define elm_obj_index_indicator_disabled_get(ret) ELM_OBJ_INDEX_ID(ELM_OBJ_INDEX_SUB_ID_INDICATOR_DISABLED_GET), EO_TYPECHECK(Eina_Bool *, ret) + +/** + * @def elm_obj_index_horizontal_set + * @since 1.8 + * + * Enable or disable horizontal mode on the index object + * + * @param[in] horizontal + * + * @see elm_index_horizontal_set + */ +#define elm_obj_index_horizontal_set(horizontal) ELM_OBJ_INDEX_ID(ELM_OBJ_INDEX_SUB_ID_HORIZONTAL_SET), EO_TYPECHECK(Eina_Bool, horizontal) + +/** + * @def elm_obj_index_horizontal_get + * @since 1.8 + * + * Get a value whether horizontal mode is enabled or not. + * + * @param[out] ret + * + * @see elm_index_horizontal_get + */ +#define elm_obj_index_horizontal_get(ret) ELM_OBJ_INDEX_ID(ELM_OBJ_INDEX_SUB_ID_HORIZONTAL_GET), EO_TYPECHECK(Eina_Bool *, ret) + +/** + * @def elm_obj_index_delay_change_time_set + * @since 1.8 + * + * Change index delay change time. + * + * @param[in] ret + * + * @see elm_index_delay_change_time_get + */ +#define elm_obj_index_delay_change_time_set(dtime) ELM_OBJ_INDEX_ID(ELM_OBJ_INDEX_SUB_ID_DELAY_CHANGE_TIME_SET), EO_TYPECHECK(double, dtime) + +/** + * @def elm_obj_index_delay_change_time_get + * @since 1.8 + * + * Get index delay change time. + * + * @param[out] ret + * + * @see elm_index_delay_change_time_set + */ +#define elm_obj_index_delay_change_time_get(ret) ELM_OBJ_INDEX_ID(ELM_OBJ_INDEX_SUB_ID_DELAY_CHANGE_TIME_GET), EO_TYPECHECK(double *, ret) + +/** + * @def elm_obj_index_omit_enabled_set + * @since 1.8 + * + * Enable or disable omit feature for a given index widget. + * + * @param[in] enabled + * + * @see elm_index_omit_enabled_set + */ +#define elm_obj_index_omit_enabled_set(enabled) ELM_OBJ_INDEX_ID(ELM_OBJ_INDEX_SUB_ID_OMIT_ENABLED_SET), EO_TYPECHECK(Eina_Bool, enabled) + +/** + * @def elm_obj_index_omit_enabled_get + * @since 1.8 + * + * Get whether omit feature is enabled or not for a given index widget. + * + * @param[out] ret + * + * @see elm_index_omit_enabled_get + */ +#define elm_obj_index_omit_enabled_get(ret) ELM_OBJ_INDEX_ID(ELM_OBJ_INDEX_SUB_ID_OMIT_ENABLED_GET), EO_TYPECHECK(Eina_Bool *, ret) + + diff --git a/legacy/elementary/src/lib/elm_index_legacy.h b/legacy/elementary/src/lib/elm_index_legacy.h new file mode 100644 index 0000000000..6c1a025bb5 --- /dev/null +++ b/legacy/elementary/src/lib/elm_index_legacy.h @@ -0,0 +1,357 @@ +/** + * Add a new index widget to the given parent Elementary + * (container) object + * + * @param parent The parent object + * @return a new index widget handle or @c NULL, on errors + * + * This function inserts a new index widget on the canvas. + * + * @ingroup Index + */ +EAPI Evas_Object *elm_index_add(Evas_Object *parent); + +/** + * Enable or disable auto hiding feature for a given index widget. + * + * @param obj The index object + * @param disabled @c EINA_TRUE to disable auto hiding, @c EINA_FALSE to enable + * + * @see elm_index_autohide_disabled_get() + * + * @ingroup Index + */ +EAPI void elm_index_autohide_disabled_set(Evas_Object *obj, Eina_Bool disabled); + +/** + * Get whether auto hiding feature is enabled or not for a given index widget. + * + * @param obj The index object + * @return @c EINA_TRUE, if auto hiding is disabled, @c EINA_FALSE otherwise + * + * @see elm_index_autohide_disabled_set() for more details + * + * @ingroup Index + */ +EAPI Eina_Bool elm_index_autohide_disabled_get(const Evas_Object *obj); + +/** + * Set the items level for a given index widget. + * + * @param obj The index object. + * @param level @c 0 or @c 1, the currently implemented levels. + * + * @see elm_index_item_level_get() + * + * @ingroup Index + */ +EAPI void elm_index_item_level_set(Evas_Object *obj, int level); + +/** + * Get the items level set for a given index widget. + * + * @param obj The index object. + * @return @c 0 or @c 1, which are the levels @p obj might be at. + * + * @see elm_index_item_level_set() for more information + * + * @ingroup Index + */ +EAPI int elm_index_item_level_get(const Evas_Object *obj); + +/** + * Returns the last selected item, for a given index widget. + * + * @param obj The index object. + * @param level @c 0 or @c 1, the currently implemented levels. + * @return The last item @b selected on @p obj (or @c NULL, on errors). + * + * @ingroup Index + */ +EAPI Elm_Object_Item *elm_index_selected_item_get(const Evas_Object *obj, int level); + +/** + * Append a new item on a given index widget. + * + * @param obj The index object. + * @param letter Letter under which the item should be indexed + * @param func The function to call when the item is selected. + * @param data The item data to set for the index's item + * @return A handle to the item added or @c NULL, on errors + * + * Despite the most common usage of the @p letter argument is for + * single char strings, one could use arbitrary strings as index + * entries. + * + * @c item will be the pointer returned back on @c "changed", @c + * "delay,changed" and @c "selected" smart events. + * + * @ingroup Index + */ +EAPI Elm_Object_Item *elm_index_item_append(Evas_Object *obj, const char *letter, Evas_Smart_Cb func, const void *data); + +/** + * Prepend a new item on a given index widget. + * + * @param obj The index object. + * @param letter Letter under which the item should be indexed + * @param func The function to call when the item is selected. + * @param data The item data to set for the index's item + * @return A handle to the item added or @c NULL, on errors + * + * Despite the most common usage of the @p letter argument is for + * single char strings, one could use arbitrary strings as index + * entries. + * + * @c item will be the pointer returned back on @c "changed", @c + * "delay,changed" and @c "selected" smart events. + * + * @ingroup Index + */ +EAPI Elm_Object_Item *elm_index_item_prepend(Evas_Object *obj, const char *letter, Evas_Smart_Cb func, const void *data); + +/** + * Insert a new item into the index object after item @p after. + * + * @param obj The index object. + * @param after The index item to insert after. + * @param letter Letter under which the item should be indexed + * @param func The function to call when the item is clicked. + * @param data The item data to set for the index's item + * @return A handle to the item added or @c NULL, on errors + * + * Despite the most common usage of the @p letter argument is for + * single char strings, one could use arbitrary strings as index + * entries. + * + * @c item will be the pointer returned back on @c "changed", @c + * "delay,changed" and @c "selected" smart events. + * + * @note If @p relative is @c NULL this function will behave as + * elm_index_item_append(). + * + * @ingroup Index + */ +EAPI Elm_Object_Item *elm_index_item_insert_after(Evas_Object *obj, Elm_Object_Item *after, const char *letter, Evas_Smart_Cb func, const void *data); + +/** + * Insert a new item into the index object before item @p before. + * + * @param obj The index object. + * @param before The index item to insert after. + * @param letter Letter under which the item should be indexed + * @param func The function to call when the item is clicked. + * @param data The item data to set for the index's item + * @return A handle to the item added or @c NULL, on errors + * + * Despite the most common usage of the @p letter argument is for + * single char strings, one could use arbitrary strings as index + * entries. + * + * @c item will be the pointer returned back on @c "changed", @c + * "delay,changed" and @c "selected" smart events. + * + * @note If @p relative is @c NULL this function will behave as + * elm_index_item_prepend(). + * + * @ingroup Index + */ +EAPI Elm_Object_Item *elm_index_item_insert_before(Evas_Object *obj, Elm_Object_Item *before, const char *letter, Evas_Smart_Cb func, const void *data); + +/** + * Insert a new item into the given index widget, using @p cmp_func + * function to sort items (by item handles). + * + * @param obj The index object. + * @param letter Letter under which the item should be indexed + * @param func The function to call when the item is clicked. + * @param data The item data to set for the index's item + * @param cmp_func The comparing function to be used to sort index + * items by index item handles + * @param cmp_data_func A @b fallback function to be called for the + * sorting of index items by item data). It will be used + * when @p cmp_func returns @c 0 (equality), which means an index + * item with provided item data already exists. To decide which + * data item should be pointed to by the index item in question, @p + * cmp_data_func will be used. If @p cmp_data_func returns a + * non-negative value, the previous index item data will be + * replaced by the given @p item pointer. If the previous data need + * to be freed, it should be done by the @p cmp_data_func function, + * because all references to it will be lost. If this function is + * not provided (@c NULL is given), index items will be @b + * duplicated, if @p cmp_func returns @c 0. + * @return A handle to the item added or @c NULL, on errors + * + * Despite the most common usage of the @p letter argument is for + * single char strings, one could use arbitrary strings as index + * entries. + * + * @c item will be the pointer returned back on @c "changed", @c + * "delay,changed" and @c "selected" smart events. + * + * @ingroup Index + */ +EAPI Elm_Object_Item *elm_index_item_sorted_insert(Evas_Object *obj, const char *letter, Evas_Smart_Cb func, const void *data, Eina_Compare_Cb cmp_func, Eina_Compare_Cb cmp_data_func); + +/** + * Find a given index widget's item, using item data. + * + * @param obj The index object + * @param data The item data pointed to by the desired index item + * @return The index item handle, if found, or @c NULL otherwise + * + * @ingroup Index + */ +EAPI Elm_Object_Item *elm_index_item_find(Evas_Object *obj, const void *data); + +/** + * Removes @b all items from a given index widget. + * + * @param obj The index object. + * + * If deletion callbacks are set, via elm_object_item_del_cb_set(), + * that callback function will be called for each item in @p obj. + * + * @ingroup Index + */ +EAPI void elm_index_item_clear(Evas_Object *obj); + +/** + * Flush the changes made to the index items so they work correctly + * + * This flushes any changes made to items indicating the object is ready to + * go. You should call this before any changes you expect to work. This + * is similar to elm_list_go(). + * + * @param obj The index object + * @param level The index level (one of @c 0 or @c 1) where changes were made + * + * @warning If not called, it won't display the index properly. + * + * @ingroup Index + */ +EAPI void elm_index_level_go(Evas_Object *obj, int level); + +/** + * Get the letter (string) set on a given index widget item. + * + * @param item The index item handle + * @return The letter string set on @p it + * + * @ingroup Index + */ +EAPI const char *elm_index_item_letter_get(const Elm_Object_Item *item); + +/** + * Set the indicator as to be disabled. + * + * @param obj The index object + * @param disabled @c EINA_TRUE to disable it, @c EINA_FALSE to enable it + * + * In Index widget, Indicator notes popup text, which shows a letter has been selecting. + * + * @see elm_index_indicator_disabled_get() + * + * @ingroup Index + */ +EAPI void elm_index_indicator_disabled_set(Evas_Object *obj, Eina_Bool disabled); + +/** + * Get the value of indicator's disabled status. + * + * @param obj The index object + * @return EINA_TRUE if the indicator is disabled. + * + * @see elm_index_indicator_disabled_set() + * + * @ingroup Index + */ +EAPI Eina_Bool elm_index_indicator_disabled_get(const Evas_Object *obj); + +/** + * Enable or disable horizontal mode on the index object + * + * @param obj The index object. + * @param horizontal @c EINA_TRUE to enable horizontal or @c EINA_FALSE to + * disable it, i.e., to enable vertical mode. it's an area one @ref Fingers + * "finger" wide on the bottom side of the index widget's container. + * + * @note Vertical mode is set by default. + * + * On horizontal mode items are displayed on index from left to right, + * instead of from top to bottom. Also, the index will scroll horizontally. + * + * @see elm_index_horizontal_get() + * + * @ingroup Index + */ +EAPI void elm_index_horizontal_set(Evas_Object *obj, Eina_Bool horizontal); + +/** + * Get a value whether horizontal mode is enabled or not. + * + * @param obj The index object. + * @return @c EINA_TRUE means horizontal mode selection is enabled. + * @c EINA_FALSE indicates it's disabled. If @p obj is @c NULL, + * @c EINA_FALSE is returned. + * + * @see elm_index_horizontal_set() for details. + * + * @ingroup Index + */ +EAPI Eina_Bool elm_index_horizontal_get(const Evas_Object *obj); + +/** + * Set a delay change time for index object. + * + * @param obj The index object. + * @param delay_change_time The delay change time to set. + * + * @note delay time is 0.2 sec by default. + * + * @see elm_index_delay_change_time_get + * + * @ingroup Index + */ +EAPI void elm_index_delay_change_time_set(Evas_Object *obj, double delay_change_time); + +/** + * Get a delay change time for index object. + * + * @param obj The index object. + * @return delay change time in seconds + * + * @see elm_index_delay_change_time_set + * + * @ingroup Index + */ +EAPI double elm_index_delay_change_time_get(const Evas_Object *obj); + +/** + * Enable or disable omit feature for a given index widget. + * + * @param obj The index object + * @param enabled @c EINA_TRUE to enable omit feature, @c EINA_FALSE to disable + * + * @see elm_index_omit_enabled_get() + * + * @since 1.8 + * + * @ingroup Index + */ +EAPI void elm_index_omit_enabled_set(Evas_Object *obj, Eina_Bool enabled); + +/** + * Get whether omit feature is enabled or not for a given index widget. + * + * @param obj The index object + * @return @c EINA_TRUE, if omit feature is enabled, @c EINA_FALSE otherwise + * + * @see elm_index_omit_enabled_set() + * + * @since 1.8 + * + * @ingroup Index + */ +EAPI Eina_Bool elm_index_omit_enabled_get(const Evas_Object *obj); +