KTextEditor

katescriptaction.h
1 /* SPDX-License-Identifier: LGPL-2.0-or-later
2 
3  Copyright (C) 2010-2018 Dominik Haumann <[email protected]>
4 
5  This library is free software; you can redistribute it and/or
6  modify it under the terms of the GNU Library General Public
7  License as published by the Free Software Foundation; either
8  version 2 of the License, or (at your option) any later version.
9 
10  This library is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13  Library General Public License for more details.
14 
15  You should have received a copy of the GNU Library General Public License
16  along with this library; see the file COPYING.LIB. If not, write to
17  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18  Boston, MA 02110-1301, USA.
19 */
20 
21 #ifndef KATE_SCRIPT_ACTION_H
22 #define KATE_SCRIPT_ACTION_H
23 
24 #include "katecommandlinescript.h"
25 
26 #include <KActionMenu>
27 
28 #include <QAction>
29 
30 namespace KTextEditor
31 {
32 class ViewPrivate;
33 }
34 
39 class KateScriptAction : public QAction
40 {
41  Q_OBJECT
42 
43 public:
44  KateScriptAction(const QString &cmd, const QJsonObject &action, KTextEditor::ViewPrivate *view);
45  virtual ~KateScriptAction();
46 
47 public Q_SLOTS:
48  void exec();
49 
50 private:
51  KTextEditor::ViewPrivate *m_view;
52  QString m_command;
53  bool m_interactive;
54 };
55 
62 {
63  Q_OBJECT
64 
65 public:
66  KateScriptActionMenu(KTextEditor::ViewPrivate *view, const QString &text);
68 
69  void cleanup();
70 
71 public Q_SLOTS:
72  void repopulate();
73 
74 private:
75  KTextEditor::ViewPrivate *m_view;
76  QList<QMenu *> m_menus;
77  QList<QAction *> m_actions;
78 };
79 
80 #endif
The KTextEditor namespace contains all the public API that is required to use the KTextEditor compone...
Tools > Scripts menu This menu is filled with the command line scripts exported via the scripting sup...
KateScriptAction is an action that executes a commandline-script if triggered.
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Sun Aug 9 2020 23:00:40 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.