diff --git a/legacy/elementary/src/lib/elm_genlist.c b/legacy/elementary/src/lib/elm_genlist.c index ccb21cdbf9..9683ec2a0b 100644 --- a/legacy/elementary/src/lib/elm_genlist.c +++ b/legacy/elementary/src/lib/elm_genlist.c @@ -6127,6 +6127,15 @@ elm_genlist_item_parent_get(const Elm_Object_Item *it) return (Elm_Object_Item *)((Elm_Gen_Item *)it)->parent; } +EAPI unsigned int +elm_genlist_item_subitems_count(const Elm_Object_Item *it) +{ + Elm_Gen_Item *item = (Elm_Gen_Item *)it; + ELM_GENLIST_ITEM_CHECK_OR_RETURN(it, 0); + + return eina_list_count(item->item->items); +} + EAPI void elm_genlist_item_subitems_clear(Elm_Object_Item *item) { diff --git a/legacy/elementary/src/lib/elm_genlist_common.h b/legacy/elementary/src/lib/elm_genlist_common.h index 2d860ee188..8ce45933d5 100644 --- a/legacy/elementary/src/lib/elm_genlist_common.h +++ b/legacy/elementary/src/lib/elm_genlist_common.h @@ -558,6 +558,18 @@ EAPI Eina_Bool elm_genlist_item_cursor_engine_only_get(const */ EAPI Elm_Object_Item *elm_genlist_item_parent_get(const Elm_Object_Item *it); +/** + * Get the number of subitems of a given item + * + * @param it The item + * @return The number of subitems, 0 on error + * + * This returns the number of subitems that an item possesses. + * + * @since 1.9 + * @ingroup Genlist + */ +EAPI unsigned int elm_genlist_item_subitems_count(const Elm_Object_Item *it); /** * Remove all sub-items (children) of the given item *