Fix batch remove API
[platform/core/api/media-content.git] / include_product / media_image.h
1 /*
2 * Copyright (c) 2011 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
18
19 #ifndef __TIZEN_IMAGE_META_H__
20 #define __TIZEN_IMAGE_META_H__
21
22 #include <media_content_type.h>
23
24 #ifdef __cplusplus
25 extern "C" {
26 #endif /* __cplusplus */
27
28 /**
29  * @brief This file contains the image metadata API and related functions to proceed with them.
30  *        Functions include cloning and destroying the image metadata, getting image metadata such as width, height, \n
31  *        orientation, date taken, title, burst shot id and updating image to DB.
32  */
33
34 /**
35  * @addtogroup CAPI_CONTENT_MEDIA_IMAGE_MODULE
36  * @{
37  */
38
39
40 /**
41  * @brief Clones the image metadata.
42  * @details The function copies the image metadata handle from a source to destination.
43  *
44  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
45  *
46  * @remarks The destination handle must be released with image_meta_destroy().
47  *
48  * @param[out] dst  The destination handle to the image metadata
49  * @param[in]  src  The source handle to the image metadata
50  *
51  * @return @c 0 on success,
52  *         otherwise a negative error value
53  *
54  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
55  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
56  * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
57  *
58  * @see image_meta_destroy()
59  */
60 int image_meta_clone(image_meta_h *dst, image_meta_h src);
61
62 /**
63  * @brief Destroys the image metadata.
64  * @details The function frees all resources related to the image metadata handle. This handle
65  *          no longer can be used to perform any operation. A new handle has to
66  *          be created before next usage.
67  *
68  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
69  *
70  * @param[in] image The image metadata handle
71  *
72  * @return @c 0 on success,
73  *         otherwise a negative error value
74  *
75  * @retval #MEDIA_CONTENT_ERROR_NONE Successful
76  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
77  *
78  * @pre Get a copy of image_meta handle by calling image_meta_clone().
79  *
80  * @see image_meta_clone()
81  */
82 int image_meta_destroy(image_meta_h image);
83
84 /**
85  * @brief Gets the ID of an image.
86  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
87  *
88  * @param[in]  image    The image metadata handle
89  * @param[out] media_id The ID of an image
90  *
91  * @return @c 0 on success,
92  *         otherwise a negative error value
93  *
94  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
95  * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
96  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
97  */
98 int image_meta_get_media_id(image_meta_h image, char **media_id);
99
100 /**
101  * @brief Gets the image width in pixels.
102  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
103  *
104  * @param[in]  image The image metadata handle
105  * @param[out] width The image width in pixels
106  *
107  * @return @c 0 on success,
108  *         otherwise a negative error value
109  *
110  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
111  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
112  */
113 int image_meta_get_width(image_meta_h image, int *width);
114
115 /**
116  * @brief Gets the image height in pixels.
117  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
118  *
119  * @param[in]  image  The image metadata handle
120  * @param[out] height The image height in pixels
121  *
122  * @return @c 0 on success,
123  *         otherwise a negative error value
124  *
125  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
126  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
127  */
128 int image_meta_get_height(image_meta_h image, int *height);
129
130 /**
131  * @brief Gets the image orientation.
132  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
133  *
134  * @param[in]  image       The image metadata handle
135  * @param[out] orientation The image orientation
136  *
137  * @return @c 0 on success,
138  *         otherwise a negative error value
139  *
140  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
141  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
142  */
143 int image_meta_get_orientation(image_meta_h image, media_content_orientation_e *orientation);
144
145 /**
146  * @brief Gets the image creation time.
147  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
148  *
149  * @param[in]  image      The image metadata handle
150  * @param[out] date_taken The time, when image was taken (in seconds, since the Epoch)
151  *
152  * @return @c 0 on success,
153  *         otherwise a negative error value
154  *
155  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
156  * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
157  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
158  */
159 int image_meta_get_date_taken(image_meta_h image, char **date_taken);
160
161 /**
162  * @brief Gets the burst shot ID.
163  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
164  *
165  * @remarks You must release @a burst_id using free().
166  *
167  * @param[in]  image    The image metadata handle
168  * @param[out] burst_id The ID of burst shot\ n
169  *                      If @a burst_id is @c NULL, this is not burst shot
170  *
171  * @return @c 0 on success,
172  *         otherwise a negative error value
173  *
174  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
175  * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
176  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
177  */
178 int image_meta_get_burst_id(image_meta_h image, char **burst_id);
179
180 /**
181  * @brief Gets the exposure time from exif.
182  * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
183  *
184  * @remarks @a exposure time must be released with free() by you.
185  *
186  * @param[in]  image    The image metadata handle
187  * @param[out] exposure_time The value of exposure_time, getting from exif
188  *
189  * @return 0 on success,
190  *         otherwise a negative error value
191  *
192  * @retval #MEDIA_CONTENT_ERROR_NONE Successful
193  * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
194  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
195  *
196  */
197 int image_meta_get_exposure_time(image_meta_h image, char **exposure_time);
198
199 /**
200  * @brief Gets the fnumber from exif.
201  * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
202  *
203  * @param[in]  image    The image metadata handle
204  * @param[out] fnumber The value of fnumber, getting from exif
205  *
206  * @return 0 on success,
207  *         otherwise a negative error value
208  *
209  * @retval #MEDIA_CONTENT_ERROR_NONE Successful
210  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
211  *
212  */
213 int image_meta_get_fnumber(image_meta_h image, double *fnumber);
214
215 /**
216  * @brief Gets the iso from exif.
217  * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
218  *
219  * @param[in]  image    The image metadata handle
220  * @param[out] iso The value of iso, getting from exif
221  *
222  * @return 0 on success,
223  *         otherwise a negative error value
224  *
225  * @retval #MEDIA_CONTENT_ERROR_NONE Successful
226  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
227  *
228  */
229 int image_meta_get_iso(image_meta_h image, int *iso);
230
231 /**
232  * @brief Gets the model from exif.
233  * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
234  *
235  * @remarks @a model must be released with free() by you.
236  *
237  * @param[in]  image    The image metadata handle
238  * @param[out] model The value of model, getting from exif
239  *
240  * @return 0 on success,
241  *         otherwise a negative error value
242  *
243  * @retval #MEDIA_CONTENT_ERROR_NONE Successful
244  * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
245  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
246  *
247  */
248 int image_meta_get_model(image_meta_h image, char **model);
249
250 /**
251  * @brief Checks whether the media is a burst shot image.
252  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
253  *
254  * @param[in]  image         The image metadata handle
255  * @param[out] is_burst_shot @c true if the media is a burst shot image,
256  *                           otherwise @c false if the media is not a burst shot image
257  *
258  * @return @c 0 on success,
259  *         otherwise a negative error value
260  *
261  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
262  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
263  */
264 int image_meta_is_burst_shot(image_meta_h image, bool *is_burst_shot);
265
266 /**
267  * @deprecated Deprecated since 4.0. This data cannot be saved to the file.
268  * @brief Sets an orientation of the image.
269  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
270  *
271  * @param[in] image       The image metadata handle
272  * @param[in] orientation The image orientation
273  *
274  * @return @c 0 on success,
275  *         otherwise a negative error value
276  *
277  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
278  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
279  */
280 int image_meta_set_orientation(image_meta_h image, media_content_orientation_e orientation) TIZEN_DEPRECATED_API;
281
282 /**
283  * @deprecated Deprecated since 4.0. Related setter functions are deprecated, therefore this function is not needed anymore.
284  * @brief Updates the image to the media database.
285  *
286  * @details The function updates the given image meta in the media database. \n
287  *               The function should be called after any change in image attributes, to be updated to the media database.
288  *
289  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
290  *
291  * @privlevel public
292  * @privilege %http://tizen.org/privilege/content.write
293  *
294  * @remarks Do not call this function in callback function of foreach function like media_info_foreach_media_from_db().
295  *
296  * @param[in] image The handle to the image
297  *
298  * @return @c 0 on success,
299  *         otherwise a negative error value
300  *
301  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
302  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
303  * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
304  * @retval #MEDIA_CONTENT_ERROR_INVALID_OPERATION Invalid operation
305  * @retval #MEDIA_CONTENT_ERROR_DB_FAILED         DB Operation failed
306  * @retval #MEDIA_CONTENT_ERROR_DB_BUSY           DB Operation busy
307  * @retval #MEDIA_CONTENT_ERROR_NETWORK           Network fail
308  * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
309  *
310  * @pre This function requires opened connection to content service by media_content_connect().
311  *
312  * @see media_content_connect()
313  */
314 int image_meta_update_to_db(image_meta_h image) TIZEN_DEPRECATED_API;
315
316 /**
317  * @}
318  */
319
320
321 #ifdef __cplusplus
322 }
323 #endif /* __cplusplus */
324
325 #endif /*__TIZEN_IMAGE_META_H__*/