tor-browser

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

SpeechSynthesisVoice.h (1398B)


      1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
      2 /* vim:set ts=2 sw=2 sts=2 et cindent: */
      3 /* This Source Code Form is subject to the terms of the Mozilla Public
      4 * License, v. 2.0. If a copy of the MPL was not distributed with this
      5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
      6 
      7 #ifndef mozilla_dom_SpeechSynthesisVoice_h
      8 #define mozilla_dom_SpeechSynthesisVoice_h
      9 
     10 #include "js/TypeDecls.h"
     11 #include "nsCOMPtr.h"
     12 #include "nsString.h"
     13 #include "nsWrapperCache.h"
     14 
     15 namespace mozilla::dom {
     16 
     17 class nsSynthVoiceRegistry;
     18 class SpeechSynthesis;
     19 
     20 class SpeechSynthesisVoice final : public nsISupports, public nsWrapperCache {
     21  friend class nsSynthVoiceRegistry;
     22  friend class SpeechSynthesis;
     23 
     24 public:
     25  SpeechSynthesisVoice(nsISupports* aParent, const nsAString& aUri);
     26 
     27  NS_DECL_CYCLE_COLLECTING_ISUPPORTS
     28  NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(SpeechSynthesisVoice)
     29 
     30  nsISupports* GetParentObject() const;
     31 
     32  JSObject* WrapObject(JSContext* aCx,
     33                       JS::Handle<JSObject*> aGivenProto) override;
     34 
     35  void GetVoiceURI(nsString& aRetval) const;
     36 
     37  void GetName(nsString& aRetval) const;
     38 
     39  void GetLang(nsString& aRetval) const;
     40 
     41  bool LocalService() const;
     42 
     43  bool Default() const;
     44 
     45 private:
     46  virtual ~SpeechSynthesisVoice();
     47 
     48  nsCOMPtr<nsISupports> mParent;
     49 
     50  nsString mUri;
     51 };
     52 
     53 }  // namespace mozilla::dom
     54 
     55 #endif