2014-05-18 11:52:39 -04:00
|
|
|
#ifndef INCLUDE_PLUGININTERFACE_H
|
|
|
|
#define INCLUDE_PLUGININTERFACE_H
|
|
|
|
|
|
|
|
#include <QtPlugin>
|
|
|
|
#include <QString>
|
|
|
|
|
|
|
|
struct PluginDescriptor {
|
|
|
|
// general plugin description
|
|
|
|
const QString displayedName;
|
|
|
|
const QString version;
|
|
|
|
const QString copyright;
|
|
|
|
const QString website;
|
|
|
|
bool licenseIsGPL;
|
|
|
|
const QString sourceCodeURL;
|
|
|
|
};
|
|
|
|
|
|
|
|
class PluginAPI;
|
2016-05-15 19:12:37 -04:00
|
|
|
class DeviceAPI;
|
2014-05-18 11:52:39 -04:00
|
|
|
class PluginGUI;
|
2016-05-16 21:41:01 -04:00
|
|
|
class QWidget;
|
2014-05-18 11:52:39 -04:00
|
|
|
|
|
|
|
class PluginInterface {
|
|
|
|
public:
|
2015-09-30 00:57:40 -04:00
|
|
|
struct SampleSourceDevice
|
|
|
|
{
|
2014-05-18 11:52:39 -04:00
|
|
|
QString displayedName;
|
2015-09-30 00:57:40 -04:00
|
|
|
QString id;
|
|
|
|
QString serial;
|
|
|
|
int sequence;
|
|
|
|
|
|
|
|
SampleSourceDevice(const QString& _displayedName,
|
|
|
|
const QString& _id,
|
|
|
|
const QString& _serial,
|
|
|
|
int _sequence) :
|
2014-05-18 11:52:39 -04:00
|
|
|
displayedName(_displayedName),
|
2015-09-30 00:57:40 -04:00
|
|
|
id(_id),
|
|
|
|
serial(_serial),
|
|
|
|
sequence(_sequence)
|
2014-05-18 11:52:39 -04:00
|
|
|
{ }
|
|
|
|
};
|
|
|
|
typedef QList<SampleSourceDevice> SampleSourceDevices;
|
|
|
|
|
|
|
|
virtual ~PluginInterface() { };
|
|
|
|
|
|
|
|
virtual const PluginDescriptor& getPluginDescriptor() const = 0;
|
|
|
|
virtual void initPlugin(PluginAPI* pluginAPI) = 0;
|
|
|
|
|
2016-05-15 21:21:21 -04:00
|
|
|
virtual PluginGUI* createChannel(const QString& channelName, DeviceAPI *deviceAPI) { return 0; }
|
2014-05-18 11:52:39 -04:00
|
|
|
|
|
|
|
virtual SampleSourceDevices enumSampleSources() { return SampleSourceDevices(); }
|
2016-05-16 21:41:01 -04:00
|
|
|
virtual PluginGUI* createSampleSourcePluginGUI(const QString& sourceId, QWidget **widget, DeviceAPI *deviceAPI)
|
2016-05-15 19:12:37 -04:00
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
2014-05-18 11:52:39 -04:00
|
|
|
};
|
|
|
|
|
2015-10-04 22:47:23 -04:00
|
|
|
Q_DECLARE_INTERFACE(PluginInterface, "SDRangel.PluginInterface/0.1");
|
2014-05-18 11:52:39 -04:00
|
|
|
|
|
|
|
#endif // INCLUDE_PLUGININTERFACE_H
|