bigsnitch/pluginhandler.h

32 lines
782 B
C
Raw Normal View History

2021-01-09 10:17:50 +00:00
#pragma once
#include <include/api.h>
#include <include/proxyinterface.h>
#include <QObject>
#include <QDir>
#include <QPluginLoader>
#include <proxyhandler.h>
2021-03-20 21:56:03 +00:00
//! PluginHandler controls all plugins.
//! Every different plugin interface, that got signals has to reference them here
//! Other parts of bigsnitch connect to them here.
class PluginHandler : public QObject
2021-01-09 10:17:50 +00:00
{
2021-03-20 21:56:03 +00:00
Q_OBJECT
2021-01-09 10:17:50 +00:00
private:
QStringList loaded_plugins;
2021-03-03 16:12:12 +00:00
http::ProxyHandler proxyhandler;
2021-01-09 10:17:50 +00:00
public:
2021-03-20 21:56:03 +00:00
//! Loads a single plugin.
2021-01-09 10:17:50 +00:00
bool load(QString path);
2021-03-20 21:56:03 +00:00
//! loads all plugins in a directory.
2021-01-09 10:17:50 +00:00
void loadPlugins(QDir path);
2021-03-20 21:56:03 +00:00
signals:
//! error signal from ProxyInterface
void proxy_error(QString err);
//! message signal from ProxyInterface
void proxy_message(http::Flow flow);
2021-01-09 10:17:50 +00:00
};