File indexing completed on 2024-02-18 05:27:41

0001 /*
0002  *   SPDX-FileCopyrightText: 2008 Montel Laurent <montel@kde.org>
0003  *
0004  *   SPDX-License-Identifier: GPL-2.0-or-later
0005  *
0006  */
0007 #ifndef klinespellchecking_h
0008 #define klinespellchecking_h
0009 
0010 #include <KLineEdit>
0011 
0012 class QAction;
0013 
0014 class KLineSpellChecking : public KLineEdit
0015 {
0016     Q_OBJECT
0017 public:
0018     explicit KLineSpellChecking(QWidget *parent = nullptr);
0019     ~KLineSpellChecking() override;
0020 
0021     void highLightWord(int length, int pos);
0022 
0023 protected:
0024     void contextMenuEvent(QContextMenuEvent *e) override;
0025 
0026 private Q_SLOTS:
0027     void slotCheckSpelling();
0028     void slotSpellCheckDone(const QString &s);
0029     void spellCheckerMisspelling(const QString &text, int pos);
0030     void spellCheckerCorrected(const QString &, int, const QString &);
0031     void spellCheckerFinished();
0032 
0033 private:
0034     QAction *m_spellAction;
0035 };
0036 
0037 #endif