![]() |
![]() |
![]() |
![]() |
TeplWidgetListCategory — A category of TeplWidgetListItem's
This API is in a draft state and is incomplete.
A TeplWidgetListCategory object contains:
A name.
A list of TeplWidgetListItem's.
The main idea is to put several TeplWidgetListItem's in a list. The usual
case is to have a single list, with TEPL_WIDGET_LIST_CATEGORY_DEFAULT
. But
it's possible to categorize the items, for example to distinguish between
core components (always there) and plugins components, with
TEPL_WIDGET_LIST_CATEGORY_CORE
and TEPL_WIDGET_LIST_CATEGORY_PLUGINS
. But
the name of a category is a simple string, so other schemes are possible too.
The use-case for distinguishing between core components and plugins components is to clearly show in the UI that it comes from a plugin. For sorting the items too: first show core components (sorted alphabetically by title for example), then plugins components. If there are no plugins components, show an empty state icon.
TeplWidgetListCategory *
tepl_widget_list_category_new (const gchar *name
);
[skip]
Since: 6.4
void
tepl_widget_list_category_free (TeplWidgetListCategory *category
);
Since: 6.4
const gchar *
tepl_widget_list_category_get_name (const TeplWidgetListCategory *category
);
Since: 6.4
void tepl_widget_list_category_add_item (TeplWidgetListCategory *category
,TeplWidgetListItem *item
);
Since: 6.4
GList *
tepl_widget_list_category_get_all (TeplWidgetListCategory *category
);
the list of items
that are part of category
.
[transfer none][element-type TeplWidgetListItem]
Since: 6.4
#define TEPL_WIDGET_LIST_CATEGORY_CORE "core"
A category name for core components.
Usually used in combination with TEPL_WIDGET_LIST_CATEGORY_PLUGINS
to
distinguish between the two.
Since: 6.4
#define TEPL_WIDGET_LIST_CATEGORY_DEFAULT "default"
A category name, used as a default.
Usually used when only a single list is preferred.
Since: 6.4
#define TEPL_WIDGET_LIST_CATEGORY_PLUGINS "plugins"
A category name for plugins components.
Usually used in combination with TEPL_WIDGET_LIST_CATEGORY_CORE
to
distinguish between the two.
Since: 6.4