ba34513fb4ebf5f0f27ffcb547a02f89b0865810
[platform/core/uifw/voice-control.git] / doc / uix_vc_doc.h
1 /*
2  * Copyright (c) 2011-2014 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 __TIZEN_UIX_VOICE_CONTROL_DOC_H__
19 #define __TIZEN_UIX_VOICE_CONTROL_DOC_H__
20
21 /**
22  * @defgroup CAPI_UIX_VOICE_CONTROL_MODULE Voice control
23  * @ingroup CAPI_UIX_FRAMEWORK
24  * @brief The @ref CAPI_UIX_VOICE_CONTROL_MODULE API provides functions for registering command and getting notification when registered command is recognized.
25  * 
26  * @section CAPI_UIX_VOICE_CONTROL_MODULE_HEADER Required Header
27  *   \#include <voice_control.h><br>
28  * 
29  * @section CAPI_UIX_VOICE_CONTROL_MODULE_OVERVIEW Overview
30  * A main function of Voice Control API register command and gets notification for recognition result.
31  * Applications can add their own commands and be provided result when their command is recognized by user voice input.
32  * 
33  * To use of Voice Control, use the following steps:
34  * 1. Initialize <br>
35  * 2. Register callback functions for notifications <br> 
36  * 3. Connect to voice control service asynchronously. The state should be changed to Ready <br>
37  * 4. Make command list as the following step <br>
38  * 4-1. Create command list handle <br>
39  * 4-2. Create command handle <br>
40  * 4-3. Set command and type for command handle <br>
41  * 4-4. Add command handle to command list <br>
42  * Step 4 is called repeatedly for each command which an application wants <br>
43  * 5. Set command list for recognition <br>
44  * 6. If an application wants to finish voice control,<br>
45  * 6-1. Destroy command and command list handle <br>
46  * 6-2. Deinitialize <br>
47  *
48  * An application can obtain command handle from command list, and also get information from handle. 
49  *
50  *
51  * The Voice Control API also notifies you (by callback mechanism) when the states of client and service are changed, 
52  * command is recognized, current language is changed or error occurred.
53  * An application should register callback functions: vc_state_changed_cb(), vc_service_state_changed_cb(), vc_result_cb(), 
54  * vc_current_language_changed_cb(), vc_error_cb().
55  *
56  * @section CAPI_UIX_VOICE_CONTROL_MODULE_STATE_DIAGRAM State Diagram
57  * The following diagram shows the life cycle and the states of the Voice Control.
58  *
59  * @image html capi_uix_voice_control_state_diagram.png "<State diagram>    "
60  * The following diagram shows the states of Voice Control service.
61  * @image html capi_uix_voice_control_service_state_diagram.png "<Service state diagram>"
62  *
63  * @section CAPI_UIX_VOICE_CONTROL_MODULE_STATE_TRANSITIONS State Transitions
64  *
65  * <table>
66  * <tr>
67  * <th>FUNCTION</th>
68  * <th>PRE-STATE</th>
69  * <th>POST-STATE</th>
70  * <th>SYNC TYPE</th>
71  * </tr>
72  * <tr>
73  * <td>vc_initialize()</td>
74  * <td>None</td>
75  * <td>Initialized</td>
76  * <td>SYNC</td>
77  * </tr>
78  * <tr>
79  * <td>vc_deinitialize()</td>
80  * <td>Initialized</td>
81  * <td>None</td>
82  * <td>SYNC</td>
83  * </tr>
84  * <tr>
85  * <td>vc_prepare()</td>
86  * <td>Initialized</td>
87  * <td>Ready</td>
88  * <td>ASYNC</td>
89  * </tr>
90  * <tr>
91  * <td>vc_unprepare()</td>
92  * <td>Ready</td>
93  * <td>Initialized</td>
94  * <td>SYNC</td>
95  * </tr>
96
97  * </table>
98  *
99  * @section CAPI_UIX_VOICE_CONTROL_MODULE_STATE_DEPENDENT_FUNCTION_CALLS State Dependent Function Calls
100  * The following table shows state-dependent function calls.
101  * It is forbidden to call functions listed below in wrong states.
102  * Violation of this rule may result in an unpredictable behavior.
103  * 
104  * <table>
105  * <tr>
106  * <th>FUNCTION</th>
107  * <th>VALID STATES</th>
108  * <th>DESCRIPTION</th>
109  * </tr>
110  * <tr>
111  * <td>vc_initialize()</td>
112  * <td>None</td>
113  * <td>All functions must be called after vc_initialize()</td>
114  * </tr>
115  * <tr>
116  * <td>vc_deinitialize()</td>
117  * <td>Initialized, Ready</td>
118  * <td>This function should be called when an application want to finalize voice control using</td>
119  * </tr>
120  * <tr>
121  * <td>vc_prepare()</td>
122  * <td>Initialized</td>
123  * <td>This function works asynchronously. If service start is failed, application gets the error callback.</td>
124  * </tr>
125  * <tr>
126  * <td>vc_unprepare()</td>
127  * <td>Ready</td>
128  * <td></td>
129  * </tr>
130  * <tr>
131  * <td>vc_foreach_supported_languages()</td>
132  * <td>Initialized, Ready</td>
133  * <td></td>
134  * </tr>
135  * <tr>
136  * <td>vc_get_current_language()</td>
137  * <td>Initialized, Ready</td>
138  * <td></td>
139  * </tr>
140  * <tr>
141  * <td>vc_get_state()</td>
142  * <td>Initialized, Ready</td>
143  * <td></td>
144  * </tr>
145  * <tr>
146  * <td>vc_get_service_state()</td>
147  * <td>Initialized, Ready</td>
148  * <td></td>
149  * </tr>
150  * <tr>
151  * <td>vc_set_command_list()</td>
152  * <td>Ready</td>
153  * <td></td>
154  * </tr>
155  * <tr>
156  * <td>vc_unset_command_list()</td>
157  * <td>Ready</td>
158  * <td></td>
159  * </tr>
160  * <tr>
161  * <td>
162  * vc_set_result_cb()<br>
163  * vc_unset_result_cb()<br>
164  * vc_set_state_changed_cb()<br>
165  * vc_unset_state_changed_cb()<br>
166  * vc_set_service_state_changed_cb()<br>
167  * vc_unset_service_state_changed_cb()<br>
168  * vc_set_current_language_changed_cb()<br>
169  * vc_unset_current_language_changed_cb()<br>
170  * vc_set_error_cb()<br>
171  * vc_unset_error_cb()</td>
172  * <td>Initialized</td>
173  * <td> All callback function should be registered in Initialized state </td>
174  * </tr>
175  * </table>
176  * 
177  * @section CAPI_UIX_STT_MODULE_FEATURE Related Features
178  * This API is related with the following features:<br>
179  *  - http://tizen.org/feature/microphone<br>
180  *
181  * It is recommended to design feature related codes in your application for reliability.<br>
182  * You can check if a device supports the related features for this API by using @ref CAPI_SYSTEM_SYSTEM_INFO_MODULE, thereby controlling the procedure of your application.<br>
183  * To ensure your application is only running on the device with specific features, please define the features in your manifest file using the manifest editor in the SDK.<br>
184  * More details on featuring your application can be found from <a href="../org.tizen.mobile.native.appprogramming/html/ide_sdk_tools/feature_element.htm"><b>Feature Element</b>.</a>
185  *
186  */
187
188 #endif /* __TIZEN_UIX_VOICE_CONTROL_DOC_H__ */
189