Merge "remove duplicated codes" into tizen
[platform/core/uifw/stt.git] / include / stt_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 #ifndef __STT_INTERNAL_H__
18 #define __STT_INTERNAL_H__
19
20 #include <tizen.h>
21
22 /**
23  * @file stt_internal.h
24  */
25
26 #ifdef __cplusplus
27 extern "C"
28 {
29 #endif
30
31 #define STT_SPEECH_STATUS_BEGINNING_POINT_DETECTED      0
32
33 /**
34  * @brief Called when user speaking is detected.
35  *
36  * @param[in] stt The STT handle
37  * @param[in] status The speech status
38  * @param[in] user_data The user data passed from the callback registration function
39  *
40  * @pre An application registers callback function using stt_set_speech_status_cb().
41  *
42  * @see stt_set_speech_status_cb()
43  * @see stt_unset_speech_status_cb()
44  */
45 typedef void (*stt_speech_status_cb)(stt_h stt, int status, void *user_data);
46
47
48 /**
49  * @brief Registers a callback function to detect the speech status is changed.
50  * @since_tizen 3.0
51  * @privilege %http://tizen.org/privilege/recorder
52  *
53  * @param[in] stt The STT handle
54  * @param[in] callback The callback function to register
55  * @param[in] user_data The user data to be passed to the callback function
56  *
57  * @return 0 on success, otherwise a negative error value
58  * @retval #STT_ERROR_NONE Successful
59  * @retval #STT_ERROR_INVALID_PARAMETER Invalid parameter
60  * @retval #STT_ERROR_INVALID_STATE Invalid state
61  * @retval #STT_ERROR_NOT_SUPPORTED STT NOT supported
62  * @retval #STT_ERROR_PERMISSION_DENIED Permission denied
63  *
64  * @pre The state should be #STT_STATE_CREATED.
65  *
66  * @see stt_speech_status_cb()
67  * @see stt_unset_speech_status_cb()
68 */
69 int stt_set_speech_status_cb(stt_h stt, stt_speech_status_cb callback, void* user_data);
70
71 /**
72  * @brief Unregisters the callback function.
73  * @since_tizen 3.0
74  * @privilege %http://tizen.org/privilege/recorder
75  *
76  * @param[in] stt The STT handle
77  *
78  * @return 0 on success, otherwise a negative error value
79  * @retval #STT_ERROR_NONE Successful
80  * @retval #STT_ERROR_INVALID_PARAMETER Invalid parameter
81  * @retval #STT_ERROR_INVALID_STATE Invalid state
82  * @retval #STT_ERROR_NOT_SUPPORTED STT NOT supported
83  * @retval #STT_ERROR_PERMISSION_DENIED Permission denied
84  *
85  * @pre The state should be #STT_STATE_CREATED.
86  *
87  * @see stt_set_speech_status_cb()
88 */
89 int stt_unset_speech_status_cb(stt_h stt);
90
91 #ifdef __cplusplus
92 }
93 #endif
94
95 /**
96  * @}@}
97  */
98
99 #endif /* __STT_INTERNAL_H__ */
100