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
37 * @brief Insert media storage to database.
40 * @remarks You must release @a storage using media_storage_destroy().
43 * @privilege %http://tizen.org/privilege/content.write
45 * @param[in] storage_name The storage name to insert to database
46 * @param[in] storage_path The storage path to insert to database
47 * @param[in] storage_account The storage account to insert to database
48 * @param[in] storage_type The storage type to insert to database
49 * @param[out] storage The media storage handle
51 * @return @c 0 on success,
52 * otherwise a negative error value
54 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
55 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
56 * @retval #MEDIA_CONTENT_ERROR_DB_FAILED DB operation failed
57 * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
59 * @see media_storage_delete_from_db()
61 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);
65 * @brief Deletes the database for media storage.
69 * @privilege %http://tizen.org/privilege/content.write
71 * @param[in] storage_id The storage ID to delete from database
73 * @return @c 0 on success,
74 * otherwise a negative error value
76 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
77 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
78 * @retval #MEDIA_CONTENT_ERROR_DB_FAILED DB operation failed
79 * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
81 * @see media_storage_insert_to_db()
83 int media_storage_delete_from_db(const char *storage_id);
86 * @brief Gets the storage account of media storage.
89 * @remarks You must release @a storage_account using free().
91 * @param[in] storage The media storage handle
92 * @param[out] storage_account The storage account of the media storage
94 * @return @c 0 on success,
95 * otherwise a negative error value
97 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
98 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
99 * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
101 int media_storage_get_storage_account(media_storage_h storage, char **storage_account);
105 * @brief Creates the media info handle.
108 * @remarks You must release @a media using media_info_destroy().
110 * @param[out] media The media info handle
112 * @return @c 0 on success,
113 * otherwise a negative error value
115 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
116 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
117 * @retval #MEDIA_CONTENT_ERROR_DB_FAILED DB operation failed
118 * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
120 * @see media_info_destroy()
122 int media_info_create_handle(media_info_h *media);
126 * @brief Inserts media info to database with media info data.
129 * @remarks You must release @a info using media_info_destroy().
131 * @privlevel platform
132 * @privilege %http://tizen.org/privilege/content.write
134 * @param[in] media The media info handle
135 * @param[out] info The media info handle to get data from database
137 * @return @c 0 on success,
138 * otherwise a negative error value
140 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
141 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
142 * @retval #MEDIA_CONTENT_ERROR_DB_FAILED DB operation failed
143 * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
145 int media_info_insert_to_db_with_data(media_info_h media, media_info_h *info);
149 * @brief Sets the path of media info handle.
152 * @param[in] media The media info handle
153 * @param[in] path The path of the media info
155 * @return @c 0 on success,
156 * otherwise a negative error value
158 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
159 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
160 * @retval #MEDIA_CONTENT_ERROR_DB_FAILED DB operation failed
161 * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
163 * @post media_info_insert_to_db_with_data()
165 int media_info_set_path(media_info_h media, const char *path);
169 * @brief Sets the MIME type of media info handle.
172 * @param[in] media The media info handle
173 * @param[in] mime_type The MIME type of the media info
175 * @return @c 0 on success,
176 * otherwise a negative error value
178 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
179 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
180 * @retval #MEDIA_CONTENT_ERROR_DB_FAILED DB operation failed
181 * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
183 * @post media_info_insert_to_db_with_data()
185 int media_info_set_mime_type(media_info_h media, const char *mime_type);
189 * @brief Sets the title of media info handle.
192 * @param[in] media The media info handle
193 * @param[in] title The title of media info handle
195 * @return @c 0 on success,
196 * otherwise a negative error value
198 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
199 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
200 * @retval #MEDIA_CONTENT_ERROR_DB_FAILED DB operation failed
201 * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
203 * @post media_info_insert_to_db_with_data()
205 int media_info_set_title(media_info_h media, const char *title);
209 * @brief Sets the album of media info handle.
212 * @param[in] media The media info handle
213 * @param[in] album The album of media info handle
215 * @return @c 0 on success,
216 * otherwise a negative error value
218 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
219 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
220 * @retval #MEDIA_CONTENT_ERROR_DB_FAILED DB operation failed
221 * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
223 * @post media_info_insert_to_db_with_data()
225 int media_info_set_album(media_info_h media, const char *album);
229 * @brief Sets the artist of media info handle.
232 * @param[in] media The media info handle
233 * @param[in] artist The artist of media info handle
235 * @return @c 0 on success,
236 * otherwise a negative error value
238 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
239 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
240 * @retval #MEDIA_CONTENT_ERROR_DB_FAILED DB operation failed
241 * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
243 * @post media_info_insert_to_db_with_data()
245 int media_info_set_artist(media_info_h media, const char *artist);
249 * @brief Sets the genre of media info handle.
252 * @param[in] media The media info handle
253 * @param[in] genre The genre of media info handle
255 * @return @c 0 on success,
256 * otherwise a negative error value
258 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
259 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
260 * @retval #MEDIA_CONTENT_ERROR_DB_FAILED DB operation failed
261 * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
263 * @post media_info_insert_to_db_with_data()
265 int media_info_set_genre(media_info_h media, const char *genre);
269 * @brief Sets the recorded date of media info handle.
272 * @param[in] media The media info handle
273 * @param[in] recorded_date The recorded date of media info handle
275 * @return @c 0 on success,
276 * otherwise a negative error value
278 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
279 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
280 * @retval #MEDIA_CONTENT_ERROR_DB_FAILED DB operation failed
281 * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
283 * @post media_info_insert_to_db_with_data()
285 int media_info_set_recorded_date(media_info_h media, const char *recorded_date);
289 * @brief Sets the thumbnail path of media info handle.
292 * @param[in] media The media info handle
293 * @param[in] thumbnail_path The thumbnail path of media info handle
295 * @return @c 0 on success,
296 * otherwise a negative error value
298 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
299 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
300 * @retval #MEDIA_CONTENT_ERROR_DB_FAILED DB operation failed
301 * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
303 * @post media_info_insert_to_db_with_data()
305 int media_info_set_thumbnail_path(media_info_h media, const char *thumbnail_path);
309 * @brief Sets the size of media info handle.
312 * @param[in] media The media info handle
313 * @param[in] size The size of media info handle
315 * @return @c 0 on success,
316 * otherwise a negative error value
318 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
319 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
320 * @retval #MEDIA_CONTENT_ERROR_DB_FAILED DB operation failed
321 * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
323 * @post media_info_insert_to_db_with_data()
325 int media_info_set_size(media_info_h media, unsigned long long size);
329 * @brief Sets the modified time of media info handle.
332 * @param[in] media The media info handle
333 * @param[in] modified_time The modified time of media info handle
335 * @return @c 0 on success,
336 * otherwise a negative error value
338 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
339 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
340 * @retval #MEDIA_CONTENT_ERROR_DB_FAILED DB operation failed
341 * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
343 * @post media_info_insert_to_db_with_data()
345 int media_info_set_modified_time(media_info_h media, time_t modified_time);
349 * @brief Sets the media type of media info handle.
352 * @param[in] media The media info handle
353 * @param[in] type The media type of media info handle
355 * @return @c 0 on success,
356 * otherwise a negative error value
358 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
359 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
360 * @retval #MEDIA_CONTENT_ERROR_DB_FAILED DB operation failed
361 * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
363 * @post media_info_insert_to_db_with_data()
365 int media_info_set_media_type(media_info_h media, media_content_type_e type);
369 * @brief Sets the duration of media info handle.
372 * @param[in] media The media info handle
373 * @param[in] duration The duration of media info handle
375 * @return @c 0 on success,
376 * otherwise a negative error value
378 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
379 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
380 * @retval #MEDIA_CONTENT_ERROR_DB_FAILED DB operation failed
381 * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
383 * @post media_info_insert_to_db_with_data()
385 int media_info_set_duration(media_info_h media, int duration);
389 * @brief Sets the width of media info handle.
392 * @param[in] media The media info handle
393 * @param[in] width The width of media info handle
395 * @return @c 0 on success,
396 * otherwise a negative error value
398 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
399 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
400 * @retval #MEDIA_CONTENT_ERROR_DB_FAILED DB operation failed
401 * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
403 * @post media_info_insert_to_db_with_data()
405 int media_info_set_width(media_info_h media, int width);
409 * @brief Sets the height of media info handle.
412 * @param[in] media The media info handle
413 * @param[in] height The height of media info handle
415 * @return @c 0 on success,
416 * otherwise a negative error value
418 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
419 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
420 * @retval #MEDIA_CONTENT_ERROR_DB_FAILED DB operation failed
421 * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
423 * @post media_info_insert_to_db_with_data()
425 int media_info_set_height(media_info_h media, int height);
429 * @brief Sets the storage type of media info handle.
432 * @param[in] media The media info handle
433 * @param[in] storage_type The storage type of media info handle
435 * @return @c 0 on success,
436 * otherwise a negative error value
438 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
439 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
440 * @retval #MEDIA_CONTENT_ERROR_DB_FAILED DB operation failed
441 * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
443 * @post media_info_insert_to_db_with_data()
445 int media_info_set_storage_type(media_info_h media, media_content_storage_e storage_type);
449 * @brief Sets the storage type of media info handle.
452 * @param[in] media The media info handle
453 * @param[in] storage_id The storage id of media info handle
455 * @return @c 0 on success,
456 * otherwise a negative error value
458 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
459 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
460 * @retval #MEDIA_CONTENT_ERROR_DB_FAILED DB operation failed
461 * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
463 * @post media_info_insert_to_db_with_data()
465 int media_info_set_storage_id(media_info_h media, const char *storage_id);
469 #endif /* __cplusplus */
470 #endif /*__TIZEN_MEDIA_CONTENT_INTERNAL_H__*/