]> git.lyx.org Git - lyx.git/blob - src/SpellBase.h
0120a0bb075ff9fb129b8f7093f832a521099403
[lyx.git] / src / SpellBase.h
1 // -*- C++ -*-
2 /**
3  * \file SpellBase.h
4  * Copyright 2002 the LyX Team
5  * Read the file COPYING
6  *
7  * \author unknown
8  */
9
10 #ifndef SPELL_BASE_H
11 #define SPELL_BASE_H
12
13 #include "LString.h" // can't forward declare...
14
15 class BufferParams;
16
17 /**
18  * Base class of all spell checker implementations.
19  */
20 class SpellBase {
21 public:
22
23         /// the result from checking a single word
24         enum Result  {
25                 OK = 1, //< word is correct
26                 ROOT, //< root of given word was found
27                 COMPOUNDWORD, //< word found through compound formation
28                 UNKNOWN, //< word not found
29                 MISSED, //< not found, with suggestions
30                 IGNORE //< number of other ignored "word"
31         };
32
33         virtual ~SpellBase() {}
34
35         /// return true if the spellchecker instance still exists
36         virtual bool alive() = 0;
37
38         /// clean up on messy exit
39         virtual void cleanUp() = 0;
40
41         /// check the given word and return the result
42         virtual enum Result check(string const &) = 0;
43
44         /// finish this spellchecker instance
45         virtual void close() = 0;
46
47         /// insert the given word into the personal dictionary
48         virtual void insert(string const &) = 0;
49
50         /// accept the given word temporarily
51         virtual void accept(string const &) = 0;
52
53         /// return the next near miss after a MISSED result
54         virtual string const nextMiss() = 0;
55  
56         /// give an error message on messy exit 
57         virtual string const error() = 0;
58
59 };
60
61 #endif // SPELL_BASE_H