Add get/set played time, count API
[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 number which represents how many times given content has been played.
955  * @since_tizen 2.4
956  *
957  * @param [in] media The handle to media info
958  * @param [out] count_played The counter of content played
959  *
960  * @return 0 on success,
961  *         otherwise a negative error value
962  *
963  * @retval #MEDIA_CONTENT_ERROR_NONE Successful
964  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
965  */
966 int media_info_get_played_count(media_info_h media, int *played_count);
967
968 /**
969  * @brief Gets the content's played time parameter.
970  * @details Function returns content's elapsed playback time parameter as period
971  *          starting from the beginning of the track.
972  * @since_tizen 2.4
973  *
974  * @param [in] media The handle to media info
975  * @param [out] played_time The elapsed time of the content
976  *
977  * @return 0 on success,
978  *         otherwise a negative error value
979  *
980  * @retval #MEDIA_CONTENT_ERROR_NONE Successful
981  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
982  */
983 int media_info_get_played_time(media_info_h media, time_t *played_time);
984
985 /**
986  * @brief Gets the media info from the media database.
987  *
988  * @details This function creates a new media handle from the media database by the given @a media_id.
989  *          Media info will be created and filled with information.
990  *
991  * @since_tizen 2.3
992  *
993  * @remarks You must release @a media using media_tag_destroy().
994  *
995  * @param[in]  media_id The ID of media info
996  * @param[out] media    The media handle associated with the media ID
997  *
998  * @return @c 0 on success,
999  *         otherwise a negative error value
1000  *
1001  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
1002  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1003  * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
1004  *
1005  * @pre This function requires opened connection to content service by media_content_connect().
1006  *
1007  * @see media_content_connect()
1008  * @see media_info_destroy()
1009  */
1010 int media_info_get_media_from_db(const char *media_id, media_info_h *media);
1011
1012 /**
1013  * @brief Increments the played count to content meta handle.
1014  * @detalis You can increase the played(opened) count of the media file.
1015  * @since_tizen 2.4
1016  *
1017  * @param [in] media The handle to media info
1018  *
1019  * @return 0 on success,
1020  *         otherwise a negative error value
1021  *
1022  * @retval #MEDIA_CONTENT_ERROR_NONE Successful
1023  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1024  *
1025  * @post media_info_update_to_db()
1026  */
1027 int media_info_increase_played_count(media_info_h media);
1028
1029 /**
1030  * @brief Sets the played time to content meta handle.
1031  * @detalis You can set the latest played(opened) time of the media file. the latest played time to be set the current time on the system.
1032  * @since_tizen 2.4
1033  *
1034  * @param [in] media The handle to media info
1035  *
1036  * @return 0 on success,
1037  *         otherwise a negative error value
1038  *
1039  * @retval #MEDIA_CONTENT_ERROR_NONE Successful
1040  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1041  *
1042  * @post media_info_update_to_db()
1043  */
1044 int media_info_set_played_time(media_info_h media);
1045
1046 /**
1047  * @brief Sets the display name of media info.
1048  * @since_tizen 2.3
1049  *
1050  * @param[in] media        The media info handle
1051  * @param[in] display_name The display name of the media info
1052  *
1053  * @return @c 0 on success,
1054  *         otherwise a negative error value
1055  *
1056  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
1057  * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
1058  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1059  * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
1060  *
1061  * @post media_info_update_to_db().
1062  *
1063  */
1064 int media_info_set_display_name(media_info_h media, const char *display_name);
1065
1066 /**
1067  * @brief Sets the description of media info.
1068  * @since_tizen 2.3
1069  *
1070  * @param[in] media       The media info handle
1071  * @param[in] description The description of the media info
1072  *
1073  * @return @c 0 on success,
1074  *         otherwise a negative error value
1075  *
1076  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
1077  * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
1078  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1079  * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
1080  *
1081  * @post media_info_update_to_db().
1082  *
1083  */
1084 int media_info_set_description(media_info_h media, const char *description);
1085
1086 /**
1087  * @brief Sets the longitude of media info.
1088  * @since_tizen 2.3
1089  *
1090  * @param[in] media     The media info handle
1091  * @param[in] longitude The longitude of the media info
1092  *
1093  * @return @c 0 on success,
1094  *         otherwise a negative error value
1095  *
1096  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
1097  * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
1098  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1099  * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
1100  *
1101  * @post media_info_update_to_db().
1102  */
1103 int media_info_set_longitude(media_info_h media, double longitude);
1104
1105 /**
1106  * @brief Sets the latitude of media info.
1107  * @since_tizen 2.3
1108  *
1109  * @param[in] media    The media info handle
1110  * @param[in] latitude The latitude of the media info
1111  *
1112  * @return @c 0 on success,
1113  *         otherwise a negative error value
1114  *
1115  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
1116  * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
1117  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1118  * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
1119  *
1120  * @post media_info_update_to_db().
1121  */
1122 int media_info_set_latitude(media_info_h media, double latitude);
1123
1124 /**
1125  * @brief Sets the altitude of media info.
1126  * @since_tizen 2.3
1127  *
1128  * @param[in] media    The media info handle
1129  * @param[in] altitude The altitude of the media info
1130  *
1131  * @return @c 0 on success,
1132  *         otherwise a negative error value
1133  *
1134  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
1135  * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
1136  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1137  * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
1138  *
1139  * @post media_info_update_to_db().
1140  */
1141 int media_info_set_altitude(media_info_h media, double altitude);
1142
1143 /**
1144  * @brief Sets weather to media info.
1145  *
1146  * @param[in] media The handle to media info
1147  * @param[in] weather The weather of media info
1148  * @return 0 on success, otherwise a negative error value.
1149  * @retval #MEDIA_CONTENT_ERROR_NONE Successful
1150  * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
1151  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1152  * @post media_info_update_to_db()
1153  *
1154  */
1155 int media_info_set_weather(media_info_h media, const char *weather);
1156
1157 /**
1158  * @brief Sets the rating of media info.
1159  * @since_tizen 2.3
1160  *
1161  * @param[in] media  The media info handle
1162  * @param[in] rating The rating of the media info
1163  *
1164  * @return @c 0 on success,
1165  *         otherwise a negative error value
1166  *
1167  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
1168  * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
1169  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1170  * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
1171  *
1172  * @post media_info_update_to_db().
1173  */
1174 int media_info_set_rating(media_info_h media, int rating);
1175
1176 /**
1177  * @brief Sets the favorite of media info.
1178  * @since_tizen 2.3
1179  *
1180  * @param[in] media    The media info handle
1181  * @param[in] favorite Set @c true to set the media info as favorite,
1182  *                     otherwise set @c false to not set the media info as favorite
1183  *
1184  * @return @c 0 on success,
1185  *         otherwise a negative error value
1186  *
1187  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
1188  * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
1189  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1190  * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
1191  */
1192 int media_info_set_favorite(media_info_h media, bool favorite);
1193
1194 /**
1195  * @brief Sets the author of media info.
1196  * @since_tizen 2.3
1197  *
1198  * @param[in] media  The media info handle
1199  * @param[in] author The author of the media info
1200  *
1201  * @return @c 0 on success,
1202  *         otherwise a negative error value
1203  *
1204  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
1205  * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
1206  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1207  * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
1208  */
1209 int media_info_set_author(media_info_h media, const char *author);
1210
1211 /**
1212  * @brief Sets the provider of media info.
1213  * @since_tizen 2.3
1214  *
1215  * @param[in] media    The media info handle
1216  * @param[in] provider The provider of the media info
1217  *
1218  * @return @c 0 on success,
1219  *         otherwise a negative error value
1220  *
1221  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
1222  * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
1223  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1224  * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
1225  */
1226 int media_info_set_provider(media_info_h media, const char *provider);
1227
1228 /**
1229  * @brief Sets the content name of media info.
1230  * @since_tizen 2.3
1231  *
1232  * @param[in] media        The media info handle
1233  * @param[in] content_name The content name of the media info
1234  *
1235  * @return @c 0 on success,
1236  *         otherwise a negative error value
1237  *
1238  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
1239  * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
1240  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1241  * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
1242  *
1243  * @post media_info_update_to_db()
1244  */
1245 int media_info_set_content_name(media_info_h media, const char *content_name);
1246
1247 /**
1248  * @brief Sets the category of media info.
1249  * @since_tizen 2.3
1250  *
1251  * @param[in] media    The media info handle
1252  * @param[in] category The category of the media info
1253  *
1254  * @return @c 0 on success,
1255  *         otherwise a negative error value
1256  *
1257  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
1258  * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
1259  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1260  * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
1261  *
1262  * @post media_info_update_to_db()
1263  */
1264 int media_info_set_category(media_info_h media, const char *category);
1265
1266 /**
1267  * @brief Sets the location tag of media info.
1268  * @since_tizen 2.3
1269  *
1270  * @param[in] media        The media info handle
1271  * @param[in] location_tag The location of the media info
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_OUT_OF_MEMORY     Out of memory
1278  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1279  * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
1280  *
1281  * @post media_info_update_to_db()
1282  */
1283 int media_info_set_location_tag(media_info_h media, const char *location_tag);
1284
1285 /**
1286  * @brief Sets the age rating of media info.
1287  * @since_tizen 2.3
1288  *
1289  * @param[in] media      The media info handle
1290  * @param[in] age_rating The age rating of the media info
1291  *
1292  * @return @c 0 on success,
1293  *         otherwise a negative error value
1294  *
1295  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
1296  * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
1297  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1298  * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
1299  *
1300  * @post media_info_update_to_db()
1301  */
1302 int media_info_set_age_rating(media_info_h media, const char *age_rating);
1303
1304 /**
1305  * @brief Sets the keyword of media info.
1306  * @since_tizen 2.3
1307  *
1308  * @param[in] media   The media info handle
1309  * @param[in] keyword The keyword of the media info
1310  *
1311  * @return @c 0 on success,
1312  *         otherwise a negative error value
1313  *
1314  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
1315  * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
1316  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1317  * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
1318  *
1319  * @post media_info_update_to_db()
1320  */
1321 int media_info_set_keyword(media_info_h media, const char *keyword);
1322
1323 /**
1324  * @brief Updates the media info to the media database.
1325  * 
1326  * @details The function updates the given media info in the media database.
1327  *
1328  * @since_tizen 2.3
1329  * @privlevel public
1330  * @privilege %http://tizen.org/privilege/content.write
1331  *
1332  * @remarks The function should be called after any change in media, to be updated to the media
1333  *          database. For example, after using media_info_set_display_name()
1334  *          for setting the name of the media, the media_info_update_to_db() function should be called so as to update
1335  *          the given media info attributes in the media database.
1336  *
1337  * @param[in] media The media info handle
1338  *
1339  * @return @c 0 on success,
1340  *         otherwise a negative error value
1341  *
1342  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
1343  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1344  * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
1345  *
1346  * @pre This function requires opened connection to content service by media_content_connect().
1347  *
1348  * @see media_content_connect()
1349  * @see media_info_set_display_name()
1350  * @see media_info_set_description()
1351  * @see media_info_set_longitude()
1352  * @see media_info_set_latitude()
1353  * @see media_info_set_altitude()
1354  * @see media_info_set_rating()
1355  * @see media_info_set_favorite()
1356  * @see media_info_set_author()
1357  * @see media_info_set_provider()
1358  * @see media_info_set_content_name()
1359  * @see media_info_set_category()
1360  * @see media_info_set_location_tag()
1361  * @see media_info_set_age_rating()
1362  */
1363 int media_info_update_to_db(media_info_h media);
1364
1365 /**
1366  * @brief Refreshes the media metadata to the media database.
1367  * @since_tizen 2.3
1368  *
1369  * @privlevel public
1370  * @privilege %http://tizen.org/privilege/content.write \n
1371  *                   %http://tizen.org/privilege/mediastorage \n
1372  *                   %http://tizen.org/privilege/externalstorage
1373  *
1374  * @remarks You must add privilege http://tizen.org/privilege/content.write. And You add more privilege depending on your choice of contents path. \n
1375  *                   If you want to access only internal storage by using  this API, you should add privilege http://tizen.org/privilege/mediastorage. \n
1376  *                   Or if you want to access only external storage by using  this API, you shold add privilege http://tizen.org/privilege/externalstorage. \n
1377  *                   If you can access both storage, you should add all privilege.
1378  *
1379  * @param[in] media_id The ID of the media info
1380  *
1381  * @return @c 0 on success,
1382  *         otherwise a negative error value
1383  *
1384  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
1385  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1386  * @retval #MEDIA_CONTENT_ERROR_DB_FAILED         DB operation failed
1387  * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
1388  *
1389  * @pre This function requires opened connection to content service by media_content_connect().
1390  *
1391  * @see media_content_connect()
1392  */
1393 int media_info_refresh_metadata_to_db(const char *media_id);
1394
1395 /**
1396  * @brief Sets the added time of media info.
1397  * @since_tizen 2.3
1398  *
1399  * @param[in] media      The media info handle
1400  * @param[in] added_time The added time of the media info
1401  *
1402  * @return @c 0 on success,
1403  *         otherwise a negative error value
1404  *
1405  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
1406  * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
1407  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1408  * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
1409  *
1410  * @post media_info_update_to_db()
1411  */
1412 int media_info_set_added_time(media_info_h media, time_t added_time);
1413
1414 /**
1415  * @brief Moves the media info to the given destination path in the media database.
1416  * @since_tizen 2.3
1417  *
1418  * @privlevel public
1419  * @privilege %http://tizen.org/privilege/content.write \n
1420  *                   %http://tizen.org/privilege/mediastorage \n
1421  *                   %http://tizen.org/privilege/externalstorage
1422  *
1423  * @remarks You must add privilege http://tizen.org/privilege/content.write. And You add more privilege depending on your choice of contents path. \n
1424  *                   If you want to access only internal storage by using  this API, you should add privilege http://tizen.org/privilege/mediastorage. \n
1425  *                   Or if you want to access only external storage by using this API, you shold add privilege http://tizen.org/privilege/externalstorage. \n
1426  *                   If you can access both storage, you should add all privilege.
1427  *
1428  * @param[in] media    The media info handle
1429  * @param[in] dst_path The path of destination
1430  *
1431  * @return @c 0 on success,
1432  *         otherwise a negative error value
1433  *
1434  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
1435  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1436  * @retval #MEDIA_CONTENT_ERROR_DB_FAILED         DB operation failed
1437  * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
1438  *
1439  * @pre This function requires opened connection to content service by media_content_connect().
1440  *
1441  * @see media_content_connect()
1442  */
1443 int media_info_move_to_db(media_info_h media, const char* dst_path);
1444
1445 /**
1446  * @brief Creates a thumbnail image for the given media, asynchronously.
1447  * @details This function creates an thumbnail image for given media item and calls registered callback function for completion of creating the thumbnail.
1448  *          If a thumbnail already exists for the given media, then the path of thumbnail will be returned in callback function.
1449  *
1450  * @since_tizen 2.3
1451  *
1452  * @privlevel public
1453  * @privilege %http://tizen.org/privilege/content.write
1454  *
1455  * @param[in] media     The media info handle
1456  * @param[in] callback  The callback function to be invoked
1457  * @param[in] user_data The user data to be passed to the callback function
1458  *
1459  * @return @c 0 on success,
1460  *         otherwise a negative error value
1461  *
1462  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
1463  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter (Especially, if the request is duplicated, this error returns.)
1464  * @retval #MEDIA_CONTENT_ERROR_DB_FAILED         DB operation failed
1465  * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
1466  *
1467  * @pre This function requires opened connection to content service by media_content_connect().
1468  *
1469  * @see media_content_connect()
1470  */
1471 int media_info_create_thumbnail(media_info_h media, media_thumbnail_completed_cb callback, void *user_data);
1472
1473 /**
1474  * @brief Cancels the creation of image's thumbnail for the given media.
1475  * @since_tizen 2.3
1476  *
1477  * @privlevel public
1478  * @privilege %http://tizen.org/privilege/content.write
1479  *
1480  * @param[in] media The media info handle
1481  *
1482  * @return @c 0 on success,
1483  *         otherwise a negative error value
1484  *
1485  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
1486  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1487  * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
1488  *
1489  * @pre This function requires opened connection to content service by media_content_connect().
1490  * @see media_content_connect()
1491  */
1492 int media_info_cancel_thumbnail(media_info_h media);
1493
1494 /**
1495  * @}
1496  */
1497
1498
1499 #ifdef __cplusplus
1500 }
1501 #endif /* __cplusplus */
1502
1503 #endif /* __TIZEN_MEDIA_INFORMATION_H__ */