swift
cookiemanager.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (C) 2015 swift Project Community / Contributors
2 // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-swift-pilot-client-1
3 
5 
6 #ifndef SWIFT_CORE_COOKIEMANAGER_H
7 #define SWIFT_CORE_COOKIEMANAGER_H
8 
9 #include <QList>
10 #include <QNetworkCookieJar>
11 #include <QObject>
12 #include <QReadWriteLock>
13 
14 #include "core/swiftcoreexport.h"
15 
16 class QNetworkCookie;
17 class QUrl;
18 
19 namespace swift::core
20 {
24  class SWIFT_CORE_EXPORT CCookieManager : public QNetworkCookieJar
25  {
26  Q_OBJECT
27 
28  public:
30  explicit CCookieManager(QObject *parent = nullptr);
31 
34  bool setCookiesFromUrl(const QList<QNetworkCookie> &cookies, const QUrl &url) override;
35 
38  QList<QNetworkCookie> cookiesForUrl(const QUrl &url) const override;
39 
42  bool deleteCookie(const QNetworkCookie &cookie) override;
43 
46  void deleteAllCookies();
47 
50  bool insertCookie(const QNetworkCookie &cookie) override;
51 
54  bool updateCookie(const QNetworkCookie &cookie) override;
55 
56  private:
57  mutable QReadWriteLock m_lock { QReadWriteLock::Recursive };
58  };
59 
60 } // namespace swift::core
61 
62 #endif // SWIFT_CORE_COOKIEMANAGER_H
Backend services of the swift project, like dealing with the network or the simulators.
Definition: actionbind.cpp:7
#define SWIFT_CORE_EXPORT
Export a class or function from the library.