Merge "Update header and doc files written in English" into tizen
[platform/core/uifw/voice-control.git] / include / voice_control_command_expand.h
1 /*
2 * Copyright (c) 2011-2015 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_COMMAND_EXPAND_H__
19 #define __VOICE_CONTROL_COMMAND_EXPAND_H__
20
21 #include <time.h>
22 #include <tizen.h>
23 #include <voice_control_command.h>
24
25
26 #ifdef __cplusplus
27 extern "C"
28 {
29 #endif
30
31 /**
32  * @brief Enumerations of command format.
33  * @since_tizen 3.0
34  */
35 typedef enum {
36         VC_CMD_FORMAT_FIXED = 0,                /**< Fixed command only */
37         VC_CMD_FORMAT_FIXED_AND_VFIXED,         /**< Fixed + variable fixed command */
38         VC_CMD_FORMAT_VFIXED_AND_FIXED,         /**< Variable fixed + fixed command */
39         VC_CMD_FORMAT_FIXED_AND_NONFIXED,       /**< Fixed + non fixed command */
40         VC_CMD_FORMAT_NONFIXED_AND_FIXED,       /**< Non fixed + fixed command */
41         VC_CMD_FORMAT_ACTION,                   /**< Action command */
42         VC_CMD_FORMAT_PARTIAL                   /**< Partial matched command */
43 } vc_cmd_format_e;
44
45 /**
46 * @brief Sets command domain
47 * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
48 *
49 * @param[in] vc_command The command handle
50 * @param[in] domain The domain
51 *
52 * @return 0 on success, otherwise a negative error value
53 * @retval #VC_ERROR_NONE Successful
54 * @retval #VC_ERROR_INVALID_PARAMETER Invalid parameter
55 * @retval #VC_ERROR_PERMISSION_DENIED Permission denied
56 * @retval #VC_ERROR_NOT_SUPPORTED Not supported feature
57 *
58 * @see vc_cmd_get_domain()
59 */
60 int vc_cmd_set_domain(vc_cmd_h vc_command, int domain);
61
62 /**
63 * @brief Gets command domain.
64 * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
65 *
66 * @param[in] vc_command The command handle
67 * @param[out] domain The domain
68 *
69 * @return 0 on success, otherwise a negative error value
70 * @retval #VC_ERROR_NONE Successful
71 * @retval #VC_ERROR_INVALID_PARAMETER Invalid parameter
72 * @retval #VC_ERROR_PERMISSION_DENIED Permission denied
73 * @retval #VC_ERROR_NOT_SUPPORTED Not supported feature
74 *
75 * @see vc_cmd_set_domain()
76 */
77 int vc_cmd_get_domain(vc_cmd_h vc_command, int* domain);
78
79 /**
80 * @brief Remove all commands from command list.
81 * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
82 *
83 * @param[in] vc_cmd_list The command list handle
84 * @param[in] free_command The command free option @c true = release each commands in list,
85 *                       @c false = remove command from list
86 *
87 * @return 0 on success, otherwise a negative error value
88 * @retval #VC_CMD_ERROR_NONE Successful
89 * @retval #VC_CMD_ERROR_INVALID_PARAMETER Invalid parameter
90 * @retval #VC_CMD_ERROR_PERMISSION_DENIED Permission denied
91 * @retval #VC_CMD_ERROR_NOT_SUPPORTED Not supported feature
92 *
93 * @see vc_cmd_list_add()
94 */
95 int vc_cmd_list_remove_all(vc_cmd_list_h vc_cmd_list, bool free_command);
96
97 /**
98 * @brief Retrieves all commands of command list using callback function.
99 * @since_tizen 3.0
100 *
101 * @param[in] vc_cmd_list The command list handle
102 * @param[in] callback Callback function to invoke
103 * @param[in] user_data The user data to be passed to the callback function
104 *
105 * @return 0 on success, otherwise a negative error value
106 * @retval #VC_ERROR_NONE Successful
107 * @retval #VC_ERROR_INVALID_PARAMETER Invalid parameter
108 * @retval #VC_ERROR_PERMISSION_DENIED Permission denied
109 * @retval #VC_ERROR_NOT_SUPPORTED Not supported
110 *
111 * @post This function invokes vc_cmd_list_cb() repeatedly for getting commands.
112 *
113 * @see vc_cmd_list_cb()
114 */
115 int vc_cmd_list_filter_by_type(vc_cmd_list_h original, int type, vc_cmd_list_h* filtered);
116
117 /**
118 * @brief Sets pid.
119 * @since_tizen 3.0
120 *
121 * @param[in] vc_command The command handle
122 * @param[in] pid Process id
123 *
124 * @return 0 on success, otherwise a negative error value
125 * @retval #VC_CMD_ERROR_NONE Successful
126 * @retval #VC_CMD_ERROR_INVALID_PARAMETER Invalid parameter
127 *
128 * @see vc_cmd_get_pid()
129 */
130 int vc_cmd_set_pid(vc_cmd_h vc_command, int pid);
131
132 /**
133 * @brief Sets command domain
134 * @since_tizen 3.0
135 *
136 * @param[in] vc_command The command handle
137 * @param[out] pid Process id
138 *
139 * @return 0 on success, otherwise a negative error value
140 * @retval #VC_CMD_ERROR_NONE Successful
141 * @retval #VC_CMD_ERROR_INVALID_PARAMETER Invalid parameter
142 * @retval #VC_CMD_ERROR_PERMISSION_DENIED Permission denied
143 * @retval #VC_CMD_ERROR_NOT_SUPPORTED Not supported feature
144 *
145 * @see vc_cmd_set_pid()
146 */
147 int vc_cmd_get_pid(vc_cmd_h vc_command, int* pid);
148
149 /**
150 * @brief Sets unfixed command.
151 * @since_tizen 3.0
152 *
153 * @param[in] vc_command The command handle
154 * @param[in] command The unfixed command
155 *
156 * @return 0 on success, otherwise a negative error value
157 * @retval #VC_CMD_ERROR_NONE Successful
158 * @retval #VC_CMD_ERROR_INVALID_PARAMETER Invalid parameter
159 * @retval #VC_CMD_ERROR_NOT_SUPPORTED Not supported feature
160 *
161 * @see vc_cmd_get_unfixed_command()
162 */
163 int vc_cmd_set_unfixed_command(vc_cmd_h vc_command, const char* command);
164
165 /**
166 * @brief Gets nlu json data.
167 * @since_tizen 3.0
168 *
169 * @param[in] vc_command The command handle
170 * @param[out] json The nlu json data
171 *
172 * @return 0 on success, otherwise a negative error value
173 * @retval #VC_ERROR_NONE Successful
174 * @retval #VC_ERROR_INVALID_PARAMETER Invalid parameter
175 * @retval #VC_ERROR_NOT_SUPPORTED Not supported feature
176 *
177 */
178 int vc_cmd_get_nlu_json(vc_cmd_h vc_cmd, char** json);
179
180 /**
181 * @brief Gets the datetime value from the setence.
182 * @since_tizen 3.0
183 *
184 * @param[in] text The sentence to analyze
185 * @param[out] result The datetime value in the sentence
186 * @param[out] remain Remained text except time
187 *
188 * @remark If the function succeeds, @a remain must be released with free() by you when you no longer need it.
189 *       If there is no time value in @a text or the function does not work correctly,
190 *       @a result is -1. Otherwise @a result has the time value in @a text.
191 *
192 * @return 0 on success, otherwise a negative error value
193 * @retval #VC_CMD_ERROR_NONE Successful
194 * @retval #VC_ERROR_OPERATION_FAILED operation failure
195 * @retval #VC_ERROR_OUT_OF_MEMORY Not enough memory
196 * @retval #VC_CMD_ERROR_INVALID_PARAMETER Invalid parameter
197 *
198 * @see vc_cmd_set_datetime_lang()
199 */
200 int vc_cmd_get_datetime(const char *text, time_t *result, char **remain);
201
202 #ifdef __cplusplus
203 }
204 #endif
205
206 /**
207  * @}@}
208  */
209
210 #endif /* __VOICE_CONTROL_COMMAND_EXPAND_H__ */