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 __VC_WIDGET_CLIENT_H_
19 #define __VC_WIDGET_CLIENT_H_
21 #include "voice_control_common.h"
22 #include "voice_control_internal.h"
23 #include "voice_control_widget.h"
33 unsigned int uid; /*<< unique id = pid + handle */
34 int xid; /*<< main Wayland window id */
36 vc_result_cb result_cb;
37 void* result_user_data;
38 vc_asr_result_cb asr_result_cb;
39 void* asr_result_user_data;
40 bool asr_result_enabled;
42 void* error_user_data;
43 vc_service_state_changed_cb service_state_changed_cb;
44 void* service_state_changed_user_data;
45 vc_state_changed_cb state_changed_cb;
46 void* state_changed_user_data;
47 vc_widget_show_tooltip_cb show_tooltip_cb;
48 void* show_tooltip_user_data;
49 vc_current_language_changed_cb current_lang_changed_cb;
50 void* current_lang_changed_user_data;
52 vc_widget_send_current_command_list_cb send_command_list_cb;
53 void* send_command_list_user_data;
59 vc_service_state_e service_state;
62 vc_state_e previous_state;
63 vc_state_e current_state;
65 Ecore_Timer* conn_timer;
77 int vc_widget_client_create(vc_h* vc);
79 int vc_widget_client_destroy(vc_h vc);
81 bool vc_widget_client_is_valid(vc_h vc);
83 bool vc_widget_client_is_valid_by_uid(unsigned int uid);
85 int vc_widget_client_get_handle(unsigned int uid, vc_h* vc);
87 vc_widget_s* widget_get(vc_h vc);
89 GSList* vc_widget_client_get_client_list();
92 * set/get callback function
94 int vc_widget_client_set_result_cb(vc_h vc, vc_result_cb callback, void* user_data);
96 int vc_widget_client_get_result_cb(vc_h vc, vc_result_cb* callback, void** user_data);
98 int vc_widget_client_set_asr_result_cb(vc_h vc, vc_asr_result_cb callback, void* user_data);
100 int vc_widget_client_get_asr_result_cb(vc_h vc, vc_asr_result_cb* callback, void** user_data);
102 int vc_widget_client_set_service_state_changed_cb(vc_h vc, vc_service_state_changed_cb callback, void* user_data);
104 int vc_widget_client_get_service_state_changed_cb(vc_h vc, vc_service_state_changed_cb* callback, void** user_data);
106 int vc_widget_client_set_state_changed_cb(vc_h vc, vc_state_changed_cb callback, void* user_data);
108 int vc_widget_client_get_state_changed_cb(vc_h vc, vc_state_changed_cb* callback, void** user_data);
110 int vc_widget_client_set_show_tooltip_cb(vc_h vc, vc_widget_show_tooltip_cb callback, void* user_data);
112 int vc_widget_client_get_show_tooltip_cb(vc_h vc, vc_widget_show_tooltip_cb* callback, void** user_data);
114 int vc_widget_client_set_current_lang_changed_cb(vc_h vc, vc_current_language_changed_cb callback, void* user_data);
116 int vc_widget_client_get_current_lang_changed_cb(vc_h vc, vc_current_language_changed_cb* callback, void** user_data);
118 int vc_widget_client_set_error_cb(vc_h vc, vc_error_cb callback, void* user_data);
120 int vc_widget_client_get_error_cb(vc_h vc, vc_error_cb* callback, void** user_data);
122 int vc_widget_client_set_send_command_list_cb(vc_h vc, vc_widget_send_current_command_list_cb callback, void* user_data);
124 int vc_widget_client_get_send_command_list_cb(vc_h vc, vc_widget_send_current_command_list_cb* callback, void** user_data);
131 int vc_widget_client_set_service_state(vc_h vc, vc_service_state_e state);
133 int vc_widget_client_get_service_state(vc_h vc, vc_service_state_e* state);
135 int vc_widget_client_set_state(vc_h vc, vc_state_e state);
137 int vc_widget_client_get_state(vc_h vc, vc_state_e* state);
139 int vc_widget_client_get_state_by_uid(unsigned int uid, vc_state_e* state);
141 int vc_widget_client_get_previous_state(vc_h vc, vc_state_e* state, vc_state_e* previous_state);
143 int vc_widget_client_set_xid(vc_h vc, int xid);
145 int vc_widget_cilent_get_xid(vc_h vc, int* xid);
147 int vc_widget_client_set_error(vc_h vc, int reason);
149 int vc_widget_client_get_error(vc_h vc, int* reason);
151 int vc_widget_client_set_show_tooltip(vc_h vc, bool show);
153 int vc_widget_client_get_show_tooltip(vc_h vc, bool* show);
155 int vc_widget_client_set_asr_result_enabled(vc_h vc, bool enabled);
157 int vc_widget_client_get_asr_result_enabled(vc_h vc, bool* enabled);
161 int vc_widget_client_get_count();
163 int vc_widget_client_use_callback(vc_h vc);
165 int vc_widget_client_not_use_callback(vc_h vc);
172 #endif /* __VC_WIDGET_CLIENT_H_ */