qnetworkcookie.sip 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. // qnetworkcookie.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 QNetworkCookie
  22. {
  23. %TypeHeaderCode
  24. #include <qnetworkcookie.h>
  25. %End
  26. public:
  27. enum RawForm
  28. {
  29. NameAndValueOnly,
  30. Full,
  31. };
  32. QNetworkCookie(const QByteArray &name = QByteArray(), const QByteArray &value = QByteArray());
  33. QNetworkCookie(const QNetworkCookie &other);
  34. ~QNetworkCookie();
  35. bool isSecure() const;
  36. void setSecure(bool enable);
  37. bool isSessionCookie() const;
  38. QDateTime expirationDate() const;
  39. void setExpirationDate(const QDateTime &date);
  40. QString domain() const;
  41. void setDomain(const QString &domain);
  42. QString path() const;
  43. void setPath(const QString &path);
  44. QByteArray name() const;
  45. void setName(const QByteArray &cookieName);
  46. QByteArray value() const;
  47. void setValue(const QByteArray &value);
  48. QByteArray toRawForm(QNetworkCookie::RawForm form = QNetworkCookie::Full) const;
  49. %If (Qt_6_7_0 -)
  50. static QList<QNetworkCookie> parseCookies(QByteArrayView cookieString);
  51. %End
  52. %If (- Qt_6_7_0)
  53. static QList<QNetworkCookie> parseCookies(const QByteArray &cookieString);
  54. %End
  55. bool operator==(const QNetworkCookie &other) const;
  56. bool operator!=(const QNetworkCookie &other) const;
  57. bool isHttpOnly() const;
  58. void setHttpOnly(bool enable);
  59. void swap(QNetworkCookie &other /Constrained/);
  60. bool hasSameIdentifier(const QNetworkCookie &other) const;
  61. void normalize(const QUrl &url);
  62. %If (Qt_6_1_0 -)
  63. enum class SameSite
  64. {
  65. Default,
  66. None /PyName=None_/,
  67. Lax,
  68. Strict,
  69. };
  70. %End
  71. %If (Qt_6_1_0 -)
  72. QNetworkCookie::SameSite sameSitePolicy() const;
  73. %End
  74. %If (Qt_6_1_0 -)
  75. void setSameSitePolicy(QNetworkCookie::SameSite sameSite);
  76. %End
  77. };