]> git.lyx.org Git - lyx.git/blob - src/frontends/controllers/ControlThesaurus.h
introduce namespace lyx::support
[lyx.git] / src / frontends / controllers / ControlThesaurus.h
1 // -*- C++ -*-
2 /**
3  * \file ControlThesaurus.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
13 #ifndef CONTROLTHESAURUS_H
14 #define CONTROLTHESAURUS_H
15
16 #include "Dialog.h"
17 #include "Thesaurus.h"
18 #include <vector>
19
20 /** A controller for Thesaurus dialogs.
21  */
22 class ControlThesaurus : public Dialog::Controller {
23 public:
24         ///
25         ControlThesaurus(Dialog &);
26         ///
27         virtual bool initialiseParams(string const & data);
28         ///
29         virtual void clearParams();
30         ///
31         virtual void dispatchParams() {}
32         ///
33         virtual bool isBufferDependent() const { return true; }
34
35         /// replace the particular string
36         void replace(string const & newstr);
37
38         /// get meanings
39         Thesaurus::Meanings const & getMeanings(string const & str);
40
41         /// the text
42         string const & text() const { return oldstr_; }
43
44 private:
45         /// last string looked up
46         string laststr_;
47
48         /// entries for last string
49         Thesaurus::Meanings meanings_;
50
51         /// original string
52         string oldstr_;
53
54         /// not needed.
55         virtual void apply() {}
56 };
57
58 #endif // CONTROLTHESAURUS_H