content/media/webspeech/synth/nsISynthVoiceRegistry.idl

Fri, 16 Jan 2015 04:50:19 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Fri, 16 Jan 2015 04:50:19 +0100
branch
TOR_BUG_9701
changeset 13
44a2da4a2ab2
permissions
-rw-r--r--

Replace accessor implementation with direct member state manipulation, by
request https://trac.torproject.org/projects/tor/ticket/9701#comment:32

     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(53dcc868-4193-4c3c-a1d9-fe5a0a6af2fb)]
    11 interface nsISynthVoiceRegistry : nsISupports
    12 {
    13   /**
    14    * Register a speech synthesis voice.
    15    *
    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    */
    22   void addVoice(in nsISpeechService aService, in DOMString aUri,
    23                 in DOMString aName, in DOMString aLang,
    24                 in boolean aLocalService);
    26   /**
    27    * Remove a speech synthesis voice.
    28    *
    29    * @param aService the service that was used to add the voice.
    30    * @param aUri     a unique identifier of an existing voice.
    31    */
    32   void removeVoice(in nsISpeechService aService, in DOMString aUri);
    34   /**
    35    * Set a voice as default.
    36    *
    37    * @param aUri       a unique identifier of an existing voice.
    38    * @param aIsDefault true if this voice should be toggled as default.
    39    */
    40   void setDefaultVoice(in DOMString aUri, in boolean aIsDefault);
    42   readonly attribute uint32_t voiceCount;
    44   AString getVoice(in uint32_t aIndex);
    46   bool isDefaultVoice(in DOMString aUri);
    48   bool isLocalVoice(in DOMString aUri);
    50   AString getVoiceLang(in DOMString aUri);
    52   AString getVoiceName(in DOMString aUri);
    53 };
    55 %{C++
    56 #define NS_SYNTHVOICEREGISTRY_CID                   \
    57   { /* {7090524d-5574-4492-a77f-d8d558ced59d} */       \
    58     0x7090524d,                                        \
    59     0x5574,                                            \
    60     0x4492,                                            \
    61     { 0xa7, 0x7f, 0xd8, 0xd5, 0x58, 0xce, 0xd5, 0x9d } \
    62   }
    64 #define NS_SYNTHVOICEREGISTRY_CONTRACTID \
    65     "@mozilla.org/synth-voice-registry;1"
    67 #define NS_SYNTHVOICEREGISTRY_CLASSNAME \
    68     "Speech Synthesis Voice Registry"
    70 %}

mercurial