Add description and retry limitation for vc_prepare_sync
[platform/core/uifw/voice-control.git] / include / voice_control_internal.h
1 /*
2    * Copyright (c) 2011-2016 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_INTERNAL_H__
19 #define __VOICE_CONTROL_INTERNAL_H__
20
21 #include <tizen.h>
22
23
24 #ifdef __cplusplus
25 extern "C"
26 {
27 #endif
28
29 /**
30 * @brief Called when client gets the asr recognition result from vc-daemon.
31 *
32 * @param[in] event The result event
33 * @param[in] result ASR text
34 * @param[in] user_data The user data passed from the callback registration function
35 *
36 * @return @c true when asr result is consumed \n @c false to propagate.
37 *
38 * @pre An application registers callback function using vc_mgr_set_pre_result_cb().
39 *
40 * @see vc_widget_set_asr_result_cb()
41 * @see vc_widget_unset_asr_result_cb()
42 */
43 typedef bool (*vc_asr_result_cb)(vc_result_event_e event, const char* result, void *user_data);
44
45 /**
46  * @brief Sets command list from file.
47  * @since_tizen 3.0
48  * @privlevel public
49  * @privilege %http://tizen.org/privilege/recorder
50  *
51  * @remarks The command type is valid for #VC_COMMAND_TYPE_FOREGROUND and #VC_COMMAND_TYPE_BACKGROUND.
52  * Therefore, @a type is either #VC_COMMAND_TYPE_FOREGROUND or #VC_COMMAND_TYPE_BACKGROUND.
53  * In the file corresponding to @a file_path, there must be commands and command types.
54  *
55  * @param[in] file_path The command file path (absolute or relative)
56  * @param[in] type Command type
57  *
58  * @return 0 on success, otherwise a negative error value
59  * @retval #VC_ERROR_NONE Successful
60  * @retval #VC_ERROR_INVALID_PARAMETER Invalid parameter
61  * @retval #VC_ERROR_INVALID_STATE Invalid state
62  * @retval #VC_ERROR_PERMISSION_DENIED Permission denied
63  * @retval #VC_ERROR_NOT_SUPPORTED Not supported
64  *
65  * @pre The state should be #VC_STATE_READY.
66  *
67  * @see vc_unset_command_list()
68  */
69 int vc_set_command_list_from_file(const char* file_path, int type);
70
71 /**
72  * @brief Connects the voice control service synchronously.
73  * @since_tizen 4.0
74  * @privlevel public
75  * @privilege %http://tizen.org/privilege/recorder
76  * @return @c 0 on success,
77  *         otherwise a negative error value
78  * @retval #VC_ERROR_NONE Successful
79  * @retval #VC_ERROR_INVALID_STATE Invalid state
80  * @retval #VC_ERROR_OPERATION_FAILED Operation failure
81  * @retval #VC_ERROR_PERMISSION_DENIED Permission denied
82  * @retval #VC_ERROR_NOT_SUPPORTED Not supported
83  * @pre The state should be #VC_STATE_INITIALIZED.
84  * @post If this function is called, the state will be #VC_STATE_READY.
85  * @see vc_unprepare()
86  */
87 int vc_prepare_sync(void);
88
89
90 #ifdef __cplusplus
91 }
92 #endif
93
94 /**
95    * @}@}
96     */
97
98 #endif /* __VOICE_CONTROL_INTERNAL_H__ */