/* * 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: git://neueland.iserlohn-fortress.net/smolbote.git * * SPDX-License-Identifier: GPL-3.0 */ #ifndef SUBSCRIPTIONFORM_H #define SUBSCRIPTIONFORM_H #include #include #include "filtertree.h" #include namespace Ui { class SubscriptionForm; } class FilterCollection : public QWidget { Q_OBJECT public: struct MatchResult { bool match; bool block; QString pattern; }; explicit FilterCollection(const QString path, QWidget *parent = 0); ~FilterCollection(); QString name() const; bool match(QWebEngineUrlRequestInfo &info); private slots: int load(const QJsonObject &json); private: Filter::Resources parseJsonRules(const QJsonValue &obj); Ui::SubscriptionForm *ui; FilterTree *m_filters; QHash> m_filterlist; }; #endif // SUBSCRIPTIONFORM_H