WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
[patch]
Patch
bug-44114-20110813093628.patch (text/plain), 21.19 KB, created by
Lindsay Mathieson
on 2011-08-12 16:36:31 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Lindsay Mathieson
Created:
2011-08-12 16:36:31 PDT
Size:
21.19 KB
patch
obsolete
>Subversion Revision: 92674 >diff --git a/Source/WebCore/platform/graphics/qt/GraphicsContextQt.cpp b/Source/WebCore/platform/graphics/qt/GraphicsContextQt.cpp >index 10de9671abcd6a5c134586e7b2ed7e7480533895..d0fa4ce7907e9880274813d6e678aa34ed092e0b 100644 >--- a/Source/WebCore/platform/graphics/qt/GraphicsContextQt.cpp >+++ b/Source/WebCore/platform/graphics/qt/GraphicsContextQt.cpp >@@ -900,12 +900,106 @@ void GraphicsContext::drawLineForText(const FloatPoint& origin, float width, boo > drawLine(IntPoint(startPoint.x(), startPoint.y()), IntPoint(endPoint.x(), endPoint.y())); > } > >-void GraphicsContext::drawLineForTextChecking(const FloatPoint&, float, TextCheckingLineStyle) >+ >+/* >+ * NOTE: This code is completely based upon the one from >+ * Source/WebCore/platform/graphics/cairo/DrawErrorUnderline.{h|cpp} >+ * >+ * Draws an error underline that looks like one of: >+ * >+ * H E H >+ * /\ /\ /\ /\ /\ - >+ * A/ \ / \ / \ A/ \ / \ | >+ * \ \ / \ / /D \ \ / \ | >+ * \ \/ C \/ / \ \/ C \ | height = heightSquares * square >+ * \ /\ F / \ F /\ \ | >+ * \ / \ / \ / \ \G | >+ * \ / \ / \ / \ / | >+ * \/ \/ \/ \/ - >+ * B B >+ * |---| >+ * unitWidth = (heightSquares - 1) * square >+ * >+ * The x, y, width, height passed in give the desired bounding box; >+ * x/width are adjusted to make the underline a integer number of units wide. >+*/ >+static void drawErrorUnderline(QPainter *painter, qreal x, qreal y, qreal width, qreal height) >+{ >+ const qreal heightSquares = 2.5; >+ >+ qreal square = height / heightSquares; >+ qreal halfSquare = 0.5 * square; >+ >+ qreal unitWidth = (heightSquares - 1.0) * square; >+ int widthUnits = static_cast<int>((width + 0.5 * unitWidth) / unitWidth); >+ >+ x += 0.5 * (width - widthUnits * unitWidth); >+ width = widthUnits * unitWidth; >+ >+ qreal bottom = y + height; >+ qreal top = y; >+ >+ QPainterPath path; >+ // Bottom of squiggle >+ path.moveTo(x - halfSquare, top + halfSquare); // A >+ >+ int i = 0; >+ for (i = 0; i < widthUnits; i += 2) { >+ qreal middle = x + (i + 1) * unitWidth; >+ qreal right = x + (i + 2) * unitWidth; >+ >+ path.lineTo(middle, bottom); // B >+ >+ if (i + 2 == widthUnits) >+ path.lineTo(right + halfSquare, top + halfSquare); // D >+ else if (i + 1 != widthUnits) >+ path.lineTo(right, top + square); // C >+ } >+ >+ // Top of squiggle >+ for (i -= 2; i >= 0; i -= 2) { >+ qreal left = x + i * unitWidth; >+ qreal middle = x + (i + 1) * unitWidth; >+ qreal right = x + (i + 2) * unitWidth; >+ >+ if (i + 1 == widthUnits) >+ path.lineTo(middle + halfSquare, bottom - halfSquare); // G >+ else { >+ if (i + 2 == widthUnits) >+ path.lineTo(right, top); // E >+ >+ path.lineTo(middle, bottom - halfSquare); // F >+ } >+ >+ path.lineTo(left, top); // H >+ } >+ >+ painter->drawPath(path); >+} >+ >+ >+void GraphicsContext::drawLineForTextChecking(const FloatPoint& origin, float width, TextCheckingLineStyle style) > { > if (paintingDisabled()) > return; > >- notImplemented(); >+ QPainter* painter = platformContext(); >+ const QPen originalPen = painter->pen(); >+ >+ switch (style) { >+ case TextCheckingSpellingLineStyle: >+ painter->setPen(Qt::red); >+ break; >+ case TextCheckingGrammarLineStyle: >+ painter->setPen(Qt::green); >+ break; >+ default: >+ painter->setPen(originalPen); >+ return; >+ } >+ >+ drawErrorUnderline(painter, origin.x(), origin.y(), width, cMisspellingLineThickness); >+ painter->setPen(originalPen); > } > > FloatRect GraphicsContext::roundToDevicePixels(const FloatRect& frect, RoundingMode) >diff --git a/Source/WebKit/qt/Api/qwebkitplatformplugin.h b/Source/WebKit/qt/Api/qwebkitplatformplugin.h >index 1f628045bb4299326f7a1489f16ad2bd2f12e840..e32d0daf29f6ccc56c0381c4cd317cb62168818f 100644 >--- a/Source/WebKit/qt/Api/qwebkitplatformplugin.h >+++ b/Source/WebKit/qt/Api/qwebkitplatformplugin.h >@@ -21,6 +21,8 @@ > #ifndef QWEBKITPLATFORMPLUGIN_H > #define QWEBKITPLATFORMPLUGIN_H > >+#include "qwebkitglobal.h" >+ > /* > * Warning: The contents of this file is not part of the public QtWebKit API > * and may be changed from version to version or even be completely removed. >@@ -134,6 +136,32 @@ public Q_SLOTS: > }; > #endif > >+class QWEBKIT_EXPORT QWebSpellCheckerGrammarDetail { >+public: >+ int location; >+ int length; >+ QStringList guesses; >+ QString userDescription; >+}; >+ >+class QWEBKIT_EXPORT QWebSpellChecker : public QObject { >+ Q_OBJECT >+public: >+ virtual bool isContinousSpellCheckingEnabled() const = 0; >+ virtual void toggleContinousSpellChecking() = 0; >+ >+ virtual void learnWord(const QString& word) = 0; >+ virtual void ignoreWordInSpellDocument(const QString& word) = 0; >+ virtual void checkSpellingOfString(const QString& word, int* misspellingLocation, int* misspellingLength) = 0; >+ virtual QString autoCorrectSuggestionForMisspelledWord(const QString& word) = 0; >+ virtual void guessesForWord(const QString& word, const QString& context, QStringList& guesses) = 0; >+ >+ virtual bool isGrammarCheckingEnabled() = 0; >+ virtual void toggleGrammarChecking() = 0; >+ virtual void checkGrammarOfString(const QString&, QVector<QWebSpellCheckerGrammarDetail>&, int* badGrammarLocation, int* badGrammarLength) = 0; >+ >+}; >+ > class QWebKitPlatformPlugin { > public: > virtual ~QWebKitPlatformPlugin() {} >@@ -143,7 +171,8 @@ public: > Notifications, > Haptics, > TouchInteraction, >- FullScreenVideoPlayer >+ FullScreenVideoPlayer, >+ SpellChecker > }; > > virtual bool supportsExtension(Extension) const = 0; >diff --git a/Source/WebKit/qt/QtWebKit.pro b/Source/WebKit/qt/QtWebKit.pro >index 3c580891e5c1e1ce69663898828633c0cc68a524..04d60469c5e0e44175142b900e5f119c906287be 100644 >--- a/Source/WebKit/qt/QtWebKit.pro >+++ b/Source/WebKit/qt/QtWebKit.pro >@@ -194,7 +194,8 @@ SOURCES += \ > $$PWD/WebCoreSupport/PopupMenuQt.cpp \ > $$PWD/WebCoreSupport/QtPlatformPlugin.cpp \ > $$PWD/WebCoreSupport/SearchPopupMenuQt.cpp \ >- $$PWD/WebCoreSupport/WebPlatformStrategies.cpp >+ $$PWD/WebCoreSupport/WebPlatformStrategies.cpp \ >+ $$PWD/WebCoreSupport/TextCheckerClientQt.cpp > > HEADERS += \ > $$WEBKIT_API_HEADERS \ >@@ -210,7 +211,8 @@ HEADERS += \ > $$PWD/WebCoreSupport/QtPlatformPlugin.h \ > $$PWD/WebCoreSupport/PopupMenuQt.h \ > $$PWD/WebCoreSupport/SearchPopupMenuQt.h \ >- $$PWD/WebCoreSupport/WebPlatformStrategies.h >+ $$PWD/WebCoreSupport/WebPlatformStrategies.h \ >+ $$PWD/WebCoreSupport/TextCheckerClientQt.h > > webkit2 { > HEADERS += $$WEBKIT2_API_HEADERS >diff --git a/Source/WebKit/qt/WebCoreSupport/EditorClientQt.cpp b/Source/WebKit/qt/WebCoreSupport/EditorClientQt.cpp >index 73210f0fde1665fc79c836ee8bce5432e27f9c5d..14bb6e6574684459b597071157b8d83fbf0eef70 100644 >--- a/Source/WebKit/qt/WebCoreSupport/EditorClientQt.cpp >+++ b/Source/WebKit/qt/WebCoreSupport/EditorClientQt.cpp >@@ -56,7 +56,6 @@ > #include <stdio.h> > #include <wtf/OwnPtr.h> > >-#define methodDebug() qDebug("EditorClientQt: %s", __FUNCTION__); > > static QString dumpPath(WebCore::Node *node) > { >@@ -109,12 +108,12 @@ bool EditorClientQt::shouldShowDeleteInterface(HTMLElement* element) > > bool EditorClientQt::isContinuousSpellCheckingEnabled() > { >- return false; >+ return m_textCheckerClient.isContinousSpellCheckingEnabled(); > } > > bool EditorClientQt::isGrammarCheckingEnabled() > { >- return false; >+ return m_textCheckerClient.isGrammarCheckingEnabled(); > } > > int EditorClientQt::spellCheckerDocumentTag() >@@ -344,12 +343,12 @@ bool EditorClientQt::isSelectTrailingWhitespaceEnabled() > > void EditorClientQt::toggleContinuousSpellChecking() > { >- notImplemented(); >+ m_textCheckerClient.toggleContinousSpellChecking(); > } > > void EditorClientQt::toggleGrammarChecking() > { >- notImplemented(); >+ return m_textCheckerClient.toggleGrammarChecking(); > } > > static const unsigned CtrlKey = 1 << 0; >@@ -567,32 +566,6 @@ void EditorClientQt::textDidChangeInTextArea(Element*) > { > } > >-void EditorClientQt::ignoreWordInSpellDocument(const String&) >-{ >- notImplemented(); >-} >- >-void EditorClientQt::learnWord(const String&) >-{ >- notImplemented(); >-} >- >-void EditorClientQt::checkSpellingOfString(const UChar*, int, int*, int*) >-{ >- notImplemented(); >-} >- >-String EditorClientQt::getAutoCorrectSuggestionForMisspelledWord(const String&) >-{ >- notImplemented(); >- return String(); >-} >- >-void EditorClientQt::checkGrammarOfString(const UChar*, int, Vector<GrammarDetail>&, int*, int*) >-{ >- notImplemented(); >-} >- > void EditorClientQt::updateSpellingUIWithGrammarString(const String&, const GrammarDetail&) > { > notImplemented(); >@@ -614,11 +587,6 @@ bool EditorClientQt::spellingUIIsShowing() > return false; > } > >-void EditorClientQt::getGuessesForWord(const String& word, const String& context, Vector<String>& guesses) >-{ >- notImplemented(); >-} >- > bool EditorClientQt::isEditing() const > { > return m_editing; >diff --git a/Source/WebKit/qt/WebCoreSupport/EditorClientQt.h b/Source/WebKit/qt/WebCoreSupport/EditorClientQt.h >index eccb75dd0a6880d79d41d8ad9801cf427548302a..d9658bb72242c0465d9d629ed4e603885ef4ca87 100644 >--- a/Source/WebKit/qt/WebCoreSupport/EditorClientQt.h >+++ b/Source/WebKit/qt/WebCoreSupport/EditorClientQt.h >@@ -31,16 +31,15 @@ > #define EditorClientQt_h > > #include "EditorClient.h" >-#include "TextCheckerClient.h" > #include "RefCounted.h" >- >+#include "TextCheckerClientQt.h" > #include <wtf/Forward.h> > > class QWebPage; > > namespace WebCore { > >-class EditorClientQt : public EditorClient, public TextCheckerClient { >+class EditorClientQt : public EditorClient { > public: > EditorClientQt(QWebPage* page); > >@@ -97,20 +96,13 @@ public: > virtual void textWillBeDeletedInTextField(Element*); > virtual void textDidChangeInTextArea(Element*); > >- virtual void ignoreWordInSpellDocument(const String&); >- virtual void learnWord(const String&); >- virtual void checkSpellingOfString(const UChar*, int length, int* misspellingLocation, int* misspellingLength); >- virtual String getAutoCorrectSuggestionForMisspelledWord(const String& misspelledWord); >- virtual void checkGrammarOfString(const UChar*, int length, Vector<GrammarDetail>&, int* badGrammarLocation, int* badGrammarLength); > virtual void updateSpellingUIWithGrammarString(const String&, const GrammarDetail&); > virtual void updateSpellingUIWithMisspelledWord(const String&); > virtual void showSpellingUI(bool show); > virtual bool spellingUIIsShowing(); >- virtual void getGuessesForWord(const String& word, const String& context, Vector<String>& guesses); > virtual void willSetInputMethodState(); > virtual void setInputMethodState(bool enabled); >- virtual void requestCheckingOfString(SpellChecker*, int, WebCore::TextCheckingTypeMask, const String&) {} >- virtual TextCheckerClient* textChecker() { return this; } >+ virtual TextCheckerClient* textChecker() { return &m_textCheckerClient; } > > bool isEditing() const; > >@@ -118,6 +110,7 @@ public: > static bool acceptsEditing; > > private: >+ TextCheckerClientQt m_textCheckerClient; > QWebPage* m_page; > bool m_editing; > bool m_inUndoRedo; // our undo stack works differently - don't re-enter! >diff --git a/Source/WebKit/qt/WebCoreSupport/QtPlatformPlugin.cpp b/Source/WebKit/qt/WebCoreSupport/QtPlatformPlugin.cpp >index 2e44c66933de6ba3a68977601e18990d2dbe6090..7d8688b959ecc7b3b10ebc5903fbacd4b5c2b41e 100644 >--- a/Source/WebKit/qt/WebCoreSupport/QtPlatformPlugin.cpp >+++ b/Source/WebKit/qt/WebCoreSupport/QtPlatformPlugin.cpp >@@ -134,4 +134,10 @@ PassOwnPtr<QWebFullScreenVideoHandler> QtPlatformPlugin::createFullScreenVideoHa > } > #endif > >+PassOwnPtr<QWebSpellChecker> QtPlatformPlugin::createSpellChecker() >+{ >+ QWebKitPlatformPlugin* p = plugin(); >+ return adoptPtr(p ? static_cast<QWebSpellChecker*>(p->createExtension(QWebKitPlatformPlugin::SpellChecker)) : 0); >+} >+ > } >diff --git a/Source/WebKit/qt/WebCoreSupport/QtPlatformPlugin.h b/Source/WebKit/qt/WebCoreSupport/QtPlatformPlugin.h >index 316b8e8dbdf69e4705decb5c8174759372131568..9f8a760b82a9da2d999b6a3a4ac8d2b6837596a0 100644 >--- a/Source/WebKit/qt/WebCoreSupport/QtPlatformPlugin.h >+++ b/Source/WebKit/qt/WebCoreSupport/QtPlatformPlugin.h >@@ -33,6 +33,7 @@ class QWebTouchModifier; > #if ENABLE(VIDEO) && USE(QT_MULTIMEDIA) > class QWebFullScreenVideoHandler; > #endif >+class QWebSpellChecker; > > namespace WebCore { > >@@ -53,6 +54,7 @@ public: > #if ENABLE(VIDEO) && USE(QT_MULTIMEDIA) > PassOwnPtr<QWebFullScreenVideoHandler> createFullScreenVideoHandler(); > #endif >+ PassOwnPtr<QWebSpellChecker> createSpellChecker(); > > QWebKitPlatformPlugin* plugin(); > >diff --git a/Source/WebKit/qt/WebCoreSupport/TextCheckerClientQt.cpp b/Source/WebKit/qt/WebCoreSupport/TextCheckerClientQt.cpp >new file mode 100644 >index 0000000000000000000000000000000000000000..251458a907d6431432fd6b5126cb63f7977cfd26 >--- /dev/null >+++ b/Source/WebKit/qt/WebCoreSupport/TextCheckerClientQt.cpp >@@ -0,0 +1,165 @@ >+/* >+ * Copyright (C) 2011 Lindsay Mathieson <lindsay.mathieson@gmail.com> >+ * Copyright (C) 2011 Dawit Alemayehu <adawit@kde.org> >+ * >+ * All rights reserved. >+ * >+ * Redistribution and use in source and binary forms, with or without >+ * modification, are permitted provided that the following conditions >+ * are met: >+ * 1. Redistributions of source code must retain the above copyright >+ * notice, this list of conditions and the following disclaimer. >+ * 2. 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. >+ * >+ * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``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 APPLE COMPUTER, INC. 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 "TextCheckerClientQt.h" >+ >+#include "NotImplemented.h" >+#include "QtPlatformPlugin.h" >+ >+#include <QStringList> >+#include <QVector> >+#include <wtf/text/WTFString.h> >+ >+ >+namespace WebCore { >+ >+void TextCheckerClientQt::ignoreWordInSpellDocument(const String& word) >+{ >+ if (!loadSpellChecker()) >+ return; >+ >+ m_spellChecker->ignoreWordInSpellDocument(word); >+} >+ >+void TextCheckerClientQt::learnWord(const String& word) >+{ >+ if (!loadSpellChecker()) >+ return; >+ >+ m_spellChecker->learnWord(word); >+} >+ >+String TextCheckerClientQt::getAutoCorrectSuggestionForMisspelledWord(const String& misspelledWord) >+{ >+ if (!loadSpellChecker()) >+ return String(); >+ >+ return m_spellChecker->autoCorrectSuggestionForMisspelledWord(misspelledWord); >+} >+ >+void TextCheckerClientQt::checkSpellingOfString(const UChar* buffer, int length, int* misspellingLocation, int* misspellingLength) >+{ >+ if (!loadSpellChecker()) >+ return; >+ >+ const QString text = QString::fromRawData(reinterpret_cast<const QChar*>(buffer), length); >+ m_spellChecker->checkSpellingOfString(text, misspellingLocation, misspellingLength); >+} >+ >+void TextCheckerClientQt::checkGrammarOfString(const UChar* buffer, int length, Vector<GrammarDetail>& details, int* badGrammarLocation, int* badGrammarLength) >+{ >+ if (!loadSpellChecker()) >+ return; >+ >+ const QString text = QString::fromRawData(reinterpret_cast<const QChar*>(buffer), length); >+ >+ >+ // Do Grammer Check >+ QVector<QWebSpellCheckerGrammarDetail> qWebDetails; >+ m_spellChecker->checkGrammarOfString(text, qWebDetails, badGrammarLocation, badGrammarLength); >+ >+ // copy qWebDetails to details >+ details.clear(); >+ QVector<QWebSpellCheckerGrammarDetail>::iterator it = qWebDetails.begin(); >+ while (it < qWebDetails.end()) >+ { >+ GrammarDetail gd; >+ gd.location = it->location; >+ gd.length = it->length; >+ QStringList::iterator sit = it->guesses.begin(); >+ while (sit < it->guesses.end()) >+ { >+ gd.guesses.append(*sit); >+ sit++; >+ } >+ gd.userDescription = it->userDescription; >+ details.append(gd); >+ >+ it++; >+ } >+} >+ >+void TextCheckerClientQt::getGuessesForWord(const String& word, const String& context, Vector<String>& guesses) >+{ >+ if (!loadSpellChecker()) >+ return; >+ >+ QStringList guessesList; >+ m_spellChecker->guessesForWord(word, context, guessesList); >+ const int count = guessesList.count(); >+ guesses.resize(count); >+ for (int i = 0; i < count; ++i) >+ guesses.append(guessesList.at(i)); >+} >+ >+bool TextCheckerClientQt::isContinousSpellCheckingEnabled() >+{ >+ if (!loadSpellChecker()) >+ return false; >+ >+ return m_spellChecker->isContinousSpellCheckingEnabled(); >+} >+ >+void TextCheckerClientQt::toggleContinousSpellChecking() >+{ >+ if (!loadSpellChecker()) >+ return; >+ >+ m_spellChecker->toggleContinousSpellChecking(); >+} >+ >+bool TextCheckerClientQt::isGrammarCheckingEnabled() >+{ >+ if (!loadSpellChecker()) >+ return false; >+ >+ return m_spellChecker->isGrammarCheckingEnabled(); >+} >+ >+void TextCheckerClientQt::toggleGrammarChecking() >+{ >+ if (!loadSpellChecker()) >+ return; >+ >+ m_spellChecker->toggleGrammarChecking(); >+} >+ >+bool TextCheckerClientQt::loadSpellChecker() >+{ >+ if (m_spellChecker) >+ return true; >+ >+ QtPlatformPlugin platformPlugin; >+ if ((m_spellChecker = platformPlugin.createSpellChecker())) >+ return true; >+ >+ return false; >+} >+ >+} >diff --git a/Source/WebKit/qt/WebCoreSupport/TextCheckerClientQt.h b/Source/WebKit/qt/WebCoreSupport/TextCheckerClientQt.h >new file mode 100644 >index 0000000000000000000000000000000000000000..f533e5157f87180e0b103e75de4c9126bbc16f8f >--- /dev/null >+++ b/Source/WebKit/qt/WebCoreSupport/TextCheckerClientQt.h >@@ -0,0 +1,66 @@ >+/* >+ * Copyright (C) 2011 Lindsay Mathieson <lindsay.mathieson@gmail.com> >+ * Copyright (C) 2011 Dawit Alemayehu <adawit@kde.org> >+ * >+ * All rights reserved. >+ * >+ * Redistribution and use in source and binary forms, with or without >+ * modification, are permitted provided that the following conditions >+ * are met: >+ * 1. Redistributions of source code must retain the above copyright >+ * notice, this list of conditions and the following disclaimer. >+ * 2. 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. >+ * >+ * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``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 APPLE COMPUTER, INC. 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 TextCheckerClientQt_h >+#define TextCheckerClientQt_h >+ >+#include "TextCheckerClient.h" >+#include "qwebkitplatformplugin.h" >+ >+#include <wtf/Forward.h> >+#include <wtf/OwnPtr.h> >+ >+ >+namespace WebCore { >+ >+class TextCheckerClientQt : public TextCheckerClient { >+public: >+ virtual void ignoreWordInSpellDocument(const String&); >+ virtual void learnWord(const String&); >+ virtual void checkSpellingOfString(const UChar*, int length, int* misspellingLocation, int* misspellingLength); >+ virtual String getAutoCorrectSuggestionForMisspelledWord(const String& misspelledWord); >+ virtual void checkGrammarOfString(const UChar*, int length, Vector<GrammarDetail>&, int* badGrammarLocation, int* badGrammarLength); >+ virtual void getGuessesForWord(const String& word, const String& context, Vector<String>& guesses); >+ virtual void requestCheckingOfString(SpellChecker*, int, TextCheckingTypeMask, const String&) { } >+ >+ virtual bool isContinousSpellCheckingEnabled(); >+ virtual void toggleContinousSpellChecking(); >+ >+ virtual bool isGrammarCheckingEnabled(); >+ virtual void toggleGrammarChecking(); >+ >+private: >+ bool loadSpellChecker(); >+ >+private: >+ OwnPtr<QWebSpellChecker> m_spellChecker; >+}; >+ >+} >+ >+#endif
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 44114
:
102872
|
102875
|
103074
|
103075
|
103087
|
103765
|
103840
|
103842
|
103905
|
103995
|
104623