X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=adaptors%2Fpublic-api%2Fadaptor-framework%2Ftts-player.h;h=7914cfd73e6e999746e416e539ec3041eface8f3;hb=a7573b0f44b096f3118714fd88089b900cae917e;hp=e344e54cfe00c4d531f9a0fe27d4bc8a47338689;hpb=0e0bc62048fa94457ed47dc6bca7985ad3104ae3;p=platform%2Fcore%2Fuifw%2Fdali-adaptor.git diff --git a/adaptors/public-api/adaptor-framework/tts-player.h b/adaptors/public-api/adaptor-framework/tts-player.h index e344e54..7914cfd 100644 --- a/adaptors/public-api/adaptor-framework/tts-player.h +++ b/adaptors/public-api/adaptor-framework/tts-player.h @@ -20,9 +20,14 @@ // EXTERNAL INCLUDES #include +#include namespace Dali { +/** + * @addtogroup dali_adaptor_framework + * @{ + */ namespace Internal DALI_INTERNAL { @@ -33,51 +38,76 @@ class TtsPlayer; } /** - * @brief The Text-to-speech Player. + * @brief The Text-to-speech (TTS) Player. + * @SINCE_1_0.0 */ class DALI_IMPORT_API TtsPlayer : public BaseHandle { public: // ENUMs /** - * @brief Enumeration of TTS mode. + * @brief Enumeration for the instance of TTS mode. + * @SINCE_1_0.0 */ enum Mode { - DEFAULT = 0, ///< Default mode for normal application - NOTIFICATION, ///< Notification mode - SCREEN_READER, ///< Screen reader mode + DEFAULT = 0, ///< Default mode for normal application @SINCE_1_0.0 + NOTIFICATION, ///< Notification mode, such as playing utterance is started or completed @SINCE_1_0.0 + SCREEN_READER, ///< Screen reader mode. To help visually impaired users interact with their devices, screen reader reads text or graphic elements on the screen using the TTS engine. @SINCE_1_0.0 MODE_NUM }; + /** + * @brief Enumeration for the instance of TTS state. + * @SINCE_1_0.0 + */ + enum State + { + UNAVAILABLE = 0, ///< Player is not available @SINCE_1_0.0 + READY, ///< Player is ready to play @SINCE_1_0.0 + PLAYING, ///< Player is playing @SINCE_1_0.0 + PAUSED ///< Player is paused @SINCE_1_0.0 + }; + +public: // Typedefs + + /** + * @brief Type of signal emitted when the TTS state changes. + * @SINCE_1_0.0 + */ + typedef Signal< void ( const Dali::TtsPlayer::State, const Dali::TtsPlayer::State ) > StateChangedSignalType; + public: // API /** - * @brief Create an uninitialized handle. + * @brief Creates an uninitialized handle. * * This can be initialized by calling TtsPlayer::Get(). + * @SINCE_1_0.0 */ TtsPlayer(); /** - * @brief Gets the singleton of the TtsPlayer for each mode. + * @brief Gets the singleton of the TtsPlayer for the given mode. * - * Internally, each tts player handles (singleton instance) are managed for each mode. - * @param mode the mode of tts-player - * @return A handle of the Ttsplayer for given mode. + * @SINCE_1_0.0 + * @param mode The mode of tts-player + * @return A handle of the Ttsplayer for the given mode */ static TtsPlayer Get(Dali::TtsPlayer::Mode mode = Dali::TtsPlayer::DEFAULT); /** - * @brief Destructor + * @brief Destructor. * * This is non-virtual since derived Handle types must not contain data or virtual methods. + * @SINCE_1_0.0 */ ~TtsPlayer(); /** * @brief This copy constructor is required for (smart) pointer semantics. * + * @SINCE_1_0.0 * @param [in] handle A reference to the copied handle */ TtsPlayer(const TtsPlayer& handle); @@ -85,46 +115,72 @@ public: // API /** * @brief This assignment operator is required for (smart) pointer semantics. * - * @param [in] rhs A reference to the copied handle + * @SINCE_1_0.0 + * @param [in] rhs A reference to the copied handle * @return A reference to this */ TtsPlayer& operator=(const TtsPlayer& rhs); /** - * @brief Start playing the audio data synthesized from the specified text. + * @brief Starts playing the audio data synthesized from the specified text. * + * @SINCE_1_0.0 + * @param[in] text The text to play * @pre The TtsPlayer needs to be initialized. - * @param[in] text to play. */ void Play(const std::string& text); /** * @brief Stops playing the utterance. + * @SINCE_1_0.0 * @pre The TtsPlayer needs to be initialized. */ void Stop(); /** * @brief Pauses the currently playing utterance. + * @SINCE_1_0.0 * @pre The TtsPlayer needs to be initialized. */ void Pause(); /** * @brief Resumes the previously paused utterance. + * @SINCE_1_0.0 * @pre The TtsPlayer needs to be initialized. */ void Resume(); + /** + * @brief Gets the current state of the player. + * @SINCE_1_0.0 + * @return The current TTS state + * @pre The TtsPlayer needs to be initialized. + */ + State GetState(); + + /** + * @brief Allows connection TTS state change signal. + * @SINCE_1_0.0 + * @return A reference to the signal for connection + * @note Only supported by some adaptor types. + */ + Dali::TtsPlayer::StateChangedSignalType& StateChangedSignal(); + public: // Not intended for application developers /** + * @internal * @brief This constructor is used by TtsPlayer::Get(). - * @param[in] ttsPlayer A pointer to the TTS player. + * @SINCE_1_0.0 + * @param[in] ttsPlayer A pointer to the TTS player */ explicit DALI_INTERNAL TtsPlayer( Internal::Adaptor::TtsPlayer* ttsPlayer ); }; +/** + * @} + */ } // namespace Dali #endif // __DALI_TTS_PLAYER_H__