1// Copyright (C) 2016 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
4#ifndef QNETWORKCOOKIEJAR_H
5#define QNETWORKCOOKIEJAR_H
6
7#include <QtNetwork/qtnetworkglobal.h>
8#include <QtCore/QObject>
9#include <QtCore/QUrl>
10
11QT_BEGIN_NAMESPACE
12
13
14class QNetworkCookie;
15
16class QNetworkCookieJarPrivate;
17class Q_NETWORK_EXPORT QNetworkCookieJar: public QObject
18{
19 Q_OBJECT
20public:
21 explicit QNetworkCookieJar(QObject *parent = nullptr);
22 virtual ~QNetworkCookieJar();
23
24 virtual QList<QNetworkCookie> cookiesForUrl(const QUrl &url) const;
25 virtual bool setCookiesFromUrl(const QList<QNetworkCookie> &cookieList, const QUrl &url);
26
27 virtual bool insertCookie(const QNetworkCookie &cookie);
28 virtual bool updateCookie(const QNetworkCookie &cookie);
29 virtual bool deleteCookie(const QNetworkCookie &cookie);
30
31protected:
32 QList<QNetworkCookie> allCookies() const;
33 void setAllCookies(const QList<QNetworkCookie> &cookieList);
34 virtual bool validateCookie(const QNetworkCookie &cookie, const QUrl &url) const;
35
36private:
37 Q_DECLARE_PRIVATE(QNetworkCookieJar)
38 Q_DISABLE_COPY(QNetworkCookieJar)
39};
40
41QT_END_NAMESPACE
42
43#endif
44

source code of qtbase/src/network/access/qnetworkcookiejar.h