michael@0: /* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this file, michael@0: * You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #include "nsISupports.idl" michael@0: michael@0: interface nsISpeechService; michael@0: michael@0: [scriptable, builtinclass, uuid(53dcc868-4193-4c3c-a1d9-fe5a0a6af2fb)] michael@0: interface nsISynthVoiceRegistry : nsISupports michael@0: { michael@0: /** michael@0: * Register a speech synthesis voice. michael@0: * michael@0: * @param aService the service that provides this voice. michael@0: * @param aUri a unique identifier for this voice. michael@0: * @param aName human-readable name for this voice. michael@0: * @param aLang a BCP 47 language tag. michael@0: * @param aLocalService true if service does not require network. michael@0: */ michael@0: void addVoice(in nsISpeechService aService, in DOMString aUri, michael@0: in DOMString aName, in DOMString aLang, michael@0: in boolean aLocalService); michael@0: michael@0: /** michael@0: * Remove a speech synthesis voice. michael@0: * michael@0: * @param aService the service that was used to add the voice. michael@0: * @param aUri a unique identifier of an existing voice. michael@0: */ michael@0: void removeVoice(in nsISpeechService aService, in DOMString aUri); michael@0: michael@0: /** michael@0: * Set a voice as default. michael@0: * michael@0: * @param aUri a unique identifier of an existing voice. michael@0: * @param aIsDefault true if this voice should be toggled as default. michael@0: */ michael@0: void setDefaultVoice(in DOMString aUri, in boolean aIsDefault); michael@0: michael@0: readonly attribute uint32_t voiceCount; michael@0: michael@0: AString getVoice(in uint32_t aIndex); michael@0: michael@0: bool isDefaultVoice(in DOMString aUri); michael@0: michael@0: bool isLocalVoice(in DOMString aUri); michael@0: michael@0: AString getVoiceLang(in DOMString aUri); michael@0: michael@0: AString getVoiceName(in DOMString aUri); michael@0: }; michael@0: michael@0: %{C++ michael@0: #define NS_SYNTHVOICEREGISTRY_CID \ michael@0: { /* {7090524d-5574-4492-a77f-d8d558ced59d} */ \ michael@0: 0x7090524d, \ michael@0: 0x5574, \ michael@0: 0x4492, \ michael@0: { 0xa7, 0x7f, 0xd8, 0xd5, 0x58, 0xce, 0xd5, 0x9d } \ michael@0: } michael@0: michael@0: #define NS_SYNTHVOICEREGISTRY_CONTRACTID \ michael@0: "@mozilla.org/synth-voice-registry;1" michael@0: michael@0: #define NS_SYNTHVOICEREGISTRY_CLASSNAME \ michael@0: "Speech Synthesis Voice Registry" michael@0: michael@0: %}