| 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 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "base/singleton.h" | 9 #include "base/singleton.h" |
| 10 | 10 |
| 11 namespace chromeos { | 11 namespace chromeos { |
| 12 | 12 |
| 13 // This interface defines the interaction with the ChromeOS login library APIs. | 13 // This interface defines the interaction with the ChromeOS login library APIs. |
| 14 class SpeechSynthesisLibrary { | 14 class SpeechSynthesisLibrary { |
| 15 public: | 15 public: |
| 16 typedef void(*InitStatusCallback)(bool success); | 16 typedef void(*InitStatusCallback)(bool success); |
| 17 | 17 |
| 18 virtual ~SpeechSynthesisLibrary() {} | 18 virtual ~SpeechSynthesisLibrary() {} |
| 19 // Speaks the specified text. | 19 // Speaks the specified text. |
| 20 virtual bool Speak(const char* text) = 0; | 20 virtual bool Speak(const char* text) = 0; |
| 21 // Sets options for the subsequent speech synthesis requests. | 21 // Sets options for the subsequent speech synthesis requests. |
| 22 virtual bool SetSpeakProperties(const char* props) = 0; | 22 virtual bool SetSpeakProperties(const char* props) = 0; |
| 23 // Stops speaking the current utterance. | 23 // Stops speaking the current utterance. |
| 24 virtual bool StopSpeaking() = 0; | 24 virtual bool StopSpeaking() = 0; |
| 25 // Checks if the engine is currently speaking. | 25 // Checks if the engine is currently speaking. |
| 26 virtual bool IsSpeaking() = 0; | 26 virtual bool IsSpeaking() = 0; |
| 27 // Starts the speech synthesis service and indicates through a callback if | 27 // Starts the speech synthesis service and indicates through a callback if |
| 28 // it started successfully. | 28 // it started successfully. |
| 29 virtual void InitTts(InitStatusCallback) = 0; | 29 virtual void InitTts(InitStatusCallback) = 0; |
| 30 }; | |
| 31 | 30 |
| 32 // This class handles the interaction with the ChromeOS login library APIs. | 31 // Get library implementation. |
| 33 class SpeechSynthesisLibraryImpl : public SpeechSynthesisLibrary { | 32 static SpeechSynthesisLibrary* GetImpl(bool stub); |
| 34 public: | |
| 35 SpeechSynthesisLibraryImpl() {} | |
| 36 virtual ~SpeechSynthesisLibraryImpl() {} | |
| 37 | |
| 38 // SpeechSynthesisLibrary overrides. | |
| 39 virtual bool Speak(const char* text); | |
| 40 virtual bool SetSpeakProperties(const char* props); | |
| 41 virtual bool StopSpeaking(); | |
| 42 virtual bool IsSpeaking(); | |
| 43 virtual void InitTts(InitStatusCallback); | |
| 44 | |
| 45 private: | |
| 46 DISALLOW_COPY_AND_ASSIGN(SpeechSynthesisLibraryImpl); | |
| 47 }; | 33 }; |
| 48 | 34 |
| 49 } // namespace chromeos | 35 } // namespace chromeos |
| 50 | 36 |
| 51 #endif // CHROME_BROWSER_CHROMEOS_CROS_SPEECH_SYNTHESIS_LIBRARY_H_ | 37 #endif // CHROME_BROWSER_CHROMEOS_CROS_SPEECH_SYNTHESIS_LIBRARY_H_ |
| OLD | NEW |