initial
This commit is contained in:
@@ -0,0 +1,6 @@
|
||||
# Automatically generated configuration for PyQt5.QtNfc.
|
||||
|
||||
sip-version = "6.8.6"
|
||||
sip-abi-version = "12.15"
|
||||
module-tags = ["Qt_5_15_14", "WS_X11"]
|
||||
module-disabled-features = []
|
||||
@@ -0,0 +1,58 @@
|
||||
// QtNfcmod.sip generated by MetaSIP
|
||||
//
|
||||
// This file is part of the QtNfc Python extension module.
|
||||
//
|
||||
// Copyright (c) 2024 Riverbank Computing Limited <info@riverbankcomputing.com>
|
||||
//
|
||||
// This file is part of PyQt5.
|
||||
//
|
||||
// This file may be used under the terms of the GNU General Public License
|
||||
// version 3.0 as published by the Free Software Foundation and appearing in
|
||||
// the file LICENSE included in the packaging of this file. Please review the
|
||||
// following information to ensure the GNU General Public License version 3.0
|
||||
// requirements will be met: http://www.gnu.org/copyleft/gpl.html.
|
||||
//
|
||||
// If you do not wish to use this file under the terms of the GPL version 3.0
|
||||
// then you may purchase a commercial license. For more information contact
|
||||
// info@riverbankcomputing.com.
|
||||
//
|
||||
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
||||
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
|
||||
%Module(name=PyQt5.QtNfc, keyword_arguments="Optional", use_limited_api=True)
|
||||
|
||||
%Import QtCore/QtCoremod.sip
|
||||
|
||||
%Copying
|
||||
Copyright (c) 2024 Riverbank Computing Limited <info@riverbankcomputing.com>
|
||||
|
||||
This file is part of PyQt5.
|
||||
|
||||
This file may be used under the terms of the GNU General Public License
|
||||
version 3.0 as published by the Free Software Foundation and appearing in
|
||||
the file LICENSE included in the packaging of this file. Please review the
|
||||
following information to ensure the GNU General Public License version 3.0
|
||||
requirements will be met: http://www.gnu.org/copyleft/gpl.html.
|
||||
|
||||
If you do not wish to use this file under the terms of the GPL version 3.0
|
||||
then you may purchase a commercial license. For more information contact
|
||||
info@riverbankcomputing.com.
|
||||
|
||||
This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
||||
WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
%End
|
||||
|
||||
%DefaultSupertype sip.simplewrapper
|
||||
|
||||
%Include qndeffilter.sip
|
||||
%Include qndefmessage.sip
|
||||
%Include qndefnfcsmartposterrecord.sip
|
||||
%Include qndefnfctextrecord.sip
|
||||
%Include qndefnfcurirecord.sip
|
||||
%Include qndefrecord.sip
|
||||
%Include qnearfieldmanager.sip
|
||||
%Include qnearfieldsharemanager.sip
|
||||
%Include qnearfieldsharetarget.sip
|
||||
%Include qnearfieldtarget.sip
|
||||
%Include qqmlndefrecord.sip
|
||||
@@ -0,0 +1,57 @@
|
||||
// qndeffilter.sip generated by MetaSIP
|
||||
//
|
||||
// This file is part of the QtNfc Python extension module.
|
||||
//
|
||||
// Copyright (c) 2024 Riverbank Computing Limited <info@riverbankcomputing.com>
|
||||
//
|
||||
// This file is part of PyQt5.
|
||||
//
|
||||
// This file may be used under the terms of the GNU General Public License
|
||||
// version 3.0 as published by the Free Software Foundation and appearing in
|
||||
// the file LICENSE included in the packaging of this file. Please review the
|
||||
// following information to ensure the GNU General Public License version 3.0
|
||||
// requirements will be met: http://www.gnu.org/copyleft/gpl.html.
|
||||
//
|
||||
// If you do not wish to use this file under the terms of the GPL version 3.0
|
||||
// then you may purchase a commercial license. For more information contact
|
||||
// info@riverbankcomputing.com.
|
||||
//
|
||||
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
||||
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
|
||||
%If (Qt_5_5_0 -)
|
||||
|
||||
class QNdefFilter
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qndeffilter.h>
|
||||
%End
|
||||
|
||||
public:
|
||||
QNdefFilter();
|
||||
QNdefFilter(const QNdefFilter &other);
|
||||
~QNdefFilter();
|
||||
void clear();
|
||||
void setOrderMatch(bool on);
|
||||
bool orderMatch() const;
|
||||
|
||||
struct Record
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qndeffilter.h>
|
||||
%End
|
||||
|
||||
QNdefRecord::TypeNameFormat typeNameFormat;
|
||||
QByteArray type;
|
||||
unsigned int minimum;
|
||||
unsigned int maximum;
|
||||
};
|
||||
|
||||
void appendRecord(QNdefRecord::TypeNameFormat typeNameFormat, const QByteArray &type, unsigned int min = 1, unsigned int max = 1);
|
||||
void appendRecord(const QNdefFilter::Record &record);
|
||||
int recordCount() const /__len__/;
|
||||
QNdefFilter::Record recordAt(int i) const;
|
||||
};
|
||||
|
||||
%End
|
||||
@@ -0,0 +1,74 @@
|
||||
// qndefmessage.sip generated by MetaSIP
|
||||
//
|
||||
// This file is part of the QtNfc Python extension module.
|
||||
//
|
||||
// Copyright (c) 2024 Riverbank Computing Limited <info@riverbankcomputing.com>
|
||||
//
|
||||
// This file is part of PyQt5.
|
||||
//
|
||||
// This file may be used under the terms of the GNU General Public License
|
||||
// version 3.0 as published by the Free Software Foundation and appearing in
|
||||
// the file LICENSE included in the packaging of this file. Please review the
|
||||
// following information to ensure the GNU General Public License version 3.0
|
||||
// requirements will be met: http://www.gnu.org/copyleft/gpl.html.
|
||||
//
|
||||
// If you do not wish to use this file under the terms of the GPL version 3.0
|
||||
// then you may purchase a commercial license. For more information contact
|
||||
// info@riverbankcomputing.com.
|
||||
//
|
||||
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
||||
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
|
||||
%If (Qt_5_5_0 -)
|
||||
|
||||
class QNdefMessage
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qndefmessage.h>
|
||||
%End
|
||||
|
||||
public:
|
||||
QNdefMessage();
|
||||
explicit QNdefMessage(const QNdefRecord &record);
|
||||
QNdefMessage(const QNdefMessage &message);
|
||||
QNdefMessage(const QList<QNdefRecord> &records);
|
||||
bool operator==(const QNdefMessage &other) const;
|
||||
QByteArray toByteArray() const;
|
||||
int __len__() const;
|
||||
%MethodCode
|
||||
sipRes = sipCpp->count();
|
||||
%End
|
||||
|
||||
QNdefRecord __getitem__(int i) const;
|
||||
%MethodCode
|
||||
Py_ssize_t idx = sipConvertFromSequenceIndex(a0, sipCpp->count());
|
||||
|
||||
if (idx < 0)
|
||||
sipIsErr = 1;
|
||||
else
|
||||
sipRes = new QNdefRecord(sipCpp->at((int)idx));
|
||||
%End
|
||||
|
||||
void __setitem__(int i, const QNdefRecord &value);
|
||||
%MethodCode
|
||||
int len = sipCpp->count();
|
||||
|
||||
if ((a0 = (int)sipConvertFromSequenceIndex(a0, len)) < 0)
|
||||
sipIsErr = 1;
|
||||
else
|
||||
(*sipCpp)[a0] = *a1;
|
||||
%End
|
||||
|
||||
void __delitem__(int i);
|
||||
%MethodCode
|
||||
if ((a0 = (int)sipConvertFromSequenceIndex(a0, sipCpp->count())) < 0)
|
||||
sipIsErr = 1;
|
||||
else
|
||||
sipCpp->removeAt(a0);
|
||||
%End
|
||||
|
||||
static QNdefMessage fromByteArray(const QByteArray &message);
|
||||
};
|
||||
|
||||
%End
|
||||
@@ -0,0 +1,96 @@
|
||||
// qndefnfcsmartposterrecord.sip generated by MetaSIP
|
||||
//
|
||||
// This file is part of the QtNfc Python extension module.
|
||||
//
|
||||
// Copyright (c) 2024 Riverbank Computing Limited <info@riverbankcomputing.com>
|
||||
//
|
||||
// This file is part of PyQt5.
|
||||
//
|
||||
// This file may be used under the terms of the GNU General Public License
|
||||
// version 3.0 as published by the Free Software Foundation and appearing in
|
||||
// the file LICENSE included in the packaging of this file. Please review the
|
||||
// following information to ensure the GNU General Public License version 3.0
|
||||
// requirements will be met: http://www.gnu.org/copyleft/gpl.html.
|
||||
//
|
||||
// If you do not wish to use this file under the terms of the GPL version 3.0
|
||||
// then you may purchase a commercial license. For more information contact
|
||||
// info@riverbankcomputing.com.
|
||||
//
|
||||
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
||||
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
|
||||
%If (Qt_5_5_0 -)
|
||||
|
||||
class QNdefNfcIconRecord : public QNdefRecord
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qndefnfcsmartposterrecord.h>
|
||||
%End
|
||||
|
||||
public:
|
||||
QNdefNfcIconRecord();
|
||||
QNdefNfcIconRecord(const QNdefRecord &other);
|
||||
void setData(const QByteArray &data);
|
||||
QByteArray data() const;
|
||||
};
|
||||
|
||||
%End
|
||||
%If (Qt_5_5_0 -)
|
||||
|
||||
class QNdefNfcSmartPosterRecord : public QNdefRecord
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qndefnfcsmartposterrecord.h>
|
||||
%End
|
||||
|
||||
public:
|
||||
enum Action
|
||||
{
|
||||
UnspecifiedAction,
|
||||
DoAction,
|
||||
SaveAction,
|
||||
EditAction,
|
||||
};
|
||||
|
||||
QNdefNfcSmartPosterRecord();
|
||||
QNdefNfcSmartPosterRecord(const QNdefNfcSmartPosterRecord &other);
|
||||
QNdefNfcSmartPosterRecord(const QNdefRecord &other);
|
||||
~QNdefNfcSmartPosterRecord();
|
||||
void setPayload(const QByteArray &payload);
|
||||
bool hasTitle(const QString &locale = QString()) const;
|
||||
bool hasAction() const;
|
||||
bool hasIcon(const QByteArray &mimetype = QByteArray()) const;
|
||||
bool hasSize() const;
|
||||
bool hasTypeInfo() const;
|
||||
int titleCount() const;
|
||||
QString title(const QString &locale = QString()) const;
|
||||
QNdefNfcTextRecord titleRecord(const int index) const;
|
||||
QList<QNdefNfcTextRecord> titleRecords() const;
|
||||
bool addTitle(const QNdefNfcTextRecord &text);
|
||||
bool addTitle(const QString &text, const QString &locale, QNdefNfcTextRecord::Encoding encoding);
|
||||
bool removeTitle(const QNdefNfcTextRecord &text);
|
||||
bool removeTitle(const QString &locale);
|
||||
void setTitles(const QList<QNdefNfcTextRecord> &titles);
|
||||
QUrl uri() const;
|
||||
QNdefNfcUriRecord uriRecord() const;
|
||||
void setUri(const QNdefNfcUriRecord &url);
|
||||
void setUri(const QUrl &url);
|
||||
QNdefNfcSmartPosterRecord::Action action() const;
|
||||
void setAction(QNdefNfcSmartPosterRecord::Action act);
|
||||
int iconCount() const;
|
||||
QByteArray icon(const QByteArray &mimetype = QByteArray()) const;
|
||||
QNdefNfcIconRecord iconRecord(const int index) const;
|
||||
QList<QNdefNfcIconRecord> iconRecords() const;
|
||||
void addIcon(const QNdefNfcIconRecord &icon);
|
||||
void addIcon(const QByteArray &type, const QByteArray &data);
|
||||
bool removeIcon(const QNdefNfcIconRecord &icon);
|
||||
bool removeIcon(const QByteArray &type);
|
||||
void setIcons(const QList<QNdefNfcIconRecord> &icons);
|
||||
quint32 size() const;
|
||||
void setSize(quint32 size);
|
||||
QByteArray typeInfo() const;
|
||||
void setTypeInfo(const QByteArray &type);
|
||||
};
|
||||
|
||||
%End
|
||||
@@ -0,0 +1,49 @@
|
||||
// qndefnfctextrecord.sip generated by MetaSIP
|
||||
//
|
||||
// This file is part of the QtNfc Python extension module.
|
||||
//
|
||||
// Copyright (c) 2024 Riverbank Computing Limited <info@riverbankcomputing.com>
|
||||
//
|
||||
// This file is part of PyQt5.
|
||||
//
|
||||
// This file may be used under the terms of the GNU General Public License
|
||||
// version 3.0 as published by the Free Software Foundation and appearing in
|
||||
// the file LICENSE included in the packaging of this file. Please review the
|
||||
// following information to ensure the GNU General Public License version 3.0
|
||||
// requirements will be met: http://www.gnu.org/copyleft/gpl.html.
|
||||
//
|
||||
// If you do not wish to use this file under the terms of the GPL version 3.0
|
||||
// then you may purchase a commercial license. For more information contact
|
||||
// info@riverbankcomputing.com.
|
||||
//
|
||||
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
||||
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
|
||||
%If (Qt_5_5_0 -)
|
||||
|
||||
class QNdefNfcTextRecord : public QNdefRecord
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qndefnfctextrecord.h>
|
||||
%End
|
||||
|
||||
public:
|
||||
QNdefNfcTextRecord();
|
||||
QNdefNfcTextRecord(const QNdefRecord &other);
|
||||
QString locale() const;
|
||||
void setLocale(const QString &locale);
|
||||
QString text() const;
|
||||
void setText(const QString text);
|
||||
|
||||
enum Encoding
|
||||
{
|
||||
Utf8,
|
||||
Utf16,
|
||||
};
|
||||
|
||||
QNdefNfcTextRecord::Encoding encoding() const;
|
||||
void setEncoding(QNdefNfcTextRecord::Encoding encoding);
|
||||
};
|
||||
|
||||
%End
|
||||
@@ -0,0 +1,38 @@
|
||||
// qndefnfcurirecord.sip generated by MetaSIP
|
||||
//
|
||||
// This file is part of the QtNfc Python extension module.
|
||||
//
|
||||
// Copyright (c) 2024 Riverbank Computing Limited <info@riverbankcomputing.com>
|
||||
//
|
||||
// This file is part of PyQt5.
|
||||
//
|
||||
// This file may be used under the terms of the GNU General Public License
|
||||
// version 3.0 as published by the Free Software Foundation and appearing in
|
||||
// the file LICENSE included in the packaging of this file. Please review the
|
||||
// following information to ensure the GNU General Public License version 3.0
|
||||
// requirements will be met: http://www.gnu.org/copyleft/gpl.html.
|
||||
//
|
||||
// If you do not wish to use this file under the terms of the GPL version 3.0
|
||||
// then you may purchase a commercial license. For more information contact
|
||||
// info@riverbankcomputing.com.
|
||||
//
|
||||
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
||||
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
|
||||
%If (Qt_5_5_0 -)
|
||||
|
||||
class QNdefNfcUriRecord : public QNdefRecord
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qndefnfcurirecord.h>
|
||||
%End
|
||||
|
||||
public:
|
||||
QNdefNfcUriRecord();
|
||||
QNdefNfcUriRecord(const QNdefRecord &other);
|
||||
QUrl uri() const;
|
||||
void setUri(const QUrl &uri);
|
||||
};
|
||||
|
||||
%End
|
||||
@@ -0,0 +1,92 @@
|
||||
// qndefrecord.sip generated by MetaSIP
|
||||
//
|
||||
// This file is part of the QtNfc Python extension module.
|
||||
//
|
||||
// Copyright (c) 2024 Riverbank Computing Limited <info@riverbankcomputing.com>
|
||||
//
|
||||
// This file is part of PyQt5.
|
||||
//
|
||||
// This file may be used under the terms of the GNU General Public License
|
||||
// version 3.0 as published by the Free Software Foundation and appearing in
|
||||
// the file LICENSE included in the packaging of this file. Please review the
|
||||
// following information to ensure the GNU General Public License version 3.0
|
||||
// requirements will be met: http://www.gnu.org/copyleft/gpl.html.
|
||||
//
|
||||
// If you do not wish to use this file under the terms of the GPL version 3.0
|
||||
// then you may purchase a commercial license. For more information contact
|
||||
// info@riverbankcomputing.com.
|
||||
//
|
||||
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
||||
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
|
||||
%If (Qt_5_5_0 -)
|
||||
|
||||
class QNdefRecord
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qndefrecord.h>
|
||||
%End
|
||||
|
||||
%ConvertToSubClassCode
|
||||
QByteArray ndef_type = sipCpp->type();
|
||||
|
||||
switch (sipCpp->typeNameFormat())
|
||||
{
|
||||
case QNdefRecord::NfcRtd:
|
||||
if (ndef_type == "Sp")
|
||||
sipType = sipType_QNdefNfcSmartPosterRecord;
|
||||
else if (ndef_type == "T")
|
||||
sipType = sipType_QNdefNfcTextRecord;
|
||||
else if (ndef_type == "U")
|
||||
sipType = sipType_QNdefNfcUriRecord;
|
||||
else
|
||||
sipType = 0;
|
||||
|
||||
break;
|
||||
|
||||
case QNdefRecord::Mime:
|
||||
if (ndef_type == "")
|
||||
sipType = sipType_QNdefNfcIconRecord;
|
||||
else
|
||||
sipType = 0;
|
||||
|
||||
break;
|
||||
|
||||
default:
|
||||
sipType = 0;
|
||||
}
|
||||
%End
|
||||
|
||||
public:
|
||||
enum TypeNameFormat
|
||||
{
|
||||
Empty,
|
||||
NfcRtd,
|
||||
Mime,
|
||||
Uri,
|
||||
ExternalRtd,
|
||||
Unknown,
|
||||
};
|
||||
|
||||
QNdefRecord();
|
||||
QNdefRecord(const QNdefRecord &other);
|
||||
~QNdefRecord();
|
||||
void setTypeNameFormat(QNdefRecord::TypeNameFormat typeNameFormat);
|
||||
QNdefRecord::TypeNameFormat typeNameFormat() const;
|
||||
void setType(const QByteArray &type);
|
||||
QByteArray type() const;
|
||||
void setId(const QByteArray &id);
|
||||
QByteArray id() const;
|
||||
void setPayload(const QByteArray &payload);
|
||||
QByteArray payload() const;
|
||||
bool isEmpty() const;
|
||||
bool operator==(const QNdefRecord &other) const;
|
||||
bool operator!=(const QNdefRecord &other) const;
|
||||
long __hash__() const;
|
||||
%MethodCode
|
||||
sipRes = qHash(*sipCpp);
|
||||
%End
|
||||
};
|
||||
|
||||
%End
|
||||
@@ -0,0 +1,173 @@
|
||||
// qnearfieldmanager.sip generated by MetaSIP
|
||||
//
|
||||
// This file is part of the QtNfc Python extension module.
|
||||
//
|
||||
// Copyright (c) 2024 Riverbank Computing Limited <info@riverbankcomputing.com>
|
||||
//
|
||||
// This file is part of PyQt5.
|
||||
//
|
||||
// This file may be used under the terms of the GNU General Public License
|
||||
// version 3.0 as published by the Free Software Foundation and appearing in
|
||||
// the file LICENSE included in the packaging of this file. Please review the
|
||||
// following information to ensure the GNU General Public License version 3.0
|
||||
// requirements will be met: http://www.gnu.org/copyleft/gpl.html.
|
||||
//
|
||||
// If you do not wish to use this file under the terms of the GPL version 3.0
|
||||
// then you may purchase a commercial license. For more information contact
|
||||
// info@riverbankcomputing.com.
|
||||
//
|
||||
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
||||
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
|
||||
%If (Qt_5_5_0 -)
|
||||
|
||||
class QNearFieldManager : public QObject
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qnearfieldmanager.h>
|
||||
%End
|
||||
|
||||
%ConvertToSubClassCode
|
||||
static struct class_graph {
|
||||
const char *name;
|
||||
sipTypeDef **type;
|
||||
int yes, no;
|
||||
} graph[] = {
|
||||
{sipName_QNearFieldManager, &sipType_QNearFieldManager, -1, 1},
|
||||
{sipName_QNearFieldTarget, &sipType_QNearFieldTarget, -1, 2},
|
||||
{sipName_QNearFieldShareManager, &sipType_QNearFieldShareManager, -1, 3},
|
||||
{sipName_QQmlNdefRecord, &sipType_QQmlNdefRecord, -1, 4},
|
||||
{sipName_QNearFieldShareTarget, &sipType_QNearFieldShareTarget, -1, -1},
|
||||
};
|
||||
|
||||
int i = 0;
|
||||
|
||||
sipType = NULL;
|
||||
|
||||
do
|
||||
{
|
||||
struct class_graph *cg = &graph[i];
|
||||
|
||||
if (cg->name != NULL && sipCpp->inherits(cg->name))
|
||||
{
|
||||
sipType = *cg->type;
|
||||
i = cg->yes;
|
||||
}
|
||||
else
|
||||
i = cg->no;
|
||||
}
|
||||
while (i >= 0);
|
||||
%End
|
||||
|
||||
public:
|
||||
enum TargetAccessMode
|
||||
{
|
||||
NoTargetAccess,
|
||||
NdefReadTargetAccess,
|
||||
NdefWriteTargetAccess,
|
||||
TagTypeSpecificTargetAccess,
|
||||
};
|
||||
|
||||
typedef QFlags<QNearFieldManager::TargetAccessMode> TargetAccessModes;
|
||||
explicit QNearFieldManager(QObject *parent /TransferThis/ = 0);
|
||||
virtual ~QNearFieldManager();
|
||||
bool isAvailable() const;
|
||||
void setTargetAccessModes(QNearFieldManager::TargetAccessModes accessModes);
|
||||
QNearFieldManager::TargetAccessModes targetAccessModes() const;
|
||||
bool startTargetDetection();
|
||||
void stopTargetDetection();
|
||||
int registerNdefMessageHandler(SIP_PYOBJECT slot /TypeHint="PYQT_SLOT"/);
|
||||
%MethodCode
|
||||
QObject *receiver;
|
||||
QByteArray slot;
|
||||
|
||||
if ((sipError = pyqt5_qtnfc_get_pyqtslot_parts(a0, &receiver, slot)) == sipErrorNone)
|
||||
{
|
||||
sipRes = sipCpp->registerNdefMessageHandler(receiver, slot.constData());
|
||||
}
|
||||
else if (sipError == sipErrorContinue)
|
||||
{
|
||||
sipError = sipBadCallableArg(0, a0);
|
||||
}
|
||||
%End
|
||||
|
||||
int registerNdefMessageHandler(QNdefRecord::TypeNameFormat typeNameFormat, const QByteArray &type, SIP_PYOBJECT slot /TypeHint="PYQT_SLOT"/);
|
||||
%MethodCode
|
||||
QObject *receiver;
|
||||
QByteArray slot;
|
||||
|
||||
if ((sipError = pyqt5_qtnfc_get_pyqtslot_parts(a2, &receiver, slot)) == sipErrorNone)
|
||||
{
|
||||
sipRes = sipCpp->registerNdefMessageHandler(a0, *a1, receiver, slot.constData());
|
||||
}
|
||||
else if (sipError == sipErrorContinue)
|
||||
{
|
||||
sipError = sipBadCallableArg(2, a2);
|
||||
}
|
||||
%End
|
||||
|
||||
int registerNdefMessageHandler(const QNdefFilter &filter, SIP_PYOBJECT slot /TypeHint="PYQT_SLOT"/);
|
||||
%MethodCode
|
||||
QObject *receiver;
|
||||
QByteArray slot;
|
||||
|
||||
if ((sipError = pyqt5_qtnfc_get_pyqtslot_parts(a1, &receiver, slot)) == sipErrorNone)
|
||||
{
|
||||
sipRes = sipCpp->registerNdefMessageHandler(*a0, receiver, slot.constData());
|
||||
}
|
||||
else if (sipError == sipErrorContinue)
|
||||
{
|
||||
sipError = sipBadCallableArg(1, a1);
|
||||
}
|
||||
%End
|
||||
|
||||
bool unregisterNdefMessageHandler(int handlerId);
|
||||
|
||||
signals:
|
||||
void targetDetected(QNearFieldTarget *target);
|
||||
void targetLost(QNearFieldTarget *target);
|
||||
|
||||
public:
|
||||
%If (Qt_5_12_0 -)
|
||||
|
||||
enum class AdapterState
|
||||
{
|
||||
Offline,
|
||||
TurningOn,
|
||||
Online,
|
||||
TurningOff,
|
||||
};
|
||||
|
||||
%End
|
||||
%If (Qt_5_12_0 -)
|
||||
bool isSupported() const;
|
||||
%End
|
||||
|
||||
signals:
|
||||
%If (Qt_5_12_0 -)
|
||||
void adapterStateChanged(QNearFieldManager::AdapterState state /ScopesStripped=1/);
|
||||
%End
|
||||
};
|
||||
|
||||
%End
|
||||
%If (Qt_5_5_0 -)
|
||||
QFlags<QNearFieldManager::TargetAccessMode> operator|(QNearFieldManager::TargetAccessMode f1, QFlags<QNearFieldManager::TargetAccessMode> f2);
|
||||
%End
|
||||
|
||||
%ModuleHeaderCode
|
||||
// Imports from QtCore.
|
||||
typedef sipErrorState (*pyqt5_qtnfc_get_pyqtslot_parts_t)(PyObject *, QObject **, QByteArray &);
|
||||
extern pyqt5_qtnfc_get_pyqtslot_parts_t pyqt5_qtnfc_get_pyqtslot_parts;
|
||||
%End
|
||||
|
||||
%ModuleCode
|
||||
// Imports from QtCore.
|
||||
pyqt5_qtnfc_get_pyqtslot_parts_t pyqt5_qtnfc_get_pyqtslot_parts;
|
||||
%End
|
||||
|
||||
%PostInitialisationCode
|
||||
// Imports from QtCore.
|
||||
pyqt5_qtnfc_get_pyqtslot_parts = (pyqt5_qtnfc_get_pyqtslot_parts_t)sipImportSymbol("pyqt5_get_pyqtslot_parts");
|
||||
Q_ASSERT(pyqt5_qtnfc_get_pyqtslot_parts);
|
||||
%End
|
||||
@@ -0,0 +1,70 @@
|
||||
// qnearfieldsharemanager.sip generated by MetaSIP
|
||||
//
|
||||
// This file is part of the QtNfc Python extension module.
|
||||
//
|
||||
// Copyright (c) 2024 Riverbank Computing Limited <info@riverbankcomputing.com>
|
||||
//
|
||||
// This file is part of PyQt5.
|
||||
//
|
||||
// This file may be used under the terms of the GNU General Public License
|
||||
// version 3.0 as published by the Free Software Foundation and appearing in
|
||||
// the file LICENSE included in the packaging of this file. Please review the
|
||||
// following information to ensure the GNU General Public License version 3.0
|
||||
// requirements will be met: http://www.gnu.org/copyleft/gpl.html.
|
||||
//
|
||||
// If you do not wish to use this file under the terms of the GPL version 3.0
|
||||
// then you may purchase a commercial license. For more information contact
|
||||
// info@riverbankcomputing.com.
|
||||
//
|
||||
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
||||
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
|
||||
%If (Qt_5_5_0 -)
|
||||
|
||||
class QNearFieldShareManager : public QObject
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qnearfieldsharemanager.h>
|
||||
%End
|
||||
|
||||
public:
|
||||
explicit QNearFieldShareManager(QObject *parent /TransferThis/ = 0);
|
||||
virtual ~QNearFieldShareManager();
|
||||
|
||||
enum ShareError
|
||||
{
|
||||
NoError,
|
||||
UnknownError,
|
||||
InvalidShareContentError,
|
||||
ShareCanceledError,
|
||||
ShareInterruptedError,
|
||||
ShareRejectedError,
|
||||
UnsupportedShareModeError,
|
||||
ShareAlreadyInProgressError,
|
||||
SharePermissionDeniedError,
|
||||
};
|
||||
|
||||
enum ShareMode
|
||||
{
|
||||
NoShare,
|
||||
NdefShare,
|
||||
FileShare,
|
||||
};
|
||||
|
||||
typedef QFlags<QNearFieldShareManager::ShareMode> ShareModes;
|
||||
static QNearFieldShareManager::ShareModes supportedShareModes();
|
||||
void setShareModes(QNearFieldShareManager::ShareModes modes);
|
||||
QNearFieldShareManager::ShareModes shareModes() const;
|
||||
QNearFieldShareManager::ShareError shareError() const;
|
||||
|
||||
signals:
|
||||
void targetDetected(QNearFieldShareTarget *shareTarget);
|
||||
void shareModesChanged(QNearFieldShareManager::ShareModes modes);
|
||||
void error(QNearFieldShareManager::ShareError error);
|
||||
};
|
||||
|
||||
%End
|
||||
%If (Qt_5_5_0 -)
|
||||
QFlags<QNearFieldShareManager::ShareMode> operator|(QNearFieldShareManager::ShareMode f1, QFlags<QNearFieldShareManager::ShareMode> f2);
|
||||
%End
|
||||
@@ -0,0 +1,45 @@
|
||||
// qnearfieldsharetarget.sip generated by MetaSIP
|
||||
//
|
||||
// This file is part of the QtNfc Python extension module.
|
||||
//
|
||||
// Copyright (c) 2024 Riverbank Computing Limited <info@riverbankcomputing.com>
|
||||
//
|
||||
// This file is part of PyQt5.
|
||||
//
|
||||
// This file may be used under the terms of the GNU General Public License
|
||||
// version 3.0 as published by the Free Software Foundation and appearing in
|
||||
// the file LICENSE included in the packaging of this file. Please review the
|
||||
// following information to ensure the GNU General Public License version 3.0
|
||||
// requirements will be met: http://www.gnu.org/copyleft/gpl.html.
|
||||
//
|
||||
// If you do not wish to use this file under the terms of the GPL version 3.0
|
||||
// then you may purchase a commercial license. For more information contact
|
||||
// info@riverbankcomputing.com.
|
||||
//
|
||||
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
||||
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
|
||||
%If (Qt_5_5_0 -)
|
||||
|
||||
class QNearFieldShareTarget : public QObject /NoDefaultCtors/
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qnearfieldsharetarget.h>
|
||||
%End
|
||||
|
||||
public:
|
||||
virtual ~QNearFieldShareTarget();
|
||||
QNearFieldShareManager::ShareModes shareModes() const;
|
||||
bool share(const QNdefMessage &message);
|
||||
bool share(const QList<QFileInfo> &files);
|
||||
void cancel();
|
||||
bool isShareInProgress() const;
|
||||
QNearFieldShareManager::ShareError shareError() const;
|
||||
|
||||
signals:
|
||||
void error(QNearFieldShareManager::ShareError error);
|
||||
void shareFinished();
|
||||
};
|
||||
|
||||
%End
|
||||
@@ -0,0 +1,132 @@
|
||||
// qnearfieldtarget.sip generated by MetaSIP
|
||||
//
|
||||
// This file is part of the QtNfc Python extension module.
|
||||
//
|
||||
// Copyright (c) 2024 Riverbank Computing Limited <info@riverbankcomputing.com>
|
||||
//
|
||||
// This file is part of PyQt5.
|
||||
//
|
||||
// This file may be used under the terms of the GNU General Public License
|
||||
// version 3.0 as published by the Free Software Foundation and appearing in
|
||||
// the file LICENSE included in the packaging of this file. Please review the
|
||||
// following information to ensure the GNU General Public License version 3.0
|
||||
// requirements will be met: http://www.gnu.org/copyleft/gpl.html.
|
||||
//
|
||||
// If you do not wish to use this file under the terms of the GPL version 3.0
|
||||
// then you may purchase a commercial license. For more information contact
|
||||
// info@riverbankcomputing.com.
|
||||
//
|
||||
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
||||
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
|
||||
%If (Qt_5_5_0 -)
|
||||
|
||||
class QNearFieldTarget : public QObject
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qnearfieldtarget.h>
|
||||
%End
|
||||
|
||||
public:
|
||||
enum Type
|
||||
{
|
||||
ProprietaryTag,
|
||||
NfcTagType1,
|
||||
NfcTagType2,
|
||||
NfcTagType3,
|
||||
NfcTagType4,
|
||||
MifareTag,
|
||||
};
|
||||
|
||||
enum AccessMethod
|
||||
{
|
||||
UnknownAccess,
|
||||
NdefAccess,
|
||||
TagTypeSpecificAccess,
|
||||
LlcpAccess,
|
||||
};
|
||||
|
||||
typedef QFlags<QNearFieldTarget::AccessMethod> AccessMethods;
|
||||
|
||||
enum Error
|
||||
{
|
||||
NoError,
|
||||
UnknownError,
|
||||
UnsupportedError,
|
||||
TargetOutOfRangeError,
|
||||
NoResponseError,
|
||||
ChecksumMismatchError,
|
||||
InvalidParametersError,
|
||||
NdefReadError,
|
||||
NdefWriteError,
|
||||
%If (Qt_5_9_0 -)
|
||||
CommandError,
|
||||
%End
|
||||
};
|
||||
|
||||
class RequestId
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qnearfieldtarget.h>
|
||||
%End
|
||||
|
||||
public:
|
||||
RequestId();
|
||||
RequestId(const QNearFieldTarget::RequestId &other);
|
||||
~RequestId();
|
||||
bool isValid() const;
|
||||
int refCount() const;
|
||||
bool operator<(const QNearFieldTarget::RequestId &other) const;
|
||||
bool operator==(const QNearFieldTarget::RequestId &other) const;
|
||||
bool operator!=(const QNearFieldTarget::RequestId &other) const;
|
||||
};
|
||||
|
||||
explicit QNearFieldTarget(QObject *parent /TransferThis/ = 0);
|
||||
virtual ~QNearFieldTarget();
|
||||
virtual QByteArray uid() const = 0;
|
||||
virtual QUrl url() const;
|
||||
virtual QNearFieldTarget::Type type() const = 0;
|
||||
virtual QNearFieldTarget::AccessMethods accessMethods() const = 0;
|
||||
bool isProcessingCommand() const;
|
||||
virtual bool hasNdefMessage();
|
||||
virtual QNearFieldTarget::RequestId readNdefMessages();
|
||||
virtual QNearFieldTarget::RequestId writeNdefMessages(const QList<QNdefMessage> &messages);
|
||||
virtual QNearFieldTarget::RequestId sendCommand(const QByteArray &command);
|
||||
virtual QNearFieldTarget::RequestId sendCommands(const QList<QByteArray> &commands);
|
||||
virtual bool waitForRequestCompleted(const QNearFieldTarget::RequestId &id, int msecs = 5000) /ReleaseGIL/;
|
||||
QVariant requestResponse(const QNearFieldTarget::RequestId &id);
|
||||
void setResponseForRequest(const QNearFieldTarget::RequestId &id, const QVariant &response, bool emitRequestCompleted = true);
|
||||
|
||||
protected:
|
||||
virtual bool handleResponse(const QNearFieldTarget::RequestId &id, const QByteArray &response);
|
||||
%If (Qt_5_12_0 -)
|
||||
void reportError(QNearFieldTarget::Error error, const QNearFieldTarget::RequestId &id);
|
||||
%End
|
||||
|
||||
signals:
|
||||
void disconnected();
|
||||
void ndefMessageRead(const QNdefMessage &message);
|
||||
void ndefMessagesWritten();
|
||||
void requestCompleted(const QNearFieldTarget::RequestId &id);
|
||||
void error(QNearFieldTarget::Error error, const QNearFieldTarget::RequestId &id);
|
||||
|
||||
public:
|
||||
%If (Qt_5_9_0 -)
|
||||
bool keepConnection() const;
|
||||
%End
|
||||
%If (Qt_5_9_0 -)
|
||||
bool setKeepConnection(bool isPersistent);
|
||||
%End
|
||||
%If (Qt_5_9_0 -)
|
||||
bool disconnect();
|
||||
%End
|
||||
%If (Qt_5_9_0 -)
|
||||
int maxCommandLength() const;
|
||||
%End
|
||||
};
|
||||
|
||||
%End
|
||||
%If (Qt_5_5_0 -)
|
||||
QFlags<QNearFieldTarget::AccessMethod> operator|(QNearFieldTarget::AccessMethod f1, QFlags<QNearFieldTarget::AccessMethod> f2);
|
||||
%End
|
||||
@@ -0,0 +1,60 @@
|
||||
// qqmlndefrecord.sip generated by MetaSIP
|
||||
//
|
||||
// This file is part of the QtNfc Python extension module.
|
||||
//
|
||||
// Copyright (c) 2024 Riverbank Computing Limited <info@riverbankcomputing.com>
|
||||
//
|
||||
// This file is part of PyQt5.
|
||||
//
|
||||
// This file may be used under the terms of the GNU General Public License
|
||||
// version 3.0 as published by the Free Software Foundation and appearing in
|
||||
// the file LICENSE included in the packaging of this file. Please review the
|
||||
// following information to ensure the GNU General Public License version 3.0
|
||||
// requirements will be met: http://www.gnu.org/copyleft/gpl.html.
|
||||
//
|
||||
// If you do not wish to use this file under the terms of the GPL version 3.0
|
||||
// then you may purchase a commercial license. For more information contact
|
||||
// info@riverbankcomputing.com.
|
||||
//
|
||||
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
||||
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
|
||||
%If (Qt_5_5_0 -)
|
||||
|
||||
class QQmlNdefRecord : public QObject
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qqmlndefrecord.h>
|
||||
%End
|
||||
|
||||
public:
|
||||
enum TypeNameFormat
|
||||
{
|
||||
Empty,
|
||||
NfcRtd,
|
||||
Mime,
|
||||
Uri,
|
||||
ExternalRtd,
|
||||
Unknown,
|
||||
};
|
||||
|
||||
explicit QQmlNdefRecord(QObject *parent /TransferThis/ = 0);
|
||||
QQmlNdefRecord(const QNdefRecord &record, QObject *parent /TransferThis/ = 0);
|
||||
%If (Qt_5_6_0 -)
|
||||
virtual ~QQmlNdefRecord();
|
||||
%End
|
||||
QString type() const;
|
||||
void setType(const QString &t);
|
||||
void setTypeNameFormat(QQmlNdefRecord::TypeNameFormat typeNameFormat);
|
||||
QQmlNdefRecord::TypeNameFormat typeNameFormat() const;
|
||||
QNdefRecord record() const;
|
||||
void setRecord(const QNdefRecord &record);
|
||||
|
||||
signals:
|
||||
void typeChanged();
|
||||
void typeNameFormatChanged();
|
||||
void recordChanged();
|
||||
};
|
||||
|
||||
%End
|
||||
Reference in New Issue
Block a user