]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/qt4/GuiSpellchecker.h
* fix spelling in comments to please John.
[lyx.git] / src / frontends / qt4 / GuiSpellchecker.h
index d7c8023a300e7a1fab4e608902cc4ec55ab04ce4..937d4f294b78087bb843be9781ff3335efb2a414 100644 (file)
@@ -6,76 +6,69 @@
  *
  * \author John Levon
  * \author Kalle Dalheimer
+ * \author Edwin Leuven
+ * \author Abdelrazak Younes
  *
  * Full author contact details are available in file CREDITS.
  */
 
-#ifndef QSPELLCHECKER_H
-#define QSPELLCHECKER_H
+#ifndef GUISPELLCHECKER_H
+#define GUISPELLCHECKER_H
 
-#include "GuiDialogView.h"
-#include "ui_SpellcheckerUi.h"
-
-#include <QDialog>
-#include <QCloseEvent>
+#include "DockView.h"
 
 class QListWidgetItem;
 
 namespace lyx {
-namespace frontend {
-
-class GuiSpellchecker;
 
-class GuiSpellcheckerDialog: public QDialog, public Ui::SpellcheckerUi {
-       Q_OBJECT
-public:
-       GuiSpellcheckerDialog(GuiSpellchecker * form);
-public Q_SLOTS:
-       virtual void suggestionChanged(QListWidgetItem *);
+class docstring_list;
 
-protected Q_SLOTS:
-       virtual void acceptClicked();
-       virtual void addClicked();
-       virtual void replaceClicked();
-       virtual void ignoreClicked();
-       virtual void replaceChanged(const QString &);
-       virtual void reject();
-
-protected:
-       virtual void closeEvent(QCloseEvent * e);
-
-private:
-       GuiSpellchecker * form_;
-};
-
-
-class ControlSpellchecker;
+namespace frontend {
 
-class GuiSpellchecker
-       : public QController<ControlSpellchecker, GuiView<GuiSpellcheckerDialog> >
+class GuiSpellchecker : public DockView
 {
-public:
-       friend class GuiSpellcheckerDialog;
+       Q_OBJECT
 
-       GuiSpellchecker(Dialog &);
+public:
+       GuiSpellchecker(GuiView & parent);
+       ~GuiSpellchecker();
+
+private Q_SLOTS:
+       void on_closePB_clicked();
+       void on_findNextPB_clicked();
+       void on_replaceAllPB_clicked();
+       void on_suggestionsLW_itemClicked(QListWidgetItem *);
+       void on_replaceCO_highlighted(const QString & str);
+       void on_ignoreAllPB_clicked();
+       void on_addPB_clicked();
+       void on_ignorePB_clicked();
+       void on_replacePB_clicked();
 
-       /// update from controller
-       void partialUpdate(int id);
 private:
-       void accept();
-       void add();
-       void ignore();
-       void replace();
-
-       /// Apply changes
-       virtual void apply() {}
-       ///
-       virtual void update_contents();
-       /// build the dialog
-       virtual void build_dialog();
+       /// update from controller
+       void updateSuggestions(docstring_list & words);
+
+       ///{
+       void updateView();
+       bool initialiseParams(std::string const & data);
+       void clearParams() {}
+       void dispatchParams() {}
+       bool isBufferDependent() const { return true; }
+       ///}
+
+       /// check text until next misspelled/unknown word
+       /// returns true when finished
+       void check();
+       /// show count of checked words at normal exit
+       void showSummary();
+
+       bool eventFilter(QObject *obj, QEvent *event);
+
+       struct Private;
+       Private * const d;
 };
 
 } // namespace frontend
 } // namespace lyx
 
-#endif // QSPELLCHECKER_H
+#endif // GUISPELLCHECKER_H