Function description fixes
[platform/core/uifw/eail.git] / eail / eail / eail_utils.h
1 /*
2  * Copyright (c) 2013 Samsung Electronics Co., Ltd.
3  *
4  * This library is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Lesser General Public
6  * License as published by the Free Software Foundation; either
7  * version 2 of the License, or (at your option) any later version.
8  *
9  * This library is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12  * Lesser General Public License for more details.
13  *
14  * You should have received a copy of the GNU Lesser General Public License
15  * along with this library; see the file COPYING.LIB.  If not, write to
16  * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17  * Boston, MA 02110-1301, USA.
18  */
19
20 /**
21  * @file eail_utils.h
22  *
23  * @brief Header for Eail Utility functions
24  */
25
26 #ifndef EAIL_UTILS_H
27 #define EAIL_UTILS_H
28
29 #include <glib.h>
30
31 #ifdef __cplusplus
32 extern "C" {
33 #endif
34
35 #define EAIL_STR_SCROLL_UP "scroll_up" /**< @brief String for 'scroll up'*/
36 #define EAIL_STR_SCROLL_DOWN "scroll_down" /**< @brief String for 'scroll down'*/
37 #define EAIL_STR_SCROLL_LEFT "scroll_left" /**< @brief String for 'scroll left'*/
38 #define EAIL_STR_SCROLL_RIGHT "scroll_right" /**< @brief String for 'scroll right'*/
39
40 /**
41  * @enum EAIL_SCROLL_TYPE Type of scroll direction
42  */
43 enum EAIL_SCROLL_TYPE
44 {
45    EAIL_SCROLL_TYPE_UP,/**< scroll 'up' direction */
46    EAIL_SCROLL_TYPE_DOWN,/**< scroll 'down' direction */
47    EAIL_SCROLL_TYPE_LEFT,/**< scroll 'left' direction */
48    EAIL_SCROLL_TYPE_RIGHT/**< scroll 'right' direction */
49 };
50
51 /**
52  * @brief Helper function gets substring from string
53  */
54 gchar *eail_get_substring(const gchar* string, gint start_offset, gint end_offset);
55
56 /**
57  * @brief Generic function for generating ref_state for Evas_Objects stored in
58  * ATK objects
59  *
60  */
61 AtkStateSet *eail_evas_obj_ref_state_set(Evas_Object *widget,
62                                          AtkStateSet *state_set);
63
64 /**
65  * @brief Generic function for grabbing focus on Evas_Object stored in ATK object
66  */
67 gboolean eail_evas_obj_grab_focus(Evas_Object *widget);
68
69 /**
70  * @brief Emulates mouse 'press' event at given coordinates
71  */
72 void eail_mouse_press_on_coords(Evas_Object *widget, int x, int y);
73
74 /**
75  * @brief Emulates mouse 'release' event at given coordinates
76  */
77 void eail_mouse_release_on_coords(Evas_Object *widget, int x, int y);
78
79 /**
80  * @brief Emulates mouse 'click' event at given coordinates
81  */
82 void eail_mouse_click_on_coords(Evas_Object *widget, int x, int y);
83
84 /**
85  * @brief Gets coordinates of center of given widget
86  */
87 void eail_get_coords_widget_center(Evas_Object *widget, int *x, int *y);
88
89 /**
90  * @brief Gets edje parts list for item
91  *
92  */
93 Eina_List *eail_get_edje_parts_for_item(Elm_Object_Item *item);
94
95 /**
96  * @brief Gets text content from item (each text is put into field in Eina_List
97  * as const gchar*)
98  */
99 Eina_List *eail_item_get_content_strings(Elm_Object_Item *item);
100
101 /**
102  * @brief Scrolls screen to given direction
103  */
104 gboolean eail_handle_scroll(Evas_Object *widget,
105                             enum EAIL_SCROLL_TYPE type);
106
107 /**
108  * @brief Scrolls screen up
109  */
110 gboolean eail_action_scroll_up(Evas_Object *widget,
111                                void *data);
112
113 /**
114  * @brief Scrolls screen down
115  */
116 gboolean eail_action_scroll_down(Evas_Object *widget,
117                                  void *data);
118
119 /**
120  * @brief Scrolls screen left
121  */
122 gboolean eail_action_scroll_left(Evas_Object *widget,
123                                  void *data);
124
125 /**
126  * @brief Scrolls screen right
127  */
128 gboolean eail_action_scroll_right(Evas_Object *widget,
129                                   void *data);
130
131 /**
132  * @brief Emits signal for ATK Object
133  */
134 void eail_emit_atk_signal(AtkObject * atk_obj,
135                           const gchar *signal_name,
136                           GType object_type);
137
138 /**
139  * @brief Handler for selected event in for list-based content
140  */
141 void eail_list_item_handle_selected_event(void *data,
142                                           Evas_Object *obj,
143                                           void *event_info);
144
145 /**
146  * @brief Handler for unselected event for list-based content
147  */
148 void eail_list_item_handle_unselected_event(void *data,
149                                             Evas_Object *obj,
150                                             void *event_info);
151
152
153 /**
154  * @brief Gets raw evas object list for eail item
155  */
156 Eina_List *eail_get_raw_evas_obj_list_from_item(Elm_Object_Item *item);
157
158 /**
159  * @brief Helper function for emitting 'children changed' signal when needed
160  */
161 void eail_emit_children_changed(gboolean added,
162                                 AtkObject *atk_obj,
163                                 gint child_number);
164
165 /**
166  * @brief Helper function for emit children changed signal when needed (func
167  * version that takes object instead of index-number)
168  */
169 void eail_emit_children_changed_obj(gboolean added,
170                                     AtkObject *atk_obj,
171                                     AtkObject *changed_obj);
172
173 /**
174  * @brief Helper function to notify windows about focus changes of its children
175  */
176 void eail_notify_child_focus_changes(void);
177
178 #ifdef __cplusplus
179 }
180 #endif
181
182 #endif