action_by = type;
- if (!ho || !_access_action_callback_call(ho, type, NULL))
+ if (ho && !_access_action_callback_call(ho, type, NULL))
+ {
+ Elm_Access_Info *info = _elm_access_object_get(ho);
+ Evas_Object *comming = NULL;
+ if (type == ELM_ACCESS_ACTION_HIGHLIGHT_NEXT)
+ {
+ if (info->next) comming = info->next;
+ }
+ else
+ {
+ if (info->prev) comming = info->prev;
+ }
+ if (comming)
+ {
+ elm_access_highlight_set(comming);
+ elm_widget_focus_region_show(comming);
+ }
+ else
+ elm_widget_focus_cycle(obj, dir);
+ }
+ else if (!ho || !_access_action_callback_call(ho, type, NULL))
elm_widget_focus_cycle(obj, dir);
action_by = ELM_ACCESS_ACTION_FIRST;
ac = _elm_access_object_get(obj);
return _elm_access_text_get(ac, ELM_ACCESS_CONTEXT_INFO, obj);
}
+
+EAPI void
+elm_access_highlight_next_set(Evas_Object *obj, Elm_Highlight_Direction dir, Evas_Object *next)
+{
+ EINA_SAFETY_ON_FALSE_RETURN(obj);
+ EINA_SAFETY_ON_FALSE_RETURN(next);
+
+ Elm_Access_Info *info = _elm_access_object_get(obj);
+ Elm_Access_Info *info_next = _elm_access_object_get(next);
+
+ if (!info || !info_next)
+ {
+ ERR("There is no access information");
+ return;
+ }
+
+ if (dir == ELM_HIGHLIGHT_DIR_NEXT)
+ {
+ info_next->prev = obj;
+ info->next = next;
+ }
+ else if (dir == ELM_HIGHLIGHT_DIR_PREVIOUS)
+ {
+ info_next->next = obj;
+ info->prev = next;
+ }
+ else
+ ERR("Not supported focus direction for access highlight [%d]", dir);
+}
*/
typedef enum _Elm_Access_Action_Type Elm_Access_Action_Type;
+enum _Elm_Highlight_Direction
+{
+ ELM_HIGHLIGHT_DIR_FIRST = -1,
+ ELM_HIGHLIGHT_DIR_NEXT,
+ ELM_HIGHLIGHT_DIR_PREVIOUS
+};
+/**
+ * @typedef Elm_Access_Action_Type
+ */
+typedef enum _Elm_Highlight_Direction Elm_Highlight_Direction;
+
struct _Elm_Access_Action_Info
{
Evas_Coord x;
*/
EAPI void elm_access_highlight_set(Evas_Object* obj);
+/**
+ * @brief Set the next access object for highlight.
+ * @since 1.8
+ *
+ * @param obj The object is previous access object of next for hilight.
+ * @param dir Access direction same as Focus direction
+ * @param next The object is next access object of obj for hilight.
+ *
+ * Currently focus chain is used for access highlight direction. Use this API
+ * to customize focus chain. If focus chain is already established, you can
+ * change one object's highlight chain and do not break the other object's
+ * focus chain. If you use elm_object_focus_custom_chain_append(), it will
+ * reset other object's custom chain also.
+ *
+ * @see elm_object_focus_custom_chain_append
+ * @ingroup Access
+ */
+EAPI void
+elm_access_highlight_next_set(Evas_Object *obj, Elm_Highlight_Direction dir, Evas_Object *next);
+
EAPI Eina_Bool elm_access_action(Evas_Object *obj, const Elm_Access_Action_Type type, void *action_info);
EAPI void elm_access_action_cb_set(Evas_Object *obj, const Elm_Access_Action_Type type, const Elm_Access_Action_Cb cb, const void *data);
return elm_widget_content_part_unset(obj, part);
}
+EAPI Evas_Object *
+elm_object_part_access_register(Evas_Object *obj, const char *part)
+{
+ EINA_SAFETY_ON_NULL_RETURN_VAL(obj, NULL);
+ EINA_SAFETY_ON_NULL_RETURN_VAL(part, NULL);
+ if (!evas_object_smart_type_check(obj, "elm_layout"))
+ {
+ ERR("Only for parts of a layout, access object can be registered");
+ return NULL;
+ }
+
+ Evas_Object *edj = elm_layout_edje_get(obj);
+ return _elm_access_edje_object_part_object_register(obj, edj, part);
+}
+
EAPI Eina_Bool
elm_object_style_set(Evas_Object *obj,
const char *style)
#define elm_object_content_unset(obj) elm_object_part_content_unset((obj), NULL)
/**
+ * Register a part on an object as an access object.
+ * @since 1.8
+ *
+ * @param obj The Elementary object
+ * @param part The object's part name to register
+ *
+ * @ingroup General
+ */
+EAPI Evas_Object * elm_object_part_access_register(Evas_Object *obj, const char *part);
+
+/**
* Set the text to read out when in accessibility mode
*
* @param obj The object which is to be described
}
}
+EAPI void
+elm_widget_focus_region_show(const Evas_Object *obj)
+{
+ _elm_widget_focus_region_show(obj);
+}
+
static void
_parent_focus(Evas_Object *obj)
{
/* the owner part object that owns this access info */
Evas_Object *part_object;
+
+ Evas_Object *next;
+ Evas_Object *prev;
};
void _elm_access_shutdown();
EAPI Eina_Bool elm_widget_highlight_get(const Evas_Object *obj);
EAPI void elm_widget_parent_highlight_set(Evas_Object *obj, Eina_Bool highlighted);
+EAPI void elm_widget_focus_region_show(const Evas_Object *obj);
+
/**
* @internal
*