Tizen 2.0 Release
[framework/system/oma-dm-agent.git] / include / mo-handler / dm_mo_common.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 DM_MO_COMMON_H_
19 #define DM_MO_COMMON_H_
20
21 /*sync-agent*/
22 #include <sync_agent.h>
23
24 /*dm-agent*/
25 #include "common/dm_common.h"
26 #include "dm_mo_common_internal.h"
27 #include "serviceadapter/sa_define.h"
28
29 /*=================================================================
30  *                                                              DM MO COMMON
31  * =================================================================
32  */
33
34 /**
35  * @par Description: API to free dm acc
36  *
37  *
38  * @par Purpose:
39  * @par Typical use case:
40  * @par Method of function operation:
41  * @par Important notes:
42  * @param[in]   dm_acc structure
43  *
44  * @return                      DM_OK                           success
45  *                                      DM_ERROR                fail
46  *
47  *
48  * @par Errors:
49  *
50  * @pre None.
51  * @post
52  * @see
53  * @remarks None.
54  *
55  * @par Sample Code:
56  * @code
57  * @endcode
58  */
59 void free_dm_acc(dm_acc * dmaccount);
60
61 /**
62  * @par Description: API to get_client_dmacc
63  *
64  *
65  * @par Purpose:
66  * @par Typical use case:
67  * @par Method of function operation:
68  * @par Important notes:
69  * @param[in]   server id                                               server id
70  * @param[out]  client id                                                       client id
71  * @param[out]  client pw                                               client pw
72  * @param[out]  source url                                              source url
73  * @param[out]  target url                                              targer url
74  * @param[out]  base64                                                  base64
75  * @param[out]  nextnonce                                               nextnonce
76  * @param[out]  authType                                                authType
77  *
78  * @return                      DM_OK                           success
79  *                                      DM_ERROR                fail
80  *
81  *
82  * @par Errors:
83  *
84  * @pre None.
85  * @post
86  * @see
87  * @remarks None.
88  *
89  * @par Sample Code:
90  * @code
91  * @endcode
92  */
93 DM_ERROR get_client_dmacc(char *pServer_id, char **client_id, char **client_pwd, char **sourceUrl, char **targetUrl, int *isBase64, char **nextNonce, char **authType);
94
95 /**
96  * @par Description: API to get_server_dmacc
97  *
98  *
99  * @par Purpose:
100  * @par Typical use case:
101  * @par Method of function operation:
102  * @par Important notes:
103  * @param[in]   server id                                               server id
104  * @param[out]  client id                                                       client id
105  * @param[out]  client pw                                               client pw
106  * @param[out]  source url                                              source url
107  * @param[out]  target url                                              targer url
108  * @param[out]  base64                                                  base64
109  * @param[out]  nextnonce                                               nextnonce
110  * @param[out]  authType                                                authType
111  *
112  * @return                      DM_OK                           success
113  *                                      DM_ERROR                fail
114  *
115  *
116  * @par Errors:
117  *
118  * @pre None.
119  * @post
120  * @see
121  * @remarks None.
122  *
123  * @par Sample Code:
124  * @code
125  * @endcode
126  */
127 DM_ERROR get_server_dmacc(char *pServer_id, char **server_id, char **server_pwd, char **sourceUrl, char **targetUrl, int *isBase64, char **nextNonce, char **authType);
128
129 /**
130  * @par Description: API to update dm acc
131  *
132  *
133  * @par Purpose:
134  * @par Typical use case:
135  * @par Method of function operation:
136  * @par Important notes:
137  * @param[in]   server id                                               server id
138  * @param[out]  dm_acc structure
139  *
140  * @return                      1                               success
141  *                                      0                               fail
142  *
143  *
144  * @par Errors:
145  *
146  * @pre None.
147  * @post
148  * @see
149  * @remarks None.
150  *
151  * @par Sample Code:
152  * @code
153  * @endcode
154  */
155 int update_dmacc(char *pServer_id, dm_acc * dmaccount);
156
157 /**
158  * @par Description: API to get dm acc auth type
159  *
160  *
161  * @par Purpose:
162  * @par Typical use case:
163  * @par Method of function operation:
164  * @par Important notes:
165  * @param[in]   server id                                               server id
166  * @param[out]  AuthType                                                Auth type
167  *
168  * @return                      DM_OK                           success
169  *                                      DM_ERROR                fail
170  *
171  *
172  * @par Errors:
173  *
174  * @pre None.
175  * @post
176  * @see
177  * @remarks None.
178  *
179  * @par Sample Code:
180  * @code
181  * @endcode
182  */
183 DM_ERROR get_dmacc_authType(char *pServer_id, AuthType * pAuthType);
184
185 /**
186  * @par Description: API to get_format
187  *
188  *
189  * @par Purpose:
190  * @par Typical use case:
191  * @par Method of function operation:
192  * @par Important notes:
193  * @param[in]   mo format                                               mo format
194  * @param[out]  format                                                  format
195  *
196  * @return                      DM_OK                           success
197  *                                      DM_ERROR                fail
198  *
199  *
200  * @par Errors:
201  *
202  * @pre None.
203  * @post
204  * @see
205  * @remarks None.
206  *
207  * @par Sample Code:
208  * @code
209  * @endcode
210  */
211 DM_ERROR get_format(sync_agent_dm_mo_format_e format_enum, char **format);
212
213 /**
214  * @par Description: API to get_format_enum
215  *
216  *
217  * @par Purpose:
218  * @par Typical use case:
219  * @par Method of function operation:
220  * @par Important notes:
221  * @param[in]   format                                          format
222  * @param[out]  format_enum                             format_enum
223  *
224  * @return                      DM_OK                           success
225  *                                      DM_ERROR                fail
226  *
227  *
228  * @par Errors:
229  *
230  * @pre None.
231  * @post
232  * @see
233  * @remarks None.
234  *
235  * @par Sample Code:
236  * @code
237  * @endcode
238  */
239 DM_ERROR get_format_enum(char *format, sync_agent_dm_mo_format_e * format_enum);
240
241 /**
242  * @par Description: API to get_contenttype
243  *
244  *
245  * @par Purpose:
246  * @par Typical use case:
247  * @par Method of function operation:
248  * @par Important notes:
249  * @param[in]   mo contenttype                                   mo contenttype
250  * @param[out]  contenttype                                     contenttype
251  *
252  * @return                      DM_OK                           success
253  *                                      DM_ERROR                fail
254  *
255  *
256  * @par Errors:
257  *
258  * @pre None.
259  * @post
260  * @see
261  * @remarks None.
262  *
263  * @par Sample Code:
264  * @code
265  * @endcode
266
267 DM_ERROR get_contenttype(sync_agent_dm_mo_df_type_e contenttype_enum, char **contenttype);
268 */
269
270 /**
271  * @par Description: API to reset dmacc mscserver
272  *
273  *
274  * @par Purpose:
275  * @par Typical use case:
276  * @par Method of function operation:
277  * @par Important notes:
278  *
279  * @return
280  *
281  *
282  * @par Errors:
283  *
284  * @pre None.
285  * @post
286  * @see
287  * @remarks None.
288  *
289  * @par Sample Code:
290  * @code
291  * @endcode
292  */
293 void reset_dmacc_mscserver();
294
295 /**
296  * @par Description: API to reset dmacc msctestserver
297  *
298  *
299  * @par Purpose:
300  * @par Typical use case:
301  * @par Method of function operation:
302  * @par Important notes:
303  *
304  * @return
305  *
306  *
307  * @par Errors:
308  *
309  * @pre None.
310  * @post
311  * @see
312  * @remarks None.
313  *
314  * @par Sample Code:
315  * @code
316  * @endcode
317  */
318 void reset_dmacc_msctestserver();
319
320 /**
321  * @par Description: API to get_format
322  *
323  *
324  * @par Purpose:
325  * @par Typical use case:
326  * @par Method of function operation:
327  * @par Important notes:
328  *
329  * @return
330  *
331  *
332  * @par Errors:
333  *
334  * @pre None.
335  * @post
336  * @see
337  * @remarks None.
338  *
339  * @par Sample Code:
340  * @code
341  * @endcode
342  */
343 void reset_dmacc_gcf();
344
345 /**
346  * @par Description: API to reset_devinfo
347  *
348  *
349  * @par Purpose:
350  * @par Typical use case:
351  * @par Method of function operation:
352  * @par Important notes:
353  *
354  * @return
355  *
356  *
357  * @par Errors:
358  *
359  * @pre None.
360  * @post
361  * @see
362  * @remarks None.
363  *
364  * @par Sample Code:
365  * @code
366  * @endcode
367  */
368 void reset_devinfo();
369
370 /**
371  * @par Description: API to reset_devdetail
372  *
373  *
374  * @par Purpose:
375  * @par Typical use case:
376  * @par Method of function operation:
377  * @par Important notes:
378  *
379  * @return
380  *
381  *
382  * @par Errors:
383  *
384  * @pre None.
385  * @post
386  * @see
387  * @remarks None.
388  *
389  * @par Sample Code:
390  * @code
391  * @endcode
392  */
393 void reset_devdetail();
394
395 /**
396  * @par Description: API to get_mo_root_path
397  *
398  *
399  * @par Purpose:
400  * @par Typical use case:
401  * @par Method of function operation:
402  * @par Important notes:
403  * @param[in] mo full path
404  * @param[in] root path
405  *
406  * @return                      DM_OK                   success
407  *                                              DM_ERROR        fail
408  *
409  * @par Errors:
410  *
411  * @pre None.
412  * @post
413  * @see
414  * @remarks None.
415  *
416  * @par Sample Code:
417  * @code
418  * @endcode
419  */
420 DM_ERROR get_mo_root_path(const char *mo_full_path, char **root_path);
421
422 /**
423  * @par Description: API to get_engine_type_by_serverid
424  *
425  *
426  * @par Purpose:
427  * @par Typical use case:
428  * @par Method of function operation:
429  * @par Important notes:
430  * @param[in] server id
431  *
432  * @return                      SERVICE_SERVER_TYPE
433  *
434  * @par Errors:
435  *
436  * @pre None.
437  * @post
438  * @see
439  * @remarks None.
440  *
441  * @par Sample Code:
442  * @code
443  * @endcode
444  */
445 SERVICE_SERVER_TYPE get_engine_type_by_serverid(const char *server_id);
446
447 /**
448  * @par Description: API to get_engine_type_by_serverid
449  *
450  *
451  * @par Purpose:
452  * @par Typical use case:
453  * @par Method of function operation:
454  * @par Important notes:
455  * @param[in] mo full path
456  *
457  * @return                      SERVICE_SERVER_TYPE
458  *
459  * @par Errors:
460  *
461  * @pre None.
462  * @post
463  * @see
464  * @remarks None.
465  *
466  * @par Sample Code:
467  * @code
468  * @endcode
469  */
470 SERVICE_SERVER_TYPE get_service_type(const char *mo_full_path);
471
472 /**
473  * @par Description: API to get server id
474  *
475  *
476  * @par Purpose:
477  * @par Typical use case:
478  * @par Method of function operation:
479  * @par Important notes:
480  * @param[in] server type
481  * @param[out] server id
482  *
483  * @return                      SERVICE_SERVER_TYPE
484  *
485  * @par Errors:
486  *
487  * @pre None.
488  * @post
489  * @see
490  * @remarks None.
491  *
492  * @par Sample Code:
493  * @code
494  * @endcode
495  */
496 DM_ERROR get_Serverid(SERVICE_SERVER_TYPE mo_type, char **server_id);
497
498 /**
499  * @par Description: API to get server type
500  *
501  *
502  * @par Purpose:
503  * @par Typical use case:
504  * @par Method of function operation:
505  * @par Important notes:
506  * @param[in] server_id
507  * @param[out] mo_type
508  *
509  * @return                      SERVICE_SERVER_TYPE
510  *
511  * @par Errors:
512  *
513  * @pre None.
514  * @post
515  * @see
516  * @remarks None.
517  *
518  * @par Sample Code:
519  * @code
520  * @endcode
521  */
522 DM_ERROR get_server_type(char *server_id, int *mo_type);
523
524 /**
525  * @par Description: API to add dm acc
526  *
527  *
528  * @par Purpose:
529  * @par Typical use case:
530  * @par Method of function operation:
531  * @par Important notes:
532  * @param[in] server_type server type
533  *
534  * @return                      DM_OK
535  *
536  * @par Errors:
537  *
538  * @pre None.
539  * @post
540  * @see
541  * @remarks None.
542  *
543  * @par Sample Code:
544  * @code
545  * @endcode
546  */
547 DM_ERROR add_dm_acc(SERVICE_SERVER_TYPE server_type);
548
549 /**
550  * @par Description: API to remove dm acc
551  *
552  *
553  * @par Purpose:
554  * @par Typical use case:
555  * @par Method of function operation:
556  * @par Important notes:
557  * @param[in] mo_path mo full path
558  *
559  * @return                      DM_OK
560  *
561  * @par Errors:
562  *
563  * @pre None.
564  * @post
565  * @see
566  * @remarks None.
567  *
568  * @par Sample Code:
569  * @code
570  * @endcode
571  */
572 DM_ERROR remove_dm_acc(char *mo_path);
573
574 /**
575  * @par Description: API to check dm acc
576  *
577  *
578  * @par Purpose:
579  * @par Typical use case:
580  * @par Method of function operation:
581  * @par Important notes:
582  * @param[in] dmacc_type dm acc type
583  * @param[out] is_exist check exist flag
584  *
585  * @return                      DM_OK
586  *
587  * @par Errors:
588  *
589  * @pre None.
590  * @post
591  * @see
592  * @remarks None.
593  *
594  * @par Sample Code:
595  * @code
596  * @endcode
597  */
598 DM_ERROR is_exist_dmacc(SERVICE_SERVER_TYPE dmacc_type, int *is_exist);
599
600 /*=================================================================
601  *                                                              FOR TEST
602  * =================================================================
603  */
604 /**
605  * @par Description: API to this code is temp code fo test
606  *
607  *
608  * @par Purpose:
609  * @par Typical use case:
610  * @par Method of function operation:
611  * @par Important notes:
612  *
613  * @return
614  *
615  * @par Errors:
616  *
617  * @pre None.
618  * @post
619  * @see
620  * @remarks None.
621  *
622  * @par Sample Code:
623  * @code
624  * @endcode
625  */
626 /*
627 void dmacc_define_fumo();
628 void dmacc_define_lawmo();
629 void devinfo_define();
630 void devdetail_define();
631 void fumo_define();
632 void lawmo_define();
633 */
634
635 #endif                          /* DM_MO_COMMON_H_ */