Revert "[Tizen] Fix build errors in adaptor-uv by ecore wayland"
[platform/core/uifw/dali-adaptor.git] / adaptors / ubuntu / tts-player-impl.h
1 #ifndef __DALI_INTERNAL_TTS_PLAYER_H__
2 #define __DALI_INTERNAL_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 // EXTERNAL INCLUDES
22
23 #include <string>
24
25 #include <dali/integration-api/debug.h>
26 #include <dali/public-api/object/base-object.h>
27 #include <tts-player.h>
28
29 // INTERNAL INCLUDES
30
31 namespace Dali
32 {
33
34 namespace Internal
35 {
36
37 namespace Adaptor
38 {
39
40 /**
41  * Text-to-speech player
42  */
43 class TtsPlayer : public Dali::BaseObject
44 {
45
46 public:
47
48   /**
49    * Create a TtsPlayer with the given mode.
50    * This should only be called once by the Adaptor class for each given mode.
51    * @param mode the mode of tts-player
52    * @return A newly created TtsPlayer.
53    */
54   static Dali::TtsPlayer New(Dali::TtsPlayer::Mode mode);
55
56   /**
57    * @copydoc TtsPlayer::Play()
58    */
59   void Play(const std::string& text);
60
61   /**
62    * @copydoc TtsPlayer::Stop()
63    */
64   void Stop();
65
66   /**
67    * @copydoc TtsPlayer::Pause()
68    */
69   void Pause();
70
71   /**
72    * @copydoc TtsPlayer::Resume()
73    */
74   void Resume();
75
76   /**
77    * @copydoc TtsPlayer::GetState()
78    */
79   Dali::TtsPlayer::State GetState();
80
81   /**
82    * @copydoc TtsPlayer::StateChangedSignal()
83    */
84   Dali::TtsPlayer::StateChangedSignalType& StateChangedSignal();
85
86 private:
87
88   /**
89    * Private Constructor; see also TtsPlayer::New()
90    * @param mode the mode of tts-player
91    */
92   TtsPlayer(Dali::TtsPlayer::Mode mode);
93
94   /**
95    * Destructor
96    */
97   virtual ~TtsPlayer();
98
99 private:
100
101   Dali::TtsPlayer::StateChangedSignalType mStateChangedSignal; ///< Signal emitted when the TTS state changes (non-functional, for interface compatibility).
102
103 #if defined(DEBUG_ENABLED)
104 public:
105   static Debug::Filter* gLogFilter;
106 #endif
107 };
108
109 } // namespace Adaptor
110
111 } // namespace Internal
112
113 // Helpers for public-api forwarding methods
114
115 inline Internal::Adaptor::TtsPlayer& GetImplementation(Dali::TtsPlayer& player)
116 {
117   DALI_ASSERT_ALWAYS( player && "TtsPlayer handle is empty" );
118
119   BaseObject& handle = player.GetBaseObject();
120
121   return static_cast<Internal::Adaptor::TtsPlayer&>(handle);
122 }
123
124 inline const Internal::Adaptor::TtsPlayer& GetImplementation(const Dali::TtsPlayer& player)
125 {
126   DALI_ASSERT_ALWAYS( player && "TtsPlayer handle is empty" );
127
128   const BaseObject& handle = player.GetBaseObject();
129
130   return static_cast<const Internal::Adaptor::TtsPlayer&>(handle);
131 }
132
133 } // namespace Dali
134
135 #endif // __DALI_INTERNAL_TTS_PLAYER_H__