1// qabstractnetworkcache.sip generated by MetaSIP 2// 3// This file is part of the QtNetwork Python extension module. 4// 5// Copyright (c) 2021 Riverbank Computing Limited <info@riverbankcomputing.com> 6// 7// This file is part of PyQt5. 8// 9// This file may be used under the terms of the GNU General Public License 10// version 3.0 as published by the Free Software Foundation and appearing in 11// the file LICENSE included in the packaging of this file. Please review the 12// following information to ensure the GNU General Public License version 3.0 13// requirements will be met: http://www.gnu.org/copyleft/gpl.html. 14// 15// If you do not wish to use this file under the terms of the GPL version 3.0 16// then you may purchase a commercial license. For more information contact 17// info@riverbankcomputing.com. 18// 19// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 20// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 21 22 23class QNetworkCacheMetaData 24{ 25%TypeHeaderCode 26#include <qabstractnetworkcache.h> 27%End 28 29 typedef QList<QPair<QByteArray, QByteArray>> RawHeaderList; 30 typedef QHash<QNetworkRequest::Attribute, QVariant> AttributesMap; 31 32public: 33 QNetworkCacheMetaData(); 34 QNetworkCacheMetaData(const QNetworkCacheMetaData &other); 35 ~QNetworkCacheMetaData(); 36 bool operator==(const QNetworkCacheMetaData &other) const; 37 bool operator!=(const QNetworkCacheMetaData &other) const; 38 bool isValid() const; 39 QUrl url() const; 40 void setUrl(const QUrl &url); 41 QNetworkCacheMetaData::RawHeaderList rawHeaders() const; 42 void setRawHeaders(const QNetworkCacheMetaData::RawHeaderList &headers); 43 QDateTime lastModified() const; 44 void setLastModified(const QDateTime &dateTime); 45 QDateTime expirationDate() const; 46 void setExpirationDate(const QDateTime &dateTime); 47 bool saveToDisk() const; 48 void setSaveToDisk(bool allow); 49 QNetworkCacheMetaData::AttributesMap attributes() const; 50 void setAttributes(const QNetworkCacheMetaData::AttributesMap &attributes); 51 void swap(QNetworkCacheMetaData &other /Constrained/); 52}; 53 54QDataStream &operator<<(QDataStream &, const QNetworkCacheMetaData & /Constrained/) /ReleaseGIL/; 55QDataStream &operator>>(QDataStream &, QNetworkCacheMetaData & /Constrained/) /ReleaseGIL/; 56 57class QAbstractNetworkCache : QObject 58{ 59%TypeHeaderCode 60#include <qabstractnetworkcache.h> 61%End 62 63public: 64 virtual ~QAbstractNetworkCache(); 65 virtual QNetworkCacheMetaData metaData(const QUrl &url) = 0; 66 virtual void updateMetaData(const QNetworkCacheMetaData &metaData) = 0; 67 virtual QIODevice *data(const QUrl &url) = 0 /Factory/; 68 virtual bool remove(const QUrl &url) = 0; 69 virtual qint64 cacheSize() const = 0; 70 virtual QIODevice *prepare(const QNetworkCacheMetaData &metaData) = 0; 71 virtual void insert(QIODevice *device) = 0; 72 73public slots: 74 virtual void clear() = 0; 75 76protected: 77 explicit QAbstractNetworkCache(QObject *parent /TransferThis/ = 0); 78}; 79