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.
* For example, "ko_KR" for Korean, "en_US" for American English
* @param[in] type The voice type
* @param[in] user_data The user data passed from ttse_foreach_supported_voices_cb()
-* @return @c true to continue with the next iteration of the loop
+* @return @c true to continue with the next iteration of the loop
* @c false to break out of the loop
* @pre ttse_foreach_supported_voices_cb() will invoke this callback function.
* @see ttse_foreach_supported_voices_cb()
* @brief Called when the engine service user initializes TTS engine.
* @since_tizen 3.0
* @remarks This callback function is mandatory and must be registered using ttse_main().
-* @return @c 0 on success,
+* @return @c 0 on success,
* otherwise a negative error value
* @retval #TTSE_ERROR_NONE Successful
* @retval #TTSE_ERROR_INVALID_PARAMETER Invalid parameter
* @remarks This callback function is mandatory and must be registered using ttse_main().
* NOTE that the engine may be terminated automatically.
* When this callback function is invoked, the release of resources is necessary.
-* @return @c 0 on success,
+* @return @c 0 on success,
* otherwise a negative error value
* @retval #TTSE_ERROR_NONE Successful
* @retval #TTSE_ERROR_INVALID_STATE Not initialized
* If 'ttse_supported_voice_cb()' returns @c false, it should be stopped to call 'ttse_supported_voice_cb()'.
* @param[in] callback The callback function
* @param[in] user_data The user data which must be passed to ttse_supported_voice_cb()
-* @return @c 0 on success,
+* @return @c 0 on success,
* otherwise a negative error value
* @retval #TTSE_ERROR_NONE Successful
* @retval #TTSE_ERROR_INVALID_PARAMETER Invalid parameter
* followed by ISO 639-1 for the two-letter language code.
* For example, "ko_KR" for Korean, "en_US" for American English
* @param[in] type The voice type
-* @param[out] is_valid A variable for checking whether the corresponding voice is valid or not.
+* @param[out] is_valid A variable for checking whether the corresponding voice is valid or not.
* @c true to be valid,
* @c false to be invalid
-* @return @c 0 on success,
+* @return @c 0 on success,
* otherwise a negative error value
* @retval #TTSE_ERROR_NONE Successful
* @retval #TTSE_ERROR_INVALID_PARAMETER Invalid parameter
* @since_tizen 3.0
* @remarks This callback function is mandatory and must be registered using ttse_main().
* @param[in] pitch The default pitch
-* @return @c 0 on success,
+* @return @c 0 on success,
* otherwise a negative error value
* @retval #TTSE_ERROR_NONE Successful
* @retval #TTSE_ERROR_INVALID_PARAMETER Invalid parameter
* followed by ISO 639-1 for the two-letter language code.
* For example, "ko_KR" for Korean, "en_US" for American English
* @param[in] type The voice type
-* @return @c 0 on success,
+* @return @c 0 on success,
* otherwise a negative error value
* @retval #TTSE_ERROR_NONE Successful
* @retval #TTSE_ERROR_INVALID_PARAMETER Invalid parameter
* followed by ISO 639-1 for the two-letter language code.
* For example, "ko_KR" for Korean, "en_US" for American English
* @param[in] type The voice type
-* @return @c 0 on success,
+* @return @c 0 on success,
* otherwise a negative error value
* @retval #TTSE_ERROR_NONE Successful
* @retval #TTSE_ERROR_INVALID_PARAMETER Invalid parameter
* @param[out] is_agreed A variable for checking whether the application agreed to use TTS engine or not.
* @c true to agree,
* @c false to disagree
-* @return @c 0 on success,
+* @return @c 0 on success,
* otherwise a negative error value
* @retval #TTSE_ERROR_NONE Successful
* @retval #TTSE_ERROR_INVALID_STATE Not initialized
* @param[in] appid The Application ID
* @param[in] credential The credential granted to the application
* @param[in] user_data The user data which must be passed to ttse_send_result()
-* @return @c 0 on success,
+* @return @c 0 on success,
* otherwise a negative error value
* @retval #TTSE_ERROR_NONE Successful
* @retval #TTSE_ERROR_INVALID_PARAMETER Invalid parameter
* @brief Called when the engine service user cancels to synthesize a voice.
* @since_tizen 3.0
* @remarks This callback function is mandatory and must be registered using ttse_main().
-* @return @c 0 on success,
+* @return @c 0 on success,
* otherwise a negative error value
* @retval #TTSE_ERROR_NONE Successful
* @retval #TTSE_ERROR_INVALID_STATE Not initialized or not started synthesis
* @param[out] engine_name Name of engine
* @param[out] engine_setting The engine setting application(ui app)'s app ID
* @param[out] use_network The status for using network
-* @return @c 0 on success,
+* @return @c 0 on success,
* otherwise a negative error code on failure
* @retval #TTSE_ERROR_NONE Successful
* @retval #TTSE_ERROR_INVALID_PARAMETER Invalid parameter
* @remarks This callback function is optional and is registered using ttse_set_private_data_set_cb().
* @param[in] key The key field of private data
* @param[in] data The data field of private data
-* @return @c 0 on success,
+* @return @c 0 on success,
* otherwise a negative error value
* @retval #TTSE_ERROR_NONE Successful
* @retval #TTSE_ERROR_INVALID_PARAMETER Invalid parameter
* @remarks This callback function is optional and is registered using ttse_set_private_data_requested_cb().
* @param[out] key The key field of private data
* @param[out] data The data field of private data
-* @return @c 0 on success,
+* @return @c 0 on success,
* otherwise a negative error value
* @retval #TTSE_ERROR_NONE Successful
* @retval #TTSE_ERROR_INVALID_PARAMETER Invalid parameter
/**
+* @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
* @param[in] argc The argument count(original)
* @param[in] argv The argument(original)
* @param[in] callback The structure of engine request callback function
-* @return This function returns zero on success,
+* @return This function returns zero on success,
* or negative with error code on failure
* @retval #TTSE_ERROR_NONE Successful
* @retval #TTSE_ERROR_INVALID_PARAMETER Invalid parameter
/**
+* @brief Terminates the main function of TTS engine.
+* @since_tizen 7.0
+* @remarks This function invokes ttse_deinitialize_cb() in #ttse_request_callback_s which is registered by ttse_main().
+* And this function should be called before terminating the engine to ensure safe termination.
+* @return @c 0 on success,
+* otherwise a negative error value
+* @retval #TTSE_ERROR_NONE Successful
+* @retval #TTSE_ERROR_OPERATION_FAILED Operation failure
+*/
+int ttse_terminate(void);
+
+
+/**
* @brief Gets the speed range from Tizen platform.
* @since_tizen 3.0
* @remarks This API is used when TTS engine wants to get the speed range from Tizen platform.
* @param[out] min The minimum speed value
* @param[out] normal The normal speed value
* @param[out] max The maximum speed value
-* @return @c 0 on success,
+* @return @c 0 on success,
* otherwise a negative error value
* @retval #TTSE_ERROR_NONE Successful
* @retval #TTSE_ERROR_INVALID_PARAMETER Invalid parameter
* @param[out] min The minimum pitch value
* @param[out] normal The normal pitch value
* @param[out] max The maximum pitch value
-* @return @c 0 on success,
+* @return @c 0 on success,
* otherwise a negative error value
* @retval #TTSE_ERROR_NONE Successful
* @retval #TTSE_ERROR_INVALID_PARAMETER Invalid parameter
* @param[in] audio_type The audio type
* @param[in] rate The sample rate
* @param[in] user_data The user data passed from ttse_start_synthesis_cb()
-* @return @c 0 on success,
+* @return @c 0 on success,
* otherwise a negative error value
* @retval #TTSE_ERROR_NONE Successful
* @retval #TTSE_ERROR_INVALID_PARAMETER Invalid parameter
* @since_tizen 3.0
* @param[in] error The error reason
* @param[in] msg The error message
-* @return @c 0 on success,
+* @return @c 0 on success,
* otherwise a negative error value
* @retval #TTSE_ERROR_NONE Successful
* @retval #TTSE_ERROR_INVALID_PARAMETER Invalid parameter
* @since_tizen 3.0
* @remarks The ttse_private_data_set_cb() function is called when the engine service user sends the private data.
* @param[in] callback_func ttse_private_data_set event callback function
-* @return @c 0 on success,
+* @return @c 0 on success,
* otherwise a negative error value
* @retval #TTSE_ERROR_NONE Successful
* @retval #TTSE_ERROR_INVALID_PARAMETER Invalid parameter
* @since_tizen 3.0
* @remarks The ttse_private_data_requested_cb() function is called when the engine service user gets the private data from TTS engine.
* @param[in] callback_func ttse_private_data_requested event callback function
-* @return @c 0 on success,
+* @return @c 0 on success,
* otherwise a negative error value
* @retval #TTSE_ERROR_NONE Successful
* @retval #TTSE_ERROR_INVALID_PARAMETER Invalid parameter
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