#define GUISPELLCHECKER_H
#include "DockView.h"
+#include <QTabWidget>
class QListWidgetItem;
namespace frontend {
-class GuiSpellchecker : public DockView
+class SpellcheckerWidget : public QTabWidget
{
Q_OBJECT
public:
- GuiSpellchecker(GuiView & parent);
- ~GuiSpellchecker();
+ SpellcheckerWidget(GuiView * gv, DockView * dv, QWidget * parent = 0);
+ ~SpellcheckerWidget();
+ ///
+ void updateView();
+ ///
+ bool initialiseParams(std::string const &);
private Q_SLOTS:
- void on_closePB_clicked();
- void on_suggestionsLW_changed(QListWidgetItem *);
- void on_replaceC0_highlighted(const QString & str);
+ 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:
- /// update from controller
- void updateSuggestions(docstring_list & words);
+ ///
+ 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);
+ bool initialiseParams(std::string const & data) { return widget_->initialiseParams(data); }
void clearParams() {}
void dispatchParams() {}
- bool isBufferDependent() const { return true; }
+ bool isBufferDependent() const { return false; }
///}
-
- /// check text until next misspelled/unknown word
- /// returns true when finished
- void check();
- /// show count of checked words at normal exit
- void showSummary();
-
- struct Private;
- Private * const d;
+ /// The encapsulated widget.
+ SpellcheckerWidget * widget_;
};
} // namespace frontend