speech_synthesis_library.h revision 3345a6884c488ff3a535c2c9acdd33d74b37e311
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
3// found in the LICENSE file.
4
5#ifndef CHROME_BROWSER_CHROMEOS_CROS_SPEECH_SYNTHESIS_LIBRARY_H_
6#define CHROME_BROWSER_CHROMEOS_CROS_SPEECH_SYNTHESIS_LIBRARY_H_
7#pragma once
8
9#include "base/singleton.h"
10
11namespace chromeos {
12
13// This interface defines the interaction with the ChromeOS login library APIs.
14class SpeechSynthesisLibrary {
15 public:
16  typedef void(*InitStatusCallback)(bool success);
17
18  virtual ~SpeechSynthesisLibrary() {}
19  // Speaks the specified text.
20  virtual bool Speak(const char* text) = 0;
21  // Sets options for the subsequent speech synthesis requests.
22  virtual bool SetSpeakProperties(const char* props) = 0;
23  // Stops speaking the current utterance.
24  virtual bool StopSpeaking() = 0;
25  // Checks if the engine is currently speaking.
26  virtual bool IsSpeaking() = 0;
27  // Starts the speech synthesis service and indicates through a callback if
28  // it started successfully.
29  virtual void InitTts(InitStatusCallback) = 0;
30
31  // Factory function, creates a new instance and returns ownership.
32  // For normal usage, access the singleton via CrosLibrary::Get().
33  static SpeechSynthesisLibrary* GetImpl(bool stub);
34};
35
36}  // namespace chromeos
37
38#endif  // CHROME_BROWSER_CHROMEOS_CROS_SPEECH_SYNTHESIS_LIBRARY_H_
39