2 * Copyright (c) 2011-2015 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 #ifndef __VCD_CLIENT_DATA_H_
19 #define __VCD_CLIENT_DATA_H_
22 #include "vc_command.h"
23 #include "vc_info_parser.h"
25 #include "vcd_setting_stub.h"
26 #include "vcd_mgr_stub.h"
27 #include "vcd_mgr_proxy.h"
28 #include "vcd_widget_stub.h"
29 #include "vcd_widget_proxy.h"
45 /* Foreground application */
48 GSList* foreground_cmds;
50 /* Manager application */
52 GSList* exclusive_system_cmds;
53 GSList* system_background_cmds;
55 /* Other applications */
57 GSList* background_cmds;
58 } current_commands_list_s;
65 bool exclusive_cmd_option;
71 bool asr_result_enabled;
76 rpc_port_stub_vcd_stub_vc_notify_cb_h notify_cb;
77 void* notify_cb_user_data;
78 rpc_port_stub_vcd_stub_vc_feedback_cb_h feedback_cb;
79 void* feedback_cb_user_data;
83 rpc_port_stub_vcd_mgr_stub_vc_mgr_notify_cb_h notify_cb;
84 void* notify_cb_user_data;
85 rpc_port_stub_vcd_mgr_stub_vc_mgr_send_buffer_cb_h send_buffer_cb;
86 void* send_buffer_cb_user_data;
89 bool connection_requesting;
91 rpc_port_proxy_vcd_mgr_proxy_vcd_mgr_h rpc_h;
92 } manager_tidl_info_s;
97 rpc_port_stub_vcd_widget_stub_vc_widget_notify_cb_h notify_cb;
98 void* notify_cb_user_data;
101 bool connection_requesting;
103 rpc_port_proxy_vcd_widget_proxy_vcd_widget_h rpc_h;
104 } widget_tidl_info_s;
108 rpc_port_stub_vcd_setting_stub_vc_setting_notify_cb_h notify_cb;
109 void* notify_cb_user_data;
110 } setting_tidl_info_s;
114 VCD_RECOGNITION_MODE_STOP_BY_SILENCE, /**< Default mode */
115 VCD_RECOGNITION_MODE_RESTART_AFTER_REJECT, /**< Restart recognition after rejected result */
116 VCD_RECOGNITION_MODE_RESTART_CONTINUOUSLY, /**< Continuously restart recognition - not support yet*/
117 VCD_RECOGNITION_MODE_MANUAL /**< Start and stop manually without silence */
118 } vcd_recognition_mode_e;
124 typedef bool (* client_foreach_command_cb)(int id, int type, int format, const char* command, const char* param, int domain, void* user_data);
126 int vcd_client_command_collect_command();
128 int vcd_client_get_length();
130 int vcd_client_foreach_command(client_foreach_command_cb callback, void* user_data);
132 int vcd_client_get_cmd_from_result_id(int result_id, vc_cmd_s** result);
134 int vcd_client_get_cmd_info_from_result_id(int result_id, int* pid, int* cmd_type, vc_cmd_s** result);
136 int vcd_client_set_slience_detection(bool value);
138 bool vcd_client_get_slience_detection();
140 int vcd_client_set_recognition_mode(vcd_recognition_mode_e mode);
142 vcd_recognition_mode_e vcd_client_get_recognition_mode();
144 int vcd_client_append_cmd_from_type(int type, vc_cmd_list_h list);
149 int vcd_client_manager_set(int pid);
151 int vcd_client_manager_unset();
153 int vcd_client_manager_unset_appid();
155 bool vcd_client_manager_is_valid(int pid);
157 int vcd_client_manager_set_command(int pid);
159 int vcd_client_manager_unset_command(int pid);
161 int vcd_client_manager_set_demandable_client(int pid, GSList* client_list);
163 bool vcd_client_manager_check_demandable_client(int pid);
165 bool vcd_client_manager_get_exclusive();
167 int vcd_client_manager_set_exclusive(bool value);
169 int vcd_client_manager_get_pid();
171 int vcd_client_manager_get_appid(char** appid);
173 int vcd_client_manager_set_result_text(const char* result);
175 char* vcd_client_manager_get_result_text();
177 bool vcd_client_manager_is_system_command_valid(int pid);
179 int vcd_client_manager_create_tidl_info();
181 int vcd_client_manager_set_tidl_notify_cb(rpc_port_stub_vcd_mgr_stub_vc_mgr_notify_cb_h callback, void* user_data);
183 int vcd_client_manager_unset_tidl_notify_cb();
185 int vcd_client_manager_set_tidl_send_buffer_cb(rpc_port_stub_vcd_mgr_stub_vc_mgr_send_buffer_cb_h callback, void* user_data);
187 int vcd_client_manager_unset_tidl_send_buffer_cb();
189 int vcd_client_manager_delete_tidl_info();
191 manager_tidl_info_s* vcd_client_manager_get_tidl_info();
196 int vcd_client_add(int pid);
198 int vcd_client_delete(int pid);
200 int vcd_client_add_tidl_info(int pid);
202 int vcd_client_set_tidl_notify_cb(int pid, rpc_port_stub_vcd_stub_vc_notify_cb_h callback, void* user_data);
204 int vcd_client_unset_tidl_notify_cb(int pid);
206 int vcd_client_set_tidl_feedback_cb(int pid, rpc_port_stub_vcd_stub_vc_feedback_cb_h callback, void* user_data);
208 int vcd_client_unset_tidl_feedback_cb(int pid);
210 int vcd_client_delete_tidl_info(int pid);
212 client_tidl_info_s* vcd_client_get_tidl_info(int pid);
214 int vcd_client_get_tidl_list(int** pids, int* pid_count);
216 bool vcd_client_is_available(int pid);
218 int vcd_client_get_ref_count();
220 int vcd_client_get_list(int** pids, int* pid_count);
222 int vcd_client_set_command_type(int pid, int type);
224 int vcd_client_unset_command_type(int pid, int type);
226 int vcd_client_set_exclusive_command(int pid);
228 int vcd_client_unset_exclusive_command(int pid);
230 int vcd_client_save_client_info();
232 void vcd_client_update_foreground_pid();
234 int vcd_client_set_server_dialog(int pid, bool is_server_dialog);
236 int vcd_client_get_server_dialog(int pid, bool* is_server_dialog);
241 int vcd_client_widget_get_list(int** pids, int* pid_count);
243 int vcd_client_widget_add(int pid);
245 int vcd_client_widget_delete(int pid);
247 bool vcd_client_widget_is_available(int pid);
249 int vcd_client_widget_get_foreground_pid();
251 int vcd_client_widget_set_command(int pid);
253 int vcd_client_widget_unset_command(int pid);
255 int vcd_client_widget_set_asr_result_enabled(int pid, bool enable);
257 int vcd_client_widget_get_asr_result_enabled(int pid, bool* enable);
259 int vcd_client_widget_set_waiting_for_recording(int pid, bool waiting);
261 int vcd_client_widget_get_waiting_for_recording(int pid, bool* waiting);
263 int vcd_client_widget_add_tidl_info(int pid);
265 int vcd_client_widget_set_tidl_notify_cb(int pid, rpc_port_stub_vcd_widget_stub_vc_widget_notify_cb_h callback, void* user_data);
267 int vcd_client_widget_unset_tidl_notify_cb(int pid);
269 int vcd_client_widget_delete_tidl_info(int pid);
271 widget_tidl_info_s* vcd_client_widget_get_tidl_info(int pid);
273 GSList* vcd_client_widget_get_tidl_info_list();
278 int vcd_client_setting_add_tidl_info(int pid);
280 int vcd_client_setting_set_tidl_notify_cb(int pid, rpc_port_stub_vcd_setting_stub_vc_setting_notify_cb_h callback, void* user_data);
282 int vcd_client_setting_unset_tidl_notify_cb(int pid);
284 int vcd_client_setting_delete_tidl_info(int pid);
286 setting_tidl_info_s* vcd_client_setting_get_tidl_info(int pid);
288 int vcd_client_setting_get_tidl_list(int** pids, int* pid_count);
294 #endif /* __VCD_CLIENT_DATA_H_ */