2021-01-06 21:43:48 +00:00
|
|
|
#pragma once
|
|
|
|
|
2021-01-09 10:17:50 +00:00
|
|
|
#include "api.h"
|
2021-01-06 21:43:48 +00:00
|
|
|
#include <QObject>
|
|
|
|
|
|
|
|
namespace http {
|
|
|
|
|
|
|
|
#define HTTPProxyInterfaceIID "bigsnitch.api.HTTPProxyInterface/100"
|
|
|
|
|
|
|
|
//! Interface for implementing proxies
|
|
|
|
/*!
|
|
|
|
Interface for implementing proxies
|
|
|
|
*/
|
2021-01-09 10:17:50 +00:00
|
|
|
class ProxyInterface : public QObject {
|
|
|
|
Q_OBJECT
|
2021-01-06 21:43:48 +00:00
|
|
|
public:
|
|
|
|
virtual ~ProxyInterface() = default;
|
|
|
|
//! called in a custom thread, may block.
|
|
|
|
virtual void process(std::string path) = 0;
|
|
|
|
//! returns, whether the proxy is currently connected
|
|
|
|
virtual bool connected() = 0;
|
|
|
|
//! disconnects the handle
|
|
|
|
virtual void disconnect() = 0;
|
|
|
|
// options/settings
|
|
|
|
signals:
|
2021-01-09 10:17:50 +00:00
|
|
|
virtual void finished();
|
|
|
|
virtual void error(QString err);
|
|
|
|
virtual void message(http::Flow flow);
|
2021-01-06 21:43:48 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
Q_DECLARE_INTERFACE(http::ProxyInterface, HTTPProxyInterfaceIID)
|