Fix build break
[chromium-blink-merge.git] / chrome / browser / speech / extension_api / tts_engine_extension_api.h
blobea62a4975832ea9407213cb5258707a56d30c7b6
1 // Copyright (c) 2012 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.
5 #ifndef CHROME_BROWSER_SPEECH_EXTENSION_API_TTS_ENGINE_EXTENSION_API_H_
6 #define CHROME_BROWSER_SPEECH_EXTENSION_API_TTS_ENGINE_EXTENSION_API_H_
8 #include "base/memory/singleton.h"
9 #include "chrome/browser/extensions/extension_function.h"
11 class Utterance;
13 namespace base {
14 class ListValue;
17 namespace extensions {
18 class Extension;
21 namespace tts_engine_events {
22 extern const char kOnSpeak[];
23 extern const char kOnStop[];
26 // Return a list of all available voices registered by extensions.
27 void GetExtensionVoices(Profile* profile, base::ListValue* result_voices);
29 // Find the first extension with a tts_voices in its
30 // manifest that matches the speech parameters of this utterance.
31 // If found, store a pointer to the extension in |matching_extension| and
32 // the index of the voice within the extension in |voice_index| and
33 // return true.
34 bool GetMatchingExtensionVoice(Utterance* utterance,
35 const extensions::Extension** matching_extension,
36 size_t* voice_index);
38 // Speak the given utterance by sending an event to the given TTS engine
39 // extension voice.
40 void ExtensionTtsEngineSpeak(Utterance* utterance,
41 const extensions::Extension* extension,
42 size_t voice_index);
44 // Stop speaking the given utterance by sending an event to the extension
45 // associated with this utterance.
46 void ExtensionTtsEngineStop(Utterance* utterance);
48 // Hidden/internal extension function used to allow TTS engine extensions
49 // to send events back to the client that's calling tts.speak().
50 class ExtensionTtsEngineSendTtsEventFunction : public SyncExtensionFunction {
51 private:
52 virtual ~ExtensionTtsEngineSendTtsEventFunction() {}
53 virtual bool RunImpl() OVERRIDE;
54 DECLARE_EXTENSION_FUNCTION("ttsEngine.sendTtsEvent", TTSENGINE_SENDTTSEVENT)
57 #endif // CHROME_BROWSER_SPEECH_EXTENSION_API_TTS_ENGINE_EXTENSION_API_H_