* Full author contact details are available in file CREDITS.
*/
-#ifndef QTHESAURUS_H
-#define QTHESAURUS_H
+#ifndef GUITHESAURUS_H
+#define GUITHESAURUS_H
-#include "GuiDialogView.h"
+#include "GuiDialog.h"
+#include "Thesaurus.h"
#include "ui_ThesaurusUi.h"
-#include <QDialog>
-#include <QCloseEvent>
-
-
class QTreeWidgetItem;
namespace lyx {
namespace frontend {
-class ControlThesaurus;
-
-class GuiThesaurus;
-
-class GuiThesaurusDialog : public QDialog, public Ui::ThesaurusUi {
+class GuiThesaurus : public GuiDialog, public Ui::ThesaurusUi
+{
Q_OBJECT
+
public:
- GuiThesaurusDialog(GuiThesaurus * form);
+ GuiThesaurus(GuiView & lv);
- void updateLists();
-protected Q_SLOTS:
- virtual void change_adaptor();
- virtual void entryChanged();
- virtual void replaceClicked();
- virtual void selectionChanged();
- virtual void selectionClicked(QTreeWidgetItem *, int);
- virtual void itemClicked(QTreeWidgetItem *, int);
-protected:
- virtual void closeEvent(QCloseEvent * e);
-private:
- GuiThesaurus * form_;
-};
+ void checkStatus();
+private Q_SLOTS:
+ void change_adaptor();
+ void entryChanged();
+ void replaceClicked();
+ void selectionChanged();
+ void selectionClicked(QTreeWidgetItem *, int);
+ void itemClicked(QTreeWidgetItem *, int);
-///
-class GuiThesaurus
- : public QController<ControlThesaurus, GuiView<GuiThesaurusDialog> >
-{
-public:
+private:
+ /// update
+ void updateContents();
+ ///
+ void updateLists();
///
- friend class GuiThesaurusDialog;
+ bool initialiseParams(std::string const & data);
///
- GuiThesaurus(Dialog &);
+ void clearParams();
+ ///
+ void dispatchParams() {}
+ ///
+ bool isBufferDependent() const { return true; }
+
+ /// replace the particular string
+ void replace(docstring const & newstr);
+
+ /// get meanings
+ Thesaurus::Meanings const & getMeanings(docstring const & str,
+ docstring const & lang);
+
private:
- /// Apply changes
- virtual void apply() {}
- /// update
- virtual void update_contents();
- /// build the dialog
- virtual void build_dialog();
+ /// last string looked up
+ docstring laststr_;
+
+ /// entries for last string
+ Thesaurus::Meanings meanings_;
+
+ /// original string
+ docstring text_;
+
+ /// language
+ docstring lang_;
- /// replace the word
- void replace();
+ /// not needed.
+ void apply() {}
};
} // namespace frontend
} // namespace lyx
-#endif // QTHESAURUS_H
+#endif // GUITHESAURUS_H