X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Ffrontends%2Fqt4%2FGuiThesaurus.h;h=57544a6b3e96c477d33661529cd80ac40bce2241;hb=425d092204118ea6c24c28e85fdf03fcf2bb51a4;hp=48bbce8bcf2fe009c601a4bbee0bc47f58cced10;hpb=9a95d2a936748c057db94a3083c4b9e6587eea0b;p=lyx.git diff --git a/src/frontends/qt4/GuiThesaurus.h b/src/frontends/qt4/GuiThesaurus.h index 48bbce8bcf..57544a6b3e 100644 --- a/src/frontends/qt4/GuiThesaurus.h +++ b/src/frontends/qt4/GuiThesaurus.h @@ -12,67 +12,66 @@ #ifndef GUITHESAURUS_H #define GUITHESAURUS_H -#include "GuiDialogView.h" -#include "ControlThesaurus.h" +#include "GuiDialog.h" +#include "Thesaurus.h" #include "ui_ThesaurusUi.h" -#include - - 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); - 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_; -}; +public: + GuiThesaurus(GuiView & lv); +private Q_SLOTS: + void change_adaptor(); + void entryChanged(); + void replaceClicked(); + void selectionChanged(); + void selectionClicked(QTreeWidgetItem *, int); + void itemClicked(QTreeWidgetItem *, int); -/// -class GuiThesaurus : public GuiView -{ -public: +private: + /// update + void updateContents(); + /// + void updateLists(); /// - friend class GuiThesaurusDialog; + bool initialiseParams(std::string const & data); /// - GuiThesaurus(GuiDialog &); - /// parent controller - ControlThesaurus & controller() - { return static_cast(this->getController()); } - /// parent controller - ControlThesaurus const & controller() const - { return static_cast(this->getController()); } + 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 applyView() {} - /// 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