]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/qt4/GuiSpellchecker.h
Also display the info about BibTeX databases in the TeX info panel.
[lyx.git] / src / frontends / qt4 / GuiSpellchecker.h
index 9c4a9258b5e55c65c0f1e2f10baebef32da0ac51..5851e8ceda5e31cd9e3c05df50727546f2ca4135 100644 (file)
@@ -6,6 +6,8 @@
  *
  * \author John Levon
  * \author Kalle Dalheimer
+ * \author Edwin Leuven
+ * \author Abdelrazak Younes
  *
  * Full author contact details are available in file CREDITS.
  */
 #ifndef GUISPELLCHECKER_H
 #define GUISPELLCHECKER_H
 
-#include "GuiDialogView.h"
-#include "ControlSpellchecker.h"
-#include "ui_SpellcheckerUi.h"
-
-#include <QDialog>
+#include "DockView.h"
+#include <QTabWidget>
 
 class QListWidgetItem;
 
-
 namespace lyx {
-namespace frontend {
 
-class GuiSpellchecker;
+class docstring_list;
 
-class GuiSpellcheckerDialog: public QDialog, public Ui::SpellcheckerUi {
-       Q_OBJECT
-public:
-       GuiSpellcheckerDialog(GuiSpellchecker * form);
-public Q_SLOTS:
-       virtual void suggestionChanged(QListWidgetItem *);
+namespace frontend {
 
-protected Q_SLOTS:
-       virtual void acceptClicked();
-       virtual void addClicked();
-       virtual void replaceClicked();
-       virtual void ignoreClicked();
-       virtual void replaceChanged(const QString &);
-       virtual void reject();
+class SpellcheckerWidget : public QTabWidget
+{
+       Q_OBJECT
 
-protected:
-       virtual void closeEvent(QCloseEvent * e);
+public:
+       SpellcheckerWidget(GuiView * gv, DockView * dv, QWidget * parent = 0);
+       ~SpellcheckerWidget();
+       ///
+       void updateView();
+       ///
+       bool initialiseParams(std::string const &);
+
+private Q_SLOTS:
+       void on_findNextPB_clicked();
+       void on_replaceAllPB_clicked();
+       void on_suggestionsLW_itemClicked(QListWidgetItem *);
+       void on_replaceCO_highlighted(const QString & str);
+       void on_languageCO_activated(int index);
+       void on_ignoreAllPB_clicked();
+       void on_addPB_clicked();
+       void on_ignorePB_clicked();
+       void on_replacePB_clicked();
 
 private:
-       GuiSpellchecker * form_;
+       ///
+       bool eventFilter(QObject *obj, QEvent *event);
+       struct Private;
+       Private * const d;
 };
 
 
-class GuiSpellchecker : public GuiView<GuiSpellcheckerDialog>
+class GuiSpellchecker : public DockView
 {
+       Q_OBJECT
+
 public:
-       friend class GuiSpellcheckerDialog;
-
-       GuiSpellchecker(Dialog &);
-
-       /// update from controller
-       void partialUpdate(int id);
-       /// parent controller
-       ControlSpellchecker & controller()
-       { return static_cast<ControlSpellchecker &>(this->getController()); }
-       /// parent controller
-       ControlSpellchecker const & controller() const
-       { return static_cast<ControlSpellchecker const &>(this->getController()); }
-private:
-       void accept();
-       void add();
-       void ignore();
-       void replace();
+       GuiSpellchecker(
+               GuiView & parent, ///< the main window where to dock.
+               Qt::DockWidgetArea area = Qt::RightDockWidgetArea, ///< Position of the dock (and also drawer)
+               Qt::WindowFlags flags = 0);
+       ~GuiSpellchecker();
 
-       /// Apply changes
-       virtual void apply() {}
-       ///
-       virtual void update_contents();
-       /// build the dialog
-       virtual void build_dialog();
+private:
+       ///{
+       void updateView();
+       bool initialiseParams(std::string const & data) { return widget_->initialiseParams(data); }
+       void clearParams() {}
+       void dispatchParams() {}
+       bool isBufferDependent() const { return false; }
+       ///}
+       /// The encapsulated widget.
+       SpellcheckerWidget * widget_;
 };
 
 } // namespace frontend