qndefrecord.sip 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. // qndefrecord.sip generated by MetaSIP
  2. //
  3. // This file is part of the QtNfc 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. %If (Qt_6_2_0 -)
  22. class QNdefRecord
  23. {
  24. %TypeHeaderCode
  25. #include <qndefrecord.h>
  26. %End
  27. %ConvertToSubClassCode
  28. QByteArray ndef_type = sipCpp->type();
  29. switch (sipCpp->typeNameFormat())
  30. {
  31. case QNdefRecord::NfcRtd:
  32. if (ndef_type == "Sp")
  33. sipType = sipType_QNdefNfcSmartPosterRecord;
  34. else if (ndef_type == "T")
  35. sipType = sipType_QNdefNfcTextRecord;
  36. else if (ndef_type == "U")
  37. sipType = sipType_QNdefNfcUriRecord;
  38. else
  39. sipType = 0;
  40. break;
  41. case QNdefRecord::Mime:
  42. if (ndef_type == "")
  43. sipType = sipType_QNdefNfcIconRecord;
  44. else
  45. sipType = 0;
  46. break;
  47. default:
  48. sipType = 0;
  49. }
  50. %End
  51. public:
  52. enum TypeNameFormat
  53. {
  54. Empty,
  55. NfcRtd,
  56. Mime,
  57. Uri,
  58. ExternalRtd,
  59. Unknown,
  60. };
  61. QNdefRecord();
  62. QNdefRecord(const QNdefRecord &other);
  63. ~QNdefRecord();
  64. void setTypeNameFormat(QNdefRecord::TypeNameFormat typeNameFormat);
  65. QNdefRecord::TypeNameFormat typeNameFormat() const;
  66. void setType(const QByteArray &type);
  67. QByteArray type() const;
  68. void setId(const QByteArray &id);
  69. QByteArray id() const;
  70. void setPayload(const QByteArray &payload);
  71. QByteArray payload() const;
  72. bool isEmpty() const;
  73. void clear();
  74. bool operator==(const QNdefRecord &other) const;
  75. bool operator!=(const QNdefRecord &other) const;
  76. Py_hash_t __hash__() const;
  77. %MethodCode
  78. sipRes = qHash(*sipCpp);
  79. %End
  80. };
  81. %End