89789089840c6281ce693826e95fd3310158f7ec
[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 Enumeration of audio streaming event.
128  * @since_tizen 6.0
129  */
130 typedef enum {
131         VC_AUDIO_STREAMING_EVENT_FAIL = -1,             /**< Failed */
132         VC_AUDIO_STREAMING_EVENT_START = 1,             /**< Start event */
133         VC_AUDIO_STREAMING_EVENT_CONTINUE = 2,  /**< Continue event */
134         VC_AUDIO_STREAMING_EVENT_FINISH = 3             /**< Finish event */
135 } vc_audio_streaming_event_e;
136
137 /**
138  * @brief Enumeration of audio streaming mode.
139  * @since_tizen 6.0
140  */
141 typedef enum {
142         VC_AUDIO_STREAMING_MODE_VC_SERVICE = 0,                 /**< Use audio recording from VC service */
143         VC_AUDIO_STREAMING_MODE_MULTI_ASSISTANT = 1,    /**< Use audio streaming from multi-assistant */
144         VC_AUDIO_STREAMING_MODE_OUTSIDE = 2,                    /**< Use audio streaming from outside */
145 } vc_audio_streaming_mode_e;
146
147 /**
148  * @brief Enumeration of background volume event.
149  * @since_tizen 6.0
150  */
151 typedef enum {
152         VC_BACKGROUND_VOLUME_EVENT_CHANGE_FOR_NEARFIELD = 0,    /**< Background volume event for near-field */
153         VC_BACKGROUND_VOLUME_EVENT_CHANGE_FOR_FARFIELD                  /**< Background volume event for far-field */
154 } vc_background_volume_event_e;
155
156 /**
157  * @brief Called when client gets the all recognition results from voice control service.
158  * @since_tizen 5.0
159  *
160  * @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
161  *      The @a result and @a msg are also managed by the platform and will be released when invoking this callback is finished.
162  *
163  * @param[in] event         The result event
164  * @param[in] vc_cmd_list   Command list handle
165  * @param[in] result        Command text
166  * @param[in] msg           Engine message (e.g. #VC_RESULT_MESSAGE_NONE, #VC_RESULT_MESSAGE_ERROR_TOO_LOUD)
167  * @param[in] user_data     The user data passed from the callback registration function
168  *
169  * @return @c true to release command to client, \n @c false to wait for selecting command.
170  * @pre An application registers callback function using vc_mgr_set_all_result_cb().
171  *
172  * @see vc_mgr_set_all_result_cb()
173  * @see vc_mgr_unset_all_result_cb()
174  */
175 typedef bool (*vc_mgr_all_result_cb)(vc_result_event_e event, vc_cmd_list_h vc_cmd_list,
176                                 const char *result, const char *msg, void *user_data);
177
178 /**
179  * @brief Called when client gets the pre recognition results (partial ASR) from voice control service.
180  * @since_tizen 5.0
181  *
182  * @remarks The @a result is managed by the platform and will be released when invoking this callback is finished.
183  *
184  * @param[in] event       The pre result event
185  * @param[in] result      ASR text
186  * @param[in] user_data   The user data passed from the callback registration function
187  *
188  * @pre An application registers callback function using vc_mgr_set_pre_result_cb().
189  *
190  * @see vc_mgr_set_pre_result_cb()
191  * @see vc_mgr_unset_pre_result_cb()
192  */
193 typedef void (*vc_mgr_pre_result_cb)(vc_pre_result_event_e event, const char *result, void *user_data);
194
195 /**
196  * @brief Called when client gets the specific engine's result from vc-service.
197  * @since_tizen 5.0
198  *
199  * @param[in] engine_app_id The specific engine's app id
200  * @param[in] event The specific engine event type
201  * @param[in] result The specific engine result
202  * @param[in] user_data The user data passed from the callback registration function
203  *
204  * @pre An application registers callback function using vc_mgr_set_specific_engine_result_cb().
205  *
206  * @see vc_mgr_set_specific_engine_result_cb()
207  * @see vc_mgr_unset_specific_engine_result_cb()
208  */
209 typedef void (*vc_mgr_specific_engine_result_cb)(const char* engine_app_id, const char* event, const char* result, void *user_data);
210
211 /**
212  * @brief Called when user speaking is detected.
213  * @since_tizen 5.0
214  *
215  * @param[in] user_data   The user data passed from the callback registration function
216  *
217  * @pre An application registers callback function using vc_mgr_set_speech_detected_cb().
218  *
219  * @see vc_mgr_set_speech_detected_cb()
220  * @see vc_mgr_unset_speech_detected_cb()
221  */
222 typedef void (*vc_mgr_begin_speech_detected_cb)(void *user_data);
223
224
225 /**
226  * @brief Called when an application (VC client) requests dialog.
227  * @since_tizen 5.0
228  *
229  * @remarks The @a disp_text and @a utt_text are managed by the platform and will be released when invoking this callback is finished.
230  *
231  * @param[in] pid          Pid of VC client to request dialog
232  * @param[in] disp_text    Text requested to be displayed
233  * @param[in] utt_text     Text requested to be spoken
234  * @param[in] continuous   Continue dialog session
235  * @param[in] user_data    The user data passed from the callback registration function
236  *
237  * @pre An application registers callback function using vc_mgr_set_dialog_request_cb().
238  *
239  * @see vc_mgr_set_dialog_request_cb()
240  * @see vc_mgr_unset_dialog_request_cb()
241  */
242 typedef void (*vc_mgr_dialog_request_cb)(int pid, const char *disp_text, const char *utt_text, bool continuous, void *user_data);
243
244 /**
245  * @brief Called when engine sets private data to manager client.
246  * @since_tizen 5.0
247  *
248  * @remarks The @a key and @a data are managed by the platform and will be released when invoking this callback is finished.
249  *
250  * @param[in] key         Private key
251  * @param[in] data        Private data
252  * @param[in] user_data   The user data passed from the callback registration function
253  *
254  * @pre An application registers callback function using vc_mgr_set_private_data_set_cb().
255  *
256  * @see vc_mgr_set_private_data_set_cb()
257  * @see vc_mgr_unset_private_data_set_cb()
258  */
259 typedef int (*vc_mgr_private_data_set_cb)(const char *key, const char *data, void *user_data);
260
261 /**
262  * @brief Called when engine requests private data from manager client.
263  * @since_tizen 5.0
264  *
265  * @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.
266  *
267  * @param[in]  key         Private key
268  * @param[out] data        Private data
269  * @param[in]  user_data   The user data passed from the callback registration function
270  *
271  * @pre An application registers callback function using vc_mgr_set_private_data_requested_cb().
272  *
273  * @see vc_mgr_set_private_data_requested_cb()
274  * @see vc_mgr_unset_private_data_requested_cb()
275  */
276 typedef int (*vc_mgr_private_data_requested_cb)(const char *key, char **data, void *user_data);
277
278 /* for TTS feedback */
279 /**
280  * @brief Called when engine sends audio formats necessary for playing TTS feedback.
281  * @since_tizen 5.0
282  *
283  * @param[in] rate Audio sampling rate
284  * @param[in] channel Audio channel (e.g. #VC_AUDIO_CHANNEL_MONO, #VC_AUDIO_CHANNEL_STEREO)
285  * @param[in] audio_type Audio type (e.g. #VC_AUDIO_TYPE_PCM_S16_LE, #VC_AUDIO_TYPE_PCM_U8)
286  * @param[in] user_data The user data passed from the callback registration function
287  *
288  * @pre An application registers callback function using vc_mgr_set_feedback_audio_format_cb().
289  *
290  * @see vc_mgr_set_feedback_audio_format_cb()
291  * @see vc_mgr_unset_feedback_audio_format_cb()
292  */
293 typedef void (*vc_mgr_feedback_audio_format_cb)(int rate, vc_audio_channel_e channel, vc_audio_type_e audio_type, void *user_data);
294
295 /**
296  * @brief Called when engine sends audio streaming for TTS feedback.
297  * @since_tizen 5.0
298  *
299  * @remarks The @a buffer must be released with free() by you when you no longer need it.
300  *
301  * @param[in] event TTS feedback event (e.g. #VC_FEEDBACK_EVENT_START, #VC_FEEDBACK_EVENT_CONTINUE)
302  * @param[in] buffer Audio streaming data
303  * @param[in] len Length of the audio streaming data
304  * @param[in] user_data The user data passed from the callback registration function
305  *
306  * @pre An application registers callback function using vc_mgr_set_feedback_streaming_cb().
307  *
308  * @see vc_mgr_set_feedback_streaming_cb()
309  * @see vc_mgr_unset_feedback_streaming_cb()
310  */
311 typedef void (*vc_mgr_feedback_streaming_cb)(vc_feedback_event_e event, char* buffer, int len, void *user_data);
312
313 /**
314  * @brief Called when the vc client sends audio streaming for TTS feedback.
315  * @since_tizen 5.0
316  *
317  * @remarks The @a buffer must be released with free() by you when you no longer need it.
318  *
319  * @param[in] pid The process id of the vc client
320  * @param[in] utt_id The utterance id
321  * @param[in] event TTS feedback event (e.g. #VC_FEEDBACK_EVENT_START, #VC_FEEDBACK_EVENT_CONTINUE)
322  * @param[in] buffer Audio streaming data
323  * @param[in] len Length of the audio streaming data
324  * @param[in] user_data The user data passed from the callback registration function
325  *
326  * @pre An application registers callback function using vc_mgr_set_vc_tts_streaming_cb().
327  *
328  * @see vc_mgr_set_vc_tts_streaming_cb()
329  * @see vc_mgr_unset_vc_tts_streaming_cb()
330  */
331 typedef void (*vc_mgr_vc_tts_streaming_cb)(int pid, int utt_id, vc_feedback_event_e event, char* buffer, int len, void *user_data);
332
333 /**
334  * @platform
335  * @brief Initializes the voice control manager.
336  * @since_tizen 5.0
337  *
338  * @privlevel public
339  * @privilege %http://tizen.org/privilege/recorder
340  *
341  * @privlevel platform
342  * @privilege %http://tizen.org/privilege/voicecontrol.manager
343  *
344  * @remarks If the function succeeds, VC manager must be released with vc_mgr_deinitialize().
345  *
346  * @return 0 on success, otherwise a negative error value
347  * @retval #VC_ERROR_NONE                Successful
348  * @retval #VC_ERROR_NOT_SUPPORTED       VC not supported
349  * @retval #VC_ERROR_PERMISSION_DENIED   Permission denied
350  * @retval #VC_ERROR_OUT_OF_MEMORY       Out of memory
351  * @retval #VC_ERROR_OPERATION_FAILED    Operation fail
352  *
353  * @pre The state should be #VC_STATE_NONE.
354  * @post If this function is called, the state will be #VC_STATE_INITIALIZED.
355  *
356  * @see vc_mgr_deinitialize()
357  */
358 int vc_mgr_initialize(void);
359
360 /**
361  * @platform
362  * @brief Deinitializes the voice control manager.
363  * @since_tizen 5.0
364  *
365  * @privlevel platform
366  * @privilege %http://tizen.org/privilege/voicecontrol.manager
367  *
368  * @return 0 on success, otherwise a negative error value
369  * @retval #VC_ERROR_NONE                Successful
370  * @retval #VC_ERROR_NOT_SUPPORTED       VC not supported
371  * @retval #VC_ERROR_PERMISSION_DENIED   Permission denied
372  * @retval #VC_ERROR_INVALID_STATE       Invalid state
373  *
374  * @post If this function is called, the state will be #VC_STATE_NONE.
375  *
376  * @see vc_mgr_initialize()
377  */
378 int vc_mgr_deinitialize(void);
379
380 /**
381  * @platform
382  * @brief Connects the voice control service.
383  * @since_tizen 5.0
384  *
385  * @privlevel platform
386  * @privilege %http://tizen.org/privilege/voicecontrol.manager
387  *
388  * @return 0 on success, otherwise a negative error value
389  * @retval #VC_ERROR_NONE                Successful
390  * @retval #VC_ERROR_NOT_SUPPORTED       VC not supported
391  * @retval #VC_ERROR_PERMISSION_DENIED   Permission denied
392  * @retval #VC_ERROR_INVALID_STATE       Invalid state
393  *
394  * @pre The state should be #VC_STATE_INITIALIZED.
395  * @post If this function is called, the state will be #VC_STATE_READY.
396  *
397  * @see vc_mgr_unprepare()
398  */
399 int vc_mgr_prepare(void);
400
401 /**
402  * @platform
403  * @brief Disconnects the voice control service.
404  * @since_tizen 5.0
405  *
406  * @privlevel platform
407  * @privilege %http://tizen.org/privilege/voicecontrol.manager
408  *
409  * @return 0 on success, otherwise a negative error value
410  * @retval #VC_ERROR_NONE                Successful
411  * @retval #VC_ERROR_NOT_SUPPORTED       VC not supported
412  * @retval #VC_ERROR_PERMISSION_DENIED   Permission denied
413  * @retval #VC_ERROR_INVALID_STATE       Invalid state
414  *
415  * @pre The state should be #VC_STATE_READY.
416  * @post If this function is called, the state will be #VC_STATE_INITIALIZED.
417  *
418  * @see vc_mgr_prepare()
419  */
420 int vc_mgr_unprepare(void);
421
422 /**
423  * @platform
424  * @brief Retrieves all supported languages using callback function.
425  * @since_tizen 5.0
426  *
427  * @privlevel platform
428  * @privilege %http://tizen.org/privilege/voicecontrol.manager
429  *
430  * @param[in] callback    Callback function to invoke
431  * @param[in] user_data   The user data to be passed to the callback function
432  *
433  * @return 0 on success, otherwise a negative error value
434  * @retval #VC_ERROR_NONE                Successful
435  * @retval #VC_ERROR_NOT_SUPPORTED       VC not supported
436  * @retval #VC_ERROR_PERMISSION_DENIED   Permission denied
437  * @retval #VC_ERROR_INVALID_PARAMETER   Invalid parameter
438  * @retval #VC_ERROR_OPERATION_FAILED    Operation failure
439  * @retval #VC_ERROR_INVALID_STATE       Invalid state
440  *
441  * @pre The state should NOT be #VC_SERVICE_STATE_NONE.
442  * @post This function invokes vc_supported_language_cb() for each supported language.
443  *
444  * @see vc_supported_language_cb()
445  * @see vc_mgr_get_current_language()
446  */
447 int vc_mgr_foreach_supported_languages(vc_supported_language_cb callback, void *user_data);
448
449 /**
450  * @platform
451  * @brief Gets the current language set by user.
452  * @since_tizen 5.0
453  *
454  * @privlevel platform
455  * @privilege %http://tizen.org/privilege/voicecontrol.manager
456  *
457  * @remarks If the function succeeds, @a language must be released with free() by you when you no longer need it.
458  *
459  * @param[out] language   A language is specified as an ISO 3166 alpha-2 two letter country-code \n
460  *      followed by ISO 639-1 for the two-letter language code. \n
461  *      For example, "ko_KR" for Korean, "en_US" for American English.
462  *
463  * @return 0 on success, otherwise a negative error value
464  * @retval #VC_ERROR_NONE                Successful
465  * @retval #VC_ERROR_NOT_SUPPORTED       VC not supported
466  * @retval #VC_ERROR_PERMISSION_DENIED   Permission denied
467  * @retval #VC_ERROR_INVALID_PARAMETER   Invalid parameter
468  * @retval #VC_ERROR_OUT_OF_MEMORY       Out of memory
469  * @retval #VC_ERROR_OPERATION_FAILED    Operation failure
470  * @retval #VC_ERROR_INVALID_STATE       Invalid state
471  *
472  * @pre The state should NOT be #VC_SERVICE_STATE_NONE.
473  *
474  * @see vc_mgr_foreach_supported_languages()
475  */
476 int vc_mgr_get_current_language(char **language);
477
478 /**
479  * @platform
480  * @brief Gets the current state of voice control manager.
481  * @since_tizen 5.0
482  *
483  * @privlevel platform
484  * @privilege %http://tizen.org/privilege/voicecontrol.manager
485  *
486  * @param[out] state   The current state
487  *
488  * @return 0 on success, otherwise a negative error value
489  * @retval #VC_ERROR_NONE                Successful
490  * @retval #VC_ERROR_NOT_SUPPORTED       VC not supported
491  * @retval #VC_ERROR_PERMISSION_DENIED   Permission denied
492  * @retval #VC_ERROR_INVALID_PARAMETER   Invalid parameter
493  * @retval #VC_ERROR_INVALID_STATE       Invalid state
494  *
495  * @pre The state should NOT be #VC_SERVICE_STATE_NONE.
496  *
497  * @see vc_state_changed_cb()
498  * @see vc_set_state_changed_cb()
499  */
500 int vc_mgr_get_state(vc_state_e *state);
501
502 /**
503  * @platform
504  * @brief Gets the current state of voice control service.
505  * @since_tizen 5.0
506  *
507  * @privlevel platform
508  * @privilege %http://tizen.org/privilege/voicecontrol.manager
509  *
510  * @param[out] state   The current state
511  *
512  * @return 0 on success, otherwise a negative error value
513  * @retval #VC_ERROR_NONE                Successful
514  * @retval #VC_ERROR_NOT_SUPPORTED       VC not supported
515  * @retval #VC_ERROR_PERMISSION_DENIED   Permission denied
516  * @retval #VC_ERROR_INVALID_PARAMETER   Invalid parameter
517  * @retval #VC_ERROR_INVALID_STATE       Invalid state
518  * @retval #VC_ERROR_OPERATION_FAILED    Operation failure
519  *
520  * @pre The state should be #VC_STATE_READY.
521  *
522  * @see vc_mgr_start()
523  * @see vc_mgr_stop()
524  * @see vc_mgr_cancel()
525  * @see vc_set_service_state_changed_cb()
526  * @see vc_unset_service_state_changed_cb()
527  */
528 int vc_mgr_get_service_state(vc_service_state_e *state);
529
530 /**
531  * @platform
532  * @brief Checks whether the command format is supported.
533  * @since_tizen 5.0
534  *
535  * @privlevel platform
536  * @privilege %http://tizen.org/privilege/voicecontrol.manager
537  *
538  * @remarks The command formats are defined in @ref CAPI_UIX_VOICE_CONTROL_COMMAND_MODULE. (e.g. #VC_COMMAND_FORMAT_FIXED, #VC_COMMAND_FORMAT_FIXED_AND_NONFIXED, and so on). Please refer to @ref CAPI_UIX_VOICE_CONTROL_COMMAND_MODULE.
539  *
540  * @param[in]  format    The command format
541  * @param[out] support   The result status @c true = supported, @c false = not supported
542  *
543  * @return 0 on success, otherwise a negative error value
544  * @retval #VC_ERROR_NONE                Successful
545  * @retval #VC_ERROR_NOT_SUPPORTED       VC not supported
546  * @retval #VC_ERROR_PERMISSION_DENIED   Permission denied
547  * @retval #VC_ERROR_INVALID_PARAMETER   Invalid parameter
548  * @retval #VC_ERROR_INVALID_STATE       Invalid state
549  *
550  * @pre The state should be #VC_STATE_READY.
551  */
552 int vc_mgr_is_command_format_supported(int format, bool *support);
553
554 /**
555  * @platform
556  * @brief Sets all types of commands.
557  * @since_tizen 5.0
558  *
559  * @privlevel platform
560  * @privilege %http://tizen.org/privilege/voicecontrol.manager
561  *
562  * @remarks VC manager client can register all types of commands.
563  *      The commands should include type, command text, format.
564  *
565  * @param[in] vc_cmd_list   The command list handle
566  *
567  * @return 0 on success, otherwise a negative error value
568  * @retval #VC_ERROR_NONE                Successful
569  * @retval #VC_ERROR_NOT_SUPPORTED       VC not supported
570  * @retval #VC_ERROR_PERMISSION_DENIED   Permission denied
571  * @retval #VC_ERROR_INVALID_PARAMETER   Invalid parameter
572  * @retval #VC_ERROR_INVALID_STATE       Invalid state
573  *
574  * @pre The state should be #VC_STATE_READY.
575  *
576  * @see vc_mgr_unset_command_list()
577  */
578 int vc_mgr_set_command_list(vc_cmd_list_h vc_cmd_list);
579
580 /**
581  * @platform
582  * @brief Unsets all types of commands.
583  * @since_tizen 5.0
584  *
585  * @privlevel platform
586  * @privilege %http://tizen.org/privilege/voicecontrol.manager
587  *
588  * @remarks All previously registered commands will be unset.
589  *
590  * @return 0 on success, otherwise a negative error value
591  * @retval #VC_ERROR_NONE                Successful
592  * @retval #VC_ERROR_NOT_SUPPORTED       VC not supported
593  * @retval #VC_ERROR_PERMISSION_DENIED   Permission denied
594  * @retval #VC_ERROR_INVALID_STATE       Invalid state
595  *
596  * @pre The state should be #VC_STATE_READY.
597  *
598  * @see vc_mgr_set_command_list()
599  */
600 int vc_mgr_unset_command_list(void);
601
602 /**
603  * @platform
604  * @brief Sets commands from file.
605  * @since_tizen 5.0
606  *
607  * @privlevel platform
608  * @privilege %http://tizen.org/privilege/voicecontrol.manager
609  *
610  * @remarks The commands should include type, command text, format.
611  *
612  * @param[in] file_path   The directory of a file which has command list
613  * @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)
614  *
615  * @return 0 on success, otherwise a negative error value
616  * @retval #VC_ERROR_NONE                Successful
617  * @retval #VC_ERROR_NOT_SUPPORTED       VC not supported
618  * @retval #VC_ERROR_PERMISSION_DENIED   Permission denied
619  * @retval #VC_ERROR_INVALID_PARAMETER   Invalid parameter
620  * @retval #VC_ERROR_INVALID_STATE       Invalid state
621  * @retval #VC_ERROR_OPERATION_FAILED    Operation failure
622  *
623  * @pre The state should be #VC_STATE_READY.
624  *
625  * @see vc_mgr_unset_command_list()
626  */
627 int vc_mgr_set_command_list_from_file(const char *file_path, int type);
628
629 /**
630  * @platform
631  * @brief Sets background commands of preloaded app from file.
632  * @since_tizen 5.0
633  *
634  * @privlevel platform
635  * @privilege %http://tizen.org/privilege/voicecontrol.manager
636  *
637  * @remarks The command type is valid for #VC_COMMAND_TYPE_BACKGROUND.
638  *      The commands should include type, command text, format.
639  *
640  * @param[in] file_path   The directory of a file which has command list
641  *
642  * @return 0 on success, otherwise a negative error value
643  * @retval #VC_ERROR_NONE                Successful
644  * @retval #VC_ERROR_NOT_SUPPORTED       VC not supported
645  * @retval #VC_ERROR_PERMISSION_DENIED   Permission denied
646  * @retval #VC_ERROR_INVALID_PARAMETER   Invalid parameter
647  * @retval #VC_ERROR_INVALID_STATE       Invalid state
648  * @retval #VC_ERROR_OPERATION_FAILED    Operation failure
649  *
650  * @pre The state should be #VC_STATE_READY.
651  *
652  * @see vc_mgr_unset_command_list()
653  */
654 int vc_mgr_set_preloaded_commands_from_file(const char *file_path);
655
656 /**
657  * @platform
658  * @brief Retrieves all available commands.
659  * @since_tizen 5.0
660  *
661  * @privlevel platform
662  * @privilege %http://tizen.org/privilege/voicecontrol.manager
663  *
664  * @remarks If the function succeeds, @a vc_cmd_list must be released with vc_cmd_list_destroy(vc_cmd_list, true).
665  *
666  * @param[in] vc_cmd_list   The command list
667  *
668  * @return 0 on success, otherwise a negative error value
669  * @retval #VC_ERROR_NONE                Successful
670  * @retval #VC_ERROR_NOT_SUPPORTED       VC not supported
671  * @retval #VC_ERROR_PERMISSION_DENIED   Permission denied
672  * @retval #VC_ERROR_INVALID_PARAMETER   Invalid parameter
673  * @retval #VC_ERROR_INVALID_STATE       Invalid state
674  * @retval #VC_ERROR_OPERATION_FAILED    Operation failure
675  *
676  * @pre The state should be #VC_STATE_READY and the service state should be #VC_SERVICE_STATE_READY.
677  */
678 int vc_mgr_get_current_commands(vc_cmd_list_h *vc_cmd_list);
679
680 /**
681  * @platform
682  * @brief Sets a type of audio-in.
683  * @since_tizen 5.0
684  *
685  * @privlevel platform
686  * @privilege %http://tizen.org/privilege/voicecontrol.manager
687  *
688  * @param[in] audio_id   The audio type (e.g. #VC_AUDIO_TYPE_BLUETOOTH or USB device ID)
689  *
690  * @return 0 on success, otherwise a negative error value
691  * @retval #VC_ERROR_NONE                Successful
692  * @retval #VC_ERROR_NOT_SUPPORTED       VC not supported
693  * @retval #VC_ERROR_PERMISSION_DENIED   Permission denied
694  * @retval #VC_ERROR_INVALID_PARAMETER   Invalid parameter
695  * @retval #VC_ERROR_INVALID_STATE       Invalid state
696  * @retval #VC_ERROR_OPERATION_FAILED    Operation failure
697  *
698  * @pre The state should be #VC_STATE_READY and the service state should be #VC_SERVICE_STATE_READY.
699  *
700  * @see vc_mgr_get_audio_type()
701  */
702 int vc_mgr_set_audio_type(const char *audio_id);
703
704 /**
705  * @platform
706  * @brief Gets a type of audio-in.
707  * @since_tizen 5.0
708  *
709  * @privlevel platform
710  * @privilege %http://tizen.org/privilege/voicecontrol.manager
711  *
712  * @remarks audio_id must be released using free() when it is no longer required.
713  *
714  * @param[out] audio_id   The audio id (e.g. #VC_AUDIO_TYPE_BLUETOOTH or USB device ID)
715  *
716  * @return 0 on success, otherwise a negative error value
717  * @retval #VC_ERROR_NONE                Successful
718  * @retval #VC_ERROR_NOT_SUPPORTED       VC not supported
719  * @retval #VC_ERROR_PERMISSION_DENIED   Permission denied
720  * @retval #VC_ERROR_INVALID_PARAMETER   Invalid parameter
721  * @retval #VC_ERROR_INVALID_STATE       Invalid state
722  *
723  * @pre The state should be #VC_STATE_READY and the service state should be #VC_SERVICE_STATE_READY.
724  *
725  * @see vc_mgr_set_audio_type()
726  */
727 int vc_mgr_get_audio_type(char **audio_id);
728
729 /**
730  * @platform
731  * @brief Sets recognition mode.
732  * @since_tizen 5.0
733  *
734  * @privlevel platform
735  * @privilege %http://tizen.org/privilege/voicecontrol.manager
736  *
737  * @param[in] mode   Recognition mode (e.g. #VC_RECOGNITION_MODE_STOP_BY_SILENCE is default value)
738  *
739  * @return 0 on success, otherwise a negative error value
740  * @retval #VC_ERROR_NONE                Successful
741  * @retval #VC_ERROR_NOT_SUPPORTED       VC not supported
742  * @retval #VC_ERROR_PERMISSION_DENIED   Permission denied
743  * @retval #VC_ERROR_INVALID_PARAMETER   Invalid parameter
744  * @retval #VC_ERROR_INVALID_STATE       Invalid state
745  *
746  * @pre The state should be #VC_STATE_READY and the service state should be #VC_SERVICE_STATE_READY.
747  *
748  * @see vc_mgr_get_recognition_mode()
749  */
750 int vc_mgr_set_recognition_mode(vc_recognition_mode_e mode);
751
752 /**
753  * @platform
754  * @brief Gets recognition mode.
755  * @since_tizen 5.0
756  *
757  * @privlevel platform
758  * @privilege %http://tizen.org/privilege/voicecontrol.manager
759  *
760  * @param[out] mode   Recognition mode
761  *
762  * @return 0 on success, otherwise a negative error value
763  * @retval #VC_ERROR_NONE                Successful
764  * @retval #VC_ERROR_NOT_SUPPORTED       VC not supported
765  * @retval #VC_ERROR_PERMISSION_DENIED   Permission denied
766  * @retval #VC_ERROR_INVALID_PARAMETER   Invalid parameter
767  * @retval #VC_ERROR_INVALID_STATE       Invalid state
768  *
769  * @pre The state should be #VC_STATE_READY.
770  *
771  * @see vc_mgr_set_recognition_mode()
772  */
773 int vc_mgr_get_recognition_mode(vc_recognition_mode_e *mode);
774
775 /**
776  * @platform
777  * @brief Sets private data to VC engine.
778  * @since_tizen 5.0
779  *
780  * @privlevel platform
781  * @privilege %http://tizen.org/privilege/voicecontrol.manager
782  *
783  * @remarks VC manager client can set private data to VC engine using this function.
784  *
785  * @param[in] key    Private key
786  * @param[in] data   Private data
787  *
788  * @return 0 on success, otherwise a negative error value
789  * @retval #VC_ERROR_NONE                Successful
790  * @retval #VC_ERROR_NOT_SUPPORTED       VC not supported
791  * @retval #VC_ERROR_PERMISSION_DENIED   Permission denied
792  * @retval #VC_ERROR_INVALID_PARAMETER   Invalid parameter
793  * @retval #VC_ERROR_OUT_OF_MEMORY       Not enough memory
794  * @retval #VC_ERROR_INVALID_STATE       Invalid state
795  *
796  * @pre The service state should be #VC_SERVICE_STATE_READY.
797  */
798 int vc_mgr_set_private_data(const char *key, const char *data);
799
800 /**
801  * @platform
802  * @brief Gets private data from VC engine.
803  * @since_tizen 5.0
804  *
805  * @privlevel platform
806  * @privilege %http://tizen.org/privilege/voicecontrol.manager
807  *
808  * @remarks VC manager client can get private data from VC engine using this function.
809  *      @a data must be released using free() when it is no longer required.
810  *
811  * @param[in]  key    Private key
812  * @param[out] data   Private data
813  *
814  * @return 0 on success, otherwise a negative error value
815  * @retval #VC_ERROR_NONE                Successful
816  * @retval #VC_ERROR_NOT_SUPPORTED       VC not supported
817  * @retval #VC_ERROR_PERMISSION_DENIED   Permission denied
818  * @retval #VC_ERROR_INVALID_PARAMETER   Invalid parameter
819  * @retval #VC_ERROR_OUT_OF_MEMORY       Not enough memory
820  * @retval #VC_ERROR_INVALID_STATE       Invalid state
821  *
822  * @pre The service state should be #VC_SERVICE_STATE_READY.
823  */
824 int vc_mgr_get_private_data(const char *key, char **data);
825
826 /**
827  * @platform
828  * @brief Requests to do action as if utterance is spoken.
829  * @since_tizen 5.0
830  *
831  * @privlevel platform
832  * @privilege %http://tizen.org/privilege/voicecontrol.manager
833  *
834  * @param[in] type         Event type
835  * @param[in] send_event   The string for send event
836  *
837  * @return 0 on success, otherwise a negative error value
838  * @retval #VC_ERROR_NONE                Successful
839  * @retval #VC_ERROR_NOT_SUPPORTED       VC not supported
840  * @retval #VC_ERROR_PERMISSION_DENIED   Permission denied
841  * @retval #VC_ERROR_INVALID_PARAMETER   Invalid parameter
842  * @retval #VC_ERROR_OUT_OF_MEMORY       Not enough memory
843  * @retval #VC_ERROR_INVALID_STATE       Invalid state
844  *
845  * @pre The service state should be #VC_SERVICE_STATE_READY.
846  */
847 int vc_mgr_do_action(vc_send_event_type_e type, char *send_event);
848
849 /**
850  * @platform
851  * @brief Sends the specific engine request to the vc-service.
852  * @since_tizen 5.0
853  *
854  * @privlevel platform
855  * @privilege %http://tizen.org/privilege/voicecontrol.manager
856  *
857  * @param[in] engine_app_id A specific engine's app id
858  * @param[in] event A engine service user request event
859  * @param[in] request A engine service user request text
860  *
861  * @return 0 on success, otherwise a negative error value
862  * @retval #VC_ERROR_NONE               Successful
863  * @retval #VC_ERROR_NOT_SUPPORTED      VC not supported
864  * @retval #VC_ERROR_PERMISSION_DENIED  Permission denied
865  * @retval #VC_ERROR_INVALID_PARAMETER  Invalid parameter
866  * @retval #VC_ERROR_OUT_OF_MEMORY      Not enough memory
867  * @retval #VC_ERROR_INVALID_STATE      Invalid state
868  * @retval #VC_ERROR_OPERATION_FAILED   Operation failure
869  */
870 int vc_mgr_send_specific_engine_request(const char* engine_app_id, const char* event, const char* request);
871
872 /**
873  * @platform
874  * @brief Starts recognition.
875  * @since_tizen 5.0
876  *
877  * @privlevel platform
878  * @privilege %http://tizen.org/privilege/voicecontrol.manager
879  *
880  * @remarks The default recognition mode is #VC_RECOGNITION_MODE_STOP_BY_SILENCE. \n
881  *      If you want to use other mode, you can set mode with vc_mgr_set_recognition_mode().
882  *
883  * @param[in] exclusive_command_option   Exclusive command option
884  *
885  * @return 0 on success, otherwise a negative error value
886  * @retval #VC_ERROR_NONE                       Successful
887  * @retval #VC_ERROR_NOT_SUPPORTED              VC not supported
888  * @retval #VC_ERROR_PERMISSION_DENIED          Permission denied
889  * @retval #VC_ERROR_INVALID_PARAMETER          Invalid parameter.
890  * @retval #VC_ERROR_INVALID_STATE              Invalid state
891  * @retval #VC_ERROR_OPERATION_FAILED           Operation failure
892  * @retval #VC_ERROR_IN_PROGRESS_TO_RECORDING   In progress to recording
893  *
894  * @pre The state should be #VC_STATE_READY and the service state should be #VC_SERVICE_STATE_READY.
895  * @post It will invoke vc_service_state_changed_cb(), if you register a callback with vc_service_state_changed_cb(). \n
896  *      If this function succeeds, the service state will be #VC_SERVICE_STATE_RECORDING.
897  *
898  * @see vc_mgr_stop()
899  * @see vc_mgr_cancel()
900  * @see vc_service_state_changed_cb()
901  * @see vc_mgr_set_recognition_mode()
902  * @see vc_mgr_get_recognition_mode()
903  */
904 int vc_mgr_start(bool exclusive_command_option);
905
906 /**
907  * @platform
908  * @brief Stops recognition.
909  * @since_tizen 5.0
910  *
911  * @privlevel platform
912  * @privilege %http://tizen.org/privilege/voicecontrol.manager
913  *
914  * @return 0 on success, otherwise a negative error value
915  * @retval #VC_ERROR_NONE                        Successful
916  * @retval #VC_ERROR_NOT_SUPPORTED               VC not supported
917  * @retval #VC_ERROR_PERMISSION_DENIED           Permission denied
918  * @retval #VC_ERROR_INVALID_STATE               Invalid state
919  * @retval #VC_ERROR_OPERATION_FAILED            Operation failure
920  * @retval #VC_ERROR_IN_PROGRESS_TO_READY        In progress to ready
921  * @retval #VC_ERROR_IN_PROGRESS_TO_RECORDING    In progress to recording
922  * @retval #VC_ERROR_IN_PROGRESS_TO_PROCESSING   In progress to processing
923  *
924  * @pre The service state should be #VC_SERVICE_STATE_RECORDING.
925  * @post It will invoke vc_service_state_changed_cb(), if you register a callback with vc_service_state_changed_cb(). \n
926  *      If this function succeeds, the service state will be #VC_SERVICE_STATE_PROCESSING.
927  *
928  * @see vc_mgr_start()
929  * @see vc_mgr_cancel()
930  * @see vc_service_state_changed_cb()
931  * @see vc_result_cb()
932  */
933 int vc_mgr_stop(void);
934
935 /**
936  * @platform
937  * @brief Cancels recognition.
938  * @since_tizen 5.0
939  *
940  * @privlevel platform
941  * @privilege %http://tizen.org/privilege/voicecontrol.manager
942  *
943  * @return 0 on success, otherwise a negative error value
944  * @retval #VC_ERROR_NONE                        Successful
945  * @retval #VC_ERROR_NOT_SUPPORTED               VC not supported
946  * @retval #VC_ERROR_PERMISSION_DENIED           Permission denied
947  * @retval #VC_ERROR_OUT_OF_MEMORY               Not enough memory
948  * @retval #VC_ERROR_INVALID_STATE               Invalid state
949  * @retval #VC_ERROR_OPERATION_FAILED            Operation failure
950  * @retval #VC_ERROR_IN_PROGRESS_TO_READY        In progress to ready
951  * @retval #VC_ERROR_IN_PROGRESS_TO_RECORDING    In progress to recording
952  * @retval #VC_ERROR_IN_PROGRESS_TO_PROCESSING   In progress to processing
953  *
954  * @pre The service state should be #VC_SERVICE_STATE_RECORDING or #VC_SERVICE_STATE_PROCESSING.
955  * @post It will invoke vc_service_state_changed_cb(), if you register a callback with vc_service_state_changed_cb(). \n
956  *      If this function succeeds, the service state will be #VC_SERVICE_STATE_READY.
957  *
958  * @see vc_mgr_start()
959  * @see vc_mgr_stop()
960  * @see vc_service_state_changed_cb()
961  */
962 int vc_mgr_cancel(void);
963
964 /**
965  * @platform
966  * @brief Gets the microphone volume during recording.
967  * @since_tizen 5.0
968  *
969  * @privlevel platform
970  * @privilege %http://tizen.org/privilege/voicecontrol.manager
971  *
972  * @param[out] volume   Recording volume
973  *
974  * @return 0 on success, otherwise a negative error value
975  * @retval #VC_ERROR_NONE                Successful
976  * @retval #VC_ERROR_NOT_SUPPORTED       VC not supported
977  * @retval #VC_ERROR_PERMISSION_DENIED   Permission denied
978  * @retval #VC_ERROR_INVALID_PARAMETER   Invalid parameter
979  * @retval #VC_ERROR_INVALID_STATE       Invalid state
980  *
981  * @pre The service state should be #VC_SERVICE_STATE_RECORDING.
982  *
983  * @see vc_mgr_start()
984  */
985 int vc_mgr_get_recording_volume(float *volume);
986
987 /**
988  * @platform
989  * @brief Selects valid results from all results.
990  * @since_tizen 5.0
991  *
992  * @privlevel platform
993  * @privilege %http://tizen.org/privilege/voicecontrol.manager
994  *
995  * @remarks This function should be called in vc_mgr_all_result_cb().
996  *      Or this function should be called after that vc_mgr_all_result_cb() returns @c false.
997  *      The @a vc_cmd_list can be NULL, in that case the function does nothing.
998  * @param[in] vc_cmd_list   The valid result list
999  *
1000  * @return 0 on success, otherwise a negative error value
1001  * @retval #VC_ERROR_NONE                Successful
1002  * @retval #VC_ERROR_NOT_SUPPORTED       VC not supported
1003  * @retval #VC_ERROR_PERMISSION_DENIED   Permission denied
1004  * @retval #VC_ERROR_INVALID_STATE       Invalid state
1005  *
1006  * @pre vc_mgr_all_result_cb() should be called
1007  *
1008  * @see vc_mgr_all_result_cb()
1009  */
1010 int vc_mgr_set_selected_results(vc_cmd_list_h vc_cmd_list);
1011
1012
1013 /**
1014  * @platform
1015  * @brief Sets a callback function for getting recognition result.
1016  * @since_tizen 5.0
1017  *
1018  * @privlevel platform
1019  * @privilege %http://tizen.org/privilege/voicecontrol.manager
1020  *
1021  * @param[in] callback    Callback function to register
1022  * @param[in] user_data   The user data to be passed to the callback function
1023  *
1024  * @return 0 on success, otherwise a negative error value
1025  * @retval #VC_ERROR_NONE                Successful
1026  * @retval #VC_ERROR_NOT_SUPPORTED       VC not supported
1027  * @retval #VC_ERROR_PERMISSION_DENIED   Permission denied
1028  * @retval #VC_ERROR_INVALID_PARAMETER   Invalid parameter
1029  * @retval #VC_ERROR_INVALID_STATE       Invalid state
1030  *
1031  * @pre The state should be #VC_STATE_INITIALIZED.
1032  *
1033  * @see vc_mgr_all_result_cb()
1034  * @see vc_mgr_unset_all_result_cb()
1035  */
1036 int vc_mgr_set_all_result_cb(vc_mgr_all_result_cb callback, void *user_data);
1037
1038 /**
1039  * @platform
1040  * @brief Unsets the recognition result callback function.
1041  * @since_tizen 5.0
1042  *
1043  * @privlevel platform
1044  * @privilege %http://tizen.org/privilege/voicecontrol.manager
1045  *
1046  * @return 0 on success, otherwise a negative error value
1047  * @retval #VC_ERROR_NONE                Successful
1048  * @retval #VC_ERROR_NOT_SUPPORTED       VC not supported
1049  * @retval #VC_ERROR_PERMISSION_DENIED   Permission denied
1050  * @retval #VC_ERROR_INVALID_STATE       Invalid state
1051  *
1052  * @pre The state should be #VC_STATE_INITIALIZED.
1053  *
1054  * @see vc_mgr_set_all_result_cb()
1055  */
1056 int vc_mgr_unset_all_result_cb(void);
1057
1058 /**
1059  * @platform
1060  * @brief Sets a callback function for getting pre recognition result.
1061  * @since_tizen 5.0
1062  *
1063  * @privlevel platform
1064  * @privilege %http://tizen.org/privilege/voicecontrol.manager
1065  *
1066  * @param[in] callback    Callback function to register
1067  * @param[in] user_data   The user data to be passed to the callback function
1068  *
1069  * @return 0 on success, otherwise a negative error value
1070  * @retval #VC_ERROR_NONE                Successful
1071  * @retval #VC_ERROR_NOT_SUPPORTED       VC not supported
1072  * @retval #VC_ERROR_PERMISSION_DENIED   Permission denied
1073  * @retval #VC_ERROR_INVALID_PARAMETER   Invalid parameter
1074  * @retval #VC_ERROR_INVALID_STATE       Invalid state
1075  *
1076  * @pre The state should be #VC_STATE_INITIALIZED.
1077  *
1078  * @see vc_mgr_pre_result_cb()
1079  * @see vc_mgr_unset_pre_result_cb()
1080  */
1081 int vc_mgr_set_pre_result_cb(vc_mgr_pre_result_cb callback, void *user_data);
1082
1083 /**
1084  * @platform
1085  * @brief Unsets the pre recognition result callback function.
1086  * @since_tizen 5.0
1087  *
1088  * @privlevel platform
1089  * @privilege %http://tizen.org/privilege/voicecontrol.manager
1090  *
1091  * @return 0 on success, otherwise a negative error value
1092  * @retval #VC_ERROR_NONE                Successful
1093  * @retval #VC_ERROR_NOT_SUPPORTED       VC not supported
1094  * @retval #VC_ERROR_PERMISSION_DENIED   Permission denied
1095  * @retval #VC_ERROR_INVALID_STATE       Invalid state
1096  *
1097  * @pre The state should be #VC_STATE_INITIALIZED.
1098  *
1099  * @see vc_mgr_set_pre_result_cb()
1100  */
1101 int vc_mgr_unset_pre_result_cb(void);
1102
1103 /**
1104  * @platform
1105  * @brief Sets a callback function for getting specific engine result.
1106  * @since_tizen 5.0
1107  *
1108  * @privlevel platform
1109  * @privilege %http://tizen.org/privilege/voicecontrol.manager
1110  *
1111  * @param[in] callback Callback function to register
1112  * @param[in] user_data The user data to be passed to the callback function
1113  *
1114  * @return 0 on success, otherwise a negative error value
1115  * @retval #VC_ERROR_NONE               Successful
1116  * @retval #VC_ERROR_NOT_SUPPORTED      Not supported
1117  * @retval #VC_ERROR_PERMISSION_DENIED  Permission denied
1118  * @retval #VC_ERROR_INVALID_PARAMETER  Invalid parameter
1119  * @retval #VC_ERROR_INVALID_STATE      Invalid state
1120  *
1121  * @pre The state should be #VC_STATE_INITIALIZED.
1122  *
1123  * @see vc_mgr_unset_specific_engine_result_cb()
1124  */
1125 int vc_mgr_set_specific_engine_result_cb(vc_mgr_specific_engine_result_cb callback, void* user_data);
1126
1127 /**
1128  * @brief Unsets the specific engine result callback function.
1129  * @since_tizen 5.0
1130  *
1131  * @return 0 on success, otherwise a negative error value
1132  * @retval #VC_ERROR_NONE           Successful
1133  * @retval #VC_ERROR_NOT_SUPPORTED  Not supported
1134  * @retval #VC_ERROR_INVALID_STATE  Invalid state
1135  *
1136  * @pre The state should be #VC_STATE_INITIALIZED.
1137  *
1138  * @see vc_mgr_set_specific_engine_result_cb()
1139  */
1140 int vc_mgr_unset_specific_engine_result_cb(void);
1141
1142 /**
1143  * @platform
1144  * @brief Sets a callback function for getting all types of recognition results.
1145  * @since_tizen 5.0
1146  *
1147  * @privlevel platform
1148  * @privilege %http://tizen.org/privilege/voicecontrol.manager
1149  *
1150  * @param[in] callback    Callback function to register
1151  * @param[in] user_data   The user data to be passed to the callback function
1152  *
1153  * @return 0 on success, otherwise a negative error value
1154  * @retval #VC_ERROR_NONE                Successful
1155  * @retval #VC_ERROR_NOT_SUPPORTED       VC not supported
1156  * @retval #VC_ERROR_PERMISSION_DENIED   Permission denied
1157  * @retval #VC_ERROR_INVALID_PARAMETER   Invalid parameter
1158  * @retval #VC_ERROR_INVALID_STATE       Invalid state
1159  *
1160  * @pre The state should be #VC_STATE_INITIALIZED.
1161  *
1162  * @see vc_result_cb()
1163  * @see vc_mgr_unset_result_cb()
1164  */
1165 int vc_mgr_set_result_cb(vc_result_cb callback, void *user_data);
1166
1167 /**
1168  * @platform
1169  * @brief Unsets the callback function for getting all types of recognition results.
1170  * @since_tizen 5.0
1171  *
1172  * @privlevel platform
1173  * @privilege %http://tizen.org/privilege/voicecontrol.manager
1174  *
1175  * @return 0 on success, otherwise a negative error value
1176  * @retval #VC_ERROR_NONE                Successful
1177  * @retval #VC_ERROR_NOT_SUPPORTED       VC not supported
1178  * @retval #VC_ERROR_PERMISSION_DENIED   Permission denied
1179  * @retval #VC_ERROR_INVALID_STATE       Invalid state
1180  *
1181  * @pre The state should be #VC_STATE_INITIALIZED.
1182  *
1183  * @see vc_mgr_set_result_cb()
1184  */
1185 int vc_mgr_unset_result_cb(void);
1186
1187 /**
1188  * @platform
1189  * @brief Sets a callback function to be called when state is changed.
1190  * @since_tizen 5.0
1191  *
1192  * @privlevel platform
1193  * @privilege %http://tizen.org/privilege/voicecontrol.manager
1194  *
1195  * @param[in] callback    Callback function to register
1196  * @param[in] user_data   The user data to be passed to the callback function
1197  *
1198  * @return 0 on success, otherwise a negative error value
1199  * @retval #VC_ERROR_NONE                Successful
1200  * @retval #VC_ERROR_NOT_SUPPORTED       VC not supported
1201  * @retval #VC_ERROR_PERMISSION_DENIED   Permission denied
1202  * @retval #VC_ERROR_INVALID_PARAMETER   Invalid parameter
1203  * @retval #VC_ERROR_INVALID_STATE       Invalid state
1204  *
1205  * @pre The state should be #VC_STATE_INITIALIZED.
1206  *
1207  * @see vc_state_changed_cb()
1208  * @see vc_mgr_unset_state_changed_cb()
1209  */
1210 int vc_mgr_set_state_changed_cb(vc_state_changed_cb callback, void *user_data);
1211
1212 /**
1213  * @platform
1214  * @brief Unsets the state changed callback function.
1215  * @since_tizen 5.0
1216  *
1217  * @privlevel platform
1218  * @privilege %http://tizen.org/privilege/voicecontrol.manager
1219  *
1220  * @return 0 on success, otherwise a negative error value
1221  * @retval #VC_ERROR_NONE                Successful
1222  * @retval #VC_ERROR_NOT_SUPPORTED       VC not supported
1223  * @retval #VC_ERROR_PERMISSION_DENIED   Permission denied
1224  * @retval #VC_ERROR_INVALID_STATE       Invalid state
1225  *
1226  * @pre The state should be #VC_STATE_INITIALIZED.
1227  *
1228  * @see vc_mgr_set_state_changed_cb()
1229  */
1230 int vc_mgr_unset_state_changed_cb(void);
1231
1232 /**
1233  * @platform
1234  * @brief Sets a callback function to be called when service state is changed.
1235  * @since_tizen 5.0
1236  *
1237  * @privlevel platform
1238  * @privilege %http://tizen.org/privilege/voicecontrol.manager
1239  *
1240  * @param[in] callback    Callback function to register
1241  * @param[in] user_data   The user data to be passed to the callback function
1242  *
1243  * @return 0 on success, otherwise a negative error value
1244  * @retval #VC_ERROR_NONE                Successful
1245  * @retval #VC_ERROR_NOT_SUPPORTED       VC not supported
1246  * @retval #VC_ERROR_PERMISSION_DENIED   Permission denied
1247  * @retval #VC_ERROR_INVALID_PARAMETER   Invalid parameter
1248  * @retval #VC_ERROR_INVALID_STATE       Invalid state
1249  *
1250  * @pre The state should be #VC_STATE_INITIALIZED.
1251  *
1252  * @see vc_service_state_changed_cb()
1253  * @see vc_mgr_unset_service_state_changed_cb()
1254  */
1255 int vc_mgr_set_service_state_changed_cb(vc_service_state_changed_cb callback, void *user_data);
1256
1257 /**
1258  * @platform
1259  * @brief Unsets the service state changed callback function.
1260  * @since_tizen 5.0
1261  *
1262  * @privlevel platform
1263  * @privilege %http://tizen.org/privilege/voicecontrol.manager
1264  *
1265  * @return 0 on success, otherwise a negative error value
1266  * @retval #VC_ERROR_NONE                Successful
1267  * @retval #VC_ERROR_NOT_SUPPORTED       VC not supported
1268  * @retval #VC_ERROR_PERMISSION_DENIED   Permission denied
1269  * @retval #VC_ERROR_INVALID_STATE       Invalid state
1270  *
1271  * @pre The state should be #VC_STATE_INITIALIZED.
1272  *
1273  * @see vc_mgr_set_service_state_changed_cb()
1274  */
1275 int vc_mgr_unset_service_state_changed_cb(void);
1276
1277 /**
1278  * @platform
1279  * @brief Sets a callback function to be called when begin of speech is detected.
1280  * @since_tizen 5.0
1281  *
1282  * @privlevel platform
1283  * @privilege %http://tizen.org/privilege/voicecontrol.manager
1284  *
1285  * @param[in] callback    Callback function to register
1286  * @param[in] user_data   The user data to be passed to the callback function
1287  *
1288  * @return 0 on success, otherwise a negative error value
1289  * @retval #VC_ERROR_NONE                Successful
1290  * @retval #VC_ERROR_NOT_SUPPORTED       VC not supported
1291  * @retval #VC_ERROR_PERMISSION_DENIED   Permission denied
1292  * @retval #VC_ERROR_INVALID_PARAMETER   Invalid parameter
1293  * @retval #VC_ERROR_INVALID_STATE       Invalid state
1294  *
1295  * @pre The state should be #VC_STATE_INITIALIZED.
1296  *
1297  * @see vc_mgr_begin_speech_detected_cb()
1298  * @see vc_mgr_unset_speech_detected_cb()
1299  */
1300 int vc_mgr_set_speech_detected_cb(vc_mgr_begin_speech_detected_cb callback, void *user_data);
1301
1302 /**
1303  * @platform
1304  * @brief Unsets the speech detected callback function.
1305  * @since_tizen 5.0
1306  *
1307  * @privlevel platform
1308  * @privilege %http://tizen.org/privilege/voicecontrol.manager
1309  *
1310  * @return 0 on success, otherwise a negative error value
1311  * @retval #VC_ERROR_NONE                Successful
1312  * @retval #VC_ERROR_NOT_SUPPORTED       VC not supported
1313  * @retval #VC_ERROR_PERMISSION_DENIED   Permission denied
1314  * @retval #VC_ERROR_INVALID_STATE       Invalid state
1315  *
1316  * @pre The state should be #VC_STATE_INITIALIZED.
1317  *
1318  * @see vc_mgr_set_speech_detected_cb()
1319  */
1320 int vc_mgr_unset_speech_detected_cb(void);
1321
1322 /**
1323  * @platform
1324  * @brief Sets a callback function to be called when current language is changed.
1325  * @since_tizen 5.0
1326  *
1327  * @privlevel platform
1328  * @privilege %http://tizen.org/privilege/voicecontrol.manager
1329  *
1330  * @param[in] callback    Callback function to register
1331  * @param[in] user_data   The user data to be passed to the callback function
1332  *
1333  * @return 0 on success, otherwise a negative error value
1334  * @retval #VC_ERROR_NONE                Successful
1335  * @retval #VC_ERROR_NOT_SUPPORTED       VC not supported
1336  * @retval #VC_ERROR_PERMISSION_DENIED   Permission denied
1337  * @retval #VC_ERROR_INVALID_PARAMETER   Invalid parameter
1338  * @retval #VC_ERROR_INVALID_STATE       Invalid state
1339  *
1340  * @pre The state should be #VC_STATE_INITIALIZED.
1341  *
1342  * @see vc_current_language_changed_cb()
1343  * @see vc_mgr_unset_current_language_changed_cb()
1344  */
1345 int vc_mgr_set_current_language_changed_cb(vc_current_language_changed_cb callback, void *user_data);
1346
1347 /**
1348  * @platform
1349  * @brief Unsets the current language changed callback function.
1350  * @since_tizen 5.0
1351  *
1352  * @privlevel platform
1353  * @privilege %http://tizen.org/privilege/voicecontrol.manager
1354  *
1355  * @return 0 on success, otherwise a negative error value
1356  * @retval #VC_ERROR_NONE                Successful
1357  * @retval #VC_ERROR_NOT_SUPPORTED       VC not supported
1358  * @retval #VC_ERROR_PERMISSION_DENIED   Permission denied
1359  * @retval #VC_ERROR_INVALID_STATE       Invalid state
1360  *
1361  * @pre The state should be #VC_STATE_INITIALIZED.
1362  *
1363  * @see vc_mgr_set_current_language_changed_cb()
1364  */
1365 int vc_mgr_unset_current_language_changed_cb(void);
1366
1367 /**
1368  * @platform
1369  * @brief Gets the current error message.
1370  * @since_tizen 5.0
1371  *
1372  * @privlevel platform
1373  * @privilege %http://tizen.org/privilege/voicecontrol.manager
1374  *
1375  * @remarks This function should be called during as vc error callback. If not, the error as operation failure will be returned. \n
1376  *      If the function succeeds, @a err_msg must be released using free() when it is no longer required.
1377  *
1378  * @param[out] err_msg   The current error message
1379  *
1380  * @return 0 on success, otherwise a negative error value
1381  * @retval #VC_ERROR_NONE                Successful
1382  * @retval #VC_ERROR_NOT_SUPPORTED       VC not supported
1383  * @retval #VC_ERROR_PERMISSION_DENIED   Permission denied
1384  * @retval #VC_ERROR_INVALID_PARAMETER   Invalid parameter
1385  * @retval #VC_ERROR_INVALID_STATE       Invalid state
1386  * @retval $VC_ERROR_OPERATION_FAILED    Operation failure
1387  * @retval #VC_ERROR_OUT_OF_MEMORY       Out of memory
1388  *
1389  * @see vc_error_cb()
1390  */
1391 int vc_mgr_get_error_message(char **err_msg);
1392
1393 /**
1394  * @platform
1395  * @brief Sets a callback function to be called when an error occurred.
1396  * @since_tizen 5.0
1397  *
1398  * @privlevel platform
1399  * @privilege %http://tizen.org/privilege/voicecontrol.manager
1400  *
1401  * @param[in] callback    Callback function to register
1402  * @param[in] user_data   The user data to be passed to the callback function
1403  *
1404  * @return 0 on success, otherwise a negative error value
1405  * @retval #VC_ERROR_NONE                Successful
1406  * @retval #VC_ERROR_NOT_SUPPORTED       VC not supported
1407  * @retval #VC_ERROR_PERMISSION_DENIED   Permission denied
1408  * @retval #VC_ERROR_INVALID_PARAMETER   Invalid parameter
1409  * @retval #VC_ERROR_INVALID_STATE       Invalid state
1410  *
1411  * @pre The state should be #VC_STATE_INITIALIZED.
1412  *
1413  * @see vc_error_cb()
1414  * @see vc_mgr_unset_error_cb()
1415  */
1416 int vc_mgr_set_error_cb(vc_error_cb callback, void *user_data);
1417
1418 /**
1419  * @platform
1420  * @brief Unsets the callback function to be called when an error occurred.
1421  * @since_tizen 5.0
1422  *
1423  * @privlevel platform
1424  * @privilege %http://tizen.org/privilege/voicecontrol.manager
1425  *
1426  * @return 0 on success, otherwise a negative error value
1427  * @retval #VC_ERROR_NONE                Successful
1428  * @retval #VC_ERROR_NOT_SUPPORTED       VC not supported
1429  * @retval #VC_ERROR_PERMISSION_DENIED   Permission denied
1430  * @retval #VC_ERROR_INVALID_STATE       Invalid state
1431  *
1432  * @pre The state should be #VC_STATE_INITIALIZED.
1433  *
1434  * @see vc_mgr_set_error_cb()
1435  */
1436 int vc_mgr_unset_error_cb(void);
1437
1438
1439 /**
1440  * @platform
1441  * @brief Sets a callback function to be called when dialog requests.
1442  * @since_tizen 5.0
1443  *
1444  * @privlevel platform
1445  * @privilege %http://tizen.org/privilege/voicecontrol.manager
1446  *
1447  * @param[in] callback    Callback function to register
1448  * @param[in] user_data   The user data to be passed to the callback function
1449  *
1450  * @return 0 on success, otherwise a negative error value
1451  * @retval #VC_ERROR_NONE                Successful
1452  * @retval #VC_ERROR_NOT_SUPPORTED       VC not supported
1453  * @retval #VC_ERROR_PERMISSION_DENIED   Permission denied
1454  * @retval #VC_ERROR_INVALID_PARAMETER   Invalid parameter
1455  * @retval #VC_ERROR_INVALID_STATE       Invalid state
1456  *
1457  * @pre The state should be #VC_STATE_INITIALIZED.
1458  *
1459  * @see vc_mgr_unset_dialog_request_cb()
1460  */
1461 int vc_mgr_set_dialog_request_cb(vc_mgr_dialog_request_cb callback, void *user_data);
1462
1463 /**
1464  * @platform
1465  * @brief Unsets the callback function to be called when dialog requests.
1466  * @since_tizen 5.0
1467  *
1468  * @privlevel platform
1469  * @privilege %http://tizen.org/privilege/voicecontrol.manager
1470  *
1471  * @return 0 on success, otherwise a negative error value
1472  * @retval #VC_ERROR_NONE                Successful
1473  * @retval #VC_ERROR_NOT_SUPPORTED       VC not supported
1474  * @retval #VC_ERROR_PERMISSION_DENIED   Permission denied
1475  * @retval #VC_ERROR_INVALID_STATE       Invalid state
1476  *
1477  * @pre The state should be #VC_STATE_INITIALIZED.
1478  *
1479  * @see vc_mgr_set_dialog_request_cb()
1480  */
1481 int vc_mgr_unset_dialog_request_cb(void);
1482
1483 /**
1484  * @platform
1485  * @brief Enables command type as candidate command.
1486  * @since_tizen 5.0
1487  *
1488  * @privlevel platform
1489  * @privilege %http://tizen.org/privilege/voicecontrol.manager
1490  *
1491  * @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)
1492  *
1493  * @return 0 on success, otherwise a negative error value
1494  * @retval #VC_ERROR_NONE                Successful
1495  * @retval #VC_ERROR_NOT_SUPPORTED       VC not supported
1496  * @retval #VC_ERROR_PERMISSION_DENIED   Permission denied
1497  * @retval #VC_ERROR_INVALID_PARAMETER   Invalid parameter
1498  * @retval #VC_ERROR_INVALID_STATE       Invalid state
1499  *
1500  * @pre The state should be #VC_STATE_READY.
1501  *
1502  * @see vc_mgr_disable_command_type()
1503  */
1504 int vc_mgr_enable_command_type(int cmd_type);
1505
1506 /**
1507  * @platform
1508  * @brief Disables command type as candidate command.
1509  * @since_tizen 5.0
1510  *
1511  * @privlevel platform
1512  * @privilege %http://tizen.org/privilege/voicecontrol.manager
1513  *
1514  * @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)
1515  *
1516  * @return 0 on success, otherwise a negative error value
1517  * @retval #VC_ERROR_NONE                Successful
1518  * @retval #VC_ERROR_NOT_SUPPORTED       VC not supported
1519  * @retval #VC_ERROR_PERMISSION_DENIED   Permission denied
1520  * @retval #VC_ERROR_INVALID_PARAMETER   Invalid parameter
1521  * @retval #VC_ERROR_INVALID_STATE       Invalid state
1522  *
1523  * @pre The state should be #VC_STATE_READY.
1524  *
1525  * @see vc_mgr_enable_command_type()
1526  */
1527 int vc_mgr_disable_command_type(int cmd_type);
1528
1529 /**
1530  * @platform
1531  * @brief Sets a callback function to be called when engine set private data.
1532  * @since_tizen 5.0
1533  *
1534  * @privlevel platform
1535  * @privilege %http://tizen.org/privilege/voicecontrol.manager
1536  *
1537  * @param[in] callback    Callback function to register
1538  * @param[in] user_data   The user data to be passed to the callback function
1539  *
1540  * @return 0 on success, otherwise a negative error value
1541  * @retval #VC_ERROR_NONE                Successful
1542  * @retval #VC_ERROR_NOT_SUPPORTED       VC not supported
1543  * @retval #VC_ERROR_PERMISSION_DENIED   Permission denied
1544  * @retval #VC_ERROR_INVALID_PARAMETER   Invalid parameter
1545  * @retval #VC_ERROR_INVALID_STATE       Invalid state
1546  *
1547  * @pre The state should be #VC_STATE_INITIALIZED.
1548  *
1549  * @see vc_mgr_private_data_set_cb()
1550  * @see vc_mgr_unset_private_data_set_cb()
1551  */
1552 int vc_mgr_set_private_data_set_cb(vc_mgr_private_data_set_cb callback, void *user_data);
1553
1554 /**
1555  * @platform
1556  * @brief Unsets the callback function to be called when engine set private data.
1557  * @since_tizen 5.0
1558  *
1559  * @privlevel platform
1560  * @privilege %http://tizen.org/privilege/voicecontrol.manager
1561  *
1562  * @return 0 on success, otherwise a negative error value
1563  * @retval #VC_ERROR_NONE                Successful
1564  * @retval #VC_ERROR_NOT_SUPPORTED       VC not supported
1565  * @retval #VC_ERROR_PERMISSION_DENIED   Permission denied
1566  * @retval #VC_ERROR_INVALID_STATE       Invalid state
1567  *
1568  * @pre The state should be #VC_STATE_INITIALIZED.
1569  *
1570  * @see vc_mgr_set_private_data_set_cb()
1571  */
1572 int vc_mgr_unset_private_data_set_cb(void);
1573
1574 /**
1575  * @platform
1576  * @brief Sets a callback function to be called when engine request private data.
1577  * @since_tizen 5.0
1578  *
1579  * @privlevel platform
1580  * @privilege %http://tizen.org/privilege/voicecontrol.manager
1581  *
1582  * @param[in] callback    Callback function to register
1583  * @param[in] user_data   The user data to be passed to the callback function
1584  *
1585  * @return 0 on success, otherwise a negative error value
1586  * @retval #VC_ERROR_NONE                Successful
1587  * @retval #VC_ERROR_NOT_SUPPORTED       VC not supported
1588  * @retval #VC_ERROR_PERMISSION_DENIED   Permission denied
1589  * @retval #VC_ERROR_INVALID_PARAMETER   Invalid parameter
1590  * @retval #VC_ERROR_INVALID_STATE       Invalid state
1591  *
1592  * @pre The state should be #VC_STATE_INITIALIZED.
1593  *
1594  * @see vc_mgr_private_data_requested_cb()
1595  * @see vc_mgr_unset_private_data_requested_cb()
1596  */
1597 int vc_mgr_set_private_data_requested_cb(vc_mgr_private_data_requested_cb callback, void *user_data);
1598
1599 /**
1600  * @platform
1601  * @brief Unsets the callback function to be called when engine request private data.
1602  * @since_tizen 5.0
1603  *
1604  * @privlevel platform
1605  * @privilege %http://tizen.org/privilege/voicecontrol.manager
1606  *
1607  * @return 0 on success, otherwise a negative error value
1608  * @retval #VC_ERROR_NONE                Successful
1609  * @retval #VC_ERROR_NOT_SUPPORTED       VC not supported
1610  * @retval #VC_ERROR_PERMISSION_DENIED   Permission denied
1611  * @retval #VC_ERROR_INVALID_STATE       Invalid state
1612  *
1613  * @pre The state should be #VC_STATE_INITIALIZED.
1614  *
1615  * @see vc_mgr_set_private_data_requested_cb()
1616  */
1617 int vc_mgr_unset_private_data_requested_cb(void);
1618
1619 /* for TTS feedback */
1620 /**
1621  * @platform
1622  * @brief Sets a callback function to be called when engine sends audio formats necessary for playing TTS feedback.
1623  * @since_tizen 5.0
1624  *
1625  * @privlevel platform
1626  * @privilege %http://tizen.org/privilege/voicecontrol.manager
1627  *
1628  * @param[in] callback Callback function to set
1629  * @param[in] user_data The user data to be passed to the callback function
1630  *
1631  * @return 0 on success, otherwise a negative error value
1632  * @retval #VC_ERROR_NONE               Successful
1633  * @retval #VC_ERROR_NOT_SUPPORTED      VC not supported
1634  * @retval #VC_ERROR_PERMISSION_DENIED  Permission denied
1635  * @retval #VC_ERROR_INVALID_PARAMETER  Invalid parameter
1636  * @retval #VC_ERROR_INVALID_STATE      Invalid state
1637  *
1638  * @pre The state should be #VC_STATE_INITIALIZED.
1639  *
1640  * @see vc_mgr_feedback_audio_format_cb()
1641  * @see vc_mgr_unset_feedback_audio_format_cb()
1642  */
1643 int vc_mgr_set_feedback_audio_format_cb(vc_mgr_feedback_audio_format_cb callback, void* user_data);
1644
1645 /**
1646  * @platform
1647  * @brief Unsets a callback function to be called when engine sends audio formats necessary for playing TTS feedback.
1648  * @since_tizen 5.0
1649  *
1650  * @privlevel platform
1651  * @privilege %http://tizen.org/privilege/voicecontrol.manager
1652  *
1653  * @return 0 on success, otherwise a negative error value
1654  * @retval #VC_ERROR_NONE               Successful
1655  * @retval #VC_ERROR_NOT_SUPPORTED      VC not supported
1656  * @retval #VC_ERROR_PERMISSION_DENIED  Permission denied
1657  * @retval #VC_ERROR_INVALID_STATE      Invalid state
1658  *
1659  * @pre The state should be #VC_STATE_INITIALIZED.
1660  *
1661  * @see vc_mgr_feedback_audio_format_cb()
1662  * @see vc_mgr_set_feedback_audio_format_cb()
1663  */
1664 int vc_mgr_unset_feedback_audio_format_cb(void);
1665
1666 /**
1667  * @platform
1668  * @brief Sets a callback function to be called when engine sends audio streaming for TTS feedback.
1669  * @since_tizen 5.0
1670  *
1671  * @privlevel platform
1672  * @privilege %http://tizen.org/privilege/voicecontrol.manager
1673  *
1674  * @param[in] callback Callback function to set
1675  * @param[in] user_data The user data to be passed to the callback function
1676  *
1677  * @return 0 on success, otherwise a negative error value
1678  * @retval #VC_ERROR_NONE               Successful
1679  * @retval #VC_ERROR_NOT_SUPPORTED      VC not supported
1680  * @retval #VC_ERROR_PERMISSION_DENIED  Permission denied
1681  * @retval #VC_ERROR_INVALID_PARAMETER  Invalid parameter
1682  * @retval #VC_ERROR_INVALID_STATE      Invalid state
1683  *
1684  * @pre The state should be #VC_STATE_INITIALIZED.
1685  *
1686  * @see vc_mgr_feedback_streaming_cb()
1687  * @see vc_mgr_unset_feedback_streaming_cb()
1688  */
1689 int vc_mgr_set_feedback_streaming_cb(vc_mgr_feedback_streaming_cb callback, void* user_data);
1690
1691 /**
1692  * @platform
1693  * @brief Unsets a callback function to be called when engine sends audio streaming for TTS feedback.
1694  * @since_tizen 5.0
1695  *
1696  * @privlevel platform
1697  * @privilege %http://tizen.org/privilege/voicecontrol.manager
1698  *
1699  * @return 0 on success, otherwise a negative error value
1700  * @retval #VC_ERROR_NONE               Successful
1701  * @retval #VC_ERROR_NOT_SUPPORTED      VC not supported
1702  * @retval #VC_ERROR_PERMISSION_DENIED  Permission denied
1703  * @retval #VC_ERROR_INVALID_STATE      Invalid state
1704  *
1705  * @pre The state should be #VC_STATE_INITIALIZED.
1706  *
1707  * @see vc_mgr_feedback_streaming_cb()
1708  * @see vc_mgr_set_feedback_streaming_cb()
1709  */
1710 int vc_mgr_unset_feedback_streaming_cb(void);
1711
1712 /**
1713  * @platform
1714  * @brief Starts getting TTS feedback streaming data from the buffer.
1715  * @since_tizen 5.0
1716  *
1717  * @privlevel platform
1718  * @privilege %http://tizen.org/privilege/voicecontrol.manager
1719  *
1720  * @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().
1721  *
1722  * @return 0 on success, otherwise a negative error value
1723  * @retval #VC_ERROR_NONE               Successful
1724  * @retval #VC_ERROR_NOT_SUPPORTED      VC not supported
1725  * @retval #VC_ERROR_PERMISSION_DENIED  Permission denied
1726  * @retval #VC_ERROR_INVALID_STATE      Invalid state
1727  *
1728  * @pre The state should be #VC_STATE_READY. \n
1729  *      'vc_mgr_feedback_streaming_cb()' should be registered.
1730  *
1731  * @see vc_mgr_feedback_streaming_cb()
1732  * @see vc_mgr_set_feedback_streaming_cb()
1733  * @see vc_mgr_unset_feedback_streaming_cb()
1734  * @see vc_mgr_stop_feedback()
1735  */
1736 int vc_mgr_start_feedback(void);
1737
1738 /**
1739  * @platform
1740  * @brief Stops getting and removes TTS feedback streaming data from the buffer.
1741  * @since_tizen 5.0
1742  *
1743  * @privlevel platform
1744  * @privilege %http://tizen.org/privilege/voicecontrol.manager
1745  *
1746  * @return 0 on success, otherwise a negative error value
1747  * @retval #VC_ERROR_NONE               Successful
1748  * @retval #VC_ERROR_NOT_SUPPORTED      VC not supported
1749  * @retval #VC_ERROR_PERMISSION_DENIED  Permission denied
1750  * @retval #VC_ERROR_INVALID_STATE      Invalid state
1751  *
1752  * @pre The state should be #VC_STATE_READY.
1753  *
1754  * @see vc_mgr_feedback_streaming_cb()
1755  * @see vc_mgr_set_feedback_streaming_cb()
1756  * @see vc_mgr_unset_feedback_streaming_cb()
1757  * @see vc_mgr_start_feedback()
1758  */
1759 int vc_mgr_stop_feedback(void);
1760
1761 /**
1762  * @platform
1763  * @brief Sets TTS streaming callback function.
1764  * @since_tizen 5.0
1765  *
1766  * @privlevel platform
1767  * @privilege %http://tizen.org/privilege/voicecontrol.manager
1768  *
1769  * @param[in] callback The callback function
1770  * @param[in] user_data The user data to be passed to the callback function
1771  *
1772  * @return 0 on success, otherwise a negative error value
1773  * @retval #VC_ERROR_NONE               Successful
1774  * @retval #VC_ERROR_NOT_SUPPORTED      VC not supported
1775  * @retval #VC_ERROR_PERMISSION_DENIED  Permission denied
1776  * @retval #VC_ERROR_INVALID_PARAMETER  Invalid parameter
1777  * @retval #VC_ERROR_INVALID_STATE      Invalid state
1778  *
1779  * @pre The state should be #VC_STATE_INITIALIZED.
1780  *
1781  * @see vc_mgr_vc_tts_streaming_cb()
1782  * @see vc_mgr_unset_vc_tts_streaming_cb()
1783  */
1784 int vc_mgr_set_vc_tts_streaming_cb(vc_mgr_vc_tts_streaming_cb callback, void* user_data);
1785
1786 /**
1787  * @platform
1788  * @brief Unsets TTS streaming callback function.
1789  * @since_tizen 5.0
1790  *
1791  * @privlevel platform
1792  * @privilege %http://tizen.org/privilege/voicecontrol.manager
1793  *
1794  * @return 0 on success, otherwise a negative error value
1795  * @retval #VC_ERROR_NONE               Successful
1796  * @retval #VC_ERROR_NOT_SUPPORTED      VC not supported
1797  * @retval #VC_ERROR_PERMISSION_DENIED  Permission denied
1798  * @retval #VC_ERROR_INVALID_STATE      Invalid state
1799  *
1800  * @pre The state should be #VC_STATE_INITIALIZED.
1801  *
1802  * @see vc_mgr_vc_tts_streaming_cb()
1803  * @see vc_mgr_set_vc_tts_streaming_cb()
1804  */
1805 int vc_mgr_unset_vc_tts_streaming_cb(void);
1806
1807 /**
1808  * @platform
1809  * @brief Sends the utterance status to the VC client.
1810  * @since_tizen 6.0
1811  *
1812  * @privlevel platform
1813  * @privilege %http://tizen.org/privilege/voicecontrol.manager
1814  *
1815  * @param[in] pid The process id of the VC client
1816  * @param[in] utt_id The utterance id
1817  * @param[in] utt_status The utterance status
1818  *
1819  * @return 0 on success, otherwise a negative error value
1820  * @retval #VC_ERROR_NONE                Successful
1821  * @retval #VC_ERROR_NOT_SUPPORTED       VC not supported
1822  * @retval #VC_ERROR_PERMISSION_DENIED   Permission denied
1823  * @retval #VC_ERROR_INVALID_PARAMETER   Invalid parameter
1824  * @retval #VC_ERROR_OUT_OF_MEMORY       Not enough memory
1825  * @retval #VC_ERROR_INVALID_STATE       Invalid state
1826  * @retval #VC_ERROR_OPERATION_FAILED    Operation fail
1827  *
1828  * @pre The service state should be #VC_SERVICE_STATE_READY.
1829  */
1830 int vc_mgr_send_utterance_status(int pid, int utt_id, vc_tts_utterance_status_e utt_status);
1831
1832 /**
1833  * @platform
1834  * @brief Sends audio streaming to the engine service.
1835  * @details Using this function, the developer can send audio streaming after vc_mgr_start() function is called.
1836  * @since_tizen 6.0
1837  *
1838  * @privlevel platform
1839  * @privilege %http://tizen.org/privilege/voicecontrol.manager
1840  *
1841  * @param[in] event Audio streaming event (e.g. #VC_AUDIO_STREAMING_EVENT_START, #VC_AUDIO_STREAMING_EVENT_CONTINUE)
1842  * @param[in] buffer Audio streaming data
1843  * @param[in] len Length of the audio streaming data
1844  *
1845  * @return 0 on success, otherwise a negative error value
1846  * @retval #VC_ERROR_NONE                Successful
1847  * @retval #VC_ERROR_NOT_SUPPORTED       VC not supported
1848  * @retval #VC_ERROR_PERMISSION_DENIED   Permission denied
1849  * @retval #VC_ERROR_INVALID_PARAMETER   Invalid parameter
1850  * @retval #VC_ERROR_OUT_OF_MEMORY       Not enough memory
1851  * @retval #VC_ERROR_INVALID_STATE       Invalid state
1852  * @retval #VC_ERROR_OPERATION_FAILED    Operation fail
1853  *
1854  * @pre The state should be #VC_SERVICE_STATE_RECORDING.
1855  *
1856  * @see vc_mgr_set_audio_streaming_mode()
1857  */
1858 int vc_mgr_send_audio_streaming(vc_audio_streaming_event_e event, unsigned char *buffer, unsigned int len);
1859
1860 /**
1861  * @platform
1862  * @brief Sets audio streaming mode.
1863  * @since_tizen 6.0
1864  *
1865  * @privlevel platform
1866  * @privilege %http://tizen.org/privilege/voicecontrol.manager
1867  *
1868  * @remarks The default audio streaming mode is #VC_AUDIO_STREAMING_MODE_VC_SERVICE. \n
1869  *      If you want to use other mode, you can set mode with vc_mgr_set_audio_streaming_mode().
1870  *
1871  * @param[in] mode Audio streaming mode
1872  *
1873  * @return 0 on success, otherwise a negative error value
1874  * @retval #VC_ERROR_NONE                Successful
1875  * @retval #VC_ERROR_NOT_SUPPORTED       VC not supported
1876  * @retval #VC_ERROR_PERMISSION_DENIED   Permission denied
1877  * @retval #VC_ERROR_INVALID_PARAMETER   Invalid parameter
1878  * @retval #VC_ERROR_INVALID_STATE       Invalid state
1879  * @retval #VC_ERROR_OPERATION_FAILED    Operation fail
1880  *
1881  * @pre The state should be #VC_STATE_INITIALIZED or #VC_SERVICE_STATE_READY.
1882  *
1883  * @see vc_mgr_send_audio_streaming()
1884  */
1885 int vc_mgr_set_audio_streaming_mode(vc_audio_streaming_mode_e mode);
1886
1887 /**
1888  * @platform
1889  * @brief Changes background volume.
1890  * @since_tizen 6.0
1891  *
1892  * @privlevel public
1893  * @privilege %http://tizen.org/privilege/volume.set
1894  *
1895  * @privlevel platform
1896  * @privilege %http://tizen.org/privilege/voicecontrol.manager
1897  *
1898  * @remarks If @a event is #VC_BACKGROUND_VOLUME_EVENT_CHANGE_FOR_NEARFIELD, the background volume will be reduced by 70%.
1899  *          And, if @a event is #VC_BACKGROUND_VOLUME_EVENT_CHANGE_FOR_FARFIELD, the background volume will be muted.
1900  *
1901  * @param[in] event The background volume event
1902  *
1903  * @return 0 on success, otherwise a negative error value
1904  * @retval #VC_ERROR_NONE                Successful
1905  * @retval #VC_ERROR_NOT_SUPPORTED       VC not supported
1906  * @retval #VC_ERROR_PERMISSION_DENIED   Permission denied
1907  * @retval #VC_ERROR_INVALID_PARAMETER   Invalid parameter
1908  * @retval #VC_ERROR_INVALID_STATE       Invalid state
1909  * @retval #VC_ERROR_OPERATION_FAILED    Operation fail
1910  *
1911  * @pre The state should be #VC_STATE_INITIALIZED or #VC_STATE_READY.
1912  *
1913  * @see vc_mgr_reset_background_volume()
1914  * @see vc_mgr_change_background_volume_by_ratio()
1915  */
1916 int vc_mgr_change_background_volume(vc_background_volume_event_e event);
1917
1918 /**
1919  * @platform
1920  * @brief Changes background volume ratio.
1921  * @details Calling this function sets the background volume to a given percentage of its current value.
1922  * @since_tizen 6.0
1923  *
1924  * @privlevel public
1925  * @privilege %http://tizen.org/privilege/volume.set
1926  *
1927  * @privlevel platform
1928  * @privilege %http://tizen.org/privilege/voicecontrol.manager
1929  *
1930  * @param[in] ratio Current background volume ratio (Range 0.0 ~ 1.0)
1931  *
1932  * @return 0 on success, otherwise a negative error value
1933  * @retval #VC_ERROR_NONE                Successful
1934  * @retval #VC_ERROR_NOT_SUPPORTED       VC not supported
1935  * @retval #VC_ERROR_PERMISSION_DENIED   Permission denied
1936  * @retval #VC_ERROR_INVALID_PARAMETER   Invalid parameter
1937  * @retval #VC_ERROR_INVALID_STATE       Invalid state
1938  * @retval #VC_ERROR_OPERATION_FAILED    Operation fail
1939  *
1940  * @pre The state should be #VC_STATE_INITIALIZED or #VC_STATE_READY.
1941  *
1942  * @see vc_mgr_change_background_volume()
1943  * @see vc_mgr_reset_background_volume()
1944  */
1945 int vc_mgr_change_background_volume_by_ratio(double ratio);
1946
1947 /**
1948  * @platform
1949  * @brief Resets background volume.
1950  * @details This function reverts all changes made by vc_mgr_change_background_volume() and vc_mgr_change_background_volume_by_ratio().
1951  * @since_tizen 6.0
1952  *
1953  * @privlevel public
1954  * @privilege %http://tizen.org/privilege/volume.set
1955  *
1956  * @privlevel platform
1957  * @privilege %http://tizen.org/privilege/voicecontrol.manager
1958  *
1959  * @return 0 on success, otherwise a negative error value
1960  * @retval #VC_ERROR_NONE                Successful
1961  * @retval #VC_ERROR_NOT_SUPPORTED       VC not supported
1962  * @retval #VC_ERROR_PERMISSION_DENIED   Permission denied
1963  * @retval #VC_ERROR_INVALID_STATE       Invalid state
1964  * @retval #VC_ERROR_OPERATION_FAILED    Operation fail
1965  *
1966  * @pre The state should be #VC_STATE_INITIALIZED or #VC_STATE_READY.
1967  *
1968  * @see vc_mgr_change_background_volume()
1969  * @see vc_mgr_change_background_volume_by_ratio()
1970  */
1971 int vc_mgr_reset_background_volume(void);
1972
1973 #ifdef __cplusplus
1974 }
1975 #endif
1976
1977 /**
1978  * @}
1979  */
1980
1981 #endif /* __VOICE_CONTROL_MANAGER_H__ */
1982