1 #ifndef DOWNLOAD_PROVIDER_H
2 #define DOWNLOAD_PROVIDER_H
8 #define DOWNLOAD_PROVIDER_IPC "/tmp/download-provider"
10 #define DP_MAX_STR_LEN_64 64
11 #define DP_MAX_STR_LEN 256
12 #define DP_MAX_PATH_LEN DP_MAX_STR_LEN
13 #define DP_MAX_URL_LEN 2048
16 DOWNLOAD_CONTROL_START = 1,
17 DOWNLOAD_CONTROL_STOP = 2,
18 DOWNLOAD_CONTROL_PAUSE = 3,
19 DOWNLOAD_CONTROL_RESUME = 4,
20 DOWNLOAD_CONTROL_GET_DOWNLOADING_INFO = 11,
21 DOWNLOAD_CONTROL_GET_STATE_INFO = 13,
22 DOWNLOAD_CONTROL_GET_DOWNLOAD_INFO = 14,
23 DOWNLOAD_CONTROL_GET_REQUEST_STATE_INFO = 15
27 DOWNLOAD_STATE_NONE = 0,
28 DOWNLOAD_STATE_READY = 1,
29 DOWNLOAD_STATE_PENDED = 2,
30 DOWNLOAD_STATE_PAUSE_REQUESTED = 3,
31 DOWNLOAD_STATE_PAUSED = 4,
32 DOWNLOAD_STATE_DOWNLOADING = 5,
33 DOWNLOAD_STATE_INSTALLING = 6,
34 DOWNLOAD_STATE_FINISHED = 7,
35 DOWNLOAD_STATE_STOPPED = 10,
36 DOWNLOAD_STATE_FAILED = 11
40 DOWNLOAD_ERROR_NONE = 0,
41 DOWNLOAD_ERROR_INVALID_PARAMETER = 1,
42 DOWNLOAD_ERROR_OUT_OF_MEMORY = 2,
43 DOWNLOAD_ERROR_IO_ERROR = 3,
44 DOWNLOAD_ERROR_NETWORK_UNREACHABLE = 4,
45 DOWNLOAD_ERROR_CONNECTION_TIMED_OUT = 5,
46 DOWNLOAD_ERROR_NO_SPACE = 6,
47 DOWNLOAD_ERROR_FILED_NOT_FOUND = 7,
48 DOWNLOAD_ERROR_INVALID_STATE = 8,
49 DOWNLOAD_ERROR_CONNECTION_FAILED = 9,
50 DOWNLOAD_ERROR_INVALID_URL = 10,
51 DOWNLOAD_ERROR_INVALID_DESTINATION = 11,
52 DOWNLOAD_ERROR_TOO_MANY_DOWNLOADS = 12,
53 DOWNLOAD_ERROR_ALREADY_COMPLETED = 13,
54 DOWNLOAD_ERROR_INSTALL_FAIL = 20,
55 DOWNLOAD_ERROR_FAIL_INIT_AGENT = 100,
56 DOWNLOAD_ERROR_UNKOWN = 900
62 unsigned int completed;
64 unsigned int progress;
70 } download_flexible_string;
74 download_flexible_string *str;
75 } download_flexible_double_string;
78 unsigned int received_size;
79 char saved_path[DP_MAX_PATH_LEN];
80 } downloading_state_info;
83 download_states state;
85 } download_state_info;
88 unsigned int file_size;
89 char mime_type[DP_MAX_STR_LEN];
90 char content_name[DP_MAX_STR_LEN];
91 } download_content_info;
94 callback_info callbackinfo;
95 unsigned int notification;
97 download_flexible_string client_packagename;
98 download_flexible_string url;
99 download_flexible_string install_path;
100 download_flexible_string filename;
101 download_flexible_double_string headers;
102 } download_request_info;
105 download_state_info stateinfo;
107 } download_request_state_info;