]> git.lyx.org Git - lyx.git/blob - src/frontends/qt4/GuiThesaurus.h
next one
[lyx.git] / src / frontends / qt4 / GuiThesaurus.h
1 // -*- C++ -*-
2 /**
3  * \file GuiThesaurus.h
4  * This file is part of LyX, the document processor.
5  * Licence details can be found in the file COPYING.
6  *
7  * \author John Levon
8  *
9  * Full author contact details are available in file CREDITS.
10  */
11
12 #ifndef GUITHESAURUS_H
13 #define GUITHESAURUS_H
14
15 #include "GuiDialog.h"
16 #include "Thesaurus.h"
17 #include "ui_ThesaurusUi.h"
18
19 class QTreeWidgetItem;
20
21 namespace lyx {
22 namespace frontend {
23
24 class GuiThesaurus : public GuiDialog, public Ui::ThesaurusUi, public Controller
25 {
26         Q_OBJECT
27
28 public:
29         GuiThesaurus(LyXView & lv);
30
31 private Q_SLOTS:
32         void change_adaptor();
33         void entryChanged();
34         void replaceClicked();
35         void selectionChanged();
36         void selectionClicked(QTreeWidgetItem *, int);
37         void itemClicked(QTreeWidgetItem *, int);
38
39 private:
40         void closeEvent(QCloseEvent * e);
41         /// parent controller
42         Controller & controller() { return *this; }
43         /// update
44         void updateContents();
45         ///
46         void updateLists();
47         ///
48         bool initialiseParams(std::string const & data);
49         ///
50         void clearParams();
51         ///
52         void dispatchParams() {}
53         ///
54         bool isBufferDependent() const { return true; }
55
56         /// replace the particular string
57         void replace(docstring const & newstr);
58
59         /// get meanings
60         Thesaurus::Meanings const & getMeanings(docstring const & str);
61
62 private:
63         /// last string looked up
64         docstring laststr_;
65
66         /// entries for last string
67         Thesaurus::Meanings meanings_;
68
69         /// original string
70         docstring text_;
71
72         /// not needed.
73         void apply() {}
74 };
75
76 } // namespace frontend
77 } // namespace lyx
78
79 #endif // GUITHESAURUS_H