KDECore
speller.h
Go to the documentation of this file.00001
00021 #ifndef SONNET_SPELLER_H
00022 #define SONNET_SPELLER_H
00023
00024 #include <QtCore/QStringList>
00025 #include <QtCore/QString>
00026
00027 #include <kdecore_export.h>
00028
00029 class KConfig;
00030
00031 namespace Sonnet
00032 {
00038 class KDECORE_EXPORT Speller
00039 {
00040 public:
00041 Speller(const QString &lang=QString());
00042 ~Speller();
00043
00044 Speller(const Speller &speller);
00045 Speller &operator=(const Speller &speller);
00046
00051 bool isValid() const;
00052
00056 void setLanguage(const QString &lang);
00060 QString language() const;
00061
00066 bool isCorrect(const QString &word) const;
00067
00072 bool isMisspelled(const QString &word) const;
00073
00079 QStringList suggest(const QString &word) const;
00080
00085 bool checkAndSuggest(const QString &word,
00086 QStringList &suggestions) const;
00087
00092 bool storeReplacement(const QString &bad,
00093 const QString &good);
00094
00099 bool addToPersonal(const QString &word);
00100
00105 bool addToSession(const QString &word);
00106
00107 public:
00108 enum Attribute {
00109 CheckUppercase,
00110 SkipRunTogether
00111 };
00112 void save(KConfig *config);
00113 void restore(KConfig *config);
00114
00118 QStringList availableBackends() const;
00119
00125 QStringList availableLanguages() const;
00131 QStringList availableLanguageNames() const;
00132
00137 QMap<QString, QString> availableDictionaries() const;
00138
00139
00140 void setDefaultLanguage(const QString &lang);
00141 QString defaultLanguage() const;
00142
00143 void setDefaultClient(const QString &client);
00144 QString defaultClient() const;
00145
00146 void setAttribute(Attribute attr, bool b = true);
00147 bool testAttribute(Attribute attr) const;
00148 private:
00149 class Private;
00150 Private *const d;
00151 };
00152 }
00153 #endif