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 | |
17 virtual ~SpeechSynthesisLibrary() {} | 15 virtual ~SpeechSynthesisLibrary() {} |
18 // Speaks the specified text. | 16 // Speaks the specified text. |
19 virtual bool Speak(const char* text) = 0; | 17 virtual bool Speak(const char* text) = 0; |
20 // Sets options for the subsequent speech synthesis requests. | 18 // Sets options for the subsequent speech synthesis requests. |
21 virtual bool SetSpeakProperties(const char* props) = 0; | 19 virtual bool SetSpeakProperties(const char* props) = 0; |
22 // Stops speaking the current utterance. | 20 // Stops speaking the current utterance. |
23 virtual bool StopSpeaking() = 0; | 21 virtual bool StopSpeaking() = 0; |
24 // Checks if the engine is currently speaking. | 22 // Checks if the engine is currently speaking. |
25 virtual bool IsSpeaking() = 0; | 23 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; | |
29 }; | 24 }; |
30 | 25 |
31 // This class handles the interaction with the ChromeOS login library APIs. | 26 // This class handles the interaction with the ChromeOS login library APIs. |
32 class SpeechSynthesisLibraryImpl : public SpeechSynthesisLibrary { | 27 class SpeechSynthesisLibraryImpl : public SpeechSynthesisLibrary { |
33 public: | 28 public: |
34 SpeechSynthesisLibraryImpl() {} | 29 SpeechSynthesisLibraryImpl() {} |
35 virtual ~SpeechSynthesisLibraryImpl() {} | 30 virtual ~SpeechSynthesisLibraryImpl() {} |
36 | 31 |
37 // SpeechSynthesisLibrary overrides. | 32 // SpeechSynthesisLibrary overrides. |
38 virtual bool Speak(const char* text); | 33 virtual bool Speak(const char* text); |
39 virtual bool SetSpeakProperties(const char* props); | 34 virtual bool SetSpeakProperties(const char* props); |
40 virtual bool StopSpeaking(); | 35 virtual bool StopSpeaking(); |
41 virtual bool IsSpeaking(); | 36 virtual bool IsSpeaking(); |
42 virtual void InitTts(InitStatusCallback); | |
43 | 37 |
44 private: | 38 private: |
45 DISALLOW_COPY_AND_ASSIGN(SpeechSynthesisLibraryImpl); | 39 DISALLOW_COPY_AND_ASSIGN(SpeechSynthesisLibraryImpl); |
46 }; | 40 }; |
47 | 41 |
48 } // namespace chromeos | 42 } // namespace chromeos |
49 | 43 |
50 #endif // CHROME_BROWSER_CHROMEOS_CROS_SPEECH_SYNTHESIS_LIBRARY_H_ | 44 #endif // CHROME_BROWSER_CHROMEOS_CROS_SPEECH_SYNTHESIS_LIBRARY_H_ |
OLD | NEW |