2 * Copyright (c) 2013 - 2017 Samsung Electronics Co., Ltd All Rights Reserved
4 * Licensed under the Apache License, Version 2.0 (the License);
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an AS IS BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
18 * @file data-control-provider.h
19 * @brief This is the header file for the data control provider.
22 #ifndef _APPFW_DATA_CONTROL_PROVIDER_H_
23 #define _APPFW_DATA_CONTROL_PROVIDER_H_
25 #include <data_control_types.h>
26 #include <data_control_provider.h>
33 * @brief Sends select result without selected data.
34 * @details This function is made for C# API. C# API has a different select flow. \n
35 * It will send select result after provider's select callback and \n
36 * do not get db handle for sending result to remove db dependancy. \n
37 * So, this function just send provider's select callback result and pass \n
38 * connected socket fd for sending selected data to consumer.
40 * @param[in] request_id The request ID
41 * @param[out] fd The socket fd
43 * @return @c 0 on success,
44 * otherwise a negative error value
46 * @retval #DATACONTROL_ERROR_NONE Successful
47 * @retval #DATACONTROL_ERROR_INVALID_PARAMETER Invalid parameter
48 * @retval #DATACONTROL_ERROR_IO_ERROR I/O error
49 * @retval #DATACONTROL_ERROR_OUT_OF_MEMORY Out of memory
51 int datacontrol_provider_send_select_result_without_data(int request_id, int *fd);
54 * @brief Writes data to socket.
55 * @details This function is made for C# API. C# API has a different select flow. \n
56 * It will send select result after provider's select callback and \n
57 * do not get db handle for sending result to remove db dependancy. \n
58 * So, C# API need native API which get buffer and send it to the consumer.
60 * @param[in] fd The socket fd
61 * @param[in] buffer The data for sending to the consumer application
62 * @param[in] nbytes The data size
63 * @param[out] bytes_write The data size of sent successfully to the consumer
65 * @return @c 0 on success,
66 * otherwise a negative error value
68 * @retval #DATACONTROL_ERROR_NONE Successful
69 * @retval #DATACONTROL_ERROR_IO_ERROR I/O error
71 int datacontrol_provider_write_socket(int fd, void *buffer, unsigned int nbytes,
72 unsigned int *bytes_write);
75 * @brief Gets select request page info.
76 * @details This function is made for C# API. C# API can control selected page in proivder's callback. \n
77 * This function provide request page info to the provider application so that provider application \n
78 * can manage which page should be sent to the consumer.
80 * @param[in] request_id The request ID
81 * @param[out] page_num The requested page number
82 * @param[out] count_per_page The requested count per page
84 * @return @c 0 on success,
85 * otherwise a negative error value
87 * @retval #DATACONTROL_ERROR_NONE Successful
88 * @retval #DATACONTROL_ERROR_INVALID_PARAMETER Invalid parameter
89 * @retval #DATACONTROL_ERROR_IO_ERROR I/O error
91 int datacontrol_provider_get_select_page_info(int request_id, int *page_num, int *count_per_page);
97 #endif /* _APPFW_DATA_CONTROL_PROVIDER_H_ */