]> git.lyx.org Git - lyx.git/blob - src/ASpell_local.h
* rename SpellBase to SpellChecker
[lyx.git] / src / ASpell_local.h
1 // -*- C++ -*-
2 /**
3  * \file ASpell_local.h
4  * This file is part of LyX, the document processor.
5  * Licence details can be found in the file COPYING.
6  *
7  * \author Kevin Atkinson
8  * \author John Levon
9  *
10  * Full author contact details are available in file CREDITS.
11  */
12
13 #ifndef LYX_ASPELL_H
14 #define LYX_ASPELL_H
15
16 #include "SpellChecker.h"
17
18 #include <map>
19 #include <string>
20
21 struct AspellSpeller;
22 struct AspellStringEnumeration;
23 struct AspellCanHaveError;
24 struct AspellConfig;
25
26 namespace lyx {
27
28 class BufferParams;
29
30
31 class ASpell : public SpellChecker {
32 public:
33         /**
34          * Initialise the spellchecker with the given buffer params and language.
35          */
36         ASpell(BufferParams const & params, std::string const & lang);
37
38         virtual ~ASpell();
39
40         /// check the given word and return the result
41         virtual enum Result check(WordLangTuple const &);
42
43         /// insert the given word into the personal dictionary
44         virtual void insert(WordLangTuple const &);
45
46         /// accept the given word temporarily
47         virtual void accept(WordLangTuple const &);
48
49         /// return the next near miss after a SUGGESTED_WORDS result
50         virtual docstring const nextMiss();
51
52         /// give an error message on messy exit
53         virtual docstring const error();
54
55 private:
56         /// add a speller of the given language
57         void addSpeller(std::string const & lang);
58
59         struct Speller {
60                 AspellSpeller * speller;
61                 AspellConfig * config;
62         };
63
64         typedef std::map<std::string, Speller> Spellers;
65
66         /// the spellers
67         Spellers spellers_;
68
69         /// FIXME
70         AspellStringEnumeration * els;
71         /// FIXME
72         AspellCanHaveError * spell_error_object;
73 };
74
75
76 } // namespace lyx
77
78 #endif // LYX_ASPELL_H