1 | /* |
---|---|
2 | * backgroundchecker_p.h |
3 | * |
4 | * SPDX-FileCopyrightText: 2009 Jakub Stachowski <qbast@go2.pl> |
5 | * |
6 | * SPDX-License-Identifier: LGPL-2.1-or-later |
7 | */ |
8 | #ifndef SONNET_BACKGROUNDCHECKER_P_H |
9 | #define SONNET_BACKGROUNDCHECKER_P_H |
10 | |
11 | #include "backgroundchecker.h" |
12 | #include "languagefilter_p.h" |
13 | #include "speller.h" |
14 | #include "tokenizer_p.h" |
15 | |
16 | #include <QObject> |
17 | |
18 | namespace Sonnet |
19 | { |
20 | |
21 | class BackgroundCheckerPrivate : public QObject |
22 | { |
23 | Q_OBJECT |
24 | public: |
25 | BackgroundCheckerPrivate() |
26 | : mainTokenizer(new SentenceTokenizer) |
27 | , sentenceOffset(-1) |
28 | { |
29 | autoDetectLanguageDisabled = false; |
30 | } |
31 | |
32 | void start(); |
33 | void continueChecking(); |
34 | |
35 | LanguageFilter mainTokenizer; |
36 | WordTokenizer words; |
37 | Token lastMisspelled; |
38 | Speller currentDict; |
39 | int sentenceOffset; |
40 | bool autoDetectLanguageDisabled; |
41 | |
42 | private Q_SLOTS: |
43 | void checkNext(); |
44 | Q_SIGNALS: |
45 | void misspelling(const QString &, int); |
46 | void done(); |
47 | }; |
48 | |
49 | } |
50 | |
51 | #endif |
52 |