summaryrefslogtreecommitdiffstats
path: root/chrome/browser/chromeos/cros/speech_synthesis_library.h
blob: adf3b38ba1735672dbf1d89a2b00d44109f32833 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
// Copyright (c) 2010 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef CHROME_BROWSER_CHROMEOS_CROS_SPEECH_SYNTHESIS_LIBRARY_H_
#define CHROME_BROWSER_CHROMEOS_CROS_SPEECH_SYNTHESIS_LIBRARY_H_
#pragma once

#include "base/singleton.h"

namespace chromeos {

// This interface defines the interaction with the ChromeOS login library APIs.
class SpeechSynthesisLibrary {
 public:
  typedef void(*InitStatusCallback)(bool success);

  virtual ~SpeechSynthesisLibrary() {}
  // Speaks the specified text.
  virtual bool Speak(const char* text) = 0;
  // Sets options for the subsequent speech synthesis requests.
  virtual bool SetSpeakProperties(const char* props) = 0;
  // Stops speaking the current utterance.
  virtual bool StopSpeaking() = 0;
  // Checks if the engine is currently speaking.
  virtual bool IsSpeaking() = 0;
  // Starts the speech synthesis service and indicates through a callback if
  // it started successfully.
  virtual void InitTts(InitStatusCallback) = 0;

  // Get library implementation.
  static SpeechSynthesisLibrary* GetImpl(bool stub);
};

}  // namespace chromeos

#endif  // CHROME_BROWSER_CHROMEOS_CROS_SPEECH_SYNTHESIS_LIBRARY_H_