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_1, /**< Default notification level. (Deprecated since $TZ_CFG_VER_24_OR_30$. Use EFL_UTIL_NOTIFICATION_LEVEL_DEFAULT instead.) */
71 EFL_UTIL_NOTIFICATION_LEVEL_2, /**< Higher notification level than default. (Deprecated since $TZ_CFG_VER_24_OR_30$. Use EFL_UTIL_NOTIFICATION_LEVEL_MEDIUM instead.) */
72 EFL_UTIL_NOTIFICATION_LEVEL_3, /**< The highest notification level. (Deprecated since $TZ_CFG_VER_24_OR_30$. Use EFL_UTIL_NOTIFICATION_LEVEL_TOP instead.) */
73 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$) */
74 EFL_UTIL_NOTIFICATION_LEVEL_DEFAULT = 10, /**< Default notification level. (@b Since: $TZ_CFG_VER_24_OR_30$) */
75 EFL_UTIL_NOTIFICATION_LEVEL_MEDIUM = 20, /**< Higher notification level than default. (@b Since: $TZ_CFG_VER_24_OR_30$) */
76 EFL_UTIL_NOTIFICATION_LEVEL_HIGH = 30, /**< Higher notification level than medium. (@b Since: $TZ_CFG_VER_24_OR_30$) */
77 EFL_UTIL_NOTIFICATION_LEVEL_TOP = 40 /**< The highest notification level. (@b Since: $TZ_CFG_VER_24_OR_30$) */
78 } efl_util_notification_level_e;
81 * @brief Enumeration of screen mode.
82 * @since_tizen $TZ_CFG_VER_24_OR_30$
86 EFL_UTIL_SCREEN_MODE_DEFAULT, /**< The mode which turns the screen off after a timeout. */
87 EFL_UTIL_SCREEN_MODE_ALWAYS_ON, /**< The mode which keeps the screen turned on. */
88 } efl_util_screen_mode_e;
91 * @brief Sets the priority level for the specified notification window.
92 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
94 * @privilege %http://tizen.org/privilege/window.priority.set
95 * @remarks This API can be used for a notification type window only.
96 * Up to the version $TZ_CFG_VER_24_OR_231$, it supports as async APIs.
97 * But it is synchronous call since Tizen 3.0
98 * @param[in] window The EFL window
99 * @param[in] level The notification window level
100 * @return @c 0 on success, otherwise a negative error value
101 * @retval #EFL_UTIL_ERROR_NONE Successful
102 * @retval #EFL_UTIL_ERROR_INVALID_PARAMETER Invalid parameter
103 * @retval #EFL_UTIL_ERROR_NOT_SUPPORTED_WINDOW_TYPE Window type not supported
104 * @retval #EFL_UTIL_ERROR_PERMISSION_DENIED Permission denied
106 API int efl_util_set_notification_window_level(Evas_Object *window, efl_util_notification_level_e level);
109 * @brief Gets the priority level for the specified notification window.
110 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
112 * @remarks This API can be used for a notification type window only.
113 * Up to the version $TZ_CFG_VER_24_OR_231$, it supports as async APIs.
114 * But it is synchronous call since Tizen 3.0
115 * @param[in] window The EFL window
116 * @param[out] level The notification window level
117 * @return @c 0 on success, otherwise a negative error value
118 * @retval #EFL_UTIL_ERROR_NONE Successful
119 * @retval #EFL_UTIL_ERROR_INVALID_PARAMETER Invalid parameter
120 * @retval #EFL_UTIL_ERROR_NOT_SUPPORTED_WINDOW_TYPE Window type not supported
122 API int efl_util_get_notification_window_level(Evas_Object *window, efl_util_notification_level_e *level);
125 * @deprecated Deprecated since 3.0.
126 * @brief Called when an error occurs for setting notification window level
127 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
128 * @remarks An application can check error by the return value of efl_util_set_notification_window_level since 3.0.
129 * @param[in] window The EFL window
130 * @param[in] error_code The error code (#EFL_UTIL_ERROR_PERMISSION_DENIED)
131 * @param[in] user_data The user data passed from the callback registration function
132 * @see efl_util_set_notification_window_level_error_cb()
133 * @see efl_util_unset_notification_window_level_error_cb()
135 typedef void (*efl_util_notification_window_level_error_cb)(Evas_Object *window, int error_code, void *user_data);
138 * @deprecated Deprecated since 3.0. Use the return value of efl_util_set_notification_window_level() instead.
139 * @brief Registers a callback function to be invoked when an error which set the notification level occurs.
140 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
141 * @remarks An application can check error by the return value of efl_util_set_notification_window_level since 3.0.
142 * @param[in] window The EFL window
143 * @param[in] callback The callback function to register
144 * @param[in] user_data The user data to be passed to the callback function
145 * @return @c 0 on success, otherwise a negative error value
146 * @retval #EFL_UTIL_ERROR_NONE Successful
147 * @retval #EFL_UTIL_ERROR_INVALID_PARAMETER Invalid parameter
148 * @retval #EFL_UTIL_ERROR_OUT_OF_MEMORY Out of memory
149 * @post efl_util_notification_window_level_error_cb() will be invoked.
150 * @see efl_util_unset_notification_window_level_error_cb()
151 * @see efl_util_notification_window_level_error_cb()
153 API int efl_util_set_notification_window_level_error_cb(Evas_Object *window, efl_util_notification_window_level_error_cb callback, void *user_data) TIZEN_DEPRECATED_API;
156 * @deprecated Deprecated since 3.0. Use the return value of efl_util_set_notification_window_level() instead.
157 * @brief Unregisters the callback function.
158 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
159 * @remarks An application can check error by the return value of efl_util_set_notification_window_level since 3.0.
160 * @param[in] window The EFL window
161 * @return @c 0 on success, otherwise a negative error value
162 * @retval #EFL_UTIL_ERROR_NONE Successful
163 * @retval #EFL_UTIL_ERROR_INVALID_PARAMETER Invalid parameter
164 * @see efl_util_set_notification_window_level_error_cb()
166 API int efl_util_unset_notification_window_level_error_cb(Evas_Object *window) TIZEN_DEPRECATED_API;
169 * @brief Sets the alpha window's visual state to opaque state
170 * @details This API sets the alpha window's visual state to opaque state.
171 * If the alpha window sets the visual state to the opaque,
172 * then the window manager could handle it as the opaque window while calculating visibility.
173 * This API will have no effect when used by a non-alpha window.
174 * @since_tizen $TZ_CFG_VER_24_OR_30$
175 * @param[in] window The EFL window
176 * @param[in] opaque The value that indicates whether the window has set a visual state to opaque (0: unset, 1: set)
177 * @return @c 0 on success, otherwise a negative error value
178 * @retval #EFL_UTIL_ERROR_NONE Successful
179 * @retval #EFL_UTIL_ERROR_INVALID_PARAMETER Invalid parameter
181 API int efl_util_set_window_opaque_state(Evas_Object *window, int opaque);
184 * @brief Sets the window's screen mode.
185 * @details This API is useful when the application need to keep the display turned on.
186 * If the application set the mode to #EFL_UTIL_SCREEN_MODE_ALWAYS_ON to its window and the window is shown wholly or partially,
187 * the window manager requests the display system to keep the display on as long as the window is shown.
188 * If the window is no longer shown, then the window manger request the display system to go back to normal operation.
189 * Default screen mode of window is #EFL_UTIL_SCREEN_MODE_DEFAULT.
190 * @since_tizen $TZ_CFG_VER_24_OR_30$
192 * @privilege %http://tizen.org/privilege/display
193 * @remarks This API needs the privilege.
194 * If the application which is not get the privilege use this API, the window manager generates the permission deny error.
195 * @param[in] window The EFL window
196 * @param[in] mode The screen mode
197 * @return @c 0 on success, otherwise a negative error value
198 * @retval #EFL_UTIL_ERROR_NONE Successful
199 * @retval #EFL_UTIL_ERROR_INVALID_PARAMETER Invalid parameter
200 * @retval #EFL_UTIL_ERROR_PERMISSION_DENIED Permission denied
202 API int efl_util_set_window_screen_mode(Evas_Object *window, efl_util_screen_mode_e mode);
205 * @brief Gets the screen mode of the specified window.
206 * @since_tizen $TZ_CFG_VER_24_OR_30$
207 * @param[in] window The EFL window
208 * @param[out] mode The screen mode
209 * @return @c 0 on success, otherwise a negative error value
210 * @retval #EFL_UTIL_ERROR_NONE Successful
211 * @retval #EFL_UTIL_ERROR_INVALID_PARAMETER Invalid parameter
213 API int efl_util_get_window_screen_mode(Evas_Object *window, efl_util_screen_mode_e *mode);
216 * @deprecated Deprecated since 3.0.
217 * @brief Called when an error occurs for setting window's screen mode
219 * @remarks An application can check error by the return value of efl_util_set_window_screen_mode since 3.0.
220 * @param[in] window The EFL window
221 * @param[in] error_code The error code (#EFL_UTIL_ERROR_PERMISSION_DENIED)
222 * @param[in] user_data The user data passed from the callback registration function
223 * @see efl_util_set_window_screen_mode_error_cb()
224 * @see efl_util_unset_window_screen_mode_error_cb()
226 typedef void (*efl_util_window_screen_mode_error_cb)(Evas_Object *window, int error_code, void *user_data);
229 * @deprecated Deprecated since 3.0. Use the return value of efl_util_set_window_screen_mode() instead.
230 * @brief Registers a callback function to be invoked when an error which set the screen mode.
232 * @remarks An application can check error by the return value of efl_util_set_window_screen_mode since 3.0.
233 * @param[in] window The EFL window
234 * @param[in] callback The callback function to register
235 * @param[in] user_data The user data to be passed to the callback function
236 * @return @c 0 on success, otherwise a negative error value
237 * @retval #EFL_UTIL_ERROR_NONE Successful
238 * @retval #EFL_UTIL_ERROR_INVALID_PARAMETER Invalid parameter
239 * @retval #EFL_UTIL_ERROR_OUT_OF_MEMORY Out of memory
240 * @post efl_util_window_screen_mode_error_cb() will be invoked.
241 * @see efl_util_unset_window_screen_mode_error_cb()
242 * @see efl_util_window_screen_mode_error_cb()
244 API int efl_util_set_window_screen_mode_error_cb(Evas_Object *window, efl_util_window_screen_mode_error_cb callback, void *user_data) TIZEN_DEPRECATED_API;
247 * @deprecated Deprecated since 3.0. Use the return value of efl_util_set_window_screen_mode() instead.
248 * @brief Unregisters the callback function.
250 * @remarks An application can check error by the return value of efl_util_set_window_screen_mode since 3.0.
251 * @param[in] window The EFL window
252 * @return @c 0 on success, otherwise a negative error value
253 * @retval #EFL_UTIL_ERROR_NONE Successful
254 * @retval #EFL_UTIL_ERROR_INVALID_PARAMETER Invalid parameter
255 * @see efl_util_set_window_screen_mode_error_cb()
257 API int efl_util_unset_window_screen_mode_error_cb(Evas_Object *window) TIZEN_DEPRECATED_API;
260 * @brief Sets the user's preferred brightness of the specified window.
261 * @details This API is useful when the application need to change the brightness of the screen when it is appeared on the screen.
262 * If the application sets the brightness 0 to 100 to its window and the application window is shown wholly or partially,
263 * the window manager requests the display system to change the brightness of the screen using user's preferred brightness.
264 * If the window is no longer shown, then the window manger request the display system to go back to default brightness.
265 * If the brightness is less than 0, this means to use the default screen brightness.
268 * @privilege %http://tizen.org/privilege/display
269 * @remarks This API needs the privilege.
270 * If the application which is not get the privilege use this API, the window manager generates the permission deny error.
271 * @param[in] window The EFL window
272 * @param[in] brightness The preferred brightness
273 * @return @c 0 on success, otherwise a negative error value
274 * @retval #EFL_UTIL_ERROR_NONE Successful
275 * @retval #EFL_UTIL_ERROR_INVALID_PARAMETER Invalid parameter
276 * @retval #EFL_UTIL_ERROR_PERMISSION_DENIED Permission denied
277 * @retval #EFL_UTIL_ERROR_OUT_OF_MEMORY Out of memory
278 * @see efl_util_get_window_brightness()
280 API int efl_util_set_window_brightness(Evas_Object *window, int brightness);
283 * @brief Gets the user's preferred brightness of the specified window.
285 * @param[in] window The EFL window
286 * @param[out] brightness The preferred brightness
287 * @return @c 0 on success, otherwise a negative error value
288 * @retval #EFL_UTIL_ERROR_NONE Successful
289 * @retval #EFL_UTIL_ERROR_INVALID_PARAMETER Invalid parameter
290 * @see efl_util_set_window_brightness()
292 API int efl_util_get_window_brightness(Evas_Object *window, int *brightness);
300 * @addtogroup CAPI_EFL_UTIL_INPUT_MODULE
306 * @brief Definition for the input generator handle.
307 * @since_tizen $TZ_CFG_VER_24_OR_30$
310 typedef struct _efl_util_inputgen_h * efl_util_inputgen_h;
314 * @brief Enumeration of device type generated events.
315 * @since_tizen $TZ_CFG_VER_24_OR_30$
319 EFL_UTIL_INPUT_DEVTYPE_NONE = 0x0, /**< (Deprecated since 3.0.) */
320 EFL_UTIL_INPUT_DEVTYPE_TOUCHSCREEN = (1 << 0), /**< Touch Screen device */
321 EFL_UTIL_INPUT_DEVTYPE_KEYBOARD = (1 << 1), /**< Keyboard device */
322 EFL_UTIL_INPUT_DEVTYPE_POINTER = (1 << 2), /**< Mouse device (Since 3.0) */
323 EFL_UTIL_INPUT_DEVTYPE_ALL = EFL_UTIL_INPUT_DEVTYPE_TOUCHSCREEN |
324 EFL_UTIL_INPUT_DEVTYPE_KEYBOARD, /**< Both of touch screen and keyboard device (Deprecated since 3.0. Check all enumerations using OR operand instead) */
325 EFL_UTIL_INPUT_DEVTYPE_MAX = (1 << 10) /**< (Deprecated since 3.0.) */
326 } efl_util_input_device_type_e;
330 * @brief Enumeration of touch event types.
331 * @since_tizen $TZ_CFG_VER_24_OR_30$
335 EFL_UTIL_INPUT_TOUCH_NONE, /**< (Deprecated since 3.0.) */
336 EFL_UTIL_INPUT_TOUCH_BEGIN, /**< Finger press. It is same a behavior put your finger on touch screen */
337 EFL_UTIL_INPUT_TOUCH_UPDATE, /**< Finger move. It is same a behavior move your finger on touch screen */
338 EFL_UTIL_INPUT_TOUCH_END, /**< Finger release. It is same a behavior release your finger on touch screen */
339 EFL_UTIL_INPUT_TOUCH_MAX = 10 /**< (Deprecated since 3.0.) */
340 } efl_util_input_touch_type_e;
344 * @brief Enumeration of pointer event types.
349 EFL_UTIL_INPUT_POINTER_BUTTON_DOWN, /**< Mouse button press. */
350 EFL_UTIL_INPUT_POINTER_BUTTON_UP, /**< Mouse move. */
351 EFL_UTIL_INPUT_POINTER_MOVE, /**< Mouse button release. */
352 } efl_util_input_pointer_type_e;
356 * @brief Initializes system and check input generate functions are supported, open devices generated events.
357 * @since_tizen $TZ_CFG_VER_24_OR_30$
358 * @privlevel platform
359 * @privilege %http://tizen.org/privilege/inputgenerator
360 * @remarks The specific error code can be obtained using the get_last_result() method. Error codes are described in Exception section.
361 * @remarks The dev_type is changed into the unsigned int to perform bitwise operations. (Since 3.0)
362 * @param[in] dev_type The device type want to generate events (ex> #EFL_UTIL_INPUT_DEVTYPE_TOUCHSCREEN | #EFL_UTIL_INPUT_DEVTYPE_KEYBOARD)
363 * @return #efl_util_inputgen_h on success, otherwise @c NULL
364 * @retval #efl_util_inputgen_h The input generator handle
365 * @exception #EFL_UTIL_ERROR_NONE Successful
366 * @exception #EFL_UTIL_ERROR_INVALID_PARAMETER Invalid parameter
367 * @exception #EFL_UTIL_ERROR_NO_SUCH_DEVICE No such device or address
368 * @exception #EFL_UTIL_ERROR_INVALID_OPERATION Function not implemented
369 * @exception #EFL_UTIL_ERROR_OUT_OF_MEMORY Memory allocation failure
370 * @see efl_util_input_deinitialize_generator()
372 API efl_util_inputgen_h efl_util_input_initialize_generator(unsigned int dev_type);
376 * @brief Initializes system, check input generate functions are supported and then open events generator devices with given name.
378 * @privlevel platform
379 * @privilege %http://tizen.org/privilege/inputgenerator
380 * @remarks The specific error code can be obtained using the get_last_result() method. Error codes are described in Exception section.
381 * @remarks The dev_type is changed into the unsigned int to perform bitwise operations.
382 * @param[in] dev_type The device type want to generate events (ex> #EFL_UTIL_INPUT_DEVTYPE_TOUCHSCREEN | #EFL_UTIL_INPUT_DEVTYPE_KEYBOARD)
383 * @param[in] name The device name (maximum 31 characters)
384 * @return #efl_util_inputgen_h on success, otherwise @c NULL
385 * @retval #efl_util_inputgen_h The input generator handle
386 * @exception #EFL_UTIL_ERROR_NONE Successful
387 * @exception #EFL_UTIL_ERROR_INVALID_PARAMETER Invalid parameter
388 * @exception #EFL_UTIL_ERROR_NO_SUCH_DEVICE No such device or address
389 * @exception #EFL_UTIL_ERROR_INVALID_OPERATION Function not implemented
390 * @exception #EFL_UTIL_ERROR_OUT_OF_MEMORY Memory allocation failure
391 * @see efl_util_input_deinitialize_generator()
393 API efl_util_inputgen_h efl_util_input_initialize_generator_with_name(unsigned int dev_type, const char *name);
397 * @brief Deinitializes system and close opened devices.
398 * @since_tizen $TZ_CFG_VER_24_OR_30$
399 * @privlevel platform
400 * @privilege %http://tizen.org/privilege/inputgenerator
401 * @param[in] inputgen_h The #efl_util_inputgen_h handle
402 * @return @c 0 on success, otherwise a negative error value
403 * @retval #EFL_UTIL_ERROR_NONE Successful
404 * @retval #EFL_UTIL_ERROR_INVALID_PARAMETER Invalid parameter
405 * @see efl_util_input_initialize_generator()
407 API int efl_util_input_deinitialize_generator(efl_util_inputgen_h inputgen_h);
411 * @brief Generates all of key events using a opened device.
412 * @since_tizen $TZ_CFG_VER_24_OR_30$
413 * @privlevel platform
414 * @privilege %http://tizen.org/privilege/inputgenerator
415 * @param[in] inputgen_h The #efl_util_inputgen_h handle
416 * @param[in] key_name The key name want to generate
417 * @param[in] pressed The value that select key press or release (0: release, 1: press)
418 * @return @c 0 on success, otherwise a negative error value
419 * @retval #EFL_UTIL_ERROR_NONE Successful
420 * @retval #EFL_UTIL_ERROR_INVALID_PARAMETER Invalid parameter
421 * @retval #EFL_UTIL_ERROR_PERMISSION_DENIED Has no permission to generate key
423 API int efl_util_input_generate_key(efl_util_inputgen_h inputgen_h, const char *key_name, int pressed);
427 * @brief Generates a touch event using a opened device.
428 * @since_tizen $TZ_CFG_VER_24_OR_30$
429 * @privlevel platform
430 * @privilege %http://tizen.org/privilege/inputgenerator
431 * @param[in] inputgen_h The #efl_util_inputgen_h handle
432 * @param[in] idx The index of touched finger
433 * @param[in] touch_type The touch type (ex> #EFL_UTIL_INPUT_TOUCH_BEGIN, #EFL_UTIL_INPUT_TOUCH_UPDATE, #EFL_UTIL_INPUT_TOUCH_END)
434 * @param[in] x The x axis of touch point
435 * @param[in] y The y axis of touch point
436 * @return @c 0 on success, otherwise a negative error value
437 * @retval #EFL_UTIL_ERROR_NONE Successful
438 * @retval #EFL_UTIL_ERROR_INVALID_PARAMETER Invalid parameter
439 * @retval #EFL_UTIL_ERROR_PERMISSION_DENIED Has no permission to generate touch
441 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);
445 * @brief Generate a pointer event using a opened device.
447 * @privlevel platform
448 * @privilege %http://tizen.org/privilege/inputgenerator
449 * @param[in] inputgen_h The #efl_util_inputgen_h handle
450 * @param[in] buttons The number of button
451 * @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)
452 * @param[in] x x coordination to move
453 * @param[in] y y coordination to move
454 * @return @c 0 on success, otherwise a negative error value
455 * @retval #EFL_UTIL_ERROR_NONE Successful
456 * @retval #EFL_UTIL_ERROR_INVALID_PARAMETER Invalid parameter
457 * @retval #EFL_UTIL_ERROR_PERMISSION_DENIED Has no permission to generate pointer
458 * @retval #EFL_UTIL_ERROR_NO_SUCH_DEVICE No such device or address
459 * @retval #EFL_UTIL_ERROR_OUT_OF_MEMORY Memory allocation failure
461 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);
468 * @addtogroup CAPI_EFL_UTIL_SCREENSHOT_MODULE
474 * @brief Definition for the screenshot handle.
475 * @since_tizen $TZ_CFG_VER_24_OR_30$
477 typedef struct _efl_util_screenshot_h * efl_util_screenshot_h;
481 * @brief Initializes the screenshot.
482 * @since_tizen $TZ_CFG_VER_24_OR_30$
483 * @privlevel platform
484 * @privilege %http://tizen.org/privilege/screenshot
485 * @remarks The specific error code can be obtained using the get_last_result()
486 * method. Error codes are described in Exception section.
487 * @param[in] width width of the screenshot surface
488 * @param[in] height height of the screenshot surface
489 * @return #efl_util_screenshot_h on success, otherwise @c NULL
490 * @retval #efl_util_screenshot_h The screenshot handle
491 * @exception #EFL_UTIL_ERROR_NONE Successful
492 * @exception #EFL_UTIL_ERROR_INVALID_PARAMETER Invalid parameter
493 * @exception #EFL_UTIL_ERROR_OUT_OF_MEMORY Memory allocation failure
494 * @exception #EFL_UTIL_ERROR_SCREENSHOT_INIT_FAIL Initialization failure
495 * @see efl_util_screenshot_deinitialize()
497 API efl_util_screenshot_h efl_util_screenshot_initialize(int width, int height);
501 * @brief Takes a screenshot and get a tbm_surface handle.
502 * @since_tizen $TZ_CFG_VER_24_OR_30$
503 * @privlevel platform
504 * @privilege %http://tizen.org/privilege/screenshot
505 * @remarks The specific error code can be obtained using the get_last_result()
506 * The #tbm_surface_h must be free by caller
507 * @param[in] screenshot efl_util_screenshot_h handle
508 * @return #tbm_surface_h on success, otherwise @c NULL
509 * @retval #tbm_surface_h The TBM surface handle
510 * @exception #EFL_UTIL_ERROR_NONE Successful
511 * @exception #EFL_UTIL_ERROR_INVALID_PARAMETER Invalid parameter
512 * @exception #EFL_UTIL_ERROR_SCREENSHOT_EXECUTION_FAIL Execution failure
513 * @see efl_util_screenshot_initialize()
514 * @see efl_util_screenshot_deinitialize()
516 API tbm_surface_h efl_util_screenshot_take_tbm_surface(efl_util_screenshot_h screenshot);
520 * @brief Deinitializes the screenshot.
521 * @since_tizen $TZ_CFG_VER_24_OR_30$
522 * @privlevel platform
523 * @privilege %http://tizen.org/privilege/screenshot
524 * @param[in] screenshot efl_util_screenshot_h handle
525 * @return @c 0 on success, otherwise a negative error value
526 * @retval #EFL_UTIL_ERROR_NONE Successful
527 * @retval #EFL_UTIL_ERROR_INVALID_PARAMETER Invalid parameter
528 * @see efl_util_screenshot_initialize()
530 API int efl_util_screenshot_deinitialize(efl_util_screenshot_h screenshot);
537 * @addtogroup CAPI_EFL_UTIL_GESTURE_MODULE
542 * @brief Definition for the gesture handle.
545 typedef struct _efl_util_gesture_h * efl_util_gesture_h;
548 * @brief Definition for the edge swipe gesture event.
551 API extern int EFL_UTIL_EVENT_GESTURE_EDGE_SWIPE;
554 * @brief Definition for the edge swipe gesture event.
557 API extern int EFL_UTIL_EVENT_GESTURE_EDGE_DRAG;
560 * @brief Definition for the tap gesture event.
563 API extern int EFL_UTIL_EVENT_GESTURE_TAP;
566 * @brief Definition for the palm cover gesture event.
569 API extern int EFL_UTIL_EVENT_GESTURE_PALM_COVER;
572 * @brief Enumeration of gesture type
575 typedef enum _efl_util_gesture_type_e
577 EFL_UTIL_GESTURE_TYPE_NONE = 0, /**< None gesture type */
578 EFL_UTIL_GESTURE_TYPE_EDGE_SWIPE = (1 << 0), /**< Edge swipe gesture type */
579 EFL_UTIL_GESTURE_TYPE_EDGE_DRAG = (1 << 1), /**< Edge drag gesture type */
580 EFL_UTIL_GESTURE_TYPE_TAP = (1 << 2), /**< Tap gesture type */
581 EFL_UTIL_GESTURE_TYPE_PALM_COVER = (1 << 3), /**< Palm cover gesture type */
582 EFL_UTIL_GESTURE_TYPE_PAN = (1 << 4), /**< Pan gesture type */
583 EFL_UTIL_GESTURE_TYPE_PINCH = (1 << 5), /**< Pinch gesture type */
584 EFL_UTIL_GESTURE_TYPE_PALM_SWIPE = (1 << 6) /**< Palm swipe gesture type */
585 } efl_util_gesture_type_e;
588 * @brief Enumeration of gesture mode
591 typedef enum _efl_util_gesture_mode_e
593 EFL_UTIL_GESTURE_MODE_NONE = 0, /**< None gesture mode */
594 EFL_UTIL_GESTURE_MODE_BEGIN, /**< Begin a gesture event */
595 EFL_UTIL_GESTURE_MODE_UPDATE, /**< continually update a gesture event */
596 EFL_UTIL_GESTURE_MODE_END, /**< End a gesture event */
597 EFL_UTIL_GESTURE_MODE_DONE /**< Occur a gesture event */
598 } efl_util_gesture_mode_e;
601 * @brief Enumeration of gesture edge
604 typedef enum _efl_util_gesture_edge_e
606 EFL_UTIL_GESTURE_EDGE_NONE = 0, /**< None edge point */
607 EFL_UTIL_GESTURE_EDGE_TOP, /**< Top edge position of screen */
608 EFL_UTIL_GESTURE_EDGE_RIGHT, /**< Right edge position of screen */
609 EFL_UTIL_GESTURE_EDGE_BOTTOM, /**< Bottom edge position of screen */
610 EFL_UTIL_GESTURE_EDGE_LEFT /**< Left edge position of screen */
611 } efl_util_gesture_edge_e;
614 * @brief Enumeration of gesture edge size
617 typedef enum _efl_util_gesture_edge_size_e
619 EFL_UTIL_GESTURE_EDGE_SIZE_NONE, /**< None size of edge */
620 EFL_UTIL_GESTURE_EDGE_SIZE_FULL, /**< Full size in the edge */
621 EFL_UTIL_GESTURE_EDGE_SIZE_PARTIAL /**< Part of edge */
622 } efl_util_gesture_edge_size_e;
625 * @brief Definition for the gesture data handle
628 typedef void *efl_util_gesture_data;
631 * @brief Definition for the edge swipe gesture's event data structure
634 typedef struct _efl_util_event_gesture_edge_swipe_s
636 efl_util_gesture_mode_e mode; /**< Mode of a gesture event */
637 unsigned int fingers; /**< Number of fingers */
638 int sx; /**< Start x point of edge area */
639 int sy; /**< Start y point of edge area */
640 unsigned int edge; /**< Start edge location */
641 } efl_util_event_gesture_edge_swipe_s;
644 * @brief Definition for the edge drag gesture's event data structure
647 typedef struct efl_util_event_gesture_edge_drag_s
649 efl_util_gesture_mode_e mode; /**< Mode of a gesture event */
650 unsigned int fingers; /**< Number of fingers */
651 int cx; /**< Center x point of edge area */
652 int cy; /**< Center y point of edge area */
653 unsigned int edge; /**< Start edge location */
654 } efl_util_event_gesture_edge_drag_s;
657 * @brief Definition for the tap gesture's event data structure
660 typedef struct _efl_util_event_gesture_tap_s
662 efl_util_gesture_mode_e mode; /**< Mode of a gesture event */
663 unsigned int fingers; /**< Number of fingers */
664 unsigned int repeats; /**< Number of tap repeats */
665 } efl_util_event_gesture_tap_s;
668 * @brief Definition for the palm cover gesture's event data structure
671 typedef struct _efl_util_event_gesture_palm_cover_s
673 efl_util_gesture_mode_e mode; /**< Mode of a gesture event */
674 unsigned int duration; /**< Duration time of gesture behavior */
675 int cx; /**< Center x point of edge area */
676 int cy; /**< Center y point of edge area */
677 unsigned int size; /**< Size of touched area */
678 double pressure; /**< Pressure of touched finger */
679 } efl_util_event_gesture_palm_cover_s;
682 * @brief Initializes system and check if global gestures are supported.
684 * @remarks The specific error code can be obtained using the get_last_result() method.
685 * Error codes are described in Exception section.
686 * @return #efl_util_gesture_h on success, otherwise @c NULL
687 * @retval #efl_util_gesture_h The global gesture handle
688 * @exception #EFL_UTIL_ERROR_NONE Successful
689 * @exception #EFL_UTIL_ERROR_OUT_OF_MEMORY Memory allocation failure
690 * @exception #EFL_UTIL_ERROR_NOT_SUPPORTED Not supported
691 * @exception #EFL_UTIL_ERROR_NO_RESOURCE_AVAILABLE Resource is not available
692 * @see efl_util_gesture_deinitialize()
694 API efl_util_gesture_h efl_util_gesture_initialize(void);
697 * @brief Deinitializes system.
699 * @param[in] gesture_h The #efl_util_gesture_h handle
700 * @return @c 0 on success, otherwise a negative error value
701 * @retval #EFL_UTIL_ERROR_NONE Successful
702 * @retval #EFL_UTIL_ERROR_INVALID_PARAMETER Invalid parameter
703 * @see efl_util_gesture_initialize()
705 API int efl_util_gesture_deinitialize(efl_util_gesture_h gesture_h);
708 * @brief Generates a edge swipe gesture's grab info handle.
710 * @param[in] gesture_h The #efl_util_gesture_h handle
711 * @param[in] fingers The number of fingers
712 * @param[in] edge The position of edge
713 * @remarks The specific error code can be obtained using the get_last_result() method.
714 * Error codes are described in Exception section.
715 * @return #efl_util_gesture_data on success, otherwise @c NULL
716 * @retval #efl_util_gesture_data The specific gesture data handle
717 * @exception #EFL_UTIL_ERROR_NONE Successful
718 * @exception #EFL_UTIL_ERROR_OUT_OF_MEMORY Memory allocation failure
719 * @exception #EFL_UTIL_ERROR_INVALID_PARAMETER Invalid parameter
720 * @exception #EFL_UTIL_ERROR_NO_RESOURCE_AVAILABLE Resource is not available
722 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);
725 * @brief Frees a memory of edge swipe gesture's grab info handle.
727 * @param[in] gesture_h The #efl_util_gesture_h handle
728 * @param[in] data The #efl_util_gesture_data handle
729 * @return @c 0 on success, otherwise a negative error value
730 * @retval #EFL_UTIL_ERROR_NONE Successful
731 * @retval #EFL_UTIL_ERROR_INVALID_PARAMETER Invalid parameter
733 API int efl_util_gesture_edge_swipe_free(efl_util_gesture_h gesture_h, efl_util_gesture_data data);
737 * @brief Sets a specific size of edge for edge swipe gesture.
739 * @param[in] data The #efl_util_gesture_data handle
740 * @param[in] edge_size The #efl_util_gesture_edge_size_e enum
741 * @param[in] start_point The start point of edge area
742 * @param[in] end_point The end point of edge area
743 * @return @c 0 on success, otherwise a negative error value
744 * @retval #EFL_UTIL_ERROR_NONE Successful
745 * @retval #EFL_UTIL_ERROR_INVALID_PARAMETER Invalid parameter
746 * @retval #EFL_UTIL_ERROR_NO_RESOURCE_AVAILABLE Resource is not available
748 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);
751 * @brief Generates a edge drag gesture's grab info handle.
753 * @param[in] gesture_h The #efl_util_gesture_h handle
754 * @param[in] fingers The number of fingers
755 * @param[in] edge The position of edge
756 * @remarks The specific error code can be obtained using the get_last_result() method.
757 * Error codes are described in Exception section.
758 * @return #efl_util_gesture_data on success, otherwise @c NULL
759 * @retval #efl_util_gesture_data The specific gesture data handle
760 * @exception #EFL_UTIL_ERROR_NONE Successful
761 * @exception #EFL_UTIL_ERROR_OUT_OF_MEMORY Memory allocation failure
762 * @exception #EFL_UTIL_ERROR_INVALID_PARAMETER Invalid parameter
763 * @exception #EFL_UTIL_ERROR_NO_RESOURCE_AVAILABLE Resource is not available
765 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);
768 * @brief Frees a memory of edge drag gesture's grab info handle.
770 * @param[in] gesture_h The #efl_util_gesture_h handle
771 * @param[in] data The #efl_util_gesture_data handle
772 * @return @c 0 on success, otherwise a negative error value
773 * @retval #EFL_UTIL_ERROR_NONE Successful
774 * @retval #EFL_UTIL_ERROR_INVALID_PARAMETER Invalid parameter
776 API int efl_util_gesture_edge_drag_free(efl_util_gesture_h gesture_h, efl_util_gesture_data data);
779 * @brief Sets a specific size of edge for edge drag gesture.
781 * @param[in] data The #efl_util_gesture_data handle
782 * @param[in] edge_size The #efl_util_gesture_edge_size_e enum
783 * @param[in] start_point The start point of edge area
784 * @param[in] end_point The end point of edge area
785 * @return @c 0 on success, otherwise a negative error value
786 * @retval #EFL_UTIL_ERROR_NONE Successful
787 * @retval #EFL_UTIL_ERROR_INVALID_PARAMETER Invalid parameter
788 * @retval #EFL_UTIL_ERROR_NO_RESOURCE_AVAILABLE Resource is not available
790 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);
793 * @brief Generates a tap gesture's grab info handle.
795 * @param[in] gesture_h The #efl_util_gesture_h handle
796 * @param[in] fingers The number of fingers
797 * @param[in] repeats The number of repeats
798 * @remarks The specific error code can be obtained using the get_last_result() method.
799 * Error codes are described in Exception section.
800 * @return #efl_util_gesture_data on success, otherwise @c NULL
801 * @retval #efl_util_gesture_data The specific gesture data handle
802 * @exception #EFL_UTIL_ERROR_NONE Successful
803 * @exception #EFL_UTIL_ERROR_OUT_OF_MEMORY Memory allocation failure
804 * @exception #EFL_UTIL_ERROR_INVALID_PARAMETER Invalid parameter
805 * @exception #EFL_UTIL_ERROR_NO_RESOURCE_AVAILABLE Resource is not available
807 API efl_util_gesture_data efl_util_gesture_tap_new(efl_util_gesture_h gesture_h, unsigned int fingers, unsigned int repeats);
810 * @brief Frees a memory of tap gesture's grab info handle.
812 * @param[in] gesture_h The #efl_util_gesture_h handle
813 * @param[in] data The #efl_util_gesture_data handle
814 * @return @c 0 on success, otherwise a negative error value
815 * @retval #EFL_UTIL_ERROR_NONE Successful
816 * @retval #EFL_UTIL_ERROR_INVALID_PARAMETER Invalid parameter
818 API int efl_util_gesture_tap_free(efl_util_gesture_h gesture_h, efl_util_gesture_data data);
821 * @brief Generates a palm cover gesture's grab info handle.
823 * @param[in] gesture_h The #efl_util_gesture_h handle
824 * @remarks The specific error code can be obtained using the get_last_result() method.
825 * Error codes are described in Exception section.
826 * @return #efl_util_gesture_data on success, otherwise @c NULL
827 * @retval #efl_util_gesture_data The specific gesture data handle
828 * @exception #EFL_UTIL_ERROR_NONE Successful
829 * @exception #EFL_UTIL_ERROR_OUT_OF_MEMORY Memory allocation failure
830 * @exception #EFL_UTIL_ERROR_INVALID_PARAMETER Invalid parameter
831 * @exception #EFL_UTIL_ERROR_NO_RESOURCE_AVAILABLE Resource is not available
833 API efl_util_gesture_data efl_util_gesture_palm_cover_new(efl_util_gesture_h gesture_h);
836 * @brief Frees a memory of palm cover gesture's grab info handle.
838 * @param[in] gesture_h The #efl_util_gesture_h handle
839 * @param[in] data The #efl_util_gesture_data handle
840 * @return @c 0 on success, otherwise a negative error value
841 * @retval #EFL_UTIL_ERROR_NONE Successful
842 * @retval #EFL_UTIL_ERROR_INVALID_PARAMETER Invalid parameter
844 API int efl_util_gesture_palm_cover_free(efl_util_gesture_h gesture_h, efl_util_gesture_data data);
848 * @brief Grabs a global gesture.
850 * @privlevel platform
851 * @privilege %http://tizen.org/privilege/gesturegrab
852 * @param[in] gesture_h The #efl_util_gesture_h handle
853 * @param[in] data The #efl_util_gesture_data handle.
854 * @return @c 0 on success, otherwise a negative error value
855 * @retval #EFL_UTIL_ERROR_NONE Successful
856 * @retval #EFL_UTIL_ERROR_INVALID_PARAMETER Invalid parameter
857 * @retval #EFL_UTIL_ERROR_PERMISSION_DENIED Permission denied
858 * @retval #EFL_UTIL_ERROR_OUT_OF_MEMORY Memory allocation failure
859 * @retval #EFL_UTIL_ERROR_NOT_SUPPORTED Not supported
860 * @retval #EFL_UTIL_ERROR_NO_RESOURCE_AVAILABLE Resource is not available
862 API int efl_util_gesture_grab(efl_util_gesture_h gesture_h, efl_util_gesture_data data);
866 * @brief Ungrabs a global gesture.
868 * @privlevel platform
869 * @privilege %http://tizen.org/privilege/gesturegrab
870 * @param[in] gesture_h The #efl_util_gesture_h handle
871 * @param[in] data The #efl_util_gesture_data handle.
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_PERMISSION_DENIED Permission denied
876 * @retval #EFL_UTIL_ERROR_OUT_OF_MEMORY Memory allocation failure
877 * @retval #EFL_UTIL_ERROR_NOT_SUPPORTED Not supported
878 * @retval #EFL_UTIL_ERROR_NO_RESOURCE_AVAILABLE Resource is not available
880 API int efl_util_gesture_ungrab(efl_util_gesture_h gesture_h, efl_util_gesture_data data);
883 * @brief Selects a global gesture on given window.
885 * @param[in] gesture_h The #efl_util_gesture_h handle
886 * @param[in] window The efl window
887 * @param[in] data The #efl_util_gesture_data handle.
888 * @return @c 0 on success, otherwise a negative error value
889 * @retval #EFL_UTIL_ERROR_NONE Successful
890 * @retval #EFL_UTIL_ERROR_INVALID_PARAMETER Invalid parameter
891 * @retval #EFL_UTIL_ERROR_OUT_OF_MEMORY Memory allocation failure
892 * @retval #EFL_UTIL_ERROR_NO_RESOURCE_AVAILABLE Resource is not available
894 API int efl_util_gesture_select(efl_util_gesture_h gesture_h, Evas_Object *window, efl_util_gesture_data data);
897 * @brief Deselects a global gesture on given window.
899 * @param[in] gesture_h The #efl_util_gesture_h handle
900 * @param[in] window The efl window
901 * @param[in] data The #efl_util_gesture_data handle
902 * @return @c 0 on success, otherwise a negative error value
903 * @retval #EFL_UTIL_ERROR_NONE Successful
904 * @retval #EFL_UTIL_ERROR_INVALID_PARAMETER Invalid parameter
905 * @retval #EFL_UTIL_ERROR_OUT_OF_MEMORY Memory allocation failure
906 * @retval #EFL_UTIL_ERROR_NO_RESOURCE_AVAILABLE Resource is not available
908 API int efl_util_gesture_deselect(efl_util_gesture_h gesture_h, Evas_Object *window, efl_util_gesture_data data);
912 * @brief Activates or deactivates a global gesture.
914 * @privlevel platform
915 * @privilege %http://tizen.org/privilege/gestureactivation
916 * @param[in] gesture_h The #efl_util_gesture_h handle
917 * @param[in] type The gesture type to activate /deactivate combined by #efl_util_gesture_type_e to bitwise operation
918 * @param[in] active The activated boolean value
919 * @return @c 0 on success, otherwise a negative error value
920 * @retval #EFL_UTIL_ERROR_NONE Successful
921 * @retval #EFL_UTIL_ERROR_INVALID_PARAMETER Invalid parameter
922 * @retval #EFL_UTIL_ERROR_PERMISSION_DENIED Permission denied
923 * @retval #EFL_UTIL_ERROR_OUT_OF_MEMORY Memory allocation failure
924 * @retval #EFL_UTIL_ERROR_NO_RESOURCE_AVAILABLE Resource is not available
926 API int efl_util_gesture_activate_set(efl_util_gesture_h gesture_h, unsigned int type, Eina_Bool active);
929 * @brief Activates or deactivates a global gesture on given window.
931 * @param[in] gesture_h The #efl_util_gesture_h handle
932 * @param[in] window The efl window
933 * @param[in] type The gesture type to activate /deactivate combined by #efl_util_gesture_type_e to bitwise operation
934 * @param[in] active The activated boolean value
935 * @return @c 0 on success, otherwise a negative error value
936 * @retval #EFL_UTIL_ERROR_NONE Successful
937 * @retval #EFL_UTIL_ERROR_INVALID_PARAMETER Invalid parameter
938 * @retval #EFL_UTIL_ERROR_OUT_OF_MEMORY Memory allocation failure
939 * @retval #EFL_UTIL_ERROR_NO_RESOURCE_AVAILABLE Resource is not available
941 API int efl_util_gesture_activate_set_on_window(efl_util_gesture_h gesture_h, Evas_Object *window, unsigned int type, Eina_Bool active);
950 #endif /* __TIZEN_UI_EFL_UTIL_H__ */