#ifndef SpeechRecognitionEvent_h
#define SpeechRecognitionEvent_h
#include "core/events/Event.h"
#include "heap/Handle.h"
#include "modules/speech/SpeechRecognitionResult.h"
#include "modules/speech/SpeechRecognitionResultList.h"
#include "wtf/RefPtr.h"
namespace WebCore {
class Document;
class SpeechRecognitionEventInit : public EventInit {
public:
SpeechRecognitionEventInit();
unsigned long resultIndex;
RefPtrWillBeMember<SpeechRecognitionResultList> results;
};
class SpeechRecognitionEvent FINAL : public Event {
public:
static PassRefPtrWillBeRawPtr<SpeechRecognitionEvent> create();
static PassRefPtrWillBeRawPtr<SpeechRecognitionEvent> create(const AtomicString&, const SpeechRecognitionEventInit&);
virtual ~SpeechRecognitionEvent();
static PassRefPtrWillBeRawPtr<SpeechRecognitionEvent> createResult(unsigned long resultIndex, const WillBeHeapVector<RefPtrWillBeMember<SpeechRecognitionResult> >& results);
static PassRefPtrWillBeRawPtr<SpeechRecognitionEvent> createNoMatch(PassRefPtrWillBeRawPtr<SpeechRecognitionResult>);
unsigned long resultIndex() const { return m_resultIndex; }
SpeechRecognitionResultList* results() const { return m_results.get(); }
Document* interpretation() { return 0; }
Document* emma() { return 0; }
virtual const AtomicString& interfaceName() const OVERRIDE;
virtual void trace(Visitor*) OVERRIDE;
private:
SpeechRecognitionEvent();
SpeechRecognitionEvent(const AtomicString&, const SpeechRecognitionEventInit&);
SpeechRecognitionEvent(const AtomicString& eventName, unsigned long resultIndex, PassRefPtrWillBeRawPtr<SpeechRecognitionResultList> results);
unsigned long m_resultIndex;
RefPtrWillBeMember<SpeechRecognitionResultList> m_results;
};
}
#endif