Add parameter to change system volume
[platform/core/uifw/voice-control.git] / include / voice_control_widget.h
index f9ecd2c..93c3e4c 100644 (file)
@@ -21,7 +21,9 @@
 #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
@@ -35,7 +37,7 @@ extern "C"
 
 /**
 * @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
 
@@ -63,7 +65,7 @@ typedef void (*vc_widget_show_tooltip_cb)(bool show, void* user_data);
 * @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);
 
@@ -87,7 +89,7 @@ typedef void (*vc_widget_send_current_command_list_cb)(vc_cmd_list_h* vc_cmd_lis
 *
 * @see vc_widget_deinitialize()
 */
-int vc_widget_initialize();
+int vc_widget_initialize(vc_h* vc);
 
 /**
 * @brief Deinitialize voice control for widget.
@@ -101,7 +103,7 @@ int vc_widget_initialize();
 *
 * @see vc_widget_initialize()
 */
-int vc_widget_deinitialize();
+int vc_widget_deinitialize(vc_h vc);
 
 /**
 * @brief Connects the voice control service asynchronously.
@@ -118,7 +120,7 @@ int vc_widget_deinitialize();
 *
 * @see vc_widget_unprepare()
 */
-int vc_widget_prepare();
+int vc_widget_prepare(vc_h vc);
 
 /**
 * @brief Disconnects the voice control service.
@@ -135,7 +137,7 @@ int vc_widget_prepare();
 *
 * @see vc_widget_prepare()
 */
-int vc_widget_unprepare();
+int vc_widget_unprepare(vc_h vc);
 
 /**
 * @brief Retrieves all supported languages using callback function.
@@ -156,7 +158,7 @@ int vc_widget_unprepare();
 * @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.
@@ -179,7 +181,7 @@ int vc_widget_foreach_supported_languages(vc_supported_language_cb callback, voi
 *
 * @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.
@@ -198,7 +200,7 @@ int vc_widget_get_current_language(char** language);
 * @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.
@@ -216,7 +218,7 @@ int vc_widget_get_state(vc_state_e* state);
 * @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.
@@ -233,7 +235,7 @@ int vc_widget_get_service_state(vc_service_state_e* state);
 *
 * @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);
 
 
 /**
@@ -250,7 +252,7 @@ int vc_widget_is_command_format_supported(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.
@@ -271,7 +273,7 @@ int vc_widget_set_foreground(bool value);
 * @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.
@@ -290,7 +292,7 @@ int vc_widget_cancel();
 * @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);
 
 
 /**
@@ -306,7 +308,7 @@ int vc_widget_set_result_cb(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.
@@ -325,7 +327,7 @@ int vc_widget_unset_result_cb();
 * @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.
@@ -340,7 +342,7 @@ int vc_widget_set_show_tooltip_cb(vc_widget_show_tooltip_cb callback, void* user
 *
 * @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.
@@ -359,7 +361,7 @@ int vc_widget_unset_show_tooltip_cb();
 * @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.
@@ -374,7 +376,7 @@ int vc_widget_set_send_current_command_list_cb(vc_widget_send_current_command_li
 *
 * @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.
@@ -393,7 +395,7 @@ int vc_widget_unsset_send_current_command_list_cb();
 * @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.
@@ -408,7 +410,7 @@ int vc_widget_set_service_state_changed_cb(vc_service_state_changed_cb callback,
 *
 * @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.
@@ -428,7 +430,7 @@ int vc_widget_unset_service_state_changed_cb();
 * @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.
@@ -443,7 +445,7 @@ int vc_widget_set_state_changed_cb(vc_state_changed_cb callback, void* user_data
 *
 * @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.
@@ -463,7 +465,7 @@ int vc_widget_unset_state_changed_cb();
 * @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.
@@ -478,7 +480,7 @@ int vc_widget_set_current_language_changed_cb(vc_current_language_changed_cb cal
 *
 * @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.
@@ -498,7 +500,7 @@ int vc_widget_unset_current_language_changed_cb();
 * @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.
@@ -513,15 +515,66 @@ int vc_widget_set_error_cb(vc_error_cb callback, void* user_data);
 *
 * @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__ */