Fri, 16 Jan 2015 04:50:19 +0100
Replace accessor implementation with direct member state manipulation, by
request https://trac.torproject.org/projects/tor/ticket/9701#comment:32
michael@0 | 1 | /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ |
michael@0 | 2 | /* vim:set ts=2 sw=2 sts=2 et cindent: */ |
michael@0 | 3 | /* This Source Code Form is subject to the terms of the Mozilla Public |
michael@0 | 4 | * License, v. 2.0. If a copy of the MPL was not distributed with this |
michael@0 | 5 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
michael@0 | 6 | |
michael@0 | 7 | #ifndef mozilla_dom_SpeechGrammarList_h |
michael@0 | 8 | #define mozilla_dom_SpeechGrammarList_h |
michael@0 | 9 | |
michael@0 | 10 | #include "mozilla/Attributes.h" |
michael@0 | 11 | #include "nsCOMPtr.h" |
michael@0 | 12 | #include "nsCycleCollectionParticipant.h" |
michael@0 | 13 | #include "nsWrapperCache.h" |
michael@0 | 14 | |
michael@0 | 15 | struct JSContext; |
michael@0 | 16 | |
michael@0 | 17 | namespace mozilla { |
michael@0 | 18 | |
michael@0 | 19 | class ErrorResult; |
michael@0 | 20 | |
michael@0 | 21 | namespace dom { |
michael@0 | 22 | |
michael@0 | 23 | class GlobalObject; |
michael@0 | 24 | class SpeechGrammar; |
michael@0 | 25 | template<typename> class Optional; |
michael@0 | 26 | |
michael@0 | 27 | class SpeechGrammarList MOZ_FINAL : public nsISupports, |
michael@0 | 28 | public nsWrapperCache |
michael@0 | 29 | { |
michael@0 | 30 | public: |
michael@0 | 31 | SpeechGrammarList(nsISupports* aParent); |
michael@0 | 32 | ~SpeechGrammarList(); |
michael@0 | 33 | |
michael@0 | 34 | NS_DECL_CYCLE_COLLECTING_ISUPPORTS |
michael@0 | 35 | NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(SpeechGrammarList) |
michael@0 | 36 | |
michael@0 | 37 | SpeechGrammarList* Constructor(const GlobalObject& aGlobal, |
michael@0 | 38 | ErrorResult& aRv); |
michael@0 | 39 | |
michael@0 | 40 | nsISupports* GetParentObject() const; |
michael@0 | 41 | |
michael@0 | 42 | virtual JSObject* WrapObject(JSContext* aCx) MOZ_OVERRIDE; |
michael@0 | 43 | |
michael@0 | 44 | uint32_t Length() const; |
michael@0 | 45 | |
michael@0 | 46 | already_AddRefed<SpeechGrammar> Item(uint32_t aIndex, ErrorResult& aRv); |
michael@0 | 47 | |
michael@0 | 48 | void AddFromURI(const nsAString& aSrc, const Optional<float>& aWeight, ErrorResult& aRv); |
michael@0 | 49 | |
michael@0 | 50 | void AddFromString(const nsAString& aString, const Optional<float>& aWeight, ErrorResult& aRv); |
michael@0 | 51 | |
michael@0 | 52 | already_AddRefed<SpeechGrammar> IndexedGetter(uint32_t aIndex, bool& aPresent, ErrorResult& aRv); |
michael@0 | 53 | |
michael@0 | 54 | private: |
michael@0 | 55 | nsCOMPtr<nsISupports> mParent; |
michael@0 | 56 | }; |
michael@0 | 57 | |
michael@0 | 58 | } // namespace dom |
michael@0 | 59 | } // namespace mozilla |
michael@0 | 60 | |
michael@0 | 61 | #endif |