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