Merge "Overlay RenderTaskList should be created by the Window instead of the Overlay...
[platform/core/uifw/dali-adaptor.git] / dali / internal / accessibility / common / tts-player-impl.h
1 #ifndef DALI_INTERNAL_ACCESSIBILITY_COMMON_TTS_PLAYER_IMPL_H
2 #define DALI_INTERNAL_ACCESSIBILITY_COMMON_TTS_PLAYER_IMPL_H
3
4 /*
5  * Copyright (c) 2017 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 #include <dali/integration-api/debug.h>
23 #include <dali/public-api/object/base-object.h>
24
25 // INTERNAL INCLUDES
26 #include <dali/public-api/adaptor-framework/tts-player.h>
27
28 namespace Dali
29 {
30
31 namespace Internal
32 {
33
34 namespace Adaptor
35 {
36
37 /**
38  * Text-to-speech player
39  */
40 class TtsPlayer : public Dali::BaseObject
41 {
42
43 public:
44
45   /**
46    * Create a TtsPlayer with the given mode.
47    * This should only be called once by the Adaptor class for each given mode.
48    * @param mode the mode of tts-player
49    * @return A newly created TtsPlayer.
50    */
51   static Dali::TtsPlayer New(Dali::TtsPlayer::Mode mode);
52
53   /**
54    * @copydoc TtsPlayer::Play()
55    */
56   virtual void Play(const std::string& text);
57
58   /**
59    * @copydoc TtsPlayer::Stop()
60    */
61   virtual void Stop();
62
63   /**
64    * @copydoc TtsPlayer::Pause()
65    */
66   virtual void Pause();
67
68   /**
69    * @copydoc TtsPlayer::Resume()
70    */
71   virtual void Resume();
72
73   /**
74    * @copydoc TtsPlayer::GetState()
75    */
76   virtual Dali::TtsPlayer::State GetState();
77
78   /**
79    * @copydoc TtsPlayer::StateChangedSignal()
80    */
81   virtual Dali::TtsPlayer::StateChangedSignalType& StateChangedSignal();
82 };
83
84 } // namespace Adaptor
85
86 } // namespace Internal
87
88 // Helpers for public-api forwarding methods
89
90 inline Internal::Adaptor::TtsPlayer& GetImplementation(Dali::TtsPlayer& player)
91 {
92   DALI_ASSERT_ALWAYS( player && "TtsPlayer handle is empty" );
93
94   BaseObject& handle = player.GetBaseObject();
95
96   return static_cast<Internal::Adaptor::TtsPlayer&>(handle);
97 }
98
99 inline const Internal::Adaptor::TtsPlayer& GetImplementation(const Dali::TtsPlayer& player)
100 {
101   DALI_ASSERT_ALWAYS( player && "TtsPlayer handle is empty" );
102
103   const BaseObject& handle = player.GetBaseObject();
104
105   return static_cast<const Internal::Adaptor::TtsPlayer&>(handle);
106 }
107
108 } // namespace Dali
109
110 #endif // DALI_INTERNAL_ACCESSIBILITY_COMMON_TTS_PLAYER_IMPL_H