aspellpluginimpl.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007 #ifndef ASPELLPLUGINIMPL_H
00008 #define ASPELLPLUGINIMPL_H
00009
00010
00011 #include <string>
00012 #include <vector>
00013
00014 #include <QRegExp>
00015 #include <QString>
00016 #include <QStringList>
00017 #include <QHash>
00018
00019 #include "scribusdoc.h"
00020 #include "scribus.h"
00021 #include "selection.h"
00022 #include "prefsfile.h"
00023 #include "prefsmanager.h"
00024
00025 #include "ui_aspellpluginbase.h"
00026
00027 #include "suggest.h"
00028
00034 class AspellPluginImpl : public QDialog, private Ui::AspellPluginBase
00035 {
00036 Q_OBJECT
00037 private:
00039 static const char* kDEF_CONTEXT;
00041 static const QString kDEF_ASPELL_ENTRY;
00043 Speller::Aspell::Suggest* fsuggest;
00045 PrefsContext* fprefs;
00047 QString flang;
00049 QString fjargon;
00051 QString fencoding;
00053 QString fentry;
00055 ScribusDoc* fdoc;
00057 struct Changes
00058 {
00060 uint fnwords;
00062 uint fntot;
00064 uint fnframes;
00074 Changes(uint nwords=0, uint ntot=0, uint nframes=0) :
00075 fnwords(nwords), fntot(ntot), fnframes(nframes) {}
00076 } fnchanges;
00078 QString fcontent;
00080 uint fpos;
00081 QHash<QString, QString> rememberedWords;
00083 int fidx;
00085 QStringList fwordlist;
00087 PageItem* fFrame;
00090 protected:
00098 void checkText();
00106 void nextWord();
00116 void setPreferences(const QString& lang,
00117 const QString& jargon,
00118 const QString& encoding=Speller::Aspell::Suggest::kDEF_ENCODING,
00119 const QString& entry=kDEF_ASPELL_ENTRY);
00127 void getPreferences();
00135 void activateSpellGUI();
00143 void deactivateSpellGUI();
00151 void parseItem();
00159 void parseSelection();
00167 void spellCheckDone();
00168
00169 public:
00178 AspellPluginImpl(ScribusDoc* doc, QWidget* parent=NULL);
00186 ~AspellPluginImpl();
00187
00188 public slots:
00196 void on_fcloseBtn_clicked();
00204 void on_fchangeBtn_clicked();
00212 void on_fchangeAllBtn_clicked();
00220 void on_fskipBtn_clicked();
00228 void on_fskipAllBtn_clicked();
00236 void on_faddWordBtn_clicked();
00244 void on_flistReplacements_itemActivated();
00252 void on_flistDicts_activated();
00253
00254 protected slots:
00255 void languageChange();
00256
00257 };
00258 #endif // #ifndef ASPELLPLUGINIMPL_H
00259