2 * Copyright (c) 2012 Samsung Electronics Co., Ltd All Rights Reserved
4 * Licensed under the Apache License, Version 2.0 (the License);
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an AS IS BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
17 #ifndef _DOWNLOAD_AGENT_INTERFACE_H
18 #define _DOWNLOAD_AGENT_INTERFACE_H
21 #define EXPORT_API __attribute__((visibility("default")))
29 #include "download-agent-defs.h"
35 unsigned long long file_size;
53 const char **request_header;
54 int request_header_count;
56 const char *install_path;
57 const char *file_name;
58 const char *temp_file_path;
62 int disable_verify_host;
65 void *user_client_data;
68 typedef void (*da_paused_cb) (int download_id,
69 void *user_param1, void *user_param2);
70 typedef void (*da_progress_cb) (int download_id,
71 unsigned long long received_size,
72 void *user_param1, void *user_param2);
73 typedef void (*da_started_cb) (download_info_t *download_info,
74 void *user_param1, void *user_param2);
75 typedef void (*da_finished_cb) (finished_info_t *finished_info,
76 void *user_param1, void *user_param2);
79 da_started_cb download_info_cb;
80 da_progress_cb progress_cb;
81 da_finished_cb finished_cb;
82 da_paused_cb paused_cb;
85 EXPORT_API int da_init();
86 EXPORT_API int da_deinit();
88 EXPORT_API int da_start_download(const char *url, req_data_t *ext_data,
89 da_cb_t *da_cb_data, int *download_id);
90 EXPORT_API int da_cancel_download(int download_id);
91 EXPORT_API int da_cancel_download_without_update(int download_id);
92 EXPORT_API int da_suspend_download(int download_id);
93 EXPORT_API int da_suspend_download_without_update(int download_id);
94 EXPORT_API int da_resume_download(int download_id);
95 EXPORT_API int da_is_valid_download_id(int download_id);
101 #endif //_DOWNLOAD_AGENT_INTERFACE_H