Scribus Developer Documentation - API
logo-pen

Scribus Developer Documentation - API

aspellpluginimpl.h

Go to the documentation of this file.
00001 /*
00002 For general Scribus (>=1.3.2) copyright and licensing information please refer
00003 to the COPYING file provided with the program. Following this notice may exist
00004 a copyright and/or license notice that predates the release of Scribus 1.3.2
00005 for which a new license (GPL+exception) is in place.
00006 */
00007 #ifndef ASPELLPLUGINIMPL_H
00008 #define ASPELLPLUGINIMPL_H
00009 
00010 // ISO C++ include files
00011 #include <string>        // For replacement word from aspell
00012 #include <vector>        // For array of replacements from aspell
00013 // QT include files
00014 #include <QRegExp>
00015 #include <QString>
00016 #include <QStringList>
00017 #include <QHash>
00018 // Scribus include files
00019 #include "scribusdoc.h"           // For ScribusDoc
00020 #include "scribus.h"              // For ScribusMainWindow
00021 #include "selection.h"            // Item selected
00022 #include "prefsfile.h"            // Stored plugin preferences
00023 #include "prefsmanager.h"         // Preferences manager
00024 // Local include files
00025 #include "ui_aspellpluginbase.h"  // For GUI from QT4 designer
00026 // #include "donedlgimpl.h"          // For spell-checking done dialog
00027 #include "suggest.h"              // For aspell interface class
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 //@@@@@@@@@@@@@@@@@@@@@@@@@ END OF FILE @@@@@@@@@@@@@@@@@@@@@@@@@
Created with personalized Doxygen. This is documentation for GPL software Scribus - Open Source Desktop Publishing.