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.
19 * @oma_ds_protocol_binder.h
21 * @brief This file is the header file of interface of protocol binder
24 #ifndef OMA_DS_PROTOCOL_BINDER_H_
25 #define OMA_DS_PROTOCOL_BINDER_H_
27 #include <sync_agent.h>
28 #include "service-adapter/protocol-binder/oma_ds_protocol_binder_definition.h"
31 * @par Description: API to Initialize protocol binder function set
35 * @par Typical use case:
36 * @par Method of function operation:
37 * @par Important notes:
38 * @param[in] sync_agent_pb_protocol_binder_function_set_s structure
41 * @return sync_agent_pb_error_e type
54 sync_agent_pb_error_e init_oma_ds_1_2_binder_function_set(sync_agent_pb_protocol_binder_function_set_s ** binder_function_set);
57 * @par Description: API to free sync_agent_pb_protocol_binder_function_set_s structure
61 * @par Typical use case:
62 * @par Method of function operation:
63 * @par Important notes:
64 * @param[in] sync_agent_pb_protocol_binder_function_set_s structure
80 void free_oma_ds_1_2_binder_function_set(sync_agent_pb_protocol_binder_function_set_s * binder_function_set);
83 * @par Description: API to Initialize protocol binder
87 * @par Typical use case:
88 * @par Method of function operation:
89 * @par Important notes:
90 * @param[in] sync_agent_pb_protocol_binder_info_s structure
91 * @param[in] enum type, sync_agent_pb_encoding_e(SYNC_AGENT_PB_ENCODING_XML, SYNC_AGENT_PB_ENCODING_WBXML_10, SYNC_AGENT_PB_ENCODING_WBXML_11, SYNC_AGENT_PB_ENCODING_WBXML_12, SYNC_AGENT_PB_ENCODING_WBXML_13)
92 * @param[in] boolean type, whether encode xml header or not
93 * @param[in] boolean type, whether use string table or not
94 * @param[in] boolean type, whether protocol is anonymous or not
95 * @param[in] boolean type, whether use flow mode or not
96 * @param[in] boolean type, whether use textual public id or not
97 * @param[in] sync_agent_pb_protocol_binder_function_set_s structure
100 * @return sync_agent_pb_protocol_binder_info_s on success
114 sync_agent_pb_protocol_binder_info_s *oma_ds_1_2_binder_init(sync_agent_pb_protocol_binder_info_s * binder, sync_agent_pb_encoding_e enc, bool encode_xml_header,
115 bool use_strtbl, bool produce_anonymous, bool use_flow_mode, bool text_public_id, sync_agent_pb_protocol_binder_function_set_s * binder_function_set);
118 * @par Description: API to append specific element to WBXML tree
122 * @par Typical use case:
123 * @par Method of function operation:
124 * @par Important notes:
125 * @param[in] sync_agent_pb_protocol_binder_info_s structure
126 * @param[in] enum type, protocol element
127 * @param[in] content(structure to append)
130 * @return SYNC_AGENT_PB_RETURN_OK on success
144 sync_agent_pb_error_e oma_ds_1_2_binder_append(sync_agent_pb_protocol_binder_info_s * binder, oma_ds_protocol_element_e protocol_element, Content_Ptr content);
147 * @par Description: API to terminate sync_agent_pb_protocol_binder_info_s structure
151 * @par Typical use case:
152 * @par Method of function operation:
153 * @par Important notes:
154 * @param[in] sync_agent_pb_protocol_binder_info_s structure
170 void oma_ds_1_2_binder_terminate(sync_agent_pb_protocol_binder_info_s * binder);
173 * @par Description: API to get stream
177 * @par Typical use case:
178 * @par Method of function operation:
179 * @par Important notes:
180 * @param[in] sync_agent_pb_protocol_binder_info_s structure
181 * @param[out] string type, stream from WBXML tree
182 * @param[out] unsigned int type, size of stream
184 * @return SYNC_AGENT_PB_RETURN_OK on success
198 sync_agent_pb_error_e oma_ds_1_2_binder_get_stream(sync_agent_pb_protocol_binder_info_s * binder, char **byte_stream, unsigned int *byte_stream_size);
201 * @par Description: API to get stream size
205 * @par Typical use case:
206 * @par Method of function operation:
207 * @par Important notes:
208 * @param[in] sync_agent_pb_protocol_binder_info_s structure
209 * @param[out] unsigned int type, size of stream
211 * @return SYNC_AGENT_PB_RETURN_OK on success
225 sync_agent_pb_error_e oma_ds_1_2_binder_get_stream_size(sync_agent_pb_protocol_binder_info_s * binder, unsigned int *byte_stream_size);
228 * @par Description: API to get encoding type
232 * @par Typical use case:
233 * @par Method of function operation:
234 * @par Important notes:
235 * @param[in] sync_agent_pb_protocol_binder_info_s structure
236 * @param[out] enum type, sync_agent_pb_encoding_e(SYNC_AGENT_PB_ENCODING_XML, SYNC_AGENT_PB_ENCODING_WBXML_10, SYNC_AGENT_PB_ENCODING_WBXML_11, SYNC_AGENT_PB_ENCODING_WBXML_12, SYNC_AGENT_PB_ENCODING_WBXML_13)
238 * @return SYNC_AGENT_PB_RETURN_OK on success
252 sync_agent_pb_error_e oma_ds_1_2_binder_get_encoding(sync_agent_pb_protocol_binder_info_s * binder, sync_agent_pb_encoding_e * enc);
255 * @par Description: API to Initialize reverse protocol binder
259 * @par Typical use case:
260 * @par Method of function operation:
261 * @par Important notes:
262 * @param[in] string type, WBXML stream to parse
263 * @param[in] unsigned int type, size of stream
264 * @param[in] enum type, decoding(SYNC_AGENT_PB_DECODING_XML, SYNC_AGENT_PB_DECODING_WBXML)
265 * @param[in] user data
266 * @param[out] sync_agent_pb_protocol_binder_reverse_info_s structure
268 * @return SYNC_AGENT_PB_RETURN_OK on success
282 sync_agent_pb_error_e reverse_oma_ds_1_2_binder_init(char *byte_stream,
283 unsigned int byte_stream_len, sync_agent_pb_decoding_e dec, sync_agent_pb_protocol_binder_function_set_s * binder_function_set, void *user_data, sync_agent_pb_protocol_binder_reverse_info_s ** binder);
286 * @par Description: API to parse and get next contents
290 * @par Typical use case:
291 * @par Method of function operation:
292 * @par Important notes:
293 * @param[in] sync_agent_pb_protocol_binder_reverse_info_s structure
294 * @param[out] protocol element
295 * @param[out] string type, protocol element
296 * @param[out] parsed contents(defined structure)
298 * @return SYNC_AGENT_PB_RETURN_OK on success
312 sync_agent_pb_error_e reverse_oma_ds_1_2_binder_next(sync_agent_pb_protocol_binder_reverse_info_s * binder, Protocol_Element * protocol_element, char **protocol_element_name, Content_Ptr * content);
314 #endif /* OMA_DS_PROTOCOL_BINDER_H_ */