File indexing completed on 2024-05-05 05:51:22
0001 /* This file is part of the KDE project 0002 * 0003 * SPDX-FileCopyrightText: 2019 Dominik Haumann <dhaumann@kde.org> 0004 * 0005 * SPDX-License-Identifier: LGPL-2.0-or-later 0006 */ 0007 #pragma once 0008 0009 #include <KTextEditor/Command> 0010 0011 class KateExternalToolsPlugin; 0012 class KateExternalTool; 0013 0014 /** 0015 * Helper class that registers and executes the respective external tool. 0016 */ 0017 class KateExternalToolsCommand : public KTextEditor::Command 0018 { 0019 public: 0020 KateExternalToolsCommand(KateExternalToolsPlugin *plugin); 0021 ~KateExternalToolsCommand() override = default; 0022 0023 public: 0024 bool exec(KTextEditor::View *view, const QString &cmd, QString &msg, const KTextEditor::Range &range = KTextEditor::Range::invalid()) override; 0025 bool help(KTextEditor::View *view, const QString &cmd, QString &msg) override; 0026 0027 private: 0028 void runTool(KateExternalTool &tool, KTextEditor::View *view); 0029 0030 private: 0031 KateExternalToolsPlugin *m_plugin; 0032 }; 0033 0034 // kate: space-indent on; indent-width 4; replace-tabs on;