WebKitTextChecker.h [plain text]
#ifndef WebKitTextChecker_h
#define WebKitTextChecker_h
#if ENABLE(SPELLCHECK)
#include <WebCore/TextCheckerEnchant.h>
#include <wtf/FastAllocBase.h>
#include <wtf/PassOwnPtr.h>
#include <wtf/Vector.h>
#include <wtf/gobject/GRefPtr.h>
#include <wtf/text/CString.h>
class WebKitTextChecker {
WTF_MAKE_FAST_ALLOCATED;
public:
static PassOwnPtr<WebKitTextChecker> create() { return adoptPtr(new WebKitTextChecker()); }
virtual ~WebKitTextChecker();
bool isSpellCheckingEnabled() { return m_spellCheckingEnabled; }
void setSpellCheckingEnabled(bool enabled);
void checkSpellingOfString(const String& string, int& misspellingLocation, int& misspellingLength);
Vector<String> getGuessesForWord(const String& word);
void learnWord(const String& word);
void ignoreWord(const String& word);
const char* const* getSpellCheckingLanguages();
void setSpellCheckingLanguages(const char* const* spellCheckingLanguages);
private:
WebKitTextChecker();
OwnPtr<WebCore::TextCheckerEnchant> m_textChecker;
GRefPtr<GPtrArray> m_spellCheckingLanguages;
bool m_spellCheckingEnabled;
};
#endif // ENABLE(SPELLCHECK)
#endif // WebKitTextChecker_h