merge with master
[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_Info_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 obj The evas object to register as an accessible object.
25  * @param parent The elementary object which is used for creating
26  * accessible object.
27  *
28  * @ingroup Access
29  */
30 EAPI Evas_Object *elm_access_object_register(Evas_Object *obj, Evas_Object *parent);
31
32 /**
33  * @brief Unregister accessible object.
34  * @since 1.8
35  *
36  * @param obj The Evas object to unregister accessible object.
37  *
38  * @ingroup Access
39  */
40 EAPI void elm_access_object_unregister(Evas_Object *obj);
41
42 /**
43  * @brief Get an accessible object of the evas object.
44  * @since 1.8
45  *
46  * @param obj The evas object.
47  * @return Accessible object of the evas object or NULL for any error
48  *
49  * @ingroup Access
50  */
51 EAPI Evas_Object *elm_access_object_get(const Evas_Object *obj);
52
53 /**
54  * @brief Set text to give information for specific type.
55  * @since 1.8
56  *
57  * @param obj Accessible object.
58  * @param type The type of content that will be read
59  * @param text The text information that will be read
60  *
61  * @see elm_access_info_cb_set
62  * @ingroup Access
63  */
64 EAPI void elm_access_info_set(Evas_Object *obj, int type, const char *text);
65
66 /**
67  * @brief Set text 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  *
73  * @see elm_access_info_cb_set
74  * @ingroup Access
75  */
76 EAPI char *elm_access_info_get(const Evas_Object *obj, int type);
77
78 /**
79  * @brief Set content callback to give information for specific type.
80  * @since 1.8
81  *
82  * @param obj Accessible object.
83  * @param type The type of content that will be read
84  * @param func The function to be called when the content is read
85  * @param data The data pointer to be passed to @p func
86  *
87  * The type would be one of ELM_ACCESS_TYPE, ELM_ACCESS_INFO,
88  * ELM_ACCESS_STATE, ELM_ACCESS_CONTEXT_INFO.
89  *
90  * In the case of button widget, the content of ELM_ACCESS_TYPE would be
91  * "button". The label of button such as "ok", "cancel" is for ELM_ACCESS_INFO.
92  * If the button is disabled, content of ELM_ACCESS_STATE would be "disabled".
93  * And if there is contextual information, use ELM_ACCESS_CONTEXT_INFO.
94  *
95  * @ingroup Access
96  */
97 EAPI void elm_access_info_cb_set(Evas_Object *obj, int type, Elm_Access_Info_Cb func, const void *data);
98
99 /**
100  * @brief Set activate callback to activate highlight object.
101  * @since 1.8
102  *
103  * @param obj Accessible object.
104  * @param func The function to be called when the activate gesture is detected
105  * @param data The data pointer to be passed to @p func
106  *
107  * @ingroup Access
108  */
109 EAPI void elm_access_activate_cb_set(Evas_Object *obj, Elm_Access_Activate_Cb func, void *data);
110
111 /**
112  * @brief Read out text information directly.
113  * @since 1.8
114  *
115  * @param text The text information that will be read
116  *
117  * This function will not free the @p text internally.
118  *
119  * @ingroup Access
120  */
121 EAPI void elm_access_say(const char *text);
122
123 /**
124  * @brief Give the highlight to the object directly.
125  * @since 1.8
126  *
127  * @param obj The object that will have the highlight and its information be read.
128  *
129  * The object should be an elementary object or an access object.
130  *
131  * @see elm_access_object_get
132  * @ingroup Access
133  */
134 EAPI void elm_access_highlight_set(Evas_Object* obj);
135
136 //TODO: remvoe below - use elm_access_text_set(); or elm_access_cb_set();
137 EINA_DEPRECATED EAPI void elm_access_external_info_set(Evas_Object *obj, const char *text);
138 EINA_DEPRECATED EAPI char *elm_access_external_info_get(const Evas_Object *obj);