summaryrefslogtreecommitdiffstats
path: root/scribus/plugins/tools/hunspellcheck/hunspelldialog.h
blob: 1a29661ed3d224984750a6b094412bf5cc1e886e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#ifndef HUNSPELLDIALOG_H
#define HUNSPELLDIALOG_H

#include <QDialog>
#include <QList>
#include <QStringList>
#include <QWidget>

#include <hunspell/hunspell.hxx>

#include "pluginapi.h"
#include "hunspellpluginstructs.h"
#include "scribusdoc.h"
#include "text/storytext.h"

#include "ui_hunspelldialogbase.h"

class PLUGIN_API HunspellDialog : public QDialog, private Ui::HunspellDialogBase
{
	Q_OBJECT

	public:
		HunspellDialog(QWidget* parent, ScribusDoc *doc, StoryText* iText);
		~HunspellDialog() {};
		void set(QMap<QString, QString>* dictionaryMap, QMap<QString, Hunspell*> *hspellerMap, QList<WordsFound>* wfList);
		bool docChanged() {return m_docChanged;}
		void updateSuggestions(QStringList& newSuggestions);

	public slots:
		void goToNextWord(int i=-1);
		void ignoreAllWords();
		void changeWord();
		void changeAllWords();
		void replaceWord(int i);
		void languageComboChanged(const QString &);
		void setLanguageCombo(const QString &newLangAbbrev);

	private:
		ScribusDoc* m_doc;
		StoryText* m_iText;
		QMap<QString, QString>* m_dictionaryMap;
		QMap<QString, Hunspell*> *m_hspellerMap;
		QList<WordsFound>* m_wfList;
		WordsFound currWF;
		int wfListIndex;
		bool m_docChanged;
		bool m_returnToDefaultLang;
		int m_primaryLangIndex;
};

#endif // HUNSPELLDIALOG_H