Commit e8ef39de authored by jberlin@webkit.org's avatar jberlin@webkit.org

WebKit2: Implement TextChecker on Windows

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: svn://svn.chromium.org/blink/trunk@83085 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent 2acdb578
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.
......
......@@ -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;
......
......@@ -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)
......
......@@ -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
......@@ -39,6 +39,8 @@ public:
void setContinuousSpellCheckingEnabled(bool);
bool grammarCheckingEnabled();
void setGrammarCheckingEnabled(bool);
uint64_t uniqueSpellDocumentTag();
void closeSpellDocumentWithTag(uint64_t);
};
} // namespace WebKit
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment