3 * Copyright (c) 2012 Samsung Electronics Co., Ltd.
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
9 * http://www.apache.org/licenses/LICENSE-2.0
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.
18 #ifndef DM_MO_GENERATER_H_
19 #define DM_MO_GENERATER_H_
22 #include <sync_agent.h>
25 #include "common/dm_error.h"
26 #include "serviceadapter/sa_define.h"
27 #include "dm_mo_common.h"
30 * @par Description: API to clean mo db for reset or delete dm
34 * @par Typical use case:
35 * @par Method of function operation:
36 * @par Important notes:
38 * @return DM_OK success
52 DM_ERROR clean_dm_mo();
55 * @par Description: API to add item to mo with add cmd
59 * @par Typical use case:
60 * @par Method of function operation:
61 * @par Important notes:
63 * @param[in] server_id
65 * @return DM_OK success
79 DM_ERROR add_itemtomo(Item * item, char *server_id);
82 * @par Description: API to replace item to mo with replace cmd (update)
86 * @par Typical use case:
87 * @par Method of function operation:
88 * @par Important notes:
91 * @return DM_OK success
105 DM_ERROR replace_itemtomo(Item * item);
108 * @par Description: API to replace mo data
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
118 * @return DM_OK success
132 DM_ERROR replace_mo_data(char *mo_full_path, char *value);
135 * @par Description: API to replace mo acl property
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
145 * param[in] contenttype contenttype
146 * param[in] format format
147 * param[in] prop_type prop_type
150 * @return DM_OK success
164 DM_ERROR replace_mo_property(char *mo_full_path, char *value, char *acl, char *contenttype, char *format, GetType prop_type);
167 * @par Description: API to add mo
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
181 * @return DM_OK success
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);
198 * @par Description: API to delete item to mo
202 * @par Typical use case:
203 * @par Method of function operation:
204 * @par Important notes:
207 * @return DM_OK success
221 DM_ERROR delete_itemtomo(Item * item);
224 * @par Description: API to replace mo (update)
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
238 * @return DM_OK success
252 DM_ERROR replace_mo(char *mo_full_path, char *value, char *acl, char *contenttype, char *format, GetType prop_type);
255 * @par Description: API to delete mo
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
265 * @return DM_OK success
279 DM_ERROR delete_mo(char *mo_full_path);
282 * @par Description: API to get mo data
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
292 * @return DM_OK success
306 DM_ERROR get_mo_data(char *full_path, char **data);
309 * @par Description: API to get mo child list
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
319 * @return DM_OK success
333 DM_ERROR get_child_mo_list(char *mo_full_path, GList ** pItems);
336 * @par Description: API to get mo data
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
347 * @return DM_OK success
361 DM_ERROR get_type_mo_tree(char *mo_full_path, GetType * get_type, char **real_full_path);
364 * @par Description: API to get Struct
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
374 * @return DM_OK success
388 DM_ERROR get_struct(char *mo_full_path, GList ** pItems);
391 * @par Description: API to get StructData
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
401 * @return DM_OK success
415 DM_ERROR get_structdata(char *mo_full_path, GList ** pItems);
418 * @par Description: API to get TNDS
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
442 DM_ERROR get_tnds(char *contenttype, char *mo_full_path, char **tnds, unsigned int *stream_size);
445 * @par Description: API to set_client_nextnonce
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
455 * @return DM_OK success
469 DM_ERROR set_client_nextnonce(char *pServer_id, char *next_nonce);
472 * @par Description: API to set_client_authtype
476 * @par Typical use case:
477 * @par Method of function operation:
478 * @par Important notes:
479 * @param[in] server id
480 * @param[in] AuthType
482 * @return DM_OK success
496 DM_ERROR set_client_authtype(char *pServer_id, AuthType auth_type);
499 * @par Description: API to check_mo_scope
503 * @par Typical use case:
504 * @par Method of function operation:
505 * @par Important notes:
506 * @param[in] full_path
508 * @return DM_OK success
522 DM_ERROR check_mo_scope(char *full_path);
525 * @par Description: API to copy_itemtomo
529 * @par Typical use case:
530 * @par Method of function operation:
531 * @par Important notes:
534 * @return DM_OK success
548 DM_ERROR copy_itemtomo(Item * item);
551 * @par Description: API to copy_itemtomo
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
561 * @return DM_OK success
575 DM_ERROR copy_mo_data(char *target_url, char *source_url);
578 * @par Description: API to copy_mo
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
588 * @return DM_OK success
602 DM_ERROR copy_mo(char *target_url, char *source_url);
605 * @par Description: API to get Operation Type
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
615 * @return DM_OK success
629 DM_ERROR get_mo_operationtype(char *full_path, char **result_oper_type);
632 * @par Description: API to get_mo_node_format_contenttype
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
643 * @return DM_OK success
657 DM_ERROR get_mo_node_format_contenttype(const char *mo_path, char **format, char **contenttype);
660 * @par Description: API to get_mo_node_property
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
671 * @return DM_OK success
685 DM_ERROR get_mo_node_property(const char *mo_path, propoerty_type pr_type, char **property);
687 /*=================================================================
689 * =================================================================
692 * @par Description: API to this code is temp code for test
696 * @par Typical use case:
697 * @par Method of function operation:
698 * @par Important notes:
699 * @param[in] mo_full_path mo full path
702 * @return DM_OK success
716 DM_ERROR pre_define_mo();
718 #endif /* DM_MO_GENERATER_H_ */