4 * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
6 * Contact: JuHak Park <juhaki.park@samsung.com>,
7 * JuneHyuk Lee <junhyuk7.lee@samsung.com>,
8 * SunBong Ha <sunbong.ha@samsung.com>
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
14 * http://www.apache.org/licenses/LICENSE-2.0
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.
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.
34 * SeongWon Shim <seongwon.shim@samsung.com>
38 * @oma_ds_protocol_binder.h
40 * @brief This file is the header file of interface of protocol binder
43 #ifndef OMA_DS_PROTOCOL_BINDER_H_
44 #define OMA_DS_PROTOCOL_BINDER_H_
46 #include "agent-framework/NetworkAssistant/protocol_binder/protocol_binder_common.h"
47 #include "ServiceAdapter/ProtocolBinder/oma_ds_protocol_binder_definition.h"
50 * @par Description: API to Initialize protocol binder function set
54 * @par Typical use case:
55 * @par Method of function operation:
56 * @par Important notes:
57 * @param[in] Binder_function_set structure
60 * @return PROTOCOL_BINDER_ERROR type
73 PROTOCOL_BINDER_ERROR init_oma_ds_1_2_binder_function_set(Binder_function_set **pBinder_function_set);
76 * @par Description: API to free Binder_function_set structure
80 * @par Typical use case:
81 * @par Method of function operation:
82 * @par Important notes:
83 * @param[in] Binder_function_set structure
99 void free_oma_ds_1_2_binder_function_set(Binder_function_set *pBinder_function_set);
102 * @par Description: API to Initialize protocol binder
106 * @par Typical use case:
107 * @par Method of function operation:
108 * @par Important notes:
109 * @param[in] protocol_binder structure
110 * @param[in] enum type, Encoding(ENCODING_XML, ENCODING_WBXML_10, ENCODING_WBXML_11, ENCODING_WBXML_12, ENCODING_WBXML_13)
111 * @param[in] boolean type, whether encode xml header or not
112 * @param[in] boolean type, whether use string table or not
113 * @param[in] boolean type, whether protocol is anonymous or not
114 * @param[in] boolean type, whether use flow mode or not
115 * @param[in] Binder_function_set structure
118 * @return protocol_binder on success
132 protocol_binder *oma_ds_1_2_binder_init(protocol_binder *pBinder, Encoding enc, bool encode_xml_header,
133 bool use_strtbl, bool produce_anonymous, bool use_flow_mode, Binder_function_set *pBinder_function_set);
136 * @par Description: API to append specific element to WBXML tree
140 * @par Typical use case:
141 * @par Method of function operation:
142 * @par Important notes:
143 * @param[in] protocol_binder structure
144 * @param[in] enum type, protocol element
145 * @param[in] content(structure to append)
148 * @return PROTOCOL_BINDER_OK on success
162 PROTOCOL_BINDER_ERROR oma_ds_1_2_binder_append(protocol_binder *pBinder, OMA_DS_Protocol_Element protocol_element, Content_Ptr pContent);
166 * @par Description: API to terminate protocol_binder structure
170 * @par Typical use case:
171 * @par Method of function operation:
172 * @par Important notes:
173 * @param[in] protocol_binder structure
189 void oma_ds_1_2_binder_terminate(protocol_binder *pBinder);
192 * @par Description: API to get stream
196 * @par Typical use case:
197 * @par Method of function operation:
198 * @par Important notes:
199 * @param[in] protocol_binder structure
200 * @param[out] string type, stream from WBXML tree
201 * @param[out] unsigned int type, size of stream
203 * @return PROTOCOL_BINDER_OK on success
217 PROTOCOL_BINDER_ERROR oma_ds_1_2_binder_get_stream(protocol_binder *pBinder, char **byte_stream, unsigned int *byte_stream_size);
220 * @par Description: API to get stream size
224 * @par Typical use case:
225 * @par Method of function operation:
226 * @par Important notes:
227 * @param[in] protocol_binder structure
228 * @param[out] unsigned int type, size of stream
230 * @return PROTOCOL_BINDER_OK on success
244 PROTOCOL_BINDER_ERROR oma_ds_1_2_binder_get_stream_size(protocol_binder *pBinder, unsigned int *byte_stream_size);
247 * @par Description: API to get encoding type
251 * @par Typical use case:
252 * @par Method of function operation:
253 * @par Important notes:
254 * @param[in] protocol_binder structure
255 * @param[out] enum type, Encoding(ENCODING_XML, ENCODING_WBXML_10, ENCODING_WBXML_11, ENCODING_WBXML_12, ENCODING_WBXML_13)
257 * @return PROTOCOL_BINDER_OK on success
271 PROTOCOL_BINDER_ERROR oma_ds_1_2_binder_get_encoding(protocol_binder *pBinder, Encoding *enc);
274 * @par Description: API to Initialize reverse protocol binder
278 * @par Typical use case:
279 * @par Method of function operation:
280 * @par Important notes:
281 * @param[in] string type, WBXML stream to parse
282 * @param[in] unsigned int type, size of stream
283 * @param[in] enum type, decoding(DECODING_XML, DECODING_WBXML)
284 * @param[in] user data
285 * @param[out] Reverse_protocol_binder structure
287 * @return PROTOCOL_BINDER_OK on success
301 PROTOCOL_BINDER_ERROR reverse_oma_ds_1_2_binder_init(char *byte_stream,
302 unsigned int byte_stream_len,
304 Binder_function_set *pBinder_function_set,
306 Reverse_protocol_binder **ppBinder);
310 * @par Description: API to parse and get next contents
314 * @par Typical use case:
315 * @par Method of function operation:
316 * @par Important notes:
317 * @param[in] Reverse_protocol_binder structure
318 * @param[out] protocol element
319 * @param[out] string type, protocol element
320 * @param[out] parsed contents(defined structure)
322 * @return PROTOCOL_BINDER_OK on success
336 PROTOCOL_BINDER_ERROR reverse_oma_ds_1_2_binder_next(Reverse_protocol_binder *pBinder,
337 Protocol_Element *protocol_element,
338 char **protocol_element_name,
339 Content_Ptr *pContent);
342 #endif /* OMA_DS_PROTOCOL_BINDER_H_ */