1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/content/media/webspeech/synth/SpeechSynthesisVoice.h Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,61 @@ 1.4 +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 1.5 +/* vim:set ts=2 sw=2 sts=2 et cindent: */ 1.6 +/* This Source Code Form is subject to the terms of the Mozilla Public 1.7 + * License, v. 2.0. If a copy of the MPL was not distributed with this 1.8 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 1.9 + 1.10 +#ifndef mozilla_dom_SpeechSynthesisVoice_h 1.11 +#define mozilla_dom_SpeechSynthesisVoice_h 1.12 + 1.13 +#include "nsCOMPtr.h" 1.14 +#include "nsString.h" 1.15 +#include "nsWrapperCache.h" 1.16 +#include "js/TypeDecls.h" 1.17 + 1.18 +#include "nsISpeechService.h" 1.19 + 1.20 +namespace mozilla { 1.21 +namespace dom { 1.22 + 1.23 +class nsSynthVoiceRegistry; 1.24 +class SpeechSynthesis; 1.25 + 1.26 +class SpeechSynthesisVoice MOZ_FINAL : public nsISupports, 1.27 + public nsWrapperCache 1.28 +{ 1.29 + friend class nsSynthVoiceRegistry; 1.30 + friend class SpeechSynthesis; 1.31 + 1.32 +public: 1.33 + SpeechSynthesisVoice(nsISupports* aParent, const nsAString& aUri); 1.34 + 1.35 + virtual ~SpeechSynthesisVoice(); 1.36 + 1.37 + NS_DECL_CYCLE_COLLECTING_ISUPPORTS 1.38 + NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(SpeechSynthesisVoice) 1.39 + 1.40 + nsISupports* GetParentObject() const; 1.41 + 1.42 + virtual JSObject* WrapObject(JSContext* aCx) MOZ_OVERRIDE; 1.43 + 1.44 + void GetVoiceURI(nsString& aRetval) const; 1.45 + 1.46 + void GetName(nsString& aRetval) const; 1.47 + 1.48 + void GetLang(nsString& aRetval) const; 1.49 + 1.50 + bool LocalService() const; 1.51 + 1.52 + bool Default() const; 1.53 + 1.54 +private: 1.55 + 1.56 + nsCOMPtr<nsISupports> mParent; 1.57 + 1.58 + nsString mUri; 1.59 +}; 1.60 + 1.61 +} // namespace dom 1.62 +} // namespace mozilla 1.63 + 1.64 +#endif