tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

nsISpeechRecognitionService.idl (1508B)


      1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
      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
      4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
      5 
      6 #include "nsISupports.idl"
      7 
      8 %{C++
      9 #include "mozilla/WeakPtr.h"
     10 
     11 namespace mozilla {
     12 class AudioSegment;
     13 namespace dom {
     14 class SpeechRecognition;
     15 class SpeechRecognitionResultList;
     16 class SpeechGrammarList;
     17 class SpeechGrammar;
     18 }
     19 }
     20 %}
     21 
     22 native SpeechRecognitionWeakPtr(mozilla::WeakPtr<mozilla::dom::SpeechRecognition>);
     23 [ptr] native AudioSegmentPtr(mozilla::AudioSegment);
     24 [ptr] native SpeechGrammarPtr(mozilla::dom::SpeechGrammar);
     25 [ptr] native SpeechGrammarListPtr(mozilla::dom::SpeechGrammarList);
     26 
     27 [uuid(6fcb6ee8-a6db-49ba-9f06-355d7ee18ea7)]
     28 interface nsISpeechGrammarCompilationCallback : nsISupports {
     29    void grammarCompilationEnd(in SpeechGrammarPtr grammarObject, in boolean success);
     30 };
     31 
     32 [uuid(8e97f287-f322-44e8-8888-8344fa408ef8)]
     33 interface nsISpeechRecognitionService : nsISupports {
     34    void initialize(in SpeechRecognitionWeakPtr aSpeechRecognition);
     35    void processAudioSegment(in AudioSegmentPtr aAudioSegment, in long aSampleRate);
     36    void validateAndSetGrammarList(in SpeechGrammarPtr aSpeechGrammar, in nsISpeechGrammarCompilationCallback aCallback);
     37    void soundEnd();
     38    void abort();
     39 };
     40 
     41 %{C++
     42 #define NS_SPEECH_RECOGNITION_SERVICE_CONTRACTID_PREFIX "@mozilla.org/webspeech/service;1?name="
     43 %}