]> git.lyx.org Git - lyx.git/blob - src/Thesaurus.h
9808a455ff49ab683e31734f39644553d9178ad0
[lyx.git] / src / Thesaurus.h
1 // -*- C++ -*-
2 /**
3  * \file Thesaurus.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  * \author Jürgen Spitzmüller
9  *
10  * Full author contact details are available in file CREDITS.
11  */
12
13 #ifndef THESAURUS_H
14 #define THESAURUS_H
15
16 #include "support/docstring.h"
17
18 #include <vector>
19 #include <map>
20 #include <string>
21
22 #ifdef HAVE_LIBMYTHES
23 #include MYTHES_H_LOCATION
24 #else
25 #ifdef HAVE_LIBAIKSAURUS
26 #include AIKSAURUS_H_LOCATION
27 #endif // HAVE_LIBAIKSAURUS
28 #endif // !HAVE_LIBMYTHES
29
30 namespace lyx {
31
32 /**
33  * This class provides an interface to whatever thesauri we might support.
34  */
35
36 class Thesaurus
37 {
38 public:
39         ///
40         Thesaurus();
41         ///
42         ~Thesaurus();
43
44         typedef std::map<docstring, std::vector<docstring> > Meanings;
45
46         /**
47          * look up some text in the thesaurus
48          */
49         Meanings lookup(docstring const & text, docstring const & lang);
50         /// check if a thesaurus for a given language \p lang is available
51         bool thesaurusAvailable(docstring const & lang) const;
52
53 private:
54 #ifdef HAVE_LIBMYTHES
55         /// add a thesaurus to the list
56         bool addThesaurus(docstring const & lang);
57
58         typedef std::map<docstring, MyThes *> Thesauri;
59         /// the thesauri
60         Thesauri thes_;
61 #else
62 #ifdef HAVE_LIBAIKSAURUS
63         Aiksaurus * thes_;
64 #endif // HAVE_LIBAIKSAURUS
65 #endif // !HAVE_LIBMYTHES
66 };
67
68 extern Thesaurus thesaurus;
69
70
71 } // namespace lyx
72
73 #endif