KTextEditor

katescriptaction.h
1 /*
2  SPDX-FileCopyrightText: 2010-2018 Dominik Haumann <[email protected]>
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  Q_OBJECT
28 
29 public:
30  KateScriptAction(const QString &cmd, const QJsonObject &action, KTextEditor::ViewPrivate *view);
31 
32 public Q_SLOTS:
33  void exec();
34 
35 private:
36  KTextEditor::ViewPrivate *m_view;
37  QString m_command;
38  bool m_interactive;
39 };
40 
41 /**
42  * Tools > Scripts menu
43  * This menu is filled with the command line scripts exported
44  * via the scripting support.
45  */
47 {
48  Q_OBJECT
49 
50 public:
51  KateScriptActionMenu(KTextEditor::ViewPrivate *view, const QString &text);
52  ~KateScriptActionMenu() override;
53 
54  void cleanup();
55 
56 public Q_SLOTS:
57  void repopulate();
58 
59 private:
60  KTextEditor::ViewPrivate *m_view;
61  QList<QMenu *> m_menus;
62  QList<QAction *> m_actions;
63 };
64 
65 #endif
Q_OBJECTQ_OBJECT
Q_SLOTSQ_SLOTS
KateScriptAction is an action that executes a commandline-script if triggered.
Tools > Scripts menu This menu is filled with the command line scripts exported via the scripting sup...
The KTextEditor namespace contains all the public API that is required to use the KTextEditor compone...
Definition: katetextblock.h:22
This file is part of the KDE documentation.
Documentation copyright © 1996-2022 The KDE developers.
Generated on Tue Aug 9 2022 03:52:59 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.