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_MANAGER_CLIENT_H_
19 #define __VC_MANAGER_CLIENT_H_
22 #include "vc_info_parser.h"
23 #include "voice_control_manager.h"
24 #include "voice_control_manager_internal.h"
31 VC_INTERNAL_STATE_NONE = 0,
32 VC_INTERNAL_STATE_STARTING = 1,
33 VC_INTERNAL_STATE_STOPPING = 2,
34 VC_INTERNAL_STATE_CANCELING = 3
35 } vc_internal_state_e;
40 int vc_mgr_client_create(vc_h* vc);
42 int vc_mgr_client_destroy(vc_h vc);
44 bool vc_mgr_client_is_valid(vc_h vc);
46 bool vc_mgr_client_is_valid_by_uid(unsigned int uid);
48 int vc_mgr_client_get_handle(unsigned int uid, vc_h* vc);
50 int vc_mgr_client_get_pid(vc_h vc, int* pid);
53 * set/get callback function
55 int vc_mgr_client_set_all_result_cb(vc_h vc, vc_mgr_all_result_cb callback, void* user_data);
57 int vc_mgr_client_get_all_result_cb(vc_h vc, vc_mgr_all_result_cb* callback, void** user_data);
59 int vc_mgr_client_set_result_cb(vc_h vc, vc_result_cb callback, void* user_data);
61 int vc_mgr_client_get_result_cb(vc_h vc, vc_result_cb* callback, void** user_data);
63 int vc_mgr_client_set_pre_result_cb(vc_h vc, vc_mgr_pre_result_cb callback, void* user_data);
65 int vc_mgr_client_get_pre_result_cb(vc_h vc, vc_mgr_pre_result_cb* callback, void** user_data);
67 int vc_mgr_client_set_service_state_changed_cb(vc_h vc, vc_service_state_changed_cb callback, void* user_data);
69 int vc_mgr_client_get_service_state_changed_cb(vc_h vc, vc_service_state_changed_cb* callback, void** user_data);
71 int vc_mgr_client_set_state_changed_cb(vc_h vc, vc_state_changed_cb callback, void* user_data);
73 int vc_mgr_client_get_state_changed_cb(vc_h vc, vc_state_changed_cb* callback, void** user_data);
75 int vc_mgr_client_set_speech_detected_cb(vc_h vc, vc_mgr_begin_speech_detected_cb callback, void* user_data);
77 int vc_mgr_client_get_speech_detected_cb(vc_h vc, vc_mgr_begin_speech_detected_cb* callback, void** user_data);
79 int vc_mgr_client_set_current_lang_changed_cb(vc_h vc, vc_current_language_changed_cb callback, void* user_data);
81 int vc_mgr_client_get_current_lang_changed_cb(vc_h vc, vc_current_language_changed_cb* callback, void** user_data);
83 int vc_mgr_client_set_error_cb(vc_h vc, vc_error_cb callback, void* user_data);
85 int vc_mgr_client_get_error_cb(vc_h vc, vc_error_cb* callback, void** user_data);
87 int vc_mgr_client_set_dialog_request_cb(vc_h vc, vc_mgr_dialog_request_cb callback, void* user_data);
89 int vc_mgr_client_get_dialog_request_cb(vc_h vc, vc_mgr_dialog_request_cb* callback, void** user_data);
91 int vc_mgr_client_set_private_data_set_cb(vc_h vc, vc_mgr_private_data_set_cb callback, void* user_data);
93 int vc_mgr_client_get_private_data_set_cb(vc_h vc, vc_mgr_private_data_set_cb* callback, void** user_data);
95 int vc_mgr_client_set_private_data_requested_cb(vc_h vc, vc_mgr_private_data_requested_cb callback, void* user_data);
97 int vc_mgr_client_get_private_data_requested_cb(vc_h vc, vc_mgr_private_data_requested_cb* callback, void** user_data);
99 int vc_mgr_client_set_specific_engine_result_cb(vc_h vc, vc_mgr_specific_engine_result_cb callback, void* user_data);
101 int vc_mgr_client_get_specific_engine_result_cb(vc_h vc, vc_mgr_specific_engine_result_cb* callback, void** user_data);
103 int vc_mgr_client_set_feedback_audio_format_cb(vc_h vc, vc_mgr_feedback_audio_format_cb callback, void* user_data);
105 int vc_mgr_client_get_feedback_audio_format_cb(vc_h vc, vc_mgr_feedback_audio_format_cb* callback, void** user_data);
107 int vc_mgr_client_set_feedback_streaming_cb(vc_h vc, vc_mgr_feedback_streaming_cb callback, void* user_data);
109 int vc_mgr_client_get_feedback_streaming_cb(vc_h vc, vc_mgr_feedback_streaming_cb* callback, void** user_data);
111 int vc_mgr_client_set_vc_tts_streaming_cb(vc_h vc, vc_mgr_vc_tts_streaming_cb callback, void* user_data);
113 int vc_mgr_client_get_vc_tts_streaming_cb(vc_h vc, vc_mgr_vc_tts_streaming_cb* callback, void** user_data);
118 int vc_mgr_client_set_service_state(vc_h vc, vc_service_state_e state);
120 int vc_mgr_client_get_service_state(vc_h vc, vc_service_state_e* state);
122 int vc_mgr_client_set_internal_state(vc_h vc, vc_internal_state_e state);
124 int vc_mgr_client_get_internal_state(vc_h vc, vc_internal_state_e* state);
126 int vc_mgr_client_set_client_state(vc_h vc, vc_state_e state);
128 int vc_mgr_client_get_client_state(vc_h vc, vc_state_e* state);
130 int vc_mgr_client_get_client_state_by_uid(unsigned int uid, vc_state_e* state);
132 int vc_mgr_client_get_previous_state(vc_h vc, vc_state_e* state, vc_state_e* previous_state);
134 int vc_mgr_client_set_error(vc_h vc, int reason);
136 int vc_mgr_client_get_error(vc_h vc, int* reason);
138 int vc_mgr_client_set_error_message(vc_h vc, const char* err_msg);
140 int vc_mgr_client_get_error_message(vc_h vc, char** err_msg);
142 int vc_mgr_client_enable_command_type(vc_h vc, vc_cmd_type_e cmd_type);
144 int vc_mgr_client_disable_command_type(vc_h vc, vc_cmd_type_e cmd_type);
146 int vc_mgr_client_get_disabled_command_type(vc_h vc, int* disabled_cmd_type);
148 int vc_mgr_client_set_exclusive_command(vc_h vc, bool value);
150 bool vc_mgr_client_get_exclusive_command(vc_h vc);
152 int vc_mgr_client_set_all_result(vc_h vc, int event, const char* result_text);
154 int vc_mgr_client_get_all_result(vc_h vc, int* event, char** result_text);
156 int vc_mgr_client_unset_all_result(vc_h vc);
158 int vc_mgr_client_set_audio_type(vc_h vc, const char* audio_id);
160 int vc_mgr_client_get_audio_type(vc_h vc, char** audio_id);
162 int vc_mgr_client_set_recognition_mode(vc_h vc, vc_recognition_mode_e mode);
164 int vc_mgr_client_get_recognition_mode(vc_h vc, vc_recognition_mode_e* mode);
166 int vc_mgr_client_set_foreground(vc_h vc, int pid, bool value);
168 int vc_mgr_client_get_foreground(vc_h vc, int* pid);
170 int vc_mgr_client_set_multi_assistant(vc_h vc, bool use_multi_assistant);
172 int vc_mgr_client_get_multi_assistant(vc_h vc, bool* use_multi_assistant);
176 int vc_mgr_client_get_count();
178 int vc_mgr_client_use_callback(vc_h vc);
180 int vc_mgr_client_not_use_callback(vc_h vc);
183 int vc_mgr_client_add_authorized_client(vc_h vc, int pid);
185 int vc_mgr_client_remove_authorized_client(vc_h vc, int pid);
187 bool vc_mgr_client_is_authorized_client(vc_h vc, int pid);
189 int vc_mgr_client_set_valid_authorized_client(vc_h vc, int pid);
191 int vc_mgr_client_get_valid_authorized_client(vc_h vc, int* pid);
193 bool vc_mgr_client_is_valid_authorized_client(vc_h vc, int pid);
195 int vc_mgr_client_set_start_by_client(vc_h vc, bool option);
197 int vc_mgr_client_get_start_by_client(vc_h vc, bool* option);
199 /* multi assistant */
200 int vc_mgr_client_set_audio_streaming_mode(vc_h vc, vc_audio_streaming_mode_e streaming_mode);
202 int vc_mgr_client_get_audio_streaming_mode(vc_h vc, vc_audio_streaming_mode_e* streaming_mode);
209 #endif /* __VC_MANAGER_CLIENT_H_ */