| 1 | /* |
| 2 | SPDX-FileCopyrightText: 2008-2009 Michel Ludwig <michel.ludwig@kdemail.net> |
| 3 | |
| 4 | SPDX-License-Identifier: LGPL-2.0-or-later |
| 5 | */ |
| 6 | |
| 7 | #ifndef SPELLINGMENU_H |
| 8 | #define |
| 9 | |
| 10 | #include <QObject> |
| 11 | |
| 12 | #include <KActionCollection> |
| 13 | #include <KActionMenu> |
| 14 | #include <ktexteditor/movingrange.h> |
| 15 | #include <ktexteditor/movingrangefeedback.h> |
| 16 | #include <ktexteditor/range.h> |
| 17 | #include <ktexteditor/view.h> |
| 18 | |
| 19 | namespace KTextEditor |
| 20 | { |
| 21 | class ViewPrivate; |
| 22 | } |
| 23 | class KateOnTheFlyChecker; |
| 24 | |
| 25 | class : public QObject |
| 26 | { |
| 27 | Q_OBJECT |
| 28 | friend class KateOnTheFlyChecker; |
| 29 | |
| 30 | public: |
| 31 | explicit (KTextEditor::ViewPrivate *view); |
| 32 | () override; |
| 33 | |
| 34 | bool () const; |
| 35 | bool () const; |
| 36 | |
| 37 | void (KActionCollection *ac); |
| 38 | |
| 39 | /** |
| 40 | * This method has to be called before the menu is shown in response to a context |
| 41 | * menu event. Ensure contextMenu is valid pointer! |
| 42 | **/ |
| 43 | void (QMenu *); |
| 44 | |
| 45 | /** |
| 46 | * This method has to be called after a context menu event. |
| 47 | **/ |
| 48 | void (); |
| 49 | |
| 50 | void (bool b); |
| 51 | void (bool b); |
| 52 | |
| 53 | protected: |
| 54 | KTextEditor::ViewPrivate *; |
| 55 | KActionMenu *; |
| 56 | QAction *, *; |
| 57 | QActionGroup *; |
| 58 | QList<QAction *> ; |
| 59 | QMenu *; |
| 60 | KTextEditor::MovingRange *; |
| 61 | /** |
| 62 | * Set to true when a word was selected. Needed because in such case we got no "exited-notification" |
| 63 | * and end up with an always active m_currentMisspelledRange |
| 64 | **/ |
| 65 | bool = false; |
| 66 | KTextEditor::Range ; |
| 67 | QString ; |
| 68 | QStringList ; |
| 69 | |
| 70 | // These methods are called from KateOnTheFlyChecker to inform about events involving |
| 71 | // moving ranges. |
| 72 | void (KTextEditor::MovingRange *range); |
| 73 | void (KTextEditor::MovingRange *range); |
| 74 | void (KTextEditor::MovingRange *range); |
| 75 | |
| 76 | protected Q_SLOTS: |
| 77 | void (); |
| 78 | void (const QString &suggestion); |
| 79 | |
| 80 | void (); |
| 81 | void (); |
| 82 | }; |
| 83 | |
| 84 | #endif |
| 85 | |