diff options
author | Aqua-sama <aqua@iserlohn-fortress.net> | 2020-04-19 22:10:12 +0300 |
---|---|---|
committer | Aqua-sama <aqua@iserlohn-fortress.net> | 2020-04-21 20:14:58 +0300 |
commit | 511032175004959b634f12d0822b48a22f5b769e (patch) | |
tree | 0f982787d2c61a7aaa853390cd94d8f98b87c0b6 /include/smolbote | |
parent | Fix some clazy warnings (diff) | |
download | smolbote-511032175004959b634f12d0822b48a22f5b769e.tar.xz |
Add plugin loading code to smolblok
Diffstat (limited to 'include/smolbote')
-rw-r--r-- | include/smolbote/filterinterface.hpp | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/include/smolbote/filterinterface.hpp b/include/smolbote/filterinterface.hpp index 09c9269..1ae65cc 100644 --- a/include/smolbote/filterinterface.hpp +++ b/include/smolbote/filterinterface.hpp @@ -6,33 +6,35 @@ * SPDX-License-Identifier: MIT */ -#ifndef SMOLBOTE_FILTER_HPP -#define SMOLBOTE_FILTER_HPP +#ifndef SMOLBOTE_SMOLBLOK_INTERFACE_HPP +#define SMOLBOTE_SMOLBLOK_INTERFACE_HPP #include <QWebEngineUrlRequestInfo> #include <QtPlugin> -class Filter +class QIODevice; + +class FilterList { public: - virtual ~Filter() = default; + virtual ~FilterList() = default; [[nodiscard]] virtual bool filter(QWebEngineUrlRequestInfo &info) const = 0; [[nodiscard]] 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; + virtual FilterList *load(QIODevice* from) const = 0; + virtual bool update(QIODevice *f, const QUrl &upstream) const = 0; }; #define FilterPluginIid "net.iserlohn-fortress.smolbote.FilterPlugin" Q_DECLARE_INTERFACE(FilterPlugin, FilterPluginIid) -#endif // SMOLBOTE_FILTER_HPP +#endif // SMOLBOTE_SMOLBLOK_INTERFACE_HPP |