]> git.lyx.org Git - lyx.git/blob - src/SpellBase.h
compilation fix
[lyx.git] / src / SpellBase.h
1 // -*- C++ -*-
2 /**
3  * \file SpellBase.h
4  * This file is part of LyX, the document processor.
5  * Licence details can be found in the file COPYING.
6  *
7  * \author unknown
8  * \author John Levon
9  *
10  * Full author contact details are available in file CREDITS.
11  */
12
13 #ifndef SPELL_BASE_H
14 #define SPELL_BASE_H
15
16 #include <string>
17
18 class BufferParams;
19 class WordLangTuple;
20
21 /**
22  * Base class of all spell checker implementations.
23  */
24 class SpellBase {
25 public:
26
27         /// the result from checking a single word
28         enum Result  {
29                 /// word is correct
30                 OK = 1,
31                 /// root of given word was found
32                 ROOT,
33                 /// word found through compound formation
34                 COMPOUND_WORD,
35                 /// word not found
36                 UNKNOWN_WORD,
37                 /// not found, with suggestions
38                 SUGGESTED_WORDS,
39                 /// number of other ignored "word"
40                 IGNORED_WORD
41         };
42
43         virtual ~SpellBase() {}
44
45         /// return true if the spellchecker instance still exists
46         virtual bool alive() = 0;
47
48         /// check the given word of the given lang code and return the result
49         virtual enum Result check(WordLangTuple const &) = 0;
50
51         /// insert the given word into the personal dictionary
52         virtual void insert(WordLangTuple const &) = 0;
53
54         /// accept the given word temporarily
55         virtual void accept(WordLangTuple const &) = 0;
56
57         /// return the next near miss after a SUGGESTED_WORDS result
58         virtual std::string const nextMiss() = 0;
59
60         /// give an error message on messy exit
61         virtual std::string const error() = 0;
62
63 };
64
65 #endif // SPELL_BASE_H