]> git.lyx.org Git - lyx.git/blob - src/pspell.h
reverse last change
[lyx.git] / src / pspell.h
1 /**
2  * \file pspell.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_PSPELL_H
11 #define LYX_PSPELL_H
12
13 #include <map>
14
15 #include "SpellBase.h"
16
17 class PspellManager;
18 class PspellStringEmulation;
19 class PspellCanHaveError;
20 class PspellConfig;
21
22 class BufferParams;
23
24
25 class PSpell : public SpellBase {
26 public:
27         /**
28          * Initialise the spellchecker with the given buffer params and language.
29          */
30         PSpell(BufferParams const & params, string const & lang);
31
32         virtual ~PSpell();
33
34         /**
35          * return true if the spellchecker instance still exists
36          * Always true for pspell, since there is no separate process
37          */
38         virtual bool alive() { return true; }
39
40         /// clean up on messy exit
41         virtual void cleanUp();
42
43         /// check the given word and return the result
44         virtual enum Result check(WordLangTuple const &);
45
46         /// finish this spellchecker instance
47         virtual void close();
48
49         /// insert the given word into the personal dictionary
50         virtual void insert(WordLangTuple const &);
51
52         /// accept the given word temporarily
53         virtual void accept(WordLangTuple const &);
54
55         /// return the next near miss after a MISSED result
56         virtual string const nextMiss();
57
58         /// give an error message on messy exit
59         virtual string const error();
60
61 private:
62         /// add a manager of the given language
63         void addManager(string const & lang);
64
65         struct Manager {
66                 PspellManager * manager;
67                 PspellConfig * config;
68         };
69
70         typedef std::map<string, struct Manager> Managers;
71
72         /// the managers
73         Managers managers_;
74
75         /// FIXME
76         PspellStringEmulation * els;
77         /// FIXME
78         PspellCanHaveError * spell_error_object;
79 };
80
81 #endif // PSPELL_H