Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4)

Side by Side Diff: chrome/browser/chromeos/dbus/speech_synthesizer_client.h

Issue 8334018: Move the code in libcros' chromeos_speech_synthesis.cc into Chrome (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Removed ScopedRunnableMethodFactory Created 9 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright (c) 2011 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_DBUS_SPEECH_SYNTHESIZER_CLIENT_H_
6 #define CHROME_BROWSER_CHROMEOS_DBUS_SPEECH_SYNTHESIZER_CLIENT_H_
7 #pragma once
8
9 #include <string>
10
11 #include "base/callback.h"
12
13 namespace dbus {
14 class Bus;
15 }
16
17 namespace chromeos {
18
19 // SpeechSynthesizerClient is used to communicate with the speech synthesizer.
20 // All method should be called from the origin thread (UI thread) which
21 // initializes the DBusThreadManager instance.
22 class SpeechSynthesizerClient {
23 public:
24 // A callback function called when the result of IsSpeaking is ready.
25 // The argument indicates if the speech synthesizer is speaking or not.
26 typedef base::Callback<void(bool)> IsSpeakingCallback;
27
28 virtual ~SpeechSynthesizerClient() {}
29
30 // Speaks the specified text.
31 virtual void Speak(const std::string& text) = 0;
32
33 // Sets options for the subsequent speech synthesis requests.
34 // Use the constants below.
35 virtual void SetSpeakProperties(const std::string& props) = 0;
36
37 // Stops speaking the current utterance.
38 virtual void StopSpeaking() = 0;
39
40 // Checks if the engine is currently speaking.
41 // |callback| will be called on the origin thread later with the result.
42 virtual void IsSpeaking(IsSpeakingCallback callback) = 0;
43
44 // Factory function, creates a new instance and returns ownership.
45 // For normal usage, access the singleton via DBusThreadManager::Get().
46 static SpeechSynthesizerClient* Create(dbus::Bus* bus);
47
48 // Constants to be used with SetSpeakProperties.
49 static const char kSpeechPropertyLocale[];
50 static const char kSpeechPropertyGender[];
51 static const char kSpeechPropertyRate[];
52 static const char kSpeechPropertyPitch[];
53 static const char kSpeechPropertyVolume[];
54 static const char kSpeechPropertyEquals[];
55 static const char kSpeechPropertyDelimiter[];
56 };
57
58 } // namespace chromeos
59
60 #endif // CHROME_BROWSER_CHROMEOS_DBUS_SPEECH_SYNTHESIZER_CLIENT_H_
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/dbus/dbus_thread_manager.cc ('k') | chrome/browser/chromeos/dbus/speech_synthesizer_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698