Refactored image loaders, added public API
[platform/core/uifw/dali-adaptor.git] / adaptors / public-api / tts-player.h
1 #ifndef __DALI_TTS_PLAYER_H__
2 #define __DALI_TTS_PLAYER_H__
3
4 /*
5  * Copyright (c) 2014 Samsung Electronics Co., Ltd.
6  *
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  *
11  * http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  *
19  */
20
21 /**
22  * @addtogroup CAPI_DALI_ADAPTOR_MODULE
23  * @{
24  */
25
26 // EXTERNAL INCLUDES
27 #include <dali/public-api/object/base-handle.h>
28
29 namespace Dali DALI_IMPORT_API
30 {
31
32 namespace Internal DALI_INTERNAL
33 {
34 namespace Adaptor
35 {
36 class TtsPlayer;
37 }
38 }
39
40 /**
41  * @brief The Text-to-speech Player.
42  */
43 class TtsPlayer : public BaseHandle
44 {
45 public: // ENUMs
46
47   /**
48    * @brief Enumeration of TTS mode.
49    */
50   enum Mode
51   {
52     DEFAULT = 0,  ///< Default mode for normal application
53     NOTIFICATION, ///< Notification mode
54     SCREEN_READER, ///< Screen reader mode
55     MODE_NUM
56   };
57
58 public: // API
59
60   /**
61    * @brief Create an uninitialized handle.
62    *
63    * This can be initialized by calling TtsPlayer::Get().
64    */
65   TtsPlayer();
66
67   /**
68    * @brief Gets the singleton of the TtsPlayer for each mode.
69    *
70    * Internally, each tts player handles (singleton instance) are managed for each mode.
71    * @param mode the mode of tts-player
72    * @return A handle of the Ttsplayer for given mode.
73    */
74   static TtsPlayer Get(Dali::TtsPlayer::Mode mode = Dali::TtsPlayer::DEFAULT);
75
76   /**
77    * @brief Destructor
78    *
79    * This is non-virtual since derived Handle types must not contain data or virtual methods.
80    */
81   ~TtsPlayer();
82
83   /**
84    * @brief Start playing the audio data synthesized from the specified text.
85    *
86    * @pre The TtsPlayer needs to be initialized.
87    * @param[in] text to play.
88    */
89   void Play(const std::string& text);
90
91   /**
92    * @brief Stops playing the utterance.
93    * @pre The TtsPlayer needs to be initialized.
94    */
95   void Stop();
96
97   /**
98    * @brief Pauses the currently playing utterance.
99    * @pre The TtsPlayer needs to be initialized.
100    */
101   void Pause();
102
103   /**
104    * @brief Resumes the previously paused utterance.
105    * @pre The TtsPlayer needs to be initialized.
106    */
107   void Resume();
108
109 public: // Not intended for application developers
110
111   /**
112    * @brief This constructor is used by TtsPlayer::Get().
113    * @param[in] ttsPlayer A pointer to the TTS player.
114    */
115   TtsPlayer( Internal::Adaptor::TtsPlayer* ttsPlayer );
116 };
117
118 } // namespace Dali
119
120 /**
121  * @}
122  */
123 #endif // __DALI_TTS_PLAYER_H__