Add codes in client side to set/unset callback for retrieving sythesized pcm data
[platform/core/uifw/tts.git] / include / ttse.h
index 0c73115..32c52a2 100755 (executable)
@@ -71,6 +71,17 @@ typedef enum {
        TTSE_RESULT_EVENT_FINISH = 3 /**< Event when the sound data is last data or sound data is only one result */
 } ttse_result_event_e;
 
+/**
+* @brief Enumeration for TTS mode mask.
+* @since_tizen 7.0
+*/
+typedef enum {
+       TTSE_MODE_MASK_DEFAULT = 0x01, /**< Default mode */
+       TTSE_MODE_MASK_NOTIFICATION = 0x02, /**< Notification mode */
+       TTSE_MODE_MASK_SCREEN_READER = 0x04, /**< Screen reader mode */
+       TTSE_MODE_MASK_INTERRUPT = 0x08 /**< Interrupt mode */
+} ttse_mode_mask_e;
+
 
 /**
 * @brief Definition for male voice type.
@@ -374,6 +385,23 @@ typedef int (*ttse_private_data_requested_cb)(const char* key, char** data);
 
 
 /**
+* @brief Called when activated modes are changed.
+* @details When a client connects to TTS engine, the engine activates the TTS mode of the client.
+*          For example, if two clients, one is default mode and other is screen reader mode, connect to TTS engine, then the
+*          @a activated_mode has the same bit sequence as '#TTSE_MODE_MASK_DEFAULT | #TTSE_MODE_MASK_SCREEN_READER'.
+*          The activated TTS modes are decided according to the connected clients, so when a client connects or disconnects to
+*          the engine, the activated TTS modes may be changed.
+*          This callback function is called when the activated TTS modes are changed.
+* @since_tizen 7.0
+* @remarks This callback function is optional and is registered using ttse_set_activated_mode_changed_cb().
+* @param[in] activated_mode The activated TTS modes by connected clients, values of ttse_mode_mask_e combined with bitwise 'or'.
+* @see ttse_set_activated_mode_changed_cb()
+* @see ttse_get_activated_mode()
+*/
+typedef void (*ttse_activated_mode_changed_cb)(int activated_mode);
+
+
+/**
 * @brief A structure for the TTS engine functions.
 * @details This structure contains essential callback functions for operating TTS engine.
 * @since_tizen 3.0
@@ -621,6 +649,44 @@ int ttse_set_private_data_set_cb(ttse_private_data_set_cb callback_func);
 int ttse_set_private_data_requested_cb(ttse_private_data_requested_cb callback_func);
 
 
+/**
+* @brief Gets activated modes.
+* @details When a client connects to TTS engine, the engine activates the TTS mode of the client.
+*          For example, if two clients, one is default mode and other is screen reader mode, connect to TTS engine, then the
+*          @a activated_mode has the same bit sequence as '#TTSE_MODE_MASK_DEFAULT | #TTSE_MODE_MASK_SCREEN_READER'.
+*          Using this API, the engine can get the activated TTS modes information.
+* @since_tizen 7.0
+* @param[out] activated_mode The activated TTS mode by connected clients, values of ttse_mode_mask_e combined with bitwise 'or'.
+* @return @c 0 on success,
+*         otherwise a negative error value
+* @retval #TTSE_ERROR_NONE Successful
+* @retval #TTSE_ERROR_NOT_SUPPORTED TTS NOT supported
+* @retval #TTSE_ERROR_INVALID_PARAMETER Invalid parameter
+* @retval #TTSE_ERROR_INVALID_STATE Not initialized
+* @pre The ttse_main() function should be invoked before this function is called.
+* @see ttse_set_activated_mode_changed_cb()
+*/
+int ttse_get_activated_mode(int* activated_mode);
+
+
+/**
+* @brief Sets a callback function to be called when the activated TTS modes are changed.
+* @since_tizen 7.0
+* @remarks The ttse_activated_mode_changed_cb() function is called when the activated TTS modes are changed.
+* @param[in] callback ttse_activated_mode_changed event callback function
+* @return @c 0 on success,
+*         otherwise a negative error value
+* @retval #TTSE_ERROR_NONE Successful
+* @retval #TTSE_ERROR_NOT_SUPPORTED TTS NOT supported
+* @retval #TTSE_ERROR_INVALID_PARAMETER Invalid parameter
+* @retval #TTSE_ERROR_INVALID_STATE Not initialized
+* @pre The ttse_main() function should be invoked before this function is called.
+* @see ttse_activated_mode_changed_cb()
+* @see ttse_get_activated_mode()
+*/
+int ttse_set_activated_mode_changed_cb(ttse_activated_mode_changed_cb callback);
+
+
 #ifdef __cplusplus
 }
 #endif