SpeechRecognitionEvent.h [plain text]
#ifndef SpeechRecognitionEvent_h
#define SpeechRecognitionEvent_h
#if ENABLE(SCRIPTED_SPEECH)
#include "Event.h"
#include "SpeechRecognitionResult.h"
#include "SpeechRecognitionResultList.h"
#include <wtf/RefPtr.h>
namespace WebCore {
class Document;
struct SpeechRecognitionEventInit : public EventInit {
SpeechRecognitionEventInit();
unsigned long resultIndex;
RefPtr<SpeechRecognitionResultList> results;
};
class SpeechRecognitionEvent : public Event {
public:
static PassRefPtr<SpeechRecognitionEvent> create();
static PassRefPtr<SpeechRecognitionEvent> create(const AtomicString&, const SpeechRecognitionEventInit&);
virtual ~SpeechRecognitionEvent();
static PassRefPtr<SpeechRecognitionEvent> createResult(unsigned long resultIndex, const Vector<RefPtr<SpeechRecognitionResult> >& results);
static PassRefPtr<SpeechRecognitionEvent> createNoMatch(PassRefPtr<SpeechRecognitionResult>);
unsigned long resultIndex() const { return m_resultIndex; }
SpeechRecognitionResultList* results() const { return m_results.get(); }
Document* emma() { return 0; }
virtual const AtomicString& interfaceName() const OVERRIDE;
private:
SpeechRecognitionEvent();
SpeechRecognitionEvent(const AtomicString&, const SpeechRecognitionEventInit&);
SpeechRecognitionEvent(const AtomicString& eventName, unsigned long resultIndex, PassRefPtr<SpeechRecognitionResultList> results);
unsigned long m_resultIndex;
RefPtr<SpeechRecognitionResultList> m_results;
};
}
#endif // ENABLE(SCRIPTED_SPEECH)
#endif // SpeechRecognitionEvent_h