Remove unused product API
[platform/core/api/media-content.git] / include_product / media_content_product.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_PRODUCT_H__
18 #define __TIZEN_MEDIA_CONTENT_PRODUCT_H__
19
20 #include <media_content_type_product.h>
21 #include <media_pvr.h>
22 #include <media_uhd.h>
23
24 #ifdef __cplusplus
25 extern "C" {
26 #endif /* __cplusplus */
27
28 /********** media_content **********/
29
30 int media_content_scan_folder_v2(const char *path, bool is_recursive, media_scan_completed_cb_v2 callback, void *user_data);
31
32
33 /********** media_info **********/
34
35 int media_info_delete_from_db(const char *media_id);
36
37 /**
38  * @brief Gets the extract_flag of media info.
39  * @since_tizen 2.3
40  *
41  * @remarks You must release @a title using free().
42  *
43  * @param[in] media         The media info handle
44  * @param[out] extract_flag  The extract_flag of the media info
45  *
46  * @return @c 0 on success,
47  *         otherwise a negative error value
48  *
49  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
50  * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
51  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
52  * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
53  */
54 int media_info_get_extract_flag(media_info_h media, int *extract_flag);
55 int media_info_get_stitched_state(media_info_h media, int *type_360);
56 /**
57  * @brief Gets the content's played position parameter.
58  * @details Function returns content's elapsed playback position parameter as period
59  * starting from the beginning of the track.
60  *
61  * @param[in] media The handle to media info
62  * @param[out] played_position The elapsed time of the content
63  * @return 0 on success, otherwise a negative error value.
64  * @retval #MEDIA_CONTENT_ERROR_NONE Successful
65  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
66  */
67 int media_info_get_played_position(media_info_h media, int *played_position);
68 /**
69  * @brief Gets the provider to media info.
70  *
71  * @remarks @a modified_month should be released with free() by you.
72  *
73  * @param[in] media The handle to media info
74  * @param[out] category The modified month of media info
75  * @return 0 on success, otherwise a negative error value.
76  * @retval #MEDIA_CONTENT_ERROR_NONE Successful
77  * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
78  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
79  *
80  */
81 int media_info_get_modified_month(media_info_h media, char **modified_month);
82
83 /**
84  * @brief Gets the played count to content meta handle.
85  *
86  * @param[in] media The handle to media info
87  * @param[out] played_count The played count of content
88  * @return 0 on success, otherwise a negative error value.
89  * @retval #MEDIA_CONTENT_ERROR_NONE Successful
90  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
91  */
92 int media_info_get_played_count(media_info_h media, int *played_count);
93
94 /**
95  * @brief Sets the played count to content meta handle.
96  *
97  * @param[in] media The handle to media info
98  * @param[in] played_count The played count of content
99  * @return 0 on success, otherwise a negative error value.
100  * @retval #MEDIA_CONTENT_ERROR_NONE Successful
101  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
102  * @post media_info_update_to_db()
103  */
104 int media_info_set_played_count(media_info_h media, int played_count);
105
106 /**
107  * @brief Sets the played position to content meta handle.
108  *
109  * @param[in] media The handle to media info
110  * @param[in] played_position The played position of content
111  * @return 0 on success, otherwise a negative error value.
112  * @retval #MEDIA_CONTENT_ERROR_NONE Successful
113  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
114  * @post media_info_update_to_db()
115  */
116 int media_info_set_played_position(media_info_h media, int played_position);
117
118 /**
119  * @brief Gets the content's played time parameter.
120  * @details Function returns content's elapsed playback time parameter as period
121  *          starting from the beginning of the track.
122  *
123  * @param[in] media The handle to the media info
124  * @param[out] played_time The elapsed time of the content
125  *
126  * @return 0 on success,
127  *         otherwise a negative error value
128  *
129  * @retval #MEDIA_CONTENT_ERROR_NONE Successful
130  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
131  */
132 int media_info_get_played_time(media_info_h media, time_t *played_time);
133
134 /**
135  * @brief Sets the played time to content meta handle.
136  * @details You can set the latest played(opened) time of the content file. the latest played time to be set the current time on the system.
137  *
138  * @param[in] media The handle to the media info
139  *
140  * @return 0 on success,
141  *         otherwise a negative error value
142  *
143  * @retval #MEDIA_CONTENT_ERROR_NONE Successful
144  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
145  *
146  * @post media_info_update_to_db()
147  */
148 int media_info_set_played_time(media_info_h media);
149
150
151 int media_info_get_media_info_by_path_from_db(const char* path, media_info_h* media);
152
153
154 /********** media_folder **********/
155 int media_folder_get_scan_status(const char *storage_uuid, char* path, media_folder_scan_status_e *scan_status);
156 int media_folder_reset_scan_status(const char *storage_uuid, const char* path);
157
158 /**
159  * @brief Sets the folder name.
160  * @since_tizen 2.3
161  *
162  * @param[in] folder The handle to the media folder
163  * @param[in] name The name of the media folder
164  *
165  * @return @c 0 on success,
166  *         otherwise a negative error value
167  *
168  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
169  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
170  * @retval #MEDIA_CONTENT_ERROR_INVALID_OPERATION Invalid operation
171  * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
172  */
173 int media_folder_set_name(media_folder_h folder, const char *name);
174
175 /**
176  * @brief Updates the media folder to the media database.
177  *
178  * @details The function updates the given media folder in the media database. The function should be called after any change in folder attributes, to be updated to the media
179  *          database.
180  *
181  * @since_tizen 2.3
182  *
183  * @privlevel public
184  * @privilege %http://tizen.org/privilege/content.write
185  *
186  * @param[in] folder The handle to the media folder
187  *
188  * @return @c 0 on success,
189  *         otherwise a negative error value
190  *
191  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
192  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
193  * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
194  * @retval #MEDIA_CONTENT_ERROR_INVALID_OPERATION Invalid operation
195  * @retval #MEDIA_CONTENT_ERROR_DB_FAILED         DB Operation failed
196  * @retval #MEDIA_CONTENT_ERROR_DB_BUSY           DB Operation busy
197  * @retval #MEDIA_CONTENT_ERROR_NETWORK           Network fail
198  * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
199  *
200  * @pre This function requires opened connection to content service by media_content_connect().
201  *
202  * @see media_content_connect()
203  * @see media_folder_destroy()
204  */
205 int media_folder_update_to_db(media_folder_h folder);
206
207 /**
208  * @brief insert media folder into database by folder path
209  * @since_tizen 4.0
210  *
211  * @param[in] folder path
212  *
213  * @return @c 0 on success,
214  *         otherwise a negative error value
215  *
216  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
217  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
218  */
219 int media_folder_insert_to_db(const char *path);
220
221 /********** media_group **********/
222
223  /**
224  * @brief Iterates through the media group with optional @a filter from the media database.
225  * @details This function gets the names and counts of media group meeting the given filter.
226  * The callback function will be invoked for every retrieved media group.
227  * If NULL is passed to the filter, no filtering is applied.
228  *
229  * @param[in] filter The handle to media filter
230  * @param[in] group The type of media group
231  * @param[in] callback The callback function to invoke
232  * @param[in] user_data The user data to be passed to the callback function
233  * @return 0 on success, otherwise a negative error value.
234  * @retval #MEDIA_CONTENT_ERROR_NONE Successful
235  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
236  * @pre This function requires opened connection to content service by media_content_connect().
237  * @post This function invokes media_group_cb().
238  * @see #media_group_and_count_cb
239  * @see media_content_connect()
240  * @see media_filter_create()
241  */
242 int media_group_foreach_group_and_count_from_db(filter_h filter, media_group_e group, media_group_and_count_cb callback, void *user_data);
243
244
245 /********** media_storage **********/
246
247 /**
248  * @brief Gets the storage scan status of media storage.
249  * @since_tizen 2.4
250  *
251  * @param[in] storage The media storage handle
252  * @param[out] scan_status  The storage type of the media storage
253  *
254  * @return @c 0 on success,
255  *         otherwise a negative error value
256  *
257  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
258  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
259  */
260 int media_storage_get_scan_status(const char *storage_uuid, media_storage_scan_status_e *scan_status);
261
262 /**
263  * @brief Iterates through media storage from the media database.
264  * @details This function gets all media storage handles meeting the given @a filter.
265  *          The @a callback function will be invoked for every retrieved media storage.
266  *          If @c NULL is passed to the @a filter, then no filtering is applied.
267  *
268  * @since_tizen 2.4
269  *
270  * @param[in] filter The handle to the media filter
271  * @param[in] callback The callback function to be invoked
272  * @param[in] user_data The user data to be passed to the callback function
273  *
274  * @return @c 0 on success,
275  *         otherwise a negative error value
276  *
277  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
278  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
279  * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
280  * @retval #MEDIA_CONTENT_ERROR_DB_FAILED         DB Operation failed
281  * @retval #MEDIA_CONTENT_ERROR_DB_BUSY           DB Operation busy
282  *
283  * @pre  This function requires opened connection to content service by media_content_connect().
284  * @post This function invokes media_storage_destroy().
285  *
286  * @see media_content_connect()
287  * @see media_storage_destroy()
288  */
289 int media_storage_foreach_storage_from_db(filter_h filter, media_storage_cb callback, void *user_data);
290
291 /**
292  * @brief Destroys media storage handle.
293  * @details The function frees all resources related to the media storage handle. This handle
294  *          can no longer be used to perform any operations. New media storage handle has to
295  *          be created before the next usage.
296  *
297  * @since_tizen 2.4
298  *
299  * @param[in] storage The media storage handle
300  *
301  * @return @c 0 on success,
302  *         otherwise a negative error value
303  *
304  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
305  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
306  *
307  * @pre Get copy of media_storage_h handle by calling media_storage_clone().
308  *
309  * @see media_storage_clone()
310  */
311 int media_storage_destroy(media_storage_h storage);
312
313 /**
314  * @brief Clones the media storage handle.
315  *
316  * @details This function copies the media storage handle from a source to the destination.
317  *          There is no media_storage_create() function. The media_storage_h is created internally and
318  *          available through media storage foreach function such as media_storage_foreach_storage_from_db().
319  *          To use this handle outside of these foreach functions, use this function.
320  *
321  * @since_tizen 2.4
322  *
323  * @remarks The @a dst should be released using media_storage_destroy().
324  *
325  * @param[out] dst The destination handle to the media storage
326  * @param[in] src The source handle to the media storage
327  *
328  * @return @c 0 on success,
329  *         otherwise a negative error value
330  *
331  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
332  * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
333  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
334  *
335  * @see media_storage_destroy()
336  * @see media_storage_foreach_storage_from_db()
337  * @see media_storage_get_storage_info_from_db()
338  */
339 int media_storage_clone(media_storage_h *dst, media_storage_h src);
340
341 /**
342  * @brief Gets the storage id of media storage.
343  * @since_tizen 2.4
344  *
345  * @remarks The @a storage_id should be released using free().
346  *
347  * @param[in] storage The media storage handle
348  * @param[out] storage_id The ID of the media storage
349  *
350  * @return @c 0 on success,
351  *         otherwise a negative error value
352  *
353  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
354  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
355  * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
356  */
357 int media_storage_get_id(media_storage_h storage, char **storage_id);
358
359 /**
360  * @brief Gets the storage path of media storage.
361  * @since_tizen 2.4
362  *
363  * @remarks The @a storage_path should be released using free().
364  *
365  * @param[in] storage The media storage handle
366  * @param[out] storage_path The storage path of the media storage
367  *
368  * @return @c 0 on success,
369  *         otherwise a negative error value
370  *
371  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
372  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
373  * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
374  */
375 int media_storage_get_path(media_storage_h storage, char **storage_path);
376 #ifdef __cplusplus
377 }
378 #endif /* __cplusplus */
379
380 #endif /* __TIZEN_MEDIA_CONTENT_PRODUCT_H__ */