libqutim  0.3.1.0
spellchecker.h
Go to the documentation of this file.
1 /****************************************************************************
2 **
3 ** qutIM - instant messenger
4 **
5 ** Copyright © 2011 Alexey Prokhin <alexey.prokhin@yandex.ru>
6 **
7 *****************************************************************************
8 **
9 ** $QUTIM_BEGIN_LICENSE$
10 ** This program is free software: you can redistribute it and/or modify
11 ** it under the terms of the GNU General Public License as published by
12 ** the Free Software Foundation, either version 3 of the License, or
13 ** (at your option) any later version.
14 **
15 ** This program is distributed in the hope that it will be useful,
16 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
17 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
18 ** See the GNU General Public License for more details.
19 **
20 ** You should have received a copy of the GNU General Public License
21 ** along with this program. If not, see http://www.gnu.org/licenses/.
22 ** $QUTIM_END_LICENSE$
23 **
24 ****************************************************************************/
25 
26 #ifndef SPELLCHECKER_H
27 #define SPELLCHECKER_H
28 
29 #include "libqutim_global.h"
30 
31 namespace qutim_sdk_0_3 {
32 
36 // TODO: do we need languages() and setLanguage() methods?
37 class LIBQUTIM_EXPORT SpellChecker : public QObject
38 {
39  Q_OBJECT
40  Q_CLASSINFO("Service", "SpellChecker")
41  Q_DISABLE_COPY(SpellChecker)
42 public:
46  virtual ~SpellChecker();
50  virtual bool isCorrect(const QString &word) const = 0;
54  bool isMisspelled(const QString &word) const { return !isCorrect(word); }
58  virtual QStringList suggest(const QString &word) const = 0;
62  virtual void store(const QString &word) const = 0;
66  virtual void storeReplacement(const QString &bad, const QString &good) = 0;
70  static SpellChecker *instance();
71 signals:
75  void dictionaryChanged();
76 protected:
77  SpellChecker();
78  virtual void virtual_hook(int id, void *data);
79 };
80 
81 } // namespace qutim_sdk_0_3
82 
83 #endif // SPELLCHECKER_H
84 

Generated by Doxygen