#define elm_object_content_unset(obj) elm_object_part_content_unset((obj), NULL)
/**
+ * Set the text to read out when in accessibility mode
+ *
+ * @param obj The object which is to be described
+ * @param txt The text that describes the widget to people with poor or no vision
+ *
+ * @ingroup General
+ */
+ EAPI void elm_object_access_info_set(Evas_Object *obj, const char *txt);
+
+ /**
* Get the widget object's handle which contains a given item
*
* @param item The Elementary object item
/**
* Set the text to read out when in accessibility mode
*
- * @param obj The object which is to be described
- * @param txt The text that describes the widget to people with poor or no vision
- *
- * @ingroup General
- */
- EAPI void elm_object_access_info_set(Evas_Object *obj, const char *txt);
-
- /**
- * Set the text to read out when in accessibility mode
- *
* @param it The object item which is to be described
* @param txt The text that describes the widget to people with poor or no vision
*
* @param source The signal's source.
* @ingroup General
*/
- EAPI void elm_object_item_signal_emit(Elm_Object_Item *it, const char *emission, const char *source) EINA_ARG_NONNULL(1);
+ EAPI void elm_object_item_signal_emit(Elm_Object_Item *it, const char *emission, const char *source) EINA_ARG_NONNULL(1);
+
+ /**
+ * Set the disabled state of an widget item.
+ *
+ * @param obj The Elementary object item
+ * @param disabled The state to put in in: @c EINA_TRUE for
+ * disabled, @c EINA_FALSE for enabled
+ *
+ * Elementary object item can be @b disabled, in which state they won't
+ * receive input and, in general, will be themed differently from
+ * their normal state, usually greyed out. Useful for contexts
+ * where you don't want your users to interact with some of the
+ * parts of you interface.
+ *
+ * This sets the state for the widget item, either disabling it or
+ * enabling it back.
+ *
+ * @ingroup Styles
+ */
+ EAPI void elm_object_item_disabled_set(Elm_Object_Item *it, Eina_Bool disabled) EINA_ARG_NONNULL(1);
+
+ /**
+ * Get the disabled state of an widget item.
+ *
+ * @param obj The Elementary object
+ * @return @c EINA_TRUE, if the widget item is disabled, @c EINA_FALSE
+ * if it's enabled (or on errors)
+ *
+ * This gets the state of the widget, which might be enabled or disabled.
+ *
+ * @ingroup Styles
+ */
+ EAPI Eina_Bool elm_object_item_disabled_get(const Elm_Object_Item *it) EINA_ARG_NONNULL(1);
/**
* @}
_elm_widget_item_access_info_set((Elm_Widget_Item *)it, txt);
}
+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 Eina_Bool elm_object_item_disabled_get(const Elm_Object_Item *it)
+{
+ return _elm_widget_item_disabled_get((Elm_Widget_Item *) it);
+}
+
return (void *)item->data;
}
+EAPI void
+_elm_widget_item_disabled_set(Elm_Widget_Item *item, Eina_Bool disabled)
+{
+ ELM_WIDGET_ITEM_CHECK_OR_RETURN(item);
+
+ if (item->disabled == disabled) return;
+ item->disabled = !!disabled;
+ if (item->disable_func) item->disable_func(item);
+}
+
+EAPI Eina_Bool
+_elm_widget_item_disabled_get(const Elm_Widget_Item *item)
+{
+ ELM_WIDGET_ITEM_CHECK_OR_RETURN(item, EINA_FALSE);
+ return item->disabled;
+}
+
+EAPI void
+_elm_widget_item_disable_set_hook_set(Elm_Widget_Item *item,
+ Elm_Widget_On_Disable_Set_Cb func)
+{
+ ELM_WIDGET_ITEM_CHECK_OR_RETURN(item);
+ item->disable_func = func;
+}
+
typedef struct _Elm_Widget_Item_Tooltip Elm_Widget_Item_Tooltip;
struct _Elm_Widget_Item_Tooltip
typedef Evas_Object *(*Elm_Widget_On_Content_Get_Cb)(const void *data, const char *part);
typedef Evas_Object *(*Elm_Widget_On_Content_Unset_Cb)(const void *data, const char *part);
typedef void (*Elm_Widget_On_Signal_Emit_Cb)(void *data, const char *emission, const char *source);
+typedef void (*Elm_Widget_On_Disable_Set_Cb)(void *data);
+
#define ELM_ACCESS_TYPE 0 // when reading out widget or item this is read first
#define ELM_ACCESS_INFO 1 // next read is info - this is normally label
Elm_Widget_On_Text_Set_Cb on_text_set_func;
Elm_Widget_On_Text_Get_Cb on_text_get_func;
Elm_Widget_On_Signal_Emit_Cb on_signal_emit_func;
+ Elm_Widget_On_Disable_Set_Cb disable_func;
Elm_Access_Info *access;
const char *access_info;
+ Eina_Bool disabled: 1;
/* widget variations should have data from here and on */
/* @todo: TODO check if this is enough for 1.0 release, maybe add padding! */
};
EAPI void _elm_widget_item_text_get_hook_set(Elm_Widget_Item *item, Elm_Widget_On_Text_Get_Cb func);
EAPI void _elm_widget_item_signal_emit_hook_set(Elm_Widget_Item *it, Elm_Widget_On_Signal_Emit_Cb func);
EAPI void _elm_widget_item_access_info_set(Elm_Widget_Item *item, const char *txt);
+EAPI void _elm_widget_item_disabled_set(Elm_Widget_Item *item, Eina_Bool disabled);
+EAPI Eina_Bool _elm_widget_item_disabled_get(const Elm_Widget_Item *item);
+EAPI void _elm_widget_item_disable_set_hook_set(Elm_Widget_Item *item, Elm_Widget_On_Disable_Set_Cb func);
/* debug function. don't use it unless you are tracking parenting issues */
*/
#define elm_widget_item_signal_emit_hook_set(item, func) \
_elm_widget_item_signal_emit_hook_set((Elm_Widget_Item *)item, (Elm_Widget_On_Signal_Emit_Cb)func)
+/**
+ * Convenience function to query disable get hook.
+ * @see _elm_widget_item_disabled_get()
+ */
+#define elm_widget_item_disabled_get(item) \
+ _elm_widget_item_disabled_get((Elm_Widget_Item *)item)
+EAPI Eina_Bool _elm_widget_item_disabled_get(const Elm_Widget_Item *item);
+
+/**
+ * Convenience function to query disable set hook.
+ * @see _elm_widget_item_disable_set_hook_set()
+ */
+#define elm_widget_item_disable_set_hook_set(item, func) \
+ _elm_widget_item_disable_set_hook_set((Elm_Widget_Item *) item, (Elm_Widget_On_Disable_Set_Cb)func)
#define ELM_WIDGET_ITEM_CHECK_OR_RETURN(item, ...) \
do { \