1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/content/media/webspeech/recognition/SpeechRecognitionResultList.h Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,53 @@ 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_SpeechRecognitionResultList_h 1.11 +#define mozilla_dom_SpeechRecognitionResultList_h 1.12 + 1.13 +#include "nsCycleCollectionParticipant.h" 1.14 +#include "nsWrapperCache.h" 1.15 +#include "nsAutoPtr.h" 1.16 +#include "nsTArray.h" 1.17 +#include "js/TypeDecls.h" 1.18 + 1.19 +#include "mozilla/Attributes.h" 1.20 + 1.21 +#include "SpeechRecognitionResult.h" 1.22 + 1.23 +namespace mozilla { 1.24 +namespace dom { 1.25 + 1.26 +class SpeechRecognition; 1.27 + 1.28 +class SpeechRecognitionResultList MOZ_FINAL : public nsISupports, 1.29 + public nsWrapperCache 1.30 +{ 1.31 +public: 1.32 + SpeechRecognitionResultList(SpeechRecognition* aParent); 1.33 + ~SpeechRecognitionResultList(); 1.34 + 1.35 + NS_DECL_CYCLE_COLLECTING_ISUPPORTS 1.36 + NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(SpeechRecognitionResultList) 1.37 + 1.38 + nsISupports* GetParentObject() const; 1.39 + 1.40 + virtual JSObject* WrapObject(JSContext* aCx) MOZ_OVERRIDE; 1.41 + 1.42 + uint32_t Length() const; 1.43 + 1.44 + already_AddRefed<SpeechRecognitionResult> Item(uint32_t aIndex); 1.45 + 1.46 + already_AddRefed<SpeechRecognitionResult> IndexedGetter(uint32_t aIndex, bool& aPresent); 1.47 + 1.48 + nsTArray<nsRefPtr<SpeechRecognitionResult> > mItems; 1.49 +private: 1.50 + nsRefPtr<SpeechRecognition> mParent; 1.51 +}; 1.52 + 1.53 +} // namespace dom 1.54 +} // namespace mozilla 1.55 + 1.56 +#endif