2001-07-29 10:42:11 +00:00
|
|
|
// -*- C++ -*-
|
|
|
|
/**
|
|
|
|
* \file ControlThesaurus.h
|
2002-09-05 15:14:23 +00:00
|
|
|
* This file is part of LyX, the document processor.
|
|
|
|
* Licence details can be found in the file COPYING.
|
2001-07-29 10:42:11 +00:00
|
|
|
*
|
|
|
|
* \author John Levon
|
2002-09-05 14:10:50 +00:00
|
|
|
*
|
|
|
|
* Full author contact details are available in file CREDITS
|
2001-07-29 10:42:11 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
#ifndef CONTROLTHESAURUS_H
|
|
|
|
#define CONTROLTHESAURUS_H
|
|
|
|
|
2003-03-26 12:17:20 +00:00
|
|
|
#include "Dialog.h"
|
2001-07-29 10:42:11 +00:00
|
|
|
#include "Thesaurus.h"
|
2003-03-26 12:17:20 +00:00
|
|
|
#include <vector>
|
2001-07-29 10:42:11 +00:00
|
|
|
|
|
|
|
/** A controller for Thesaurus dialogs.
|
|
|
|
*/
|
2003-03-26 12:17:20 +00:00
|
|
|
class ControlThesaurus : public Dialog::Controller {
|
2001-07-29 10:42:11 +00:00
|
|
|
public:
|
|
|
|
///
|
2003-03-26 12:17:20 +00:00
|
|
|
ControlThesaurus(Dialog &);
|
|
|
|
///
|
|
|
|
virtual bool initialiseParams(string const & data);
|
|
|
|
///
|
|
|
|
virtual void clearParams();
|
|
|
|
///
|
|
|
|
virtual void dispatchParams() {}
|
|
|
|
///
|
|
|
|
virtual bool isBufferDependent() const { return true; }
|
2002-03-21 21:21:28 +00:00
|
|
|
|
2001-07-29 10:42:11 +00:00
|
|
|
/// replace the particular string
|
|
|
|
void replace(string const & newstr);
|
|
|
|
|
2002-01-13 01:46:33 +00:00
|
|
|
/// get meanings
|
|
|
|
Thesaurus::Meanings const & getMeanings(string const & str);
|
2002-03-21 21:21:28 +00:00
|
|
|
|
2001-07-29 10:42:11 +00:00
|
|
|
/// the text
|
2003-03-26 12:17:20 +00:00
|
|
|
string const & text() const { return oldstr_; }
|
2001-07-29 10:42:11 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
/// last string looked up
|
|
|
|
string laststr_;
|
|
|
|
|
|
|
|
/// entries for last string
|
2002-01-13 01:46:33 +00:00
|
|
|
Thesaurus::Meanings meanings_;
|
2001-07-29 10:42:11 +00:00
|
|
|
|
|
|
|
/// original string
|
|
|
|
string oldstr_;
|
|
|
|
|
|
|
|
/// not needed.
|
|
|
|
virtual void apply() {}
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // CONTROLTHESAURUS_H
|