]> git.lyx.org Git - lyx.git/blob - src/pspell.h
Support lgathered and rgathered math environments
[lyx.git] / src / pspell.h
1 // -*- C++ -*-
2 /**
3  * \file pspell.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_PSPELL_H
14 #define LYX_PSPELL_H
15
16 #include "SpellBase.h"
17
18 #include <map>
19
20 class PspellManager;
21 class PspellStringEmulation;
22 class PspellCanHaveError;
23 class PspellConfig;
24
25 class BufferParams;
26
27
28 class PSpell : public SpellBase {
29 public:
30         /**
31          * Initialise the spellchecker with the given buffer params and language.
32          */
33         PSpell(BufferParams const & params, std::string const & lang);
34
35         virtual ~PSpell();
36
37         /**
38          * return true if the spellchecker instance still exists
39          * Always true for pspell, 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 SUGGESTED_WORDS result
53         virtual std::string const nextMiss();
54
55         /// give an error message on messy exit
56         virtual lyx::docstring const error();
57
58 private:
59         /// add a manager of the given language
60         void addManager(std::string const & lang);
61
62         struct Manager {
63                 PspellManager * manager;
64                 PspellConfig * config;
65         };
66
67         typedef std::map<std::string, struct Manager> Managers;
68
69         /// the managers
70         Managers managers_;
71
72         /// FIXME
73         PspellStringEmulation * els;
74         /// FIXME
75         PspellCanHaveError * spell_error_object;
76 };
77
78 #endif // LYX_PSPELL_H