1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-11-08 17:46:03 -05:00
sdrangel/sdrbase/plugin/pluginapi.h

57 lines
1.2 KiB
C
Raw Normal View History

#ifndef INCLUDE_PLUGINAPI_H
#define INCLUDE_PLUGINAPI_H
#include <QObject>
#include <QList>
#include "util/export.h"
2016-05-14 22:38:37 -04:00
class QString;
class PluginManager;
class PluginInterface;
class MainWindow;
class MessageQueue;
class PluginGUI;
2015-08-29 19:26:51 -04:00
class SDRANGEL_API PluginAPI : public QObject {
Q_OBJECT
public:
struct ChannelRegistration
{
QString m_channelName;
PluginInterface* m_plugin;
ChannelRegistration(const QString& channelName, PluginInterface* plugin) :
m_channelName(channelName),
m_plugin(plugin)
{ }
};
typedef QList<ChannelRegistration> ChannelRegistrations;
// MainWindow access
MessageQueue* getMainWindowMessageQueue();
// Channel stuff
void registerChannel(const QString& channelName, PluginInterface* plugin);
ChannelRegistrations *getChannelRegistrations();
// Sample Source stuff
void registerSampleSource(const QString& sourceName, PluginInterface* plugin);
// R/O access to main window
const MainWindow* getMainWindow() const { return m_mainWindow; }
protected:
PluginManager* m_pluginManager;
MainWindow* m_mainWindow;
PluginAPI(PluginManager* pluginManager, MainWindow* mainWindow);
~PluginAPI();
friend class PluginManager;
};
#endif // INCLUDE_PLUGINAPI_H