]> git.lyx.org Git - lyx.git/blob - src/ispell.h
more code in the menu backend == less code in the menu frontends; add support for...
[lyx.git] / src / ispell.h
1 // -*- C++ -*-
2 /**
3  * \file ispell.h
4  * Copyright 2002 the LyX Team
5  * Read the file COPYING
6  *
7  * \author unknown
8  */
9
10 #ifndef SP_ISPELL_H
11 #define SP_ISPELL_H
12
13 #include <cstdio>
14
15 #include "SpellBase.h"
16
17 class BufferParams;
18
19 /// i/a spell process-based spellchecker
20 class ISpell : public SpellBase {
21 public:
22         ISpell(BufferParams const & params, string const & lang);
23
24         ~ISpell();
25
26         /// return true if the spellchecker instance still exists
27         virtual bool alive();
28
29         /// clean up on messy exit
30         virtual void cleanUp();
31
32         /// check the given word and return the result
33         virtual enum Result check(WordLangTuple const & word);
34
35         /// finish this spellchecker instance
36         virtual void close();
37
38         /// insert the given word into the personal dictionary
39         virtual void insert(WordLangTuple const & word);
40
41         /// accept the given word temporarily
42         virtual void accept(WordLangTuple const & word);
43
44         /// return the next near miss after a MISSED result
45         virtual string const nextMiss();
46
47         /// give an error message on messy exit
48         virtual string const error();
49
50 private:
51         ///
52         void setError();
53
54         /// instream to communicate with ispell
55         FILE * in;
56         /// outstream to communicate with ispell
57         FILE * out;
58         /// spell error
59         char const * error_;
60         /// the fd of the outgoing pipe
61         int isp_fd;
62
63         // vileness below ... please FIXME
64         /// str ???
65         char * str;
66         /// e ???
67         char * e;
68
69 };
70
71 #endif // ISPELL_H