Initialize Tizen 2.3
[framework/system/oma-dm-agent.git] / include / mo-handler / dm_mo_handler.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_GENERATER_H_
19 #define DM_MO_GENERATER_H_
20
21 /*sync-agent*/
22 #include <sync_agent.h>
23
24 /*dm-agent*/
25 #include "common/dm_error.h"
26 #include "serviceadapter/sa_define.h"
27 #include "dm_mo_common.h"
28
29 /**
30  * @par Description: API to clean mo db for reset or delete dm
31  *
32  *
33  * @par Purpose:
34  * @par Typical use case:
35  * @par Method of function operation:
36  * @par Important notes:
37  *
38  * @return                      DM_OK                                                   success
39  *                                      DM_ERRORS                                       fail
40  *
41  * @par Errors:
42  *
43  * @pre None.
44  * @post
45  * @see
46  * @remarks None.
47  *
48  * @par Sample Code:
49  * @code
50  * @endcode
51  */
52 DM_ERROR clean_dm_mo();
53
54 /**
55  * @par Description: API to add item to mo with add cmd
56  *
57  *
58  * @par Purpose:
59  * @par Typical use case:
60  * @par Method of function operation:
61  * @par Important notes:
62  * @param[in]   item
63  * @param[in] server_id
64  *
65  * @return                      DM_OK                                                   success
66  *                                      DM_ERRORS                                       fail
67  *
68  * @par Errors:
69  *
70  * @pre None.
71  * @post
72  * @see
73  * @remarks None.
74  *
75  * @par Sample Code:
76  * @code
77  * @endcode
78  */
79 DM_ERROR add_itemtomo(Item * item, char *server_id);
80
81 /**
82  * @par Description: API to replace item to mo with replace cmd (update)
83  *
84  *
85  * @par Purpose:
86  * @par Typical use case:
87  * @par Method of function operation:
88  * @par Important notes:
89  * @param[in]   item
90  *
91  * @return                      DM_OK                                                   success
92  *                                      DM_ERRORS                                       fail
93  *
94  * @par Errors:
95  *
96  * @pre None.
97  * @post
98  * @see
99  * @remarks None.
100  *
101  * @par Sample Code:
102  * @code
103  * @endcode
104  */
105 DM_ERROR replace_itemtomo(Item * item);
106
107 /**
108  * @par Description: API to replace mo data
109  *
110  *
111  * @par Purpose:
112  * @par Typical use case:
113  * @par Method of function operation:
114  * @par Important notes:
115  * param[in]            mo_full_path                                    mo full path
116  * param[in]            value                                                           value
117  *
118  * @return                      DM_OK                                                   success
119  *                                      DM_ERRORS                                       fail
120  *
121  * @par Errors:
122  *
123  * @pre None.
124  * @post
125  * @see
126  * @remarks None.
127  *
128  * @par Sample Code:
129  * @code
130  * @endcode
131  */
132 DM_ERROR replace_mo_data(char *mo_full_path, char *value);
133
134 /**
135  * @par Description: API to replace mo acl property
136  *
137  *
138  * @par Purpose:
139  * @par Typical use case:
140  * @par Method of function operation:
141  * @par Important notes:
142  * param[in]            mo_full_path                                    mo full path
143  * param[in]            value                                                           value
144  * param[in]            acl                                                             acl
145  * param[in]            contenttype                                     contenttype
146  * param[in]            format                                                  format
147  * param[in]            prop_type                                               prop_type
148  *
149  *
150  * @return                      DM_OK                                                   success
151  *                                      DM_ERRORS                                       fail
152  *
153  * @par Errors:
154  *
155  * @pre None.
156  * @post
157  * @see
158  * @remarks None.
159  *
160  * @par Sample Code:
161  * @code
162  * @endcode
163  */
164 DM_ERROR replace_mo_property(char *mo_full_path, char *value, char *acl, char *contenttype, char *format, GetType prop_type);
165
166 /**
167  * @par Description: API to add mo
168  *
169  *
170  * @par Purpose:
171  * @par Typical use case:
172  * @par Method of function operation:
173  * @par Important notes:
174  * param[in]            server type                                     server type
175  * param[in]            mo_full_path                                    mo full path
176  * param[in]            value                                                           value
177  * param[in]            node_type                                               node type
178  * param[in]            contenttype                                     contenttype
179  * param[in]            format                                                  format
180  *
181  * @return                      DM_OK                                                   success
182  *                                      DM_ERRORS                                       fail
183  *
184  * @par Errors:
185  *
186  * @pre None.
187  * @post
188  * @see
189  * @remarks None.
190  *
191  * @par Sample Code:
192  * @code
193  * @endcode
194  */
195 DM_ERROR add_mo(int server_type, char *mo_full_path, char *value, sync_agent_dm_mo_node_type_e node_type, char *contenttype, char *format);
196
197 /**
198  * @par Description: API to delete item to mo
199  *
200  *
201  * @par Purpose:
202  * @par Typical use case:
203  * @par Method of function operation:
204  * @par Important notes:
205  * param[in]            item
206  *
207  * @return                      DM_OK                                                   success
208  *                                      DM_ERRORS                                       fail
209  *
210  * @par Errors:
211  *
212  * @pre None.
213  * @post
214  * @see
215  * @remarks None.
216  *
217  * @par Sample Code:
218  * @code
219  * @endcode
220  */
221 DM_ERROR delete_itemtomo(Item * item);
222
223 /**
224  * @par Description: API to replace mo (update)
225  *
226  *
227  * @par Purpose:
228  * @par Typical use case:
229  * @par Method of function operation:
230  * @par Important notes:
231  * param[in]            mo_full_path                                    mo full path
232  *  param[in]           value                                                           value
233  *  param[in]           prop_value                                              prop_value
234  *  param[in]           contenttype                                     contenttype
235  *  param[in]           format                                                  format
236  *  parma[in]           prop_type                                               prop_type
237  *
238  * @return                      DM_OK                                                   success
239  *                                      DM_ERRORS                                       fail
240  *
241  * @par Errors:
242  *
243  * @pre None.
244  * @post
245  * @see
246  * @remarks None.
247  *
248  * @par Sample Code:
249  * @code
250  * @endcode
251  */
252 DM_ERROR replace_mo(char *mo_full_path, char *value, char *acl, char *contenttype, char *format, GetType prop_type);
253
254 /**
255  * @par Description: API to delete mo
256  *
257  *
258  * @par Purpose:
259  * @par Typical use case:
260  * @par Method of function operation:
261  * @par Important notes:
262  * param[in]            mo_full_path                                    mo full path
263  *  param[in]           value                                                           value
264  *
265  * @return                      DM_OK                                                   success
266  *                                      DM_ERRORS                                       fail
267  *
268  * @par Errors:
269  *
270  * @pre None.
271  * @post
272  * @see
273  * @remarks None.
274  *
275  * @par Sample Code:
276  * @code
277  * @endcode
278  */
279 DM_ERROR delete_mo(char *mo_full_path);
280
281 /**
282  * @par Description: API to get mo data
283  *
284  *
285  * @par Purpose:
286  * @par Typical use case:
287  * @par Method of function operation:
288  * @par Important notes:
289  * param[in]            mo_full_path                                    mo full path
290  *  param[in]           data                                                            data
291  *
292  * @return                      DM_OK                                                   success
293  *                                      DM_ERRORS                                       fail
294  *
295  * @par Errors:
296  *
297  * @pre None.
298  * @post
299  * @see
300  * @remarks None.
301  *
302  * @par Sample Code:
303  * @code
304  * @endcode
305  */
306 DM_ERROR get_mo_data(char *full_path, char **data);
307
308 /**
309  * @par Description: API to get mo child list
310  *
311  *
312  * @par Purpose:
313  * @par Typical use case:
314  * @par Method of function operation:
315  * @par Important notes:
316  * @param[in]           mo_full_path                                    mo full path
317  * @param[out           pItems                                                  child mo liste
318  *
319  * @return                      DM_OK                                                   success
320  *                                      DM_ERRORS                                       fail
321  *
322  * @par Errors:
323  *
324  * @pre None.
325  * @post
326  * @see
327  * @remarks None.
328  *
329  * @par Sample Code:
330  * @code
331  * @endcode
332  */
333 DM_ERROR get_child_mo_list(char *mo_full_path, GList ** pItems);
334
335 /**
336  * @par Description: API to get mo data
337  *
338  *
339  * @par Purpose:
340  * @par Typical use case:
341  * @par Method of function operation:
342  * @par Important notes:
343  * @param[in]           mo_full_path                                    mo full path
344  * @param[in]           get_type                                                get type
345  * @param[out]          real_full_path                                  real full path
346  *
347  * @return                      DM_OK                                                   success
348  *                                      DM_ERRORS                                       fail
349  *
350  * @par Errors:
351  *
352  * @pre None.
353  * @post
354  * @see
355  * @remarks None.
356  *
357  * @par Sample Code:
358  * @code
359  * @endcode
360  */
361 DM_ERROR get_type_mo_tree(char *mo_full_path, GetType * get_type, char **real_full_path);
362
363 /**
364  * @par Description: API to get Struct
365  *
366  *
367  * @par Purpose:
368  * @par Typical use case:
369  * @par Method of function operation:
370  * @par Important notes:
371  * @param[in]           mo_full_path                                    mo full path
372  * @param[out           pItems                                                  child mo list with get type Struct
373  *
374  * @return                      DM_OK                                                   success
375  *                                      DM_ERRORS                                       fail
376  *
377  * @par Errors:
378  *
379  * @pre None.
380  * @post
381  * @see
382  * @remarks None.
383  *
384  * @par Sample Code:
385  * @code
386  * @endcode
387  */
388 DM_ERROR get_struct(char *mo_full_path, GList ** pItems);
389
390 /**
391  * @par Description: API to get StructData
392  *
393  *
394  * @par Purpose:
395  * @par Typical use case:
396  * @par Method of function operation:
397  * @par Important notes:
398  * @param[in]           mo_full_path                                    mo full path
399  * @param[out]          pItems                                                  child mo list with get type StructData
400  *
401  * @return                      DM_OK                                                   success
402  *                                      DM_ERRORS                                       fail
403  *
404  * @par Errors:
405  *
406  * @pre None.
407  * @post
408  * @see
409  * @remarks None.
410  *
411  * @par Sample Code:
412  * @code
413  * @endcode
414  */
415 DM_ERROR get_structdata(char *mo_full_path, GList ** pItems);
416
417 /**
418  * @par Description: API to get TNDS
419  *
420  *
421  * @par Purpose:
422  * @par Typical use case:
423  * @par Method of function operation:
424  * @par Important notes:
425  * @param[in]            contenttype                                    contenttype
426  * @param[in]           mo_full_path                                    mo full path
427  * @param[out]  stream_size                                     stream_size
428  * @return                      DM_OK                                                   success
429  *                                      DM_ERRORS                                       fail
430  *
431  * @par Errors:
432  *
433  * @pre None.
434  * @post
435  * @see
436  * @remarks None.
437  *
438  * @par Sample Code:
439  * @code
440  * @endcode
441  */
442 DM_ERROR get_tnds(char *contenttype, char *mo_full_path, char **tnds, unsigned int *stream_size);
443
444 /**
445  * @par Description: API to set_client_nextnonce
446  *
447  *
448  * @par Purpose:
449  * @par Typical use case:
450  * @par Method of function operation:
451  * @par Important notes:
452  *  @param[in]          server id
453  * @param[in]           next nonce
454  *
455  * @return                      DM_OK                                                   success
456  *                                      DM_ERRORS                                       fail
457  *
458  * @par Errors:
459  *
460  * @pre None.
461  * @post
462  * @see
463  * @remarks None.
464  *
465  * @par Sample Code:
466  * @code
467  * @endcode
468  */
469 DM_ERROR set_client_nextnonce(char *pServer_id, char *next_nonce);
470
471 /**
472  * @par Description: API to set_client_authtype
473  *
474  *
475  * @par Purpose:
476  * @par Typical use case:
477  * @par Method of function operation:
478  * @par Important notes:
479  * @param[in]           server id
480  * @param[in]           AuthType
481  *
482  * @return                      DM_OK                                                   success
483  *                                      DM_ERRORS                                       fail
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 set_client_authtype(char *pServer_id, AuthType auth_type);
497
498 /**
499  * @par Description: API to check_mo_scope
500  *
501  *
502  * @par Purpose:
503  * @par Typical use case:
504  * @par Method of function operation:
505  * @par Important notes:
506  * @param[in]           full_path
507  *
508  * @return                      DM_OK                                                   success
509  *                                      DM_ERRORS                                       fail
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 check_mo_scope(char *full_path);
523
524 /**
525  * @par Description: API to copy_itemtomo
526  *
527  *
528  * @par Purpose:
529  * @par Typical use case:
530  * @par Method of function operation:
531  * @par Important notes:
532  * @param[in]           item
533  *
534  * @return                      DM_OK                                                   success
535  *                                      DM_ERRORS                                       fail
536  *
537  * @par Errors:
538  *
539  * @pre None.
540  * @post
541  * @see
542  * @remarks None.
543  *
544  * @par Sample Code:
545  * @code
546  * @endcode
547  */
548 DM_ERROR copy_itemtomo(Item * item);
549
550 /**
551  * @par Description: API to copy_itemtomo
552  *
553  *
554  * @par Purpose:
555  * @par Typical use case:
556  * @par Method of function operation:
557  * @par Important notes:
558  * @param[in]           target url
559  * @param[in]           source url
560  *
561  * @return                      DM_OK                                                   success
562  *                                      DM_ERRORS                                       fail
563  *
564  * @par Errors:
565  *
566  * @pre None.
567  * @post
568  * @see
569  * @remarks None.
570  *
571  * @par Sample Code:
572  * @code
573  * @endcode
574  */
575 DM_ERROR copy_mo_data(char *target_url, char *source_url);
576
577 /**
578  * @par Description: API to copy_mo
579  *
580  *
581  * @par Purpose:
582  * @par Typical use case:
583  * @par Method of function operation:
584  * @par Important notes:
585  * @param[in]           source url
586  * @param[in]           target url
587  *
588  * @return                      DM_OK                                                   success
589  *                                      DM_ERRORS                                       fail
590  *
591  * @par Errors:
592  *
593  * @pre None.
594  * @post
595  * @see
596  * @remarks None.
597  *
598  * @par Sample Code:
599  * @code
600  * @endcode
601  */
602 DM_ERROR copy_mo(char *target_url, char *source_url);
603
604 /**
605  * @par Description: API to get Operation Type
606  *
607  *
608  * @par Purpose:
609  * @par Typical use case:
610  * @par Method of function operation:
611  * @par Important notes:
612  * @param[in]           mo_full_path                                    mo full path
613  * @param[out]          result_oper_type                                result oper type
614  *
615  * @return                      DM_OK                                                   success
616  *                                      DM_ERRORS                                       fail
617  *
618  * @par Errors:
619  *
620  * @pre None.
621  * @post
622  * @see
623  * @remarks None.
624  *
625  * @par Sample Code:
626  * @code
627  * @endcode
628  */
629 DM_ERROR get_mo_operationtype(char *full_path, char **result_oper_type);
630
631 /**
632  * @par Description: API to get_mo_node_format_contenttype
633  *
634  *
635  * @par Purpose:
636  * @par Typical use case:
637  * @par Method of function operation:
638  * @par Important notes:
639  * @param[in]   mo_full_path                            mo full path
640  * @param[in]   format                                          format
641  * @param[in]   contenttype                             contenttype
642  *
643  * @return                      DM_OK                                                   success
644  *                                      DM_ERRORS                                       fail
645  *
646  * @par Errors:
647  *
648  * @pre None.
649  * @post
650  * @see
651  * @remarks None.
652  *
653  * @par Sample Code:
654  * @code
655  * @endcode
656  */
657 DM_ERROR get_mo_node_format_contenttype(const char *mo_path, char **format, char **contenttype);
658
659 /**
660  * @par Description: API to get_mo_node_property
661  *
662  *
663  * @par Purpose:
664  * @par Typical use case:
665  * @par Method of function operation:
666  * @par Important notes:
667  * @param[in]   mo_full_path                            mo full path
668  * @param[in]   pr_type                                         pr_type
669  * @param[out]  property                                                property
670  *
671  * @return                      DM_OK                                                   success
672  *                                      DM_ERRORS                                       fail
673  *
674  * @par Errors:
675  *
676  * @pre None.
677  * @post
678  * @see
679  * @remarks None.
680  *
681  * @par Sample Code:
682  * @code
683  * @endcode
684  */
685 DM_ERROR get_mo_node_property(const char *mo_path, propoerty_type pr_type, char **property);
686
687 /*=================================================================
688  *                                                              FOR TEST
689  * =================================================================
690  */
691 /**
692  * @par Description: API to this code is temp code for test
693  *
694  *
695  * @par Purpose:
696  * @par Typical use case:
697  * @par Method of function operation:
698  * @par Important notes:
699  * @param[in]   mo_full_path                            mo full path
700  * @param[in]   acl                                                     acl
701  *
702  * @return                      DM_OK                                                   success
703  *                                      DM_ERRORS                                       fail
704  *
705  * @par Errors:
706  *
707  * @pre None.
708  * @post
709  * @see
710  * @remarks None.
711  *
712  * @par Sample Code:
713  * @code
714  * @endcode
715  */
716 DM_ERROR pre_define_mo();
717
718 #endif                          /* DM_MO_GENERATER_H_ */