2 * Copyright (c) 2016 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_SCREENSHOT_EXTENSION_H__
18 #define __TIZEN_UI_EFL_UTIL_SCREENSHOT_EXTENSION_H__
27 # define API __attribute__ ((visibility("default")))
33 * @file efl_util_screenshot_extension.h
37 * @addtogroup CAPI_EFL_UTIL_MODULE
43 * @brief Set auto rotation value for screenshot.
46 * @privilege %http://tizen.org/privilege/screenshot
47 * @param[in] screenshot efl_util_screenshot_h handle
48 * @param[in] set auto rotation value (1:use auto rotation, 0:don't use auto rotation)
49 * @return @c 0 on success, otherwise a negative error value
50 * @retval #EFL_UTIL_ERROR_NONE Successful
51 * @retval #EFL_UTIL_ERROR_INVALID_PARAMETER Invalid parameter
52 * @retval #EFL_UTIL_ERROR_PERMISSION_DENIED No permission for screenshot
53 * @see efl_util_screenshot_get_auto_rotation()
55 API int efl_util_screenshot_set_auto_rotation(efl_util_screenshot_h screenshot, int set);
59 * @brief Get current auto rotation value of screenshot.
62 * @privilege %http://tizen.org/privilege/screenshot
63 * @param[in] screenshot efl_util_screenshot_h handle
64 * @param[out] set The current auto rotation value of screenshot
65 * @return @c 0 on success, otherwise a negative error value
66 * @retval #EFL_UTIL_ERROR_NONE Successful
67 * @retval #EFL_UTIL_ERROR_INVALID_PARAMETER Invalid parameter
68 * @retval #EFL_UTIL_ERROR_PERMISSION_DENIED No permission for screenshot
69 * @see efl_util_screenshot_set_auto_rotation()
71 API int efl_util_screenshot_get_auto_rotation(efl_util_screenshot_h screenshot, int *set);
75 * @brief Definition for the screenmirror handle.
78 typedef struct _efl_util_screenmirror_h * efl_util_screenmirror_h;
81 * @brief The screenmirror handler
82 * @details This handler will be called when mirror buffer is received.
85 typedef void (*efl_util_screenmirror_handler)(efl_util_screenmirror_h screenmirror,
86 tbm_surface_h t_surface, void *user_data);
90 * @brief Initializes a screenmirror.
93 * @privilege %http://tizen.org/privilege/screenshot
94 * @remarks The specific error code can be obtained using the get_last_result()
95 * method. Error codes are described in Exception section.
96 * @param[in] width width of the screenmirror surface
97 * @param[in] height height of the screenmirror surface
98 * @return #efl_util_screenmirror_h on success, otherwise @c NULL
99 * @retval #efl_util_screenmirror_h The screenmirror handle
100 * @exception #EFL_UTIL_ERROR_NONE Successful
101 * @exception #EFL_UTIL_ERROR_INVALID_PARAMETER Invalid parameter
102 * @exception #EFL_UTIL_ERROR_OUT_OF_MEMORY Memory allocation failure
103 * @exception #EFL_UTIL_ERROR_SCREENSHOT_INIT_FAIL Initialization failure
104 * @exception #EFL_UTIL_ERROR_PERMISSION_DENIED No permission for screenmirror
105 * @see efl_util_screenmirror_deinitialize()
107 API efl_util_screenmirror_h efl_util_screenmirror_initialize(int width, int height);
111 * @brief Deinitializes the screenmirror.
113 * @privlevel platform
114 * @privilege %http://tizen.org/privilege/screenshot
115 * @param[in] screenmirror #efl_util_screenmirror_h handle
116 * @return @c 0 on success, otherwise a negative error value
117 * @retval #EFL_UTIL_ERROR_NONE Successful
118 * @retval #EFL_UTIL_ERROR_INVALID_PARAMETER Invalid parameter
119 * @retval #EFL_UTIL_ERROR_PERMISSION_DENIED No permission for screenmirror
120 * @see efl_util_screenmirror_initialize()
122 API int efl_util_screenmirror_deinitialize(efl_util_screenmirror_h screenmirror);
126 * @brief Set handler to get screenmirror buffer.
128 * @privlevel platform
129 * @privilege %http://tizen.org/privilege/screenshot
130 * @param[in] screenmirror #efl_util_screenmirror_h handle
131 * @param[in] func mirror buffer get handler
132 * @param[in] data user data
133 * @return @c 0 on success, otherwise a negative error value
134 * @retval #EFL_UTIL_ERROR_NONE Successful
135 * @retval #EFL_UTIL_ERROR_INVALID_PARAMETER Invalid parameter
136 * @retval #EFL_UTIL_ERROR_PERMISSION_DENIED No permission for screenmirror
137 * @see efl_util_screenmirror_initialize()
139 API int efl_util_screenmirror_set_handler(efl_util_screenmirror_h screenmirror,
140 efl_util_screenmirror_handler func, void *data);
144 * @brief Start the screenmirror.
146 * @privlevel platform
147 * @privilege %http://tizen.org/privilege/screenshot
148 * @param[in] screenmirror #efl_util_screenmirror_h handle
149 * @return @c 0 on success, otherwise a negative error value
150 * @retval #EFL_UTIL_ERROR_NONE Successful
151 * @retval #EFL_UTIL_ERROR_INVALID_PARAMETER Invalid parameter
152 * @retval #EFL_UTIL_ERROR_SCREENSHOT_EXECUTION_FAIL Execution failure
153 * @retval #EFL_UTIL_ERROR_PERMISSION_DENIED No permission for screenmirror
154 * @see efl_util_screenmirror_initialize()
156 API int efl_util_screenmirror_start(efl_util_screenmirror_h screenmirror);
160 * @brief Stop the screenmirror.
162 * @privlevel platform
163 * @privilege %http://tizen.org/privilege/screenshot
164 * @param[in] screenmirror #efl_util_screenmirror_h handle
165 * @return @c 0 on success, otherwise a negative error value
166 * @retval #EFL_UTIL_ERROR_NONE Successful
167 * @retval #EFL_UTIL_ERROR_INVALID_PARAMETER Invalid parameter
168 * @retval #EFL_UTIL_ERROR_SCREENSHOT_EXECUTION_FAIL Execution failure
169 * @retval #EFL_UTIL_ERROR_PERMISSION_DENIED No permission for screenmirror
170 * @see efl_util_screenmirror_initialize()
171 * @see efl_util_screenmirror_start();
173 API int efl_util_screenmirror_stop(efl_util_screenmirror_h screenmirror);
182 #endif /* __TIZEN_UI_EFL_UTIL_SCREENSHOT_EXTENSION_H__ */