2 * Copyright (c) 2011-2017 Samsung Electronics Co., Ltd All Rights Reserved
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
17 #ifndef __TIZEN_UI_EFL_UTIL_H__
18 #define __TIZEN_UI_EFL_UTIL_H__
22 #include <tbm_surface.h>
31 # define API __attribute__ ((visibility("default")))
41 * @addtogroup CAPI_EFL_UTIL_WIN_PROPERTY_MODULE
46 * @brief Enumeration for EFL UTIL ERROR.
47 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
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) */
65 * @brief Enumeration of notification window's priority level.
66 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
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;
78 * @brief Enumeration of screen mode.
79 * @since_tizen $TZ_CFG_VER_24_OR_30$
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;
88 * @brief Sets the priority level for the specified notification window.
89 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
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
103 API int efl_util_set_notification_window_level(Evas_Object *window, efl_util_notification_level_e level);
106 * @brief Gets the priority level for the specified notification window.
107 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
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
119 API int efl_util_get_notification_window_level(Evas_Object *window, efl_util_notification_level_e *level);
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
134 API int efl_util_set_window_opaque_state(Evas_Object *window, int opaque);
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$
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
155 API int efl_util_set_window_screen_mode(Evas_Object *window, efl_util_screen_mode_e mode);
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
166 API int efl_util_get_window_screen_mode(Evas_Object *window, efl_util_screen_mode_e *mode);
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.
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()
189 API int efl_util_set_window_brightness(Evas_Object *window, int brightness);
192 * @brief Gets the user's preferred brightness of the specified window.
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()
201 API int efl_util_get_window_brightness(Evas_Object *window, int *brightness);
209 * @addtogroup CAPI_EFL_UTIL_INPUT_MODULE
215 * @brief Definition for the input generator handle.
216 * @since_tizen $TZ_CFG_VER_24_OR_30$
219 typedef struct _efl_util_inputgen_h * efl_util_inputgen_h;
223 * @brief Enumeration of device type generated events.
224 * @since_tizen $TZ_CFG_VER_24_OR_30$
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;
239 * @brief Enumeration of touch event types.
240 * @since_tizen $TZ_CFG_VER_24_OR_30$
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;
253 * @brief Enumeration of pointer event types.
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;
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 * @see efl_util_input_deinitialize_generator()
281 API efl_util_inputgen_h efl_util_input_initialize_generator(unsigned int dev_type);
285 * @brief Initializes system, check input generate functions are supported and then open events generator devices with given name.
287 * @privlevel platform
288 * @privilege %http://tizen.org/privilege/inputgenerator
289 * @remarks The specific error code can be obtained using the get_last_result() method. Error codes are described in Exception section.
290 * @remarks The dev_type is changed into the unsigned int to perform bitwise operations.
291 * @param[in] dev_type The device type want to generate events (ex> #EFL_UTIL_INPUT_DEVTYPE_TOUCHSCREEN | #EFL_UTIL_INPUT_DEVTYPE_KEYBOARD)
292 * @param[in] name The device name (maximum 31 characters)
293 * @return #efl_util_inputgen_h on success, otherwise @c NULL
294 * @retval #efl_util_inputgen_h The input generator handle
295 * @exception #EFL_UTIL_ERROR_NONE Successful
296 * @exception #EFL_UTIL_ERROR_INVALID_PARAMETER Invalid parameter
297 * @exception #EFL_UTIL_ERROR_NO_SUCH_DEVICE No such device or address
298 * @exception #EFL_UTIL_ERROR_INVALID_OPERATION Function not implemented
299 * @exception #EFL_UTIL_ERROR_OUT_OF_MEMORY Memory allocation failure
300 * @see efl_util_input_deinitialize_generator()
302 API efl_util_inputgen_h efl_util_input_initialize_generator_with_name(unsigned int dev_type, const char *name);
306 * @brief Deinitializes system and close opened devices.
307 * @since_tizen $TZ_CFG_VER_24_OR_30$
308 * @privlevel platform
309 * @privilege %http://tizen.org/privilege/inputgenerator
310 * @param[in] inputgen_h The #efl_util_inputgen_h handle
311 * @return @c 0 on success, otherwise a negative error value
312 * @retval #EFL_UTIL_ERROR_NONE Successful
313 * @retval #EFL_UTIL_ERROR_INVALID_PARAMETER Invalid parameter
314 * @see efl_util_input_initialize_generator()
316 API int efl_util_input_deinitialize_generator(efl_util_inputgen_h inputgen_h);
320 * @brief Generates all of key events using a opened device.
321 * @since_tizen $TZ_CFG_VER_24_OR_30$
322 * @privlevel platform
323 * @privilege %http://tizen.org/privilege/inputgenerator
324 * @param[in] inputgen_h The #efl_util_inputgen_h handle
325 * @param[in] key_name The key name want to generate
326 * @param[in] pressed The value that select key press or release (0: release, 1: press)
327 * @return @c 0 on success, otherwise a negative error value
328 * @retval #EFL_UTIL_ERROR_NONE Successful
329 * @retval #EFL_UTIL_ERROR_INVALID_PARAMETER Invalid parameter
330 * @retval #EFL_UTIL_ERROR_PERMISSION_DENIED Has no permission to generate key
332 API int efl_util_input_generate_key(efl_util_inputgen_h inputgen_h, const char *key_name, int pressed);
336 * @brief Generates a touch event using a opened device.
337 * @since_tizen $TZ_CFG_VER_24_OR_30$
338 * @privlevel platform
339 * @privilege %http://tizen.org/privilege/inputgenerator
340 * @param[in] inputgen_h The #efl_util_inputgen_h handle
341 * @param[in] idx The index of touched finger
342 * @param[in] touch_type The touch type (ex> #EFL_UTIL_INPUT_TOUCH_BEGIN, #EFL_UTIL_INPUT_TOUCH_UPDATE, #EFL_UTIL_INPUT_TOUCH_END)
343 * @param[in] x The x axis of touch point
344 * @param[in] y The y axis of touch point
345 * @return @c 0 on success, otherwise a negative error value
346 * @retval #EFL_UTIL_ERROR_NONE Successful
347 * @retval #EFL_UTIL_ERROR_INVALID_PARAMETER Invalid parameter
348 * @retval #EFL_UTIL_ERROR_PERMISSION_DENIED Has no permission to generate touch
350 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);
354 * @brief Generate a pointer event using a opened device.
356 * @privlevel platform
357 * @privilege %http://tizen.org/privilege/inputgenerator
358 * @param[in] inputgen_h The #efl_util_inputgen_h handle
359 * @param[in] buttons The number of button
360 * @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)
361 * @param[in] x x coordination to move
362 * @param[in] y y coordination to move
363 * @return @c 0 on success, otherwise a negative error value
364 * @retval #EFL_UTIL_ERROR_NONE Successful
365 * @retval #EFL_UTIL_ERROR_INVALID_PARAMETER Invalid parameter
366 * @retval #EFL_UTIL_ERROR_PERMISSION_DENIED Has no permission to generate pointer
367 * @retval #EFL_UTIL_ERROR_NO_SUCH_DEVICE No such device or address
368 * @retval #EFL_UTIL_ERROR_OUT_OF_MEMORY Memory allocation failure
370 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);
377 * @addtogroup CAPI_EFL_UTIL_SCREENSHOT_MODULE
383 * @brief Definition for the screenshot handle.
384 * @since_tizen $TZ_CFG_VER_24_OR_30$
386 typedef struct _efl_util_screenshot_h * efl_util_screenshot_h;
390 * @brief Initializes the screenshot.
391 * @since_tizen $TZ_CFG_VER_24_OR_30$
392 * @privlevel platform
393 * @privilege %http://tizen.org/privilege/screenshot
394 * @remarks The specific error code can be obtained using the get_last_result()
395 * method. Error codes are described in Exception section.
396 * @param[in] width width of the screenshot surface
397 * @param[in] height height of the screenshot surface
398 * @return #efl_util_screenshot_h on success, otherwise @c NULL
399 * @retval #efl_util_screenshot_h The screenshot handle
400 * @exception #EFL_UTIL_ERROR_NONE Successful
401 * @exception #EFL_UTIL_ERROR_INVALID_PARAMETER Invalid parameter
402 * @exception #EFL_UTIL_ERROR_OUT_OF_MEMORY Memory allocation failure
403 * @exception #EFL_UTIL_ERROR_SCREENSHOT_INIT_FAIL Initialization failure
404 * @see efl_util_screenshot_deinitialize()
406 API efl_util_screenshot_h efl_util_screenshot_initialize(int width, int height);
410 * @brief Takes a screenshot and get a tbm_surface handle.
411 * @since_tizen $TZ_CFG_VER_24_OR_30$
412 * @privlevel platform
413 * @privilege %http://tizen.org/privilege/screenshot
414 * @remarks The specific error code can be obtained using the get_last_result()
415 * The #tbm_surface_h must be free by caller
416 * @param[in] screenshot efl_util_screenshot_h handle
417 * @return #tbm_surface_h on success, otherwise @c NULL
418 * @retval #tbm_surface_h The TBM surface handle
419 * @exception #EFL_UTIL_ERROR_NONE Successful
420 * @exception #EFL_UTIL_ERROR_INVALID_PARAMETER Invalid parameter
421 * @exception #EFL_UTIL_ERROR_SCREENSHOT_EXECUTION_FAIL Execution failure
422 * @see efl_util_screenshot_initialize()
423 * @see efl_util_screenshot_deinitialize()
425 API tbm_surface_h efl_util_screenshot_take_tbm_surface(efl_util_screenshot_h screenshot);
429 * @brief Deinitializes the screenshot.
430 * @since_tizen $TZ_CFG_VER_24_OR_30$
431 * @privlevel platform
432 * @privilege %http://tizen.org/privilege/screenshot
433 * @param[in] screenshot efl_util_screenshot_h handle
434 * @return @c 0 on success, otherwise a negative error value
435 * @retval #EFL_UTIL_ERROR_NONE Successful
436 * @retval #EFL_UTIL_ERROR_INVALID_PARAMETER Invalid parameter
437 * @see efl_util_screenshot_initialize()
439 API int efl_util_screenshot_deinitialize(efl_util_screenshot_h screenshot);
446 * @addtogroup CAPI_EFL_UTIL_GESTURE_MODULE
451 * @brief Definition for the gesture handle.
454 typedef struct _efl_util_gesture_h * efl_util_gesture_h;
457 * @brief Definition for the edge swipe gesture event.
460 API extern int EFL_UTIL_EVENT_GESTURE_EDGE_SWIPE;
463 * @brief Definition for the edge swipe gesture event.
466 API extern int EFL_UTIL_EVENT_GESTURE_EDGE_DRAG;
469 * @brief Definition for the tap gesture event.
472 API extern int EFL_UTIL_EVENT_GESTURE_TAP;
475 * @brief Definition for the palm cover gesture event.
478 API extern int EFL_UTIL_EVENT_GESTURE_PALM_COVER;
481 * @brief Enumeration of gesture type
484 typedef enum _efl_util_gesture_type_e
486 EFL_UTIL_GESTURE_TYPE_NONE = 0, /**< None gesture type */
487 EFL_UTIL_GESTURE_TYPE_EDGE_SWIPE = (1 << 0), /**< Edge swipe gesture type */
488 EFL_UTIL_GESTURE_TYPE_EDGE_DRAG = (1 << 1), /**< Edge drag gesture type */
489 EFL_UTIL_GESTURE_TYPE_TAP = (1 << 2), /**< Tap gesture type */
490 EFL_UTIL_GESTURE_TYPE_PALM_COVER = (1 << 3), /**< Palm cover gesture type */
491 EFL_UTIL_GESTURE_TYPE_PAN = (1 << 4), /**< Pan gesture type */
492 EFL_UTIL_GESTURE_TYPE_PINCH = (1 << 5), /**< Pinch gesture type */
493 EFL_UTIL_GESTURE_TYPE_PALM_SWIPE = (1 << 6) /**< Palm swipe gesture type */
494 } efl_util_gesture_type_e;
497 * @brief Enumeration of gesture mode
500 typedef enum _efl_util_gesture_mode_e
502 EFL_UTIL_GESTURE_MODE_NONE = 0, /**< None gesture mode */
503 EFL_UTIL_GESTURE_MODE_BEGIN, /**< Begin a gesture event */
504 EFL_UTIL_GESTURE_MODE_UPDATE, /**< continually update a gesture event */
505 EFL_UTIL_GESTURE_MODE_END, /**< End a gesture event */
506 EFL_UTIL_GESTURE_MODE_DONE /**< Occur a gesture event */
507 } efl_util_gesture_mode_e;
510 * @brief Enumeration of gesture edge
513 typedef enum _efl_util_gesture_edge_e
515 EFL_UTIL_GESTURE_EDGE_NONE = 0, /**< None edge point */
516 EFL_UTIL_GESTURE_EDGE_TOP, /**< Top edge position of screen */
517 EFL_UTIL_GESTURE_EDGE_RIGHT, /**< Right edge position of screen */
518 EFL_UTIL_GESTURE_EDGE_BOTTOM, /**< Bottom edge position of screen */
519 EFL_UTIL_GESTURE_EDGE_LEFT /**< Left edge position of screen */
520 } efl_util_gesture_edge_e;
523 * @brief Enumeration of gesture edge size
526 typedef enum _efl_util_gesture_edge_size_e
528 EFL_UTIL_GESTURE_EDGE_SIZE_NONE, /**< None size of edge */
529 EFL_UTIL_GESTURE_EDGE_SIZE_FULL, /**< Full size in the edge */
530 EFL_UTIL_GESTURE_EDGE_SIZE_PARTIAL /**< Part of edge */
531 } efl_util_gesture_edge_size_e;
534 * @brief Definition for the gesture data handle
537 typedef void *efl_util_gesture_data;
540 * @brief Definition for the edge swipe gesture's event data structure
543 typedef struct _efl_util_event_gesture_edge_swipe_s
545 efl_util_gesture_mode_e mode; /**< Mode of a gesture event */
546 unsigned int fingers; /**< Number of fingers */
547 int sx; /**< Start x point of edge area */
548 int sy; /**< Start y point of edge area */
549 unsigned int edge; /**< Start edge location */
550 } efl_util_event_gesture_edge_swipe_s;
553 * @brief Definition for the edge drag gesture's event data structure
556 typedef struct efl_util_event_gesture_edge_drag_s
558 efl_util_gesture_mode_e mode; /**< Mode of a gesture event */
559 unsigned int fingers; /**< Number of fingers */
560 int cx; /**< Center x point of edge area */
561 int cy; /**< Center y point of edge area */
562 unsigned int edge; /**< Start edge location */
563 } efl_util_event_gesture_edge_drag_s;
566 * @brief Definition for the tap gesture's event data structure
569 typedef struct _efl_util_event_gesture_tap_s
571 efl_util_gesture_mode_e mode; /**< Mode of a gesture event */
572 unsigned int fingers; /**< Number of fingers */
573 unsigned int repeats; /**< Number of tap repeats */
574 } efl_util_event_gesture_tap_s;
577 * @brief Definition for the palm cover gesture's event data structure
580 typedef struct _efl_util_event_gesture_palm_cover_s
582 efl_util_gesture_mode_e mode; /**< Mode of a gesture event */
583 unsigned int duration; /**< Duration time of gesture behavior */
584 int cx; /**< Center x point of edge area */
585 int cy; /**< Center y point of edge area */
586 unsigned int size; /**< Size of touched area */
587 double pressure; /**< Pressure of touched finger */
588 } efl_util_event_gesture_palm_cover_s;
591 * @brief Initializes system and check if global gestures are supported.
593 * @remarks The specific error code can be obtained using the get_last_result() method.
594 * Error codes are described in Exception section.
595 * @return #efl_util_gesture_h on success, otherwise @c NULL
596 * @retval #efl_util_gesture_h The global gesture handle
597 * @exception #EFL_UTIL_ERROR_NONE Successful
598 * @exception #EFL_UTIL_ERROR_OUT_OF_MEMORY Memory allocation failure
599 * @exception #EFL_UTIL_ERROR_NOT_SUPPORTED Not supported
600 * @exception #EFL_UTIL_ERROR_NO_RESOURCE_AVAILABLE Resource is not available
601 * @see efl_util_gesture_deinitialize()
603 API efl_util_gesture_h efl_util_gesture_initialize(void);
606 * @brief Deinitializes system.
608 * @param[in] gesture_h The #efl_util_gesture_h handle
609 * @return @c 0 on success, otherwise a negative error value
610 * @retval #EFL_UTIL_ERROR_NONE Successful
611 * @retval #EFL_UTIL_ERROR_INVALID_PARAMETER Invalid parameter
612 * @see efl_util_gesture_initialize()
614 API int efl_util_gesture_deinitialize(efl_util_gesture_h gesture_h);
617 * @brief Generates a edge swipe gesture's grab info handle.
619 * @param[in] gesture_h The #efl_util_gesture_h handle
620 * @param[in] fingers The number of fingers
621 * @param[in] edge The position of edge
622 * @remarks The specific error code can be obtained using the get_last_result() method.
623 * Error codes are described in Exception section.
624 * @return #efl_util_gesture_data on success, otherwise @c NULL
625 * @retval #efl_util_gesture_data The specific gesture data handle
626 * @exception #EFL_UTIL_ERROR_NONE Successful
627 * @exception #EFL_UTIL_ERROR_OUT_OF_MEMORY Memory allocation failure
628 * @exception #EFL_UTIL_ERROR_INVALID_PARAMETER Invalid parameter
629 * @exception #EFL_UTIL_ERROR_NO_RESOURCE_AVAILABLE Resource is not available
631 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);
634 * @brief Frees a memory of edge swipe gesture's grab info handle.
636 * @param[in] gesture_h The #efl_util_gesture_h handle
637 * @param[in] data The #efl_util_gesture_data handle
638 * @return @c 0 on success, otherwise a negative error value
639 * @retval #EFL_UTIL_ERROR_NONE Successful
640 * @retval #EFL_UTIL_ERROR_INVALID_PARAMETER Invalid parameter
642 API int efl_util_gesture_edge_swipe_free(efl_util_gesture_h gesture_h, efl_util_gesture_data data);
646 * @brief Sets a specific size of edge for edge swipe gesture.
648 * @param[in] data The #efl_util_gesture_data handle
649 * @param[in] edge_size The #efl_util_gesture_edge_size_e enum
650 * @param[in] start_point The start point of edge area
651 * @param[in] end_point The end point of edge area
652 * @return @c 0 on success, otherwise a negative error value
653 * @retval #EFL_UTIL_ERROR_NONE Successful
654 * @retval #EFL_UTIL_ERROR_INVALID_PARAMETER Invalid parameter
655 * @retval #EFL_UTIL_ERROR_NO_RESOURCE_AVAILABLE Resource is not available
657 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);
660 * @brief Generates a edge drag gesture's grab info handle.
662 * @param[in] gesture_h The #efl_util_gesture_h handle
663 * @param[in] fingers The number of fingers
664 * @param[in] edge The position of edge
665 * @remarks The specific error code can be obtained using the get_last_result() method.
666 * Error codes are described in Exception section.
667 * @return #efl_util_gesture_data on success, otherwise @c NULL
668 * @retval #efl_util_gesture_data The specific gesture data handle
669 * @exception #EFL_UTIL_ERROR_NONE Successful
670 * @exception #EFL_UTIL_ERROR_OUT_OF_MEMORY Memory allocation failure
671 * @exception #EFL_UTIL_ERROR_INVALID_PARAMETER Invalid parameter
672 * @exception #EFL_UTIL_ERROR_NO_RESOURCE_AVAILABLE Resource is not available
674 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);
677 * @brief Frees a memory of edge drag gesture's grab info handle.
679 * @param[in] gesture_h The #efl_util_gesture_h handle
680 * @param[in] data The #efl_util_gesture_data handle
681 * @return @c 0 on success, otherwise a negative error value
682 * @retval #EFL_UTIL_ERROR_NONE Successful
683 * @retval #EFL_UTIL_ERROR_INVALID_PARAMETER Invalid parameter
685 API int efl_util_gesture_edge_drag_free(efl_util_gesture_h gesture_h, efl_util_gesture_data data);
688 * @brief Sets a specific size of edge for edge drag gesture.
690 * @param[in] data The #efl_util_gesture_data handle
691 * @param[in] edge_size The #efl_util_gesture_edge_size_e enum
692 * @param[in] start_point The start point of edge area
693 * @param[in] end_point The end point of edge area
694 * @return @c 0 on success, otherwise a negative error value
695 * @retval #EFL_UTIL_ERROR_NONE Successful
696 * @retval #EFL_UTIL_ERROR_INVALID_PARAMETER Invalid parameter
697 * @retval #EFL_UTIL_ERROR_NO_RESOURCE_AVAILABLE Resource is not available
699 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);
702 * @brief Generates a tap gesture's grab info handle.
704 * @param[in] gesture_h The #efl_util_gesture_h handle
705 * @param[in] fingers The number of fingers
706 * @param[in] repeats The number of repeats
707 * @remarks The specific error code can be obtained using the get_last_result() method.
708 * Error codes are described in Exception section.
709 * @return #efl_util_gesture_data on success, otherwise @c NULL
710 * @retval #efl_util_gesture_data The specific gesture data handle
711 * @exception #EFL_UTIL_ERROR_NONE Successful
712 * @exception #EFL_UTIL_ERROR_OUT_OF_MEMORY Memory allocation failure
713 * @exception #EFL_UTIL_ERROR_INVALID_PARAMETER Invalid parameter
714 * @exception #EFL_UTIL_ERROR_NO_RESOURCE_AVAILABLE Resource is not available
716 API efl_util_gesture_data efl_util_gesture_tap_new(efl_util_gesture_h gesture_h, unsigned int fingers, unsigned int repeats);
719 * @brief Frees a memory of tap gesture's grab info handle.
721 * @param[in] gesture_h The #efl_util_gesture_h handle
722 * @param[in] data The #efl_util_gesture_data handle
723 * @return @c 0 on success, otherwise a negative error value
724 * @retval #EFL_UTIL_ERROR_NONE Successful
725 * @retval #EFL_UTIL_ERROR_INVALID_PARAMETER Invalid parameter
727 API int efl_util_gesture_tap_free(efl_util_gesture_h gesture_h, efl_util_gesture_data data);
730 * @brief Generates a palm cover gesture's grab info handle.
732 * @param[in] gesture_h The #efl_util_gesture_h handle
733 * @remarks The specific error code can be obtained using the get_last_result() method.
734 * Error codes are described in Exception section.
735 * @return #efl_util_gesture_data on success, otherwise @c NULL
736 * @retval #efl_util_gesture_data The specific gesture data handle
737 * @exception #EFL_UTIL_ERROR_NONE Successful
738 * @exception #EFL_UTIL_ERROR_OUT_OF_MEMORY Memory allocation failure
739 * @exception #EFL_UTIL_ERROR_INVALID_PARAMETER Invalid parameter
740 * @exception #EFL_UTIL_ERROR_NO_RESOURCE_AVAILABLE Resource is not available
742 API efl_util_gesture_data efl_util_gesture_palm_cover_new(efl_util_gesture_h gesture_h);
745 * @brief Frees a memory of palm cover gesture's grab info handle.
747 * @param[in] gesture_h The #efl_util_gesture_h handle
748 * @param[in] data The #efl_util_gesture_data handle
749 * @return @c 0 on success, otherwise a negative error value
750 * @retval #EFL_UTIL_ERROR_NONE Successful
751 * @retval #EFL_UTIL_ERROR_INVALID_PARAMETER Invalid parameter
753 API int efl_util_gesture_palm_cover_free(efl_util_gesture_h gesture_h, efl_util_gesture_data data);
757 * @brief Grabs a global gesture.
759 * @privlevel platform
760 * @privilege %http://tizen.org/privilege/gesturegrab
761 * @param[in] gesture_h The #efl_util_gesture_h handle
762 * @param[in] data The #efl_util_gesture_data handle.
763 * @return @c 0 on success, otherwise a negative error value
764 * @retval #EFL_UTIL_ERROR_NONE Successful
765 * @retval #EFL_UTIL_ERROR_INVALID_PARAMETER Invalid parameter
766 * @retval #EFL_UTIL_ERROR_PERMISSION_DENIED Permission denied
767 * @retval #EFL_UTIL_ERROR_OUT_OF_MEMORY Memory allocation failure
768 * @retval #EFL_UTIL_ERROR_NOT_SUPPORTED Not supported
769 * @retval #EFL_UTIL_ERROR_NO_RESOURCE_AVAILABLE Resource is not available
771 API int efl_util_gesture_grab(efl_util_gesture_h gesture_h, efl_util_gesture_data data);
775 * @brief Ungrabs a global gesture.
777 * @privlevel platform
778 * @privilege %http://tizen.org/privilege/gesturegrab
779 * @param[in] gesture_h The #efl_util_gesture_h handle
780 * @param[in] data The #efl_util_gesture_data handle.
781 * @return @c 0 on success, otherwise a negative error value
782 * @retval #EFL_UTIL_ERROR_NONE Successful
783 * @retval #EFL_UTIL_ERROR_INVALID_PARAMETER Invalid parameter
784 * @retval #EFL_UTIL_ERROR_PERMISSION_DENIED Permission denied
785 * @retval #EFL_UTIL_ERROR_OUT_OF_MEMORY Memory allocation failure
786 * @retval #EFL_UTIL_ERROR_NOT_SUPPORTED Not supported
787 * @retval #EFL_UTIL_ERROR_NO_RESOURCE_AVAILABLE Resource is not available
789 API int efl_util_gesture_ungrab(efl_util_gesture_h gesture_h, efl_util_gesture_data data);
792 * @brief Selects a global gesture on given window.
794 * @param[in] gesture_h The #efl_util_gesture_h handle
795 * @param[in] window The efl window
796 * @param[in] data The #efl_util_gesture_data handle.
797 * @return @c 0 on success, otherwise a negative error value
798 * @retval #EFL_UTIL_ERROR_NONE Successful
799 * @retval #EFL_UTIL_ERROR_INVALID_PARAMETER Invalid parameter
800 * @retval #EFL_UTIL_ERROR_OUT_OF_MEMORY Memory allocation failure
801 * @retval #EFL_UTIL_ERROR_NO_RESOURCE_AVAILABLE Resource is not available
803 API int efl_util_gesture_select(efl_util_gesture_h gesture_h, Evas_Object *window, efl_util_gesture_data data);
806 * @brief Deselects a global gesture on given window.
808 * @param[in] gesture_h The #efl_util_gesture_h handle
809 * @param[in] window The efl window
810 * @param[in] data The #efl_util_gesture_data handle
811 * @return @c 0 on success, otherwise a negative error value
812 * @retval #EFL_UTIL_ERROR_NONE Successful
813 * @retval #EFL_UTIL_ERROR_INVALID_PARAMETER Invalid parameter
814 * @retval #EFL_UTIL_ERROR_OUT_OF_MEMORY Memory allocation failure
815 * @retval #EFL_UTIL_ERROR_NO_RESOURCE_AVAILABLE Resource is not available
817 API int efl_util_gesture_deselect(efl_util_gesture_h gesture_h, Evas_Object *window, efl_util_gesture_data data);
821 * @brief Activates or deactivates a global gesture.
823 * @privlevel platform
824 * @privilege %http://tizen.org/privilege/gestureactivation
825 * @param[in] gesture_h The #efl_util_gesture_h handle
826 * @param[in] type The gesture type to activate /deactivate combined by #efl_util_gesture_type_e to bitwise operation
827 * @param[in] active The activated boolean value
828 * @return @c 0 on success, otherwise a negative error value
829 * @retval #EFL_UTIL_ERROR_NONE Successful
830 * @retval #EFL_UTIL_ERROR_INVALID_PARAMETER Invalid parameter
831 * @retval #EFL_UTIL_ERROR_PERMISSION_DENIED Permission denied
832 * @retval #EFL_UTIL_ERROR_OUT_OF_MEMORY Memory allocation failure
833 * @retval #EFL_UTIL_ERROR_NO_RESOURCE_AVAILABLE Resource is not available
835 API int efl_util_gesture_activate_set(efl_util_gesture_h gesture_h, unsigned int type, Eina_Bool active);
838 * @brief Activates or deactivates a global gesture on given window.
840 * @param[in] gesture_h The #efl_util_gesture_h handle
841 * @param[in] window The efl window
842 * @param[in] type The gesture type to activate /deactivate combined by #efl_util_gesture_type_e to bitwise operation
843 * @param[in] active The activated boolean value
844 * @return @c 0 on success, otherwise a negative error value
845 * @retval #EFL_UTIL_ERROR_NONE Successful
846 * @retval #EFL_UTIL_ERROR_INVALID_PARAMETER Invalid parameter
847 * @retval #EFL_UTIL_ERROR_OUT_OF_MEMORY Memory allocation failure
848 * @retval #EFL_UTIL_ERROR_NO_RESOURCE_AVAILABLE Resource is not available
850 API int efl_util_gesture_activate_set_on_window(efl_util_gesture_h gesture_h, Evas_Object *window, unsigned int type, Eina_Bool active);
859 #endif /* __TIZEN_UI_EFL_UTIL_H__ */