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
|
2007-10-06 19:51:03 +00:00
|
|
|
* \author Edwin Leuven
|
2009-04-19 08:57:43 +00:00
|
|
|
* \author Abdelrazak Younes
|
2006-03-05 17:24:44 +00:00
|
|
|
*
|
|
|
|
* 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
|
|
|
|
2009-04-19 08:57:43 +00:00
|
|
|
#include "DockView.h"
|
2007-04-24 15:32:14 +00:00
|
|
|
|
|
|
|
class QListWidgetItem;
|
2006-03-05 17:24:44 +00:00
|
|
|
|
|
|
|
namespace lyx {
|
2007-10-06 19:51:03 +00:00
|
|
|
|
2009-04-04 16:40:47 +00:00
|
|
|
class docstring_list;
|
2007-10-06 19:51:03 +00:00
|
|
|
|
2006-03-05 17:24:44 +00:00
|
|
|
namespace frontend {
|
|
|
|
|
2009-04-19 08:57:43 +00:00
|
|
|
class GuiSpellchecker : public DockView
|
2007-09-05 20:33:29 +00:00
|
|
|
{
|
2007-04-24 15:32:14 +00:00
|
|
|
Q_OBJECT
|
2007-09-05 20:33:29 +00:00
|
|
|
|
2007-04-24 15:32:14 +00:00
|
|
|
public:
|
2009-04-19 08:57:43 +00:00
|
|
|
GuiSpellchecker(GuiView & parent);
|
|
|
|
~GuiSpellchecker();
|
2007-04-24 15:32:14 +00:00
|
|
|
|
2007-09-05 20:33:29 +00:00
|
|
|
private Q_SLOTS:
|
2009-04-19 08:57:43 +00:00
|
|
|
void on_closePB_clicked();
|
2009-07-04 17:15:27 +00:00
|
|
|
void on_findNextPB_clicked();
|
|
|
|
void on_replaceAllPB_clicked();
|
2009-07-18 13:46:05 +00:00
|
|
|
void on_suggestionsLW_itemClicked(QListWidgetItem *);
|
2009-04-21 21:06:21 +00:00
|
|
|
void on_replaceCO_highlighted(const QString & str);
|
2010-02-09 13:01:37 +00:00
|
|
|
void on_languageCO_activated(int index);
|
2009-04-21 21:06:21 +00:00
|
|
|
void on_ignoreAllPB_clicked();
|
2009-04-19 08:57:43 +00:00
|
|
|
void on_addPB_clicked();
|
|
|
|
void on_ignorePB_clicked();
|
|
|
|
void on_replacePB_clicked();
|
2007-04-24 15:32:14 +00:00
|
|
|
|
|
|
|
private:
|
2006-03-05 17:24:44 +00:00
|
|
|
/// update from controller
|
2009-04-04 16:40:47 +00:00
|
|
|
void updateSuggestions(docstring_list & words);
|
2007-10-06 19:51:03 +00:00
|
|
|
|
2009-04-19 08:57:43 +00:00
|
|
|
///{
|
|
|
|
void updateView();
|
2007-10-06 19:51:03 +00:00
|
|
|
bool initialiseParams(std::string const & data);
|
2009-04-04 17:25:14 +00:00
|
|
|
void clearParams() {}
|
2007-10-06 19:51:03 +00:00
|
|
|
void dispatchParams() {}
|
|
|
|
bool isBufferDependent() const { return true; }
|
Fix bug #6451 (last part): Crash when interacting with buffer-dependent dialog with no buffer open.
- First, the comment for isBufferDependent is corrected. It seems that the actual use of this function differs from the comment. As the comment said, I decided to close all dialogs that were buffer dependent, but this didn't seem to be correct for the view source pan, the outliner, and find-and-replace.
- Second, the dialogs that are buffer dependent are now closed, but dockviews are not, except for the spellchecker pane, which really depends on an open buffer, but I can't test that.
So, please test whether the spellchecker dockviewed window behaves as one expects.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@34291 a592a061-630c-0410-9148-cb99ea01b6c8
2010-04-26 02:12:10 +00:00
|
|
|
bool needBufferOpen() const { return true; }
|
2009-04-19 08:57:43 +00:00
|
|
|
///}
|
2007-10-06 19:51:03 +00:00
|
|
|
|
|
|
|
/// check text until next misspelled/unknown word
|
|
|
|
/// returns true when finished
|
|
|
|
void check();
|
|
|
|
/// show count of checked words at normal exit
|
|
|
|
void showSummary();
|
|
|
|
|
2010-01-17 12:27:44 +00:00
|
|
|
bool eventFilter(QObject *obj, QEvent *event);
|
|
|
|
|
2009-04-19 08:57:43 +00:00
|
|
|
struct Private;
|
|
|
|
Private * const d;
|
2006-03-05 17:24:44 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace frontend
|
|
|
|
} // namespace lyx
|
|
|
|
|
2007-08-31 22:16:11 +00:00
|
|
|
#endif // GUISPELLCHECKER_H
|