]> git.lyx.org Git - lyx.git/blob - src/PSpell.h
Fixed some lines that were too long. It compiled afterwards.
[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
21 class PspellManager;
22 class PspellStringEmulation;
23 class PspellCanHaveError;
24 class PspellConfig;
25
26 namespace lyx {
27
28 class BufferParams;
29
30
31 class PSpell : public SpellBase {
32 public:
33         /**
34          * Initialise the spellchecker with the given buffer params and language.
35          */
36         PSpell(BufferParams const & params, std::string const & lang);
37
38         virtual ~PSpell();
39
40         /**
41          * return true if the spellchecker instance still exists
42          * Always true for pspell, since there is no separate process
43          */
44         virtual bool alive() { return true; }
45
46         /// check the given word and return the result
47         virtual enum Result check(WordLangTuple const &);
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 SUGGESTED_WORDS result
56         virtual docstring const nextMiss();
57
58         /// give an error message on messy exit
59         virtual docstring const error();
60
61 private:
62         /// add a manager of the given language
63         void addManager(std::string const & lang);
64
65         struct Manager {
66                 PspellManager * manager;
67                 PspellConfig * config;
68         };
69
70         typedef std::map<std::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
82 } // namespace lyx
83
84 #endif // LYX_PSPELL_H