957c61372aa96cb653204bb442bdf339f049a23c
[profile/ivi/download-provider.git] / include / download-provider-db.h
1 #ifndef DOWNLOAD_PROVIDER_DB_H
2 #define DOWNLOAD_PROVIDER_DB_H
3
4 #include "download-provider-config.h"
5
6 typedef struct {
7         download_states state;
8         int notification;
9         int retrycount;
10         int requestid;
11         char *packagename;
12         char *installpath;
13         char *filename;
14         char *createdate;
15         char *url;
16         char *mimetype;
17         char *etag;
18         char *saved_path;
19 } download_dbinfo;
20
21 typedef struct {
22         unsigned int count;
23         download_dbinfo *item;
24 } download_dbinfo_list;
25
26 typedef enum {
27         DOWNLOAD_DB_UNIQUEID = 0,
28         DOWNLOAD_DB_PACKAGENAME = 1,
29         DOWNLOAD_DB_NOTIFICATION = 2,
30         DOWNLOAD_DB_INSTALLPATH = 3,
31         DOWNLOAD_DB_FILENAME = 4,
32         DOWNLOAD_DB_RETRYCOUNT = 5,
33         DOWNLOAD_DB_STATE = 6,
34         DOWNLOAD_DB_URL = 7,
35         DOWNLOAD_DB_MIMETYPE = 10,
36         DOWNLOAD_DB_ETAG = 11,
37         DOWNLOAD_DB_SAVEDPATH = 12
38 } download_db_column_type;
39
40 int download_provider_db_requestinfo_new(download_clientinfo *clientinfo);
41 int download_provider_db_requestinfo_remove(int uniqueid);
42 int download_provider_db_requestinfo_update_column(download_clientinfo *clientinfo,
43                                                         download_db_column_type type);
44 download_dbinfo_list *download_provider_db_get_list(int state);
45 void download_provider_db_list_free(download_dbinfo_list *list);
46 int download_provider_db_list_count(int state);
47 download_request_info *download_provider_db_get_requestinfo(download_dbinfo *dbinfo);
48 int download_provider_db_history_new(download_clientinfo *clientinfo);
49 int download_provider_db_history_remove(int uniqueid);
50 int download_provider_db_history_limit_rows();
51
52 #endif