X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Ffrontends%2Fqt4%2FGuiSpellchecker.h;h=5851e8ceda5e31cd9e3c05df50727546f2ca4135;hb=43c09d723435a5b203f2ac0c39e2086de836b386;hp=668821c5e701d8f9506eca627fcc17378f91126f;hpb=c9ea6e6eef090b863fb54445010f24443b15eb23;p=lyx.git diff --git a/src/frontends/qt4/GuiSpellchecker.h b/src/frontends/qt4/GuiSpellchecker.h index 668821c5e7..5851e8ceda 100644 --- a/src/frontends/qt4/GuiSpellchecker.h +++ b/src/frontends/qt4/GuiSpellchecker.h @@ -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. */ @@ -13,47 +15,69 @@ #ifndef GUISPELLCHECKER_H #define GUISPELLCHECKER_H -#include "GuiDialog.h" -#include "ControlSpellchecker.h" -#include "ui_SpellcheckerUi.h" +#include "DockView.h" +#include class QListWidgetItem; namespace lyx { + +class docstring_list; + namespace frontend { -class GuiSpellcheckerDialog : public GuiDialog, public Ui::SpellcheckerUi +class SpellcheckerWidget : public QTabWidget { Q_OBJECT public: - GuiSpellcheckerDialog(LyXView & lv); - -public Q_SLOTS: - void suggestionChanged(QListWidgetItem *); + SpellcheckerWidget(GuiView * gv, DockView * dv, QWidget * parent = 0); + ~SpellcheckerWidget(); + /// + void updateView(); + /// + bool initialiseParams(std::string const &); private Q_SLOTS: - void acceptClicked(); - void addClicked(); - void replaceClicked(); - void ignoreClicked(); - void replaceChanged(const QString &); - void reject(); + 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: /// - void closeEvent(QCloseEvent * e); - /// update from controller - void partialUpdate(int id); - /// parent controller - ControlSpellchecker & controller() const; - //// - void accept(); - void add(); - void ignore(); - void replace(); - /// - void update_contents(); + bool eventFilter(QObject *obj, QEvent *event); + struct Private; + Private * const d; +}; + + +class GuiSpellchecker : public DockView +{ + Q_OBJECT + +public: + 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(); + +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