]> git.lyx.org Git - lyx.git/blob - src/frontends/qt/GuiThesaurus.h
Fix completion in math when inline completion was not yet shown
[lyx.git] / src / frontends / qt / 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
25 {
26         Q_OBJECT
27
28 public:
29         GuiThesaurus(GuiView & lv);
30
31         void checkStatus() override;
32
33 private Q_SLOTS:
34         void change_adaptor();
35         void entryChanged();
36         void replaceClicked();
37         void selectionChanged();
38         void selectionClicked(QTreeWidgetItem *, int);
39         void itemClicked(QTreeWidgetItem *, int);
40
41 private:
42         /// update
43         void updateContents() override;
44         ///
45         void updateLists();
46         ///
47         bool initialiseParams(std::string const & data) override;
48         ///
49         void clearParams() override;
50         ///
51         void dispatchParams() override {}
52         ///
53         bool isBufferDependent() const override { return true; }
54
55         /// replace the particular string
56         void replace(docstring const & newstr);
57
58         /// get meanings
59         Thesaurus::Meanings const & getMeanings(WordLangTuple const & wl);
60
61 private:
62         /// last string looked up
63         docstring laststr_;
64
65         /// entries for last string
66         Thesaurus::Meanings meanings_;
67
68         /// original string
69         docstring text_;
70
71         /// language
72         docstring lang_;
73
74         /// not needed.
75         void apply() override {}
76 };
77
78 } // namespace frontend
79 } // namespace lyx
80
81 #endif // GUITHESAURUS_H