2 * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
17 #ifndef __TIZEN_MEDIA_CONTENT_H__
18 #define __TIZEN_MEDIA_CONTENT_H__
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>
35 #endif /* __cplusplus */
38 * @addtogroup CAPI_MEDIA_CONTENT_MODULE
44 * @brief Connects to the media content service.
45 * @details Any media content related function call should be invoked after this function call.
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()
54 int media_content_connect(void);
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.
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()
68 int media_content_disconnect(void);
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 * @pre This function requires opened connection to content service by media_content_connect().
79 int media_content_scan_file(const char *path);
83 * @brief Requests to scan a media folder, asynchronously.
84 * @details This function requests to scan a media folder to media server with given completed callback fucntion.
85 * #media_scan_completed_cb() function will be called when the scanning is finished.
86 * The sub folders are also scanned, if there are sub folder in that folder. \n
87 * If you want that the any folders are not scanned, you have to create a blank file ".scan_ignore" in that folder.
88 * @param[in] path The folder path
89 * @param[in] is_recursive /@a true if scan recursively subdirectories,
90 * /@a false if scan only current directory,
91 * @param[in] callback The callback to invoke when the scanning is finished
92 * @param[in] user_data The user data to be passed to the callback function
93 * @return 0 on success, otherwise a negative error value.
94 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
95 * @see media_scan_completed_cb()
98 int media_content_scan_folder(const char *path, bool is_recursive, media_scan_completed_cb callback, void *user_data);
101 * @brief Subscribe notifications of media db change.
102 * @details This function subscribes notifications of media db change, which are published by media server or other apps.
103 * #media_content_db_update_cb() function will be called when notification of media db change is subscribed.
104 * @param[in] callback The callback to invoke when the scanning is finished
105 * @param[in] user_data The user data to be passed to the callback function
106 * @return 0 on success, otherwise a negative error value.
107 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
108 * @see media_content_db_update_cb()
109 * @see media_content_unset_db_updated_cb()
112 int media_content_set_db_updated_cb(media_content_db_update_cb callback, void *user_data);
116 * @brief Unsubscribe notifications of media db change.
117 * @details This function unsubscribes notifications of media db change, which are published by media server or other apps.
118 * @return 0 on success, otherwise a negative error value.
119 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
120 * @pre media_content_set_db_updated_cb()
121 * @see media_content_set_db_updated_cb()
124 int media_content_unset_db_updated_cb(void);
132 #endif /* __cplusplus */
134 #endif /* __TIZEN_MEDIA_CONTENT_H__ */