WebKit2: Implement TextChecker on Windows
authorjberlin@webkit.org <jberlin@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 6 Apr 2011 19:56:28 +0000 (19:56 +0000)
committerjberlin@webkit.org <jberlin@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 6 Apr 2011 19:56:28 +0000 (19:56 +0000)
https://bugs.webkit.org/show_bug.cgi?id=57862

Reviewed by Anders Carlsson.

Part 2: Implement uniqueSpellDocumentTag and closeSpellDocumentWithTag.

* UIProcess/API/C/win/WKTextChecker.h:
* UIProcess/win/TextCheckerWin.cpp:
(WebKit::TextChecker::uniqueSpellDocumentTag):
(WebKit::TextChecker::closeSpellDocumentWithTag):
* UIProcess/win/WebTextCheckerClient.cpp:
(WebKit::WebTextCheckerClient::uniqueSpellDocumentTag):
(WebKit::WebTextCheckerClient::closeSpellDocumentWithTag):
* UIProcess/win/WebTextCheckerClient.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@83085 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebKit2/ChangeLog
Source/WebKit2/UIProcess/API/C/win/WKTextChecker.h
Source/WebKit2/UIProcess/win/TextCheckerWin.cpp
Source/WebKit2/UIProcess/win/WebTextCheckerClient.cpp
Source/WebKit2/UIProcess/win/WebTextCheckerClient.h

index 4ada811..5d9ba2d 100644 (file)
@@ -1,3 +1,21 @@
+2011-04-06  Jessie Berlin  <jberlin@apple.com>
+
+        Reviewed by Anders Carlsson.
+
+        WebKit2: Implement TextChecker on Windows
+        https://bugs.webkit.org/show_bug.cgi?id=57862
+
+        Part 2: Implement uniqueSpellDocumentTag and closeSpellDocumentWithTag.
+
+        * UIProcess/API/C/win/WKTextChecker.h:
+        * UIProcess/win/TextCheckerWin.cpp:
+        (WebKit::TextChecker::uniqueSpellDocumentTag):
+        (WebKit::TextChecker::closeSpellDocumentWithTag):
+        * UIProcess/win/WebTextCheckerClient.cpp:
+        (WebKit::WebTextCheckerClient::uniqueSpellDocumentTag):
+        (WebKit::WebTextCheckerClient::closeSpellDocumentWithTag):
+        * UIProcess/win/WebTextCheckerClient.h:
+
 2011-04-06  Robert Sesek  <rsesek@chromium.org>
 
         Reviewed by Alexey Proskuryakov.
index 8fb6597..292d065 100644 (file)
@@ -38,6 +38,8 @@ typedef bool (*WKTextCheckerContinousSpellCheckingEnabled)(const void *clientInf
 typedef void (*WKTextCheckerSetContinousSpellCheckingEnabled)(bool enabled, const void *clientInfo);
 typedef bool (*WKTextCheckerGrammarCheckingEnabled)(const void *clientInfo);
 typedef void (*WKTextCheckerSetGrammarCheckingEnabled)(bool enabled, const void *clientInfo);
+typedef uint64_t (*WKTextCheckerUniqueSpellDocumentTag)(const void *clientInfo);
+typedef void (*WKTextCheckerCloseSpellDocumentWithTag)(uint64_t tag, const void *clientInfo);
 
 struct WKTextCheckerClient {
     int                                                                     version;
@@ -47,6 +49,8 @@ struct WKTextCheckerClient {
     WKTextCheckerSetContinousSpellCheckingEnabled                           setContinuousSpellCheckingEnabled;
     WKTextCheckerGrammarCheckingEnabled                                     grammarCheckingEnabled;
     WKTextCheckerSetGrammarCheckingEnabled                                  setGrammarCheckingEnabled;
+    WKTextCheckerUniqueSpellDocumentTag                                     uniqueSpellDocumentTag;
+    WKTextCheckerCloseSpellDocumentWithTag                                  closeSpellDocumentWithTag;
 };
 typedef struct WKTextCheckerClient WKTextCheckerClient;
 
index 357597a..cce308a 100644 (file)
@@ -84,13 +84,12 @@ void TextChecker::grammarCheckingEnabledStateChanged(bool enabled)
 
 int64_t TextChecker::uniqueSpellDocumentTag()
 {
-    notImplemented();
-    return 0;
+    return WebTextChecker::shared()->client().uniqueSpellDocumentTag();
 }
 
-void TextChecker::closeSpellDocumentWithTag(int64_t)
+void TextChecker::closeSpellDocumentWithTag(int64_t tag)
 {
-    notImplemented();
+    WebTextChecker::shared()->client().closeSpellDocumentWithTag(tag);
 }
 
 Vector<TextCheckingResult> TextChecker::checkTextOfParagraph(int64_t spellDocumentTag, const UChar* text, int length, uint64_t checkingTypes)
index b11fe31..8f9a46b 100644 (file)
@@ -68,4 +68,20 @@ void WebTextCheckerClient::setGrammarCheckingEnabled(bool enabled)
     m_client.setGrammarCheckingEnabled(enabled, m_client.clientInfo);
 }
 
+uint64_t WebTextCheckerClient::uniqueSpellDocumentTag()
+{
+    if (!m_client.uniqueSpellDocumentTag)
+        return 0;
+
+    return m_client.uniqueSpellDocumentTag(m_client.clientInfo);
+}
+
+void WebTextCheckerClient::closeSpellDocumentWithTag(uint64_t tag)
+{
+    if (!m_client.closeSpellDocumentWithTag)
+        return;
+
+    m_client.closeSpellDocumentWithTag(tag, m_client.clientInfo);
+}
+
 } // namespace WebKit
index 2e32e16..6fd6cf0 100644 (file)
@@ -39,6 +39,8 @@ public:
     void setContinuousSpellCheckingEnabled(bool);
     bool grammarCheckingEnabled();
     void setGrammarCheckingEnabled(bool);
+    uint64_t uniqueSpellDocumentTag();
+    void closeSpellDocumentWithTag(uint64_t);
 };
 
 } // namespace WebKit