diff options
Diffstat (limited to 'lib/urlfilter/filterrule.h')
-rw-r--r-- | lib/urlfilter/filterrule.h | 54 |
1 files changed, 0 insertions, 54 deletions
diff --git a/lib/urlfilter/filterrule.h b/lib/urlfilter/filterrule.h deleted file mode 100644 index 6afe3c6..0000000 --- a/lib/urlfilter/filterrule.h +++ /dev/null @@ -1,54 +0,0 @@ -/* - * 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_FILTERRULE_H -#define SMOLBOTE_FILTERRULE_H - -#include <QObject> -#include <QRegularExpression> -#include <QStringList> -#include <QStringMatcher> -#include <QUrl> -#include <QVector> -#include <QWebEngineUrlRequestInfo> -#include <memory> - -class FilterRule -{ -public: - enum UrlMatchType { - InvalidMatch, - RegularExpressionMatch, - StringContains, - StringStartsWith, - StringEndsWith, - StringEquals, - DomainMatch - }; - - bool isEnabled() const; - bool isBlocking() const; - - bool matchesDomain(uint domainHash) const; - bool matchesType(QWebEngineUrlRequestInfo::ResourceType type) const; - bool matchesUrl(const QUrl &url) const; - -protected: - bool m_isEnabled = false; - bool m_isBlocking = true; - - UrlMatchType urlMatchType = InvalidMatch; - QHash<QWebEngineUrlRequestInfo::ResourceType, bool> m_resourceTypeOptions; - - QVector<uint> allowedDomains_hashes, blockedDomains_hashes; - - QString match; - QRegularExpression regexp; -}; - -#endif // SMOLBOTE_FILTERRULE_H |