]> git.lyx.org Git - lyx.git/blob - src/Thesaurus.h
Fix for mingw/cygwin
[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 public:
38         ///
39         Thesaurus();
40         ///
41         ~Thesaurus();
42
43         typedef std::map<docstring, std::vector<docstring> > Meanings;
44
45         /**
46          * look up some text in the thesaurus
47          */
48         Meanings lookup(docstring const & text, docstring const & lang);
49         /// check if a thesaurus for a given language \p lang is available
50         bool thesaurusAvailable(docstring const & lang) const;
51
52 private:
53 #ifdef HAVE_LIBMYTHES
54         /// add a thesaurus to the list
55         bool addThesaurus(docstring const & lang);
56
57         typedef std::map<docstring, MyThes *> Thesauri;
58         /// the thesauri
59         Thesauri thes_;
60 #else
61 #ifdef HAVE_LIBAIKSAURUS
62         Aiksaurus * thes_;
63 #endif // HAVE_LIBAIKSAURUS
64 #endif // !HAVE_LIBMYTHES
65 };
66
67 extern Thesaurus thesaurus;
68
69
70 } // namespace lyx
71
72 #endif