whitespace.
[lyx.git] / src / ASpell_local.h
blob09fb17e8cd5541b217231874b35b673cffe72caa
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.
7 * \author Kevin Atkinson
8 * \author John Levon
10 * Full author contact details are available in file CREDITS.
13 #ifndef LYX_ASPELL_H
14 #define LYX_ASPELL_H
16 #include "SpellBase.h"
18 #include <map>
19 #include <string>
21 struct AspellSpeller;
22 struct AspellStringEnumeration;
23 struct AspellCanHaveError;
24 struct AspellConfig;
26 namespace lyx {
28 class BufferParams;
31 class ASpell : public SpellBase {
32 public:
33 /**
34 * Initialise the spellchecker with the given buffer params and language.
36 ASpell(BufferParams const & params, std::string const & lang);
38 virtual ~ASpell();
40 /**
41 * return true if the spellchecker instance still exists
42 * Always true for aspell, since there is no separate process
44 virtual bool alive() { return true; }
46 /// check the given word and return the result
47 virtual enum Result check(WordLangTuple const &);
49 /// insert the given word into the personal dictionary
50 virtual void insert(WordLangTuple const &);
52 /// accept the given word temporarily
53 virtual void accept(WordLangTuple const &);
55 /// return the next near miss after a SUGGESTED_WORDS result
56 virtual docstring const nextMiss();
58 /// give an error message on messy exit
59 virtual docstring const error();
61 private:
62 /// add a speller of the given language
63 void addSpeller(std::string const & lang);
65 struct Speller {
66 AspellSpeller * speller;
67 AspellConfig * config;
70 typedef std::map<std::string, Speller> Spellers;
72 /// the spellers
73 Spellers spellers_;
75 /// FIXME
76 AspellStringEnumeration * els;
77 /// FIXME
78 AspellCanHaveError * spell_error_object;
82 } // namespace lyx
84 #endif // LYX_ASPELL_H