]> git.lyx.org Git - lyx.git/blob - src/SpellBase.h
clean up a bit
[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 class WordLangTuple;
17
18 /**
19  * Base class of all spell checker implementations.
20  */
21 class SpellBase {
22 public:
23
24         /// the result from checking a single word
25         enum Result  {
26                 OK = 1, //< word is correct
27                 ROOT, //< root of given word was found
28                 COMPOUNDWORD, //< word found through compound formation
29                 UNKNOWN, //< word not found
30                 MISSED, //< not found, with suggestions
31                 IGNORE //< number of other ignored "word"
32         };
33
34         virtual ~SpellBase() {}
35
36         /// return true if the spellchecker instance still exists
37         virtual bool alive() = 0;
38
39         /// clean up on messy exit
40         virtual void cleanUp() = 0;
41
42         /// check the given word of the given lang code and return the result
43         virtual enum Result check(WordLangTuple const &) = 0;
44
45         /// finish this spellchecker instance
46         virtual void close() = 0;
47
48         /// insert the given word into the personal dictionary
49         virtual void insert(WordLangTuple const &) = 0;
50
51         /// accept the given word temporarily
52         virtual void accept(WordLangTuple const &) = 0;
53
54         /// return the next near miss after a MISSED result
55         virtual string const nextMiss() = 0;
56
57         /// give an error message on messy exit
58         virtual string const error() = 0;
59
60 };
61
62 #endif // SPELL_BASE_H