elm_object_signal_emit(VIEW(it), emission, source);
}
+static void
+_item_style_set_hook(Elm_Object_Item *it,
+ const char *style)
+{
+ if (VIEW(it))
+ elm_object_style_set(VIEW(it), style);
+}
+
+static const char *
+_item_style_get_hook(Elm_Object_Item *it)
+{
+ if (VIEW(it))
+ return elm_object_style_get(VIEW(it));
+ return NULL;
+}
+
static Eina_Bool
_item_del_pre_hook(Elm_Object_Item *it)
{
elm_widget_item_del_pre_hook_set(item, _item_del_pre_hook);
elm_widget_item_text_get_hook_set(item, _item_text_get_hook);
elm_widget_item_signal_emit_hook_set(item, _item_signal_emit_hook);
+ elm_widget_item_style_set_hook_set(item, _item_style_set_hook);
+ elm_widget_item_style_get_hook_set(item, _item_style_get_hook);
item->label = eina_stringshare_add(label);
item->icon_file = eina_stringshare_add(icon_file);
* @li elm_object_item_del
* @li elm_object_item_part_text_get
* @li elm_object_item_signal_emit - this works only when the item is created.
+ * @li elm_object_item_style_set - this works only when the item is created.
+ * @li elm_object_item_style_get - this works only when the item is created.
*
* See @ref tutorial_hoversel for an example.
* @{
return _elm_widget_item_signal_callback_del((Elm_Widget_Item *)it, emission, source, (Elm_Widget_Item_Signal_Cb) func);
}
+EAPI void
+elm_object_item_style_set(Elm_Object_Item *it, const char *style)
+{
+ elm_widget_item_style_set(it, style);
+}
+
+EAPI const char *
+elm_object_item_style_get(Elm_Object_Item *it)
+{
+ return elm_widget_item_style_get(it);
+}
+
EAPI void elm_object_item_disabled_set(Elm_Object_Item *it, Eina_Bool disabled)
{
_elm_widget_item_disabled_set((Elm_Widget_Item *)it, disabled);
*/
EAPI int elm_object_item_track_get(const Elm_Object_Item *it);
+/**
+ * Set a style of an object item
+ *
+ * @param it The Elementary object item
+ * @param part The style
+ *
+ * @ingroup General
+ */
+EAPI void elm_object_item_style_set(Elm_Object_Item *it, const char *part);
+
+/**
+ * Get the style of an object item
+ *
+ * @param it The Elementary object item
+ * @return The style of object item
+ *
+ * @ingroup General
+ */
+EAPI const char *elm_object_item_style_get(Elm_Object_Item *it);
ELM_WIDGET_ITEM_CHECK_OR_RETURN(item);
item->del_pre_func = func;
}
+/**
+ * @internal
+ *
+ * Set the function to set the style of item
+ *
+ * @param item a valid #Elm_Widget_Item to be notified
+ * @see elm_widget_item_style_set_hook_set() convenience macro.
+ * @ingroup Widget
+ */
+EAPI void
+_elm_widget_item_style_set_hook_set(Elm_Widget_Item *item,
+ Elm_Widget_Style_Set_Cb func)
+{
+ ELM_WIDGET_ITEM_CHECK_OR_RETURN(item);
+ item->style_set_func = func;
+}
/**
* @internal
*
+ * Set the function to get the style of item
+ *
+ * @param item a valid #Elm_Widget_Item to be notified
+ * @see elm_widget_item_style_get_hook_set() convenience macro.
+ * @ingroup Widget
+ */
+EAPI void
+_elm_widget_item_style_get_hook_set(Elm_Widget_Item *item,
+ Elm_Widget_Style_Get_Cb func)
+{
+ ELM_WIDGET_ITEM_CHECK_OR_RETURN(item);
+ item->style_get_func = func;
+}
+/**
+ * @internal
+ *
* Notify object will be deleted without actually deleting it.
*
* This function will callback Elm_Widget_Item::del_cb if it is set
}
EAPI void
+_elm_widget_item_style_set(Elm_Widget_Item *item, const char *style)
+{
+ ELM_WIDGET_ITEM_CHECK_OR_RETURN(item);
+ item->style_set_func(item, style);
+}
+
+EAPI const char *
+_elm_widget_item_style_get(Elm_Widget_Item *item)
+{
+ ELM_WIDGET_ITEM_CHECK_OR_RETURN(item, NULL);
+ return item->style_get_func(item);
+}
+
+EAPI void
_elm_widget_item_disable_hook_set(Elm_Widget_Item *item,
Elm_Widget_Disable_Cb func)
{
typedef void (*Elm_Widget_Disable_Cb)(void *data);
typedef Eina_Bool (*Elm_Widget_Del_Pre_Cb)(void *data);
typedef void (*Elm_Widget_Item_Signal_Cb)(void *data, Elm_Widget_Item *item, const char *emission, const char *source);
+typedef void (*Elm_Widget_Style_Set_Cb)(void *data, const char *style);
+typedef const char *(*Elm_Widget_Style_Get_Cb)(const void *data);
#define ELM_ACCESS_DONE -1 /* sentence done - send done event here */
#define ELM_ACCESS_CANCEL -2 /* stop reading immediately */
Elm_Widget_Text_Get_Cb text_get_func;
Elm_Widget_Signal_Emit_Cb signal_emit_func;
Elm_Widget_Disable_Cb disable_func;
+ Elm_Widget_Style_Set_Cb style_set_func;
+ Elm_Widget_Style_Get_Cb style_get_func;
Evas_Object *access_obj;
const char *access_info;
Eina_List *access_order;
EAPI const char *_elm_widget_item_part_text_custom_get(Elm_Widget_Item *item, const char *part);
EAPI void _elm_widget_item_part_text_custom_update(Elm_Widget_Item *item);
+EAPI void _elm_widget_item_style_set(Elm_Widget_Item *item, const char *style);
+EAPI const char *_elm_widget_item_style_get(Elm_Widget_Item *item);
+
EAPI void _elm_widget_item_signal_callback_add(Elm_Widget_Item *item, const char *emission, const char *source, Elm_Widget_Item_Signal_Cb func, void *data);
EAPI void *_elm_widget_item_signal_callback_del(Elm_Widget_Item *it, const char *emission, const char *source, Elm_Widget_Item_Signal_Cb func);
EAPI void _elm_widget_item_signal_emit(Elm_Widget_Item *item, const char *emission, const char *source);
EAPI Eina_Bool _elm_widget_item_disabled_get(const Elm_Widget_Item *item);
EAPI void _elm_widget_item_disable_hook_set(Elm_Widget_Item *item, Elm_Widget_Disable_Cb func);
EAPI void _elm_widget_item_del_pre_hook_set(Elm_Widget_Item *item, Elm_Widget_Del_Pre_Cb func);
+EAPI void _elm_widget_item_style_set_hook_set(Elm_Widget_Item *item, Elm_Widget_Style_Set_Cb func);
+EAPI void _elm_widget_item_style_get_hook_set(Elm_Widget_Item *item, Elm_Widget_Style_Get_Cb func);
EAPI void _elm_widget_item_domain_translatable_part_text_set(Elm_Widget_Item *item, const char *part, const char *domain, const char *label);
EAPI const char * _elm_widget_item_translatable_part_text_get(const Elm_Widget_Item *item, const char *part);
EAPI void _elm_widget_item_translate(Elm_Widget_Item *item);
*/
#define elm_widget_item_del_pre_hook_set(item, func) \
_elm_widget_item_del_pre_hook_set((Elm_Widget_Item *)item, (Elm_Widget_Del_Pre_Cb)func)
+/**
+ * Convenience function to query style set hook.
+ * @see _elm_widget_item_style_set_hook_set()
+ */
+#define elm_widget_item_style_set_hook_set(item, func) \
+ _elm_widget_item_style_set_hook_set((Elm_Widget_Item *)item, (Elm_Widget_Style_Set_Cb)func)
+/**
+ * Convenience function to query style get hook.
+ * @see _elm_widget_item_style_get_hook_set()
+ */
+#define elm_widget_item_style_get_hook_set(item, func) \
+ _elm_widget_item_style_get_hook_set((Elm_Widget_Item *)item, (Elm_Widget_Style_Get_Cb)func)
/**
+ * Convenience function to set style .
+ * @see _elm_widget_item_style_set()
+ */
+#define elm_widget_item_style_set(item, style) \
+ _elm_widget_item_style_set((Elm_Widget_Item *)item, style)
+/**
+ * Convenience function to get style .
+ * @see _elm_widget_item_style_get()
+ */
+#define elm_widget_item_style_get(item) \
+ _elm_widget_item_style_get((Elm_Widget_Item *)item)
+/**
* Convenience function to query track_cancel.
* @see _elm_widget_item_del_pre_hook_set()
*/