mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-08 10:51:03 +00:00
a6444784dc
- bformat(): contributed by Georg Beaum - Alert::XXX - error(): in SpellBase, ispell, psell, aspell, buffer, etc. - message(), message signal - displayMessage(), setMessage, - ErrorItems - prettyName() - makeDisplayPath() and maybe some more... - etc... git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@14970 a592a061-630c-0410-9148-cb99ea01b6c8
90 lines
1.8 KiB
C++
90 lines
1.8 KiB
C++
// -*- C++ -*-
|
|
/**
|
|
* \file ispell.h
|
|
* This file is part of LyX, the document processor.
|
|
* Licence details can be found in the file COPYING.
|
|
*
|
|
* \author unknown
|
|
* \author John Levon
|
|
*
|
|
* Full author contact details are available in file CREDITS.
|
|
*/
|
|
|
|
#ifndef SP_ISPELL_H
|
|
#define SP_ISPELL_H
|
|
|
|
#include "SpellBase.h"
|
|
|
|
#include "support/docstring.h"
|
|
|
|
#include <boost/scoped_ptr.hpp>
|
|
|
|
#include <cstdio>
|
|
|
|
class BufferParams;
|
|
namespace lyx {
|
|
namespace support {
|
|
class ForkedProcess;
|
|
}
|
|
}
|
|
|
|
/// i/a spell process-based spellchecker
|
|
class ISpell : public SpellBase {
|
|
public:
|
|
ISpell(BufferParams const & params, std::string const & lang);
|
|
|
|
~ISpell();
|
|
|
|
/// return true if the spellchecker instance still exists
|
|
virtual bool alive();
|
|
|
|
/// check the given word and return the result
|
|
virtual enum Result check(WordLangTuple const & word);
|
|
|
|
/// insert the given word into the personal dictionary
|
|
virtual void insert(WordLangTuple const & word);
|
|
|
|
/// accept the given word temporarily
|
|
virtual void accept(WordLangTuple const & word);
|
|
|
|
/// return the next near miss after a SUGGESTED_WORDS result
|
|
virtual std::string const nextMiss();
|
|
|
|
/// give an error message on messy exit
|
|
virtual lyx::docstring const error();
|
|
|
|
private:
|
|
/// read some data. Returns true on an error. Sets err_read
|
|
/// to true if the data was from stderr.
|
|
bool select(bool & err_read);
|
|
|
|
/// instream to communicate with ispell
|
|
FILE * in;
|
|
/// outstream to communicate with ispell
|
|
FILE * out;
|
|
/// errstream for ispell
|
|
FILE * inerr;
|
|
|
|
/// pipe fds
|
|
int pipein[2];
|
|
int pipeout[2];
|
|
int pipeerr[2];
|
|
|
|
/// buffer for reading
|
|
char buf[BUFSIZ];
|
|
|
|
/// spell error
|
|
lyx::docstring error_;
|
|
|
|
boost::scoped_ptr<lyx::support::ForkedProcess> child_;
|
|
|
|
// vileness below ... please FIXME
|
|
/// str ???
|
|
char * str;
|
|
/// e ???
|
|
char * e;
|
|
|
|
};
|
|
|
|
#endif // ISPELL_H
|