]> git.lyx.org Git - lyx.git/blob - src/aspell_local.h
Alfredo's second patch
[lyx.git] / src / aspell_local.h
1 /**
2  * \file aspell_local.h
3  * Copyright 2001 the LyX Team
4  * Read the file COPYING
5  *
6  * \author Kevin Atkinson
7  * \author John Levon <levon@movementarian.org>
8  */
9
10 #ifndef LYX_ASPELL_H
11 #define LYX_ASPELL_H
12
13 #include <map>
14
15 #include "SpellBase.h"
16
17 class AspellSpeller;
18 class AspellStringEnumeration;
19 class AspellCanHaveError;
20 class AspellConfig;
21
22 class BufferParams;
23
24
25 class ASpell : public SpellBase {
26 public:
27         /**
28          * Initialise the spellchecker with the given buffer params and language.
29          */
30         ASpell(BufferParams const & params, string const & lang);
31
32         virtual ~ASpell();
33
34         /**
35          * return true if the spellchecker instance still exists
36          * Always true for aspell, since there is no separate process
37          */
38         virtual bool alive() { return true; }
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 MISSED result
50         virtual string const nextMiss();
51
52         /// give an error message on messy exit
53         virtual string const error();
54
55 private:
56         /// add a speller of the given language
57         void addSpeller(string const & lang);
58
59         struct Speller {
60                 AspellSpeller * speller;
61                 AspellConfig * config;
62         };
63
64         typedef std::map<string, struct 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 #endif // ASPELL_H