2014-05-18 11:52:39 -04:00
|
|
|
#ifndef INCLUDE_PLUGINAPI_H
|
|
|
|
#define INCLUDE_PLUGINAPI_H
|
|
|
|
|
|
|
|
#include <QObject>
|
2016-05-16 12:34:23 -04:00
|
|
|
#include <QList>
|
|
|
|
|
2014-05-18 11:52:39 -04:00
|
|
|
#include "util/export.h"
|
|
|
|
|
2016-05-14 22:38:37 -04:00
|
|
|
class QString;
|
2014-05-18 11:52:39 -04:00
|
|
|
|
|
|
|
class PluginManager;
|
|
|
|
class PluginInterface;
|
|
|
|
class MainWindow;
|
2016-05-16 04:35:36 -04:00
|
|
|
class MessageQueue;
|
2014-05-18 11:52:39 -04:00
|
|
|
class PluginGUI;
|
|
|
|
|
2015-08-29 19:26:51 -04:00
|
|
|
class SDRANGEL_API PluginAPI : public QObject {
|
2014-05-18 11:52:39 -04:00
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
2016-05-16 12:34:23 -04:00
|
|
|
struct ChannelRegistration
|
|
|
|
{
|
|
|
|
QString m_channelName;
|
|
|
|
PluginInterface* m_plugin;
|
|
|
|
ChannelRegistration(const QString& channelName, PluginInterface* plugin) :
|
|
|
|
m_channelName(channelName),
|
|
|
|
m_plugin(plugin)
|
|
|
|
{ }
|
|
|
|
};
|
|
|
|
|
|
|
|
typedef QList<ChannelRegistration> ChannelRegistrations;
|
|
|
|
|
2014-05-18 11:52:39 -04:00
|
|
|
// MainWindow access
|
|
|
|
MessageQueue* getMainWindowMessageQueue();
|
|
|
|
|
|
|
|
// Channel stuff
|
2016-10-13 16:23:43 -04:00
|
|
|
void registerRxChannel(const QString& channelName, PluginInterface* plugin);
|
|
|
|
ChannelRegistrations *getRxChannelRegistrations();
|
2014-05-18 11:52:39 -04:00
|
|
|
|
|
|
|
// Sample Source stuff
|
|
|
|
void registerSampleSource(const QString& sourceName, PluginInterface* plugin);
|
|
|
|
|
2015-07-31 22:07:09 -04:00
|
|
|
// R/O access to main window
|
|
|
|
const MainWindow* getMainWindow() const { return m_mainWindow; }
|
|
|
|
|
2014-05-18 11:52:39 -04:00
|
|
|
protected:
|
|
|
|
PluginManager* m_pluginManager;
|
|
|
|
MainWindow* m_mainWindow;
|
|
|
|
|
2016-05-11 10:03:03 -04:00
|
|
|
PluginAPI(PluginManager* pluginManager, MainWindow* mainWindow);
|
2016-05-13 05:42:03 -04:00
|
|
|
~PluginAPI();
|
2014-05-18 11:52:39 -04:00
|
|
|
|
|
|
|
friend class PluginManager;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // INCLUDE_PLUGINAPI_H
|