[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc

commit-queue at webkit.org commit-queue at webkit.org
Wed Dec 22 11:08:44 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit a29e92fee5f1ec4f957009397c7d87de95f2b604
Author: commit-queue at webkit.org <commit-queue at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Tue Jul 13 19:16:32 2010 +0000

    2010-07-13  Satish Sampath  <satish at chromium.org>
    
            Reviewed by Steve Block.
    
            Speech input plumbing in webcore
            https://bugs.webkit.org/show_bug.cgi?id=41518
    
            Adds the following:
            - a SpeechInput class to be used by the speech enabled HTML elements
            - a SpeechInputListener interface to be implemented by the speech enabled HTML elements
            - a SpeechInputClient interface (defined in WebCore, implemented by WebKit) for WebCore to call into WebKit.
              This is available as a member of WebCore::Page, set by the platforms which support speech input.
            - a SpeechInputClientListener interface for WebCore to receive events from WebKit
    
            No new tests, the relevant LayoutTestController bindings will be added in a subsequent patch.
    
            * Android.mk:
            * GNUmakefile.am:
            * WebCore.gypi:
            * WebCore.pro:
            * WebCore.vcproj/WebCore.vcproj:
            * WebCore.xcodeproj/project.pbxproj:
            * page/Page.cpp:
            (WebCore::Page::Page):
            * page/Page.h: Added SpeechInputClient member variable and associated methods.
            (WebCore::Page::setSpeechInputClient):
            (WebCore::Page::speechInputClient):
            * page/SpeechInput.cpp: Added new class to provide speech API services to HTML elements.
            (WebCore::SpeechInput::SpeechInput):
            (WebCore::SpeechInput::recordingComplete):
            (WebCore::SpeechInput::setRecognitionResult):
            (WebCore::SpeechInput::startRecognition):
            * page/SpeechInput.h: Added.
            (WebCore::SpeechInput::~SpeechInput):
            (WebCore::SpeechInput::client):
            * page/SpeechInputListener.h: Added.
            (WebCore::SpeechInputListener::~SpeechInputListener):
            * page/SpeechInputClient.h: Added new interface implemented by WebKit to bubble up speech API requests to the embedder.
            (WebCore::SpeechInputClient::~SpeechInputClient):
            * page/SpeechInputClientListener.h: Added.
            (WebCore::SpeechInputClientListener::~SpeechInputClientListener):
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@63230 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/Android.mk b/WebCore/Android.mk
index b68f30f..badd84e 100644
--- a/WebCore/Android.mk
+++ b/WebCore/Android.mk
@@ -381,6 +381,7 @@ LOCAL_SRC_FILES := $(LOCAL_SRC_FILES) \
 	page/SecurityOrigin.cpp \
 	page/Settings.cpp \
 	page/SpatialNavigation.cpp \
+	page/SpeechInput.cpp \
 	page/SuspendableTimer.cpp \
 	page/Timing.cpp \
 	page/UserContentURLPattern.cpp \
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 3b04352..89f07e7 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,45 @@
+2010-07-13  Satish Sampath  <satish at chromium.org>
+
+        Reviewed by Steve Block.
+
+        Speech input plumbing in webcore
+        https://bugs.webkit.org/show_bug.cgi?id=41518
+
+        Adds the following:
+        - a SpeechInput class to be used by the speech enabled HTML elements
+        - a SpeechInputListener interface to be implemented by the speech enabled HTML elements
+        - a SpeechInputClient interface (defined in WebCore, implemented by WebKit) for WebCore to call into WebKit.
+          This is available as a member of WebCore::Page, set by the platforms which support speech input.
+        - a SpeechInputClientListener interface for WebCore to receive events from WebKit
+
+        No new tests, the relevant LayoutTestController bindings will be added in a subsequent patch.
+
+        * Android.mk:
+        * GNUmakefile.am:
+        * WebCore.gypi:
+        * WebCore.pro:
+        * WebCore.vcproj/WebCore.vcproj:
+        * WebCore.xcodeproj/project.pbxproj:
+        * page/Page.cpp:
+        (WebCore::Page::Page):
+        * page/Page.h: Added SpeechInputClient member variable and associated methods.
+        (WebCore::Page::setSpeechInputClient):
+        (WebCore::Page::speechInputClient):
+        * page/SpeechInput.cpp: Added new class to provide speech API services to HTML elements.
+        (WebCore::SpeechInput::SpeechInput):
+        (WebCore::SpeechInput::recordingComplete):
+        (WebCore::SpeechInput::setRecognitionResult):
+        (WebCore::SpeechInput::startRecognition):
+        * page/SpeechInput.h: Added.
+        (WebCore::SpeechInput::~SpeechInput):
+        (WebCore::SpeechInput::client):
+        * page/SpeechInputListener.h: Added.
+        (WebCore::SpeechInputListener::~SpeechInputListener):
+        * page/SpeechInputClient.h: Added new interface implemented by WebKit to bubble up speech API requests to the embedder.
+        (WebCore::SpeechInputClient::~SpeechInputClient):
+        * page/SpeechInputClientListener.h: Added.
+        (WebCore::SpeechInputClientListener::~SpeechInputClientListener):
+
 2010-07-13  Richard Moore <rich at kde.org>, Robert Hogan  <robert at webkit.org>
 
         Reviewed by Simon Hausmann.
diff --git a/WebCore/GNUmakefile.am b/WebCore/GNUmakefile.am
index 7fa8093..7aa9142 100644
--- a/WebCore/GNUmakefile.am
+++ b/WebCore/GNUmakefile.am
@@ -2692,6 +2692,13 @@ if ENABLE_INPUT_SPEECH
 FEATURE_DEFINES += ENABLE_INPUT_SPEECH=1
 webcore_cppflags += -DENABLE_INPUT_SPEECH=1
 
+webcore_sources += \
+	WebCore/page/SpeechInput.cpp \
+	WebCore/page/SpeechInput.h \
+	WebCore/page/SpeechInputClient.h \
+	WebCore/page/SpeechInputClientListener.h \
+	WebCore/page/SpeechInputListener.h
+
 else
 
 webcore_cppflags += -DENABLE_INPUT_SPEECH=0
diff --git a/WebCore/WebCore.gypi b/WebCore/WebCore.gypi
index 1d2363b..d62509b 100644
--- a/WebCore/WebCore.gypi
+++ b/WebCore/WebCore.gypi
@@ -2037,6 +2037,11 @@
             'page/Settings.h',
             'page/SpatialNavigation.h',
             'page/SpatialNavigation.cpp',
+            'page/SpeechInput.cpp',
+            'page/SpeechInput.h',
+            'page/SpeechInputClient.h',
+            'page/SpeechInputClientListener.h',
+            'page/SpeechInputListener.h',
             'page/SuspendableTimer.cpp',
             'page/SuspendableTimer.h',
             'page/Timing.cpp',
diff --git a/WebCore/WebCore.pro b/WebCore/WebCore.pro
index 5ce4c2f..89d3ae7 100644
--- a/WebCore/WebCore.pro
+++ b/WebCore/WebCore.pro
@@ -1597,6 +1597,10 @@ HEADERS += \
     page/SecurityOrigin.h \
     page/Settings.h \
     page/SpatialNavigation.h \
+    page/SpeechInput.h \
+    page/SpeechInputClient.h \
+    page/SpeechInputClientListener.h \
+    page/SpeechInputListener.h \
     page/WindowFeatures.h \
     page/WorkerNavigator.h \
     page/XSSAuditor.h \
@@ -2526,6 +2530,7 @@ contains(DEFINES, ENABLE_SHARED_WORKERS=1) {
 
 contains(DEFINES, ENABLE_INPUT_SPEECH=1) {
     SOURCES += \
+        page/SpeechInput.cpp \
         rendering/RenderInputSpeech.cpp
 }
 
diff --git a/WebCore/WebCore.vcproj/WebCore.vcproj b/WebCore/WebCore.vcproj/WebCore.vcproj
index 8c86968..ba80b5c 100644
--- a/WebCore/WebCore.vcproj/WebCore.vcproj
+++ b/WebCore/WebCore.vcproj/WebCore.vcproj
@@ -22481,6 +22481,26 @@
 				>
 			</File>
 			<File
+				RelativePath="..\page\SpeechInput.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\page\SpeechInput.h"
+				>
+			</File>
+			<File
+				RelativePath="..\page\SpeechInputClient.h"
+				>
+			</File>
+			<File
+				RelativePath="..\page\SpeechInputClientListener.h"
+				>
+			</File>
+			<File
+				RelativePath="..\page\SpeechInputListener.h"
+				>
+			</File>
+			<File
 				RelativePath="..\page\SuspendableTimer.cpp"
 				>
 			</File>
diff --git a/WebCore/WebCore.xcodeproj/project.pbxproj b/WebCore/WebCore.xcodeproj/project.pbxproj
index cb3d542..8f3e754 100644
--- a/WebCore/WebCore.xcodeproj/project.pbxproj
+++ b/WebCore/WebCore.xcodeproj/project.pbxproj
@@ -1345,6 +1345,11 @@
 		754133AA102E00F400075D00 /* InspectorTimelineAgent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 754133A9102E00F400075D00 /* InspectorTimelineAgent.cpp */; };
 		7553CFE8108F473F00EA281E /* TimelineRecordFactory.h in Headers */ = {isa = PBXBuildFile; fileRef = 7553CFE6108F473F00EA281E /* TimelineRecordFactory.h */; };
 		7553CFE9108F473F00EA281E /* TimelineRecordFactory.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7553CFE7108F473F00EA281E /* TimelineRecordFactory.cpp */; };
+		7578F90B11DDF26900D933C5 /* SpeechInput.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7578F90811DDF26900D933C5 /* SpeechInput.cpp */; };
+		7578F90C11DDF26900D933C5 /* SpeechInput.h in Headers */ = {isa = PBXBuildFile; fileRef = 7578F90911DDF26900D933C5 /* SpeechInput.h */; };
+		7578F90D11DDF26900D933C5 /* SpeechInputClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 7578F90A11DDF26900D933C5 /* SpeechInputClient.h */; };
+		7578F91F11E4E32800D933C5 /* SpeechInputClientListener.h in Headers */ = {isa = PBXBuildFile; fileRef = 7578F91D11E4E32800D933C5 /* SpeechInputClientListener.h */; };
+		7578F92011E4E32800D933C5 /* SpeechInputListener.h in Headers */ = {isa = PBXBuildFile; fileRef = 7578F91E11E4E32800D933C5 /* SpeechInputListener.h */; };
 		75793E830D0CE0B3007FC0AC /* MessageEvent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 75793E800D0CE0B3007FC0AC /* MessageEvent.cpp */; };
 		75793E840D0CE0B3007FC0AC /* MessageEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = 75793E810D0CE0B3007FC0AC /* MessageEvent.h */; };
 		75793EC80D0CE72D007FC0AC /* JSMessageEvent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 75793EC60D0CE72D007FC0AC /* JSMessageEvent.cpp */; };
@@ -7095,6 +7100,11 @@
 		754133A9102E00F400075D00 /* InspectorTimelineAgent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InspectorTimelineAgent.cpp; sourceTree = "<group>"; };
 		7553CFE6108F473F00EA281E /* TimelineRecordFactory.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TimelineRecordFactory.h; sourceTree = "<group>"; };
 		7553CFE7108F473F00EA281E /* TimelineRecordFactory.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TimelineRecordFactory.cpp; sourceTree = "<group>"; };
+		7578F90811DDF26900D933C5 /* SpeechInput.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SpeechInput.cpp; sourceTree = "<group>"; };
+		7578F90911DDF26900D933C5 /* SpeechInput.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SpeechInput.h; sourceTree = "<group>"; };
+		7578F90A11DDF26900D933C5 /* SpeechInputClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SpeechInputClient.h; sourceTree = "<group>"; };
+		7578F91D11E4E32800D933C5 /* SpeechInputClientListener.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SpeechInputClientListener.h; sourceTree = "<group>"; };
+		7578F91E11E4E32800D933C5 /* SpeechInputListener.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SpeechInputListener.h; sourceTree = "<group>"; };
 		75793E800D0CE0B3007FC0AC /* MessageEvent.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = MessageEvent.cpp; path = dom/MessageEvent.cpp; sourceTree = SOURCE_ROOT; };
 		75793E810D0CE0B3007FC0AC /* MessageEvent.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = MessageEvent.h; path = dom/MessageEvent.h; sourceTree = SOURCE_ROOT; };
 		75793E820D0CE0B3007FC0AC /* MessageEvent.idl */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; name = MessageEvent.idl; path = dom/MessageEvent.idl; sourceTree = SOURCE_ROOT; };
@@ -12337,6 +12347,11 @@
 				F587863A02DE3A1401EA4122 /* Settings.h */,
 				626CDE0C1140424C001E5A68 /* SpatialNavigation.cpp */,
 				626CDE0D1140424C001E5A68 /* SpatialNavigation.h */,
+				7578F90811DDF26900D933C5 /* SpeechInput.cpp */,
+				7578F90911DDF26900D933C5 /* SpeechInput.h */,
+				7578F90A11DDF26900D933C5 /* SpeechInputClient.h */,
+				7578F91D11E4E32800D933C5 /* SpeechInputClientListener.h */,
+				7578F91E11E4E32800D933C5 /* SpeechInputListener.h */,
 				62C1217A11AB9E76003C462C /* SuspendableTimer.cpp */,
 				62C1217B11AB9E77003C462C /* SuspendableTimer.h */,
 				8AF4E55811DC5A63000ED3DE /* Timing.cpp */,
@@ -19778,6 +19793,10 @@
 				C585A6FC11D4FB3D004C3E4B /* IndexedDatabaseImpl.h in Headers */,
 				C585A6FE11D4FB3D004C3E4B /* IndexedDatabaseRequest.h in Headers */,
 				590E1B4911E4EF4B0069F784 /* DeviceOrientation.h in Headers */,
+				7578F90C11DDF26900D933C5 /* SpeechInput.h in Headers */,
+				7578F90D11DDF26900D933C5 /* SpeechInputClient.h in Headers */,
+				7578F91F11E4E32800D933C5 /* SpeechInputClientListener.h in Headers */,
+				7578F92011E4E32800D933C5 /* SpeechInputListener.h in Headers */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};
@@ -22165,6 +22184,7 @@
 				C585A6FD11D4FB3D004C3E4B /* IndexedDatabaseRequest.cpp in Sources */,
 				590E1B4B11E4EF700069F784 /* JSDeviceOrientationEventCustom.cpp in Sources */,
 				59D1C10411EB5DCF00B638C8 /* DeviceOrientation.cpp in Sources */,
+				7578F90B11DDF26900D933C5 /* SpeechInput.cpp in Sources */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};
diff --git a/WebCore/page/Page.cpp b/WebCore/page/Page.cpp
index 4d1f220..59c2238 100644
--- a/WebCore/page/Page.cpp
+++ b/WebCore/page/Page.cpp
@@ -61,6 +61,7 @@
 #include "SelectionController.h"
 #include "Settings.h"
 #include "SharedBuffer.h"
+#include "SpeechInputClient.h"
 #include "StringHash.h"
 #include "TextResourceDecoder.h"
 #include "Widget.h"
@@ -140,6 +141,9 @@ Page::Page(ChromeClient* chromeClient, ContextMenuClient* contextMenuClient, Edi
 #if ENABLE(DEVICE_ORIENTATION)
     , m_deviceOrientationController(new DeviceOrientationController(this, deviceOrientationClient))
 #endif
+#if ENABLE(INPUT_SPEECH)
+    , m_speechInputClient(0)
+#endif
     , m_settings(new Settings(this))
     , m_progress(new ProgressTracker)
     , m_backForwardController(new BackForwardController(this, backForwardControllerClient))
diff --git a/WebCore/page/Page.h b/WebCore/page/Page.h
index 56a25eb..8599a83 100644
--- a/WebCore/page/Page.h
+++ b/WebCore/page/Page.h
@@ -70,6 +70,7 @@ namespace WebCore {
     class VisibleSelection;
     class SelectionController;
     class Settings;
+    class SpeechInputClient;
 
 #if ENABLE(DOM_STORAGE)
     class StorageNamespace;
@@ -152,6 +153,10 @@ namespace WebCore {
 #if ENABLE(DEVICE_ORIENTATION)
         DeviceOrientationController* deviceOrientationController() const { return m_deviceOrientationController.get(); }
 #endif
+#if ENABLE(INPUT_SPEECH)
+        void setSpeechInputClient(SpeechInputClient* client) { m_speechInputClient = client; }
+        SpeechInputClient* speechInputClient() const { return m_speechInputClient; }
+#endif
         Settings* settings() const { return m_settings.get(); }
         ProgressTracker* progress() const { return m_progress.get(); }
         
@@ -269,6 +274,9 @@ namespace WebCore {
 #if ENABLE(DEVICE_ORIENTATION)
         OwnPtr<DeviceOrientationController> m_deviceOrientationController;
 #endif
+#if ENABLE(INPUT_SPEECH)
+        SpeechInputClient* m_speechInputClient;
+#endif
         OwnPtr<Settings> m_settings;
         OwnPtr<ProgressTracker> m_progress;
         
diff --git a/WebCore/page/SpeechInput.cpp b/WebCore/page/SpeechInput.cpp
new file mode 100644
index 0000000..92df70e
--- /dev/null
+++ b/WebCore/page/SpeechInput.cpp
@@ -0,0 +1,67 @@
+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ *     * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *     * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ *     * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "SpeechInput.h"
+
+#if ENABLE(INPUT_SPEECH)
+
+#include "Frame.h"
+#include "SpeechInputClient.h"
+#include "SpeechInputListener.h"
+
+namespace WebCore {
+
+SpeechInput::SpeechInput(SpeechInputClient* client, SpeechInputListener* listener)
+    : m_client(client)
+    , m_listener(listener)
+{
+}
+
+void SpeechInput::recordingComplete()
+{
+    m_listener->recordingComplete();
+}
+
+void SpeechInput::setRecognitionResult(const String& result)
+{
+    m_listener->setRecognitionResult(result);
+}
+
+bool SpeechInput::startRecognition()
+{
+    if (m_client)
+        return m_client->startRecognition(this);
+    return false;
+}
+
+} // namespace WebCore
+
+#endif // ENABLE(INPUT_SPEECH)
diff --git a/WebCore/page/SpeechInput.h b/WebCore/page/SpeechInput.h
new file mode 100644
index 0000000..201be99
--- /dev/null
+++ b/WebCore/page/SpeechInput.h
@@ -0,0 +1,72 @@
+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ *     * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *     * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ *     * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SpeechInput_h
+#define SpeechInput_h
+
+#if ENABLE(INPUT_SPEECH)
+
+#include "SpeechInputClientListener.h"
+#include <wtf/Noncopyable.h>
+
+namespace WebCore {
+
+class SpeechInputClient;
+class SpeechInputListener;
+class String;
+
+// This class connects the input elements requiring speech input with the platform specific
+// speech recognition engine. It provides methods for the input elements to activate speech
+// recognition and methods for the speech recognition engine to return back the results.
+class SpeechInput : public Noncopyable, public SpeechInputClientListener {
+public:
+    SpeechInput(SpeechInputClient*, SpeechInputListener*);
+    virtual ~SpeechInput() { }
+
+    // Methods invoked by the input elements.
+    virtual bool startRecognition();
+
+    // SpeechInputClient::Listener methods.
+    virtual void recordingComplete();
+    virtual void setRecognitionResult(const String&);
+
+protected:
+    SpeechInputClient* client() const { return m_client; }
+
+private:
+    SpeechInputClient* m_client;
+    SpeechInputListener* m_listener;
+};
+
+} // namespace WebCore
+
+#endif // ENABLE(INPUT_SPEECH)
+
+#endif // SpeechInput_h
diff --git a/WebCore/page/SpeechInputClient.h b/WebCore/page/SpeechInputClient.h
new file mode 100644
index 0000000..be68f46
--- /dev/null
+++ b/WebCore/page/SpeechInputClient.h
@@ -0,0 +1,53 @@
+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *     * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ *     * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SpeechInputClient_h
+#define SpeechInputClient_h
+
+#if ENABLE(INPUT_SPEECH)
+
+namespace WebCore {
+
+class SpeechInputClientListener;
+
+// Provides an interface for SpeechInput to call into the embedder.
+class SpeechInputClient {
+public:
+    virtual bool startRecognition(SpeechInputClientListener* listener) = 0;
+
+protected:
+    virtual ~SpeechInputClient() { }
+};
+
+} // namespace WebCore
+
+#endif // ENABLE(INPUT_SPEECH)
+
+#endif // SpeechInputClient_h
diff --git a/WebCore/page/SpeechInputClientListener.h b/WebCore/page/SpeechInputClientListener.h
new file mode 100644
index 0000000..a9a897e
--- /dev/null
+++ b/WebCore/page/SpeechInputClientListener.h
@@ -0,0 +1,54 @@
+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ *     * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *     * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ *     * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SpeechInputClientListener_h
+#define SpeechInputClientListener_h
+
+#if ENABLE(INPUT_SPEECH)
+
+namespace WebCore {
+
+class String;
+
+// Provides an interface for the embedder to call into WebCore.
+class SpeechInputClientListener {
+public:
+    virtual void recordingComplete() = 0;
+    virtual void setRecognitionResult(const String& result) = 0;
+
+protected:
+    virtual ~SpeechInputClientListener() { }
+};
+
+} // namespace WebCore
+
+#endif // ENABLE(INPUT_SPEECH)
+
+#endif // SpeechInputClientListener_h
diff --git a/WebCore/page/SpeechInputListener.h b/WebCore/page/SpeechInputListener.h
new file mode 100644
index 0000000..d087d36
--- /dev/null
+++ b/WebCore/page/SpeechInputListener.h
@@ -0,0 +1,54 @@
+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ *     * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *     * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ *     * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SpeechInputListener_h
+#define SpeechInputListener_h
+
+#if ENABLE(INPUT_SPEECH)
+
+namespace WebCore {
+
+class String;
+
+// Interface to be implemented by the element which invokes SpeechInput.
+class SpeechInputListener {
+public:
+    virtual void recordingComplete() = 0;
+    virtual void setRecognitionResult(const String& result) = 0;
+
+protected:
+    virtual ~SpeechInputListener() { }
+};
+
+} // namespace WebCore
+
+#endif // ENABLE(INPUT_SPEECH)
+
+#endif // SpeechInputListener_h

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list