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.
19 #ifndef __TIZEN_MEDIA_CONTENT_INTERNAL_H__
20 #define __TIZEN_MEDIA_CONTENT_INTERNAL_H__
22 #include <media_content_type.h>
26 #endif /* __cplusplus */
30 * @file media_content_internal.h
31 * @brief This file contains API on main functional operations with storage that are related to media resources in the media database. \n
32 * Operations include: inserting a new storage in media to the media database, removing storage from database, \n
36 * @ingroup CAPI_MEDIA_CONTENT_MODULE
37 * @brief Enumeration for a media storage scan status.
38 * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
41 MEDIA_STORAGE_SCAN_NONE = 0, /**< Media Scanner not detect storage yet*/
42 MEDIA_STORAGE_SCAN_PREPARE, /**< Media Scanner detect storage but not scanning yet*/
43 MEDIA_STORAGE_SCAN_PROCESSING, /**< Media Scanner Start Scanning storage*/
44 MEDIA_STORAGE_SCAN_STOP, /**< Media Scanner Stop Scanning storage. Not scanning items can be exist*/
45 MEDIA_STORAGE_SCAN_DONE, /**< Scanning Done but need to extract metadata*/
46 MEDIA_STORAGE_SCAN_META_PROCESSING, /**< Scanning Done and start to extract metadata*/
47 MEDIA_STORAGE_SCAN_META_STOP, /**< Stop extract metadata*/
48 MEDIA_STORAGE_SCAN_COMPLETE , /**< Complete scanning*/
49 } media_storage_scan_status_e;
53 * @brief Insert media storage to database.
54 * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
56 * @remarks You must release @a storage using media_storage_destroy().
59 * @privilege %http://tizen.org/privilege/content.write
61 * @param[in] storage_name The storage name to insert to database
62 * @param[in] storage_path The storage path to insert to database
63 * @param[in] storage_account The storage account to insert to database
64 * @param[in] storage_type The storage type to insert to database
65 * @param[out] storage The media storage handle
67 * @return @c 0 on success,
68 * otherwise a negative error value
70 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
71 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
72 * @retval #MEDIA_CONTENT_ERROR_DB_FAILED DB operation failed
73 * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
75 * @see media_storage_delete_from_db()
77 int media_storage_insert_to_db(const char *storage_name, const char *storage_path, const char *storage_account, media_content_storage_e storage_type, media_storage_h *storage);
81 * @brief Deletes the database for media storage.
82 * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
85 * @privilege %http://tizen.org/privilege/content.write
87 * @param[in] storage_id The storage ID to delete from database
89 * @return @c 0 on success,
90 * otherwise a negative error value
92 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
93 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
94 * @retval #MEDIA_CONTENT_ERROR_DB_FAILED DB operation failed
95 * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
97 * @see media_storage_insert_to_db()
99 int media_storage_delete_from_db(const char *storage_id);
102 * @brief Gets the storage account of media storage.
103 * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
105 * @remarks You must release @a storage_account using free().
107 * @param[in] storage The media storage handle
108 * @param[out] storage_account The storage account of the media storage
110 * @return @c 0 on success,
111 * otherwise a negative error value
113 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
114 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
115 * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
117 int media_storage_get_storage_account(media_storage_h storage, char **storage_account);
121 * @brief Sets the MIME type of media info handle.
122 * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
124 * @param[in] media The media info handle
125 * @param[in] mime_type The MIME type of the media info
127 * @return @c 0 on success,
128 * otherwise a negative error value
130 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
131 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
132 * @retval #MEDIA_CONTENT_ERROR_DB_FAILED DB operation failed
133 * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
135 * @post media_info_insert_to_db_with_data()
137 int media_info_set_mime_type(media_info_h media, const char *mime_type);
141 * @brief Sets the thumbnail path of media info handle.
142 * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
144 * @param[in] media The media info handle
145 * @param[in] thumbnail_path The thumbnail path of media info handle
147 * @return @c 0 on success,
148 * otherwise a negative error value
150 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
151 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
152 * @retval #MEDIA_CONTENT_ERROR_DB_FAILED DB operation failed
153 * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
155 * @post media_info_insert_to_db_with_data()
157 int media_info_set_thumbnail_path(media_info_h media, const char *thumbnail_path);
161 * @brief Sets the size of media info handle.
162 * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
164 * @param[in] media The media info handle
165 * @param[in] size The size of media info handle
167 * @return @c 0 on success,
168 * otherwise a negative error value
170 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
171 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
172 * @retval #MEDIA_CONTENT_ERROR_DB_FAILED DB operation failed
173 * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
175 * @post media_info_insert_to_db_with_data()
177 int media_info_set_size(media_info_h media, unsigned long long size);
181 * @brief Sets the modified time of media info handle.
182 * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
184 * @param[in] media The media info handle
185 * @param[in] modified_time The modified time of media info handle
187 * @return @c 0 on success,
188 * otherwise a negative error value
190 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
191 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
192 * @retval #MEDIA_CONTENT_ERROR_DB_FAILED DB operation failed
193 * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
195 * @post media_info_insert_to_db_with_data()
197 int media_info_set_modified_time(media_info_h media, time_t modified_time);
201 * @brief Sets the media type of media info handle.
202 * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
204 * @param[in] media The media info handle
205 * @param[in] type The media type of media info handle
207 * @return @c 0 on success,
208 * otherwise a negative error value
210 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
211 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
212 * @retval #MEDIA_CONTENT_ERROR_DB_FAILED DB operation failed
213 * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
215 * @post media_info_insert_to_db_with_data()
217 int media_info_set_media_type(media_info_h media, media_content_type_e type);
221 * @brief Sets the duration of media info handle.
222 * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
224 * @param[in] media The media info handle
225 * @param[in] duration The duration of media info handle
227 * @return @c 0 on success,
228 * otherwise a negative error value
230 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
231 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
232 * @retval #MEDIA_CONTENT_ERROR_DB_FAILED DB operation failed
233 * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
235 * @post media_info_insert_to_db_with_data()
237 int media_info_set_duration(media_info_h media, int duration);
241 * @brief Sets the width of media info handle.
242 * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
244 * @param[in] media The media info handle
245 * @param[in] width The width of media info handle
247 * @return @c 0 on success,
248 * otherwise a negative error value
250 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
251 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
252 * @retval #MEDIA_CONTENT_ERROR_DB_FAILED DB operation failed
253 * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
255 * @post media_info_insert_to_db_with_data()
257 int media_info_set_width(media_info_h media, int width);
261 * @brief Sets the height of media info handle.
262 * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
264 * @param[in] media The media info handle
265 * @param[in] height The height of media info handle
267 * @return @c 0 on success,
268 * otherwise a negative error value
270 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
271 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
272 * @retval #MEDIA_CONTENT_ERROR_DB_FAILED DB operation failed
273 * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
275 * @post media_info_insert_to_db_with_data()
277 int media_info_set_height(media_info_h media, int height);
281 * @brief Sets the storage type of media info handle.
282 * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
284 * @param[in] media The media info handle
285 * @param[in] storage_type The storage type of media info handle
287 * @return @c 0 on success,
288 * otherwise a negative error value
290 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
291 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
292 * @retval #MEDIA_CONTENT_ERROR_DB_FAILED DB operation failed
293 * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
295 * @post media_info_insert_to_db_with_data()
297 int media_info_set_storage_type(media_info_h media, media_content_storage_e storage_type);
301 * @brief Sets the storage type of media info handle.
302 * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
304 * @param[in] media The media info handle
305 * @param[in] storage_id The storage id of media info handle
307 * @return @c 0 on success,
308 * otherwise a negative error value
310 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
311 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
312 * @retval #MEDIA_CONTENT_ERROR_DB_FAILED DB operation failed
313 * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
315 * @post media_info_insert_to_db_with_data()
317 int media_info_set_storage_id(media_info_h media, const char *storage_id);
320 * @brief Gets the storage scan status of media storage.
321 * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
323 * @param[in] storage The media storage handle
324 * @param[out] scan_status The storage type of the media storage
326 * @return @c 0 on success,
327 * otherwise a negative error value
329 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
330 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
332 int media_storage_get_scan_status(const char *storage_uuid, media_storage_scan_status_e *scan_status);
335 * @brief Subscribes notifications of the media DB change.
336 * @details This function subscribes notifications of the media DB change which are published by the media server or other apps.
337 * media_content_db_update_cb() function will be called when notification of the media DB change is subscribed.
339 * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
341 * @param[in] callback The callback to be invoked when the scanning is finished
342 * @param[in] user_data The user data to be passed to the callback function
344 * @return @c 0 on success,
345 * otherwise a negative error value
347 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
348 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
349 * @retval #MEDIA_CONTENT_ERROR_INVALID_OPERATION Invalid operation
350 * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
351 * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
353 * @see media_content_db_update_cb()
354 * @see media_content_unset_db_updated_cb_v2()
356 int media_content_set_db_updated_cb_v2(media_content_noti_h *noti_handle, media_content_db_update_cb callback, void *user_data);
360 * @brief Unsubscribes notifications of the media DB change.
361 * @details This function unsubscribes notifications of the media DB change which are published by the media server or other apps.
363 * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
365 * @return @c 0 on success,
366 * otherwise a negative error value
368 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
369 * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
371 * @pre media_content_set_db_updated_cb_v2()
373 * @see media_content_set_db_updated_cb_v2()
375 int media_content_unset_db_updated_cb_v2(media_content_noti_h noti_handle);
380 #endif /* __cplusplus */
381 #endif /*__TIZEN_MEDIA_CONTENT_INTERNAL_H__*/