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__
22 #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_EXTRA, /**< Fixed + extra unfixed command */
38 VC_CMD_FORMAT_EXTRA_AND_FIXED, /**< Extra unfixed + fixed command */
39 VC_CMD_FORMAT_UNFIXED_ONLY /**< Unfixed command */
44 * @brief Gets extra unfixed command.
47 * @remark If the function succeeds, @a The command must be released with free() by you if they are not NULL.
48 * If you get the result command list in result callback and the command type of commands has non-fixed format,
49 * you should check non-fixed result using this function.
51 * @param[in] vc_command The command handle
52 * @param[out] command The unfixed command text
54 * @return 0 on success, otherwise a negative error value
55 * @retval #VC_ERROR_NONE Successful
56 * @retval #VC_ERROR_INVALID_PARAMETER Invalid parameter
57 * @retval #VC_ERROR_PERMISSION_DENIED Permission denied
58 * @retval #VC_ERROR_NOT_SUPPORTED Not supported feature
60 int vc_cmd_get_unfixed_command(vc_cmd_h vc_command, char** command);
63 * @brief Sets command format.
66 * @param[in] vc_command The command handle
67 * @param[in] format The command format
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_get_format()
77 int vc_cmd_set_format(vc_cmd_h vc_command, vc_cmd_format_e format);
80 * @brief Gets command format.
83 * @remark If you do not set the format, the default format is #VC_CMD_FORMAT_FIXED.
85 * @param[in] vc_command The command handle
86 * @param[out] format The command format
88 * @return 0 on success, otherwise a negative error value
89 * @retval #VC_ERROR_NONE Successful
90 * @retval #VC_ERROR_INVALID_PARAMETER Invalid parameter
91 * @retval #VC_ERROR_PERMISSION_DENIED Permission denied
92 * @retval #VC_ERROR_NOT_SUPPORTED Not supported feature
94 * @see vc_cmd_set_format()
96 int vc_cmd_get_format(vc_cmd_h vc_command, vc_cmd_format_e* format);
99 * @brief Sets command domain
102 * @param[in] vc_command The command handle
103 * @param[in] domain The domain
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 feature
111 * @see vc_cmd_get_domain()
113 int vc_cmd_set_domain(vc_cmd_h vc_command, int domain);
116 * @brief Gets command domain.
119 * @param[in] vc_command The command handle
120 * @param[out] domain The domain
122 * @return 0 on success, otherwise a negative error value
123 * @retval #VC_ERROR_NONE Successful
124 * @retval #VC_ERROR_INVALID_PARAMETER Invalid parameter
125 * @retval #VC_ERROR_PERMISSION_DENIED Permission denied
126 * @retval #VC_ERROR_NOT_SUPPORTED Not supported feature
128 * @see vc_cmd_set_domain()
130 int vc_cmd_get_domain(vc_cmd_h vc_command, int* domain);
133 * @brief Remove all commands from command list.
136 * @param[in] vc_cmd_list The command list handle
137 * @param[in] free_command The command free option @c true = release each commands in list,
138 * @c false = remove command from list
140 * @return 0 on success, otherwise a negative error value
141 * @retval #VC_CMD_ERROR_NONE Successful
142 * @retval #VC_CMD_ERROR_INVALID_PARAMETER Invalid parameter
143 * @retval #VC_CMD_ERROR_PERMISSION_DENIED Permission denied
144 * @retval #VC_CMD_ERROR_NOT_SUPPORTED Not supported feature
146 * @see vc_cmd_list_add()
148 int vc_cmd_list_remove_all(vc_cmd_list_h vc_cmd_list, bool free_command);
151 * @brief Retrieves all commands of command list using callback function.
154 * @param[in] vc_cmd_list The command list handle
155 * @param[in] callback Callback function to invoke
156 * @param[in] user_data The user data to be passed to the callback function
158 * @return 0 on success, otherwise a negative error value
159 * @retval #VC_ERROR_NONE Successful
160 * @retval #VC_ERROR_INVALID_PARAMETER Invalid parameter
161 * @retval #VC_ERROR_PERMISSION_DENIED Permission denied
162 * @retval #VC_ERROR_NOT_SUPPORTED Not supported
164 * @post This function invokes vc_cmd_list_cb() repeatedly for getting commands.
166 * @see vc_cmd_list_cb()
168 int vc_cmd_list_filter_by_type(vc_cmd_list_h original, int type, vc_cmd_list_h* filtered);
178 #endif /* __VOICE_CONTROL_COMMAND_EXPAND_H__ */