/**
* Set the text to read out when in accessibility mode
*
- * @param obj The object which is described
+ * @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
+ *
+ * @ingroup General
+ */
+ EAPI void elm_object_item_access_info_set(Elm_Object_Item *it, const char *txt);
+
+
#define elm_object_item_text_get(it) elm_object_item_text_part_get((it), NULL)
/**
{
elm_widget_access_info_set(obj, txt);
}
+
+EAPI void
+elm_object_item_access_info_set(Elm_Object_Item *it, const char *txt)
+{
+ _elm_widget_item_access_info_set((Elm_Widget_Item *)it, txt);
+}
+
_access_info_cb(void *data __UNUSED__, Evas_Object *obj __UNUSED__, Elm_Widget_Item *item __UNUSED__)
{
Elm_Toolbar_Item *it = (Elm_Toolbar_Item *)item;
- char *txt = NULL; // FIXME set access info on items - prefer that
+ char *txt = item->access_info;
if (!txt) txt = (char *)it->label;
if (txt) return strdup(txt);
return txt;
if (item->view)
evas_object_del(item->view);
+
+ if (item->access)
+ {
+ _elm_access_clear(item->access);
+ free(item->access);
+ item->access = NULL;
+ }
+ if (item->access_info)
+ {
+ eina_stringshare_del(item->access_info);
+ item->access_info = NULL;
+ }
EINA_MAGIC_SET(item, EINA_MAGIC_NONE);
free(item);
item->on_text_get_func = func;
}
+EAPI void
+_elm_widget_item_access_info_set(Elm_Widget_Item *item, const char *txt)
+{
+ ELM_WIDGET_ITEM_CHECK_OR_RETURN(item);
+ if (item->access_info) eina_stringshare_del(item->access_info);
+ if (!txt) item->access_info = NULL;
+ else item->access_info = eina_stringshare_add(txt);
+}
+
+
static void
_smart_add(Evas_Object *obj)
{
Elm_Widget_On_Text_Set_Cb on_text_set_func;
Elm_Widget_On_Text_Get_Cb on_text_get_func;
Elm_Access_Info *access;
+ const char *access_info;
/* 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_content_unset_hook_set(Elm_Widget_Item *item, Elm_Widget_On_Content_Unset_Cb func);
EAPI void _elm_widget_item_text_set_hook_set(Elm_Widget_Item *item, Elm_Widget_On_Text_Set_Cb func);
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_access_info_set(Elm_Widget_Item *item, const char *txt);
/* debug function. don't use it unless you are tracking parenting issues */