Changeset View
Changeset View
Standalone View
Standalone View
addons/externaltools/kateexternaltoolscommand.h
- This file was added.
1 | /* This file is part of the KDE project | ||||
---|---|---|---|---|---|
2 | * | ||||
3 | * Copyright 2019 Dominik Haumann <dhaumann@kde.org> | ||||
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 | #ifndef KTEXTEDITOR_KATE_EXTERNALTOOLS_COMMAND_H | ||||
21 | #define KTEXTEDITOR_KATE_EXTERNALTOOLS_COMMAND_H | ||||
22 | | ||||
23 | #include <KTextEditor/Command> | ||||
24 | | ||||
25 | class KateExternalToolsPlugin; | ||||
26 | class KateExternalTool; | ||||
27 | | ||||
28 | /** | ||||
29 | * Helper class that registers and executes the respective external tool. | ||||
30 | */ | ||||
31 | class KateExternalToolsCommand : public KTextEditor::Command | ||||
32 | { | ||||
33 | public: | ||||
34 | KateExternalToolsCommand(KateExternalToolsPlugin* plugin); | ||||
35 | virtual ~KateExternalToolsCommand() = default; | ||||
36 | | ||||
37 | public: | ||||
38 | bool exec(KTextEditor::View* view, const QString& cmd, QString& msg, | ||||
39 | const KTextEditor::Range& range = KTextEditor::Range::invalid()) override; | ||||
40 | bool help(KTextEditor::View* view, const QString& cmd, QString& msg) override; | ||||
41 | | ||||
42 | private: | ||||
43 | void runTool(KateExternalTool& tool, KTextEditor::View* view); | ||||
44 | | ||||
45 | private: | ||||
46 | KateExternalToolsPlugin* m_plugin; | ||||
47 | }; | ||||
48 | | ||||
49 | #endif // KTEXTEDITOR_KATE_EXTERNALTOOLS_COMMAND_H | ||||
50 | | ||||
51 | // kate: space-indent on; indent-width 4; replace-tabs on; |