Tizen 2.1 base
[framework/uifw/elementary.git] / src / lib / elm_access.h
1 /**
2  * @defgroup Access Access
3  * @ingroup Elementary
4  *
5  * TODO: description
6  *
7  */
8
9 #define ELM_ACCESS_TYPE          0    /* when reading out widget or item
10                                        * this is read first */
11 #define ELM_ACCESS_INFO          1    /* next read is info - this is
12                                        * normally label */
13 #define ELM_ACCESS_STATE         2    /* if there is a state (eg checkbox)
14                                        * then read state out */
15 #define ELM_ACCESS_CONTEXT_INFO  3    /* to give contextual information */
16
17 typedef char *(*Elm_Access_Content_Cb)(void *data, Evas_Object *obj);
18 typedef void (*Elm_Access_Activate_Cb)(void *data, Evas_Object *part_obj, Elm_Object_Item *item);
19
20 /**
21  * @brief Register evas object as an accessible object.
22  * @since 1.8
23  *
24  * @param parent Accessibility parent object. this should be one of widget.
25  * @param target Evas object to register as an accessible object.
26  *
27  * @ingroup Access
28  */
29 EAPI void elm_access_object_register(Evas_Object *parent, Evas_Object *target);
30
31 /**
32  * @brief Unregister accessible object.
33  * @since 1.8
34  *
35  * @param obj Accessible object.
36  *
37  * @ingroup Access
38  */
39 EAPI void elm_access_object_unregister(Evas_Object *target);
40
41 /**
42  * @brief Set text to give information for specific type.
43  * @since 1.8
44  *
45  * @param obj Accessible object.
46  * @param type The type of content that will be read
47  * @param text The text information that will be read
48  *
49  * @see elm_access_content_cb_set
50  * @ingroup Access
51  */
52 EAPI void elm_access_text_set(Evas_Object *obj, int type, const char *text);
53
54 /**
55  * @brief Set text to give information for specific type.
56  * @since 1.8
57  *
58  * @param obj Accessible object.
59  * @param type The type of content that will be read
60  *
61  * @see elm_access_content_cb_set
62  * @ingroup Access
63  */
64 EAPI char * elm_access_text_get(Evas_Object *obj, int type);
65
66 /**
67  * @brief Set content callback to give information for specific type.
68  * @since 1.8
69  *
70  * @param obj Accessible object.
71  * @param type The type of content that will be read
72  * @param func The function to be called when the content is read
73  * @param data The data pointer to be passed to @p func
74  *
75  * The type would be one of ELM_ACCESS_TYPE, ELM_ACCESS_INFO,
76  * ELM_ACCESS_STATE, ELM_ACCESS_CONTEXT_INFO.
77  *
78  * In the case of button widget, the content of ELM_ACCESS_TYPE would be
79  * "button". The label of button such as "ok", "cancel" is for ELM_ACCESS_INFO.
80  * If the button is disabled, content of ELM_ACCESS_STATE would be "disabled".
81  * And if there is contextual information, ELM_ACCESS_CONTEXT_INFO is used.
82  *
83  * @ingroup Access
84  */
85 EAPI void elm_access_content_cb_set(Evas_Object *obj, int type, Elm_Access_Content_Cb func, const void *data);
86
87 /**
88  * @brief Set activate callback to activate highlight object.
89  * @since 1.8
90  *
91  * @param obj Accessible object.
92  * @param func The function to be called when the activate gesture is detected
93  * @param data The data pointer to be passed to @p func
94  *
95  * @ingroup Access
96  */
97 EAPI void elm_access_activate_cb_set(Evas_Object *obj, Elm_Access_Activate_Cb func, void *data);
98
99 //TODO: remvoe below - use elm_access_text_set(); or elm_access_cb_set();
100 EINA_DEPRECATED EAPI void elm_access_external_info_set(Evas_Object *obj, const char *text);
101 EINA_DEPRECATED EAPI char * elm_access_external_info_get(const Evas_Object *obj);