summaryrefslogtreecommitdiffstats
path: root/WebCore/page/SpeechInput.h
diff options
context:
space:
mode:
authorIain Merrick <husky@google.com>2010-08-19 17:55:56 +0100
committerIain Merrick <husky@google.com>2010-08-23 11:05:40 +0100
commitf486d19d62f1bc33246748b14b14a9dfa617b57f (patch)
tree195485454c93125455a30e553a73981c3816144d /WebCore/page/SpeechInput.h
parent6ba0b43722d16bc295606bec39f396f596e4fef1 (diff)
downloadexternal_webkit-f486d19d62f1bc33246748b14b14a9dfa617b57f.zip
external_webkit-f486d19d62f1bc33246748b14b14a9dfa617b57f.tar.gz
external_webkit-f486d19d62f1bc33246748b14b14a9dfa617b57f.tar.bz2
Merge WebKit at r65615 : Initial merge by git.
Change-Id: Ifbf384f4531e3b58475a662e38195c2d9152ae79
Diffstat (limited to 'WebCore/page/SpeechInput.h')
-rw-r--r--WebCore/page/SpeechInput.h25
1 files changed, 18 insertions, 7 deletions
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 <wtf/Forward.h>
+#include <wtf/HashMap.h>
#include <wtf/Noncopyable.h>
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<int, SpeechInputListener*> m_listeners;
+ int m_nextListenerId;
};
} // namespace WebCore