WebKit2: Implement TextChecker on Windows
https://bugs.webkit.org/show_bug.cgi?id=57862
Reviewed by Adam Roben.
Part 3: Implement checkSpellingOfString
In WebCore, checkTextOfParagraph is only defined and used on platforms where
WTF_USE_UNIFIED_TEXT_CHECKING is defined (which right now is only non-Leopard and non-Tiger
Mac builds).
On other platforms, checkSpellingOfString and checkGrammarOfString (coming in a separate
patch in an attempt to keep things easier to review) are used.
* UIProcess/API/C/win/WKTextChecker.h:
* UIProcess/TextChecker.h:
Surround checkTextOfParagraph by #if USE(UNIFIED_TEXT_CHECKING) and add
checkSpellingOfString.
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::checkTextOfParagraph):
Surround this by #if USE(UNIFIED_TEXT_CHECKING).
(WebKit::WebPageProxy::checkSpellingOfString):
Call through to the client.
* UIProcess/WebPageProxy.h:
* UIProcess/WebPageProxy.messages.in:
Surround checkTextOfParagraph by #if USE(UNIFIED_TEXT_CHECKING) and add
checkSpellingOfString.
* UIProcess/win/TextCheckerWin.cpp:
(WebKit::TextChecker::checkSpellingOfString):
Call through to the WebTextCheckerClient.
* UIProcess/mac/TextCheckerMac.mm:
(WebKit::TextChecker::checkTextOfParagraph):
Surround this by #if USE(UNIFIED_TEXT_CHECKING) for clarity.
(WebKit::TextChecker::checkSpellingOfString):
Add a call to notImplemented.
* UIProcess/qt/TextCheckerQt.cpp:
(WebKit::TextChecker::checkSpellingOfString):
Ditto, and remove the implementation for checkTextOfParagraph.
* UIProcess/gtk/TextCheckerGtk.cpp:
(WebKit::TextChecker::checkSpellingOfString):
Ditto.
* UIProcess/win/WebTextCheckerClient.cpp:
(WebKit::WebTextCheckerClient::checkSpellingOfString):
* UIProcess/win/WebTextCheckerClient.h:
* WebProcess/WebCoreSupport/WebEditorClient.cpp:
(WebKit::WebEditorClient::checkSpellingOfString):
Send a sync message to the UI Process (similar to the sync message used for
checkTextOfParagraph).
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@83188 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/Source/WebKit2/UIProcess/TextChecker.h b/Source/WebKit2/UIProcess/TextChecker.h
index 5f45008..4934700 100644
--- a/Source/WebKit2/UIProcess/TextChecker.h
+++ b/Source/WebKit2/UIProcess/TextChecker.h
@@ -57,8 +57,10 @@
static int64_t uniqueSpellDocumentTag();
static void closeSpellDocumentWithTag(int64_t);
-
+#if USE(UNIFIED_TEXT_CHECKING)
static Vector<WebCore::TextCheckingResult> checkTextOfParagraph(int64_t spellDocumentTag, const UChar* text, int length, uint64_t checkingTypes);
+#endif
+ static void checkSpellingOfString(int64_t spellDocumentTag, const UChar* text, uint32_t length, int32_t& misspellingLocation, int32_t& misspellingLength);
static void updateSpellingUIWithMisspelledWord(const String& misspelledWord);
static void updateSpellingUIWithGrammarString(const String& badGrammarPhrase, const WebCore::GrammarDetail&);
static void getGuessesForWord(int64_t spellDocumentTag, const String& word, const String& context, Vector<String>& guesses);