Tizen 2.1 base
[platform/framework/web/download-provider.git] / agent / include / download-agent-http-mgr.h
1 /*
2  * Copyright (c) 2012 Samsung Electronics Co., Ltd All Rights Reserved
3  *
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
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
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.
15  */
16
17 #ifndef _Download_Agent_Http_Mgr_H
18 #define _Download_Agent_Http_Mgr_H
19
20 #include <string.h>
21
22 #include "download-agent-type.h"
23 #include "download-agent-dl-mgr.h"
24 #include "download-agent-http-queue.h"
25
26 #define DA_MAX_SESSION_INFO                             DA_MAX_DOWNLOAD_ID
27 #define DA_MAX_TRANSACTION_INFO                 10
28 #define DA_MAX_TRANSACTION_MUTEX                DA_MAX_SESSION_INFO*DA_MAX_TRANSACTION_INFO
29
30 typedef struct _http_mgr_t
31 {
32         da_bool_t is_init;
33         da_bool_t is_http_init;
34 }http_mgr_t;
35
36 extern http_mgr_t http_mgr;
37
38 da_result_t  init_http_mgr(void);
39 void deinit_http_mgr(void);
40 da_result_t  make_req_dl_info_http(stage_info *stage, req_dl_info *out_info);
41 da_result_t  request_http_download(stage_info *stage);
42 da_result_t  request_to_cancel_http_download(stage_info *stage);
43 da_result_t  request_to_abort_http_download(stage_info *stage);
44 da_result_t  request_to_suspend_http_download(stage_info *stage);
45 da_result_t  request_to_resume_http_download(stage_info *stage);
46
47 #endif