1 /*
2  * Copyright (C) Pedram Pourang (aka Tsu Jan) 2019 <tsujan2000@gmail.com>
3  *
4  * FeatherPad is free software: you can redistribute it and/or modify it
5  * under the terms of the GNU General Public License as published by the
6  * Free Software Foundation, either version 3 of the License, or
7  * (at your option) any later version.
8  *
9  * FeatherPad is distributed in the hope that it will be useful, but
10  * WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
12  * See the GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License along
15  * with this program.  If not, see <http://www.gnu.org/licenses/>.
16  *
17  * @license GPL-3.0+ <https://spdx.org/licenses/GPL-3.0+.html>
18  */
19 
20 #ifndef SPELLDIALOG_H
21 #define SPELLDIALOG_H
22 
23 #include <QDialog>
24 
25 namespace FeatherPad {
26 
27 class SpellChecker;
28 
29 namespace Ui {
30 class SpellDialog;
31 }
32 
33 class SpellDialog : public QDialog
34 {
35     Q_OBJECT
36 
37 public:
38     enum SpellAction {CorrectOnce, IgnoreOnce, CorrectAll, IgnoreAll, AddToDict};
39 
40     explicit SpellDialog (SpellChecker *spellChecker, const QString &word,
41                           bool correction, QWidget *parent = nullptr);
42     ~SpellDialog();
43 
spellChecker()44     SpellChecker * spellChecker() const {
45         return spellChecker_;
46     }
47     QString replacement() const;
48     void checkWord(const QString &word);
49 
50 signals:
51     void spellChecked (int result);
52 
53 private:
54     Ui::SpellDialog *ui;
55     SpellChecker *spellChecker_;
56 };
57 
58 }
59 
60 #endif // SPELLDIALOG_H
61