Merge "Apply command priority Add api for filtering command by type" 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 <tizen.h>
22 #include <voice_control_command.h>
23
24
25 #ifdef __cplusplus
26 extern "C"
27 {
28 #endif
29
30
31 /**
32 * @brief Enumerations of command format.
33 * @since_tizen 2.4
34 */
35 typedef enum {
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 */
40 } vc_cmd_format_e;
41
42
43 /**
44 * @brief Gets extra unfixed command.
45 * @since_tizen 2.4
46 *
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.
50 *
51 * @param[in] vc_command The command handle
52 * @param[out] command The unfixed command text
53 *
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
59 */
60 int vc_cmd_get_unfixed_command(vc_cmd_h vc_command, char** command);
61
62 /**
63 * @brief Sets command format.
64 * @since_tizen 2.4
65 *
66 * @param[in] vc_command The command handle
67 * @param[in] format The command format
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_get_format()
76 */
77 int vc_cmd_set_format(vc_cmd_h vc_command, vc_cmd_format_e format);
78
79 /**
80 * @brief Gets command format.
81 * @since_tizen 2.4
82 *
83 * @remark If you do not set the format, the default format is #VC_CMD_FORMAT_FIXED.
84 *
85 * @param[in] vc_command The command handle
86 * @param[out] format The command format
87 *
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
93 *
94 * @see vc_cmd_set_format()
95 */
96 int vc_cmd_get_format(vc_cmd_h vc_command, vc_cmd_format_e* format);
97
98 /**
99 * @brief Sets command domain
100 * @since_tizen 2.4
101 *
102 * @param[in] vc_command The command handle
103 * @param[in] domain The domain
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 feature
110 *
111 * @see vc_cmd_get_domain()
112 */
113 int vc_cmd_set_domain(vc_cmd_h vc_command, int domain);
114
115 /**
116 * @brief Gets command domain.
117 * @since_tizen 2.4
118 *
119 * @param[in] vc_command The command handle
120 * @param[out] domain The domain
121 *
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
127 *
128 * @see vc_cmd_set_domain()
129 */
130 int vc_cmd_get_domain(vc_cmd_h vc_command, int* domain);
131
132 /**
133 * @brief Remove all commands from command list.
134 * @since_tizen 2.4
135 *
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
139 *
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
145 *
146 * @see vc_cmd_list_add()
147 */
148 int vc_cmd_list_remove_all(vc_cmd_list_h vc_cmd_list, bool free_command);
149
150 /**
151 * @brief Retrieves all commands of command list using callback function.
152 * @since_tizen 3.0
153 *
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
157 *
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
163 *
164 * @post This function invokes vc_cmd_list_cb() repeatedly for getting commands.
165 *
166 * @see vc_cmd_list_cb()
167 */
168 int vc_cmd_list_filter_by_type(vc_cmd_list_h original, int type, vc_cmd_list_h* filtered);
169
170 #ifdef __cplusplus
171 }
172 #endif
173
174 /**
175  * @}@}
176  */
177
178 #endif /* __VOICE_CONTROL_COMMAND_EXPAND_H__ */