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