upload tizen1.0 source
[pkgs/o/oma-ds-service.git] / include / ServiceAdapter / SA_Common_Interface.h
1 /*
2  * oma-ds-service
3  *
4  * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
5  *
6  * Contact: JuHak Park <juhaki.park@samsung.com>,
7  *          JuneHyuk Lee <junhyuk7.lee@samsung.com>,
8  *          SunBong Ha <sunbong.ha@samsung.com>
9  *
10  * Licensed under the Apache License, Version 2.0 (the "License");
11  * you may not use this file except in compliance with the License.
12  * You may obtain a copy of the License at
13  *
14  * http://www.apache.org/licenses/LICENSE-2.0
15  *
16  * Unless required by applicable law or agreed to in writing, software
17  * distributed under the License is distributed on an "AS IS" BASIS,
18  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19  * See the License for the specific language governing permissions and
20  * limitations under the License.
21  *
22  */
23
24
25
26
27
28 /*
29  * For any sort of issue you concern as to this software,
30  * you may use following point of contact.
31  * All resources contributed on this software
32  * are orinigally written by S-Core Inc., a member of Samsung Group.
33  *
34  * SeongWon Shim <seongwon.shim@samsung.com>
35  */
36
37 /**
38  *   @SA_Common_Interface.h
39  *   @version                                                                   0.1
40  *   @brief                                                                             This file is the header file of interface of SA
41  *                                                                                                      called by SE
42  */
43
44 #ifndef SA_COMMON_INTERFACE_H_
45 #define SA_COMMON_INTERFACE_H_
46
47
48 /**
49  * @par Description: API to process pre-action that has to be befor sync service
50  *
51  *  Exchage Pkg1 and Pkg2 with server
52  *  Get Device Information
53  *
54  * @par Purpose:
55  * @par Typical use case:
56  * @par Method of function operation:
57  * @par Important notes:
58  * @param[in]           string type, transport Type(obex, FW_HTTP ...)
59  * @param[in]           int type, account id
60  * @param[in]           string type, session id
61  * @param[out]          PreSyncReturnObj structure(result from pkg2)
62  *
63  * @return                      Common_ErrorType enum value
64  *
65  * @par Errors:
66  *
67  * @pre None.
68  * @post
69  * @see
70  * @remarks None.
71  *
72  * @par Sample Code:
73  * @code
74  * @endcode
75  */
76 int pre_sync(int transportType, int accountId, char *sessionId,  void **preSyncReturnObj);
77
78 /**
79  * @par Description: API to generate protocol specific msg
80  *
81  *  Generate MSg which be considered maxMsgSize and maxObjSize
82  *
83  * @par Purpose:
84  * @par Typical use case:
85  * @par Method of function operation:
86  * @par Important notes:
87  * @param[in]           SyncObj structure
88  * @param[out]          msg
89  * @param[out]          msg size
90  *
91  * @return                      Common_ErrorType enum value
92  *
93  * @par Errors:
94  *
95  * @pre None.
96  * @post
97  * @see
98  * @remarks None.
99  *
100  * @par Sample Code:
101  * @code
102  * @endcode
103  */
104 int generate_msg(void **syncObj, char **msg, unsigned int *msg_size);
105
106 /**
107  * @par Description: API to exchange protocol specific msg with server
108  *
109  *  Exchange protocol specific msg(request and response) using  header binding information with server
110  *
111  * @par Purpose:
112  * @par Typical use case:
113  * @par Method of function operation:
114  * @par Important notes:
115  * @param[in]           string type, transport protocol type(http, obex etc)
116  * @param[in]           string type, msg to send
117  * @param[in]           unsigned int type, msg size
118  * @param[out]          string type, receive msg
119  * @param[out]          unsigned int type, receive msg size
120  *
121  * @return                      Common_ErrorType enum value
122  *
123  * @par Errors:
124  *
125  * @pre None.
126  * @post
127  * @see
128  * @remarks None.
129  *
130  * @par Sample Code:
131  * @code
132  * @endcode
133  */
134 int exchange_msg(int transportType,  char *sendMsg, unsigned int sendMsg_length,  char **recvMsg, unsigned int *recvMsg_length);
135
136 /**
137  * @par Description: API to process response msg from server
138  *
139  *  Process response msg from server and convert to obj that return to Service Engine
140  *
141  * @par Purpose:
142  * @par Typical use case:
143  * @par Method of function operation:
144  * @par Important notes:
145  * @param[in]           string type, recive msg from server
146  * @param[in]           unsigned int type, receive msg size
147  * @param[out]          SyncReturnObj structure
148  * @param[out]          int type, flag for finsih sync session
149  *
150  * @return                      Common_ErrorType enum value
151  *
152  * @par Errors:
153  *
154  * @pre None.
155  * @post
156  * @see
157  * @remarks None.
158  *
159  * @par Sample Code:
160  * @code
161  * @endcode
162  */
163 int process_recv_msg(char *recvMsg, unsigned int recvMsg_length, void **syncReturnObj, int *isFinish);
164
165
166 /**
167  * @par Description: API to free session structure and close connection
168  *
169  *  This API for case that error or cancel occur in ServiceEngine so need to clean up resource which using in ServiceAdapter
170  *
171  * @par Purpose:
172  * @par Typical use case:
173  * @par Method of function operation:
174  * @par Important notes:
175  * @param[in]
176  * @param[out]
177  *
178  * @return
179  *
180  * @par Errors:
181  *
182  * @pre None.
183  * @post
184  * @see
185  * @remarks None.
186  *
187  * @par Sample Code:
188  * @code
189  * @endcode
190  */
191 void clean_up_SA();
192
193 /**
194  * @par Description: API to process auto configure function
195  *
196  *
197  * @par Purpose:
198  * @par Typical use case:
199  * @par Method of function operation:
200  * @par Important notes:
201  * @param[in]           string type, id
202  * @param[in]           string type, password
203  * @param[in]           string type, target uri
204  * @param[in]           string type, profile path for getting value from vconf
205  * @param[out]          GList type, list of auto configure results
206  *
207  * @return                              Common_ErrorType enum value
208  *
209  * @par Errors:
210  *
211  * @pre None.
212  * @post
213  * @see
214  * @remarks None.
215  *
216  * @par Sample Code:
217  * @code
218  * @endcode
219  */
220 int auto_configure_from_vconf(char *id, char *pwd, char *targetUrl, char *profilePath, GList **congifure);
221
222 /**
223  * @par Description: API to process auto configure function
224  *
225  *
226  * @par Purpose:
227  * @par Typical use case:
228  * @par Method of function operation:
229  * @par Important notes:
230  * @param[in]           string type, server ip
231  * @param[in]           string type, id
232  * @param[in]           string type, password
233  * @param[out]          GList type, list of auto configure results
234  *
235  * @return                              Common_ErrorType enum value
236  *
237  * @par Errors:
238  *
239  * @pre None.
240  * @post
241  * @see
242  * @remarks None.
243  *
244  * @par Sample Code:
245  * @code
246  * @endcode
247  */
248 int auto_configure(char *addr, char *id, char *password, GList **congifure);
249
250
251 /*FIXME cancel request to NA */
252 /*int cancel_connection_sync_request(int transportType);*/
253
254 #endif /* SA_COMMON_INTERFACE_H_ */