Initialize Tizen 2.3
[framework/system/oma-dm-agent.git] / include / dm-engine / dl-manager / sa_fw_downloader.h
1 /*
2  * oma-dm-agent
3  * Copyright (c) 2012 Samsung Electronics Co., Ltd.
4  *
5  * Licensed under the Apache License, Version 2.0 (the License);
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  *     http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  */
17
18 #ifndef SA_FW_DOWNLOADER_H_
19 #define SA_FW_DOWNLOADER_H_
20
21 /*lib*/
22 #include <glib.h>
23
24 /*dm-agent*/
25 #include "common/dm_error.h"
26
27 typedef enum {
28         DD_DOWNLOAD = 1,
29         GET_FILE_NAME,
30         DATA_DOWNLOAD,
31         SEND_DOWNLOAD_STATUS
32 } DL_SEND_MSG_TYPE;
33
34 /**
35  * @par Description: API to send msg about DL
36  *
37  *
38  * @par Purpose:
39  * @par Typical use case:
40  * @par par Method of function operation:
41  * @par Important notes:
42  * @param[in]   send_dl_type                            send msg type for dl
43  * @param[in]   local_uri                                               uri information
44  * @param[in]   content_type                            content type
45  * @param[in]   header_info                             header info g_list
46  * @param[in]   sendMsg                                 send msg
47  * @param[in]   sendMsg_length                  send msg length
48  * @param[out]  recv_header                             recv msg header info g_list
49  * @param[out]  recvMsg                                 recv msg
50  * @param[out]  recvMsg_length                  recv msg length
51  *
52  * @return                                              DM_OK
53  *                                                              DM_ERROR
54  *
55  * @par Errors:
56  *
57  * @pre None.
58  * @post
59  * @see
60  * @remarks None.
61  *
62  * @par Sample Code:
63  * @code
64  * @endcode
65  */
66 DM_ERROR send_download_msg(DL_SEND_MSG_TYPE send_dl_type, char *local_uri, char *content_type, GList * header_info, char *sendMsg, unsigned int sendMsg_length, GList ** recv_header, char **recvMsg, unsigned int *recvMsg_length);
67
68 /**
69  * @par Description: API to download data to server
70  *
71  *
72  * @par Purpose:
73  * @par Typical use case:
74  * @par par Method of function operation:
75  * @par Important notes:
76  * @param[in]   local_uri                                                                       uri information
77  * @param[in]   content_type                                                    content type
78  * @param[in]   header_info                                                     header info g_list
79  * @param[in]   current_file_download_size              current file download size
80  * @param[in]   download_folder                                         download folder path
81  * @param[in]   config                                                                  wifi config
82  * @param[out]  download_path                                           download file path
83  *
84  * @return                                              DM_OK                   on success
85  *                                                                      DM_ERROR        on fail
86  * @par Errors:
87  *
88  * @pre None.
89  * @post
90  * @see
91  * @remarks None.
92  *
93  * @par Sample Code:
94  * @code
95  * @endcode
96  */
97 DM_ERROR download_data(char *local_uri, char *content_type, GList * header_info, int current_file_download_size, char *download_folder, int config, char **download_path);
98
99 /**
100  * @par Description: API to get file name
101  *
102  *
103  * @par Purpose:
104  * @par Typical use case:
105  * @par par Method of function operation:
106  * @par Important notes:
107  * @param[in]   recieve http header
108   * @param[out] file name
109  *
110  * @return
111  *
112  * @par Errors:
113  *
114  * @pre None.
115  * @post
116  * @see
117  * @remarks None.
118  *
119  * @par Sample Code:
120  * @code
121  * @endcode
122  */
123 char *get_file_name(GList * recv_header, char *file_name);
124
125 /**
126  * @par Description: API to get file name for header info
127  *
128  *
129  * @par Purpose:
130  * @par Typical use case:
131  * @par par Method of function operation:
132  * @par Important notes:
133  * @param[in]   header_info                             header info g_list
134  *
135  * @return                      file name
136  *                                      0       error
137  *
138  * @par Errors:
139  *
140  * @pre None.
141  * @post
142  * @see
143  * @remarks None.
144  *
145  * @par Sample Code:
146  * @code
147  * @endcode
148  */
149 char *get_file_name_from_http_header(GList * header_info);
150
151 /**
152  * @par Description: API to free header info g_list
153  *
154  *
155  * @par Purpose:
156  * @par Typical use case:
157  * @par par Method of function operation:
158  * @par Important notes:
159  * @param[in]   header_info                             header info g_list
160  *
161  * @return                      file name
162  *                                      0       error
163  *
164  * @par Errors:
165  *
166  * @pre None.
167  * @post
168  * @see
169  * @remarks None.
170  *
171  * @par Sample Code:
172  * @code
173  * @endcode
174  */
175 void free_header_info(GList * header_info);
176
177 #endif                          /* SA_FW_DOWNLOADER_H_ */