]> git.lyx.org Git - lyx.git/blob - src/WordLangTuple.h
Avoid full metrics computation with Update:FitCursor
[lyx.git] / src / WordLangTuple.h
1 // -*- C++ -*-
2 /**
3  * \file WordLangTuple.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 WORD_LANG_TUPLE_H
13 #define WORD_LANG_TUPLE_H
14
15 #include "Language.h"
16
17 #include "support/docstring.h"
18
19 #include <vector>
20
21
22 namespace lyx {
23
24
25 /**
26  * A word and its given language.
27  * This is used for spellchecking
28  * and thesaurus.
29  */
30 class WordLangTuple {
31 public:
32         WordLangTuple() : lang_(0) {}
33
34         WordLangTuple(docstring const & w, Language const * l)
35                 : word_(w), lang_(l)
36         {}
37
38         /// return the word
39         docstring const & word() const {
40                 return word_;
41         }
42
43         /// return its language code
44         Language const * lang() const {
45                 return lang_;
46         }
47
48 private:
49         /// the word
50         docstring word_;
51         /// language of word
52         Language const * lang_;
53 };
54
55
56 typedef std::vector<WordLangTuple> WordLangTable;
57
58
59 } // namespace lyx
60
61 #endif // WORD_LANG_TUPLE_H