[ACR-1226] deprecate function to remove item from db
[platform/core/api/media-content.git] / include_product / media_info_private.h
index 4751a64..fa9a853 100755 (executable)
@@ -15,8 +15,8 @@
 */
 
 
-#ifndef __TIZEN_MEDIA_INFO_PRIVATE_H__
-#define __TIZEN_MEDIA_INFO_PRIVATE_H__
+#ifndef __TIZEN_CONTENT_MEDIA_INFO_PRIVATE_H__
+#define __TIZEN_CONTENT_MEDIA_INFO_PRIVATE_H__
 
 
 #include <unistd.h>
@@ -489,7 +489,6 @@ typedef struct _media_content_scan_cb_data_v2 {
 #define DB_TABLE_PLAYLIST_MAP  "playlist_map"
 #define DB_TABLE_BOOKMARK              "bookmark"
 #define DB_TABLE_STORAGE               "storage"
-#define DB_TABLE_MEDIA_VIEW    "media_view"
 #define DB_TABLE_FACE                  "face"
 #define DB_TABLE_FACE_SCAN_LIST        "face_scan_list"
 #define DB_TABLE_PVR                           "pvr"
@@ -498,6 +497,7 @@ typedef struct _media_content_scan_cb_data_v2 {
 /* DB View */
 #define DB_VIEW_PLAYLIST       "playlist_view"
 #define DB_VIEW_TAG                    "tag_view"
+#define DB_VIEW_MEDIA          "media_view"
 
 /* DB Table Alias */
 #define DB_TABLE_ALIAS_MEDIA                   "m"
@@ -799,8 +799,8 @@ typedef struct _media_content_scan_cb_data_v2 {
 #define SELECT_MEDIA_FROM_STORAGE              "SELECT "MEDIA_INFO_ITEM" FROM '%s' WHERE validity=1 AND storage_uuid='%s'"
 #define SELECT_MEDIA_FROM_TAG                          "SELECT "MEDIA_INFO_ITEM" FROM '%s' WHERE media_uuid IN (SELECT media_uuid FROM "DB_TABLE_TAG_MAP" WHERE tag_id=%d) AND validity=1"
 #define SELECT_MEDIA_FROM_PLAYLIST             "SELECT "MEDIA_INFO_ITEM" FROM '%s' WHERE media_uuid IN (SELECT media_uuid FROM "DB_TABLE_PLAYLIST_MAP" WHERE playlist_id=%d) AND validity=1"
-#define SELECT_MEDIA_PATH_BY_ID                        "SELECT path FROM "DB_TABLE_MEDIA_VIEW" WHERE media_uuid='%q'"
-#define SELECT_MEDIA_STORAGE_ID_BY_ID          "SELECT storage_uuid FROM "DB_TABLE_MEDIA_VIEW" WHERE media_uuid='%q'"
+#define SELECT_MEDIA_PATH_BY_ID                        "SELECT path FROM "DB_VIEW_MEDIA" WHERE media_uuid='%q'"
+#define SELECT_MEDIA_STORAGE_ID_BY_ID          "SELECT storage_uuid FROM "DB_VIEW_MEDIA" WHERE media_uuid='%q'"
 
 /* Delete */
 #define DELETE_MEDIA_FROM_MEDIA_BATCH  "DELETE FROM  '%s' WHERE %s AND storage_type = %d"
@@ -809,7 +809,7 @@ typedef struct _media_content_scan_cb_data_v2 {
 #define DELETE_BOOKMARK_FROM_BOOKMARK  "DELETE FROM "DB_TABLE_BOOKMARK" WHERE bookmark_id=%d"
 
 /*For batch remove*/
-#define SELECT_STORAGE_BY_FILTER       "SELECT DISTINCT storage_uuid, storage_type FROM "DB_TABLE_MEDIA_VIEW" WHERE %s"
+#define SELECT_STORAGE_BY_FILTER       "SELECT DISTINCT storage_uuid, storage_type FROM "DB_VIEW_MEDIA" WHERE %s"
 #define SELECT_THUMBNAIL_BY_FILTER     "SELECT DISTINCT thumbnail_path FROM '%s' WHERE %s AND storage_type = %d"
 
 /* Storage*/
@@ -821,14 +821,13 @@ typedef struct _media_content_scan_cb_data_v2 {
 #define DELETE_FACE_FROM_FACE                  "DELETE FROM "DB_TABLE_FACE" WHERE face_id=%d"
 #define INSERT_FACE_TO_FACE                            "INSERT INTO "DB_TABLE_FACE" (media_uuid, face_rect_x , face_rect_y, face_rect_w, face_rect_h, orientation, face_tag) VALUES ('%q', %d, %d, %d, %d, %d, %Q);"
 #define UPDATE_FACE_TO_FACE                    "UPDATE "DB_TABLE_FACE" SET face_rect_x=%d, face_rect_y=%d, face_rect_w=%d, face_rect_h=%d, orientation=%d, face_tag=%Q WHERE face_id=%d"
-#define SELECT_MEDIA_COUNT_FROM_MEDIA_BY_ID            "SELECT COUNT(*) FROM "DB_TABLE_MEDIA_VIEW" WHERE media_uuid='%q' AND validity=1"
+#define SELECT_MEDIA_COUNT_FROM_MEDIA_BY_ID            "SELECT COUNT(*) FROM "DB_VIEW_MEDIA" WHERE media_uuid='%q' AND validity=1"
 #define SELECT_FACE_COUNT                                      "SELECT COUNT(*) FROM "FACE_MEDIA_JOIN
 #define SELECT_FACE_COUNT_BY_MEDIA_ID          "SELECT COUNT(*) FROM "FACE_MEDIA_JOIN" AND fa.media_uuid='%s'"
 #define SELECT_FACE_LIST                                               "SELECT fa.face_id, fa.media_uuid, fa.face_rect_x, fa.face_rect_y, fa.face_rect_w, fa.face_rect_h, fa.orientation, fa.face_tag FROM "FACE_MEDIA_JOIN
 #define SELECT_FACE_LIST_BY_MEDIA_ID           "SELECT fa.face_id, fa.media_uuid, fa.face_rect_x, fa.face_rect_y, fa.face_rect_w, fa.face_rect_h, fa.orientation, fa.face_tag FROM "FACE_MEDIA_JOIN" AND fa.media_uuid='%s'"
-#define SELECT_FACE_PATH_FROM_MEDIA            "SELECT path FROM "DB_TABLE_MEDIA_VIEW" media_uuid='%s'"
-#define SELECT_MEDIA_FROM_FACE                 "SELECT media_uuid FROM "DB_TABLE_FACE" WHERE face_id=%d"
-#define UPDATE_MEDIA_INFO_IN_FACE_SCAN_LIST    "UPDATE "DB_TABLE_FACE_SCAN_LIST" SET modified_time = 0 WHERE media_uuid='%q'"
+#define SELECT_FACE_PATH_FROM_MEDIA            "SELECT path FROM "DB_VIEW_MEDIA" media_uuid='%s'"
+#define UPDATE_MEDIA_INFO_IN_FACE_SCAN_LIST    "UPDATE "DB_TABLE_FACE_SCAN_LIST" SET modified_time = 0 WHERE media_uuid IN (SELECT media_uuid FROM "DB_TABLE_FACE" WHERE face_id=%d)"
 #define SELECT_FACE_ID                 "SELECT face_id FROM "DB_TABLE_FACE" WHERE media_uuid='%q' AND face_rect_x=%d AND face_rect_y=%d AND face_rect_w=%d AND face_rect_h=%d AND orientation=%d"
 
 #define DEFAULT_MEDIA_STORAGE_ID                       "media"
@@ -920,94 +919,11 @@ int _media_db_get_pvr_group_item(const char *group_name, filter_h filter, media_
 int _media_db_get_uhd(filter_h filter, media_uhd_cb callback, void *user_data);
 void _media_uhd_item_get_detail(sqlite3_stmt* stmt, media_uhd_h uhd);
 
-/**
- * @internal
- * @brief Creates a media filter attribute handle.
- * @details This function creates a media filter attribute handle. The handle can be
- * used to convert to attributes of database from attributes of user.
- * @remarks The @a handle must be released with media_filter_attribute_destory() by you.
- * @param[out] filter A handle to media filter attribute
- * @return 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_PERMISSION_DENIED Permission denied
- * @see media_filter_attribute_destory()
- *
- */
 int _media_filter_attribute_create(attribute_h *attr);
-
-/**
- * @internal
- * @brief Add the attributes to the handle.
- * @details This function add the attribute to handle.
- * @param[in] filter The handle to media filter attribute
- * @param[in] user_attr The user attribute
- * @param[in] platform_attr The platform attribute
- * @return 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_PERMISSION_DENIED Permission denied
- * @see media_filter_attribute_remove()
- *
- */
 int _media_filter_attribute_add(attribute_h atrr, const char *user_attr, const char *platform_attr);
-
-/**
- * @internal
- * @brief Destroys a media filter attribute handle.
- * @details The function frees all resources related to the media filter attribute handle. The filter attribute
- * handle no longer can be used to perform any operation. A new handle
- * has to be created before the next usage.
- *
- * @param[in] filter The handle to media filter attribute
- * @return 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_PERMISSION_DENIED Permission denied
- * @see media_filter_create()
- *
- */
 int _media_filter_attribute_destory(attribute_h attr);
-
-/**
- * @internal
- * @brief Replace to platform attributes from user attributes.
- * @details This function replace to platform attributes from user attributes to generate the WHERE clause
- * @param[in] filter The handle to media filter attribute
- * @param[in] user_attr The user attribute
- * @param[in] platform_attr The platform attribute
- * @return 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_PERMISSION_DENIED Permission denied
- * @see media_filter_attribute_create()
- * @see media_filter_attribute_destory()
- *
- */
 int _media_filter_attribute_generate(attribute_h attr, filter_h filter, char **generated_condition);
-
-/**
- * @internal
- * @brief Replace to platform attributes from user attributes.
- * @details This function replace to platform attributes from user attributes to generate the WHERE clause
- * @param[in] filter The handle to media filter attribute
- * @param[in] attr The attribute
- * @param[in] generated_option The handle to generated option
- * @return 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_DB_FAILED Filed DB
- * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
- * @see media_filter_attribute_create()
- * @see media_filter_attribute_destory()
- *
- */
-
 int _media_filter_attribute_option_generate(attribute_h attr, filter_h filter, char **generated_option);
-
 int _media_filter_attribute_option_generate_with_full_query(attribute_h attr, filter_h filter, char **generated_option);
 
 GMutex* _content_get_db_mutex(void);
@@ -1080,4 +996,4 @@ GMutex* _content_get_db_mutex(void);
 #ifdef __cplusplus
 }
 #endif /* __cplusplus */
-#endif /*__TIZEN_MEDIA_INFO_PRIVATE_H__*/
+#endif /*__TIZEN_CONTENT_MEDIA_INFO_PRIVATE_H__*/