Merge "Fix event of consumed ASR result to become success" into tizen
[platform/core/uifw/voice-control.git] / client / vc_mgr_client.h
1 /*
2 * Copyright (c) 2011-2015 Samsung Electronics Co., Ltd All Rights Reserved
3 *
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
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
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.
15 */
16
17
18 #ifndef __VC_MANAGER_CLIENT_H_
19 #define __VC_MANAGER_CLIENT_H_
20
21
22 #include "vc_info_parser.h"
23 #include "voice_control_manager.h"
24
25 #ifdef __cplusplus
26 extern "C" {
27 #endif
28
29 typedef enum {
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;
35
36 /*
37 * Common function
38 */
39 int vc_mgr_client_create(vc_h* vc);
40
41 int vc_mgr_client_destroy(vc_h vc);
42
43 bool vc_mgr_client_is_valid(vc_h vc);
44
45 bool vc_mgr_client_is_valid_by_uid(int uid);
46
47 int vc_mgr_client_get_handle(int uid, vc_h* vc);
48
49 int vc_mgr_client_get_pid(vc_h vc, int* pid);
50
51 /*
52 * set/get callback function
53 */
54 int vc_mgr_client_set_all_result_cb(vc_h vc, vc_mgr_all_result_cb callback, void* user_data);
55
56 int vc_mgr_client_get_all_result_cb(vc_h vc, vc_mgr_all_result_cb* callback, void** user_data);
57
58 int vc_mgr_client_set_result_cb(vc_h vc, vc_result_cb callback, void* user_data);
59
60 int vc_mgr_client_get_result_cb(vc_h vc, vc_result_cb* callback, void** user_data);
61
62 int vc_mgr_client_set_pre_result_cb(vc_h vc, vc_mgr_pre_result_cb callback, void* user_data);
63
64 int vc_mgr_client_get_pre_result_cb(vc_h vc, vc_mgr_pre_result_cb* callback, void** user_data);
65
66 int vc_mgr_client_set_service_state_changed_cb(vc_h vc, vc_service_state_changed_cb callback, void* user_data);
67
68 int vc_mgr_client_get_service_state_changed_cb(vc_h vc, vc_service_state_changed_cb* callback, void** user_data);
69
70 int vc_mgr_client_set_state_changed_cb(vc_h vc, vc_state_changed_cb callback, void* user_data);
71
72 int vc_mgr_client_get_state_changed_cb(vc_h vc, vc_state_changed_cb* callback, void** user_data);
73
74 int vc_mgr_client_set_speech_detected_cb(vc_h vc, vc_mgr_begin_speech_detected_cb callback, void* user_data);
75
76 int vc_mgr_client_get_speech_detected_cb(vc_h vc, vc_mgr_begin_speech_detected_cb* callback, void** user_data);
77
78 int vc_mgr_client_set_current_lang_changed_cb(vc_h vc, vc_current_language_changed_cb callback, void* user_data);
79
80 int vc_mgr_client_get_current_lang_changed_cb(vc_h vc, vc_current_language_changed_cb* callback, void** user_data);
81
82 int vc_mgr_client_set_error_cb(vc_h vc, vc_error_cb callback, void* user_data);
83
84 int vc_mgr_client_get_error_cb(vc_h vc, vc_error_cb* callback, void** user_data);
85
86 int vc_mgr_client_set_dialog_request_cb(vc_h vc, vc_mgr_dialog_request_cb callback, void* user_data);
87
88 int vc_mgr_client_get_dialog_request_cb(vc_h vc, vc_mgr_dialog_request_cb* callback, void** user_data);
89
90 int vc_mgr_client_set_private_data_set_cb(vc_h vc, vc_mgr_private_data_set_cb callback, void* user_data);
91
92 int vc_mgr_client_get_private_data_set_cb(vc_h vc, vc_mgr_private_data_set_cb* callback, void** user_data);
93
94 int vc_mgr_client_set_private_data_requested_cb(vc_h vc, vc_mgr_private_data_requested_cb callback, void* user_data);
95
96 int vc_mgr_client_get_private_data_requested_cb(vc_h vc, vc_mgr_private_data_requested_cb* callback, void** user_data);
97
98 /*
99 * set/get option
100 */
101 int vc_mgr_client_set_service_state(vc_h vc, vc_service_state_e state);
102
103 int vc_mgr_client_get_service_state(vc_h vc, vc_service_state_e* state);
104
105 int vc_mgr_client_set_internal_state(vc_h vc, vc_internal_state_e state);
106
107 int vc_mgr_client_get_internal_state(vc_h vc, vc_internal_state_e* state);
108
109 int vc_mgr_client_set_client_state(vc_h vc, vc_state_e state);
110
111 int vc_mgr_client_get_client_state(vc_h vc, vc_state_e* state);
112
113 int vc_mgr_client_get_client_state_by_uid(int uid, vc_state_e* state);
114
115 int vc_mgr_client_get_before_state(vc_h vc, vc_state_e* state, vc_state_e* before_state);
116
117 int vc_mgr_client_set_error(vc_h vc, int reason);
118
119 int vc_mgr_client_get_error(vc_h vc, int* reason);
120
121 int vc_mgr_client_set_error_message(vc_h vc, const char* err_msg);
122
123 int vc_mgr_client_get_error_message(vc_h vc, char** err_msg);
124
125 int vc_mgr_client_set_exclusive_command(vc_h vc, bool value);
126
127 bool vc_mgr_client_get_exclusive_command(vc_h vc);
128
129 int vc_mgr_client_set_all_result(vc_h vc, int event, const char* result_text);
130
131 int vc_mgr_client_get_all_result(vc_h vc, int* event, char** result_text);
132
133 int vc_mgr_client_unset_all_result(vc_h vc);
134
135 int vc_mgr_client_set_audio_type(vc_h vc, const char* audio_id);
136
137 int vc_mgr_client_get_audio_type(vc_h vc, char** audio_id);
138
139 int vc_mgr_client_set_recognition_mode(vc_h vc, vc_recognition_mode_e mode);
140
141 int vc_mgr_client_get_recognition_mode(vc_h vc, vc_recognition_mode_e* mode);
142
143 int vc_mgr_client_set_foreground(vc_h vc, int pid, bool value);
144
145 int vc_mgr_client_get_foreground(vc_h vc, int* pid);
146
147 /* utils */
148 int vc_mgr_client_get_count();
149
150 int vc_mgr_client_use_callback(vc_h vc);
151
152 int vc_mgr_client_not_use_callback(vc_h vc);
153
154 /* Authority */
155 int vc_mgr_client_add_authorized_client(vc_h vc, int pid);
156
157 int vc_mgr_client_remove_authorized_client(vc_h vc, int pid);
158
159 bool vc_mgr_client_is_authorized_client(vc_h vc, int pid);
160
161 int vc_mgr_client_set_valid_authorized_client(vc_h vc, int pid);
162
163 int vc_mgr_client_get_valid_authorized_client(vc_h vc, int* pid);
164
165 bool vc_mgr_client_is_valid_authorized_client(vc_h vc, int pid);
166
167 int vc_mgr_client_set_start_by_client(vc_h vc, bool option);
168
169 int vc_mgr_client_get_start_by_client(vc_h vc, bool* option);
170
171 #ifdef __cplusplus
172 }
173 #endif
174
175 #endif /* __VC_MANAGER_CLIENT_H_ */