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"
30 VC_INTERNAL_STATE_NONE = 0,
31 VC_INTERNAL_STATE_STARTING = 1,
32 VC_INTERNAL_STATE_STOPPING = 2,
33 VC_INTERNAL_STATE_CANCELING = 3
34 } vc_internal_state_e;
39 int vc_mgr_client_create(vc_h* vc);
41 int vc_mgr_client_destroy(vc_h vc);
43 bool vc_mgr_client_is_valid(vc_h vc);
45 bool vc_mgr_client_is_valid_by_uid(int uid);
47 int vc_mgr_client_get_handle(int uid, vc_h* vc);
49 int vc_mgr_client_get_pid(vc_h vc, int* pid);
52 * set/get callback function
54 int vc_mgr_client_set_all_result_cb(vc_h vc, vc_mgr_all_result_cb callback, void* user_data);
56 int vc_mgr_client_get_all_result_cb(vc_h vc, vc_mgr_all_result_cb* callback, void** user_data);
58 int vc_mgr_client_set_result_cb(vc_h vc, vc_result_cb callback, void* user_data);
60 int vc_mgr_client_get_result_cb(vc_h vc, vc_result_cb* callback, void** user_data);
62 int vc_mgr_client_set_pre_result_cb(vc_h vc, vc_mgr_pre_result_cb callback, void* user_data);
64 int vc_mgr_client_get_pre_result_cb(vc_h vc, vc_mgr_pre_result_cb* callback, void** user_data);
66 int vc_mgr_client_set_service_state_changed_cb(vc_h vc, vc_service_state_changed_cb callback, void* user_data);
68 int vc_mgr_client_get_service_state_changed_cb(vc_h vc, vc_service_state_changed_cb* callback, void** user_data);
70 int vc_mgr_client_set_state_changed_cb(vc_h vc, vc_state_changed_cb callback, void* user_data);
72 int vc_mgr_client_get_state_changed_cb(vc_h vc, vc_state_changed_cb* callback, void** user_data);
74 int vc_mgr_client_set_speech_detected_cb(vc_h vc, vc_mgr_begin_speech_detected_cb callback, void* user_data);
76 int vc_mgr_client_get_speech_detected_cb(vc_h vc, vc_mgr_begin_speech_detected_cb* callback, void** user_data);
78 int vc_mgr_client_set_current_lang_changed_cb(vc_h vc, vc_current_language_changed_cb callback, void* user_data);
80 int vc_mgr_client_get_current_lang_changed_cb(vc_h vc, vc_current_language_changed_cb* callback, void** user_data);
82 int vc_mgr_client_set_error_cb(vc_h vc, vc_error_cb callback, void* user_data);
84 int vc_mgr_client_get_error_cb(vc_h vc, vc_error_cb* callback, void** user_data);
86 int vc_mgr_client_set_dialog_request_cb(vc_h vc, vc_mgr_dialog_request_cb callback, void* user_data);
88 int vc_mgr_client_get_dialog_request_cb(vc_h vc, vc_mgr_dialog_request_cb* callback, void** user_data);
90 int vc_mgr_client_set_private_data_set_cb(vc_h vc, vc_mgr_private_data_set_cb callback, void* user_data);
92 int vc_mgr_client_get_private_data_set_cb(vc_h vc, vc_mgr_private_data_set_cb* callback, void** user_data);
94 int vc_mgr_client_set_private_data_requested_cb(vc_h vc, vc_mgr_private_data_requested_cb callback, void* user_data);
96 int vc_mgr_client_get_private_data_requested_cb(vc_h vc, vc_mgr_private_data_requested_cb* callback, void** user_data);
101 int vc_mgr_client_set_service_state(vc_h vc, vc_service_state_e state);
103 int vc_mgr_client_get_service_state(vc_h vc, vc_service_state_e* state);
105 int vc_mgr_client_set_internal_state(vc_h vc, vc_internal_state_e state);
107 int vc_mgr_client_get_internal_state(vc_h vc, vc_internal_state_e* state);
109 int vc_mgr_client_set_client_state(vc_h vc, vc_state_e state);
111 int vc_mgr_client_get_client_state(vc_h vc, vc_state_e* state);
113 int vc_mgr_client_get_client_state_by_uid(int uid, vc_state_e* state);
115 int vc_mgr_client_get_before_state(vc_h vc, vc_state_e* state, vc_state_e* before_state);
117 int vc_mgr_client_set_error(vc_h vc, int reason);
119 int vc_mgr_client_get_error(vc_h vc, int* reason);
121 int vc_mgr_client_set_error_message(vc_h vc, const char* err_msg);
123 int vc_mgr_client_get_error_message(vc_h vc, char** err_msg);
125 int vc_mgr_client_set_exclusive_command(vc_h vc, bool value);
127 bool vc_mgr_client_get_exclusive_command(vc_h vc);
129 int vc_mgr_client_set_all_result(vc_h vc, int event, const char* result_text);
131 int vc_mgr_client_get_all_result(vc_h vc, int* event, char** result_text);
133 int vc_mgr_client_unset_all_result(vc_h vc);
135 int vc_mgr_client_set_audio_type(vc_h vc, const char* audio_id);
137 int vc_mgr_client_get_audio_type(vc_h vc, char** audio_id);
139 int vc_mgr_client_set_recognition_mode(vc_h vc, vc_recognition_mode_e mode);
141 int vc_mgr_client_get_recognition_mode(vc_h vc, vc_recognition_mode_e* mode);
143 int vc_mgr_client_set_foreground(vc_h vc, int pid, bool value);
145 int vc_mgr_client_get_foreground(vc_h vc, int* pid);
148 int vc_mgr_client_get_count();
150 int vc_mgr_client_use_callback(vc_h vc);
152 int vc_mgr_client_not_use_callback(vc_h vc);
155 int vc_mgr_client_add_authorized_client(vc_h vc, int pid);
157 int vc_mgr_client_remove_authorized_client(vc_h vc, int pid);
159 bool vc_mgr_client_is_authorized_client(vc_h vc, int pid);
161 int vc_mgr_client_set_valid_authorized_client(vc_h vc, int pid);
163 int vc_mgr_client_get_valid_authorized_client(vc_h vc, int* pid);
165 bool vc_mgr_client_is_valid_authorized_client(vc_h vc, int pid);
167 int vc_mgr_client_set_start_by_client(vc_h vc, bool option);
169 int vc_mgr_client_get_start_by_client(vc_h vc, bool* option);
175 #endif /* __VC_MANAGER_CLIENT_H_ */