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