modify DB schema.
[platform/core/api/media-content.git] / include / media_info.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 #ifndef __TIZEN_MEDIA_INFORMATION_H__
19 #define __TIZEN_MEDIA_INFORMATION_H__
20
21 #include <media_content_type.h>
22
23
24
25 #ifdef __cplusplus
26 extern "C" {
27 #endif /* __cplusplus */
28
29 /**
30  * @file media_info.h
31  * @brief This file contains the media info API and related functions to proceed with it. \n
32  *        You can use the functions to insert, clone, delete, get the number and content of files from DB. \n
33  *        You can get and set properties and parameters such as storage type, provider, and category of media info, \n
34  *        handling with thumbnail and updating media info to DB.
35  */
36
37
38 /**
39  * @addtogroup CAPI_CONTENT_MEDIA_INFO_MODULE
40  * @{
41  */
42
43 /**
44  * @brief  Inserts a media file into the media database.
45  * @details This function inserts a media item into the content storage.
46  *          Normally, inserting a media file in database is done automatically by the media server, without calling this function.
47  *          This function is only called when the media server is busy and the user needs to get quick result of inserting
48  *          e.g. Taking a photo while media server is busy and the user wants to see the quick snapshot of the photo taken.
49  *
50  * @since_tizen 2.3
51  *
52  * @privlevel public
53  * @privilege %http://tizen.org/privilege/content.write \n
54  *                   %http://tizen.org/privilege/mediastorage \n
55  *                   %http://tizen.org/privilege/externalstorage
56  *
57  * @remarks You must release the handle using media_info_destroy(). \n
58  *                   You must add privilege http://tizen.org/privilege/content.write. And You add more privilege depending on your choice of contents path. \n
59  *                   If you want to access only internal storage by using  this API, you should add privilege http://tizen.org/privilege/mediastorage. \n
60  *                   Or if you want to access only external storage by using  this API, you shold add privilege http://tizen.org/privilege/externalstorage. \n
61  *                   If you can access both storage, you must add all privilege.
62  *
63  * @param[in]  path The path to the media file
64  * @param[out] info The handle to the media info
65  *
66  * @return @c 0 on success,
67  *         otherwise a negative error value
68  *
69  * @retval #MEDIA_CONTENT_ERROR_NONE Successful
70  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
71  * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
72  *
73  * @pre This function requires opened connection to content service by media_content_connect().
74  *
75  * @see media_content_connect()
76  */
77 int media_info_insert_to_db (const char *path, media_info_h *info);
78
79 /**
80  * @brief Inserts media files into the media database, asynchronously.
81  * @details This function inserts media items into the content storage.
82  *          Normally, inserting a media file in database is done automatically by the media server, without calling this function.
83  *          This function invokes media_insert_completed_cb() callback function when insertion to the media database is finished.
84  *
85  * @since_tizen 2.3
86  *
87  * @privlevel public
88  * @privilege %http://tizen.org/privilege/content.write \n
89  *                   %http://tizen.org/privilege/mediastorage \n
90  *                   %http://tizen.org/privilege/externalstorage
91  *
92  * @remarks You must add privilege http://tizen.org/privilege/content.write. And You add more privilege depending on your choice of contents path. \n
93  *                   If you want to access only internal storage by using  this API, you should add privilege http://tizen.org/privilege/mediastorage. \n
94  *                   Or if you want to access only external storage by using  this API, you shold add privilege http://tizen.org/privilege/externalstorage. \n
95  *                   If you can access both storage, you must add all privilege.
96  *
97  * @param[in] path_array   The path array to the media files
98  * @param[in] array_length The length of the array
99  * @param[in] callback     The callback to be invoked when media items inserted completely
100  * @param[in] user_data    The user data to be passed to the callback function
101  *
102  * @return @c 0 on success,
103  *         otherwise a negative error value
104  *
105  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
106  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
107  * @retval #MEDIA_CONTENT_ERROR_DB_FAILED         DB operation failed
108  * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
109  *
110  * @pre This function requires opened connection to content service by media_content_connect().
111  *
112  * @see media_content_connect()
113  * @see media_insert_completed_cb()
114  */
115 int media_info_insert_batch_to_db(const char **path_array,unsigned int array_length, media_insert_completed_cb callback, void *user_data);
116
117 /**
118  * @brief Inserts the burst shot images into the media database, asynchronously.
119  * @details This function inserts burst images into the content storage.
120  *          media_insert_burst_shot_completed_cb() will be called when insertion to media database is finished.
121  *
122  * @since_tizen 2.3
123  *
124  * @privlevel public
125  * @privilege %http://tizen.org/privilege/content.write \n
126  *                   %http://tizen.org/privilege/mediastorage \n
127  *                   %http://tizen.org/privilege/externalstorage
128  *
129  * @remarks You must add privilege http://tizen.org/privilege/content.write. And You add more privilege depending on your choice of contents path. \n
130  *                   If you want to access only internal storage with this API, you should add privilege http://tizen.org/privilege/mediastorage. \n
131  *                   Or if you want to access only external storage with this API, you shold add privilege http://tizen.org/privilege/externalstorage. \n
132  *                   If you can access both storage, you must add all privilege.
133  *
134  * @param[in] path_array   The path array to the burst shot images
135  * @param[in] array_length The length of the array
136  * @param[in] callback     The callback to be invoked when the images are inserted completely
137  * @param[in] user_data    The user data to be passed to the callback function
138  *
139  * @return @c 0 on success,
140  *         otherwise a negative error value
141  *
142  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
143  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
144  * @retval #MEDIA_CONTENT_ERROR_DB_FAILED         DB operation failed
145  * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
146  *
147  * @pre This function requires opened connection to content service by media_content_connect().
148  *
149  * @see media_content_connect()
150  * @see media_insert_burst_shot_completed_cb()
151  */
152 int media_info_insert_burst_shot_to_db(const char **path_array,unsigned int array_length, media_insert_burst_shot_completed_cb callback, void *user_data);
153
154 /**
155  * @brief Deletes a media file from the media database.
156  * @details This function deletes a media item from the content storage.
157  *          Normally, deleting a media file in the database is done automatically by the media server, without calling this function.
158  *          This function is only called when the media server is busy and user needs to get quick result of deleting.
159  *
160  * @since_tizen 2.3
161  *
162  * @privlevel public
163  * @privilege %http://tizen.org/privilege/content.write
164  *
165  * @param[in] media_id  The ID to the media file
166  *
167  * @return @c 0 on success,
168  *         otherwise a negative error value
169  *
170  * @retval #MEDIA_CONTENT_ERROR_NONE Successful
171  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
172  * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
173  *
174  * @pre This function requires opened connection to content service by media_content_connect().
175  *
176  * @see media_content_connect()
177  */
178 int media_info_delete_from_db(const char *media_id);
179
180 /**
181  * @brief Deletes media files from the media database. 
182  *        The media files for deletion can be specified as a condition in a filter.
183  * @details This function deletes the media items from the content storage.
184  *          Normally, deleting  media files in the database are done automatically by the media server, without calling this function.
185  *          This function is only called when the media server is busy and user needs to get quick result of deleting.
186  *
187  * @since_tizen 2.3
188  *
189  * @privlevel public
190  * @privilege %http://tizen.org/privilege/content.write
191  *
192  * @param[in] filter  The handle to filter
193  *
194  * @return @c 0 on success,
195  *         otherwise a negative error value
196  *
197  * @retval #MEDIA_CONTENT_ERROR_NONE Successful
198  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
199  * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
200  *
201  * @pre This function requires opened connection to content service by media_content_connect().
202  *
203  * @see media_content_connect()
204  */
205 int media_info_delete_batch_from_db(filter_h filter);
206
207
208 /**
209  * @brief Destroys media info.
210  * @details The function frees all resources related to the media info handle. This handle
211  *          can no longer be used to perform any operation. New media info handle has to
212  *          be created before the next usage.
213  *
214  * @since_tizen 2.3
215  *
216  * @param[in]  media  The media info handle
217  *
218  * @return @c 0 on success,
219  *         otherwise a negative error value
220  *
221  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
222  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
223  * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
224  *
225  * @pre Get copy of media_info handle by calling media_info_clone().
226  *
227  * @see media_info_clone()
228  */
229 int media_info_destroy(media_info_h media);
230
231 /**
232  * @brief Clones the media info handle.
233  *
234  * @details This function copies the media info handle from a source to the destination.
235  *          There is no media_info_create() function. The media_info_h is created internally and
236  *          available through media info foreach function such as media_info_foreach_media_from_db().
237  *          To use this handle outside of these foreach functions, use this function.
238  *
239  * @since_tizen 2.3
240  *
241  * @remarks You must release the destination handle using media_info_destroy().
242  *
243  * @param[out] dst  The destination handle to the media info
244  * @param[in]  src  The source handle to media info
245  *
246  * @return @c 0 on success,
247  *         otherwise a negative error value
248  *
249  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
250  * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
251  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
252  * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
253  *
254  * @see media_info_destroy()
255  * @see media_album_foreach_media_from_db()
256  * @see media_playlist_foreach_media_from_db()
257  * @see media_group_foreach_media_from_db
258  * @see media_tag_foreach_media_from_db()
259  * @see media_info_foreach_media_from_db()
260  * @see media_folder_foreach_media_from_db()
261  */
262 int media_info_clone(media_info_h *dst, media_info_h src);
263
264 /**
265  * @brief Gets the count of media info for the passed @a filter from the media database.
266  * @since_tizen 2.3
267  *
268  * @param[in]  filter      The handle to filter
269  * @param[out] media_count The count of media
270  *
271  * @return @c 0 on success,
272  *         otherwise a negative error value
273  *
274  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
275  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
276  * @retval #MEDIA_CONTENT_ERROR_DB_FAILED         DB operation failed
277  * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
278  *
279  * @pre This function requires opened connection to content service by media_content_connect().
280  *
281  * @see media_content_connect()
282  */
283 int media_info_get_media_count_from_db(filter_h filter, int *media_count);
284
285 /**
286  * @brief Iterates through media info from the media database.
287  * @details This function gets all media info handles meeting the given @a filter.
288  *          The @a callback function will be invoked for every retrieved media info.
289  *          If @c NULL is passed to the @a filter, then no filtering is applied.
290  *
291  * @since_tizen 2.3
292  *
293  * @remarks Do not call updating DB function like media_info_update_to_db(), media_info_refresh_metadata_to_db(), audio_meta_update_to_db(), image_meta_update_to_db() and video_meta_update_to_db()  in your callback function,
294  *                   your callback function is invoked as inline function.
295  *                   So, your callback function is in read state in SQLite. When you are in read state, sometimes you do not update DB.
296  *                   We do not recommend you call updating DB function in callback of foreach function.
297  *
298  * @param[in] filter    The media info handle filter
299  * @param[in] callback  The callback function to be invoked
300  * @param[in] user_data The user data to be passed to the callback function
301  *
302  * @return @c 0 on success,
303  *         otherwise a negative error value
304  *
305  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
306  * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
307  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
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  * @post This function invokes media_info_cb().
312  *
313  * @see media_content_connect()
314  * @see #media_info_cb
315  * @see media_info_filter_create()
316  */
317 int media_info_foreach_media_from_db(filter_h filter, media_info_cb callback, void *user_data);
318
319 /**
320  * @brief Gets the count of media tags for the passed @a filter in the given @a media_id from the media database.
321  * @since_tizen 2.3
322  *
323  * @param[in]  media_id  The ID of the media info
324  * @param[in]  filter    The handle to the media filter
325  * @param[out] tag_count The count of the media tag
326  *
327  * @return @c 0 on success,
328  *         otherwise a negative error value
329  *
330  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
331  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
332  * @retval #MEDIA_CONTENT_ERROR_DB_FAILED         DB operation failed
333  * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
334  *
335  * @pre This function requires opened connection to content service by media_content_connect().
336  *
337  * @see media_content_connect()
338  */
339 int media_info_get_tag_count_from_db(const char *media_id, filter_h filter, int *tag_count);
340
341 /**
342  * @brief Iterates through the media tag in the given media info from the media database.
343  * @details This function gets all the media tags associated with the given @a media_id and calls registered callback function for every retrieved media tag.
344  *
345  * @since_tizen 2.3
346  *
347  * @param[in] media_id  The ID of the media info
348  * @param[in] filter    The handle to the media filter
349  * @param[in] callback  The callback function to be invoked
350  * @param[in] user_data The user data to be passed to the callback function
351  *
352  * @return @c 0 on success,
353  *         otherwise a negative error value
354  *
355  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
356  * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
357  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
358  * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
359  *
360  * @pre  This function requires opened connection to content service by media_content_connect().
361  * @post This function invokes media_tag_cb().
362  *
363  * @see media_content_connect()
364  * @see #media_tag_cb
365  */
366 int media_info_foreach_tag_from_db(const char *media_id, filter_h filter, media_tag_cb callback, void *user_data);
367
368 /**
369  * @brief Gets the number of bookmarks for the passed @a filter in the given media ID from the media database.
370  * @since_tizen 2.3
371  *
372  * @param[in]  media_id        The ID of the media info
373  * @param[in]  filter          The handle to the media filter
374  * @param[out] bookmark_count  The count of the media tag
375  *
376  * @return @c 0 on success,
377  *         otherwise a negative error value
378  *
379  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
380  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
381  * @retval #MEDIA_CONTENT_ERROR_DB_FAILED         DB operation failed
382  * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
383  *
384  * @pre This function requires opened connection to content service by media_content_connect().
385  *
386  * @see media_content_connect()
387  */
388 int media_info_get_bookmark_count_from_db(const char *media_id, filter_h filter, int *bookmark_count);
389
390 /**
391  * @brief Iterates through the media bookmark in the given media info from the media database.
392  * @details This function gets all media bookmarks associated with the given media and calls registered callback function for every retrieved media bookmark.
393  *
394  * @since_tizen 2.3
395  *
396  * @param[in] media_id  The ID of the media info
397  * @param[in] filter    The handle to the media filter
398  * @param[in] callback  The callback function to be invoked
399  * @param[in] user_data The user data to be passed to the callback function
400  *
401  * @return @c 0 on success,
402  *         otherwise a negative error value
403  *
404  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
405  * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
406  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
407  * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
408  *
409  * @pre  This function requires opened connection to content service by media_content_connect().
410  * @post This function invokes media_bookmark_cb().
411  *
412  * @see media_content_connect()
413  * @see media_bookmark_cb()
414  */
415 int media_info_foreach_bookmark_from_db (const char *media_id, filter_h filter, media_bookmark_cb callback, void *user_data);
416
417 /**
418  * @brief Gets the image metadata for a given media info.
419  * @details This function returns an image metadata handle retrieved from the media info.
420  *
421  * @since_tizen 2.3
422  *
423  * @remarks You must release the @a image handle using image_meta_destroy().
424  *
425  * @param[in]  media  The media info handle
426  * @param[out] image  A handle to image metadata
427  *
428  * @return @c 0 on success,
429  *         otherwise a negative error value
430  *
431  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
432  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
433  * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
434  *
435  * @see image_meta_destroy()
436  */
437 int media_info_get_image(media_info_h media, image_meta_h *image);
438
439 /**
440  * @brief Gets a video metadata for a given media info.
441  * @details This function returns a video metadata handle retrieved from the media info handle.
442  *
443  * @since_tizen 2.3
444  *
445  * @remarks You must release the @a video handle using video_meta_destroy().
446  *
447  * @param[in]  media The media info handle
448  * @param[out] video A handle to the video meta
449  *
450  * @return @c 0 on success,
451  *         otherwise a negative error value
452  *
453  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
454  * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
455  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
456  * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
457  *
458  * @see video_meta_destroy()
459  */
460 int media_info_get_video(media_info_h media, video_meta_h *video);
461
462 /**
463  * @brief Gets an audio metadata for a given media info.
464  * @details This function returns an audio metadata handle retrieved from the media info handle.
465  *
466  * @since_tizen 2.3
467  *
468  * @remarks You must release the @a audio handle using audio_meta_destroy().
469  *
470  * @param[in]  media The media info handle
471  * @param[out] audio A handle to the audio meta
472  *
473  * @return @c 0 on success,
474  *         otherwise a negative error value
475  *
476  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
477  * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
478  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
479  * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
480  *
481  * @see audio_meta_destroy()
482  */
483 int media_info_get_audio(media_info_h media, audio_meta_h *audio);
484
485 /**
486  * @brief Gets the tag ID for the media info.
487  * @since_tizen 2.3
488  *
489  * @param[in]  media The media info handle
490  * @param[out] media_id     The ID of the media tag
491  *
492  * @return @c 0 on success,
493  *         otherwise a negative error value
494  *
495  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
496  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
497  * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
498  */
499 int media_info_get_media_id(media_info_h media, char **media_id);
500
501 /**
502  * @brief Gets the path to the media info.
503  * @since_tizen 2.3
504  *
505  * @remarks You must release @a path using free().
506  *
507  * @param[in]  media The media info handle
508  * @param[out] path  The path of the media info
509  *
510  * @return @c 0 on success,
511  *         otherwise a negative error value
512  *
513  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
514  * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
515  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
516  * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
517  *
518  */
519 int media_info_get_file_path(media_info_h media, char **path);
520
521 /**
522  * @brief Gets the name of the media info.
523  * @since_tizen 2.3
524  *
525  * @remarks You must release @a name using free().
526  *
527  * @param[in]  media The media info handle
528  * @param[out] name  The name of media info
529  *
530  * @return @c 0 on success,
531  *         otherwise a negative error value
532  *
533  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
534  * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
535  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
536  * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
537  */
538 int media_info_get_display_name(media_info_h media, char **name);
539
540 /**
541  * @brief Gets the content type of the media info.
542  * @since_tizen 2.3
543  *
544  * @param[in]  media The media info handle
545  * @param[out] type  The type of the media content (#media_content_type_e)
546  *
547  * @return @c 0 on success,
548  *         otherwise a negative error value
549  *
550  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
551  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
552  * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
553  */
554 int media_info_get_media_type(media_info_h media, media_content_type_e *type);
555
556 /**
557  * @brief Gets the MIME type from the media info.
558  * @since_tizen 2.3
559  *
560  * @remarks You must release @a mime_type using free().
561  *
562  * @param[in]  media     The media info handle
563  * @param[out] mime_type The MIME type of the media info
564  *
565  * @return @c 0 on success,
566  *         otherwise a negative error value
567  *
568  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
569  * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
570  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
571  * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
572  */
573 int media_info_get_mime_type(media_info_h media, char **mime_type);
574
575 /**
576  * @brief Gets the media file size.
577  * @since_tizen 2.3
578  *
579  * @param[in]  media The media info handle
580  * @param[out] size  The type of the media content
581  *
582  * @return @c 0 on success,
583  *         otherwise a negative error value
584  *
585  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
586  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
587  * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
588  */
589 int media_info_get_size(media_info_h media, unsigned long long *size);
590
591 /**
592  * @brief Gets the addition time of the media.
593  * @since_tizen 2.3
594  *
595  * @param[in]  media      The media info handle
596  * @param[out] added_time The added time to the DB
597  *
598  * @return @c 0 on success,
599  *         otherwise a negative error value
600  *
601  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
602  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
603  * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
604  */
605 int media_info_get_added_time(media_info_h media, time_t *added_time);
606
607 /**
608  * @brief Gets the date of modification of media info.
609  * @since_tizen 2.3
610  *
611  * @param[in]  media The media info handle
612  * @param[out] time  The date of modification of the file \n
613  *                   Get from the file.
614  *
615  * @return @c 0 on success,
616  *         otherwise a negative error value
617  *
618  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
619  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
620  * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
621  */
622 int media_info_get_modified_time(media_info_h media, time_t *time);
623
624 /**
625  * @brief Gets media info's timeline.
626  *
627  * @param[in] media The handle to media info
628  * @param[out] time The date of timeline.
629  * @return 0 on success, otherwise a negative error value.
630  * @retval #MEDIA_CONTENT_ERROR_NONE Successful
631  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
632  *
633  */
634 int media_info_get_timeline(media_info_h media, time_t* time);
635
636 /**
637  * @brief Gets the thumbnail of media info.
638  * @since_tizen 2.3
639  *
640  * @remarks You must release @a path using free().
641  *
642  * @param[in]  media The media info handle
643  * @param[out] path  The path to the thumbnail of the media info
644  *
645  * @return @c 0 on success,
646  *         otherwise a negative error value
647  *
648  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
649  * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
650  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
651  * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
652  */
653 int media_info_get_thumbnail_path(media_info_h media, char **path);
654
655 /**
656  * @brief Gets the description of media info.
657  * @since_tizen 2.3
658  *
659  * @remarks You must release @a description using free().
660  *
661  * @param[in]  media       The media info handle
662  * @param[out] description The description of the media info
663  *
664  * @return @c 0 on success,
665  *         otherwise a negative error value
666  *
667  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
668  * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
669  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
670  * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
671  */
672 int media_info_get_description(media_info_h media, char **description);
673
674 /**
675  * @brief Gets the longitude of media info.
676  * @since_tizen 2.3
677  *
678  * @param[in]  media     The media info handle
679  * @param[out] longitude The longitude of the media info
680  *
681  * @return @c 0 on success,
682  *         otherwise a negative error value
683  *
684  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
685  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
686  * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
687  */
688 int media_info_get_longitude(media_info_h media, double* longitude);
689
690 /**
691  * @brief Gets the latitude of media info.
692  * @since_tizen 2.3
693  *
694  * @param[in]  media    The media info handle
695  * @param[out] latitude The latitude of the media info
696  *
697  * @return @c 0 on success,
698  *         otherwise a negative error value
699  *
700  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
701  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
702  * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
703  *
704  */
705 int media_info_get_latitude(media_info_h media, double* latitude);
706
707 /**
708  * @brief Gets the altitude of media info.
709  * @since_tizen 2.3
710  *
711  * @param[in]  media    The media info handle
712  * @param[out] altitude The altitude of the media info
713  *
714  * @return @c 0 on success,
715  *         otherwise a negative error value
716  *
717  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
718  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
719  * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
720  */
721 int media_info_get_altitude(media_info_h media, double* altitude);
722
723 /**
724  * @brief Gets media info's weather.
725  *
726  * @param[in] media The handle to media info
727  * @param[out] weater The weather of media info
728  * @return 0 on success, otherwise a negative error value.
729  * @retval #MEDIA_CONTENT_ERROR_NONE Successful
730  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
731  *
732  */
733 int media_info_get_weather(media_info_h media, char **weather);
734
735 /**
736  * @brief Gets the rating of media info.
737  * @since_tizen 2.3
738  *
739  * @param[in]  media  The media info handle
740  * @param[out] rating The rating of the media info
741  *
742  * @return @c 0 on success,
743  *         otherwise a negative error value
744  *
745  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
746  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
747  * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
748  */
749 int media_info_get_rating(media_info_h media, int *rating);
750
751 /**
752  * @brief Gets the favorite status of media info.
753  * @since_tizen 2.3
754  *
755  * @param[in]  media     The media info handle
756  * @param[out] favorite  @c true if media info is set as favorite, 
757  *                       otherwise @c false if media info is not set as favorite
758  *
759  * @return @c 0 on success,
760  *         otherwise a negative error value
761  *
762  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
763  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
764  * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
765  */
766 int media_info_get_favorite(media_info_h media, bool* favorite);
767
768 /**
769  * @brief Gets the author of media info.
770  * @since_tizen 2.3
771  *
772  * @remarks You must release @a author using free().
773  *
774  * @param[in]  media  The media info handle
775  * @param[out] author The author of the media info
776  *
777  * @return @c 0 on success,
778  *         otherwise a negative error value
779  *
780  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
781  * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
782  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
783  * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
784  */
785 int media_info_get_author(media_info_h media, char **author);
786
787 /**
788  * @brief Gets the provider of media info.
789  * @since_tizen 2.3
790  *
791  * @remarks You must release @a provider using free().
792  *
793  * @param[in]  media    The media info handle
794  * @param[out] provider The provider of the media info
795  *
796  * @return @c 0 on success,
797  *         otherwise a negative error value
798  *
799  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
800  * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
801  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
802  * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
803  */
804 int media_info_get_provider(media_info_h media, char **provider);
805
806 /**
807  * @brief Gets the content name of media info.
808  * @since_tizen 2.3
809  *
810  * @remarks You must release @a content_name using free().
811  *
812  * @param[in]  media        The media info handle
813  * @param[out] content_name The content name of the media info
814  *
815  * @return @c 0 on success,
816  *         otherwise a negative error value
817  *
818  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
819  * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
820  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
821  * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
822  */
823 int media_info_get_content_name(media_info_h media, char **content_name);
824
825 /**
826  * @brief Gets the title of media info.
827  * @since_tizen 2.3
828  *
829  * @remarks You must release @a title using free().
830  *
831  * @param[in]  media  The media info handle
832  * @param[out] title  The title of the media info
833  *
834  * @return @c 0 on success,
835  *         otherwise a negative error value
836  *
837  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
838  * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
839  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
840  * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
841  */
842 int media_info_get_title(media_info_h media, char **title);
843
844 /**
845  * @brief Gets the category of media info.
846  * @since_tizen 2.3
847  *
848  * @remarks You must release @a category using free().
849  *
850  * @param[in]  media    The media info handle
851  * @param[out] category The category of the media info
852  *
853  * @return @c 0 on success,
854  *         otherwise a negative error value
855  *
856  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
857  * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
858  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
859  * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
860  */
861 int media_info_get_category(media_info_h media, char **category);
862
863 /**
864  * @brief Gets the location tag of media info.
865  * @since_tizen 2.3
866  *
867  * @remarks You must release @a location_tag using free().
868  *
869  * @param[in]  media        The media info handle
870  * @param[out] location_tag The location of the media info
871  *
872  * @return @c 0 on success,
873  *         otherwise a negative error value
874  *
875  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
876  * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
877  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
878  * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
879  */
880 int media_info_get_location_tag(media_info_h media, char **location_tag);
881
882 /**
883  * @brief Gets the age_rating of media info.
884  * @since_tizen 2.3
885  *
886  * @remarks You must release @a age_rating using free().
887  *
888  * @param[in]  media      The media info handle
889  * @param[out] age_rating The age rating of the media info
890  *
891  * @return @c 0 on success,
892  *         otherwise a negative error value
893  *
894  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
895  * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
896  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
897  * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
898  */
899 int media_info_get_age_rating(media_info_h media, char **age_rating);
900
901 /**
902  * @brief Gets the keyword of media info.
903  * @since_tizen 2.3
904  *
905  * @remarks You must release @a keyword using free().
906  *
907  * @param[in]  media   The media info handle
908  * @param[out] keyword The keyword of the media info
909  *
910  * @return @c 0 on success,
911  *         otherwise a negative error value
912  *
913  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
914  * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
915  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
916  * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
917  */
918 int media_info_get_keyword(media_info_h media, char **keyword);
919
920 /**
921  * @brief Checks whether the media is protected via DRM.
922  * @since_tizen 2.3
923  *
924  * @param[in]  media  The media info handle
925  * @param[out] is_drm @c true if media is DRM media,
926  *                    otherwise @c false if media is not DRM media
927  *
928  * @return @c 0 on success,
929  *         otherwise a negative error value
930  *
931  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
932  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
933  * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
934  */
935 int media_info_is_drm(media_info_h media, bool *is_drm);
936
937 /**
938  * @brief Gets the storage type of media info.
939  * @since_tizen 2.3
940  *
941  * @param[in]  media        The media info handle
942  * @param[out] storage_type The storage type of the media info
943  *
944  * @return @c 0 on success,
945  *         otherwise a negative error value
946  *
947  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
948  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
949  * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
950  */
951 int media_info_get_storage_type(media_info_h media, media_content_storage_e *storage_type);
952
953 /**
954  * @brief Gets the media info from the media database.
955  *
956  * @details This function creates a new media handle from the media database by the given @a media_id.
957  *          Media info will be created and filled with information.
958  *
959  * @since_tizen 2.3
960  *
961  * @remarks You must release @a media using media_tag_destroy().
962  *
963  * @param[in]  media_id The ID of media info
964  * @param[out] media    The media handle associated with the media ID
965  *
966  * @return @c 0 on success,
967  *         otherwise a negative error value
968  *
969  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
970  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
971  * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
972  *
973  * @pre This function requires opened connection to content service by media_content_connect().
974  *
975  * @see media_content_connect()
976  * @see media_info_destroy()
977  */
978 int media_info_get_media_from_db(const char *media_id, media_info_h *media);
979
980 /**
981  * @brief Sets the display name of media info.
982  * @since_tizen 2.3
983  *
984  * @param[in] media        The media info handle
985  * @param[in] display_name The display name of the media info
986  *
987  * @return @c 0 on success,
988  *         otherwise a negative error value
989  *
990  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
991  * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
992  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
993  * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
994  *
995  * @post media_info_update_to_db().
996  *
997  */
998 int media_info_set_display_name(media_info_h media, const char *display_name);
999
1000 /**
1001  * @brief Sets the description of media info.
1002  * @since_tizen 2.3
1003  *
1004  * @param[in] media       The media info handle
1005  * @param[in] description The description of the media info
1006  *
1007  * @return @c 0 on success,
1008  *         otherwise a negative error value
1009  *
1010  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
1011  * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
1012  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1013  * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
1014  *
1015  * @post media_info_update_to_db().
1016  *
1017  */
1018 int media_info_set_description(media_info_h media, const char *description);
1019
1020 /**
1021  * @brief Sets the longitude of media info.
1022  * @since_tizen 2.3
1023  *
1024  * @param[in] media     The media info handle
1025  * @param[in] longitude The longitude of the media info
1026  *
1027  * @return @c 0 on success,
1028  *         otherwise a negative error value
1029  *
1030  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
1031  * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
1032  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1033  * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
1034  *
1035  * @post media_info_update_to_db().
1036  */
1037 int media_info_set_longitude(media_info_h media, double longitude);
1038
1039 /**
1040  * @brief Sets the latitude of media info.
1041  * @since_tizen 2.3
1042  *
1043  * @param[in] media    The media info handle
1044  * @param[in] latitude The latitude of the media info
1045  *
1046  * @return @c 0 on success,
1047  *         otherwise a negative error value
1048  *
1049  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
1050  * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
1051  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1052  * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
1053  *
1054  * @post media_info_update_to_db().
1055  */
1056 int media_info_set_latitude(media_info_h media, double latitude);
1057
1058 /**
1059  * @brief Sets the altitude of media info.
1060  * @since_tizen 2.3
1061  *
1062  * @param[in] media    The media info handle
1063  * @param[in] altitude The altitude of the media info
1064  *
1065  * @return @c 0 on success,
1066  *         otherwise a negative error value
1067  *
1068  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
1069  * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
1070  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1071  * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
1072  *
1073  * @post media_info_update_to_db().
1074  */
1075 int media_info_set_altitude(media_info_h media, double altitude);
1076
1077 /**
1078  * @brief Sets weather to media info.
1079  *
1080  * @param[in] media The handle to media info
1081  * @param[in] weather The weather of media info
1082  * @return 0 on success, otherwise a negative error value.
1083  * @retval #MEDIA_CONTENT_ERROR_NONE Successful
1084  * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
1085  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1086  * @post media_info_update_to_db()
1087  *
1088  */
1089 int media_info_set_weather(media_info_h media, const char *weather);
1090
1091 /**
1092  * @brief Sets the rating of media info.
1093  * @since_tizen 2.3
1094  *
1095  * @param[in] media  The media info handle
1096  * @param[in] rating The rating of the media info
1097  *
1098  * @return @c 0 on success,
1099  *         otherwise a negative error value
1100  *
1101  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
1102  * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
1103  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1104  * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
1105  *
1106  * @post media_info_update_to_db().
1107  */
1108 int media_info_set_rating(media_info_h media, int rating);
1109
1110 /**
1111  * @brief Sets the favorite of media info.
1112  * @since_tizen 2.3
1113  *
1114  * @param[in] media    The media info handle
1115  * @param[in] favorite Set @c true to set the media info as favorite,
1116  *                     otherwise set @c false to not set the media info as favorite
1117  *
1118  * @return @c 0 on success,
1119  *         otherwise a negative error value
1120  *
1121  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
1122  * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
1123  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1124  * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
1125  */
1126 int media_info_set_favorite(media_info_h media, bool favorite);
1127
1128 /**
1129  * @brief Sets the author of media info.
1130  * @since_tizen 2.3
1131  *
1132  * @param[in] media  The media info handle
1133  * @param[in] author The author of the media info
1134  *
1135  * @return @c 0 on success,
1136  *         otherwise a negative error value
1137  *
1138  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
1139  * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
1140  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1141  * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
1142  */
1143 int media_info_set_author(media_info_h media, const char *author);
1144
1145 /**
1146  * @brief Sets the provider of media info.
1147  * @since_tizen 2.3
1148  *
1149  * @param[in] media    The media info handle
1150  * @param[in] provider The provider of the media info
1151  *
1152  * @return @c 0 on success,
1153  *         otherwise a negative error value
1154  *
1155  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
1156  * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
1157  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1158  * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
1159  */
1160 int media_info_set_provider(media_info_h media, const char *provider);
1161
1162 /**
1163  * @brief Sets the content name of media info.
1164  * @since_tizen 2.3
1165  *
1166  * @param[in] media        The media info handle
1167  * @param[in] content_name The content name of the media info
1168  *
1169  * @return @c 0 on success,
1170  *         otherwise a negative error value
1171  *
1172  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
1173  * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
1174  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1175  * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
1176  *
1177  * @post media_info_update_to_db()
1178  */
1179 int media_info_set_content_name(media_info_h media, const char *content_name);
1180
1181 /**
1182  * @brief Sets the category of media info.
1183  * @since_tizen 2.3
1184  *
1185  * @param[in] media    The media info handle
1186  * @param[in] category The category of the media info
1187  *
1188  * @return @c 0 on success,
1189  *         otherwise a negative error value
1190  *
1191  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
1192  * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
1193  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1194  * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
1195  *
1196  * @post media_info_update_to_db()
1197  */
1198 int media_info_set_category(media_info_h media, const char *category);
1199
1200 /**
1201  * @brief Sets the location tag of media info.
1202  * @since_tizen 2.3
1203  *
1204  * @param[in] media        The media info handle
1205  * @param[in] location_tag The location of the media info
1206  *
1207  * @return @c 0 on success,
1208  *         otherwise a negative error value
1209  *
1210  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
1211  * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
1212  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1213  * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
1214  *
1215  * @post media_info_update_to_db()
1216  */
1217 int media_info_set_location_tag(media_info_h media, const char *location_tag);
1218
1219 /**
1220  * @brief Sets the age rating of media info.
1221  * @since_tizen 2.3
1222  *
1223  * @param[in] media      The media info handle
1224  * @param[in] age_rating The age rating of the media info
1225  *
1226  * @return @c 0 on success,
1227  *         otherwise a negative error value
1228  *
1229  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
1230  * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
1231  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1232  * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
1233  *
1234  * @post media_info_update_to_db()
1235  */
1236 int media_info_set_age_rating(media_info_h media, const char *age_rating);
1237
1238 /**
1239  * @brief Sets the keyword of media info.
1240  * @since_tizen 2.3
1241  *
1242  * @param[in] media   The media info handle
1243  * @param[in] keyword The keyword of the media info
1244  *
1245  * @return @c 0 on success,
1246  *         otherwise a negative error value
1247  *
1248  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
1249  * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
1250  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1251  * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
1252  *
1253  * @post media_info_update_to_db()
1254  */
1255 int media_info_set_keyword(media_info_h media, const char *keyword);
1256
1257 /**
1258  * @brief Updates the media info to the media database.
1259  * 
1260  * @details The function updates the given media info in the media database.
1261  *
1262  * @since_tizen 2.3
1263  * @privlevel public
1264  * @privilege %http://tizen.org/privilege/content.write
1265  *
1266  * @remarks The function should be called after any change in media, to be updated to the media
1267  *          database. For example, after using media_info_set_display_name()
1268  *          for setting the name of the media, the media_info_update_to_db() function should be called so as to update
1269  *          the given media info attributes in the media database.
1270  *
1271  * @param[in] media The media info handle
1272  *
1273  * @return @c 0 on success,
1274  *         otherwise a negative error value
1275  *
1276  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
1277  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1278  * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
1279  *
1280  * @pre This function requires opened connection to content service by media_content_connect().
1281  *
1282  * @see media_content_connect()
1283  * @see media_info_set_display_name()
1284  * @see media_info_set_description()
1285  * @see media_info_set_longitude()
1286  * @see media_info_set_latitude()
1287  * @see media_info_set_altitude()
1288  * @see media_info_set_rating()
1289  * @see media_info_set_favorite()
1290  * @see media_info_set_author()
1291  * @see media_info_set_provider()
1292  * @see media_info_set_content_name()
1293  * @see media_info_set_category()
1294  * @see media_info_set_location_tag()
1295  * @see media_info_set_age_rating()
1296  */
1297 int media_info_update_to_db(media_info_h media);
1298
1299 /**
1300  * @brief Refreshes the media metadata to the media database.
1301  * @since_tizen 2.3
1302  *
1303  * @privlevel public
1304  * @privilege %http://tizen.org/privilege/content.write \n
1305  *                   %http://tizen.org/privilege/mediastorage \n
1306  *                   %http://tizen.org/privilege/externalstorage
1307  *
1308  * @remarks You must add privilege http://tizen.org/privilege/content.write. And You add more privilege depending on your choice of contents path. \n
1309  *                   If you want to access only internal storage by using  this API, you should add privilege http://tizen.org/privilege/mediastorage. \n
1310  *                   Or if you want to access only external storage by using  this API, you shold add privilege http://tizen.org/privilege/externalstorage. \n
1311  *                   If you can access both storage, you should add all privilege.
1312  *
1313  * @param[in] media_id The ID of the media info
1314  *
1315  * @return @c 0 on success,
1316  *         otherwise a negative error value
1317  *
1318  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
1319  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1320  * @retval #MEDIA_CONTENT_ERROR_DB_FAILED         DB operation failed
1321  * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
1322  *
1323  * @pre This function requires opened connection to content service by media_content_connect().
1324  *
1325  * @see media_content_connect()
1326  */
1327 int media_info_refresh_metadata_to_db(const char *media_id);
1328
1329 /**
1330  * @brief Sets the added time of media info.
1331  * @since_tizen 2.3
1332  *
1333  * @param[in] media      The media info handle
1334  * @param[in] added_time The added time of the media info
1335  *
1336  * @return @c 0 on success,
1337  *         otherwise a negative error value
1338  *
1339  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
1340  * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
1341  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1342  * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
1343  *
1344  * @post media_info_update_to_db()
1345  */
1346 int media_info_set_added_time(media_info_h media, time_t added_time);
1347
1348 /**
1349  * @brief Moves the media info to the given destination path in the media database.
1350  * @since_tizen 2.3
1351  *
1352  * @privlevel public
1353  * @privilege %http://tizen.org/privilege/content.write \n
1354  *                   %http://tizen.org/privilege/mediastorage \n
1355  *                   %http://tizen.org/privilege/externalstorage
1356  *
1357  * @remarks You must add privilege http://tizen.org/privilege/content.write. And You add more privilege depending on your choice of contents path. \n
1358  *                   If you want to access only internal storage by using  this API, you should add privilege http://tizen.org/privilege/mediastorage. \n
1359  *                   Or if you want to access only external storage by using this API, you shold add privilege http://tizen.org/privilege/externalstorage. \n
1360  *                   If you can access both storage, you should add all privilege.
1361  *
1362  * @param[in] media    The media info handle
1363  * @param[in] dst_path The path of destination
1364  *
1365  * @return @c 0 on success,
1366  *         otherwise a negative error value
1367  *
1368  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
1369  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1370  * @retval #MEDIA_CONTENT_ERROR_DB_FAILED         DB operation failed
1371  * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
1372  *
1373  * @pre This function requires opened connection to content service by media_content_connect().
1374  *
1375  * @see media_content_connect()
1376  */
1377 int media_info_move_to_db(media_info_h media, const char* dst_path);
1378
1379 /**
1380  * @brief Creates a thumbnail image for the given media, asynchronously.
1381  * @details This function creates an thumbnail image for given media item and calls registered callback function for completion of creating the thumbnail.
1382  *          If a thumbnail already exists for the given media, then the path of thumbnail will be returned in callback function.
1383  *
1384  * @since_tizen 2.3
1385  *
1386  * @privlevel public
1387  * @privilege %http://tizen.org/privilege/content.write
1388  *
1389  * @param[in] media     The media info handle
1390  * @param[in] callback  The callback function to be invoked
1391  * @param[in] user_data The user data to be passed to the callback function
1392  *
1393  * @return @c 0 on success,
1394  *         otherwise a negative error value
1395  *
1396  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
1397  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter (Especially, if the request is duplicated, this error returns.)
1398  * @retval #MEDIA_CONTENT_ERROR_DB_FAILED         DB operation failed
1399  * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
1400  *
1401  * @pre This function requires opened connection to content service by media_content_connect().
1402  *
1403  * @see media_content_connect()
1404  */
1405 int media_info_create_thumbnail(media_info_h media, media_thumbnail_completed_cb callback, void *user_data);
1406
1407 /**
1408  * @brief Cancels the creation of image's thumbnail for the given media.
1409  * @since_tizen 2.3
1410  *
1411  * @privlevel public
1412  * @privilege %http://tizen.org/privilege/content.write
1413  *
1414  * @param[in] media The media info handle
1415  *
1416  * @return @c 0 on success,
1417  *         otherwise a negative error value
1418  *
1419  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
1420  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1421  * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
1422  *
1423  * @pre This function requires opened connection to content service by media_content_connect().
1424  * @see media_content_connect()
1425  */
1426 int media_info_cancel_thumbnail(media_info_h media);
1427
1428 /**
1429  * @}
1430  */
1431
1432
1433 #ifdef __cplusplus
1434 }
1435 #endif /* __cplusplus */
1436
1437 #endif /* __TIZEN_MEDIA_INFORMATION_H__ */