File indexing completed on 2024-05-05 04:39:53

0001 /*
0002     SPDX-FileCopyrightText: 2006 Vladimir Prus <ghost@cs.msu.su>
0003     SPDX-FileCopyrightText: 2007 Hamish Rodda <rodda@kde.org>
0004     SPDX-FileCopyrightText: 2009 Andreas Pakulat <apaku@gmx.de>
0005 
0006     SPDX-License-Identifier: GPL-2.0-or-later
0007 */
0008 
0009 #ifndef GDBCONFIGPAGE_H
0010 #define GDBCONFIGPAGE_H
0011 
0012 #include <interfaces/ilauncher.h>
0013 #include <interfaces/launchconfigurationpage.h>
0014 
0015 #include <QPointer>
0016 
0017 class IExecutePlugin;
0018 namespace Ui
0019 {
0020 class GdbConfigPage;
0021 }
0022 namespace KDevelop
0023 {
0024 class ILaunchConfiguration;
0025 class IProject;
0026 }
0027 
0028 namespace KDevMI
0029 {
0030 namespace GDB
0031 {
0032 class CppDebuggerPlugin;
0033 }
0034 }
0035 
0036 class GdbConfigPageFactory : public KDevelop::LaunchConfigurationPageFactory
0037 {
0038 public:
0039     KDevelop::LaunchConfigurationPage* createWidget(QWidget* parent) override;
0040 };
0041 
0042 class GdbConfigPage : public KDevelop::LaunchConfigurationPage
0043 {
0044 Q_OBJECT
0045 public:
0046     explicit GdbConfigPage( QWidget* parent = nullptr );
0047     ~GdbConfigPage() override;
0048     QIcon icon() const override;
0049     void loadFromConfiguration(const KConfigGroup& cfg, KDevelop::IProject* = nullptr) override;
0050     void saveToConfiguration(KConfigGroup, KDevelop::IProject* = nullptr ) const override;
0051     QString title() const override;
0052 private:
0053     Ui::GdbConfigPage* ui;
0054 };
0055 
0056 class GdbLauncher : public KDevelop::ILauncher
0057 {
0058 public:
0059     GdbLauncher( KDevMI::GDB::CppDebuggerPlugin* plugin, IExecutePlugin* execute );
0060     QList< KDevelop::LaunchConfigurationPageFactory* > configPages() const override;
0061     QString description() const override;
0062     QString id() override;
0063     QString name() const override;
0064     KJob* start(const QString& launchMode, KDevelop::ILaunchConfiguration* cfg) override;
0065     QStringList supportedModes() const override;
0066 private:
0067     QList<KDevelop::LaunchConfigurationPageFactory*> factoryList;
0068     QPointer<KDevMI::GDB::CppDebuggerPlugin> m_plugin;
0069     IExecutePlugin* m_execute;
0070 };
0071 
0072 #endif