qabstractnetworkcache.sip 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. // qabstractnetworkcache.sip generated by MetaSIP
  2. //
  3. // This file is part of the QtNetwork Python extension module.
  4. //
  5. // Copyright (c) 2026 Riverbank Computing Limited <info@riverbankcomputing.com>
  6. //
  7. // This file is part of PyQt6.
  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. class QNetworkCacheMetaData
  22. {
  23. %TypeHeaderCode
  24. #include <qabstractnetworkcache.h>
  25. %End
  26. typedef QList<std::pair<QByteArray, QByteArray>> RawHeaderList;
  27. typedef QHash<QNetworkRequest::Attribute, QVariant> AttributesMap;
  28. public:
  29. QNetworkCacheMetaData();
  30. QNetworkCacheMetaData(const QNetworkCacheMetaData &other);
  31. ~QNetworkCacheMetaData();
  32. bool operator==(const QNetworkCacheMetaData &other) const;
  33. bool operator!=(const QNetworkCacheMetaData &other) const;
  34. bool isValid() const;
  35. QUrl url() const;
  36. void setUrl(const QUrl &url);
  37. QNetworkCacheMetaData::RawHeaderList rawHeaders() const;
  38. void setRawHeaders(const QNetworkCacheMetaData::RawHeaderList &headers);
  39. QDateTime lastModified() const;
  40. void setLastModified(const QDateTime &dateTime);
  41. QDateTime expirationDate() const;
  42. void setExpirationDate(const QDateTime &dateTime);
  43. bool saveToDisk() const;
  44. void setSaveToDisk(bool allow);
  45. QNetworkCacheMetaData::AttributesMap attributes() const;
  46. void setAttributes(const QNetworkCacheMetaData::AttributesMap &attributes);
  47. void swap(QNetworkCacheMetaData &other /Constrained/);
  48. %If (Qt_6_8_0 -)
  49. QHttpHeaders headers() const;
  50. %End
  51. %If (Qt_6_8_0 -)
  52. void setHeaders(const QHttpHeaders &headers);
  53. %End
  54. };
  55. QDataStream &operator<<(QDataStream &, const QNetworkCacheMetaData & /Constrained/) /ReleaseGIL/;
  56. QDataStream &operator>>(QDataStream &, QNetworkCacheMetaData & /Constrained/) /ReleaseGIL/;
  57. class QAbstractNetworkCache : public QObject
  58. {
  59. %TypeHeaderCode
  60. #include <qabstractnetworkcache.h>
  61. %End
  62. public:
  63. virtual ~QAbstractNetworkCache();
  64. virtual QNetworkCacheMetaData metaData(const QUrl &url) = 0;
  65. virtual void updateMetaData(const QNetworkCacheMetaData &metaData) = 0;
  66. virtual QIODevice *data(const QUrl &url) = 0 /Factory/;
  67. virtual bool remove(const QUrl &url) = 0;
  68. virtual qint64 cacheSize() const = 0;
  69. virtual QIODevice *prepare(const QNetworkCacheMetaData &metaData) = 0;
  70. virtual void insert(QIODevice *device) = 0;
  71. public slots:
  72. virtual void clear() = 0;
  73. protected:
  74. explicit QAbstractNetworkCache(QObject *parent /TransferThis/ = 0);
  75. };