1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/content/media/webspeech/synth/nsISynthVoiceRegistry.idl Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,70 @@ 1.4 +/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 1.5 +/* This Source Code Form is subject to the terms of the Mozilla Public 1.6 + * License, v. 2.0. If a copy of the MPL was not distributed with this file, 1.7 + * You can obtain one at http://mozilla.org/MPL/2.0/. */ 1.8 + 1.9 +#include "nsISupports.idl" 1.10 + 1.11 +interface nsISpeechService; 1.12 + 1.13 +[scriptable, builtinclass, uuid(53dcc868-4193-4c3c-a1d9-fe5a0a6af2fb)] 1.14 +interface nsISynthVoiceRegistry : nsISupports 1.15 +{ 1.16 + /** 1.17 + * Register a speech synthesis voice. 1.18 + * 1.19 + * @param aService the service that provides this voice. 1.20 + * @param aUri a unique identifier for this voice. 1.21 + * @param aName human-readable name for this voice. 1.22 + * @param aLang a BCP 47 language tag. 1.23 + * @param aLocalService true if service does not require network. 1.24 + */ 1.25 + void addVoice(in nsISpeechService aService, in DOMString aUri, 1.26 + in DOMString aName, in DOMString aLang, 1.27 + in boolean aLocalService); 1.28 + 1.29 + /** 1.30 + * Remove a speech synthesis voice. 1.31 + * 1.32 + * @param aService the service that was used to add the voice. 1.33 + * @param aUri a unique identifier of an existing voice. 1.34 + */ 1.35 + void removeVoice(in nsISpeechService aService, in DOMString aUri); 1.36 + 1.37 + /** 1.38 + * Set a voice as default. 1.39 + * 1.40 + * @param aUri a unique identifier of an existing voice. 1.41 + * @param aIsDefault true if this voice should be toggled as default. 1.42 + */ 1.43 + void setDefaultVoice(in DOMString aUri, in boolean aIsDefault); 1.44 + 1.45 + readonly attribute uint32_t voiceCount; 1.46 + 1.47 + AString getVoice(in uint32_t aIndex); 1.48 + 1.49 + bool isDefaultVoice(in DOMString aUri); 1.50 + 1.51 + bool isLocalVoice(in DOMString aUri); 1.52 + 1.53 + AString getVoiceLang(in DOMString aUri); 1.54 + 1.55 + AString getVoiceName(in DOMString aUri); 1.56 +}; 1.57 + 1.58 +%{C++ 1.59 +#define NS_SYNTHVOICEREGISTRY_CID \ 1.60 + { /* {7090524d-5574-4492-a77f-d8d558ced59d} */ \ 1.61 + 0x7090524d, \ 1.62 + 0x5574, \ 1.63 + 0x4492, \ 1.64 + { 0xa7, 0x7f, 0xd8, 0xd5, 0x58, 0xce, 0xd5, 0x9d } \ 1.65 + } 1.66 + 1.67 +#define NS_SYNTHVOICEREGISTRY_CONTRACTID \ 1.68 + "@mozilla.org/synth-voice-registry;1" 1.69 + 1.70 +#define NS_SYNTHVOICEREGISTRY_CLASSNAME \ 1.71 + "Speech Synthesis Voice Registry" 1.72 + 1.73 +%}