Tizen 2.1 base
[platform/core/api/media-content.git] / include / media_content.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 #ifndef __TIZEN_MEDIA_CONTENT_H__
18 #define __TIZEN_MEDIA_CONTENT_H__
19
20 #include <media_audio.h>
21 #include <media_content_type.h>
22 #include <media_filter.h>
23 #include <media_folder.h>
24 #include <media_image.h>
25 #include <media_info.h>
26 #include <media_tag.h>
27 #include <media_video.h>
28 #include <media_group.h>
29 #include <media_playlist.h>
30 #include <media_bookmark.h>
31
32
33 #ifdef __cplusplus
34 extern "C" {
35 #endif /* __cplusplus */
36
37 /**
38  * @addtogroup CAPI_MEDIA_CONTENT_MODULE
39  * @{
40  */
41
42
43 /**
44  * @brief Connects to the media content service.
45  * @details Any media content related function call should be invoked after this function call.
46  *
47  * @return 0 on success, otherwise a negative error value.
48  * @retval #MEDIA_CONTENT_ERROR_NONE Successful
49  * @retval #MEDIA_CONTENT_ERROR_DB_FAILED DB operation failed
50  * @post media_content_disconnect()
51  * @see media_content_disconnect()
52  *
53  */
54 int media_content_connect(void);
55
56 /**
57  * @brief Disconnects from the media content service.
58  * @details This function closes connection to the media content service. Any further media content related operation
59  * cannot be performed after this function is called.
60  *
61  * @return 0 on success, otherwise a negative error value.
62  * @retval #MEDIA_CONTENT_ERROR_NONE Successful
63  * @retval #MEDIA_CONTENT_ERROR_DB_FAILED DB operation failed
64  * @pre media_content_connect()
65  * @see media_content_connect()
66  *
67  */
68 int media_content_disconnect(void);
69
70 /**
71  * @brief Requests to scan a media file.
72  * @details This function requests to scan a media file to media server.
73  * @param[in] path The file path
74  * @return 0 on success, otherwise a negative error value.
75  * @retval #MEDIA_CONTENT_ERROR_NONE Successful
76  *
77  */
78 int media_content_scan_file(const char *path);
79
80
81 /**
82  * @brief Requests to scan a media folder, asynchronously.
83  * @details This function requests to scan a media folder to media server with given completed callback fucntion.
84  * #media_scan_completed_cb() function will be called when the scanning is finished.
85  * The sub folders are also scanned, if there are sub folder in that folder. \n
86  * If you want that the any folders are not scanned, you have to create a blank file ".scan_ignore" in that folder.
87  * @param[in] path The folder path
88  * @param[in] callback The callback to invoke when the scanning is finished
89  * @param[in] user_data The user data to be passed to the callback function
90  * @return 0 on success, otherwise a negative error value.
91  * @retval #MEDIA_CONTENT_ERROR_NONE Successful
92  * @see media_scan_completed_cb()
93  *
94  */
95 int media_content_scan_folder(const char *path, media_scan_completed_cb callback, void *user_data);
96
97
98 /**
99  * @}
100  */
101
102 #ifdef __cplusplus
103 }
104 #endif /* __cplusplus */
105
106 #endif /* __TIZEN_MEDIA_CONTENT_H__ */