2014-02-16 09:46:14 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <QObject>
|
2015-02-09 00:51:14 +00:00
|
|
|
#include <BaseInstance.h>
|
2014-02-16 09:46:14 +00:00
|
|
|
|
|
|
|
class BaseInstance;
|
|
|
|
class SettingsObject;
|
|
|
|
class QProcess;
|
|
|
|
|
2021-07-25 18:11:59 +01:00
|
|
|
class BaseExternalTool : public QObject
|
2014-02-16 09:46:14 +00:00
|
|
|
{
|
2018-07-15 13:51:05 +01:00
|
|
|
Q_OBJECT
|
2014-02-16 09:46:14 +00:00
|
|
|
public:
|
2018-07-15 13:51:05 +01:00
|
|
|
explicit BaseExternalTool(SettingsObjectPtr settings, InstancePtr instance, QObject *parent = 0);
|
|
|
|
virtual ~BaseExternalTool();
|
2014-02-16 09:46:14 +00:00
|
|
|
|
|
|
|
protected:
|
2018-07-15 13:51:05 +01:00
|
|
|
InstancePtr m_instance;
|
|
|
|
SettingsObjectPtr globalSettings;
|
2014-02-16 09:46:14 +00:00
|
|
|
};
|
|
|
|
|
2021-07-25 18:11:59 +01:00
|
|
|
class BaseDetachedTool : public BaseExternalTool
|
2014-02-16 09:46:14 +00:00
|
|
|
{
|
2018-07-15 13:51:05 +01:00
|
|
|
Q_OBJECT
|
2014-02-16 09:46:14 +00:00
|
|
|
public:
|
2018-07-15 13:51:05 +01:00
|
|
|
explicit BaseDetachedTool(SettingsObjectPtr settings, InstancePtr instance, QObject *parent = 0);
|
2014-02-16 09:46:14 +00:00
|
|
|
|
|
|
|
public
|
|
|
|
slots:
|
2018-07-15 13:51:05 +01:00
|
|
|
void run();
|
2014-02-16 09:46:14 +00:00
|
|
|
|
|
|
|
protected:
|
2018-07-15 13:51:05 +01:00
|
|
|
virtual void runImpl() = 0;
|
2014-02-16 09:46:14 +00:00
|
|
|
};
|
|
|
|
|
2021-07-25 18:11:59 +01:00
|
|
|
class BaseExternalToolFactory
|
2014-02-16 09:46:14 +00:00
|
|
|
{
|
|
|
|
public:
|
2018-07-15 13:51:05 +01:00
|
|
|
virtual ~BaseExternalToolFactory();
|
2014-02-16 09:46:14 +00:00
|
|
|
|
2018-07-15 13:51:05 +01:00
|
|
|
virtual QString name() const = 0;
|
2014-02-16 09:46:14 +00:00
|
|
|
|
2018-07-15 13:51:05 +01:00
|
|
|
virtual void registerSettings(SettingsObjectPtr settings) = 0;
|
2014-02-16 09:46:14 +00:00
|
|
|
|
2018-07-15 13:51:05 +01:00
|
|
|
virtual BaseExternalTool *createTool(InstancePtr instance, QObject *parent = 0) = 0;
|
2014-02-16 09:46:14 +00:00
|
|
|
|
2018-07-15 13:51:05 +01:00
|
|
|
virtual bool check(QString *error) = 0;
|
|
|
|
virtual bool check(const QString &path, QString *error) = 0;
|
2015-02-09 00:51:14 +00:00
|
|
|
|
|
|
|
protected:
|
2018-07-15 13:51:05 +01:00
|
|
|
SettingsObjectPtr globalSettings;
|
2014-02-16 09:46:14 +00:00
|
|
|
};
|
|
|
|
|
2021-07-25 18:11:59 +01:00
|
|
|
class BaseDetachedToolFactory : public BaseExternalToolFactory
|
2014-02-16 09:46:14 +00:00
|
|
|
{
|
|
|
|
public:
|
2018-07-15 13:51:05 +01:00
|
|
|
virtual BaseDetachedTool *createDetachedTool(InstancePtr instance, QObject *parent = 0);
|
2014-02-16 09:46:14 +00:00
|
|
|
};
|