Bug 1945643 - Update to mozilla-nimbus-schemas 2025.1.1 r=chumphreys
[gecko.git] / dom / media / webspeech / synth / nsISynthVoiceRegistry.idl
blobe5189e0bc14ab8f1bf4d5855bf7ffbb3502d6d3d
1 /* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this file,
4 * You can obtain one at http://mozilla.org/MPL/2.0/. */
6 #include "nsISupports.idl"
8 interface nsISpeechService;
10 [scriptable, builtinclass, uuid(5d7a0b38-77e5-4ee5-897c-ce5db9b85d44)]
11 interface nsISynthVoiceRegistry : nsISupports
13 /**
14 * Register a speech synthesis voice.
16 * @param aService the service that provides this voice.
17 * @param aUri a unique identifier for this voice.
18 * @param aName human-readable name for this voice.
19 * @param aLang a BCP 47 language tag.
20 * @param aLocalService true if service does not require network.
21 * @param aQueuesUtterances true if voice only speaks one utterance at a time
23 void addVoice(in nsISpeechService aService, in AString aUri,
24 in AString aName, in AString aLang,
25 in boolean aLocalService, in boolean aQueuesUtterances);
27 /**
28 * Remove a speech synthesis voice.
30 * @param aService the service that was used to add the voice.
31 * @param aUri a unique identifier of an existing voice.
33 void removeVoice(in nsISpeechService aService, in AString aUri);
35 /**
36 * Notify content of voice availability changes. This allows content
37 * to be notified of voice catalog changes in real time.
39 void notifyVoicesChanged();
41 /**
42 * Notify chrome code of an error when starting speech synthesis service
44 void notifyVoicesError(in AString aError);
46 /**
47 * Set a voice as default.
49 * @param aUri a unique identifier of an existing voice.
50 * @param aIsDefault true if this voice should be toggled as default.
52 void setDefaultVoice(in AString aUri, in boolean aIsDefault);
54 readonly attribute uint32_t voiceCount;
56 AString getVoice(in uint32_t aIndex);
58 boolean isDefaultVoice(in AString aUri);
60 boolean isLocalVoice(in AString aUri);
62 AString getVoiceLang(in AString aUri);
64 AString getVoiceName(in AString aUri);
67 %{C++
68 #define NS_SYNTHVOICEREGISTRY_CONTRACTID \
69 "@mozilla.org/synth-voice-registry;1"