]> git.lyx.org Git - lyx.git/blob - src/frontends/controllers/ControlThesaurus.h
fix crash due to invalidated iterator
[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
19 namespace lyx {
20 namespace frontend {
21
22 /** A controller for Thesaurus dialogs.
23  */
24 class ControlThesaurus : public Dialog::Controller {
25 public:
26         ///
27         ControlThesaurus(Dialog &);
28         ///
29         virtual bool initialiseParams(std::string const & data);
30         ///
31         virtual void clearParams();
32         ///
33         virtual void dispatchParams() {}
34         ///
35         virtual bool isBufferDependent() const { return true; }
36
37         /// replace the particular string
38         void replace(std::string const & newstr);
39
40         /// get meanings
41         Thesaurus::Meanings const & getMeanings(std::string const & str);
42
43         /// the text
44         std::string const & text() const { return oldstr_; }
45
46 private:
47         /// last string looked up
48         std::string laststr_;
49
50         /// entries for last string
51         Thesaurus::Meanings meanings_;
52
53         /// original string
54         std::string oldstr_;
55
56         /// not needed.
57         virtual void apply() {}
58 };
59
60 } // namespace frontend
61 } // namespace lyx
62
63 #endif // CONTROLTHESAURUS_H