LeechCraft 0.6.70-16373-g319c272718
Modular cross-platform feature rich live environment.
Loading...
Searching...
No Matches
customcookiejar.h
Go to the documentation of this file.
1/**********************************************************************
2 * LeechCraft - modular cross-platform feature rich internet client.
3 * Copyright (C) 2006-2014 Georg Rudoy
4 *
5 * Distributed under the Boost Software License, Version 1.0.
6 * (See accompanying file LICENSE or copy at https://www.boost.org/LICENSE_1_0.txt)
7 **********************************************************************/
8
9#pragma once
10
11#include <QNetworkCookieJar>
12#include <QByteArray>
13#include <QRegExp>
14#include "networkconfig.h"
15
16namespace LC::Util
17{
25 class UTIL_NETWORK_API CustomCookieJar : public QNetworkCookieJar
26 {
27 Q_OBJECT
28
29 bool FilterTrackingCookies_ = false;
30 bool Enabled_ = true;
31 bool MatchDomainExactly_ = false;
32
35 public:
43 explicit CustomCookieJar (QObject *parent = nullptr);
44
49 void SetFilterTrackingCookies (bool filter);
50
59 void SetEnabled (bool enabled);
60
65 void SetExactDomainMatch (bool enabled);
66
83 void SetWhitelist (const QList<QRegExp>& list);
84
95 void SetBlacklist (const QList<QRegExp>& list);
96
104 [[nodiscard]] QByteArray Save () const;
105
112 void Load (const QByteArray& data);
113
116 void CollectGarbage ();
117
127 QList<QNetworkCookie> cookiesForUrl (const QUrl& url) const override;
128
137 bool setCookiesFromUrl (const QList<QNetworkCookie>& cookieList, const QUrl& url) override;
138
139 using QNetworkCookieJar::allCookies;
140 using QNetworkCookieJar::setAllCookies;
141 signals:
144 };
145}
#define UTIL_NETWORK_API