File indexing completed on 2024-04-21 08:23:03

0001 /*
0002  * This file is part of KDevelop project
0003  * Copyright 2016 Patrick José Pereira <patrickelectric@gmail.com>
0004  * Copyright 2007 Hamish Rodda <rodda@kde.org>
0005  *
0006  * This program is free software; you can redistribute it and/or modify
0007  * it under the terms of the GNU Library General Public License as
0008  * published by the Free Software Foundation; either version 2 of the
0009  * License, or (at your option) any later version.
0010  *
0011  * This program is distributed in the hope that it will be useful,
0012  * but WITHOUT ANY WARRANTY; without even the implied warranty of
0013  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
0014  * GNU General Public License for more details.
0015  *
0016  * You should have received a copy of the GNU General Public
0017  * License along with this program; if not, write to the
0018  * Free Software Foundation, Inc.,
0019  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
0020  */
0021 
0022 #pragma once
0023 
0024 #include <QVariant>
0025 
0026 #include <interfaces/iplugin.h>
0027 #include <execute/iexecuteplugin.h>
0028 
0029 class QUrl;
0030 class KJob;
0031 
0032 class NativeAppConfigType;
0033 
0034 class ExecutePlugin : public KDevelop::IPlugin, public IExecutePlugin
0035 {
0036     Q_OBJECT
0037     Q_INTERFACES(IExecutePlugin)
0038 
0039 public:
0040     explicit ExecutePlugin(QObject *parent, const QVariantList & = QVariantList());
0041     ~ExecutePlugin() override;
0042 
0043     static QString _nativeAppConfigTypeId;
0044     static QString workingDirEntry;
0045     static QString executableEntry;
0046     static QString argumentsEntry;
0047     static QString isExecutableEntry;
0048     static QString environmentProfileEntry;
0049     static QString useTerminalEntry;
0050     static QString commandEntry;
0051     static QString userIdToRunEntry;
0052     static QString dependencyActionEntry;
0053     static QString projectTargetEntry;
0054     static QString presetsEntry;
0055     static QString boardEntry;
0056     static QString mcuEntry;
0057     static QString arduinoEntry;
0058     static QString launcherIndexEntry;
0059     static QString openocdArgEntry;
0060     static QString openocdWorkEntry;
0061     static QString openocdCommEntry;
0062 
0063     void unload() override;
0064 
0065     QUrl executable(KDevelop::ILaunchConfiguration*, QString& err) const override;
0066     QStringList arguments(KDevelop::ILaunchConfiguration*, QString& err) const override;
0067     QUrl workingDirectory(KDevelop::ILaunchConfiguration*) const override;
0068     KJob* dependencyJob(KDevelop::ILaunchConfiguration*) const override;
0069     QString environmentProfileName(KDevelop::ILaunchConfiguration* cfg) const override;
0070     bool useTerminal(KDevelop::ILaunchConfiguration*) const override;
0071     QString terminal(KDevelop::ILaunchConfiguration*) const override;
0072     QString nativeAppConfigTypeId() const override;
0073 
0074     NativeAppConfigType* m_configType;
0075 
0076     enum index {arduino, openocd};
0077 };