From f486d19d62f1bc33246748b14b14a9dfa617b57f Mon Sep 17 00:00:00 2001 From: Iain Merrick Date: Thu, 19 Aug 2010 17:55:56 +0100 Subject: Merge WebKit at r65615 : Initial merge by git. Change-Id: Ifbf384f4531e3b58475a662e38195c2d9152ae79 --- WebCore/page/SpeechInput.h | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) (limited to 'WebCore/page/SpeechInput.h') diff --git a/WebCore/page/SpeechInput.h b/WebCore/page/SpeechInput.h index 58f4efe..f36194c 100644 --- a/WebCore/page/SpeechInput.h +++ b/WebCore/page/SpeechInput.h @@ -35,6 +35,7 @@ #include "SpeechInputListener.h" #include +#include #include namespace WebCore { @@ -48,20 +49,30 @@ class SpeechInputListener; class SpeechInput : public Noncopyable, public SpeechInputListener { public: SpeechInput(SpeechInputClient*); - virtual ~SpeechInput() { } + virtual ~SpeechInput(); + + // Generates a unique ID for the given listener to be used for speech requests. + // This should be the first call made by listeners before anything else. + int registerListener(SpeechInputListener*); + + // Invoked when the listener is done with recording or getting destroyed. + // Failure to unregister may result in crashes if there were any pending speech events. + void unregisterListener(int); // Methods invoked by the input elements. - bool startRecognition(SpeechInputListener* listener); - void stopRecording(); + bool startRecognition(int); + void stopRecording(int); + void cancelRecognition(int); // SpeechInputListener methods. - virtual void didCompleteRecording(); - virtual void didCompleteRecognition(); - virtual void setRecognitionResult(const String&); + virtual void didCompleteRecording(int); + virtual void didCompleteRecognition(int); + virtual void setRecognitionResult(int, const String&); private: SpeechInputClient* m_client; - SpeechInputListener* m_listener; + HashMap m_listeners; + int m_nextListenerId; }; } // namespace WebCore -- cgit v1.1