fix documents errors
[platform/core/api/efl-util.git] / include / efl_util.h.in
1 /*
2  * Copyright (c) 2011-2017 Samsung Electronics Co., Ltd All Rights Reserved
3  *
4  * Licensed under the Apache License, Version 2.0 (the License);
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an AS IS BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16
17 #ifndef __TIZEN_UI_EFL_UTIL_H__
18 #define __TIZEN_UI_EFL_UTIL_H__
19
20 #include <tizen.h>
21 #include <Evas.h>
22 #include <tbm_surface.h>
23
24 #ifdef __cplusplus
25 extern "C" {
26 #endif
27
28 #ifdef __GNUC__
29 # if __GNUC__ >= 4
30 #  ifndef API
31 #   define API __attribute__ ((visibility("default")))
32 #  endif
33 # endif
34 #endif
35
36 /**
37  * @file efl_util.h
38  */
39
40 /**
41  * @addtogroup CAPI_EFL_UTIL_WIN_PROPERTY_MODULE
42  * @{
43  */
44
45 /**
46  * @brief Enumeration for EFL UTIL ERROR.
47  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
48  */
49 typedef enum
50 {
51    EFL_UTIL_ERROR_NONE = TIZEN_ERROR_NONE, /**< Successful */
52    EFL_UTIL_ERROR_INVALID_PARAMETER = TIZEN_ERROR_INVALID_PARAMETER, /**< Invalid parameter */
53    EFL_UTIL_ERROR_OUT_OF_MEMORY = TIZEN_ERROR_OUT_OF_MEMORY, /**< Out of memory */
54    EFL_UTIL_ERROR_PERMISSION_DENIED = TIZEN_ERROR_PERMISSION_DENIED, /**< Permission denied */
55    EFL_UTIL_ERROR_NO_SUCH_DEVICE = TIZEN_ERROR_NO_SUCH_DEVICE, /**< @platform No such device or address (@b Since: $TZ_CFG_VER_24_OR_30$) */
56    EFL_UTIL_ERROR_INVALID_OPERATION = TIZEN_ERROR_INVALID_OPERATION, /**< @platform Function not implemented (@b Since: $TZ_CFG_VER_24_OR_30$) */
57    EFL_UTIL_ERROR_NOT_SUPPORTED = TIZEN_ERROR_NOT_SUPPORTED, /**< @platform Not supported (@b Since: $TZ_CFG_VER_24_OR_30$) */
58    EFL_UTIL_ERROR_NOT_SUPPORTED_WINDOW_TYPE = TIZEN_ERROR_EFL_UTIL | 0x01, /**< Window type not supported */
59    EFL_UTIL_ERROR_SCREENSHOT_INIT_FAIL = TIZEN_ERROR_EFL_UTIL | 0x02,  /**< @platform Screenshot initialization fail (@b Since: $TZ_CFG_VER_24_OR_30$) */
60    EFL_UTIL_ERROR_SCREENSHOT_EXECUTION_FAIL = TIZEN_ERROR_EFL_UTIL | 0x03,  /**< @platform Screenshot execution fail (@b Since: $TZ_CFG_VER_24_OR_30$) */
61    EFL_UTIL_ERROR_NO_RESOURCE_AVAILABLE = TIZEN_ERROR_EFL_UTIL | 0x04 /**< Resource is not available (@b Since: 4.0) */
62 } efl_util_error_e;
63
64 /**
65  * @brief Enumeration of notification window's priority level.
66  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
67  */
68 typedef enum
69 {
70    EFL_UTIL_NOTIFICATION_LEVEL_NONE    = -1, /**< No (reset) notification level. This value makes the window place in normal layer. (@b Since: $TZ_CFG_VER_24_OR_30$) */
71    EFL_UTIL_NOTIFICATION_LEVEL_DEFAULT = 10, /**< Default notification level. (@b Since: $TZ_CFG_VER_24_OR_30$) */
72    EFL_UTIL_NOTIFICATION_LEVEL_MEDIUM  = 20, /**< Higher notification level than default. (@b Since: $TZ_CFG_VER_24_OR_30$) */
73    EFL_UTIL_NOTIFICATION_LEVEL_HIGH    = 30, /**< Higher notification level than medium. (@b Since: $TZ_CFG_VER_24_OR_30$) */
74    EFL_UTIL_NOTIFICATION_LEVEL_TOP     = 40  /**< The highest notification level. (@b Since: $TZ_CFG_VER_24_OR_30$) */
75 } efl_util_notification_level_e;
76
77 /**
78  * @brief Enumeration of screen mode.
79  * @since_tizen $TZ_CFG_VER_24_OR_30$
80  */
81 typedef enum
82 {
83    EFL_UTIL_SCREEN_MODE_DEFAULT, /**< The mode which turns the screen off after a timeout. */
84    EFL_UTIL_SCREEN_MODE_ALWAYS_ON, /**< The mode which keeps the screen turned on. */
85 } efl_util_screen_mode_e;
86
87 /**
88  * @brief Sets the priority level for the specified notification window.
89  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
90  * @privlevel public
91  * @privilege %http://tizen.org/privilege/window.priority.set
92  * @remarks This API can be used for a notification type window only.
93  *          Up to the version $TZ_CFG_VER_24_OR_231$, it supports as async APIs.
94  *          But it is synchronous call since Tizen 3.0
95  * @param[in] window The EFL window
96  * @param[in] level The notification window level
97  * @return @c 0 on success, otherwise a negative error value
98  * @retval #EFL_UTIL_ERROR_NONE Successful
99  * @retval #EFL_UTIL_ERROR_INVALID_PARAMETER Invalid parameter
100  * @retval #EFL_UTIL_ERROR_NOT_SUPPORTED_WINDOW_TYPE Window type not supported
101  * @retval #EFL_UTIL_ERROR_PERMISSION_DENIED Permission denied
102  */
103 API int efl_util_set_notification_window_level(Evas_Object *window, efl_util_notification_level_e level);
104
105 /**
106  * @brief Gets the priority level for the specified notification window.
107  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
108  *
109  * @remarks This API can be used for a notification type window only.
110  *          Up to the version $TZ_CFG_VER_24_OR_231$, it supports as async APIs.
111  *          But it is synchronous call since Tizen 3.0
112  * @param[in] window The EFL window
113  * @param[out] level The notification window level
114  * @return @c 0 on success, otherwise a negative error value
115  * @retval #EFL_UTIL_ERROR_NONE Successful
116  * @retval #EFL_UTIL_ERROR_INVALID_PARAMETER Invalid parameter
117  * @retval #EFL_UTIL_ERROR_NOT_SUPPORTED_WINDOW_TYPE Window type not supported
118  */
119 API int efl_util_get_notification_window_level(Evas_Object *window, efl_util_notification_level_e *level);
120
121 /**
122  * @brief Sets the alpha window's visual state to opaque state.
123  * @details This API sets the alpha window's visual state to opaque state.
124  *          If the alpha window sets the visual state to the opaque,
125  *          then the window manager could handle it as the opaque window while calculating visibility.
126  *          This API will have no effect when used by a non-alpha window.
127  * @since_tizen $TZ_CFG_VER_24_OR_30$
128  * @param[in] window The EFL window
129  * @param[in] opaque The value that indicates whether the window has set a visual state to opaque (0: unset, 1: set)
130  * @return @c 0 on success, otherwise a negative error value
131  * @retval #EFL_UTIL_ERROR_NONE Successful
132  * @retval #EFL_UTIL_ERROR_INVALID_PARAMETER Invalid parameter
133  */
134 API int efl_util_set_window_opaque_state(Evas_Object *window, int opaque);
135
136 /**
137  * @brief Sets the window's screen mode.
138  * @details This API is useful when the application need to keep the display turned on.
139  *          If the application set the mode to #EFL_UTIL_SCREEN_MODE_ALWAYS_ON to its window and the window is shown wholly or partially,
140  *          the window manager requests the display system to keep the display on as long as the window is shown.
141  *          If the window is no longer shown, then the window manger request the display system to go back to normal operation.
142  *          Default screen mode of window is #EFL_UTIL_SCREEN_MODE_DEFAULT.
143  * @since_tizen $TZ_CFG_VER_24_OR_30$
144  * @privlevel public
145  * @privilege %http://tizen.org/privilege/display
146  * @remarks This API needs the privilege.
147  *          If the application which is not get the privilege use this API, the window manager generates the permission deny error.
148  * @param[in] window The EFL window
149  * @param[in] mode The screen mode
150  * @return @c 0 on success, otherwise a negative error value
151  * @retval #EFL_UTIL_ERROR_NONE Successful
152  * @retval #EFL_UTIL_ERROR_INVALID_PARAMETER Invalid parameter
153  * @retval #EFL_UTIL_ERROR_PERMISSION_DENIED Permission denied
154  */
155 API int efl_util_set_window_screen_mode(Evas_Object *window, efl_util_screen_mode_e mode);
156
157 /**
158  * @brief Gets the screen mode of the specified window.
159  * @since_tizen $TZ_CFG_VER_24_OR_30$
160  * @param[in] window The EFL window
161  * @param[out] mode The screen mode
162  * @return @c 0 on success, otherwise a negative error value
163  * @retval #EFL_UTIL_ERROR_NONE Successful
164  * @retval #EFL_UTIL_ERROR_INVALID_PARAMETER Invalid parameter
165  */
166 API int efl_util_get_window_screen_mode(Evas_Object *window, efl_util_screen_mode_e *mode);
167
168 /**
169  * @brief Sets the user's preferred brightness of the specified window.
170  * @details This API is useful when the application need to change the brightness of the screen when it is appeared on the screen.
171  *          If the application sets the brightness 0 to 100 to its window and the application window is shown wholly or partially,
172  *          the window manager requests the display system to change the brightness of the screen using user's preferred brightness.
173  *          If the window is no longer shown, then the window manger request the display system to go back to default brightness.
174  *          If the brightness is less than 0, this means to use the default screen brightness.
175  * @since_tizen 3.0
176  * @privlevel public
177  * @privilege %http://tizen.org/privilege/display
178  * @remarks This API needs the privilege.
179  *          If the application which is not get the privilege use this API, the window manager generates the permission deny error.
180  * @param[in] window The EFL window
181  * @param[in] brightness The preferred brightness
182  * @return @c 0 on success, otherwise a negative error value
183  * @retval #EFL_UTIL_ERROR_NONE Successful
184  * @retval #EFL_UTIL_ERROR_INVALID_PARAMETER Invalid parameter
185  * @retval #EFL_UTIL_ERROR_PERMISSION_DENIED Permission denied
186  * @retval #EFL_UTIL_ERROR_OUT_OF_MEMORY Out of memory
187  * @see efl_util_get_window_brightness()
188  */
189 API int efl_util_set_window_brightness(Evas_Object *window, int brightness);
190
191 /**
192  * @brief Gets the user's preferred brightness of the specified window.
193  * @since_tizen 3.0
194  * @param[in] window The EFL window
195  * @param[out] brightness The preferred brightness
196  * @return @c 0 on success, otherwise a negative error value
197  * @retval #EFL_UTIL_ERROR_NONE Successful
198  * @retval #EFL_UTIL_ERROR_INVALID_PARAMETER Invalid parameter
199  * @see efl_util_set_window_brightness()
200  */
201 API int efl_util_get_window_brightness(Evas_Object *window, int *brightness);
202
203
204 /**
205  * @}
206  */
207
208 /**
209  * @addtogroup CAPI_EFL_UTIL_INPUT_MODULE
210  * @{
211  */
212
213  /**
214   * @platform
215   * @brief Definition for the input generator handle.
216   * @since_tizen $TZ_CFG_VER_24_OR_30$
217   */
218
219  typedef struct _efl_util_inputgen_h * efl_util_inputgen_h;
220
221 /**
222  * @platform
223  * @brief Enumeration of device type generated events.
224  * @since_tizen $TZ_CFG_VER_24_OR_30$
225  */
226 typedef enum
227 {
228    EFL_UTIL_INPUT_DEVTYPE_NONE = 0x0, /**< (Deprecated since 3.0.) */
229    EFL_UTIL_INPUT_DEVTYPE_TOUCHSCREEN = (1 << 0), /**< Touch Screen device */
230    EFL_UTIL_INPUT_DEVTYPE_KEYBOARD = (1 << 1), /**< Keyboard device */
231    EFL_UTIL_INPUT_DEVTYPE_POINTER = (1 << 2), /**< Mouse device (Since 3.0) */
232    EFL_UTIL_INPUT_DEVTYPE_ALL = EFL_UTIL_INPUT_DEVTYPE_TOUCHSCREEN |
233                                 EFL_UTIL_INPUT_DEVTYPE_KEYBOARD, /**< Both of touch screen and keyboard device (Deprecated since 3.0. Check all enumerations using OR operand instead) */
234    EFL_UTIL_INPUT_DEVTYPE_MAX = (1 << 10) /**< (Deprecated since 3.0.) */
235 } efl_util_input_device_type_e;
236
237 /**
238  * @platform
239  * @brief Enumeration of touch event types.
240  * @since_tizen $TZ_CFG_VER_24_OR_30$
241  */
242 typedef enum
243 {
244    EFL_UTIL_INPUT_TOUCH_NONE, /**< (Deprecated since 3.0.) */
245    EFL_UTIL_INPUT_TOUCH_BEGIN, /**< Finger press. It is same a behavior put your finger on touch screen */
246    EFL_UTIL_INPUT_TOUCH_UPDATE, /**< Finger move. It is same a behavior move your finger on touch screen */
247    EFL_UTIL_INPUT_TOUCH_END, /**< Finger release. It is same a behavior release your finger on touch screen */
248    EFL_UTIL_INPUT_TOUCH_MAX = 10 /**< (Deprecated since 3.0.) */
249 } efl_util_input_touch_type_e;
250
251 /**
252  * @platform
253  * @brief Enumeration of pointer event types.
254  * @since_tizen 3.0
255  */
256 typedef enum
257 {
258    EFL_UTIL_INPUT_POINTER_BUTTON_DOWN, /**< Mouse button press. */
259    EFL_UTIL_INPUT_POINTER_BUTTON_UP, /**< Mouse move. */
260    EFL_UTIL_INPUT_POINTER_MOVE, /**< Mouse button release. */
261 } efl_util_input_pointer_type_e;
262
263 /**
264    * @platform
265    * @brief Initializes system and check input generate functions are supported, open devices generated events.
266    * @since_tizen $TZ_CFG_VER_24_OR_30$
267    * @privlevel platform
268    * @privilege %http://tizen.org/privilege/inputgenerator
269    * @remarks The specific error code can be obtained using the get_last_result() method. Error codes are described in Exception section.
270    * @remarks The dev_type is changed into the unsigned int to perform bitwise operations. (Since 3.0)
271    * @param[in] dev_type The device type want to generate events (ex> #EFL_UTIL_INPUT_DEVTYPE_TOUCHSCREEN | #EFL_UTIL_INPUT_DEVTYPE_KEYBOARD)
272    * @return #efl_util_inputgen_h on success, otherwise @c NULL
273    * @retval #efl_util_inputgen_h The input generator handle
274    * @exception #EFL_UTIL_ERROR_NONE Successful
275    * @exception #EFL_UTIL_ERROR_INVALID_PARAMETER Invalid parameter
276    * @exception #EFL_UTIL_ERROR_NO_SUCH_DEVICE No such device or address
277    * @exception #EFL_UTIL_ERROR_INVALID_OPERATION Function not implemented
278    * @exception #EFL_UTIL_ERROR_OUT_OF_MEMORY Memory allocation failure
279    * @exception #EFL_UTIL_ERROR_PERMISSION_DENIED Has no permission to initialize input generator
280    * @see efl_util_input_deinitialize_generator()
281    */
282 API efl_util_inputgen_h efl_util_input_initialize_generator(unsigned int dev_type);
283
284 /**
285    * @platform
286    * @brief Initializes system, check input generate functions are supported and then open events generator devices with given name.
287    * @since_tizen 4.0
288    * @privlevel platform
289    * @privilege %http://tizen.org/privilege/inputgenerator
290    * @remarks The specific error code can be obtained using the get_last_result() method. Error codes are described in Exception section.
291    * @remarks The dev_type is changed into the unsigned int to perform bitwise operations.
292    * @param[in] dev_type The device type want to generate events (ex> #EFL_UTIL_INPUT_DEVTYPE_TOUCHSCREEN | #EFL_UTIL_INPUT_DEVTYPE_KEYBOARD)
293    * @param[in] name The device name (maximum 31 characters)
294    * @return #efl_util_inputgen_h on success, otherwise @c NULL
295    * @retval #efl_util_inputgen_h The input generator handle
296    * @exception #EFL_UTIL_ERROR_NONE Successful
297    * @exception #EFL_UTIL_ERROR_INVALID_PARAMETER Invalid parameter
298    * @exception #EFL_UTIL_ERROR_NO_SUCH_DEVICE No such device or address
299    * @exception #EFL_UTIL_ERROR_INVALID_OPERATION Function not implemented
300    * @exception #EFL_UTIL_ERROR_OUT_OF_MEMORY Memory allocation failure
301    * @exception #EFL_UTIL_ERROR_PERMISSION_DENIED Has no permission to initialize input generator
302    * @see efl_util_input_deinitialize_generator()
303    */
304 API efl_util_inputgen_h efl_util_input_initialize_generator_with_name(unsigned int dev_type, const char *name);
305
306 /**
307    * @platform
308    * @brief Initializes the system, checks if input generated functions are supported and then open events generator devices synchronously.
309    * @since_tizen 5.0
310    * @privlevel platform
311    * @privilege %http://tizen.org/privilege/inputgenerator
312    * @remarks The specific error code can be obtained using the get_last_result() method. Error codes are described in Exception section.
313    * @remarks @a dev_type is changed into the unsigned int to perform bitwise operations.
314    * @remarks If the @a name is NULL, it will be set to "Input Generator"
315    * @remarks The returned object should be released with efl_util_input_deinitialize_generator().
316    * @param[in] dev_type The device type to generate events, values of #efl_util_input_device_type_e combined with bitwise 'or'\n
317    *            Example: #EFL_UTIL_INPUT_DEVTYPE_TOUCHSCREEN | #EFL_UTIL_INPUT_DEVTYPE_KEYBOARD
318    * @param[in] name The device name (maximum 31 characters, can be NULL)
319    * @return #efl_util_inputgen_h on success, otherwise @c NULL
320    * @retval #efl_util_inputgen_h The input generator handle
321    * @exception #EFL_UTIL_ERROR_NONE Successful
322    * @exception #EFL_UTIL_ERROR_INVALID_PARAMETER Invalid parameter
323    * @exception #EFL_UTIL_ERROR_NO_SUCH_DEVICE No such device or address
324    * @exception #EFL_UTIL_ERROR_INVALID_OPERATION Function not implemented
325    * @exception #EFL_UTIL_ERROR_OUT_OF_MEMORY Memory allocation failure
326    * @exception #EFL_UTIL_ERROR_PERMISSION_DENIED Has no permission to initialize input generator
327    * @see efl_util_input_deinitialize_generator()
328    */
329 API efl_util_inputgen_h efl_util_input_initialize_generator_with_sync(unsigned int dev_type, const char *name);
330
331 /**
332    * @platform
333    * @brief Deinitializes system and close opened devices.
334    * @since_tizen $TZ_CFG_VER_24_OR_30$
335    * @privlevel platform
336    * @privilege %http://tizen.org/privilege/inputgenerator
337    * @param[in] inputgen_h The #efl_util_inputgen_h handle
338    * @return @c 0 on success, otherwise a negative error value
339    * @retval #EFL_UTIL_ERROR_NONE Successful
340    * @retval #EFL_UTIL_ERROR_INVALID_PARAMETER Invalid parameter
341    * @retval #EFL_UTIL_ERROR_PERMISSION_DENIED Has no permission to deinitialize input generator
342    * @see efl_util_input_initialize_generator()
343    */
344 API int efl_util_input_deinitialize_generator(efl_util_inputgen_h inputgen_h);
345
346 /**
347    * @platform
348    * @brief Generates all of key events using a opened device.
349    * @since_tizen $TZ_CFG_VER_24_OR_30$
350    * @privlevel platform
351    * @privilege %http://tizen.org/privilege/inputgenerator
352    * @param[in] inputgen_h The #efl_util_inputgen_h handle
353    * @param[in] key_name The key name want to generate
354    * @param[in] pressed The value that select key press or release (0: release, 1: press)
355    * @return @c 0 on success, otherwise a negative error value
356    * @retval #EFL_UTIL_ERROR_NONE Successful
357    * @retval #EFL_UTIL_ERROR_INVALID_PARAMETER Invalid parameter
358    * @retval #EFL_UTIL_ERROR_PERMISSION_DENIED Has no permission to generate key
359    */
360 API int efl_util_input_generate_key(efl_util_inputgen_h inputgen_h, const char *key_name, int pressed);
361
362 /**
363    * @platform
364    * @brief Generates a touch event using a opened device.
365    * @since_tizen $TZ_CFG_VER_24_OR_30$
366    * @privlevel platform
367    * @privilege %http://tizen.org/privilege/inputgenerator
368    * @param[in] inputgen_h The #efl_util_inputgen_h handle
369    * @param[in] idx The index of touched finger
370    * @param[in] touch_type The touch type (ex> #EFL_UTIL_INPUT_TOUCH_BEGIN, #EFL_UTIL_INPUT_TOUCH_UPDATE, #EFL_UTIL_INPUT_TOUCH_END)
371    * @param[in] x The x axis of touch point
372    * @param[in] y The y axis of touch point
373    * @return @c 0 on success, otherwise a negative error value
374    * @retval #EFL_UTIL_ERROR_NONE Successful
375    * @retval #EFL_UTIL_ERROR_INVALID_PARAMETER Invalid parameter
376    * @retval #EFL_UTIL_ERROR_PERMISSION_DENIED Has no permission to generate touch
377    */
378 API int efl_util_input_generate_touch(efl_util_inputgen_h inputgen_h, int idx, efl_util_input_touch_type_e touch_type, int x, int y);
379
380 /**
381    * @platform
382    * @brief Generates a pointer event using a opened device.
383    * @since_tizen 3.0
384    * @privlevel platform
385    * @privilege %http://tizen.org/privilege/inputgenerator
386    * @param[in] inputgen_h The #efl_util_inputgen_h handle
387    * @param[in] buttons The number of button
388    * @param[in] pointer_type The pointer type (ex> #EFL_UTIL_INPUT_POINTER_BUTTON_PRESS, #EFL_UTIL_INPUT_POINTER_BUTTON_UP, #EFL_UTIL_INPUT_POINTER_MOVE)
389    * @param[in] x x coordination to move
390    * @param[in] y y coordination to move
391    * @return @c 0 on success, otherwise a negative error value
392    * @retval #EFL_UTIL_ERROR_NONE Successful
393    * @retval #EFL_UTIL_ERROR_INVALID_PARAMETER Invalid parameter
394    * @retval #EFL_UTIL_ERROR_PERMISSION_DENIED Has no permission to generate pointer
395    * @retval #EFL_UTIL_ERROR_NO_SUCH_DEVICE No such device or address
396    * @retval #EFL_UTIL_ERROR_OUT_OF_MEMORY Memory allocation failure
397    */
398 API int efl_util_input_generate_pointer(efl_util_inputgen_h inputgen_h, int buttons, efl_util_input_pointer_type_e pointer_type, int x, int y);
399
400 /**
401  * @}
402  */
403
404 /**
405  * @addtogroup CAPI_EFL_UTIL_SCREENSHOT_MODULE
406  * @{
407  */
408
409 /**
410  * @platform
411  * @brief Definition for the screenshot handle.
412  * @since_tizen $TZ_CFG_VER_24_OR_30$
413  */
414 typedef struct _efl_util_screenshot_h * efl_util_screenshot_h;
415
416 /**
417  * @platform
418  * @brief Initializes the screenshot.
419  * @since_tizen $TZ_CFG_VER_24_OR_30$
420  * @privlevel platform
421  * @privilege %http://tizen.org/privilege/screenshot
422  * @remarks The specific error code can be obtained using the get_last_result()
423  * method. Error codes are described in Exception section.
424  * @param[in] width width of the screenshot surface
425  * @param[in] height height of the screenshot surface
426  * @return #efl_util_screenshot_h on success, otherwise @c NULL
427  * @retval #efl_util_screenshot_h  The screenshot handle
428  * @exception #EFL_UTIL_ERROR_NONE Successful
429  * @exception #EFL_UTIL_ERROR_INVALID_PARAMETER Invalid parameter
430  * @exception #EFL_UTIL_ERROR_OUT_OF_MEMORY Memory allocation failure
431  * @exception #EFL_UTIL_ERROR_SCREENSHOT_INIT_FAIL Initialization failure
432  * @see efl_util_screenshot_deinitialize()
433  */
434 API efl_util_screenshot_h efl_util_screenshot_initialize(int width, int height);
435
436 /**
437  * @platform
438  * @brief Takes a screenshot and get a tbm_surface handle.
439  * @since_tizen $TZ_CFG_VER_24_OR_30$
440  * @privlevel platform
441  * @privilege %http://tizen.org/privilege/screenshot
442  * @remarks The specific error code can be obtained using the get_last_result()
443  *          The #tbm_surface_h must be free by caller
444  * @param[in] screenshot #efl_util_screenshot_h handle
445  * @return #tbm_surface_h on success, otherwise @c NULL
446  * @retval #tbm_surface_h The TBM surface handle
447  * @exception #EFL_UTIL_ERROR_NONE Successful
448  * @exception #EFL_UTIL_ERROR_INVALID_PARAMETER Invalid parameter
449  * @exception #EFL_UTIL_ERROR_SCREENSHOT_EXECUTION_FAIL Execution failure
450  * @see efl_util_screenshot_initialize()
451  * @see efl_util_screenshot_deinitialize()
452  */
453 API tbm_surface_h efl_util_screenshot_take_tbm_surface(efl_util_screenshot_h screenshot);
454
455 /**
456  * @platform
457  * @brief Deinitializes the screenshot.
458  * @since_tizen $TZ_CFG_VER_24_OR_30$
459  * @privlevel platform
460  * @privilege %http://tizen.org/privilege/screenshot
461  * @param[in]  screenshot  #efl_util_screenshot_h handle
462  * @return @c 0 on success, otherwise a negative error value
463  * @retval #EFL_UTIL_ERROR_NONE Successful
464  * @retval #EFL_UTIL_ERROR_INVALID_PARAMETER Invalid parameter
465  * @see efl_util_screenshot_initialize()
466  */
467 API int efl_util_screenshot_deinitialize(efl_util_screenshot_h screenshot);
468
469 /**
470  * @}
471  */
472
473 /**
474  * @addtogroup CAPI_EFL_UTIL_GESTURE_MODULE
475  * @{
476  */
477
478 /**
479  * @brief Definition for the gesture handle.
480  * @since_tizen 4.0
481  */
482 typedef struct _efl_util_gesture_h * efl_util_gesture_h;
483
484 /**
485  * @brief Definition for the edge swipe gesture event.
486  * @since_tizen 4.0
487  */
488 API extern int EFL_UTIL_EVENT_GESTURE_EDGE_SWIPE;
489
490 /**
491  * @brief Definition for the edge swipe gesture event.
492  * @since_tizen 4.0
493  */
494 API extern int EFL_UTIL_EVENT_GESTURE_EDGE_DRAG;
495
496 /**
497  * @brief Definition for the tap gesture event.
498  * @since_tizen 4.0
499  */
500 API extern int EFL_UTIL_EVENT_GESTURE_TAP;
501
502 /**
503  * @brief Definition for the palm cover gesture event.
504  * @since_tizen 4.0
505  */
506 API extern int EFL_UTIL_EVENT_GESTURE_PALM_COVER;
507
508 /**
509  * @brief Enumeration of gesture type.
510  * @since_tizen 4.0
511  */
512 typedef enum _efl_util_gesture_type_e
513 {
514    EFL_UTIL_GESTURE_TYPE_NONE       = 0,        /**< None gesture type */
515    EFL_UTIL_GESTURE_TYPE_EDGE_SWIPE = (1 << 0), /**< Edge swipe gesture type */
516    EFL_UTIL_GESTURE_TYPE_EDGE_DRAG  = (1 << 1), /**< Edge drag gesture type */
517    EFL_UTIL_GESTURE_TYPE_TAP        = (1 << 2), /**< Tap gesture type */
518    EFL_UTIL_GESTURE_TYPE_PALM_COVER = (1 << 3), /**< Palm cover gesture type */
519    EFL_UTIL_GESTURE_TYPE_PAN        = (1 << 4), /**< Pan gesture type */
520    EFL_UTIL_GESTURE_TYPE_PINCH      = (1 << 5), /**< Pinch gesture type */
521    EFL_UTIL_GESTURE_TYPE_PALM_SWIPE = (1 << 6)  /**< Palm swipe gesture type */
522 } efl_util_gesture_type_e;
523
524 /**
525  * @brief Enumeration of gesture mode.
526  * @since_tizen 4.0
527  */
528 typedef enum _efl_util_gesture_mode_e
529 {
530    EFL_UTIL_GESTURE_MODE_NONE    = 0, /**< None gesture mode */
531    EFL_UTIL_GESTURE_MODE_BEGIN,       /**< Begin a gesture event */
532    EFL_UTIL_GESTURE_MODE_UPDATE,      /**< continually update a gesture event */
533    EFL_UTIL_GESTURE_MODE_END,         /**< End a gesture event */
534    EFL_UTIL_GESTURE_MODE_DONE         /**< Occur a gesture event */
535 } efl_util_gesture_mode_e;
536
537 /**
538  * @brief Enumeration of gesture edge.
539  * @since_tizen 4.0
540  */
541 typedef enum _efl_util_gesture_edge_e
542 {
543    EFL_UTIL_GESTURE_EDGE_NONE    = 0, /**< None edge point */
544    EFL_UTIL_GESTURE_EDGE_TOP,         /**< Top edge position of screen */
545    EFL_UTIL_GESTURE_EDGE_RIGHT,       /**< Right edge position of screen */
546    EFL_UTIL_GESTURE_EDGE_BOTTOM,      /**< Bottom edge position of screen */
547    EFL_UTIL_GESTURE_EDGE_LEFT         /**< Left edge position of screen */
548 } efl_util_gesture_edge_e;
549
550 /**
551  * @brief Enumeration of gesture edge size.
552  * @since_tizen 4.0
553  */
554 typedef enum _efl_util_gesture_edge_size_e
555 {
556    EFL_UTIL_GESTURE_EDGE_SIZE_NONE,    /**< None size of edge */
557    EFL_UTIL_GESTURE_EDGE_SIZE_FULL,    /**< Full size in the edge */
558    EFL_UTIL_GESTURE_EDGE_SIZE_PARTIAL  /**< Part of edge */
559 } efl_util_gesture_edge_size_e;
560
561 /**
562  * @brief Definition for the gesture data handle.
563  * @since_tizen 4.0
564  */
565 typedef void *efl_util_gesture_data;
566
567 /**
568  * @brief Definition for the edge swipe gesture's event data structure.
569  * @since_tizen 4.0
570  */
571 typedef struct _efl_util_event_gesture_edge_swipe_s
572 {
573    efl_util_gesture_mode_e mode;  /**< Mode of a gesture event */
574    unsigned int fingers;          /**< Number of fingers */
575    int sx;                        /**< Start x point of edge area */
576    int sy;                        /**< Start y point of edge area */
577    unsigned int edge;             /**< Start edge location */
578 } efl_util_event_gesture_edge_swipe_s;
579
580 /**
581  * @brief Definition for the edge drag gesture's event data structure.
582  * @since_tizen 4.0
583  */
584 typedef struct efl_util_event_gesture_edge_drag_s
585 {
586    efl_util_gesture_mode_e mode;  /**< Mode of a gesture event */
587    unsigned int fingers;          /**< Number of fingers */
588    int cx;                        /**< Center x point of edge area */
589    int cy;                        /**< Center y point of edge area */
590    unsigned int edge;             /**< Start edge location */
591 } efl_util_event_gesture_edge_drag_s;
592
593 /**
594  * @brief Definition for the tap gesture's event data structure.
595  * @since_tizen 4.0
596  */
597 typedef struct _efl_util_event_gesture_tap_s
598 {
599    efl_util_gesture_mode_e mode;  /**< Mode of a gesture event */
600    unsigned int fingers;          /**< Number of fingers */
601    unsigned int repeats;          /**< Number of tap repeats */
602 } efl_util_event_gesture_tap_s;
603
604 /**
605  * @brief Definition for the palm cover gesture's event data structure.
606  * @since_tizen 4.0
607  */
608 typedef struct _efl_util_event_gesture_palm_cover_s
609 {
610    efl_util_gesture_mode_e mode;  /**< Mode of a gesture event */
611    unsigned int duration;         /**< Duration time of gesture behavior */
612    int cx;                        /**< Center x point of edge area */
613    int cy;                        /**< Center y point of edge area */
614    unsigned int size;             /**< Size of touched area */
615    double pressure;               /**< Pressure of touched finger */
616 } efl_util_event_gesture_palm_cover_s;
617
618 /**
619  * @brief Initializes system and check if global gestures are supported.
620  * @since_tizen 4.0
621  * @remarks The specific error code can be obtained using the get_last_result() method.
622  *          Error codes are described in Exception section.
623  * @return #efl_util_gesture_h on success, otherwise @c NULL
624  * @retval #efl_util_gesture_h The global gesture handle
625  * @exception #EFL_UTIL_ERROR_NONE Successful
626  * @exception #EFL_UTIL_ERROR_OUT_OF_MEMORY Memory allocation failure
627  * @exception #EFL_UTIL_ERROR_NOT_SUPPORTED Not supported
628  * @exception #EFL_UTIL_ERROR_NO_RESOURCE_AVAILABLE Resource is not available
629  * @see efl_util_gesture_deinitialize()
630  */
631 API efl_util_gesture_h efl_util_gesture_initialize(void);
632
633 /**
634  * @brief Deinitializes system.
635  * @since_tizen 4.0
636  * @param[in] gesture_h The #efl_util_gesture_h handle
637  * @return @c 0 on success, otherwise a negative error value
638  * @retval #EFL_UTIL_ERROR_NONE Successful
639  * @retval #EFL_UTIL_ERROR_INVALID_PARAMETER Invalid parameter
640  * @see efl_util_gesture_initialize()
641  */
642 API int efl_util_gesture_deinitialize(efl_util_gesture_h gesture_h);
643
644 /**
645  * @brief Generates a edge swipe gesture's grab info handle.
646  * @since_tizen 4.0
647  * @param[in] gesture_h The #efl_util_gesture_h handle
648  * @param[in] fingers   The number of fingers
649  * @param[in] edge      The position of edge
650  * @remarks The specific error code can be obtained using the get_last_result() method.
651  *          Error codes are described in Exception section.
652  * @return #efl_util_gesture_data on success, otherwise @c NULL
653  * @retval #efl_util_gesture_data The specific gesture data handle
654  * @exception #EFL_UTIL_ERROR_NONE Successful
655  * @exception #EFL_UTIL_ERROR_OUT_OF_MEMORY Memory allocation failure
656  * @exception #EFL_UTIL_ERROR_INVALID_PARAMETER Invalid parameter
657  * @exception #EFL_UTIL_ERROR_NO_RESOURCE_AVAILABLE Resource is not available
658  */
659 API efl_util_gesture_data efl_util_gesture_edge_swipe_new(efl_util_gesture_h gesture_h, unsigned int fingers, efl_util_gesture_edge_e edge);
660
661 /**
662  * @brief Frees a memory of edge swipe gesture's grab info handle.
663  * @since_tizen 4.0
664  * @param[in] gesture_h The #efl_util_gesture_h handle
665  * @param[in] data      The #efl_util_gesture_data handle
666  * @return @c 0 on success, otherwise a negative error value
667  * @retval #EFL_UTIL_ERROR_NONE Successful
668  * @retval #EFL_UTIL_ERROR_INVALID_PARAMETER Invalid parameter
669  */
670 API int efl_util_gesture_edge_swipe_free(efl_util_gesture_h gesture_h, efl_util_gesture_data data);
671
672
673 /**
674  * @brief Sets a specific size of edge for edge swipe gesture.
675  * @since_tizen 4.0
676  * @param[in] data        The #efl_util_gesture_data handle
677  * @param[in] edge_size   The #efl_util_gesture_edge_size_e enum
678  * @param[in] start_point The start point of edge area
679  * @param[in] end_point   The end point of edge area
680  * @return @c 0 on success, otherwise a negative error value
681  * @retval #EFL_UTIL_ERROR_NONE Successful
682  * @retval #EFL_UTIL_ERROR_INVALID_PARAMETER Invalid parameter
683  * @retval #EFL_UTIL_ERROR_NO_RESOURCE_AVAILABLE Resource is not available
684  */
685 API int efl_util_gesture_edge_swipe_size_set(efl_util_gesture_data data, efl_util_gesture_edge_size_e edge_size, unsigned int start_point, unsigned int end_point);
686
687 /**
688  * @brief Generates a edge drag gesture's grab info handle.
689  * @since_tizen 4.0
690  * @param[in] gesture_h The #efl_util_gesture_h handle
691  * @param[in] fingers   The number of fingers
692  * @param[in] edge      The position of edge
693  * @remarks The specific error code can be obtained using the get_last_result() method.
694  *          Error codes are described in Exception section.
695  * @return #efl_util_gesture_data on success, otherwise @c NULL
696  * @retval #efl_util_gesture_data The specific gesture data handle
697  * @exception #EFL_UTIL_ERROR_NONE Successful
698  * @exception #EFL_UTIL_ERROR_OUT_OF_MEMORY Memory allocation failure
699  * @exception #EFL_UTIL_ERROR_INVALID_PARAMETER Invalid parameter
700  * @exception #EFL_UTIL_ERROR_NO_RESOURCE_AVAILABLE Resource is not available
701  */
702 API efl_util_gesture_data efl_util_gesture_edge_drag_new(efl_util_gesture_h gesture_h, unsigned int fingers, efl_util_gesture_edge_e edge);
703
704 /**
705  * @brief Frees a memory of edge drag gesture's grab info handle.
706  * @since_tizen 4.0
707  * @param[in] gesture_h The #efl_util_gesture_h handle
708  * @param[in] data      The #efl_util_gesture_data handle
709  * @return @c 0 on success, otherwise a negative error value
710  * @retval #EFL_UTIL_ERROR_NONE Successful
711  * @retval #EFL_UTIL_ERROR_INVALID_PARAMETER Invalid parameter
712  */
713 API int efl_util_gesture_edge_drag_free(efl_util_gesture_h gesture_h, efl_util_gesture_data data);
714
715 /**
716  * @brief Sets a specific size of edge for edge drag gesture.
717  * @since_tizen 4.0
718  * @param[in] data        The #efl_util_gesture_data handle
719  * @param[in] edge_size   The #efl_util_gesture_edge_size_e enum
720  * @param[in] start_point The start point of edge area
721  * @param[in] end_point   The end point of edge area
722  * @return @c 0 on success, otherwise a negative error value
723  * @retval #EFL_UTIL_ERROR_NONE Successful
724  * @retval #EFL_UTIL_ERROR_INVALID_PARAMETER Invalid parameter
725  * @retval #EFL_UTIL_ERROR_NO_RESOURCE_AVAILABLE Resource is not available
726  */
727 API int efl_util_gesture_edge_drag_size_set(efl_util_gesture_data data, efl_util_gesture_edge_size_e edge_size, unsigned int start_point, unsigned int end_point);
728
729 /**
730  * @brief Generates a tap gesture's grab info handle.
731  * @since_tizen 4.0
732  * @param[in] gesture_h The #efl_util_gesture_h handle
733  * @param[in] fingers   The number of fingers
734  * @param[in] repeats   The number of repeats
735  * @remarks The specific error code can be obtained using the get_last_result() method.
736  *          Error codes are described in Exception section.
737  * @return #efl_util_gesture_data on success, otherwise @c NULL
738  * @retval #efl_util_gesture_data The specific gesture data handle
739  * @exception #EFL_UTIL_ERROR_NONE Successful
740  * @exception #EFL_UTIL_ERROR_OUT_OF_MEMORY Memory allocation failure
741  * @exception #EFL_UTIL_ERROR_INVALID_PARAMETER Invalid parameter
742  * @exception #EFL_UTIL_ERROR_NO_RESOURCE_AVAILABLE Resource is not available
743  */
744 API efl_util_gesture_data efl_util_gesture_tap_new(efl_util_gesture_h gesture_h, unsigned int fingers, unsigned int repeats);
745
746 /**
747  * @brief Frees a memory of tap gesture's grab info handle.
748  * @since_tizen 4.0
749  * @param[in] gesture_h The #efl_util_gesture_h handle
750  * @param[in] data      The #efl_util_gesture_data handle
751  * @return @c 0 on success, otherwise a negative error value
752  * @retval #EFL_UTIL_ERROR_NONE Successful
753  * @retval #EFL_UTIL_ERROR_INVALID_PARAMETER Invalid parameter
754  */
755 API int efl_util_gesture_tap_free(efl_util_gesture_h gesture_h, efl_util_gesture_data data);
756
757 /**
758  * @brief Generates a palm cover gesture's grab info handle.
759  * @since_tizen 4.0
760  * @param[in] gesture_h The #efl_util_gesture_h handle
761  * @remarks The specific error code can be obtained using the get_last_result() method.
762  *          Error codes are described in Exception section.
763  * @return #efl_util_gesture_data on success, otherwise @c NULL
764  * @retval #efl_util_gesture_data The specific gesture data handle
765  * @exception #EFL_UTIL_ERROR_NONE Successful
766  * @exception #EFL_UTIL_ERROR_OUT_OF_MEMORY Memory allocation failure
767  * @exception #EFL_UTIL_ERROR_INVALID_PARAMETER Invalid parameter
768  * @exception #EFL_UTIL_ERROR_NO_RESOURCE_AVAILABLE Resource is not available
769  */
770 API efl_util_gesture_data efl_util_gesture_palm_cover_new(efl_util_gesture_h gesture_h);
771
772 /**
773  * @brief Frees a memory of palm cover gesture's grab info handle.
774  * @since_tizen 4.0
775  * @param[in] gesture_h The #efl_util_gesture_h handle
776  * @param[in] data      The #efl_util_gesture_data handle
777  * @return @c 0 on success, otherwise a negative error value
778  * @retval #EFL_UTIL_ERROR_NONE Successful
779  * @retval #EFL_UTIL_ERROR_INVALID_PARAMETER Invalid parameter
780  */
781 API int efl_util_gesture_palm_cover_free(efl_util_gesture_h gesture_h, efl_util_gesture_data data);
782
783 /**
784  * @platform
785  * @brief Grabs a global gesture.
786  * @since_tizen 4.0
787  * @privlevel platform
788  * @privilege %http://tizen.org/privilege/gesturegrab
789  * @param[in] gesture_h The #efl_util_gesture_h handle
790  * @param[in] data      The #efl_util_gesture_data handle.
791  * @return @c 0 on success, otherwise a negative error value
792  * @retval #EFL_UTIL_ERROR_NONE Successful
793  * @retval #EFL_UTIL_ERROR_INVALID_PARAMETER Invalid parameter
794  * @retval #EFL_UTIL_ERROR_PERMISSION_DENIED Permission denied
795  * @retval #EFL_UTIL_ERROR_OUT_OF_MEMORY Memory allocation failure
796  * @retval #EFL_UTIL_ERROR_NOT_SUPPORTED Not supported
797  * @retval #EFL_UTIL_ERROR_NO_RESOURCE_AVAILABLE Resource is not available
798  */
799 API int efl_util_gesture_grab(efl_util_gesture_h gesture_h, efl_util_gesture_data data);
800
801 /**
802  * @platform
803  * @brief Ungrabs a global gesture.
804  * @since_tizen 4.0
805  * @privlevel platform
806  * @privilege %http://tizen.org/privilege/gesturegrab
807  * @param[in] gesture_h The #efl_util_gesture_h handle
808  * @param[in] data      The #efl_util_gesture_data handle.
809  * @return @c 0 on success, otherwise a negative error value
810  * @retval #EFL_UTIL_ERROR_NONE Successful
811  * @retval #EFL_UTIL_ERROR_INVALID_PARAMETER Invalid parameter
812  * @retval #EFL_UTIL_ERROR_PERMISSION_DENIED Permission denied
813  * @retval #EFL_UTIL_ERROR_OUT_OF_MEMORY Memory allocation failure
814  * @retval #EFL_UTIL_ERROR_NOT_SUPPORTED Not supported
815  * @retval #EFL_UTIL_ERROR_NO_RESOURCE_AVAILABLE Resource is not available
816  */
817 API int efl_util_gesture_ungrab(efl_util_gesture_h gesture_h, efl_util_gesture_data data);
818
819 /**
820  * @brief Selects a global gesture on given window.
821  * @since_tizen 4.0
822  * @param[in] gesture_h The #efl_util_gesture_h handle
823  * @param[in] window    The efl window
824  * @param[in] data      The #efl_util_gesture_data handle.
825  * @return @c 0 on success, otherwise a negative error value
826  * @retval #EFL_UTIL_ERROR_NONE Successful
827  * @retval #EFL_UTIL_ERROR_INVALID_PARAMETER Invalid parameter
828  * @retval #EFL_UTIL_ERROR_OUT_OF_MEMORY Memory allocation failure
829  * @retval #EFL_UTIL_ERROR_NO_RESOURCE_AVAILABLE Resource is not available
830  */
831 API int efl_util_gesture_select(efl_util_gesture_h gesture_h, Evas_Object *window, efl_util_gesture_data data);
832
833 /**
834  * @brief Deselects a global gesture on given window.
835  * @since_tizen 4.0
836  * @param[in] gesture_h The #efl_util_gesture_h handle
837  * @param[in] window    The efl window
838  * @param[in] data      The #efl_util_gesture_data handle
839  * @return @c 0 on success, otherwise a negative error value
840  * @retval #EFL_UTIL_ERROR_NONE Successful
841  * @retval #EFL_UTIL_ERROR_INVALID_PARAMETER Invalid parameter
842  * @retval #EFL_UTIL_ERROR_OUT_OF_MEMORY Memory allocation failure
843  * @retval #EFL_UTIL_ERROR_NO_RESOURCE_AVAILABLE Resource is not available
844  */
845 API int efl_util_gesture_deselect(efl_util_gesture_h gesture_h, Evas_Object *window, efl_util_gesture_data data);
846
847 /**
848  * @platform
849  * @brief Activates or deactivates a global gesture.
850  * @since_tizen 4.0
851  * @privlevel platform
852  * @privilege %http://tizen.org/privilege/gestureactivation
853  * @param[in] gesture_h The #efl_util_gesture_h handle
854  * @param[in] type      The gesture type to activate /deactivate combined by #efl_util_gesture_type_e to bitwise operation
855  * @param[in] active    The activated boolean value
856  * @return @c 0 on success, otherwise a negative error value
857  * @retval #EFL_UTIL_ERROR_NONE Successful
858  * @retval #EFL_UTIL_ERROR_INVALID_PARAMETER Invalid parameter
859  * @retval #EFL_UTIL_ERROR_PERMISSION_DENIED Permission denied
860  * @retval #EFL_UTIL_ERROR_OUT_OF_MEMORY Memory allocation failure
861  * @retval #EFL_UTIL_ERROR_NO_RESOURCE_AVAILABLE Resource is not available
862  */
863 API int efl_util_gesture_activate_set(efl_util_gesture_h gesture_h, unsigned int type, Eina_Bool active);
864
865 /**
866  * @brief Activates or deactivates a global gesture on given window.
867  * @since_tizen 4.0
868  * @param[in] gesture_h The #efl_util_gesture_h handle
869  * @param[in] window    The efl window
870  * @param[in] type      The gesture type to activate /deactivate combined by #efl_util_gesture_type_e to bitwise operation
871  * @param[in] active    The activated boolean value
872  * @return @c 0 on success, otherwise a negative error value
873  * @retval #EFL_UTIL_ERROR_NONE Successful
874  * @retval #EFL_UTIL_ERROR_INVALID_PARAMETER Invalid parameter
875  * @retval #EFL_UTIL_ERROR_OUT_OF_MEMORY Memory allocation failure
876  * @retval #EFL_UTIL_ERROR_NO_RESOURCE_AVAILABLE Resource is not available
877  */
878 API int efl_util_gesture_activate_set_on_window(efl_util_gesture_h gesture_h, Evas_Object *window, unsigned int type, Eina_Bool active);
879
880 /**
881  * @}
882  */
883
884 #ifdef __cplusplus
885 }
886 #endif
887 #endif /* __TIZEN_UI_EFL_UTIL_H__ */