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