libqutim 0.3.1.0
spellchecker.h
Go to the documentation of this file.
00001 /****************************************************************************
00002 **
00003 ** qutIM - instant messenger
00004 **
00005 ** Copyright © 2011 Alexey Prokhin <alexey.prokhin@yandex.ru>
00006 **
00007 *****************************************************************************
00008 **
00009 ** $QUTIM_BEGIN_LICENSE$
00010 ** This program is free software: you can redistribute it and/or modify
00011 ** it under the terms of the GNU General Public License as published by
00012 ** the Free Software Foundation, either version 3 of the License, or
00013 ** (at your option) any later version.
00014 **
00015 ** This program is distributed in the hope that it will be useful,
00016 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
00017 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
00018 ** See the GNU General Public License for more details.
00019 **
00020 ** You should have received a copy of the GNU General Public License
00021 ** along with this program.  If not, see http://www.gnu.org/licenses/.
00022 ** $QUTIM_END_LICENSE$
00023 **
00024 ****************************************************************************/
00025 
00026 #ifndef SPELLCHECKER_H
00027 #define SPELLCHECKER_H
00028 
00029 #include "libqutim_global.h"
00030 
00031 namespace qutim_sdk_0_3 {
00032 
00036 // TODO: do we need languages() and setLanguage() methods?
00037 class LIBQUTIM_EXPORT SpellChecker : public QObject
00038 {
00039     Q_OBJECT
00040     Q_CLASSINFO("Service", "SpellChecker")
00041     Q_DISABLE_COPY(SpellChecker)
00042 public:
00046     virtual ~SpellChecker();
00050     virtual bool isCorrect(const QString &word) const = 0;
00054     bool isMisspelled(const QString &word) const { return !isCorrect(word); }
00058     virtual QStringList suggest(const QString &word) const = 0;
00062     virtual void store(const QString &word) const = 0;
00066     virtual void storeReplacement(const QString &bad, const QString &good) = 0;
00070     static SpellChecker *instance();
00071 signals:
00075     void dictionaryChanged();
00076 protected:
00077     SpellChecker();
00078     virtual void virtual_hook(int id, void *data);
00079 };
00080 
00081 } // namespace qutim_sdk_0_3
00082 
00083 #endif // SPELLCHECKER_H
00084