diff options
Diffstat (limited to 'include/filterinterface.h')
-rw-r--r-- | include/filterinterface.h | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/include/filterinterface.h b/include/filterinterface.h new file mode 100644 index 0000000..fb04e25 --- /dev/null +++ b/include/filterinterface.h @@ -0,0 +1,36 @@ +/* + * This file is part of smolbote. It's copyrighted by the contributors recorded + * in the version control history of the file, available from its original + * location: https://library.iserlohn-fortress.net/aqua/smolbote.git + * + * SPDX-License-Identifier: MIT + */ + +#pragma once + +#include <QWebEngineUrlRequestInfo> +#include <QtPlugin> + +class Filter +{ +public: + virtual ~Filter() = default; + + virtual void filter(QWebEngineUrlRequestInfo &info) const = 0; + + virtual bool isUpToDate() const = 0; +}; + +// A class to provide filter interfaces +class QIODevice; +class FilterPlugin +{ +public: + virtual ~FilterPlugin() = default; + + virtual Filter* load(QIODevice* from) const = 0; +}; + +#define FilterPluginIid "net.iserlohn-fortress.smolbote.FilterPlugin" +Q_DECLARE_INTERFACE(FilterPlugin, FilterPluginIid) + |