2006-03-05 17:24:44 +00:00
|
|
|
// -*- C++ -*-
|
|
|
|
/**
|
2007-08-31 05:53:55 +00:00
|
|
|
* \file GuiSpellchecker.h
|
2006-03-05 17:24:44 +00:00
|
|
|
* This file is part of LyX, the document processor.
|
|
|
|
* Licence details can be found in the file COPYING.
|
|
|
|
*
|
|
|
|
* \author John Levon
|
|
|
|
* \author Kalle Dalheimer
|
|
|
|
*
|
|
|
|
* Full author contact details are available in file CREDITS.
|
|
|
|
*/
|
|
|
|
|
2007-08-31 22:16:11 +00:00
|
|
|
#ifndef GUISPELLCHECKER_H
|
|
|
|
#define GUISPELLCHECKER_H
|
2006-03-05 17:24:44 +00:00
|
|
|
|
2007-08-31 05:53:55 +00:00
|
|
|
#include "GuiDialogView.h"
|
2007-08-31 22:16:11 +00:00
|
|
|
#include "ControlSpellchecker.h"
|
2007-08-11 15:48:15 +00:00
|
|
|
#include "ui_SpellcheckerUi.h"
|
2007-04-24 15:32:14 +00:00
|
|
|
|
|
|
|
#include <QDialog>
|
|
|
|
|
|
|
|
class QListWidgetItem;
|
2006-03-05 17:24:44 +00:00
|
|
|
|
2007-08-31 22:16:11 +00:00
|
|
|
|
2006-03-05 17:24:44 +00:00
|
|
|
namespace lyx {
|
|
|
|
namespace frontend {
|
|
|
|
|
2007-08-31 05:53:55 +00:00
|
|
|
class GuiSpellchecker;
|
2007-04-24 15:32:14 +00:00
|
|
|
|
2007-08-31 05:53:55 +00:00
|
|
|
class GuiSpellcheckerDialog: public QDialog, public Ui::SpellcheckerUi {
|
2007-04-24 15:32:14 +00:00
|
|
|
Q_OBJECT
|
|
|
|
public:
|
2007-08-31 05:53:55 +00:00
|
|
|
GuiSpellcheckerDialog(GuiSpellchecker * form);
|
2007-04-24 15:32:14 +00:00
|
|
|
public Q_SLOTS:
|
|
|
|
virtual void suggestionChanged(QListWidgetItem *);
|
|
|
|
|
|
|
|
protected Q_SLOTS:
|
|
|
|
virtual void acceptClicked();
|
|
|
|
virtual void addClicked();
|
|
|
|
virtual void replaceClicked();
|
|
|
|
virtual void ignoreClicked();
|
|
|
|
virtual void replaceChanged(const QString &);
|
|
|
|
virtual void reject();
|
|
|
|
|
|
|
|
protected:
|
|
|
|
virtual void closeEvent(QCloseEvent * e);
|
|
|
|
|
|
|
|
private:
|
2007-08-31 05:53:55 +00:00
|
|
|
GuiSpellchecker * form_;
|
2007-04-24 15:32:14 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2007-08-31 22:16:11 +00:00
|
|
|
class GuiSpellchecker : public GuiView<GuiSpellcheckerDialog>
|
2006-03-05 17:24:44 +00:00
|
|
|
{
|
|
|
|
public:
|
2007-08-31 05:53:55 +00:00
|
|
|
friend class GuiSpellcheckerDialog;
|
2006-03-05 17:24:44 +00:00
|
|
|
|
2007-09-03 05:59:32 +00:00
|
|
|
GuiSpellchecker(GuiDialog &);
|
2006-03-05 17:24:44 +00:00
|
|
|
|
|
|
|
/// update from controller
|
|
|
|
void partialUpdate(int id);
|
2007-08-31 22:16:11 +00:00
|
|
|
/// parent controller
|
|
|
|
ControlSpellchecker & controller()
|
|
|
|
{ return static_cast<ControlSpellchecker &>(this->getController()); }
|
|
|
|
/// parent controller
|
|
|
|
ControlSpellchecker const & controller() const
|
|
|
|
{ return static_cast<ControlSpellchecker const &>(this->getController()); }
|
2006-03-05 17:24:44 +00:00
|
|
|
private:
|
|
|
|
void accept();
|
|
|
|
void add();
|
|
|
|
void ignore();
|
|
|
|
void replace();
|
|
|
|
|
|
|
|
/// Apply changes
|
|
|
|
virtual void apply() {}
|
|
|
|
///
|
|
|
|
virtual void update_contents();
|
|
|
|
/// build the dialog
|
|
|
|
virtual void build_dialog();
|
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace frontend
|
|
|
|
} // namespace lyx
|
|
|
|
|
2007-08-31 22:16:11 +00:00
|
|
|
#endif // GUISPELLCHECKER_H
|