Tizen 2.1 base
[framework/multimedia/media-server.git] / common / scanner / include / media-scanner-db-svc.h
1 /*
2  *  Media Server
3  *
4  * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
5  *
6  * Contact: Yong Yeon Kim <yy9875.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  * This file defines api utilities of contents manager engines.
24  *
25  * @file                media-server-db-svc.h
26  * @author      Yong Yeon Kim(yy9875.kim@samsung.com)
27  * @version     1.0
28  * @brief
29  */
30 #ifndef _MEDIA_SCANNER_DB_SVC_H_
31 #define _MEDIA_SCANNER_DB_SVC_H_
32
33 #include "media-server-types.h"
34
35 typedef int (*CHECK_ITEM)(const char*, const char*, char **);
36 typedef int (*CONNECT)(void**, char **);
37 typedef int (*DISCONNECT)(void*, char **);
38 typedef int (*CHECK_ITEM_EXIST)(void*, const char*, int, char **);
39 typedef int (*INSERT_ITEM_BEGIN)(void*, int, char **);
40 typedef int (*INSERT_ITEM_END)(void*, char **);
41 typedef int (*INSERT_ITEM)(void*, const char*, int, const char*, char **);
42 typedef int (*SET_ALL_STORAGE_ITEMS_VALIDITY)(void*, int, int, char **);
43 typedef int (*SET_ITEM_VALIDITY_BEGIN)(void*, int, char **);
44 typedef int (*SET_ITEM_VALIDITY_END)(void*, char **);
45 typedef int (*SET_ITEM_VALIDITY)(void*, const char*, int, const char*, int, char **);
46 typedef int (*DELETE_ALL_ITEMS_IN_STORAGE)(void*, int, char **);
47 typedef int (*DELETE_ALL_INVALID_ITMES_IN_STORAGE)(void*, int, char **);
48 typedef int (*UPDATE_BEGIN)(void);
49 typedef int (*UPDATE_END)(void);
50 typedef int (*SET_FOLDER_ITEM_VALIDITY)(void*, const char*, int, int, char**);
51 typedef int (*DELETE_ALL_INVALID_ITEMS_IN_FOLDER)(void*, const char*, char**);
52
53 int
54 msc_load_functions(void);
55
56 void
57 msc_unload_functions(void);
58
59 int
60 msc_connect_db(void ***handle);
61
62 int
63 msc_disconnect_db(void ***handle);
64
65 int
66 msc_validate_item(void **handle, char *path);
67
68 int
69 msc_insert_item_batch(void **handle, const char *path);
70
71 bool
72 msc_delete_all_items(void **handle, ms_storage_type_t store_type);
73
74 int
75 msc_invalidate_all_items(void **handle, ms_storage_type_t store_type);
76
77 bool
78 msc_delete_invalid_items(void **handle, ms_storage_type_t store_type);
79
80 int
81 msc_set_folder_validity(void **handle, const char *path, int validity, int recursive);
82
83 int
84 msc_delete_invalid_items_in_folder(void **handle, const char*path);
85
86 /****************************************************************************************************
87 FOR BULK COMMIT
88 *****************************************************************************************************/
89
90 void
91 msc_register_start(void **handle);
92
93 void
94 msc_register_end(void **handle);
95
96 void
97 msc_validate_start(void **handle);
98
99 void
100 msc_validate_end(void **handle);
101
102 #endif /*_MEDIA_SCANNER_DB_SVC_H_*/