]> git.lyx.org Git - lyx.git/blob - src/aspell_local.h
hopefully fix tex2lyx linking.
[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 "SpellBase.h"
17
18 #include "support/docstring.h"
19
20 #include <map>
21
22
23 class AspellSpeller;
24 class AspellStringEnumeration;
25 class AspellCanHaveError;
26 class AspellConfig;
27
28 namespace lyx {
29
30 class BufferParams;
31
32
33 class ASpell : public SpellBase {
34 public:
35         /**
36          * Initialise the spellchecker with the given buffer params and language.
37          */
38         ASpell(BufferParams const & params, std::string const & lang);
39
40         virtual ~ASpell();
41
42         /**
43          * return true if the spellchecker instance still exists
44          * Always true for aspell, since there is no separate process
45          */
46         virtual bool alive() { return true; }
47
48         /// check the given word and return the result
49         virtual enum Result check(WordLangTuple const &);
50
51         /// insert the given word into the personal dictionary
52         virtual void insert(WordLangTuple const &);
53
54         /// accept the given word temporarily
55         virtual void accept(WordLangTuple const &);
56
57         /// return the next near miss after a SUGGESTED_WORDS result
58         virtual std::string const nextMiss();
59
60         /// give an error message on messy exit
61         virtual docstring const error();
62
63 private:
64         /// add a speller of the given language
65         void addSpeller(std::string const & lang);
66
67         struct Speller {
68                 AspellSpeller * speller;
69                 AspellConfig * config;
70         };
71
72         typedef std::map<std::string, Speller> Spellers;
73
74         /// the spellers
75         Spellers spellers_;
76
77         /// FIXME
78         AspellStringEnumeration * els;
79         /// FIXME
80         AspellCanHaveError * spell_error_object;
81 };
82
83
84 } // namespace lyx
85
86 #endif // LYX_ASPELL_H