diff options
author | Aqua-sama <aqua@iserlohn-fortress.net> | 2020-02-15 14:53:56 +0200 |
---|---|---|
committer | Aqua-sama <aqua@iserlohn-fortress.net> | 2020-02-29 15:41:55 +0200 |
commit | 26e2926d5424f0c248892b4755c699541d46e856 (patch) | |
tree | 16ed0e75a31c4779d4d140b07262e89bca6971a0 /include/filterinterface.h | |
parent | Added example firefox/palemoon bookmarks to test (diff) | |
download | smolbote-26e2926d5424f0c248892b4755c699541d46e856.tar.xz |
Remove ProfileInterface
Plugins should define their own specific interfaces rather than
subclassing from ProfileInterface:
- add Filter for QWebEngineUrlRequestInterceptor filters
- add FilterPlugin for Filter loading
Remove deprecated Browser::profileList()
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) + |