OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CHROME_BROWSER_CHROMEOS_CROS_SPEECH_SYNTHESIS_LIBRARY_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_CROS_SPEECH_SYNTHESIS_LIBRARY_H_ |
6 #define CHROME_BROWSER_CHROMEOS_CROS_SPEECH_SYNTHESIS_LIBRARY_H_ | 6 #define CHROME_BROWSER_CHROMEOS_CROS_SPEECH_SYNTHESIS_LIBRARY_H_ |
7 | 7 |
8 #include "base/singleton.h" | 8 #include "base/singleton.h" |
9 | 9 |
10 namespace chromeos { | 10 namespace chromeos { |
11 | 11 |
12 // This interface defines the interaction with the ChromeOS login library APIs. | 12 // This interface defines the interaction with the ChromeOS login library APIs. |
13 class SpeechSynthesisLibrary { | 13 class SpeechSynthesisLibrary { |
14 public: | 14 public: |
| 15 typedef void(*InitStatusCallback)(bool success); |
| 16 |
15 virtual ~SpeechSynthesisLibrary() {} | 17 virtual ~SpeechSynthesisLibrary() {} |
16 // Speaks the specified text. | 18 // Speaks the specified text. |
17 virtual bool Speak(const char* text) = 0; | 19 virtual bool Speak(const char* text) = 0; |
18 // Sets options for the subsequent speech synthesis requests. | 20 // Sets options for the subsequent speech synthesis requests. |
19 virtual bool SetSpeakProperties(const char* props) = 0; | 21 virtual bool SetSpeakProperties(const char* props) = 0; |
20 // Stops speaking the current utterance. | 22 // Stops speaking the current utterance. |
21 virtual bool StopSpeaking() = 0; | 23 virtual bool StopSpeaking() = 0; |
22 // Checks if the engine is currently speaking. | 24 // Checks if the engine is currently speaking. |
23 virtual bool IsSpeaking() = 0; | 25 virtual bool IsSpeaking() = 0; |
| 26 // Starts the speech synthesis service and indicates through a callback if |
| 27 // it started successfully. |
| 28 virtual void InitTts(InitStatusCallback) = 0; |
24 }; | 29 }; |
25 | 30 |
26 // This class handles the interaction with the ChromeOS login library APIs. | 31 // This class handles the interaction with the ChromeOS login library APIs. |
27 class SpeechSynthesisLibraryImpl : public SpeechSynthesisLibrary { | 32 class SpeechSynthesisLibraryImpl : public SpeechSynthesisLibrary { |
28 public: | 33 public: |
29 SpeechSynthesisLibraryImpl() {} | 34 SpeechSynthesisLibraryImpl() {} |
30 virtual ~SpeechSynthesisLibraryImpl() {} | 35 virtual ~SpeechSynthesisLibraryImpl() {} |
31 | 36 |
32 // SpeechSynthesisLibrary overrides. | 37 // SpeechSynthesisLibrary overrides. |
33 virtual bool Speak(const char* text); | 38 virtual bool Speak(const char* text); |
34 virtual bool SetSpeakProperties(const char* props); | 39 virtual bool SetSpeakProperties(const char* props); |
35 virtual bool StopSpeaking(); | 40 virtual bool StopSpeaking(); |
36 virtual bool IsSpeaking(); | 41 virtual bool IsSpeaking(); |
| 42 virtual void InitTts(InitStatusCallback); |
37 | 43 |
38 private: | 44 private: |
39 DISALLOW_COPY_AND_ASSIGN(SpeechSynthesisLibraryImpl); | 45 DISALLOW_COPY_AND_ASSIGN(SpeechSynthesisLibraryImpl); |
40 }; | 46 }; |
41 | 47 |
42 } // namespace chromeos | 48 } // namespace chromeos |
43 | 49 |
44 #endif // CHROME_BROWSER_CHROMEOS_CROS_SPEECH_SYNTHESIS_LIBRARY_H_ | 50 #endif // CHROME_BROWSER_CHROMEOS_CROS_SPEECH_SYNTHESIS_LIBRARY_H_ |
OLD | NEW |