Tizen Native API
5.0
|
The Voice control command API provides functions for creating/destroying command list and add/remove/retrieve commands of list.
Copyright (c) 2011-2016 Samsung Electronics Co., Ltd All Rights Reserved
Licensed under the Apache License, Version 2.0 (the License); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an AS IS BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Functions | |
int | vc_cmd_list_create (vc_cmd_list_h *vc_cmd_list) |
Creates a handle for command list. | |
int | vc_cmd_list_destroy (vc_cmd_list_h vc_cmd_list, bool free_command) |
Destroys the handle for command list. | |
int | vc_cmd_list_get_count (vc_cmd_list_h vc_cmd_list, int *count) |
Gets command count of list. | |
int | vc_cmd_list_add (vc_cmd_list_h vc_cmd_list, vc_cmd_h vc_command) |
Adds command to command list. | |
int | vc_cmd_list_remove (vc_cmd_list_h vc_cmd_list, vc_cmd_h vc_command) |
Removes command from command list. | |
int | vc_cmd_list_foreach_commands (vc_cmd_list_h vc_cmd_list, vc_cmd_list_cb callback, void *user_data) |
Retrieves all commands of command list using callback function. | |
int | vc_cmd_list_first (vc_cmd_list_h vc_cmd_list) |
Moves index to first command. | |
int | vc_cmd_list_last (vc_cmd_list_h vc_cmd_list) |
Moves index to last command. | |
int | vc_cmd_list_next (vc_cmd_list_h vc_cmd_list) |
Moves index to next command. | |
int | vc_cmd_list_prev (vc_cmd_list_h vc_cmd_list) |
Moves index to previous command. | |
int | vc_cmd_list_get_current (vc_cmd_list_h vc_cmd_list, vc_cmd_h *vc_command) |
Get current command from command list by index. | |
int | vc_cmd_create (vc_cmd_h *vc_command) |
Creates a handle for command. | |
int | vc_cmd_destroy (vc_cmd_h vc_command) |
Destroys the handle. | |
int | vc_cmd_set_command (vc_cmd_h vc_command, const char *command) |
Sets command or action. | |
int | vc_cmd_get_command (vc_cmd_h vc_command, char **command) |
Gets command. | |
int | vc_cmd_get_unfixed_command (vc_cmd_h vc_command, char **command) |
Gets the unfixed command. | |
int | vc_cmd_set_type (vc_cmd_h vc_command, int type) |
Sets command type. | |
int | vc_cmd_get_type (vc_cmd_h vc_command, int *type) |
Gets command type. | |
int | vc_cmd_set_format (vc_cmd_h vc_command, int format) |
Sets the command format. | |
int | vc_cmd_get_format (vc_cmd_h vc_command, int *format) |
Gets the command format. | |
Typedefs | |
typedef struct vc_cmd_s * | vc_cmd_h |
The voice command handle. | |
typedef struct vc_cmd_list_s * | vc_cmd_list_h |
The voice command list handle. | |
typedef bool(* | vc_cmd_list_cb )(vc_cmd_h vc_command, void *user_data) |
Called to retrieve The commands in list. | |
Defines | |
#define | VC_COMMAND_FORMAT_FIXED 0 |
Definition for fixed command format. | |
#define | VC_COMMAND_FORMAT_FIXED_AND_VFIXED 1 |
Definition for fixed and variable fixed command format. | |
#define | VC_COMMAND_FORMAT_VFIXED_AND_FIXED 2 |
Definition for variable fixed and fixed command format. | |
#define | VC_COMMAND_FORMAT_FIXED_AND_NONFIXED 3 |
Definition for fixed and non-fixed command format. | |
#define | VC_COMMAND_FORMAT_NONFIXED_AND_FIXED 4 |
Definition for non-fixed and fixed command format. |
#define VC_COMMAND_FORMAT_FIXED 0 |
Definition for fixed command format.
#define VC_COMMAND_FORMAT_FIXED_AND_NONFIXED 3 |
Definition for fixed and non-fixed command format.
#define VC_COMMAND_FORMAT_FIXED_AND_VFIXED 1 |
Definition for fixed and variable fixed command format.
#define VC_COMMAND_FORMAT_NONFIXED_AND_FIXED 4 |
Definition for non-fixed and fixed command format.
#define VC_COMMAND_FORMAT_VFIXED_AND_FIXED 2 |
Definition for variable fixed and fixed command format.
typedef struct vc_cmd_s* vc_cmd_h |
The voice command handle.
typedef bool(* vc_cmd_list_cb)(vc_cmd_h vc_command, void *user_data) |
Called to retrieve The commands in list.
[in] | vc_command | The command handle |
[in] | user_data | The user data passed from the foreach function |
true
to continue with the next iteration of the loop, false
to break out of the loop typedef struct vc_cmd_list_s* vc_cmd_list_h |
The voice command list handle.
int vc_cmd_create | ( | vc_cmd_h * | vc_command | ) |
Creates a handle for command.
[out] | vc_command | The command handle |
0
on success, otherwise a negative error value VC_ERROR_NONE | Successful |
VC_ERROR_OUT_OF_MEMORY | Out of memory |
VC_ERROR_INVALID_PARAMETER | Invalid parameter |
VC_ERROR_PERMISSION_DENIED | Permission denied |
VC_ERROR_NOT_SUPPORTED | Not supported |
int vc_cmd_destroy | ( | vc_cmd_h | vc_command | ) |
Destroys the handle.
[in] | vc_command | The command handle |
0
on success, otherwise a negative error value VC_ERROR_NONE | Successful |
VC_ERROR_INVALID_PARAMETER | Invalid parameter |
VC_ERROR_PERMISSION_DENIED | Permission denied |
VC_ERROR_NOT_SUPPORTED | Not supported |
int vc_cmd_get_command | ( | vc_cmd_h | vc_command, |
char ** | command | ||
) |
Gets command.
[in] | vc_command | The command handle |
[out] | command | The command text |
0
on success, otherwise a negative error value VC_ERROR_NONE | Successful |
VC_ERROR_INVALID_PARAMETER | Invalid parameter |
VC_ERROR_PERMISSION_DENIED | Permission denied |
VC_ERROR_NOT_SUPPORTED | Not supported |
int vc_cmd_get_format | ( | vc_cmd_h | vc_command, |
int * | format | ||
) |
Gets the command format.
[in] | vc_command | The command handle |
[out] | format | The command format |
0
on success, otherwise a negative error value VC_ERROR_NONE | Successful |
VC_ERROR_INVALID_PARAMETER | Invalid parameter |
VC_ERROR_PERMISSION_DENIED | Permission denied |
VC_ERROR_NOT_SUPPORTED | Not supported feature |
int vc_cmd_get_type | ( | vc_cmd_h | vc_command, |
int * | type | ||
) |
Gets command type.
[in] | vc_command | The command handle |
[out] | type | The command type |
0
on success, otherwise a negative error value VC_ERROR_NONE | Successful |
VC_ERROR_INVALID_PARAMETER | Invalid parameter |
VC_ERROR_PERMISSION_DENIED | Permission denied |
VC_ERROR_NOT_SUPPORTED | Not supported |
int vc_cmd_get_unfixed_command | ( | vc_cmd_h | vc_command, |
char ** | command | ||
) |
Gets the unfixed command.
[in] | vc_command | The command handle |
[out] | command | The unfixed command text |
0
on success, otherwise a negative error value VC_ERROR_NONE | Successful |
VC_ERROR_INVALID_PARAMETER | Invalid parameter |
VC_ERROR_PERMISSION_DENIED | Permission denied |
VC_ERROR_NOT_SUPPORTED | Not supported feature |
int vc_cmd_list_add | ( | vc_cmd_list_h | vc_cmd_list, |
vc_cmd_h | vc_command | ||
) |
Adds command to command list.
[in] | vc_cmd_list | The command list handle |
[in] | vc_command | The command handle |
0
on success, otherwise a negative error value VC_ERROR_NONE | Successful |
VC_ERROR_INVALID_PARAMETER | Invalid parameter |
VC_ERROR_PERMISSION_DENIED | Permission denied |
VC_ERROR_NOT_SUPPORTED | Not supported |
int vc_cmd_list_create | ( | vc_cmd_list_h * | vc_cmd_list | ) |
Creates a handle for command list.
[out] | vc_cmd_list | The command list handle |
0
on success, otherwise a negative error value VC_ERROR_NONE | Successful |
VC_ERROR_OUT_OF_MEMORY | Out of memory |
VC_ERROR_INVALID_PARAMETER | Invalid parameter |
VC_ERROR_PERMISSION_DENIED | Permission denied |
VC_ERROR_NOT_SUPPORTED | Not supported |
int vc_cmd_list_destroy | ( | vc_cmd_list_h | vc_cmd_list, |
bool | free_command | ||
) |
Destroys the handle for command list.
[in] | vc_cmd_list | The command list handle |
[in] | free_command | The command free option true = release each commands in list, false = remove command from list |
0
on success, otherwise a negative error value VC_ERROR_NONE | Successful |
VC_ERROR_INVALID_PARAMETER | Invalid parameter |
VC_ERROR_PERMISSION_DENIED | Permission denied |
VC_ERROR_NOT_SUPPORTED | Not supported |
int vc_cmd_list_first | ( | vc_cmd_list_h | vc_cmd_list | ) |
Moves index to first command.
[in] | vc_cmd_list | The command list handle |
0
on success, otherwise a negative error value VC_ERROR_NONE | Successful |
VC_ERROR_INVALID_PARAMETER | Invalid parameter |
VC_ERROR_EMPTY | List empty |
VC_ERROR_PERMISSION_DENIED | Permission denied |
VC_ERROR_NOT_SUPPORTED | Not supported |
int vc_cmd_list_foreach_commands | ( | vc_cmd_list_h | vc_cmd_list, |
vc_cmd_list_cb | callback, | ||
void * | user_data | ||
) |
Retrieves all commands of command list using callback function.
[in] | vc_cmd_list | The command list handle |
[in] | callback | Callback function to invoke |
[in] | user_data | The user data to be passed to the callback function |
0
on success, otherwise a negative error value VC_ERROR_NONE | Successful |
VC_ERROR_INVALID_PARAMETER | Invalid parameter |
VC_ERROR_PERMISSION_DENIED | Permission denied |
VC_ERROR_NOT_SUPPORTED | Not supported |
int vc_cmd_list_get_count | ( | vc_cmd_list_h | vc_cmd_list, |
int * | count | ||
) |
Gets command count of list.
[in] | vc_cmd_list | The command list handle |
[out] | count | The count |
0
on success, otherwise a negative error value VC_ERROR_NONE | Successful |
VC_ERROR_INVALID_PARAMETER | Invalid parameter |
VC_ERROR_PERMISSION_DENIED | Permission denied |
VC_ERROR_NOT_SUPPORTED | Not supported |
int vc_cmd_list_get_current | ( | vc_cmd_list_h | vc_cmd_list, |
vc_cmd_h * | vc_command | ||
) |
Get current command from command list by index.
[in] | vc_cmd_list | The command list handle |
[out] | vc_command | The command handle |
0
on success, otherwise a negative error value VC_ERROR_NONE | Successful |
VC_ERROR_INVALID_PARAMETER | Invalid parameter |
VC_ERROR_EMPTY | List empty |
VC_ERROR_PERMISSION_DENIED | Permission denied |
VC_ERROR_NOT_SUPPORTED | Not supported |
int vc_cmd_list_last | ( | vc_cmd_list_h | vc_cmd_list | ) |
Moves index to last command.
[in] | vc_cmd_list | The command list handle |
0
on success, otherwise a negative error value VC_ERROR_NONE | Successful |
VC_ERROR_INVALID_PARAMETER | Invalid parameter |
VC_ERROR_EMPTY | List empty |
VC_ERROR_PERMISSION_DENIED | Permission denied |
VC_ERROR_NOT_SUPPORTED | Not supported |
int vc_cmd_list_next | ( | vc_cmd_list_h | vc_cmd_list | ) |
Moves index to next command.
[in] | vc_cmd_list | The command list handle |
0
on success, otherwise a negative error value VC_ERROR_NONE | Successful |
VC_ERROR_INVALID_PARAMETER | Invalid parameter |
VC_ERROR_EMPTY | List empty |
VC_ERROR_ITERATION_END | List reached end |
VC_ERROR_PERMISSION_DENIED | Permission denied |
VC_ERROR_NOT_SUPPORTED | Not supported |
int vc_cmd_list_prev | ( | vc_cmd_list_h | vc_cmd_list | ) |
Moves index to previous command.
[in] | vc_cmd_list | The command list handle |
0
on success, otherwise a negative error value VC_ERROR_NONE | Successful |
VC_ERROR_INVALID_PARAMETER | Invalid parameter |
VC_ERROR_EMPTY | List empty |
VC_ERROR_ITERATION_END | List reached end |
VC_ERROR_PERMISSION_DENIED | Permission denied |
VC_ERROR_NOT_SUPPORTED | Not supported |
int vc_cmd_list_remove | ( | vc_cmd_list_h | vc_cmd_list, |
vc_cmd_h | vc_command | ||
) |
Removes command from command list.
[in] | vc_cmd_list | The command list handle |
[in] | vc_command | The command handle |
0
on success, otherwise a negative error value VC_ERROR_NONE | Successful |
VC_ERROR_INVALID_PARAMETER | Invalid parameter |
VC_ERROR_PERMISSION_DENIED | Permission denied |
VC_ERROR_NOT_SUPPORTED | Not supported |
int vc_cmd_set_command | ( | vc_cmd_h | vc_command, |
const char * | command | ||
) |
Sets command or action.
[in] | vc_command | The command handle |
[in] | command | The command or action text |
0
on success, otherwise a negative error value VC_ERROR_NONE | Successful |
VC_ERROR_INVALID_PARAMETER | Invalid parameter |
VC_ERROR_PERMISSION_DENIED | Permission denied |
VC_ERROR_NOT_SUPPORTED | Not supported |
int vc_cmd_set_format | ( | vc_cmd_h | vc_command, |
int | format | ||
) |
Sets the command format.
[in] | vc_command | The command handle |
[in] | format | The command format |
0
on success, otherwise a negative error value VC_ERROR_NONE | Successful |
VC_ERROR_INVALID_PARAMETER | Invalid parameter |
VC_ERROR_PERMISSION_DENIED | Permission denied |
VC_ERROR_NOT_SUPPORTED | Not supported feature |
int vc_cmd_set_type | ( | vc_cmd_h | vc_command, |
int | type | ||
) |
Sets command type.
-1
. You should set type if command is valid [in] | vc_command | The command handle |
[in] | type | The command type |
0
on success, otherwise a negative error value VC_ERROR_NONE | Successful |
VC_ERROR_INVALID_PARAMETER | Invalid parameter |
VC_ERROR_PERMISSION_DENIED | Permission denied |
VC_ERROR_NOT_SUPPORTED | Not supported |