Fix spelling errata
[platform/core/uifw/voice-control.git] / include / voice_control_manager.h
1 /*
2 * Copyright (c) 2011-2018 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 __VOICE_CONTROL_MANAGER_H__
19 #define __VOICE_CONTROL_MANAGER_H__
20
21 #include <voice_control_command.h>
22 #include <voice_control_common.h>
23
24 /**
25  * @addtogroup CAPI_UIX_VOICE_CONTROL_MANAGER_MODULE
26  * @{
27  */
28
29 #ifdef __cplusplus
30 extern "C"
31 {
32 #endif
33
34
35 /**
36  * @brief Definition of Bluetooth audio-in type.
37  * @since_tizen 5.0
38  */
39 #define VC_AUDIO_TYPE_BLUETOOTH         "VC_AUDIO_ID_BLUETOOTH"         /**< Bluetooth audio type */
40
41 /**
42  * @brief Definition of Wi-Fi audio-in type.
43  * @since_tizen 5.0
44  */
45 #define VC_AUDIO_TYPE_WIFI              "VC_AUDIO_ID_WIFI"              /**< Wi-Fi audio type */
46
47 /**
48  * @brief Definition for foreground command type.
49  * @since_tizen 5.0
50  */
51 #define VC_COMMAND_TYPE_FOREGROUND      1
52
53 /**
54  * @brief Definition for background command type.
55  * @since_tizen 5.0
56  */
57 #define VC_COMMAND_TYPE_BACKGROUND      2
58
59 /**
60  * @brief Definition for widget command type.
61  * @since_tizen 5.0
62  */
63 #define VC_COMMAND_TYPE_WIDGET          3
64
65 /**
66  * @brief Definition for system command type.
67  * @since_tizen 5.0
68  */
69 #define VC_COMMAND_TYPE_SYSTEM          4
70
71 /**
72  * @brief Definition for system background command type.
73  * @since_tizen 5.0
74  */
75 #define VC_COMMAND_TYPE_SYSTEM_BACKGROUND       5
76
77 /**
78  * @brief Definition for exclusive command type.
79  * @since_tizen 5.0
80  */
81 #define VC_COMMAND_TYPE_EXCLUSIVE       6
82
83 /**
84  * @brief Definition for none message.
85  * @since_tizen 5.0
86  */
87 #define VC_RESULT_MESSAGE_NONE                  "vc.result.message.none"
88
89 /**
90  * @brief Definition for failed recognition because the speech is too loud to listen.
91  * @since_tizen 5.0
92  */
93 #define VC_RESULT_MESSAGE_ERROR_TOO_LOUD        "vc.result.message.error.too.loud"
94
95 /**
96  * @brief Enumeration of recognition mode.
97  * @since_tizen 5.0
98  */
99 typedef enum {
100         VC_RECOGNITION_MODE_STOP_BY_SILENCE,            /**< Default mode */
101         VC_RECOGNITION_MODE_RESTART_AFTER_REJECT,       /**< Restart recognition after rejected result */
102         VC_RECOGNITION_MODE_RESTART_CONTINUOUSLY,       /**< Continuously restart recognition - not support yet*/
103         VC_RECOGNITION_MODE_MANUAL                                      /**< Start and stop manually without silence */
104 } vc_recognition_mode_e;
105
106 /**
107  * @brief Enumeration of send event type.
108  * @since_tizen 5.0
109  */
110 typedef enum {
111         VC_SEND_EVENT_TYPE_TEXT,                        /**< Send text event to VC engine */
112         VC_SEND_EVENT_TYPE_LIST_EVENT,          /**< Send list event to VC engine */
113         VC_SEND_EVENT_TYPE_HAPTIC_EVENT         /**< Send haptic event to VC engine */
114 } vc_send_event_type_e;
115
116 /**
117  * @brief Enumeration of pre result event.
118  * @since_tizen 5.0
119  */
120 typedef enum {
121         VC_PRE_RESULT_EVENT_FINAL_RESULT = 0,   /**< Pre-result event for final result */
122         VC_PRE_RESULT_EVENT_PARTIAL_RESULT,             /**< Pre-result event for partial result */
123         VC_PRE_RESULT_EVENT_ERROR                               /**< Pre-result event for error */
124 } vc_pre_result_event_e;
125
126 /**
127  * @brief Called when client gets the all recognition results from voice control service.
128  * @since_tizen 5.0
129  *
130  * @remarks The @a vc_cmd_list should not be released. It is managed by the platform and will be released when invoking this callback is finished. \n
131  *      The @a result and @a msg are also managed by the platform and will be released when invoking this callback is finished.
132  *
133  * @param[in] event         The result event
134  * @param[in] vc_cmd_list   Command list handle
135  * @param[in] result        Command text
136  * @param[in] msg           Engine message (e.g. #VC_RESULT_MESSAGE_NONE, #VC_RESULT_MESSAGE_ERROR_TOO_LOUD)
137  * @param[in] user_data     The user data passed from the callback registration function
138  *
139  * @return @c true to release command to client, \n @c false to wait for selecting command.
140  * @pre An application registers callback function using vc_mgr_set_all_result_cb().
141  *
142  * @see vc_mgr_set_all_result_cb()
143  * @see vc_mgr_unset_all_result_cb()
144  */
145 typedef bool (*vc_mgr_all_result_cb)(vc_result_event_e event, vc_cmd_list_h vc_cmd_list,
146                                 const char *result, const char *msg, void *user_data);
147
148 /**
149  * @brief Called when client gets the pre recognition results (partial ASR) from voice control service.
150  * @since_tizen 5.0
151  *
152  * @remarks The @a result is managed by the platform and will be released when invoking this callback is finished.
153  *
154  * @param[in] event       The pre result event
155  * @param[in] result      ASR text
156  * @param[in] user_data   The user data passed from the callback registration function
157  *
158  * @pre An application registers callback function using vc_mgr_set_pre_result_cb().
159  *
160  * @see vc_mgr_set_pre_result_cb()
161  * @see vc_mgr_unset_pre_result_cb()
162  */
163 typedef void (*vc_mgr_pre_result_cb)(vc_pre_result_event_e event, const char *result, void *user_data);
164
165 /**
166 * @brief Called when client gets the specific engine's result from vc-service.
167 * @since_tizen 5.0
168 *
169 * @param[in] engine_app_id The specific engine's app id
170 * @param[in] event The specific engine event type
171 * @param[in] result The specific engine result
172 * @param[in] user_data The user data passed from the callback registration function
173 *
174 * @pre An application registers callback function using vc_mgr_set_specific_engine_result_cb().
175 *
176 * @see vc_mgr_set_specific_engine_result_cb()
177 * @see vc_mgr_unset_specific_engine_result_cb()
178 */
179 typedef void (*vc_mgr_specific_engine_result_cb)(const char* engine_app_id, const char* event, const char* result, void *user_data);
180
181 /**
182  * @brief Called when user speaking is detected.
183  * @since_tizen 5.0
184  *
185  * @param[in] user_data   The user data passed from the callback registration function
186  *
187  * @pre An application registers callback function using vc_mgr_set_speech_detected_cb().
188  *
189  * @see vc_mgr_set_speech_detected_cb()
190  * @see vc_mgr_unset_speech_detected_cb()
191  */
192 typedef void (*vc_mgr_begin_speech_detected_cb)(void *user_data);
193
194
195 /**
196  * @brief Called when an application (VC client) requests dialog.
197  * @since_tizen 5.0
198  *
199  * @remarks The @a disp_text and @a utt_text are managed by the platform and will be released when invoking this callback is finished.
200  *
201  * @param[in] pid          Pid of VC client to request dialog
202  * @param[in] disp_text    Text requested to be displayed
203  * @param[in] utt_text     Text requested to be spoken
204  * @param[in] continuous   Continue dialog session
205  * @param[in] user_data    The user data passed from the callback registration function
206  *
207  * @pre An application registers callback function using vc_mgr_set_dialog_request_cb().
208  *
209  * @see vc_mgr_set_dialog_request_cb()
210  * @see vc_mgr_unset_dialog_request_cb()
211  */
212 typedef void (*vc_mgr_dialog_request_cb)(int pid, const char *disp_text, const char *utt_text, bool continuous, void *user_data);
213
214 /**
215  * @brief Called when engine sets private data to manager client.
216  * @since_tizen 5.0
217  *
218  * @remarks The @a key and @a data are managed by the platform and will be released when invoking this callback is finished.
219  *
220  * @param[in] key         Private key
221  * @param[in] data        Private data
222  * @param[in] user_data   The user data passed from the callback registration function
223  *
224  * @pre An application registers callback function using vc_mgr_set_private_data_set_cb().
225  *
226  * @see vc_mgr_set_private_data_set_cb()
227  * @see vc_mgr_unset_private_data_set_cb()
228  */
229 typedef int (*vc_mgr_private_data_set_cb)(const char *key, const char *data, void *user_data);
230
231 /**
232  * @brief Called when engine requests private data from manager client.
233  * @since_tizen 5.0
234  *
235  * @remarks The @a data should not be released. The @a data and @a key are managed by the platform and will be released when invoking this callback is finished.
236  *
237  * @param[in]  key         Private key
238  * @param[out] data        Private data
239  * @param[in]  user_data   The user data passed from the callback registration function
240  *
241  * @pre An application registers callback function using vc_mgr_set_private_data_requested_cb().
242  *
243  * @see vc_mgr_set_private_data_requested_cb()
244  * @see vc_mgr_unset_private_data_requested_cb()
245  */
246 typedef int (*vc_mgr_private_data_requested_cb)(const char *key, char **data, void *user_data);
247
248 /* for TTS feedback */
249 /**
250 * @brief Called when engine sends audio formats necessary for playing TTS feedback
251 *
252 * @param[in] rate Audio sampling rate
253 * @param[in] channel Audio channel (e.g. #VC_AUDIO_CHANNEL_MONO, #VC_AUDIO_CHANNEL_STEREO)
254 * @param[in] audio_type Audio type (e.g. #VC_AUDIO_TYPE_PCM_S16_LE, #VC_AUDIO_TYPE_PCM_U8)
255 * @param[in] user_data The user data passed from the callback registration function
256 *
257 * @pre An application registers callback function using vc_mgr_set_feedback_audio_format_cb().
258 *
259 * @see vc_mgr_set_feedback_audio_format_cb()
260 * @see vc_mgr_unset_feedback_audio_format_cb()
261 */
262 typedef void (*vc_mgr_feedback_audio_format_cb)(int rate, vc_audio_channel_e channel, vc_audio_type_e audio_type, void *user_data);
263
264 /**
265 * @brief Called when engine sends audio streaming for TTS feedback
266 *
267 * @param[in] event TTS feedback event (e.g. #VC_FEEDBACK_EVENT_START, #VC_FEEDBACK_EVENT_CONTINUE)
268 * @param[in] buffer Audio streaming data
269 * @param[in] len Length of the audio streaming data
270 * @param[in] user_data The user data passed from the callback registration function
271 *
272 * @pre An application registers callback function using vc_mgr_set_feedback_streaming_cb().
273 *
274 * @see vc_mgr_set_feedback_streaming_cb()
275 * @see vc_mgr_unset_feedback_streaming_cb()
276 */
277 typedef void (*vc_mgr_feedback_streaming_cb)(vc_feedback_event_e event, char* buffer, int len, void *user_data);
278
279
280 /**
281  * @platform
282  * @brief Initializes the voice control manager.
283  * @since_tizen 5.0
284  *
285  * @privlevel public
286  * @privilege %http://tizen.org/privilege/recorder
287  *
288  * @privlevel platform
289  * @privilege %http://tizen.org/privilege/voicecontrol.manager
290  *
291  * @remarks If the function succeeds, VC manager must be released with vc_mgr_deinitialize().
292  *
293  * @return 0 on success, otherwise a negative error value
294  * @retval #VC_ERROR_NONE                Successful
295  * @retval #VC_ERROR_OUT_OF_MEMORY       Out of memory
296  * @retval #VC_ERROR_OPERATION_FAILED    Operation fail
297  * @retval #VC_ERROR_PERMISSION_DENIED   Permission denied
298  * @retval #VC_ERROR_NOT_SUPPORTED       VC not supported
299  *
300  * @pre The state should be #VC_STATE_NONE.
301  * @post If this function is called, the state will be #VC_STATE_INITIALIZED.
302  *
303  * @see vc_mgr_deinitialize()
304  */
305 int vc_mgr_initialize(void);
306
307 /**
308  * @platform
309  * @brief Deinitializes the voice control manager.
310  * @since_tizen 5.0
311  *
312  * @privlevel platform
313  * @privilege %http://tizen.org/privilege/voicecontrol.manager
314  *
315  * @return 0 on success, otherwise a negative error value
316  * @retval #VC_ERROR_NONE                Successful
317  * @retval #VC_ERROR_INVALID_STATE       Invalid state
318  * @retval #VC_ERROR_PERMISSION_DENIED   Permission denied
319  * @retval #VC_ERROR_NOT_SUPPORTED       VC not supported
320  *
321  * @post If this function is called, the state will be #VC_STATE_NONE.
322  *
323  * @see vc_mgr_initialize()
324  */
325 int vc_mgr_deinitialize(void);
326
327 /**
328  * @platform
329  * @brief Connects the voice control service.
330  * @since_tizen 5.0
331  *
332  * @privlevel platform
333  * @privilege %http://tizen.org/privilege/voicecontrol.manager
334  *
335  * @return 0 on success, otherwise a negative error value
336  * @retval #VC_ERROR_NONE                Successful
337  * @retval #VC_ERROR_INVALID_STATE       Invalid state
338  * @retval #VC_ERROR_PERMISSION_DENIED   Permission denied
339  * @retval #VC_ERROR_NOT_SUPPORTED       VC not supported
340  *
341  * @pre The state should be #VC_STATE_INITIALIZED.
342  * @post If this function is called, the state will be #VC_STATE_READY.
343  *
344  * @see vc_mgr_unprepare()
345  */
346 int vc_mgr_prepare(void);
347
348 /**
349  * @platform
350  * @brief Disconnects the voice control service.
351  * @since_tizen 5.0
352  *
353  * @privlevel platform
354  * @privilege %http://tizen.org/privilege/voicecontrol.manager
355  *
356  * @return 0 on success, otherwise a negative error value
357  * @retval #VC_ERROR_NONE                Successful
358  * @retval #VC_ERROR_INVALID_STATE       Invalid state
359  * @retval #VC_ERROR_PERMISSION_DENIED   Permission denied
360  * @retval #VC_ERROR_NOT_SUPPORTED       VC not supported
361  *
362  * @pre The state should be #VC_STATE_READY.
363  * @post If this function is called, the state will be #VC_STATE_INITIALIZED.
364  *
365  * @see vc_mgr_prepare()
366  */
367 int vc_mgr_unprepare(void);
368
369 /**
370  * @platform
371  * @brief Retrieves all supported languages using callback function.
372  * @since_tizen 5.0
373  *
374  * @privlevel platform
375  * @privilege %http://tizen.org/privilege/voicecontrol.manager
376  *
377  * @param[in] callback    Callback function to invoke
378  * @param[in] user_data   The user data to be passed to the callback function
379  *
380  * @return 0 on success, otherwise a negative error value
381  * @retval #VC_ERROR_NONE                Successful
382  * @retval #VC_ERROR_INVALID_PARAMETER   Invalid parameter
383  * @retval #VC_ERROR_OPERATION_FAILED    Operation failure
384  * @retval #VC_ERROR_INVALID_STATE       Invalid state
385  * @retval #VC_ERROR_PERMISSION_DENIED   Permission denied
386  * @retval #VC_ERROR_NOT_SUPPORTED       VC not supported
387  *
388  * @pre The state should NOT be #VC_SERVICE_STATE_NONE.
389  * @post This function invokes vc_supported_language_cb() for each supported language.
390  *
391  * @see vc_supported_language_cb()
392  * @see vc_mgr_get_current_language()
393  */
394 int vc_mgr_foreach_supported_languages(vc_supported_language_cb callback, void *user_data);
395
396 /**
397  * @platform
398  * @brief Gets the current language set by user.
399  * @since_tizen 5.0
400  *
401  * @privlevel platform
402  * @privilege %http://tizen.org/privilege/voicecontrol.manager
403  *
404  * @remarks If the function succeeds, @a language must be released with free() by you when you no longer need it.
405  *
406  * @param[out] language   A language is specified as an ISO 3166 alpha-2 two letter country-code \n
407  *      followed by ISO 639-1 for the two-letter language code. \n
408  *      For example, "ko_KR" for Korean, "en_US" for American English.
409  *
410  * @return 0 on success, otherwise a negative error value
411  * @retval #VC_ERROR_NONE                Successful
412  * @retval #VC_ERROR_INVALID_PARAMETER   Invalid parameter
413  * @retval #VC_ERROR_OUT_OF_MEMORY       Out of memory
414  * @retval #VC_ERROR_OPERATION_FAILED    Operation failure
415  * @retval #VC_ERROR_INVALID_STATE       Invalid state
416  * @retval #VC_ERROR_PERMISSION_DENIED   Permission denied
417  * @retval #VC_ERROR_NOT_SUPPORTED       VC not supported
418  *
419  * @pre The state should NOT be #VC_SERVICE_STATE_NONE.
420  *
421  * @see vc_mgr_foreach_supported_languages()
422  */
423 int vc_mgr_get_current_language(char **language);
424
425 /**
426  * @platform
427  * @brief Gets the current state of voice control manager.
428  * @since_tizen 5.0
429  *
430  * @privlevel platform
431  * @privilege %http://tizen.org/privilege/voicecontrol.manager
432  *
433  * @param[out] state   The current state
434  *
435  * @return 0 on success, otherwise a negative error value
436  * @retval #VC_ERROR_NONE                Successful
437  * @retval #VC_ERROR_INVALID_PARAMETER   Invalid parameter
438  * @retval #VC_ERROR_INVALID_STATE       Invalid state
439  * @retval #VC_ERROR_PERMISSION_DENIED   Permission denied
440  * @retval #VC_ERROR_NOT_SUPPORTED       VC not supported
441  *
442  * @pre The state should NOT be #VC_SERVICE_STATE_NONE.
443  *
444  * @see vc_state_changed_cb()
445  * @see vc_set_state_changed_cb()
446  */
447 int vc_mgr_get_state(vc_state_e *state);
448
449 /**
450  * @platform
451  * @brief Gets the current state of voice control service.
452  * @since_tizen 5.0
453  *
454  * @privlevel platform
455  * @privilege %http://tizen.org/privilege/voicecontrol.manager
456  *
457  * @param[out] state   The current state
458  *
459  * @return 0 on success, otherwise a negative error value
460  * @retval #VC_ERROR_NONE                Successful
461  * @retval #VC_ERROR_INVALID_PARAMETER   Invalid parameter
462  * @retval #VC_ERROR_INVALID_STATE       Invalid state
463  * @retval #VC_ERROR_OPERATION_FAILED    Operation failure
464  * @retval #VC_ERROR_PERMISSION_DENIED   Permission denied
465  * @retval #VC_ERROR_NOT_SUPPORTED       VC not supported
466  *
467  * @pre The state should be #VC_STATE_READY.
468  *
469  * @see vc_mgr_start()
470  * @see vc_mgr_stop()
471  * @see vc_mgr_cancel()
472  * @see vc_set_service_state_changed_cb()
473  * @see vc_unset_service_state_changed_cb()
474  */
475 int vc_mgr_get_service_state(vc_service_state_e *state);
476
477 /**
478  * @platform
479  * @brief Checks whether the command format is supported.
480  * @since_tizen 5.0
481  *
482  * @privlevel platform
483  * @privilege %http://tizen.org/privilege/voicecontrol.manager
484  *
485  * @remarks The command formats are defined in the #voice_control_command.h. (e.g. #VC_COMMAND_FORMAT_FIXED, #VC_COMMAND_FORMAT_FIXED_AND_NONFIXED, and so on). Please refer to #voice_control_command.h.
486  *
487  * @param[in]  format    The command format
488  * @param[out] support   The result status @c true = supported, @c false = not supported
489  *
490  * @return 0 on success, otherwise a negative error value
491  * @retval #VC_ERROR_NONE                Successful
492  * @retval #VC_ERROR_INVALID_PARAMETER   Invalid parameter
493  * @retval #VC_ERROR_INVALID_STATE       Invalid state
494  * @retval #VC_ERROR_PERMISSION_DENIED   Permission denied
495  * @retval #VC_ERROR_NOT_SUPPORTED       VC not supported
496  *
497  * @pre The state should be #VC_STATE_READY.
498  */
499 int vc_mgr_is_command_format_supported(int format, bool *support);
500
501 /**
502  * @platform
503  * @brief Sets all types of commands.
504  * @since_tizen 5.0
505  *
506  * @privlevel platform
507  * @privilege %http://tizen.org/privilege/voicecontrol.manager
508  *
509  * @remarks VC manager client can register all types of commands.
510  *      The commands should include type, command text, format.
511  *
512  * @param[in] vc_cmd_list   The command list handle
513  *
514  * @return 0 on success, otherwise a negative error value
515  * @retval #VC_ERROR_NONE                Successful
516  * @retval #VC_ERROR_INVALID_PARAMETER   Invalid parameter
517  * @retval #VC_ERROR_INVALID_STATE       Invalid state
518  * @retval #VC_ERROR_PERMISSION_DENIED   Permission denied
519  * @retval #VC_ERROR_NOT_SUPPORTED       VC not supported
520  *
521  * @pre The state should be #VC_STATE_READY.
522  *
523  * @see vc_mgr_unset_command_list()
524  */
525 int vc_mgr_set_command_list(vc_cmd_list_h vc_cmd_list);
526
527 /**
528  * @platform
529  * @brief Unsets all types of commands.
530  * @since_tizen 5.0
531  *
532  * @privlevel platform
533  * @privilege %http://tizen.org/privilege/voicecontrol.manager
534  *
535  * @remarks All previously registered commands will be unset.
536  *
537  * @return 0 on success, otherwise a negative error value
538  * @retval #VC_ERROR_NONE                Successful
539  * @retval #VC_ERROR_INVALID_STATE       Invalid state
540  * @retval #VC_ERROR_PERMISSION_DENIED   Permission denied
541  * @retval #VC_ERROR_NOT_SUPPORTED       VC not supported
542  *
543  * @pre The state should be #VC_STATE_READY.
544  *
545  * @see vc_mgr_set_command_list()
546  */
547 int vc_mgr_unset_command_list(void);
548
549 /**
550  * @platform
551  * @brief Sets commands from file.
552  * @since_tizen 5.0
553  *
554  * @privlevel platform
555  * @privilege %http://tizen.org/privilege/voicecontrol.manager
556  *
557  * @remarks The commands should include type, command text, format.
558  *
559  * @param[in] file_path   The directory of a file which has command list
560  * @param[in] type          The command type (e.g. #VC_COMMAND_TYPE_FOREGROUND, #VC_COMMAND_TYPE_BACKGROUND, #VC_COMMAND_TYPE_WIDGET, #VC_COMMAND_TYPE_SYSTEM, #VC_COMMAND_TYPE_SYSTEM_BACKGROUND, #VC_COMMAND_TYPE_EXCLUSIVE)
561  *
562  * @return 0 on success, otherwise a negative error value
563  * @retval #VC_ERROR_NONE                Successful
564  * @retval #VC_ERROR_INVALID_PARAMETER   Invalid parameter
565  * @retval #VC_ERROR_INVALID_STATE       Invalid state
566  * @retval #VC_ERROR_OPERATION_FAILED    Operation failure
567  * @retval #VC_ERROR_PERMISSION_DENIED   Permission denied
568  * @retval #VC_ERROR_NOT_SUPPORTED       VC not supported
569  *
570  * @pre The state should be #VC_STATE_READY.
571  *
572  * @see vc_mgr_unset_command_list()
573  */
574 int vc_mgr_set_command_list_from_file(const char *file_path, int type);
575
576 /**
577  * @platform
578  * @brief Sets background commands of preloaded app from file.
579  * @since_tizen 5.0
580  *
581  * @privlevel platform
582  * @privilege %http://tizen.org/privilege/voicecontrol.manager
583  *
584  * @remarks The command type is valid for #VC_COMMAND_TYPE_BACKGROUND.
585  *      The commands should include type, command text, format.
586  *
587  * @param[in] file_path   The directory of a file which has command list
588  *
589  * @return 0 on success, otherwise a negative error value
590  * @retval #VC_ERROR_NONE                Successful
591  * @retval #VC_ERROR_INVALID_PARAMETER   Invalid parameter
592  * @retval #VC_ERROR_INVALID_STATE       Invalid state
593  * @retval #VC_ERROR_OPERATION_FAILED    Operation failure
594  * @retval #VC_ERROR_PERMISSION_DENIED   Permission denied
595  * @retval #VC_ERROR_NOT_SUPPORTED       VC not supported
596  *
597  * @pre The state should be #VC_STATE_READY.
598  *
599  * @see vc_mgr_unset_command_list()
600  */
601 int vc_mgr_set_preloaded_commands_from_file(const char *file_path);
602
603 /**
604  * @platform
605  * @brief Retrieves all available commands.
606  * @since_tizen 5.0
607  *
608  * @privlevel platform
609  * @privilege %http://tizen.org/privilege/voicecontrol.manager
610  *
611  * @remarks If the function succeeds, @a vc_cmd_list must be released with vc_cmd_list_destroy(vc_cmd_list, true).
612  *
613  * @param[in] vc_cmd_list   The command list
614  *
615  * @return 0 on success, otherwise a negative error value
616  * @retval #VC_ERROR_NONE                Successful
617  * @retval #VC_ERROR_INVALID_PARAMETER   Invalid parameter
618  * @retval #VC_ERROR_INVALID_STATE       Invalid state
619  * @retval #VC_ERROR_OPERATION_FAILED    Operation failure
620  * @retval #VC_ERROR_PERMISSION_DENIED   Permission denied
621  * @retval #VC_ERROR_NOT_SUPPORTED       VC not supported
622  *
623  * @pre The state should be #VC_STATE_READY and the service state should be #VC_SERVICE_STATE_READY.
624  */
625 int vc_mgr_get_current_commands(vc_cmd_list_h *vc_cmd_list);
626
627 /**
628  * @platform
629  * @brief Sets a type of audio-in.
630  * @since_tizen 5.0
631  *
632  * @privlevel platform
633  * @privilege %http://tizen.org/privilege/voicecontrol.manager
634  *
635  * @param[in] audio_id   The audio type (e.g. #VC_AUDIO_TYPE_BLUETOOTH or USB device ID)
636  *
637  * @return 0 on success, otherwise a negative error value
638  * @retval #VC_ERROR_NONE                Successful
639  * @retval #VC_ERROR_INVALID_PARAMETER   Invalid parameter
640  * @retval #VC_ERROR_INVALID_STATE       Invalid state
641  * @retval #VC_ERROR_OPERATION_FAILED    Operation failure
642  * @retval #VC_ERROR_PERMISSION_DENIED   Permission denied
643  * @retval #VC_ERROR_NOT_SUPPORTED       VC not supported
644  *
645  * @pre The state should be #VC_STATE_READY and the service state should be #VC_SERVICE_STATE_READY.
646  *
647  * @see vc_mgr_get_audio_type()
648  */
649 int vc_mgr_set_audio_type(const char *audio_id);
650
651 /**
652  * @platform
653  * @brief Gets a type of audio-in.
654  * @since_tizen 5.0
655  *
656  * @privlevel platform
657  * @privilege %http://tizen.org/privilege/voicecontrol.manager
658  *
659  * @remarks audio_id must be released using free() when it is no longer required.
660  *
661  * @param[out] audio_id   The audio id (e.g. #VC_AUDIO_TYPE_BLUETOOTH or USB device ID)
662  *
663  * @return 0 on success, otherwise a negative error value
664  * @retval #VC_ERROR_NONE                Successful
665  * @retval #VC_ERROR_INVALID_PARAMETER   Invalid parameter
666  * @retval #VC_ERROR_INVALID_STATE       Invalid state
667  * @retval #VC_ERROR_PERMISSION_DENIED   Permission denied
668  * @retval #VC_ERROR_NOT_SUPPORTED       VC not supported
669  *
670  * @pre The state should be #VC_STATE_READY and the service state should be #VC_SERVICE_STATE_READY.
671  *
672  * @see vc_mgr_set_audio_type()
673  */
674 int vc_mgr_get_audio_type(char **audio_id);
675
676 /**
677  * @platform
678  * @brief Sets recognition mode.
679  * @since_tizen 5.0
680  *
681  * @privlevel platform
682  * @privilege %http://tizen.org/privilege/voicecontrol.manager
683  *
684  * @param[in] mode   Recognition mode (e.g. #VC_RECOGNITION_MODE_STOP_BY_SILENCE is default value)
685  *
686  * @return 0 on success, otherwise a negative error value
687  * @retval #VC_ERROR_NONE                Successful
688  * @retval #VC_ERROR_INVALID_PARAMETER   Invalid parameter
689  * @retval #VC_ERROR_INVALID_STATE       Invalid state
690  * @retval #VC_ERROR_PERMISSION_DENIED   Permission denied
691  * @retval #VC_ERROR_NOT_SUPPORTED       VC not supported
692  *
693  * @pre The state should be #VC_STATE_READY and the service state should be #VC_SERVICE_STATE_READY.
694  *
695  * @see vc_mgr_set_recognition_mode()
696  */
697 int vc_mgr_set_recognition_mode(vc_recognition_mode_e mode);
698
699 /**
700  * @platform
701  * @brief Gets recognition mode.
702  * @since_tizen 5.0
703  *
704  * @privlevel platform
705  * @privilege %http://tizen.org/privilege/voicecontrol.manager
706  *
707  * @param[out] mode   Recognition mode
708  *
709  * @return 0 on success, otherwise a negative error value
710  * @retval #VC_ERROR_NONE                Successful
711  * @retval #VC_ERROR_INVALID_PARAMETER   Invalid parameter
712  * @retval #VC_ERROR_INVALID_STATE       Invalid state
713  * @retval #VC_ERROR_PERMISSION_DENIED   Permission denied
714  * @retval #VC_ERROR_NOT_SUPPORTED       VC not supported
715  *
716  * @pre The state should be #VC_STATE_READY.
717  *
718  * @see vc_mgr_get_recognition_mode()
719  */
720 int vc_mgr_get_recognition_mode(vc_recognition_mode_e *mode);
721
722 /**
723  * @platform
724  * @brief Sets private data to VC engine.
725  * @since_tizen 5.0
726  *
727  * @privlevel platform
728  * @privilege %http://tizen.org/privilege/voicecontrol.manager
729  *
730  * @remarks VC manager client can set private data to VC engine using this function.
731  *
732  * @param[in] key    Private key
733  * @param[in] data   Private data
734  *
735  * @return 0 on success, otherwise a negative error value
736  * @retval #VC_ERROR_NONE                Successful
737  * @retval #VC_ERROR_OUT_OF_MEMORY       Not enough memory
738  * @retval #VC_ERROR_INVALID_PARAMETER   Invalid parameter
739  * @retval #VC_ERROR_INVALID_STATE       Invalid state
740  * @retval #VC_ERROR_PERMISSION_DENIED   Permission denied
741  * @retval #VC_ERROR_NOT_SUPPORTED       VC not supported
742  *
743  * @pre The service state should be #VC_SERVICE_STATE_READY.
744  */
745 int vc_mgr_set_private_data(const char *key, const char *data);
746
747 /**
748  * @platform
749  * @brief Gets private data from VC engine.
750  * @since_tizen 5.0
751  *
752  * @privlevel platform
753  * @privilege %http://tizen.org/privilege/voicecontrol.manager
754  *
755  * @remarks VC manager client can get private data from VC engine using this function.
756  *      @a data must be released using free() when it is no longer required.
757  *
758  * @param[in]  key    Private key
759  * @param[out] data   Private data
760  *
761  * @return 0 on success, otherwise a negative error value
762  * @retval #VC_ERROR_NONE                Successful
763  * @retval #VC_ERROR_OUT_OF_MEMORY       Not enough memory
764  * @retval #VC_ERROR_INVALID_PARAMETER   Invalid parameter
765  * @retval #VC_ERROR_INVALID_STATE       Invalid state
766  * @retval #VC_ERROR_PERMISSION_DENIED   Permission denied
767  * @retval #VC_ERROR_NOT_SUPPORTED       VC not supported
768  *
769  * @pre The service state should be #VC_SERVICE_STATE_READY.
770  */
771 int vc_mgr_get_private_data(const char *key, char **data);
772
773 /**
774  * @platform
775  * @brief Requests to do action as if utterance is spoken.
776  * @since_tizen 5.0
777  *
778  * @privlevel platform
779  * @privilege %http://tizen.org/privilege/voicecontrol.manager
780  *
781  * @param[in] type         Event type
782  * @param[in] send_event   The string for send event
783  *
784  * @return 0 on success, otherwise a negative error value
785  * @retval #VC_ERROR_NONE                Successful
786  * @retval #VC_ERROR_OUT_OF_MEMORY       Not enough memory
787  * @retval #VC_ERROR_INVALID_STATE       Invalid state
788  * @retval #VC_ERROR_INVALID_PARAMETER   Invalid parameter
789  * @retval #VC_ERROR_PERMISSION_DENIED   Permission denied
790  * @retval #VC_ERROR_NOT_SUPPORTED       VC not supported
791  *
792  * @pre The service state should be #VC_SERVICE_STATE_READY.
793  */
794 int vc_mgr_do_action(vc_send_event_type_e type, char *send_event);
795
796 /**
797 * @brief Sends the specific engine request to the vc-service.
798 * @since_tizen 5.0
799 *
800 * @param[in] engine_app_id A specific engine's app id
801 * @param[in] event A engine service user request event
802 * @param[in] request A engine service user request text
803 *
804 * @return 0 on success, otherwise a negative error value
805 * @retval #VC_ERROR_NONE Successful
806 * @retval #VC_ERROR_OUT_OF_MEMORY Not enough memory
807 * @retval #VC_ERROR_INVALID_STATE Invalid state
808 * @retval #VC_ERROR_INVALID_PARAMETER Invalid parameter
809 * @retval #VC_ERROR_OPERATION_FAILED Operation failure
810 */
811 int vc_mgr_send_specific_engine_request(const char* engine_app_id, const char* event, const char* request);
812
813 /**
814  * @platform
815  * @brief Starts recognition.
816  * @since_tizen 5.0
817  *
818  * @privlevel platform
819  * @privilege %http://tizen.org/privilege/voicecontrol.manager
820  *
821  * @remarks The default recognition mode is #VC_RECOGNITION_MODE_STOP_BY_SILENCE. \n
822  *      If you want to use other mode, you can set mode with vc_mgr_set_recognition_mode().
823  *
824  * @param[in] exclusive_command_option   Exclusive command option
825  *
826  * @return 0 on success, otherwise a negative error value
827  * @retval #VC_ERROR_NONE                       Successful
828  * @retval #VC_ERROR_INVALID_PARAMETER          Invalid parameter.
829  * @retval #VC_ERROR_INVALID_STATE              Invalid state
830  * @retval #VC_ERROR_OPERATION_FAILED           Operation failure
831  * @retval #VC_ERROR_IN_PROGRESS_TO_RECORDING   In progress to recording
832  * @retval #VC_ERROR_PERMISSION_DENIED          Permission denied
833  * @retval #VC_ERROR_NOT_SUPPORTED              VC not supported
834  *
835  * @pre The state should be #VC_STATE_READY and the service state should be #VC_SERVICE_STATE_READY.
836  * @post It will invoke vc_service_state_changed_cb(), if you register a callback with vc_service_state_changed_cb(). \n
837  *      If this function succeeds, the service state will be #VC_SERVICE_STATE_RECORDING.
838  *
839  * @see vc_mgr_stop()
840  * @see vc_mgr_cancel()
841  * @see vc_service_state_changed_cb()
842  * @see vc_mgr_set_recognition_mode()
843  * @see vc_mgr_get_recognition_mode()
844  */
845 int vc_mgr_start(bool exclusive_command_option);
846
847 /**
848  * @platform
849  * @brief Stops recognition.
850  * @since_tizen 5.0
851  *
852  * @privlevel platform
853  * @privilege %http://tizen.org/privilege/voicecontrol.manager
854  *
855  * @return 0 on success, otherwise a negative error value
856  * @retval #VC_ERROR_NONE                        Successful
857  * @retval #VC_ERROR_INVALID_STATE               Invalid state
858  * @retval #VC_ERROR_OPERATION_FAILED            Operation failure
859  * @retval #VC_ERROR_IN_PROGRESS_TO_READY        In progress to ready
860  * @retval #VC_ERROR_IN_PROGRESS_TO_RECORDING    In progress to recording
861  * @retval #VC_ERROR_IN_PROGRESS_TO_PROCESSING   In progress to processing
862  * @retval #VC_ERROR_PERMISSION_DENIED           Permission denied
863  * @retval #VC_ERROR_NOT_SUPPORTED               VC not supported
864  *
865  * @pre The service state should be #VC_SERVICE_STATE_RECORDING.
866  * @post It will invoke vc_service_state_changed_cb(), if you register a callback with vc_service_state_changed_cb(). \n
867  *      If this function succeeds, the service state will be #VC_SERVICE_STATE_PROCESSING.
868  *
869  * @see vc_mgr_start()
870  * @see vc_mgr_cancel()
871  * @see vc_service_state_changed_cb()
872  * @see vc_mgr_result_cb()
873  */
874 int vc_mgr_stop(void);
875
876 /**
877  * @platform
878  * @brief Cancels recognition.
879  * @since_tizen 5.0
880  *
881  * @privlevel platform
882  * @privilege %http://tizen.org/privilege/voicecontrol.manager
883  *
884  * @return 0 on success, otherwise a negative error value
885  * @retval #VC_ERROR_NONE                        Successful
886  * @retval #VC_ERROR_OUT_OF_MEMORY               Not enough memory
887  * @retval #VC_ERROR_INVALID_STATE               Invalid state
888  * @retval #VC_ERROR_OPERATION_FAILED            Operation failure
889  * @retval #VC_ERROR_IN_PROGRESS_TO_READY        In progress to ready
890  * @retval #VC_ERROR_IN_PROGRESS_TO_RECORDING    In progress to recording
891  * @retval #VC_ERROR_IN_PROGRESS_TO_PROCESSING   In progress to processing
892  * @retval #VC_ERROR_PERMISSION_DENIED           Permission denied
893  * @retval #VC_ERROR_NOT_SUPPORTED               VC not supported
894  *
895  * @pre The service state should be #VC_SERVICE_STATE_RECORDING or #VC_SERVICE_STATE_PROCESSING.
896  * @post It will invoke vc_service_state_changed_cb(), if you register a callback with vc_service_state_changed_cb(). \n
897  *      If this function succeeds, the service state will be #VC_SERVICE_STATE_READY.
898  *
899  * @see vc_mgr_start()
900  * @see vc_mgr_stop()
901  * @see vc_service_state_changed_cb()
902  */
903 int vc_mgr_cancel(void);
904
905 /**
906  * @platform
907  * @brief Gets the microphone volume during recording.
908  * @since_tizen 5.0
909  *
910  * @privlevel platform
911  * @privilege %http://tizen.org/privilege/voicecontrol.manager
912  *
913  * @param[out] volume   Recording volume
914  *
915  * @return 0 on success, otherwise a negative error value
916  * @retval #VC_ERROR_NONE                Successful
917  * @retval #VC_ERROR_INVALID_PARAMETER   Invalid parameter
918  * @retval #VC_ERROR_INVALID_STATE       Invalid state
919  * @retval #VC_ERROR_PERMISSION_DENIED   Permission denied
920  * @retval #VC_ERROR_NOT_SUPPORTED       VC not supported
921  *
922  * @pre The service state should be #VC_SERVICE_STATE_RECORDING.
923  *
924  * @see vc_mgr_start()
925  */
926 int vc_mgr_get_recording_volume(float *volume);
927
928 /**
929  * @platform
930  * @brief Selects valid results from all results.
931  * @since_tizen 5.0
932  *
933  * @privlevel platform
934  * @privilege %http://tizen.org/privilege/voicecontrol.manager
935  *
936  * @remarks This function should be called in vc_mgr_all_result_cb().
937  *      The @a vc_cmd_list can be NULL, in that case the function does nothing.
938  * @param[in] vc_cmd_list   The valid result list
939  *
940  * @return 0 on success, otherwise a negative error value
941  * @retval #VC_ERROR_NONE                Successful
942  * @retval #VC_ERROR_INVALID_STATE       Invalid state
943  * @retval #VC_ERROR_PERMISSION_DENIED   Permission denied
944  * @retval #VC_ERROR_NOT_SUPPORTED       VC not supported
945  *
946  * @pre vc_mgr_all_result_cb() should be called
947  *
948  * @see vc_mgr_all_result_cb()
949  */
950 int vc_mgr_set_selected_results(vc_cmd_list_h vc_cmd_list);
951
952
953 /**
954  * @platform
955  * @brief Sets a callback function for getting recognition result.
956  * @since_tizen 5.0
957  *
958  * @privlevel platform
959  * @privilege %http://tizen.org/privilege/voicecontrol.manager
960  *
961  * @param[in] callback    Callback function to register
962  * @param[in] user_data   The user data to be passed to the callback function
963  *
964  * @return 0 on success, otherwise a negative error value
965  * @retval #VC_ERROR_NONE                Successful
966  * @retval #VC_ERROR_INVALID_PARAMETER   Invalid parameter
967  * @retval #VC_ERROR_INVALID_STATE       Invalid state
968  * @retval #VC_ERROR_PERMISSION_DENIED   Permission denied
969  * @retval #VC_ERROR_NOT_SUPPORTED       VC not supported
970  *
971  * @pre The state should be #VC_STATE_INITIALIZED.
972  *
973  * @see vc_mgr_all_result_cb()
974  * @see vc_mgr_unset_all_result_cb()
975  */
976 int vc_mgr_set_all_result_cb(vc_mgr_all_result_cb callback, void *user_data);
977
978 /**
979  * @platform
980  * @brief Unsets the recognition result callback function.
981  * @since_tizen 5.0
982  *
983  * @privlevel platform
984  * @privilege %http://tizen.org/privilege/voicecontrol.manager
985  *
986  * @return 0 on success, otherwise a negative error value
987  * @retval #VC_ERROR_NONE                Successful
988  * @retval #VC_ERROR_INVALID_STATE       Invalid state
989  * @retval #VC_ERROR_PERMISSION_DENIED   Permission denied
990  * @retval #VC_ERROR_NOT_SUPPORTED       VC not supported
991  *
992  * @pre The state should be #VC_STATE_INITIALIZED.
993  *
994  * @see vc_mgr_set_all_result_cb()
995  */
996 int vc_mgr_unset_all_result_cb(void);
997
998 /**
999  * @platform
1000  * @brief Sets a callback function for getting pre recognition result.
1001  * @since_tizen 5.0
1002  *
1003  * @privlevel platform
1004  * @privilege %http://tizen.org/privilege/voicecontrol.manager
1005  *
1006  * @param[in] callback    Callback function to register
1007  * @param[in] user_data   The user data to be passed to the callback function
1008  *
1009  * @return 0 on success, otherwise a negative error value
1010  * @retval #VC_ERROR_NONE                Successful
1011  * @retval #VC_ERROR_INVALID_PARAMETER   Invalid parameter
1012  * @retval #VC_ERROR_INVALID_STATE       Invalid state
1013  * @retval #VC_ERROR_PERMISSION_DENIED   Permission denied
1014  * @retval #VC_ERROR_NOT_SUPPORTED       VC not supported
1015  *
1016  * @pre The state should be #VC_STATE_INITIALIZED.
1017  *
1018  * @see vc_mgr_pre_result_cb()
1019  * @see vc_mgr_unset_pre_result_cb()
1020  */
1021 int vc_mgr_set_pre_result_cb(vc_mgr_pre_result_cb callback, void *user_data);
1022
1023 /**
1024  * @platform
1025  * @brief Unsets the pre recognition result callback function.
1026  * @since_tizen 5.0
1027  *
1028  * @privlevel platform
1029  * @privilege %http://tizen.org/privilege/voicecontrol.manager
1030  *
1031  * @return 0 on success, otherwise a negative error value
1032  * @retval #VC_ERROR_NONE                Successful
1033  * @retval #VC_ERROR_INVALID_STATE       Invalid state
1034  * @retval #VC_ERROR_PERMISSION_DENIED   Permission denied
1035  * @retval #VC_ERROR_NOT_SUPPORTED       VC not supported
1036  *
1037  * @pre The state should be #VC_STATE_INITIALIZED.
1038  *
1039  * @see vc_mgr_set_pre_result_cb()
1040  */
1041 int vc_mgr_unset_pre_result_cb(void);
1042
1043 /**
1044 * @brief Registers a callback function for getting specific engine result.
1045 * @since_tizen 5.0
1046 *
1047 * @param[in] callback Callback function to register
1048 * @param[in] user_data The user data to be passed to the callback function
1049 *
1050 * @return 0 on success, otherwise a negative error value
1051 * @retval #VC_ERROR_NONE Successful
1052 * @retval #VC_ERROR_INVALID_PARAMETER Invalid parameter
1053 * @retval #VC_ERROR_INVALID_STATE Invalid state
1054 * @retval #VC_ERROR_PERMISSION_DENIED Permission denied
1055 * @retval #VC_ERROR_NOT_SUPPORTED Not supported
1056 *
1057 * @pre The state should be #VC_STATE_INITIALIZED.
1058 *
1059 * @see vc_mgr_unset_specific_engine_result_cb()
1060 */
1061 int vc_mgr_set_specific_engine_result_cb(vc_mgr_specific_engine_result_cb callback, void* user_data);
1062
1063 /**
1064 * @brief Unregisters the specific engine result callback function.
1065 * @since_tizen 5.0
1066 *
1067 * @return 0 on success, otherwise a negative error value
1068 * @retval #VC_ERROR_NONE Successful
1069 * @retval #VC_ERROR_INVALID_STATE Invalid state
1070 * @retval #VC_ERROR_PERMISSION_DENIED Permission denied
1071 * @retval #VC_ERROR_NOT_SUPPORTED Not supported
1072 *
1073 * @pre The state should be #VC_STATE_INITIALIZED.
1074 *
1075 * @see vc_mgr_set_specific_engine_result_cb()
1076 */
1077 int vc_mgr_unset_specific_engine_result_cb(void);
1078
1079 /**
1080  * @platform
1081  * @brief Sets a callback function for getting all types of recognition results.
1082  * @since_tizen 5.0
1083  *
1084  * @privlevel platform
1085  * @privilege %http://tizen.org/privilege/voicecontrol.manager
1086  *
1087  * @param[in] callback    Callback function to register
1088  * @param[in] user_data   The user data to be passed to the callback function
1089  *
1090  * @return 0 on success, otherwise a negative error value
1091  * @retval #VC_ERROR_NONE                Successful
1092  * @retval #VC_ERROR_INVALID_PARAMETER   Invalid parameter
1093  * @retval #VC_ERROR_INVALID_STATE       Invalid state
1094  * @retval #VC_ERROR_PERMISSION_DENIED   Permission denied
1095  * @retval #VC_ERROR_NOT_SUPPORTED       VC not supported
1096  *
1097  * @pre The state should be #VC_STATE_INITIALIZED.
1098  *
1099  * @see vc_result_cb()
1100  * @see vc_mgr_unset_result_cb()
1101  */
1102 int vc_mgr_set_result_cb(vc_result_cb callback, void *user_data);
1103
1104 /**
1105  * @platform
1106  * @brief Unsets the callback function for getting all types of recognition results.
1107  * @since_tizen 5.0
1108  *
1109  * @privlevel platform
1110  * @privilege %http://tizen.org/privilege/voicecontrol.manager
1111  *
1112  * @return 0 on success, otherwise a negative error value
1113  * @retval #VC_ERROR_NONE                Successful
1114  * @retval #VC_ERROR_INVALID_STATE       Invalid state
1115  * @retval #VC_ERROR_PERMISSION_DENIED   Permission denied
1116  * @retval #VC_ERROR_NOT_SUPPORTED       VC not supported
1117  *
1118  * @pre The state should be #VC_STATE_INITIALIZED.
1119  *
1120  * @see vc_mgr_set_result_cb()
1121  */
1122 int vc_mgr_unset_result_cb(void);
1123
1124 /**
1125  * @platform
1126  * @brief Sets a callback function to be called when state is changed.
1127  * @since_tizen 5.0
1128  *
1129  * @privlevel platform
1130  * @privilege %http://tizen.org/privilege/voicecontrol.manager
1131  *
1132  * @param[in] callback    Callback function to register
1133  * @param[in] user_data   The user data to be passed to the callback function
1134  *
1135  * @return 0 on success, otherwise a negative error value
1136  * @retval #VC_ERROR_NONE                Successful
1137  * @retval #VC_ERROR_INVALID_PARAMETER   Invalid parameter
1138  * @retval #VC_ERROR_INVALID_STATE       Invalid state
1139  * @retval #VC_ERROR_PERMISSION_DENIED   Permission denied
1140  * @retval #VC_ERROR_NOT_SUPPORTED       VC not supported
1141  *
1142  * @pre The state should be #VC_STATE_INITIALIZED.
1143  *
1144  * @see vc_state_changed_cb()
1145  * @see vc_mgr_unset_state_changed_cb()
1146  */
1147 int vc_mgr_set_state_changed_cb(vc_state_changed_cb callback, void *user_data);
1148
1149 /**
1150  * @platform
1151  * @brief Unsets the state changed callback function.
1152  * @since_tizen 5.0
1153  *
1154  * @privlevel platform
1155  * @privilege %http://tizen.org/privilege/voicecontrol.manager
1156  *
1157  * @return 0 on success, otherwise a negative error value
1158  * @retval #VC_ERROR_NONE                Successful
1159  * @retval #VC_ERROR_INVALID_STATE       Invalid state
1160  * @retval #VC_ERROR_PERMISSION_DENIED   Permission denied
1161  * @retval #VC_ERROR_NOT_SUPPORTED       VC not supported
1162  *
1163  * @pre The state should be #VC_STATE_INITIALIZED.
1164  *
1165  * @see vc_mgr_set_state_changed_cb()
1166  */
1167 int vc_mgr_unset_state_changed_cb(void);
1168
1169 /**
1170  * @platform
1171  * @brief Sets a callback function to be called when service state is changed.
1172  * @since_tizen 5.0
1173  *
1174  * @privlevel platform
1175  * @privilege %http://tizen.org/privilege/voicecontrol.manager
1176  *
1177  * @param[in] callback    Callback function to register
1178  * @param[in] user_data   The user data to be passed to the callback function
1179  *
1180  * @return 0 on success, otherwise a negative error value
1181  * @retval #VC_ERROR_NONE                Successful
1182  * @retval #VC_ERROR_INVALID_PARAMETER   Invalid parameter
1183  * @retval #VC_ERROR_INVALID_STATE       Invalid state
1184  * @retval #VC_ERROR_PERMISSION_DENIED   Permission denied
1185  * @retval #VC_ERROR_NOT_SUPPORTED       VC not supported
1186  *
1187  * @pre The state should be #VC_STATE_INITIALIZED.
1188  *
1189  * @see vc_service_state_changed_cb()
1190  * @see vc_mgr_unset_service_state_changed_cb()
1191  */
1192 int vc_mgr_set_service_state_changed_cb(vc_service_state_changed_cb callback, void *user_data);
1193
1194 /**
1195  * @platform
1196  * @brief Unsets the service state changed callback function.
1197  * @since_tizen 5.0
1198  *
1199  * @privlevel platform
1200  * @privilege %http://tizen.org/privilege/voicecontrol.manager
1201  *
1202  * @return 0 on success, otherwise a negative error value
1203  * @retval #VC_ERROR_NONE                Successful
1204  * @retval #VC_ERROR_INVALID_STATE       Invalid state
1205  * @retval #VC_ERROR_PERMISSION_DENIED   Permission denied
1206  * @retval #VC_ERROR_NOT_SUPPORTED       VC not supported
1207  *
1208  * @pre The state should be #VC_STATE_INITIALIZED.
1209  *
1210  * @see vc_mgr_set_service_state_changed_cb()
1211  */
1212 int vc_mgr_unset_service_state_changed_cb(void);
1213
1214 /**
1215  * @platform
1216  * @brief Sets a callback function to be called when begin of speech is detected.
1217  * @since_tizen 5.0
1218  *
1219  * @privlevel platform
1220  * @privilege %http://tizen.org/privilege/voicecontrol.manager
1221  *
1222  * @param[in] callback    Callback function to register
1223  * @param[in] user_data   The user data to be passed to the callback function
1224  *
1225  * @return 0 on success, otherwise a negative error value
1226  * @retval #VC_ERROR_NONE                Successful
1227  * @retval #VC_ERROR_INVALID_PARAMETER   Invalid parameter
1228  * @retval #VC_ERROR_INVALID_STATE       Invalid state
1229  * @retval #VC_ERROR_PERMISSION_DENIED   Permission denied
1230  * @retval #VC_ERROR_NOT_SUPPORTED       VC not supported
1231  *
1232  * @pre The state should be #VC_STATE_INITIALIZED.
1233  *
1234  * @see vc_mgr_begin_speech_detected_cb()
1235  * @see vc_mgr_unset_speech_detected_cb()
1236  */
1237 int vc_mgr_set_speech_detected_cb(vc_mgr_begin_speech_detected_cb callback, void *user_data);
1238
1239 /**
1240  * @platform
1241  * @brief Unsets the speech detected callback function.
1242  * @since_tizen 5.0
1243  *
1244  * @privlevel platform
1245  * @privilege %http://tizen.org/privilege/voicecontrol.manager
1246  *
1247  * @return 0 on success, otherwise a negative error value
1248  * @retval #VC_ERROR_NONE                Successful
1249  * @retval #VC_ERROR_INVALID_STATE       Invalid state
1250  * @retval #VC_ERROR_PERMISSION_DENIED   Permission denied
1251  * @retval #VC_ERROR_NOT_SUPPORTED       VC not supported
1252  *
1253  * @pre The state should be #VC_STATE_INITIALIZED.
1254  *
1255  * @see vc_mgr_set_speech_detected_cb()
1256  */
1257 int vc_mgr_unset_speech_detected_cb(void);
1258
1259 /**
1260  * @platform
1261  * @brief Sets a callback function to be called when current language is changed.
1262  * @since_tizen 5.0
1263  *
1264  * @privlevel platform
1265  * @privilege %http://tizen.org/privilege/voicecontrol.manager
1266  *
1267  * @param[in] callback    Callback function to register
1268  * @param[in] user_data   The user data to be passed to the callback function
1269  *
1270  * @return 0 on success, otherwise a negative error value
1271  * @retval #VC_ERROR_NONE                Successful
1272  * @retval #VC_ERROR_INVALID_PARAMETER   Invalid parameter
1273  * @retval #VC_ERROR_INVALID_STATE       Invalid state
1274  * @retval #VC_ERROR_PERMISSION_DENIED   Permission denied
1275  * @retval #VC_ERROR_NOT_SUPPORTED       VC not supported
1276  *
1277  * @pre The state should be #VC_STATE_INITIALIZED.
1278  *
1279  * @see vc_current_language_changed_cb()
1280  * @see vc_mgr_unset_current_language_changed_cb()
1281  */
1282 int vc_mgr_set_current_language_changed_cb(vc_current_language_changed_cb callback, void *user_data);
1283
1284 /**
1285  * @platform
1286  * @brief Unsets the current language changed callback function.
1287  * @since_tizen 5.0
1288  *
1289  * @privlevel platform
1290  * @privilege %http://tizen.org/privilege/voicecontrol.manager
1291  *
1292  * @return 0 on success, otherwise a negative error value
1293  * @retval #VC_ERROR_NONE                Successful
1294  * @retval #VC_ERROR_INVALID_STATE       Invalid state
1295  * @retval #VC_ERROR_PERMISSION_DENIED   Permission denied
1296  * @retval #VC_ERROR_NOT_SUPPORTED       VC not supported
1297  *
1298  * @pre The state should be #VC_STATE_INITIALIZED.
1299  *
1300  * @see vc_mgr_set_current_language_changed_cb()
1301  */
1302 int vc_mgr_unset_current_language_changed_cb(void);
1303
1304 /**
1305  * @platform
1306  * @brief Gets the current error message.
1307  * @since_tizen 5.0
1308  *
1309  * @privlevel platform
1310  * @privilege %http://tizen.org/privilege/voicecontrol.manager
1311  *
1312  * @remarks This function should be called during as vc error callback. If not, the error as operation failure will be returned. \n
1313  *      If the function succeeds, @a err_msg must be released using free() when it is no longer required.
1314  *
1315  * @param[out] err_msg   The current error message
1316  *
1317  * @return 0 on success, otherwise a negative error value
1318  * @retval #VC_ERROR_NONE                Successful
1319  * @retval #VC_ERROR_INVALID_PARAMETER   Invalid parameter
1320  * @retval #VC_ERROR_INVALID_STATE       Invalid state
1321  * @retval $VC_ERROR_OPERATION_FAILED    Operation failure
1322  * @retval #VC_ERROR_OUT_OF_MEMORY       Out of memory
1323  * @retval #VC_ERROR_PERMISSION_DENIED   Permission denied
1324  * @retval #VC_ERROR_NOT_SUPPORTED       VC not supported
1325  *
1326  * @see vc_error_cb()
1327  */
1328 int vc_mgr_get_error_message(char **err_msg);
1329
1330 /**
1331  * @platform
1332  * @brief Sets a callback function to be called when an error occurred.
1333  * @since_tizen 5.0
1334  *
1335  * @privlevel platform
1336  * @privilege %http://tizen.org/privilege/voicecontrol.manager
1337  *
1338  * @param[in] callback    Callback function to register
1339  * @param[in] user_data   The user data to be passed to the callback function
1340  *
1341  * @return 0 on success, otherwise a negative error value
1342  * @retval #VC_ERROR_NONE                Successful
1343  * @retval #VC_ERROR_INVALID_PARAMETER   Invalid parameter
1344  * @retval #VC_ERROR_INVALID_STATE       Invalid state
1345  * @retval #VC_ERROR_PERMISSION_DENIED   Permission denied
1346  * @retval #VC_ERROR_NOT_SUPPORTED       VC not supported
1347  *
1348  * @pre The state should be #VC_STATE_INITIALIZED.
1349  *
1350  * @see vc_error_cb()
1351  * @see vc_mgr_unset_error_cb()
1352  */
1353 int vc_mgr_set_error_cb(vc_error_cb callback, void *user_data);
1354
1355 /**
1356  * @platform
1357  * @brief Unsets the callback function to be called when an error occurred.
1358  * @since_tizen 5.0
1359  *
1360  * @privlevel platform
1361  * @privilege %http://tizen.org/privilege/voicecontrol.manager
1362  *
1363  * @return 0 on success, otherwise a negative error value
1364  * @retval #VC_ERROR_NONE                Successful
1365  * @retval #VC_ERROR_INVALID_STATE       Invalid state
1366  * @retval #VC_ERROR_PERMISSION_DENIED   Permission denied
1367  * @retval #VC_ERROR_NOT_SUPPORTED       VC not supported
1368  *
1369  * @pre The state should be #VC_STATE_INITIALIZED.
1370  *
1371  * @see vc_mgr_set_error_cb()
1372  */
1373 int vc_mgr_unset_error_cb(void);
1374
1375
1376 /**
1377  * @platform
1378  * @brief Sets a callback function to be called when dialog requests.
1379  * @since_tizen 5.0
1380  *
1381  * @privlevel platform
1382  * @privilege %http://tizen.org/privilege/voicecontrol.manager
1383  *
1384  * @param[in] callback    Callback function to register
1385  * @param[in] user_data   The user data to be passed to the callback function
1386  *
1387  * @return 0 on success, otherwise a negative error value
1388  * @retval #VC_ERROR_NONE                Successful
1389  * @retval #VC_ERROR_INVALID_PARAMETER   Invalid parameter
1390  * @retval #VC_ERROR_INVALID_STATE       Invalid state
1391  * @retval #VC_ERROR_PERMISSION_DENIED   Permission denied
1392  * @retval #VC_ERROR_NOT_SUPPORTED       VC not supported
1393  *
1394  * @pre The state should be #VC_STATE_INITIALIZED.
1395  *
1396  * @see vc_mgr_unset_dialog_request_cb()
1397  */
1398 int vc_mgr_set_dialog_request_cb(vc_mgr_dialog_request_cb callback, void *user_data);
1399
1400 /**
1401  * @platform
1402  * @brief Unsets the callback function to be called when dialog requests.
1403  * @since_tizen 5.0
1404  *
1405  * @privlevel platform
1406  * @privilege %http://tizen.org/privilege/voicecontrol.manager
1407  *
1408  * @return 0 on success, otherwise a negative error value
1409  * @retval #VC_ERROR_NONE                Successful
1410  * @retval #VC_ERROR_INVALID_STATE       Invalid state
1411  * @retval #VC_ERROR_PERMISSION_DENIED   Permission denied
1412  * @retval #VC_ERROR_NOT_SUPPORTED       VC not supported
1413  *
1414  * @pre The state should be #VC_STATE_INITIALIZED.
1415  *
1416  * @see vc_mgr_set_dialog_request_cb()
1417  */
1418 int vc_mgr_unset_dialog_request_cb(void);
1419
1420 /**
1421  * @platform
1422  * @brief Enables command type as candidate command.
1423  * @since_tizen 5.0
1424  *
1425  * @privlevel platform
1426  * @privilege %http://tizen.org/privilege/voicecontrol.manager
1427  *
1428  * @param[in] cmd_type   The command type (e.g. #VC_COMMAND_TYPE_FOREGROUND, #VC_COMMAND_TYPE_BACKGROUND, #VC_COMMAND_TYPE_WIDGET, #VC_COMMAND_TYPE_SYSTEM, #VC_COMMAND_TYPE_SYSTEM_BACKGROUND, #VC_COMMAND_TYPE_EXCLUSIVE)
1429  *
1430  * @return 0 on success, otherwise a negative error value
1431  * @retval #VC_ERROR_NONE                Successful
1432  * @retval #VC_ERROR_INVALID_STATE       Invalid state
1433  * @retval #VC_ERROR_INVALID_PARAMETER   Invalid parameter
1434  * @retval #VC_ERROR_PERMISSION_DENIED   Permission denied
1435  * @retval #VC_ERROR_NOT_SUPPORTED       VC not supported
1436  *
1437  * @pre The state should be #VC_STATE_READY.
1438  *
1439  * @see vc_mgr_disable_command_type()
1440  */
1441 int vc_mgr_enable_command_type(int cmd_type);
1442
1443 /**
1444  * @platform
1445  * @brief Disables command type as candidate command.
1446  * @since_tizen 5.0
1447  *
1448  * @privlevel platform
1449  * @privilege %http://tizen.org/privilege/voicecontrol.manager
1450  *
1451  * @param[in] cmd_type   The command type (e.g. #VC_COMMAND_TYPE_FOREGROUND, #VC_COMMAND_TYPE_BACKGROUND, #VC_COMMAND_TYPE_WIDGET, #VC_COMMAND_TYPE_SYSTEM, #VC_COMMAND_TYPE_SYSTEM_BACKGROUND, #VC_COMMAND_TYPE_EXCLUSIVE)
1452  *
1453  * @return 0 on success, otherwise a negative error value
1454  * @retval #VC_ERROR_NONE                Successful
1455  * @retval #VC_ERROR_INVALID_STATE       Invalid state
1456  * @retval #VC_ERROR_INVALID_PARAMETER   Invalid parameter
1457  * @retval #VC_ERROR_PERMISSION_DENIED   Permission denied
1458  * @retval #VC_ERROR_NOT_SUPPORTED       VC not supported
1459  *
1460  * @pre The state should be #VC_STATE_READY.
1461  *
1462  * @see vc_mgr_enable_command_type()
1463  */
1464 int vc_mgr_disable_command_type(int cmd_type);
1465
1466 /**
1467  * @platform
1468  * @brief Sets a callback function to be called when engine set private data.
1469  * @since_tizen 5.0
1470  *
1471  * @privlevel platform
1472  * @privilege %http://tizen.org/privilege/voicecontrol.manager
1473  *
1474  * @param[in] callback    Callback function to register
1475  * @param[in] user_data   The user data to be passed to the callback function
1476  *
1477  * @return 0 on success, otherwise a negative error value
1478  * @retval #VC_ERROR_NONE                Successful
1479  * @retval #VC_ERROR_INVALID_PARAMETER   Invalid parameter
1480  * @retval #VC_ERROR_INVALID_STATE       Invalid state
1481  * @retval #VC_ERROR_PERMISSION_DENIED   Permission denied
1482  * @retval #VC_ERROR_NOT_SUPPORTED       VC not supported
1483  *
1484  * @pre The state should be #VC_STATE_INITIALIZED.
1485  *
1486  * @see vc_private_data_set_cb()
1487  * @see vc_mgr_unset_private_data_set_cb()
1488  */
1489 int vc_mgr_set_private_data_set_cb(vc_mgr_private_data_set_cb callback, void *user_data);
1490
1491 /**
1492  * @platform
1493  * @brief Unsets the callback function to be called when engine set private data.
1494  * @since_tizen 5.0
1495  *
1496  * @privlevel platform
1497  * @privilege %http://tizen.org/privilege/voicecontrol.manager
1498  *
1499  * @return 0 on success, otherwise a negative error value
1500  * @retval #VC_ERROR_NONE                Successful
1501  * @retval #VC_ERROR_INVALID_STATE       Invalid state
1502  * @retval #VC_ERROR_PERMISSION_DENIED   Permission denied
1503  * @retval #VC_ERROR_NOT_SUPPORTED       VC not supported
1504  *
1505  * @pre The state should be #VC_STATE_INITIALIZED.
1506  *
1507  * @see vc_mgr_set_private_data_set_cb()
1508  */
1509 int vc_mgr_unset_private_data_set_cb(void);
1510
1511 /**
1512  * @platform
1513  * @brief Sets a callback function to be called when engine request private data.
1514  * @since_tizen 5.0
1515  *
1516  * @privlevel platform
1517  * @privilege %http://tizen.org/privilege/voicecontrol.manager
1518  *
1519  * @param[in] callback    Callback function to register
1520  * @param[in] user_data   The user data to be passed to the callback function
1521  *
1522  * @return 0 on success, otherwise a negative error value
1523  * @retval #VC_ERROR_NONE                Successful
1524  * @retval #VC_ERROR_INVALID_PARAMETER   Invalid parameter
1525  * @retval #VC_ERROR_INVALID_STATE       Invalid state
1526  * @retval #VC_ERROR_PERMISSION_DENIED   Permission denied
1527  * @retval #VC_ERROR_NOT_SUPPORTED       VC not supported
1528  *
1529  * @pre The state should be #VC_STATE_INITIALIZED.
1530  *
1531  * @see vc_private_data_requested_cb()
1532  * @see vc_mgr_unset_private_data_requested_cb()
1533  */
1534 int vc_mgr_set_private_data_requested_cb(vc_mgr_private_data_requested_cb callback, void *user_data);
1535
1536 /**
1537  * @platform
1538  * @brief Unsets the callback function to be called when engine request private data.
1539  * @since_tizen 5.0
1540  *
1541  * @privlevel platform
1542  * @privilege %http://tizen.org/privilege/voicecontrol.manager
1543  *
1544  * @return 0 on success, otherwise a negative error value
1545  * @retval #VC_ERROR_NONE                Successful
1546  * @retval #VC_ERROR_INVALID_STATE       Invalid state
1547  * @retval #VC_ERROR_PERMISSION_DENIED   Permission denied
1548  * @retval #VC_ERROR_NOT_SUPPORTED       VC not supported
1549  *
1550  * @pre The state should be #VC_STATE_INITIALIZED.
1551  *
1552  * @see vc_mgr_set_private_data_requested_cb()
1553  */
1554 int vc_mgr_unset_private_data_requested_cb(void);
1555
1556 /* for TTS feedback */
1557 /**
1558 * @brief Sets a callback function to be called when engine sends audio formats necessary for playing TTS feedback.
1559 *
1560 * @param[in] callback Callback function to set
1561 * @param[in] user_data The user data to be passed to the callback function
1562 *
1563 * @return 0 on success, otherwise a negative error value
1564 * @retval #VC_ERROR_NONE Successful
1565 * @retval #VC_ERROR_INVALID_PARAMETER Invalid parameter
1566 * @retval #VC_ERROR_INVALID_STATE Invalid state
1567 *
1568 * @pre The state should be #VC_STATE_INITIALIZED.
1569 *
1570 * @see vc_mgr_feedback_audio_format_cb()
1571 * @see vc_mgr_unset_feedback_audio_format_cb()
1572 */
1573 int vc_mgr_set_feedback_audio_format_cb(vc_mgr_feedback_audio_format_cb callback, void* user_data);
1574
1575 /**
1576 * @brief Unsets a callback function to be called when engine sends audio formats necessary for playing TTS feedback.
1577 *
1578 * @return 0 on success, otherwise a negative error value
1579 * @retval #VC_ERROR_NONE Successful
1580 * @retval #VC_ERROR_INVALID_STATE Invalid state
1581 *
1582 * @pre The state should be #VC_STATE_INITIALIZED.
1583 *
1584 * @see vc_mgr_feedback_audio_format_cb()
1585 * @see vc_mgr_set_feedback_audio_format_cb()
1586 */
1587 int vc_mgr_unset_feedback_audio_format_cb(void);
1588
1589 /**
1590 * @brief Sets a callback function to be called when engine sends audio streaming for TTS feedback.
1591 *
1592 * @param[in] callback Callback function to set
1593 * @param[in] user_data The user data to be passed to the callback function
1594 *
1595 * @return 0 on success, otherwise a negative error value
1596 * @retval #VC_ERROR_NONE Successful
1597 * @retval #VC_ERROR_INVALID_PARAMETER Invalid parameter
1598 * @retval #VC_ERROR_INVALID_STATE Invalid state
1599 *
1600 * @pre The state should be #VC_STATE_INITIALIZED.
1601 *
1602 * @see vc_mgr_feedback_streaming_cb()
1603 * @see vc_mgr_unset_feedback_streaming_cb()
1604 */
1605 int vc_mgr_set_feedback_streaming_cb(vc_mgr_feedback_streaming_cb callback, void* user_data);
1606
1607 /**
1608 * @brief Unsets a callback function to be called when engine sends audio streaming for TTS feedback.
1609 *
1610 * @return 0 on success, otherwise a negative error value
1611 * @retval #VC_ERROR_NONE Successful
1612 * @retval #VC_ERROR_INVALID_STATE Invalid state
1613 *
1614 * @pre The state should be #VC_STATE_INITIALIZED.
1615 *
1616 * @see vc_mgr_feedback_streaming_cb()
1617 * @see vc_mgr_set_feedback_streaming_cb()
1618 */
1619 int vc_mgr_unset_feedback_streaming_cb(void);
1620
1621 /**
1622 * @brief Starts getting TTS feedback streaming data from the buffer.
1623 *
1624 * @remarks In order to get TTS feedback streaming data, the application should set 'vc_mgr_feedback_streaming_cb()' using vc_mgr_set_feedback_streaming_cb().
1625 *
1626 * @return 0 on success, otherwise a negative error value
1627 * @retval #VC_ERROR_NONE Successful
1628 * @retval #VC_ERROR_INVALID_STATE Invalid state
1629 *
1630 * @pre The state should be #VC_STATE_READY. \n
1631 *      'vc_mgr_feedback_streaming_cb()' should be registered.
1632 *
1633 * @see vc_mgr_feedback_streaming_cb()
1634 * @see vc_mgr_set_feedback_streaming_cb()
1635 * @see vc_mgr_unset_feedback_streaming_cb()
1636 * @see vc_mgr_stop_feedback()
1637 */
1638 int vc_mgr_start_feedback(void);
1639
1640 /**
1641 * @brief Stops getting and removes TTS feedback streaming data from the buffer.
1642 *
1643 * @return 0 on success, otherwise a negative error value
1644 * @retval #VC_ERROR_NONE Successful
1645 * @retval #VC_ERROR_INVALID_STATE Invalid state
1646 *
1647 * @pre The state should be #VC_STATE_READY.
1648 *
1649 * @see vc_mgr_feedback_streaming_cb()
1650 * @see vc_mgr_set_feedback_streaming_cb()
1651 * @see vc_mgr_unset_feedback_streaming_cb()
1652 * @see vc_mgr_start_feedback()
1653 */
1654 int vc_mgr_stop_feedback(void);
1655
1656
1657 #ifdef __cplusplus
1658 }
1659 #endif
1660
1661 /**
1662  * @}
1663  */
1664
1665 #endif /* __VOICE_CONTROL_MANAGER_H__ */
1666