Merge "Apply tizen coding rule" into tizen
[platform/core/api/media-content.git] / include / media_playlist.h
index e6ccea9..fdd233c 100755 (executable)
@@ -39,7 +39,7 @@ extern "C" {
 
 /**
  * @brief Gets the number of playlists for the passed @a filter from the media database.
- * @since_tizen 2.3
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
  *
  * @param[in]  filter         The handle to the filter
  * @param[out] playlist_count The count of the media playlist
@@ -49,7 +49,8 @@ extern "C" {
  *
  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #MEDIA_CONTENT_ERROR_DB_FAILED         DB operation failed
+ * @retval #MEDIA_CONTENT_ERROR_DB_FAILED         DB Operation failed
+ * @retval #MEDIA_CONTENT_ERROR_DB_BUSY           DB Operation busy
  * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
  *
  * @pre This function requires opened connection to content service by media_content_connect().
@@ -64,7 +65,7 @@ int media_playlist_get_playlist_count_from_db(filter_h filter, int *playlist_cou
  *          The callback function will be invoked for every retrieved media playlist.
  *          If @c NULL is passed to the filter, no filtering is applied.
  *
- * @since_tizen 2.3
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
  *
  * @param[in] filter    The handle to the audio filter
  * @param[in] callback  The callback function to be invoked
@@ -76,6 +77,8 @@ int media_playlist_get_playlist_count_from_db(filter_h filter, int *playlist_cou
  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
  * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
+ * @retval #MEDIA_CONTENT_ERROR_DB_FAILED         DB Operation failed
+ * @retval #MEDIA_CONTENT_ERROR_DB_BUSY           DB Operation busy
  * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
  *
  * @pre  This function requires opened connection to content service by media_content_connect().
@@ -89,7 +92,7 @@ int media_playlist_foreach_playlist_from_db(filter_h filter, media_playlist_cb c
 
 /**
  * @brief Gets the number of the media info for the given playlist present in the media database.
- * @since_tizen 2.3
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
  *
  * @param[in]  playlist_id  The ID of the media playlist
  * @param[in]  filter       The media filter handle
@@ -100,6 +103,8 @@ int media_playlist_foreach_playlist_from_db(filter_h filter, media_playlist_cb c
  *
  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #MEDIA_CONTENT_ERROR_DB_FAILED         DB Operation failed
+ * @retval #MEDIA_CONTENT_ERROR_DB_BUSY           DB Operation busy
  * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
  *
  * @pre This function requires opened connection to content service by media_content_connect().
@@ -114,7 +119,7 @@ int media_playlist_get_media_count_from_db(int playlist_id, filter_h filter, int
  *          meeting desired filter option and calls registered callback function for
  *          every retrieved media info. If @c NULL is passed to the @a filter, no filtering is applied.
  *
- * @since_tizen 2.3
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
  *
  * @param[in] playlist_id The ID of the media playlist
  * @param[in] filter      The audio filter handle
@@ -127,6 +132,8 @@ int media_playlist_get_media_count_from_db(int playlist_id, filter_h filter, int
  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
  * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
+ * @retval #MEDIA_CONTENT_ERROR_DB_FAILED         DB Operation failed
+ * @retval #MEDIA_CONTENT_ERROR_DB_BUSY           DB Operation busy
  * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
  *
  * @pre  This function requires opened connection to content service by media_content_connect().
@@ -140,7 +147,7 @@ int media_playlist_foreach_media_from_db(int playlist_id, filter_h filter, playl
 
 /**
  * @brief Inserts a new playlist with the given name into the media database.
- * @since_tizen 2.3
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
  *
  * @privlevel public
  * @privilege %http://tizen.org/privilege/content.write
@@ -171,7 +178,7 @@ int media_playlist_insert_to_db(const char *name, media_playlist_h *playlist);
 
 /**
  * @brief Deletes the given playlist from the media database.
- * @since_tizen 2.3
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
  *
  * @privlevel public
  * @privilege %http://tizen.org/privilege/content.write
@@ -183,6 +190,10 @@ int media_playlist_insert_to_db(const char *name, media_playlist_h *playlist);
  *
  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #MEDIA_CONTENT_ERROR_INVALID_OPERATION Invalid operation
+ * @retval #MEDIA_CONTENT_ERROR_DB_FAILED         DB Operation failed
+ * @retval #MEDIA_CONTENT_ERROR_DB_BUSY           DB Operation busy
+ * @retval #MEDIA_CONTENT_ERROR_NETWORK           Network fail
  * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
  *
  * @pre This function requires opened connection to content service by media_content_connect().
@@ -198,7 +209,7 @@ int media_playlist_delete_from_db(int playlist_id);
  * @details This function creates a new media playlist handle from the media database by the given @a playlist_id.
  *          The media playlist will be created and will be filled with the playlist information.
  *
- * @since_tizen 2.3
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
  *
  * @remarks You must release @a playlist using media_playlist_destroy().
  *
@@ -210,6 +221,9 @@ int media_playlist_delete_from_db(int playlist_id);
  *
  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
+ * @retval #MEDIA_CONTENT_ERROR_DB_FAILED         DB Operation failed
+ * @retval #MEDIA_CONTENT_ERROR_DB_BUSY           DB Operation busy
  * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
  *
  * @pre This function requires opened connection to content service by media_content_connect().
@@ -225,7 +239,7 @@ int media_playlist_get_playlist_from_db(int playlist_id, media_playlist_h *playl
  *          handle no longer can be used to perform any operation. A new handle has to
  *          be created before next usage.
  *
- * @since_tizen 2.3
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
  *
  * @param[in] playlist The media playlist handle
  *
@@ -249,7 +263,7 @@ int media_playlist_destroy(media_playlist_h playlist);
  *          media playlist foreach function such as media_playlist_foreach_playlist_from_db().
  *          To use this handle outside of these foreach functions, use this function.
  *
- * @since_tizen 2.3
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
  *
  * @remarks The destination handle must be released using media_playlist_destroy().
  *
@@ -271,7 +285,7 @@ int media_playlist_clone(media_playlist_h *dst, media_playlist_h src);
 
 /**
  * @brief Gets the media playlist ID.
- * @since_tizen 2.3
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
  *
  * @param[in]  playlist    The media playlist handle
  * @param[out] playlist_id The ID of the media playlist
@@ -287,7 +301,7 @@ int media_playlist_get_playlist_id(media_playlist_h playlist, int *playlist_id);
 
 /**
  * @brief Gets a name of the playlist.
- * @since_tizen 2.3
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
  *
  * @remarks You must release @a playlist_name using free().
  *
@@ -306,7 +320,7 @@ int media_playlist_get_name(media_playlist_h playlist, char **playlist_name);
 
 /**
  * @brief Sets the name of the playlist.
- * @since_tizen 2.3
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
  *
  * @param[in] playlist      The media playlist handle
  * @param[in] playlist_name The name of the media playlist
@@ -326,7 +340,7 @@ int media_playlist_set_name(media_playlist_h playlist, const char *playlist_name
 
 /**
  * @brief Gets a thumbnail path of the playlist.
- * @since_tizen 2.3
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
  *
  * @remarks You must release @a path using free().
  *
@@ -345,7 +359,7 @@ int media_playlist_get_thumbnail_path(media_playlist_h playlist, char **path);
 
 /**
  * @brief Sets the thumbnail path of the playlist.
- * @since_tizen 2.3
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
  *
  * @param[in] playlist The media playlist handle
  * @param[in] path     The path of the thumbnail
@@ -365,7 +379,7 @@ int media_playlist_set_thumbnail_path(media_playlist_h playlist, const char *pat
 
 /**
  * @brief Sets the playing order in the playlist.
- * @since_tizen 2.3
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
  *
  * @param[in] playlist           The media playlist handle
  * @param[in] playlist_member_id The playlist member ID
@@ -385,7 +399,7 @@ int media_playlist_set_play_order(media_playlist_h playlist, int playlist_member
 
 /**
  * @brief Adds a new media info to the playlist.
- * @since_tizen 2.3
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
  *
  * @param[in] playlist The media playlist handle
  * @param[in] media_id The ID to the media info which is added
@@ -408,7 +422,7 @@ int media_playlist_add_media(media_playlist_h playlist, const char *media_id);
 
 /**
  * @brief Removes the playlist members related with the media from the given playlist.
- * @since_tizen 2.3
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
  *
  * @param[in] playlist           The media playlist handle
  * @param[in] playlist_member_id The playlist member ID
@@ -431,7 +445,7 @@ int media_playlist_remove_media(media_playlist_h playlist, int playlist_member_i
 
 /**
  * @brief Gets the played order of the playlist.
- * @since_tizen 2.3
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
  *
  * @param[in] playlist           The media playlist handle
  * @param[in] playlist_member_id The playlist member ID
@@ -455,7 +469,7 @@ int media_playlist_get_play_order(media_playlist_h playlist, int playlist_member
  *          media_playlist_update_to_db() function should be called so as to update
  *          the given playlist attributes in the media database.
  *
- * @since_tizen 2.3
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
  *
  * @privlevel public
  * @privilege %http://tizen.org/privilege/content.write
@@ -467,6 +481,11 @@ int media_playlist_get_play_order(media_playlist_h playlist, int playlist_member
  *
  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
+ * @retval #MEDIA_CONTENT_ERROR_INVALID_OPERATION Invalid operation
+ * @retval #MEDIA_CONTENT_ERROR_DB_FAILED         DB Operation failed
+ * @retval #MEDIA_CONTENT_ERROR_DB_BUSY           DB Operation busy
+ * @retval #MEDIA_CONTENT_ERROR_NETWORK           Network fail
  * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
  *
  * @pre This function requires opened connection to content service by media_content_connect().
@@ -481,6 +500,60 @@ int media_playlist_get_play_order(media_playlist_h playlist, int playlist_member
 int media_playlist_update_to_db(media_playlist_h playlist);
 
 /**
+ * @brief Imports the playlist from m3u playlist file.
+ * @details This api reads a playlist from the m3u playlist file and insert into the db.
+ * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
+ *
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/content.write
+ *
+ * @remarks   http://tizen.org/privilege/mediastorage is needed if input or output path are relevant to media storage. \n
+ *                     http://tizen.org/privilege/externalstorage is needed if input or output path are relevant to external storage. \n
+ *                     This api does not support the file of extended m3u playlist.
+ *
+ * @param[in] playlist_name The name of the playlist to save
+ * @param[in] path The path to import the playlist file
+ * @param[out] playlist The media playlist handle
+ *
+ * @return @c 0 on success,
+ *         otherwise a negative error value
+ *
+ * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
+ * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
+ * @retval #MEDIA_CONTENT_ERROR_INVALID_OPERATION Invalid operation
+ * @retval #MEDIA_CONTENT_ERROR_DB_FAILED         DB Operation failed
+ * @retval #MEDIA_CONTENT_ERROR_DB_BUSY           DB Operation busy
+ * @retval #MEDIA_CONTENT_ERROR_NETWORK           Network fail
+ * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
+ */
+int media_playlist_import_from_file(const char *playlist_name, const char *path, media_playlist_h *playlist);
+
+/**
+ * @brief Exports the playlist to m3u playlist file.
+ * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
+ *
+ * @remarks   http://tizen.org/privilege/mediastorage is needed if input or output path are relevant to media storage. \n
+ *                     http://tizen.org/privilege/externalstorage is needed if input or output path are relevant to external storage. \n
+ *
+ * @param[in] playlist The media playlist handle
+ * @param[in] path path The path to export the playlist
+ *
+ * @return @c 0 on success,
+ *         otherwise a negative error value
+ *
+ * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
+ * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
+ * @retval #MEDIA_CONTENT_ERROR_INVALID_OPERATION Invalid operation
+ * @retval #MEDIA_CONTENT_ERROR_DB_FAILED         DB Operation failed
+ * @retval #MEDIA_CONTENT_ERROR_DB_BUSY           DB Operation busy
+ * @retval #MEDIA_CONTENT_ERROR_NETWORK           Network fail
+ * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
+ */
+int media_playlist_export_to_file(media_playlist_h playlist, const char* path);
+
+/**
  * @}
  */