The base model is changed
[framework/api/url-download.git] / include / url_download_private.h
1 /*
2  * Copyright (c) 2011 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
18 #ifndef __TIZEN_WEB_URL_DOWNLOAD_PRIVATE_H__
19 #define __TIZEN_WEB_URL_DOWNLOAD_PRIVATE_H__
20
21 #include <bundle.h>
22 #ifndef ENABLE_DOWNLOAD_PROVIDER
23 #include <download-agent-interface.h>
24 #endif
25
26 #ifdef __cplusplus
27 extern "C"
28 {
29 #endif
30
31 #ifndef ENABLE_DOWNLOAD_PROVIDER
32 typedef da_client_cb_t *url_download_agent_h;
33 #endif
34
35 /**
36  * url_download_cb_s
37  */
38 struct url_download_cb_s {
39         url_download_started_cb started;
40         void *started_user_data;
41
42         url_download_paused_cb paused;
43         void *paused_user_data;
44
45         url_download_completed_cb completed;
46         void *completed_user_data;
47
48         url_download_stopped_cb stopped;
49         void *stopped_user_data;
50
51         url_download_progress_cb progress;
52         void *progress_user_data;
53 };
54
55 struct url_download_s {
56 #ifndef ENABLE_DOWNLOAD_PROVIDER
57         url_download_agent_h agent;
58         da_handle_t id;
59 #else
60         uint id;
61         uint enable_notification;
62         int requestid;
63 #endif
64         struct url_download_cb_s callback;
65         url_download_state_e state;
66         char *url;
67         char *destination;
68         bundle *http_header;
69         char *completed_path;
70         char *content_name;
71         char *mime_type;
72         uint file_size;
73         int sockfd;
74         pthread_t callback_thread_pid;
75 };
76
77 #ifdef __cplusplus
78 }
79 #endif
80
81 #endif /* __TIZEN_WEB_URL_DOWNLOAD_PRIVATE_H__ */