aboutsummaryrefslogtreecommitdiff
path: root/src/webengine/blockerrule.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/webengine/blockerrule.h')
-rw-r--r--src/webengine/blockerrule.h17
1 files changed, 15 insertions, 2 deletions
diff --git a/src/webengine/blockerrule.h b/src/webengine/blockerrule.h
index cf1dc19..95d82b7 100644
--- a/src/webengine/blockerrule.h
+++ b/src/webengine/blockerrule.h
@@ -29,8 +29,17 @@ class BlockerRule : public QObject
{
Q_OBJECT
public:
+ enum RuleType {
+ Invalid,
+ DomainMatch,
+ RegularExpressionMatch,
+ WildcardMatch
+ };
+
explicit BlockerRule(QString rule, QObject *parent = 0);
+ QString pattern() const;
+ QString domain() const;
bool match(const QUrl &url);
bool isValid();
bool isException();
@@ -40,8 +49,12 @@ signals:
public slots:
private:
- bool m_valid;
- bool m_exception;
+ // TODO: subclass QRegularExpression and move this there
+ QString fromWildcardMatch(const QString &pattern);
+
+ RuleType m_type;
+ bool m_exception = false;
+ QString m_domain;
QRegularExpression ruleExpression;
};