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