#include <voice_control_command.h>
#include <voice_control_command_expand.h>
#include <voice_control_common.h>
+#include <voice_control_internal.h>
+typedef struct vc_s *vc_h;
/**
* @addtogroup VOICE_CONTROL_WIDGET
/**
* @brief Definitions for widget command type.
-* @since_tizen 2.4
+* @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
*/
#define VC_COMMAND_TYPE_WIDGET 3
* @pre An application registers callback function using vc_widget_set_send_current_command_group_cb().
*
* @see vc_widget_set_send_current_command_list_cb()
-* @see vc_widget_unsset_send_current_command_list_cb()
+* @see vc_widget_unset_send_current_command_list_cb()
*/
typedef void (*vc_widget_send_current_command_list_cb)(vc_cmd_list_h* vc_cmd_list, void* user_data);
*
* @see vc_widget_deinitialize()
*/
-int vc_widget_initialize();
+int vc_widget_initialize(vc_h* vc);
/**
* @brief Deinitialize voice control for widget.
*
* @see vc_widget_initialize()
*/
-int vc_widget_deinitialize();
+int vc_widget_deinitialize(vc_h vc);
/**
* @brief Connects the voice control service asynchronously.
*
* @see vc_widget_unprepare()
*/
-int vc_widget_prepare();
+int vc_widget_prepare(vc_h vc);
/**
* @brief Disconnects the voice control service.
*
* @see vc_widget_prepare()
*/
-int vc_widget_unprepare();
+int vc_widget_unprepare(vc_h vc);
/**
* @brief Retrieves all supported languages using callback function.
* @see vc_supported_language_cb()
* @see vc_widget_get_current_language()
*/
-int vc_widget_foreach_supported_languages(vc_supported_language_cb callback, void* user_data);
+int vc_widget_foreach_supported_languages(vc_h vc, vc_supported_language_cb callback, void* user_data);
/**
* @brief Gets current language set by user.
*
* @see vc_widget_foreach_supported_languages()
*/
-int vc_widget_get_current_language(char** language);
+int vc_widget_get_current_language(vc_h vc, char** language);
/**
* @brief Gets current state of voice control widget.
* @see vc_widget_set_state_changed_cb()
* @see vc_widget_unset_state_changed_cb()
*/
-int vc_widget_get_state(vc_state_e* state);
+int vc_widget_get_state(vc_h vc, vc_state_e* state);
/**
* @brief Gets current state of voice control service.
* @see vc_set_service_state_changed_cb()
* @see vc_unset_service_state_changed_cb()
*/
-int vc_widget_get_service_state(vc_service_state_e* state);
+int vc_widget_get_service_state(vc_h vc, vc_service_state_e* state);
/**
* @brief Checks whether the command format is supported.
*
* @pre The state should be #VC_STATE_READY.
*/
-int vc_widget_is_command_format_supported(vc_cmd_format_e format, bool* support);
+int vc_widget_is_command_format_supported(vc_h vc, vc_cmd_format_e format, bool* support);
/**
*
* @pre The state should be #VC_STATE_READY.
*/
-int vc_widget_set_foreground(bool value);
+int vc_widget_set_foreground(vc_h vc, bool value);
/**
* @brief Cancels recognition.
* @see vc_widget_stop()
* @see vc_state_changed_cb()
*/
-int vc_widget_cancel();
+int vc_widget_cancel(vc_h vc);
/**
* @brief Registers a callback function for getting recognition result.
* @see vc_widget_result_cb()
* @see vc_widget_unset_result_cb()
*/
-int vc_widget_set_result_cb(vc_result_cb callback, void* user_data);
+int vc_widget_set_result_cb(vc_h vc, vc_result_cb callback, void* user_data);
/**
*
* @see vc_widget_set_result_cb()
*/
-int vc_widget_unset_result_cb();
+int vc_widget_unset_result_cb(vc_h vc);
/**
* @brief Registers a callback function for showing or hiding tooltip.
* @see vc_widget_show_tooltip_cb()
* @see vc_widget_unset_show_tooltip_cb()
*/
-int vc_widget_set_show_tooltip_cb(vc_widget_show_tooltip_cb callback, void* user_data);
+int vc_widget_set_show_tooltip_cb(vc_h vc, vc_widget_show_tooltip_cb callback, void* user_data);
/**
* @brief Unregisters the callback function.
*
* @see vc_widget_set_show_tooltip_cb()
*/
-int vc_widget_unset_show_tooltip_cb();
+int vc_widget_unset_show_tooltip_cb(vc_h vc);
/**
* @brief Registers a callback function for setting current command.
* @see vc_widget_send_current_command_list_cb()
* @see vc_widget_unset_send_current_command_list_cb()
*/
-int vc_widget_set_send_current_command_list_cb(vc_widget_send_current_command_list_cb callback, void* user_data);
+int vc_widget_set_send_current_command_list_cb(vc_h vc, vc_widget_send_current_command_list_cb callback, void* user_data);
/**
* @brief Unregisters the callback function.
*
* @see vc_widget_set_send_current_command_list_cb()
*/
-int vc_widget_unsset_send_current_command_list_cb();
+int vc_widget_unset_send_current_command_list_cb(vc_h vc);
/**
* @brief Registers a callback function to be called when service state is changed.
* @see vc_service_state_changed_cb()
* @see vc_widget_unset_service_state_changed_cb()
*/
-int vc_widget_set_service_state_changed_cb(vc_service_state_changed_cb callback, void* user_data);
+int vc_widget_set_service_state_changed_cb(vc_h vc, vc_service_state_changed_cb callback, void* user_data);
/**
* @brief Unregisters the callback function.
*
* @see vc_widget_set_service_state_changed_cb()
*/
-int vc_widget_unset_service_state_changed_cb();
+int vc_widget_unset_service_state_changed_cb(vc_h vc);
/**
* @brief Registers a callback function for getting state changed.
* @see vc_state_changed_cb()
* @see vc_widget_unset_state_changed_cb()
*/
-int vc_widget_set_state_changed_cb(vc_state_changed_cb callback, void* user_data);
+int vc_widget_set_state_changed_cb(vc_h vc, vc_state_changed_cb callback, void* user_data);
/**
* @brief Unregisters the callback function.
*
* @see vc_widget_set_state_changed_cb()
*/
-int vc_widget_unset_state_changed_cb();
+int vc_widget_unset_state_changed_cb(vc_h vc);
/**
* @brief Registers a callback function to be called when current language is changed.
* @see vc_current_language_changed_cb()
* @see vc_widget_unset_current_language_changed_cb()
*/
-int vc_widget_set_current_language_changed_cb(vc_current_language_changed_cb callback, void* user_data);
+int vc_widget_set_current_language_changed_cb(vc_h vc, vc_current_language_changed_cb callback, void* user_data);
/**
* @brief Unregisters the callback function.
*
* @see vc_widget_set_current_language_changed_cb()
*/
-int vc_widget_unset_current_language_changed_cb();
+int vc_widget_unset_current_language_changed_cb(vc_h vc);
/**
* @brief Registers a callback function for an error occurred.
* @see vc_error_cb()
* @see vc_widget_unset_error_cb()
*/
-int vc_widget_set_error_cb(vc_error_cb callback, void* user_data);
+int vc_widget_set_error_cb(vc_h vc, vc_error_cb callback, void* user_data);
/**
* @brief Unregisters the callback function.
*
* @see vc_widget_set_error_cb()
*/
-int vc_widget_unset_error_cb();
+int vc_widget_unset_error_cb(vc_h vc);
+
+/**
+ * @brief Sets option for obtain ASR result as dictation via result callback.
+ * @since_tizen 3.0
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/recorder
+ *
+ * @param[in] enable enable to get asr result
+ *
+ * @return 0 on success, otherwise a negative error value
+ * @retval #VC_ERROR_NONE Successful
+ * @retval #VC_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #VC_ERROR_INVALID_STATE Invalid state
+ * @retval #VC_ERROR_PERMISSION_DENIED Permission denied
+ * @retval #VC_ERROR_NOT_SUPPORTED Not supported
+ *
+ * @pre The state should be #VC_STATE_READY.
+ *
+ */
+int vc_widget_enable_asr_result(vc_h vc, bool enable);
+
+/**
+* @brief Registers a callback function for an asr result.
+*
+* @param[in] callback Callback function to register
+* @param[in] user_data The user data to be passed to the callback function
+*
+* @return 0 on success, otherwise a negative error value
+* @retval #VC_ERROR_NONE Successful
+* @retval #VC_ERROR_INVALID_PARAMETER Invalid parameter
+* @retval #VC_ERROR_INVALID_STATE Invalid state
+*
+* @pre The state should be #VC_STATE_INITIALIZED.
+*
+* @see vc_asr_result_cb()
+* @see vc_widget_enable_asr_result()
+* @see vc_widget_unset_asr_result_cb()
+*/
+int vc_widget_set_asr_result_cb(vc_h vc, vc_asr_result_cb callback, void* user_data);
+/**
+* @brief Unregisters the callback function.
+*
+* @return 0 on success, otherwise a negative error value
+* @retval #VC_ERROR_NONE Successful
+* @retval #VC_ERROR_INVALID_STATE Invalid state
+*
+* @pre The state should be #VC_STATE_INITIALIZED.
+*
+* @see vc_widget_set_asr_result_cb()
+*/
+int vc_widget_unset_asr_result_cb(vc_h vc);
#ifdef __cplusplus
}
#endif
/**
- * @}@}
+ * @}
*/
#endif /* __VOICE_CONTROL_WIDGET_H__ */