2 * Copyright (c) 2011-2015 Samsung Electronics Co., Ltd All Rights Reserved
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
18 #ifndef __VOICE_CONTROL_COMMAND_EXPAND_H__
19 #define __VOICE_CONTROL_COMMAND_EXPAND_H__
23 #include <voice_control_command.h>
32 * @brief Enumerations of command format.
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 */
46 * @brief Sets command domain
47 * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
49 * @param[in] vc_command The command handle
50 * @param[in] domain The domain
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
58 * @see vc_cmd_get_domain()
60 int vc_cmd_set_domain(vc_cmd_h vc_command, int domain);
63 * @brief Gets command domain.
64 * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
66 * @param[in] vc_command The command handle
67 * @param[out] domain The domain
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
75 * @see vc_cmd_set_domain()
77 int vc_cmd_get_domain(vc_cmd_h vc_command, int* domain);
80 * @brief Remove all commands from command list.
81 * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
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
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
93 * @see vc_cmd_list_add()
95 int vc_cmd_list_remove_all(vc_cmd_list_h vc_cmd_list, bool free_command);
98 * @brief Retrieves all commands of command list using callback function.
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
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
111 * @post This function invokes vc_cmd_list_cb() repeatedly for getting commands.
113 * @see vc_cmd_list_cb()
115 int vc_cmd_list_filter_by_type(vc_cmd_list_h original, int type, vc_cmd_list_h* filtered);
121 * @param[in] vc_command The command handle
122 * @param[in] pid Process id
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
128 * @see vc_cmd_get_pid()
130 int vc_cmd_set_pid(vc_cmd_h vc_command, int pid);
133 * @brief Sets command domain
136 * @param[in] vc_command The command handle
137 * @param[out] pid Process id
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
145 * @see vc_cmd_set_pid()
147 int vc_cmd_get_pid(vc_cmd_h vc_command, int* pid);
150 * @brief Sets unfixed command.
153 * @param[in] vc_command The command handle
154 * @param[in] command The unfixed command
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
161 * @see vc_cmd_get_unfixed_command()
163 int vc_cmd_set_unfixed_command(vc_cmd_h vc_command, const char* command);
166 * @brief Gets nlu json data.
169 * @param[in] vc_command The command handle
170 * @param[out] json The nlu json data
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
178 int vc_cmd_get_nlu_json(vc_cmd_h vc_cmd, char** json);
181 * @brief Gets the datetime value from the setence.
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
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.
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
198 * @see vc_cmd_set_datetime_lang()
200 int vc_cmd_get_datetime(const char *text, time_t *result, char **remain);
210 #endif /* __VOICE_CONTROL_COMMAND_EXPAND_H__ */