/* * 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://neueland.iserlohn-fortress.net/gitea/aqua/smolbote * * SPDX-License-Identifier: GPL-3.0 */ #ifndef SMOLBOTE_FILTER_H #define SMOLBOTE_FILTER_H #include "urlfilter/filterrule.h" #include #include #include class Configuration; class Filter : public QObject { Q_OBJECT public: struct HostRule { bool isBlocking; }; explicit Filter(const std::unique_ptr &config, QObject *parent = nullptr); ~Filter() override = default; const QHash hostlist() const { return qAsConst(m_hostlist); } std::optional hostlistRule(const QString &url) const; const QMap headers() const { return qAsConst(m_headers); } private: QHash m_hostlist; QMap m_headers; }; #endif // SMOLBOTE_FILTER_H