]> git.lyx.org Git - lyx.git/blob - src/SpellBase.h
remove obsolete references to saveSelection
[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 "support/docstring.h"
17
18
19 namespace lyx {
20
21 class BufferParams;
22 class WordLangTuple;
23
24 /**
25  * Base class of all spellchecker implementations.
26  * The class can be instantiated but will have no functionality.
27  */
28 class SpellBase {
29 public:
30
31         /// the result from checking a single word
32         enum Result  {
33                 /// word is correct
34                 OK = 1,
35                 /// root of given word was found
36                 ROOT,
37                 /// word found through compound formation
38                 COMPOUND_WORD,
39                 /// word not found
40                 UNKNOWN_WORD,
41                 /// not found, with suggestions
42                 SUGGESTED_WORDS,
43                 /// number of other ignored "word"
44                 IGNORED_WORD
45         };
46
47         virtual ~SpellBase() {}
48
49         /// return true if the spellchecker instance still exists
50         virtual bool alive();
51
52         /// check the given word of the given lang code and return the result
53         virtual enum Result check(WordLangTuple const &);
54
55         /// insert the given word into the personal dictionary
56         virtual void insert(WordLangTuple const &);
57
58         /// accept the given word temporarily
59         virtual void accept(WordLangTuple const &);
60
61         /// return the next near miss after a SUGGESTED_WORDS result
62         virtual docstring const nextMiss();
63
64         /// give an error message on messy exit
65         virtual docstring const error();
66 };
67
68
69 } // namespace lyx
70
71 #endif // SPELL_BASE_H