[ACR-1348] Fix bug of media_info_insert_to_db API
[platform/core/multimedia/libmedia-service.git] / include / media-svc.h
1 /*
2  * libmedia-service
3  *
4  * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
5  *
6  * Contact: Hyunjun Ko <zzoon.ko@samsung.com>, Haejeong Kim <backto.kim@samsung.com>
7  *
8  * Licensed under the Apache License, Version 2.0 (the "License");
9  * you may not use this file except in compliance with the License.
10  * You may obtain a copy of the License at
11  *
12  * http://www.apache.org/licenses/LICENSE-2.0
13  *
14  * Unless required by applicable law or agreed to in writing, software
15  * distributed under the License is distributed on an "AS IS" BASIS,
16  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17  * See the License for the specific language governing permissions and
18  * limitations under the License.
19  *
20  */
21
22
23
24 #ifndef _MEDIA_SVC_H_
25 #define _MEDIA_SVC_H_
26
27 #include "media-svc-types.h"
28 #include <media-util.h>
29 #include <time.h>
30 #include <stdbool.h>
31 #include <sqlite3.h>
32
33 #ifdef __cplusplus
34 extern "C" {
35 #endif
36
37
38 int media_svc_get_user_version(sqlite3 *handle, int *user_version);
39 int media_svc_create_table(uid_t uid);
40 int media_svc_check_item_exist_by_path(sqlite3 *handle, const char *storage_id, const char *path);
41 int media_svc_get_modified_time(sqlite3 *handle, const char *storage_id, const char *path, int *modified_time);
42 int media_svc_insert_folder(sqlite3 *handle, const char *storage_id, ms_user_storage_type_e storage_type, const char *path, uid_t uid);
43 int media_svc_insert_item_begin(int data_cnt, int with_noti, int from_pid);
44 int media_svc_insert_item_end(uid_t uid);
45 int media_svc_insert_item_bulk(sqlite3 *handle, const char *storage_id, ms_user_storage_type_e storage_type, const char *path, uid_t uid);
46 int media_svc_insert_item_immediately(sqlite3 *handle, const char *storage_id, ms_user_storage_type_e storage_type, const char *path, uid_t uid);
47 int media_svc_move_item(sqlite3 *handle, const char *src_path, const char *dest_path, uid_t uid);
48 int media_svc_set_item_validity_begin(int data_cnt);
49 int media_svc_set_item_validity_end(uid_t uid);
50 int media_svc_set_item_validity(const char *storage_id, const char *path, int validity, uid_t uid);
51 int media_svc_delete_item_by_path(sqlite3 *handle, const char *storage_id, const char *path, uid_t uid);
52 int media_svc_refresh_item(sqlite3 *handle, const char *storage_id, ms_user_storage_type_e storage_type, const char *path, uid_t uid);
53 int media_svc_send_dir_update_noti(sqlite3 *handle, const char *storage_id, const char *dir_path, const char *folder_id, media_item_update_type_e update_type, int pid);
54 int media_svc_check_db_upgrade(sqlite3 *handle, int user_version, uid_t uid);
55 int media_svc_publish_noti(media_item_type_e update_item, media_item_update_type_e update_type, const char *path, media_type_e media_type, const char *uuid, const char *mime_type);
56 int media_svc_get_pinyin(const char *src_str, char **pinyin_str);
57 int media_svc_check_pinyin_support(bool *support);
58 int media_svc_update_item_begin(int data_cnt);
59 int media_svc_update_item_end(uid_t uid);
60 int media_svc_update_item_meta(const char *file_path, const char *storage_id, int storage_type, uid_t uid);
61
62 int media_svc_generate_uuid(char **uuid);
63 int media_svc_check_storage(sqlite3 *handle, const char *storage_id, char **storage_path, int *validity, uid_t uid);
64 int media_svc_insert_storage(sqlite3 *handle, const char *storage_id, const char *storage_path, ms_user_storage_type_e storage_type, uid_t uid);
65 int media_svc_update_storage(sqlite3 *handle, const char *storage_id, const char *storage_path, uid_t uid);
66 int media_svc_set_storage_validity(sqlite3 *handle, const char *storage_id, int validity, uid_t uid);
67 int media_svc_get_storage_id(sqlite3 *handle, const char *path, char *storage_id, uid_t uid);
68 int media_svc_set_folder_validity(sqlite3 *handle, const char *storage_id, const char *start_path, int validity, bool is_recursive, uid_t uid);
69
70 int media_svc_insert_folder_begin(int data_cnt);
71 int media_svc_insert_folder_end(uid_t uid);
72
73 int media_svc_check_folder_exist_by_path(sqlite3 *handle, const char *storage_id, const char *folder_path);
74
75 int media_svc_append_query(const char *query, uid_t uid);
76 int media_svc_send_query(uid_t uid);
77
78 int media_svc_get_media_type(const char *path, int *mediatype);
79 int media_svc_create_thumbnail(const char *storage_id, const char *file_path, int media_type, uid_t uid, char **thumbnail_path);
80
81 #ifdef __cplusplus
82 }
83 #endif
84
85 #endif /*_MEDIA_SVC_H_*/