Merge "Fix InputMethodContext to work well in multi-window env" into devel/master
[platform/core/uifw/dali-toolkit.git] / automated-tests / src / dali-toolkit / dali-toolkit-test-utils / toolkit-tts-player.cpp
1 /*
2  * Copyright (c) 2015 Samsung Electronics Co., Ltd.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  *
16  */
17
18 // EXTERNAL INCLUDES
19 #include <dali/dali.h>
20
21
22 namespace Dali
23 {
24
25 TtsPlayer::TtsPlayer()
26 {
27 }
28
29 namespace Internal
30 {
31 namespace Adaptor
32 {
33
34 class TtsPlayer : public BaseObject
35 {
36 public:
37   TtsPlayer()
38   {
39   }
40
41   void Play(const std::string& text)
42   {
43   }
44
45   void Stop()
46   {
47   }
48
49   void Pause()
50   {
51   }
52
53   void Resume()
54   {
55   }
56
57   Dali::TtsPlayer::State GetState()
58   {
59     return Dali::TtsPlayer::READY;
60   }
61
62   Dali::TtsPlayer::StateChangedSignalType& StateChangedSignal()
63   {
64     return mStateChangedSignal;
65   }
66 private:
67   Dali::TtsPlayer::StateChangedSignalType mStateChangedSignal;
68 };
69
70
71 inline TtsPlayer& GetImplementation(Dali::TtsPlayer& player)
72 {
73   DALI_ASSERT_ALWAYS( player && "TtsPlayer handle is empty" );
74   BaseObject& handle = player.GetBaseObject();
75   return static_cast<Internal::Adaptor::TtsPlayer&>(handle);
76 }
77
78 inline const TtsPlayer& GetImplementation(const Dali::TtsPlayer& player)
79 {
80   DALI_ASSERT_ALWAYS( player && "TtsPlayer handle is empty" );
81   const BaseObject& handle = player.GetBaseObject();
82   return static_cast<const Internal::Adaptor::TtsPlayer&>(handle);
83 }
84
85 } // Adaptor
86 } // Internal
87
88 static IntrusivePtr<Internal::Adaptor::TtsPlayer> ttsSingleton = NULL;
89
90 TtsPlayer TtsPlayer::Get(Dali::TtsPlayer::Mode mode)
91 {
92   if( ! ttsSingleton )
93   {
94     ttsSingleton.Reset( new Dali::Internal::Adaptor::TtsPlayer() );
95   }
96   TtsPlayer playerHandle(ttsSingleton.Get());
97
98   return playerHandle;
99 }
100
101 TtsPlayer::~TtsPlayer()
102 {
103 }
104
105 TtsPlayer::TtsPlayer(const TtsPlayer& handle)
106 : BaseHandle(handle)
107 {
108 }
109
110 TtsPlayer& TtsPlayer::operator=(const TtsPlayer& rhs)
111 {
112   BaseHandle::operator=(rhs);
113   return *this;
114 }
115
116 void TtsPlayer::Play(const std::string& text)
117 {
118   // GetImplementation(*this).Play(text);
119 }
120
121 void TtsPlayer::Stop()
122 {
123   // GetImplementation(*this).Stop();
124 }
125
126 void TtsPlayer::Pause()
127 {
128   // GetImplementation(*this).Pause();
129 }
130
131 void TtsPlayer::Resume()
132 {
133   // GetImplementation(*this).Resume();
134 }
135
136 TtsPlayer::State TtsPlayer::GetState()
137 {
138   return READY; // GetImplementation(*this).GetState();
139 }
140
141 TtsPlayer::StateChangedSignalType& TtsPlayer::StateChangedSignal()
142 {
143   return Internal::Adaptor::GetImplementation(*this).StateChangedSignal();
144 }
145
146 TtsPlayer::TtsPlayer( Internal::Adaptor::TtsPlayer* player )
147 : BaseHandle( player )
148 {
149 }
150
151 } // namespace Dali