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 | |
11 | QT_BEGIN_NAMESPACE |
12 | |
13 | |
14 | class QNetworkCookie; |
15 | |
16 | class QNetworkCookieJarPrivate; |
17 | class Q_NETWORK_EXPORT QNetworkCookieJar: public QObject |
18 | { |
19 | Q_OBJECT |
20 | public: |
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 | |
31 | protected: |
32 | QList<QNetworkCookie> allCookies() const; |
33 | void setAllCookies(const QList<QNetworkCookie> &cookieList); |
34 | virtual bool validateCookie(const QNetworkCookie &cookie, const QUrl &url) const; |
35 | |
36 | private: |
37 | Q_DECLARE_PRIVATE(QNetworkCookieJar) |
38 | Q_DISABLE_COPY(QNetworkCookieJar) |
39 | }; |
40 | |
41 | QT_END_NAMESPACE |
42 | |
43 | #endif |
44 |