7849214faa6118e71eb60d6c5b364f405356684d
[framework/api/media-content.git] / include / media_content_type.h
1 /*\r
2 * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved\r
3 *\r
4 * Licensed under the Apache License, Version 2.0 (the "License");\r
5 * you may not use this file except in compliance with the License.\r
6 * You may obtain a copy of the License at\r
7 *\r
8 * http://www.apache.org/licenses/LICENSE-2.0\r
9 *\r
10 * Unless required by applicable law or agreed to in writing, software\r
11 * distributed under the License is distributed on an "AS IS" BASIS,\r
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
13 * See the License for the specific language governing permissions and\r
14 * limitations under the License. \r
15 */\r
16 \r
17 \r
18 \r
19 #ifndef __TIZEN_MEDIA_CONTENT_TYPE_H__\r
20 #define __TIZEN_MEDIA_CONTENT_TYPE_H__\r
21 \r
22 #include <time.h>\r
23 #include <tizen.h>\r
24 \r
25 #ifdef __cplusplus\r
26 extern "C" {\r
27 #endif /* __cplusplus */\r
28 \r
29 #define ERROR_MASKL16       0xFFFF\r
30 #define ERROR_SET(X)        ((X) & ERROR_MASKL16)\r
31 \r
32 \r
33 /**\r
34 * @addtogroup CAPI_MEDIA_CONTENT_MODULE\r
35 * @{\r
36 */\r
37 \r
38 /**\r
39  * @ingroup CAPI_MEDIA_CONTENT_MODULE\r
40  * @brief The enumerations of the media file format.\r
41  */\r
42 typedef enum\r
43 {\r
44     MEDIA_CONTENT_TYPE_IMAGE = 0x01 << 0,     /**<The type of image */\r
45     MEDIA_CONTENT_TYPE_VIDEO = 0x01 << 1,     /**<The type of video */\r
46     MEDIA_CONTENT_TYPE_AUDIO = 0x01 << 2,     /**<The type of audio */\r
47     MEDIA_CONTENT_TYPE_ALL = MEDIA_CONTENT_TYPE_IMAGE|MEDIA_CONTENT_TYPE_VIDEO|MEDIA_CONTENT_TYPE_AUDIO,        /**< The type of all media content */\r
48 \r
49 } media_content_type_e;\r
50 \r
51 /**\r
52  * @ingroup CAPI_CONTENT_MEDIA_FOLDER_MODULE\r
53  * @brief The enumerations of the storage type.\r
54  * @detail This information is used to establish where the folder is.\r
55  */\r
56 typedef enum\r
57 {\r
58     MEDIA_CONTENT_STORAGE_INTERNAL = 0x01 << 0,      /**< The device's internal storage */              \r
59     MEDIA_CONTENT_STORAGE_EXTERNAL = 0x01 << 1,    /**< The device's external storage */   \r
60     //MEDIA_CONTENT_STORAGE_WEB = 0x01<< 2,\r
61 } media_content_storage_e;\r
62 \r
63 /**\r
64  * @ingroup CAPI_CONTENT_MEDIA_INFO_MODULE\r
65  * @brief The type of orientation.\r
66  */\r
67 typedef enum {\r
68     MEDIA_CONTENT_ORIENTATION_NOT_AVAILABLE=0,    /**< Not available*/\r
69     MEDIA_CONTENT_ORIENTATION_NORMAL  =1,         /**< Normal*/\r
70     MEDIA_CONTENT_ORIENTATION_HFLIP   =2,         /**< Flip horizontal*/\r
71     MEDIA_CONTENT_ORIENTATION_ROT_180 =3,         /**< Rotate 180 degrees*/\r
72     MEDIA_CONTENT_ORIENTATION_VFLIP   =4,         /**< Flip vertical*/\r
73     MEDIA_CONTENT_ORIENTATION_TRANSPOSE   =5,     /**< Transpose*/\r
74     MEDIA_CONTENT_ORIENTATION_ROT_90  =6,         /**< Rotate 90 degrees*/\r
75     MEDIA_CONTENT_ORIENTATION_TRANSVERSE  =7,     /**< Transverse*/\r
76     MEDIA_CONTENT_ORIENTATION_ROT_270 =8,         /**< Rotate 270 degrees*/\r
77 } media_content_orientation_e;\r
78 \r
79 /**\r
80  * @ingroup CAPI_MEDIA_CONTENT_MODULE\r
81  * @brief The enumerations of ordering.\r
82  */\r
83 typedef enum\r
84 {\r
85     MEDIA_CONTENT_SORT_NONE,          /**< None order of sort*/\r
86     MEDIA_CONTENT_SORT_BY_NAME_ASC,   /**< The sort by name in ascending order*/\r
87     MEDIA_CONTENT_SORT_BY_NAME_DESC,  /**< The sort by name in descending order*/\r
88     MEDIA_CONTENT_SORT_BY_DATE_ASC,     /**< The sort by date in ascending order*/\r
89     MEDIA_CONTENT_SORT_BY_DATE_DESC,  /**< The sort by date in descending order*/    \r
90 } media_content_order_e;\r
91 \r
92 /**\r
93  * @ingroup CAPI_CONTENT_MEDIA_AUDIO_META_MODULE\r
94  * @brief The category of audio.\r
95  */\r
96 typedef enum{\r
97     CONTENT_AUDIO_MUSIC,    /**< Music Category*/\r
98     CONTENT_AUDIO_SOUND     /**< Sound Category*/\r
99 } audio_category_e;\r
100 \r
101 /**\r
102  * @ingroup CAPI_MEDIA_CONTENT_MODULE\r
103  * @brief   The enumerations of media content error\r
104  */\r
105 typedef enum\r
106 {\r
107     MEDIA_CONTENT_ERROR_NONE                                    = TIZEN_ERROR_NONE,                   /**< Successful */\r
108     MEDIA_CONTENT_ERROR_INVALID_PARAMETER               = TIZEN_ERROR_INVALID_PARAMETER,  /**< Invalid parameter */\r
109     MEDIA_CONTENT_ERROR_OUT_OF_MEMORY                   = TIZEN_ERROR_OUT_OF_MEMORY,      /**< Out of memory */\r
110     MEDIA_CONTENT_ERROR_DB_FAILED                               = TIZEN_ERROR_CONTENT_CLASS | 0x01,   /**< DB operation failed  */\r
111     MEDIA_CONTENT_ERROR_NOT_SUPPORTED_AUDIO             = TIZEN_ERROR_CONTENT_CLASS | 0x02, /**< Only video and image info can be added to Tag */\r
112 } media_content_error_e;\r
113 \r
114 \r
115 \r
116 /**\r
117  * @ingroup CAPI_CONTENT_MEDIA_FILTER_INFO_MODULE\r
118  * @brief  The type of searchable media info \r
119  */\r
120 typedef enum\r
121 {\r
122         MEDIA_INFO_SEARCH_NONE = 0x00,                          /**< No Search */\r
123         MEDIA_INFO_SEARCH_BY_DISPLAY_NAME = 0x01 << 0,          /**< The search by display name */\r
124                 \r
125 }media_info_search_type_e;\r
126 \r
127 \r
128 /**\r
129  * @ingroup CAPI_CONTENT_MEDIA_FILTER_FOLDER_MODULE\r
130  * @brief  The type of searchable media folder \r
131  */\r
132 typedef enum\r
133 {\r
134         MEDIA_FOLDER_SEARCH_NONE = 0x00,                                /**< No Search */\r
135         MEDIA_FOLDER_SEARCH_BY_FOLDER_NAME = 0x01 << 0,         /**< The searchabe type folder name */\r
136 }media_folder_search_type_e;\r
137 \r
138 /**\r
139  * @ingroup CAPI_CONTENT_MEDIA_FILTER_AUDIO_MODULE\r
140  * @brief  The type of searchable media audio \r
141  */\r
142 typedef enum\r
143 {\r
144         MEDIA_AUDIO_SEARCH_NONE = 0x00,                         /**< No Search */\r
145         MEDIA_AUDIO_SEARCH_BY_PLAYLIST = 0x01 << 0,             /**< The searchabe type of playlist */\r
146         MEDIA_AUDIO_SEARCH_BY_ARTIST = 0x01 << 1,               /**< The searchabe type of  artist */\r
147         MEDIA_AUDIO_SEARCH_BY_ALBUM = 0x01 << 2,                /**< The searchabe type of  album */\r
148         MEDIA_AUDIO_SEARCH_BY_AUTHOR = 0x01 << 3,               /**< The searchabe type of  author */\r
149         MEDIA_AUDIO_SEARCH_BY_GENRE = 0x01 << 4,                /**< The searchabe type of  genre */\r
150 }media_audio_search_type_e;\r
151 \r
152 /**\r
153  * @ingroup CAPI_CONTENT_MEDIA_FILTER_TAG_MODULE\r
154  * @brief  The type of searchable media tag \r
155  */\r
156 typedef enum\r
157 {\r
158         MEDIA_TAG_SEARCH_NONE = 0x00,                           /**< No Search */\r
159         MEDIA_TAG_SEARCH_BY_TAG_NAME = 0x01 << 0,               /**< The searchabe type folder name */\r
160 }media_tag_search_type_e;\r
161 \r
162 \r
163 \r
164 \r
165 \r
166 /**\r
167  * @ingroup CAPI_CONTENT_MEDIA_FILTER_INFO_MODULE\r
168  * @brief  The handle to media infon filter.\r
169  */\r
170 typedef struct media_info_filter_s* media_info_filter_h;\r
171 \r
172 /**\r
173  * @ingroup CAPI_CONTENT_MEDIA_FILTER_FOLDER_MODULE\r
174  * @brief The handle to media folder filter.\r
175  */\r
176 typedef struct media_folder_filter_s* media_folder_filter_h;\r
177 \r
178 /** \r
179  * @ingroup CAPI_CONTENT_MEDIA_FILTER_TAG_MODULE\r
180  * @brief The handle to media tag filter.\r
181  */\r
182 typedef struct media_tag_filter_s* media_tag_filter_h;\r
183 \r
184 /**\r
185  * @ingroup CAPI_CONTENT_MEDIA_FILTER_AUDIO_MODULE\r
186  * @brief The handle to media audio filter.\r
187  */\r
188 typedef struct media_audio_filter_s* media_audio_filter_h;\r
189 \r
190 /**\r
191  * @ingroup CAPI_CONTENT_MEDIA_FILTER_BOOKMARK_MODULE\r
192  * @brief The handle to video bookmark filter.\r
193  */\r
194 typedef struct video_bookmark_filter_s* video_bookmark_filter_h;\r
195 \r
196 \r
197 /**\r
198  * @ingroup CAPI_CONTENT_MEDIA_INFO_MODULE\r
199  * @brief The handle to media info.\r
200  */\r
201 typedef struct media_info_s* media_info_h;\r
202 \r
203 /**\r
204  * @ingroup CAPI_CONTENT_MEDIA_FOLDER_MODULE\r
205  * @brief The handle to media folder.\r
206  */\r
207 typedef struct media_folder_s* media_folder_h;\r
208 \r
209 /**\r
210  * @ingroup CAPI_CONTENT_MEDIA_TAG_MODULE\r
211  * @brief The handle to media tag.\r
212  */\r
213 typedef struct media_tag_s* media_tag_h;\r
214 \r
215 /**\r
216  * @ingroup CAPI_CONTENT_MEDIA_IMAGE_MODULE\r
217  * @brief The handle to image metadata.\r
218  */\r
219 typedef struct image_meta_s* image_meta_h;\r
220 \r
221 /**\r
222  * @ingroup CAPI_CONTENT_MEDIA_VIDEO_META_MODULE\r
223  * @brief The handle to video metadata.\r
224  */\r
225 typedef struct video_meta_s* video_meta_h;\r
226 \r
227 /**\r
228  * @ingroup CAPI_CONTENT_MEDIA_VIDEO_BOOKMARK_MODULE\r
229  * @brief The handle to video bookmark.\r
230  */\r
231 typedef struct video_bookmark_s* video_bookmark_h;\r
232 \r
233 /**\r
234  * @ingroup CAPI_CONTENT_MEDIA_AUDIO_META_MODULE\r
235  * @brief The handle to audio metadata.\r
236  */\r
237 typedef struct audio_meta_s* audio_meta_h;\r
238 \r
239 /**\r
240  * @ingroup CAPI_CONTENT_MEDIA_AUDIO_PLAYLIST_MODULE\r
241  * @brief The handle to audio playlist.\r
242  */\r
243 typedef struct audio_playlist_s* audio_playlist_h;\r
244 \r
245 /**\r
246  * @ingroup CAPI_CONTENT_MEDIA_AUDIO_ALBUM_MODULE\r
247  * @brief The handle to audio album.\r
248  */\r
249 typedef struct audio_album_s* audio_album_h;\r
250 \r
251 /**\r
252  * @ingroup CAPI_CONTENT_MEDIA_AUDIO_AUTHOR_MODULE\r
253  * @brief The handle to audio author.\r
254  */\r
255 typedef struct audio_author_s* audio_author_h;\r
256 \r
257 /**\r
258  * @ingroup CAPI_CONTENT_MEDIA_AUDIO_GENRE_MODULE\r
259  * @brief The handle to audio genre.\r
260  */\r
261 typedef struct audio_genre_s* audio_genre_h;\r
262 \r
263 /**\r
264  * @ingroup CAPI_CONTENT_MEDIA_AUDIO_ARTIST_MODULE\r
265  * @brief The handle to audio artist.\r
266  */\r
267 typedef struct audio_artist_s* audio_artist_h;\r
268 \r
269 /**\r
270  * @ingroup CAPI_CONTENT_MEDIA_FOLDER_MODULE\r
271  * @brief Iterates over a list of folders.\r
272  *\r
273  * @details This callback is called for every available media folder.\n\r
274  *\r
275  * @remarks To use the @a folder outside this function, copy the handle with #media_folder_clone() function. \r
276  *\r
277  * @param[in] folder The handle to media folder\r
278  * @param[in] user_data The user data passed from the foreach function\r
279  \r
280  * @return true to continue with the next iteration of the loop, \r
281  * @return false to break out of the loop.\r
282  * @pre media_folder_foreach_folder_from_db() will invoke this function.\r
283  * @see media_folder_clone()\r
284  * @see media_folder_foreach_folder_from_db()\r
285  */\r
286 typedef bool (*media_folder_cb)(media_folder_h folder, void *user_data);\r
287 \r
288 \r
289 /**\r
290  * @ingroup CAPI_CONTENT_MEDIA_INFO_MODULE\r
291  * @brief Iterates over a list of media info.\r
292  *\r
293  * @details This callback is called for every available media info.\n\r
294  *\r
295  * @remarks To use the @a media outside this function, copy the handle with #media_info_clone() function. \r
296  *\r
297  * @param[in] media  The hande to media info\r
298  * @param[in] user_data The user data passed from the foreach function \r
299  * @return true to continue with the next iteration of the loop, \r
300  * @return false to break out of the loop.\r
301  * @pre media_tag_foreach_media_from_db(), audio_playlist_foreach_media_from_db(), audio_genre_foreach_media_from_db(),\r
302  *      audio_album_foreach_media_from_db(), audio_artist_foreach_media_from_db(), audio_author_foreach_media_from_db(), \r
303  *      media_info_foreach_media_from_db(), media_folder_foreach_media_from_db() will invoke this function.\r
304  * @see media_info_clone()\r
305  * @see audio_album_foreach_media_from_db()\r
306  * @see audio_playlist_foreach_media_from_db()\r
307  * @see audio_artist_foreach_media_from_db()\r
308  * @see audio_author_foreach_media_from_db()\r
309  * @see audio_genre_get_media_count_from_db()\r
310  * @see media_tag_foreach_media_from_db()\r
311  * @see media_info_foreach_media_from_db()\r
312  * @see  media_folder_foreach_media_from_db()\r
313  */\r
314 typedef bool (*media_info_cb)(media_info_h media, void *user_data);\r
315 \r
316 /**\r
317  * @ingroup CAPI_CONTENT_MEDIA_TAG_MODULE\r
318  * @brief Iterates over a list of tags\r
319  *\r
320  * @details This callback is called for every tag in the obtained list of tags.\n\r
321  *\r
322  * @remarks To use the @a tag outside this function, copy the handle with #media_tag_clone() function. \r
323  *\r
324  * @param[in] tag The handle to media tag\r
325  * @param[in] user_data  The user data passed from the foreach function\r
326  * @return true to continue with the next iteration of the loop, \r
327  * @return false to break out of the loop.\r
328  * @pre media_tag_foreach_tag_from_db(), media_info_foreach_tag_from_db() will invoke this function.\r
329  * @see media_tag_clone()\r
330  * @see media_tag_foreach_tag_from_db()\r
331  * @see media_info_foreach_tag_from_db()\r
332  */\r
333 typedef bool (*media_tag_cb)(media_tag_h tag, void *user_data);\r
334 \r
335 /**\r
336  * @ingroup CAPI_CONTENT_MEDIA_VIDEO_BOOKMARK_MODULE\r
337  * @brief Iterates over bookmark list\r
338  *\r
339  * @details This callback is called for every bookmark in obtained list of bookmarks.\n\r
340  *\r
341  * @remarks To use the @a bookmark outside this function, copy the handle with #video_bookmark_clone() function. \r
342  *\r
343  * @param[in] bookmark The handle to video bookmark\r
344  * @param[in] user_data  The user data passed from the foreach function\r
345  * @return true to continue with the next iteration of the loop, \r
346  * @return false to break out of the loop.\r
347  * @pre video_bookmark_foreach_bookmark_from_db() will invoke this function.\r
348  * @see video_bookmark_clone()\r
349  * @see video_bookmark_foreach_bookmark_from_db()\r
350  */\r
351 typedef bool (*video_bookmark_cb)(video_bookmark_h bookmark, void *user_data);\r
352 \r
353 /**\r
354  * @ingroup CAPI_CONTENT_MEDIA_AUDIO_PLAYLIST_MODULE\r
355  * @brief Iterates over playlist list\r
356  *\r
357  * @details This callback is called for every playlist in obtained list of playlists.\n\r
358  *\r
359  * @remarks To use the @a playlist outside this function, copy the handle with #audio_playlist_clone() function. \r
360 \r
361  *\r
362  * @param[in] playlist The handle to audio playlist\r
363  * @param[in] user_data  The user data passed from the foreach function\r
364  * @return true to continue with the next iteration of the loop, \r
365  * @return false to break out of the loop.\r
366  * @pre audio_playlist_foreach_playlist_from_db() will invoke this function.\r
367  * @see audio_playlist_clone()\r
368  * @see audio_playlist_foreach_playlist_from_db()\r
369  */\r
370 typedef bool (*audio_playlist_cb)(audio_playlist_h playlist, void *user_data);\r
371 \r
372 /**\r
373  * @ingroup CAPI_CONTENT_MEDIA_AUDIO_GENRE_MODULE\r
374  * @brief Iterates over genre list\r
375  *\r
376  * @details This callback is called for every genre in obtained list of groups.\n\r
377  *\r
378  * @remarks To use the @a genre outside this function, copy the handle with #audio_genre_clone() function. \r
379  *\r
380  * @param[in] genre  The handle to audio genre\r
381  * @param[in] user_data  The user data passed from the foreach function\r
382  * @return true to continue with the next iteration of the loop, \r
383  * @return false to break out of the loop.\r
384  * @pre audio_genre_foreach_genre_from_db() will invoke this function.\r
385  * @see audio_genre_clone()\r
386  * @see audio_genre_foreach_genre_from_db()\r
387  */\r
388 typedef bool (*audio_genre_cb)(audio_genre_h genre, void *user_data);\r
389 \r
390 /**\r
391  * @ingroup CAPI_CONTENT_MEDIA_AUDIO_ARTIST_MODULE\r
392  * @brief Iterates over artist list\r
393  *\r
394  * @details This callback is called for every artist in obtained list of groups.\n\r
395  *\r
396  * @remarks To use the @a artist outside this function, copy the handle with #audio_artist_clone() function. \r
397  *\r
398  * @param[in] artist The handle to audio artist\r
399  * @param[in] user_data  The user data passed from the foreach function\r
400  * @return true to continue with the next iteration of the loop, \r
401  * @return false to break out of the loop.\r
402  * @pre audio_artist_foreach_artist_from_db() will invoke this function.\r
403  * @see audio_artist_clone()\r
404  * @see audio_artist_foreach_artist_from_db()\r
405  */\r
406 typedef bool (*audio_artist_cb)(audio_artist_h artist, void *user_data);\r
407 \r
408 /**\r
409  * @ingroup CAPI_CONTENT_MEDIA_AUDIO_AUTHOR_MODULE\r
410  * @brief Iterates over author list\r
411  *\r
412  * @details This callback is called for every author in obtained list of groups.\n\r
413  *\r
414  * @remarks To use the @a author outside this function, copy the handle with #audio_author_clone() function. \r
415  *\r
416  * @param[in] author  The handle to audio author\r
417  * @param[in] user_data  The user data passed from the foreach function\r
418  * @return true to continue with the next iteration of the loop, \r
419  * @return false to break out of the loop.\r
420  * @pre audio_author_foreach_author_from_db() will invoke this function.\r
421  * @see audio_author_clone()\r
422  * @see audio_author_foreach_author_from_db()\r
423  */\r
424 typedef bool (*audio_author_cb)(audio_author_h author, void *user_data);\r
425 \r
426 /**\r
427  * @ingroup CAPI_CONTENT_MEDIA_AUDIO_ALBUM_MODULE\r
428  * @brief Iterates over album list\r
429  *\r
430  * @details This callback is called for every album in obtained list of groups.\n\r
431  *\r
432  * @remarks To use the @a album outside this function, copy the handle with #audio_album_clone() function. \r
433  *\r
434  * @param[in] album  The handle to audio album\r
435  * @param[in] user_data  The user data passed from the foreach function\r
436  * @return true to continue with the next iteration of the loop, \r
437  * @return false to break out of the loop.\r
438  * @pre audio_album_foreach_album_from_db() will invoke this function.\r
439  * @see audio_album_clone()\r
440  * @see audio_album_foreach_album_from_db()\r
441  */\r
442 \r
443 typedef bool (*audio_album_cb)(audio_album_h album, void *user_data);\r
444 \r
445 /**\r
446  * @}\r
447  */\r
448 \r
449 #ifdef __cplusplus\r
450 }\r
451 #endif /* __cplusplus */\r
452 \r
453 \r
454 #endif /*__TIZEN_MEDIA_CONTENT_TYPE_H__*/\r