| 1 | /* |
| 2 | SPDX-FileCopyrightText: 2010-2018 Dominik Haumann <dhaumann@kde.org> |
| 3 | |
| 4 | SPDX-License-Identifier: LGPL-2.0-or-later |
| 5 | */ |
| 6 | |
| 7 | #ifndef KATE_SCRIPT_ACTION_H |
| 8 | #define KATE_SCRIPT_ACTION_H |
| 9 | |
| 10 | #include "katecommandlinescript.h" |
| 11 | |
| 12 | #include <KActionMenu> |
| 13 | |
| 14 | #include <QAction> |
| 15 | |
| 16 | namespace KTextEditor |
| 17 | { |
| 18 | class ViewPrivate; |
| 19 | } |
| 20 | |
| 21 | /** |
| 22 | * KateScriptAction is an action that executes a commandline-script |
| 23 | * if triggered. It is shown in Tools > Scripts. |
| 24 | */ |
| 25 | class KateScriptAction : public QAction |
| 26 | { |
| 27 | public: |
| 28 | KateScriptAction(const QString &cmd, const QJsonObject &action, KTextEditor::ViewPrivate *view); |
| 29 | |
| 30 | public: |
| 31 | void exec(); |
| 32 | |
| 33 | private: |
| 34 | KTextEditor::ViewPrivate *m_view; |
| 35 | QString m_command; |
| 36 | bool m_interactive; |
| 37 | }; |
| 38 | |
| 39 | /** |
| 40 | * Tools > Scripts menu |
| 41 | * This menu is filled with the command line scripts exported |
| 42 | * via the scripting support. |
| 43 | */ |
| 44 | class : public KActionMenu |
| 45 | { |
| 46 | public: |
| 47 | (KTextEditor::ViewPrivate *view, const QString &text); |
| 48 | () override; |
| 49 | |
| 50 | void (); |
| 51 | |
| 52 | public: |
| 53 | void (); |
| 54 | |
| 55 | private: |
| 56 | KTextEditor::ViewPrivate *; |
| 57 | QList<QMenu *> ; |
| 58 | QList<QAction *> ; |
| 59 | }; |
| 60 | |
| 61 | #endif |
| 62 | |