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
|
|
|
*
|
2003-08-23 00:17:00 +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"
|
|
|
|
|
|
|
|
/** 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 &);
|
|
|
|
///
|
2003-10-06 15:43:21 +00:00
|
|
|
virtual bool initialiseParams(std::string const & data);
|
2003-03-26 12:17:20 +00:00
|
|
|
///
|
|
|
|
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
|
2003-10-06 15:43:21 +00:00
|
|
|
void replace(std::string const & newstr);
|
2001-07-29 10:42:11 +00:00
|
|
|
|
2002-01-13 01:46:33 +00:00
|
|
|
/// get meanings
|
2003-10-06 15:43:21 +00:00
|
|
|
Thesaurus::Meanings const & getMeanings(std::string const & str);
|
2002-03-21 21:21:28 +00:00
|
|
|
|
2001-07-29 10:42:11 +00:00
|
|
|
/// the text
|
2003-10-06 15:43:21 +00:00
|
|
|
std::string const & text() const { return oldstr_; }
|
2001-07-29 10:42:11 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
/// last string looked up
|
2003-10-06 15:43:21 +00:00
|
|
|
std::string laststr_;
|
2001-07-29 10:42:11 +00:00
|
|
|
|
|
|
|
/// 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
|
2003-10-06 15:43:21 +00:00
|
|
|
std::string oldstr_;
|
2001-07-29 10:42:11 +00:00
|
|
|
|
|
|
|
/// not needed.
|
|
|
|
virtual void apply() {}
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // CONTROLTHESAURUS_H
|