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