diff options
author | Andreas Buhr <andreas@andreasbuhr.de> | 2021-02-22 12:37:00 +0100 |
---|---|---|
committer | Andreas Buhr <andreas@andreasbuhr.de> | 2021-02-26 11:49:59 +0100 |
commit | 6e7911f94906571975555438d9a99ddec3b5bb46 (patch) | |
tree | 89ead58100dabc2ffa0509043be0b6b0dde9c7ef /src | |
parent | 143bcc5b8e2adca497c901fa18d754efd97dade0 (diff) |
Remove QBluetoothTransferManager and friends
This patch removes QBluetoothTransferManager,
QBluetoothTransferReply and QBluetoothTransferRequest.
Furthermore, the examples "btfiletransfer" and "picturetransfer"
are removed.
Fixes: QTBUG-75353
Task-number: QTBUG-62877
Change-Id: Ife192d80196249185df877fb6a4cae317d7e44ad
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
Diffstat (limited to 'src')
39 files changed, 7 insertions, 3120 deletions
diff --git a/src/bluetooth/ApiChangesQt6.txt b/src/bluetooth/ApiChangesQt6.txt index 5dd789f5..e330a3b3 100644 --- a/src/bluetooth/ApiChangesQt6.txt +++ b/src/bluetooth/ApiChangesQt6.txt @@ -44,3 +44,10 @@ QLowEnergyController - Remaining QLowEnergyController ctors have been made private. The createPeripheral() and createCentral() functions should be used to obtain QLowEnergyController instances. + +QBluetoothTransferManager +------------------------- + + - QBluetoothTransferManager, QBluetoothTransferRequest, and QBluetoothTransferReply have been removed + without replacement. + diff --git a/src/bluetooth/CMakeLists.txt b/src/bluetooth/CMakeLists.txt index 88a26904..fe5100fe 100644 --- a/src/bluetooth/CMakeLists.txt +++ b/src/bluetooth/CMakeLists.txt @@ -16,9 +16,6 @@ qt_internal_add_module(Bluetooth qbluetoothserviceinfo.cpp qbluetoothserviceinfo.h qbluetoothserviceinfo_p.h qbluetoothsocket.cpp qbluetoothsocket.h qbluetoothsocketbase.cpp qbluetoothsocketbase_p.h - qbluetoothtransfermanager.cpp qbluetoothtransfermanager.h - qbluetoothtransferreply.cpp qbluetoothtransferreply.h qbluetoothtransferreply_p.h - qbluetoothtransferrequest.cpp qbluetoothtransferrequest.h qbluetoothtransferrequest_p.h qbluetoothuuid.cpp qbluetoothuuid.h qleadvertiser_p.h qlowenergyadvertisingdata.cpp qlowenergyadvertisingdata.h @@ -96,13 +93,6 @@ qt_internal_extend_target(Bluetooth CONDITION QT_FEATURE_bluez bluez/gattservice1.cpp bluez/gattservice1_p.h bluez/hcimanager.cpp bluez/hcimanager_p.h bluez/manager.cpp bluez/manager_p.h - bluez/obex_agent.cpp bluez/obex_agent_p.h - bluez/obex_client.cpp bluez/obex_client_p.h - bluez/obex_client1_bluez5.cpp bluez/obex_client1_bluez5_p.h - bluez/obex_manager.cpp bluez/obex_manager_p.h - bluez/obex_objectpush1_bluez5.cpp bluez/obex_objectpush1_bluez5_p.h - bluez/obex_transfer.cpp bluez/obex_transfer_p.h - bluez/obex_transfer1_bluez5.cpp bluez/obex_transfer1_bluez5_p.h bluez/objectmanager.cpp bluez/objectmanager_p.h bluez/profile1.cpp bluez/profile1_p.h bluez/profile1context.cpp bluez/profile1context_p.h @@ -118,7 +108,6 @@ qt_internal_extend_target(Bluetooth CONDITION QT_FEATURE_bluez qbluetoothserviceinfo_bluez.cpp qbluetoothsocket_bluez.cpp qbluetoothsocket_bluez_p.h qbluetoothsocket_bluezdbus.cpp qbluetoothsocket_bluezdbus_p.h - qbluetoothtransferreply_bluez.cpp qbluetoothtransferreply_bluez_p.h LIBRARIES Qt::Concurrent PUBLIC_LIBRARIES # for Linux QEMU (gcc-armv7) on Linux Ubuntu_20_04 (gcc-x86_64) @@ -208,7 +197,6 @@ qt_internal_extend_target(Bluetooth CONDITION MACOS AND NOT QT_FEATURE_bluez AND qbluetoothservicediscoveryagent_macos.mm qbluetoothserviceinfo_macos.mm qbluetoothsocket_macos.mm qbluetoothsocket_macos_p.h - qbluetoothtransferreply_macos.mm qbluetoothtransferreply_macos_p.h qlowenergycontroller_darwin.mm qlowenergycontroller_darwin_p.h DEFINES QT_OSX_BLUETOOTH diff --git a/src/bluetooth/bluez/obex_agent.cpp b/src/bluetooth/bluez/obex_agent.cpp deleted file mode 100644 index 0d64c7ad..00000000 --- a/src/bluetooth/bluez/obex_agent.cpp +++ /dev/null @@ -1,67 +0,0 @@ -/* - * This file was generated by qdbusxml2cpp version 0.8 - * Command line was: qdbusxml2cpp -a obex_agent_p.h:obex_agent.cpp org.openobex.agent.xml org.openobex.Agent - * - * qdbusxml2cpp is Copyright (C) 2020 The Qt Company Ltd. - * - * This is an auto-generated file. - * Do not edit! All changes made to it will be lost. - */ - -#include "obex_agent_p.h" -#include <QtCore/QMetaObject> -#include <QtCore/QByteArray> -#include <QtCore/QList> -#include <QtCore/QMap> -#include <QtCore/QString> -#include <QtCore/QStringList> -#include <QtCore/QVariant> - -/* - * Implementation of adaptor class AgentAdaptor - */ - -AgentAdaptor::AgentAdaptor(QObject *parent) - : QDBusAbstractAdaptor(parent) -{ - // constructor - setAutoRelaySignals(true); -} - -AgentAdaptor::~AgentAdaptor() -{ - // destructor -} - -void AgentAdaptor::Complete(const QDBusObjectPath &in0) -{ - // handle method call org.openobex.Agent.Complete - QMetaObject::invokeMethod(parent(), "Complete", Q_ARG(QDBusObjectPath, in0)); -} - -void AgentAdaptor::Error(const QDBusObjectPath &in0, const QString &in1) -{ - // handle method call org.openobex.Agent.Error - QMetaObject::invokeMethod(parent(), "Error", Q_ARG(QDBusObjectPath, in0), Q_ARG(QString, in1)); -} - -void AgentAdaptor::Progress(const QDBusObjectPath &in0, qulonglong in1) -{ - // handle method call org.openobex.Agent.Progress - QMetaObject::invokeMethod(parent(), "Progress", Q_ARG(QDBusObjectPath, in0), Q_ARG(qulonglong, in1)); -} - -void AgentAdaptor::Release() -{ - // handle method call org.openobex.Agent.Release - QMetaObject::invokeMethod(parent(), "Release"); -} - -QString AgentAdaptor::Request(const QDBusObjectPath &in0) -{ - // handle method call org.openobex.Agent.Request - QString out0; - QMetaObject::invokeMethod(parent(), "Request", Q_RETURN_ARG(QString, out0), Q_ARG(QDBusObjectPath, in0)); - return out0; -} - diff --git a/src/bluetooth/bluez/obex_agent_p.h b/src/bluetooth/bluez/obex_agent_p.h deleted file mode 100644 index 9422007a..00000000 --- a/src/bluetooth/bluez/obex_agent_p.h +++ /dev/null @@ -1,60 +0,0 @@ -/* - * This file was generated by qdbusxml2cpp version 0.8 - * Command line was: qdbusxml2cpp -a obex_agent_p.h:obex_agent.cpp org.openobex.agent.xml org.openobex.Agent - * - * qdbusxml2cpp is Copyright (C) 2020 The Qt Company Ltd. - * - * This is an auto-generated file. - * This file may have been hand-edited. Look for HAND-EDIT comments - * before re-generating it. - */ - -#ifndef OBEX_AGENT_P_H -#define OBEX_AGENT_P_H - -#include <QtCore/QObject> -#include <QtDBus/QtDBus> -#include <QtCore/qcontainerfwd.h> - -/* - * Adaptor class for interface org.openobex.Agent - */ -class AgentAdaptor: public QDBusAbstractAdaptor -{ - Q_OBJECT - Q_CLASSINFO("D-Bus Interface", "org.openobex.Agent") - Q_CLASSINFO("D-Bus Introspection", "" -" <interface name=\"org.openobex.Agent\">\n" -" <method name=\"Release\"/>\n" -" <method name=\"Request\">\n" -" <arg direction=\"in\" type=\"o\"/>\n" -" <arg direction=\"out\" type=\"s\"/>\n" -" </method>\n" -" <method name=\"Progress\">\n" -" <arg direction=\"in\" type=\"o\"/>\n" -" <arg direction=\"in\" type=\"t\"/>\n" -" </method>\n" -" <method name=\"Complete\">\n" -" <arg direction=\"in\" type=\"o\"/>\n" -" </method>\n" -" <method name=\"Error\">\n" -" <arg direction=\"in\" type=\"o\"/>\n" -" <arg direction=\"in\" type=\"s\"/>\n" -" </method>\n" -" </interface>\n" - "") -public: - AgentAdaptor(QObject *parent); - virtual ~AgentAdaptor(); - -public: // PROPERTIES -public Q_SLOTS: // METHODS - void Complete(const QDBusObjectPath &in0); - void Error(const QDBusObjectPath &in0, const QString &in1); - void Progress(const QDBusObjectPath &in0, qulonglong in1); - void Release(); - QString Request(const QDBusObjectPath &in0); -Q_SIGNALS: // SIGNALS -}; - -#endif diff --git a/src/bluetooth/bluez/obex_client.cpp b/src/bluetooth/bluez/obex_client.cpp deleted file mode 100644 index bef9155a..00000000 --- a/src/bluetooth/bluez/obex_client.cpp +++ /dev/null @@ -1,26 +0,0 @@ -/* - * This file was generated by qdbusxml2cpp version 0.8 - * Command line was: qdbusxml2cpp -p obex_client_p.h:obex_client.cpp org.openobex.client.xml org.openobex.Client - * - * qdbusxml2cpp is Copyright (C) 2017 The Qt Company Ltd. - * - * This is an auto-generated file. - * This file may have been hand-edited. Look for HAND-EDIT comments - * before re-generating it. - */ - -#include "obex_client_p.h" - -/* - * Implementation of interface class OrgOpenobexClientInterface - */ - -OrgOpenobexClientInterface::OrgOpenobexClientInterface(const QString &service, const QString &path, const QDBusConnection &connection, QObject *parent) - : QDBusAbstractInterface(service, path, staticInterfaceName(), connection, parent) -{ -} - -OrgOpenobexClientInterface::~OrgOpenobexClientInterface() -{ -} - diff --git a/src/bluetooth/bluez/obex_client1_bluez5.cpp b/src/bluetooth/bluez/obex_client1_bluez5.cpp deleted file mode 100644 index fb66708a..00000000 --- a/src/bluetooth/bluez/obex_client1_bluez5.cpp +++ /dev/null @@ -1,26 +0,0 @@ -/* - * This file was generated by qdbusxml2cpp version 0.8 - * Command line was: qdbusxml2cpp org.bluez.Client1.xml -p asd - * - * qdbusxml2cpp is Copyright (C) 2015 The Qt Company Ltd. - * - * This is an auto-generated file. - * This file may have been hand-edited. Look for HAND-EDIT comments - * before re-generating it. - */ - -#include "obex_client1_bluez5_p.h" - -/* - * Implementation of interface class OrgBluezObexClient1Interface - */ - -OrgBluezObexClient1Interface::OrgBluezObexClient1Interface(const QString &service, const QString &path, const QDBusConnection &connection, QObject *parent) - : QDBusAbstractInterface(service, path, staticInterfaceName(), connection, parent) -{ -} - -OrgBluezObexClient1Interface::~OrgBluezObexClient1Interface() -{ -} - diff --git a/src/bluetooth/bluez/obex_client1_bluez5_p.h b/src/bluetooth/bluez/obex_client1_bluez5_p.h deleted file mode 100644 index ccd5b0d6..00000000 --- a/src/bluetooth/bluez/obex_client1_bluez5_p.h +++ /dev/null @@ -1,63 +0,0 @@ -/* - * This file was generated by qdbusxml2cpp version 0.8 - * Command line was: qdbusxml2cpp -p obex_client1_bluez5_p.h:obex_client1_bluez5_p.h org.bluez.Client1.xml - * - * qdbusxml2cpp is Copyright (C) 2017 The Qt Company Ltd. - * - * This is an auto-generated file. - * Do not edit! All changes made to it will be lost. - */ - -#ifndef OBEX_CLIENT1_BLUEZ5_P_H -#define OBEX_CLIENT1_BLUEZ5_P_H - -#include <QtCore/QObject> -#include <QtCore/QByteArray> -#include <QtCore/QList> -#include <QtCore/QMap> -#include <QtCore/QString> -#include <QtCore/QStringList> -#include <QtCore/QVariant> -#include <QtDBus/QtDBus> - -/* - * Proxy class for interface org.bluez.obex.Client1 - */ -class OrgBluezObexClient1Interface: public QDBusAbstractInterface -{ - Q_OBJECT -public: - static inline const char *staticInterfaceName() - { return "org.bluez.obex.Client1"; } - -public: - OrgBluezObexClient1Interface(const QString &service, const QString &path, const QDBusConnection &connection, QObject *parent = nullptr); - - ~OrgBluezObexClient1Interface(); - -public Q_SLOTS: // METHODS - inline QDBusPendingReply<QDBusObjectPath> CreateSession(const QString &destination, const QVariantMap &args) - { - QList<QVariant> argumentList; - argumentList << QVariant::fromValue(destination) << QVariant::fromValue(args); - return asyncCallWithArgumentList(QStringLiteral("CreateSession"), argumentList); - } - - inline QDBusPendingReply<> RemoveSession(const QDBusObjectPath &session) - { - QList<QVariant> argumentList; - argumentList << QVariant::fromValue(session); - return asyncCallWithArgumentList(QStringLiteral("RemoveSession"), argumentList); - } - -Q_SIGNALS: // SIGNALS -}; - -namespace org { - namespace bluez { - namespace obex { - typedef ::OrgBluezObexClient1Interface Client1; - } - } -} -#endif diff --git a/src/bluetooth/bluez/obex_client_p.h b/src/bluetooth/bluez/obex_client_p.h deleted file mode 100644 index 13b638b6..00000000 --- a/src/bluetooth/bluez/obex_client_p.h +++ /dev/null @@ -1,82 +0,0 @@ -/* - * This file was generated by qdbusxml2cpp version 0.8 - * Command line was: qdbusxml2cpp -p obex_client_p.h:obex_client.cpp org.openobex.client.xml org.openobex.Client - * - * qdbusxml2cpp is Copyright (C) 2017 The Qt Company Ltd. - * - * This is an auto-generated file. - * Do not edit! All changes made to it will be lost. - */ - -#ifndef OBEX_CLIENT_P_H -#define OBEX_CLIENT_P_H - -#include <QtCore/QObject> -#include <QtCore/QByteArray> -#include <QtCore/QList> -#include <QtCore/QMap> -#include <QtCore/QString> -#include <QtCore/QStringList> -#include <QtCore/QVariant> -#include <QtDBus/QtDBus> - -/* - * Proxy class for interface org.openobex.Client - */ -class OrgOpenobexClientInterface: public QDBusAbstractInterface -{ - Q_OBJECT -public: - static inline const char *staticInterfaceName() - { return "org.openobex.Client"; } - -public: - OrgOpenobexClientInterface(const QString &service, const QString &path, const QDBusConnection &connection, QObject *parent = nullptr); - - ~OrgOpenobexClientInterface(); - -public Q_SLOTS: // METHODS - inline QDBusPendingReply<QDBusObjectPath> CreateSession(const QVariantMap &in0) - { - QList<QVariant> argumentList; - argumentList << QVariant::fromValue(in0); - return asyncCallWithArgumentList(QStringLiteral("CreateSession"), argumentList); - } - - inline QDBusPendingReply<> ExchangeBusinessCards(const QVariantMap &in0, const QString &in1, const QString &in2) - { - QList<QVariant> argumentList; - argumentList << QVariant::fromValue(in0) << QVariant::fromValue(in1) << QVariant::fromValue(in2); - return asyncCallWithArgumentList(QStringLiteral("ExchangeBusinessCards"), argumentList); - } - - inline QDBusPendingReply<QString> GetCapabilities(const QVariantMap &in0) - { - QList<QVariant> argumentList; - argumentList << QVariant::fromValue(in0); - return asyncCallWithArgumentList(QStringLiteral("GetCapabilities"), argumentList); - } - - inline QDBusPendingReply<> PullBusinessCard(const QVariantMap &in0, const QString &in1) - { - QList<QVariant> argumentList; - argumentList << QVariant::fromValue(in0) << QVariant::fromValue(in1); - return asyncCallWithArgumentList(QStringLiteral("PullBusinessCard"), argumentList); - } - - inline QDBusPendingReply<> SendFiles(const QVariantMap &in0, const QStringList &in1, const QDBusObjectPath &in2) - { - QList<QVariant> argumentList; - argumentList << QVariant::fromValue(in0) << QVariant::fromValue(in1) << QVariant::fromValue(in2); - return asyncCallWithArgumentList(QStringLiteral("SendFiles"), argumentList); - } - -Q_SIGNALS: // SIGNALS -}; - -namespace org { - namespace openobex { - typedef ::OrgOpenobexClientInterface Client; - } -} -#endif diff --git a/src/bluetooth/bluez/obex_manager.cpp b/src/bluetooth/bluez/obex_manager.cpp deleted file mode 100644 index cc6e0ecb..00000000 --- a/src/bluetooth/bluez/obex_manager.cpp +++ /dev/null @@ -1,26 +0,0 @@ -/* - * This file was generated by qdbusxml2cpp version 0.8 - * Command line was: qdbusxml2cpp -p obex_manager_p.h:obex_manager.cpp org.openobex.all.xml org.openobex.Manager - * - * qdbusxml2cpp is Copyright (C) 2017 The Qt Company Ltd. - * - * This is an auto-generated file. - * This file may have been hand-edited. Look for HAND-EDIT comments - * before re-generating it. - */ - -#include "obex_manager_p.h" - -/* - * Implementation of interface class OrgOpenobexManagerInterface - */ - -OrgOpenobexManagerInterface::OrgOpenobexManagerInterface(const QString &service, const QString &path, const QDBusConnection &connection, QObject *parent) - : QDBusAbstractInterface(service, path, staticInterfaceName(), connection, parent) -{ -} - -OrgOpenobexManagerInterface::~OrgOpenobexManagerInterface() -{ -} - diff --git a/src/bluetooth/bluez/obex_manager_p.h b/src/bluetooth/bluez/obex_manager_p.h deleted file mode 100644 index 822954ab..00000000 --- a/src/bluetooth/bluez/obex_manager_p.h +++ /dev/null @@ -1,65 +0,0 @@ -/* - * This file was generated by qdbusxml2cpp version 0.8 - * Command line was: qdbusxml2cpp -p obex_manager_p.h:obex_manager.cpp org.openobex.all.xml org.openobex.Manager - * - * qdbusxml2cpp is Copyright (C) 2017 The Qt Company Ltd. - * - * This is an auto-generated file. - * Do not edit! All changes made to it will be lost. - */ - -#ifndef OBEX_MANAGER_P_H -#define OBEX_MANAGER_P_H - -#include <QtCore/QObject> -#include <QtCore/QByteArray> -#include <QtCore/QList> -#include <QtCore/QMap> -#include <QtCore/QString> -#include <QtCore/QStringList> -#include <QtCore/QVariant> -#include <QtDBus/QtDBus> - -/* - * Proxy class for interface org.openobex.Manager - */ -class OrgOpenobexManagerInterface: public QDBusAbstractInterface -{ - Q_OBJECT -public: - static inline const char *staticInterfaceName() - { return "org.openobex.Manager"; } - -public: - OrgOpenobexManagerInterface(const QString &service, const QString &path, const QDBusConnection &connection, QObject *parent = nullptr); - - ~OrgOpenobexManagerInterface(); - -public Q_SLOTS: // METHODS - inline QDBusPendingReply<> RegisterAgent(const QDBusObjectPath &in0) - { - QList<QVariant> argumentList; - argumentList << QVariant::fromValue(in0); - return asyncCallWithArgumentList(QStringLiteral("RegisterAgent"), argumentList); - } - - inline QDBusPendingReply<> UnregisterAgent(const QDBusObjectPath &in0) - { - QList<QVariant> argumentList; - argumentList << QVariant::fromValue(in0); - return asyncCallWithArgumentList(QStringLiteral("UnregisterAgent"), argumentList); - } - -Q_SIGNALS: // SIGNALS - void SessionCreated(const QDBusObjectPath &in0); - void SessionRemoved(const QDBusObjectPath &in0); - void TransferCompleted(const QDBusObjectPath &in0, bool in1); - void TransferStarted(const QDBusObjectPath &in0); -}; - -namespace org { - namespace openobex { - typedef ::OrgOpenobexManagerInterface Manager; - } -} -#endif diff --git a/src/bluetooth/bluez/obex_objectpush1_bluez5.cpp b/src/bluetooth/bluez/obex_objectpush1_bluez5.cpp deleted file mode 100644 index 59b94e80..00000000 --- a/src/bluetooth/bluez/obex_objectpush1_bluez5.cpp +++ /dev/null @@ -1,26 +0,0 @@ -/* - * This file was generated by qdbusxml2cpp version 0.8 - * Command line was: qdbusxml2cpp -p obex_objectpush1_bluez5_p.h:obex_objectpush1_bluez5.cpp org.bluez.obex.ObjectPush1.xml - * - * qdbusxml2cpp is Copyright (C) 2017 The Qt Company Ltd. - * - * This is an auto-generated file. - * This file may have been hand-edited. Look for HAND-EDIT comments - * before re-generating it. - */ - -#include "obex_objectpush1_bluez5_p.h" - -/* - * Implementation of interface class OrgBluezObexObjectPush1Interface - */ - -OrgBluezObexObjectPush1Interface::OrgBluezObexObjectPush1Interface(const QString &service, const QString &path, const QDBusConnection &connection, QObject *parent) - : QDBusAbstractInterface(service, path, staticInterfaceName(), connection, parent) -{ -} - -OrgBluezObexObjectPush1Interface::~OrgBluezObexObjectPush1Interface() -{ -} - diff --git a/src/bluetooth/bluez/obex_objectpush1_bluez5_p.h b/src/bluetooth/bluez/obex_objectpush1_bluez5_p.h deleted file mode 100644 index 5fa1703b..00000000 --- a/src/bluetooth/bluez/obex_objectpush1_bluez5_p.h +++ /dev/null @@ -1,100 +0,0 @@ -/* - * This file was generated by qdbusxml2cpp version 0.8 - * Command line was: qdbusxml2cpp -p obex_objectpush1_bluez5_p.h:obex_objectpush1_bluez5.cpp org.bluez.obex.ObjectPush1.xml - * - * qdbusxml2cpp is Copyright (C) 2017 The Qt Company Ltd. - * - * This is an auto-generated file. - * Do not edit! All changes made to it will be lost. - */ - -#ifndef OBEX_OBJECTPUSH1_BLUEZ5_P_H -#define OBEX_OBJECTPUSH1_BLUEZ5_P_H - -#include <QtCore/QObject> -#include <QtCore/QByteArray> -#include <QtCore/QList> -#include <QtCore/QMap> -#include <QtCore/QString> -#include <QtCore/QStringList> -#include <QtCore/QVariant> -#include <QtDBus/QtDBus> - -/* - * Proxy class for interface org.bluez.obex.ObjectPush1 - */ -class OrgBluezObexObjectPush1Interface: public QDBusAbstractInterface -{ - Q_OBJECT -public: - static inline const char *staticInterfaceName() - { return "org.bluez.obex.ObjectPush1"; } - -public: - OrgBluezObexObjectPush1Interface(const QString &service, const QString &path, const QDBusConnection &connection, QObject *parent = nullptr); - - ~OrgBluezObexObjectPush1Interface(); - -public Q_SLOTS: // METHODS - inline QDBusPendingReply<QDBusObjectPath, QVariantMap> ExchangeBusinessCards(const QString &clientfile, const QString &targetfile) - { - QList<QVariant> argumentList; - argumentList << QVariant::fromValue(clientfile) << QVariant::fromValue(targetfile); - return asyncCallWithArgumentList(QStringLiteral("ExchangeBusinessCards"), argumentList); - } - inline QDBusReply<QDBusObjectPath> ExchangeBusinessCards(const QString &clientfile, const QString &targetfile, QVariantMap &properties) - { - QList<QVariant> argumentList; - argumentList << QVariant::fromValue(clientfile) << QVariant::fromValue(targetfile); - QDBusMessage reply = callWithArgumentList(QDBus::Block, QStringLiteral("ExchangeBusinessCards"), argumentList); - if (reply.type() == QDBusMessage::ReplyMessage && reply.arguments().count() == 2) { - properties = qdbus_cast<QVariantMap>(reply.arguments().at(1)); - } - return reply; - } - - inline QDBusPendingReply<QDBusObjectPath, QVariantMap> PullBusinessCard(const QString &targetfile) - { - QList<QVariant> argumentList; - argumentList << QVariant::fromValue(targetfile); - return asyncCallWithArgumentList(QStringLiteral("PullBusinessCard"), argumentList); - } - inline QDBusReply<QDBusObjectPath> PullBusinessCard(const QString &targetfile, QVariantMap &properties) - { - QList<QVariant> argumentList; - argumentList << QVariant::fromValue(targetfile); - QDBusMessage reply = callWithArgumentList(QDBus::Block, QStringLiteral("PullBusinessCard"), argumentList); - if (reply.type() == QDBusMessage::ReplyMessage && reply.arguments().count() == 2) { - properties = qdbus_cast<QVariantMap>(reply.arguments().at(1)); - } - return reply; - } - - inline QDBusPendingReply<QDBusObjectPath, QVariantMap> SendFile(const QString &sourcefile) - { - QList<QVariant> argumentList; - argumentList << QVariant::fromValue(sourcefile); - return asyncCallWithArgumentList(QStringLiteral("SendFile"), argumentList); - } - inline QDBusReply<QDBusObjectPath> SendFile(const QString &sourcefile, QVariantMap &properties) - { - QList<QVariant> argumentList; - argumentList << QVariant::fromValue(sourcefile); - QDBusMessage reply = callWithArgumentList(QDBus::Block, QStringLiteral("SendFile"), argumentList); - if (reply.type() == QDBusMessage::ReplyMessage && reply.arguments().count() == 2) { - properties = qdbus_cast<QVariantMap>(reply.arguments().at(1)); - } - return reply; - } - -Q_SIGNALS: // SIGNALS -}; - -namespace org { - namespace bluez { - namespace obex { - typedef ::OrgBluezObexObjectPush1Interface ObjectPush1; - } - } -} -#endif diff --git a/src/bluetooth/bluez/obex_transfer.cpp b/src/bluetooth/bluez/obex_transfer.cpp deleted file mode 100644 index be27362f..00000000 --- a/src/bluetooth/bluez/obex_transfer.cpp +++ /dev/null @@ -1,26 +0,0 @@ -/* - * This file was generated by qdbusxml2cpp version 0.8 - * Command line was: qdbusxml2cpp -p obex_transfer_p.h:obex_transfer.cpp org.openobex.transfer.xml org.openobex.Transfer - * - * qdbusxml2cpp is Copyright (C) 2017 The Qt Company Ltd. - * - * This is an auto-generated file. - * This file may have been hand-edited. Look for HAND-EDIT comments - * before re-generating it. - */ - -#include "obex_transfer_p.h" - -/* - * Implementation of interface class OrgOpenobexTransferInterface - */ - -OrgOpenobexTransferInterface::OrgOpenobexTransferInterface(const QString &service, const QString &path, const QDBusConnection &connection, QObject *parent) - : QDBusAbstractInterface(service, path, staticInterfaceName(), connection, parent) -{ -} - -OrgOpenobexTransferInterface::~OrgOpenobexTransferInterface() -{ -} - diff --git a/src/bluetooth/bluez/obex_transfer1_bluez5.cpp b/src/bluetooth/bluez/obex_transfer1_bluez5.cpp deleted file mode 100644 index 8cddd05e..00000000 --- a/src/bluetooth/bluez/obex_transfer1_bluez5.cpp +++ /dev/null @@ -1,26 +0,0 @@ -/* - * This file was generated by qdbusxml2cpp version 0.8 - * Command line was: qdbusxml2cpp org.bluez.obex.Transfer1.xml -p obex_transfer1_bluez5 - * - * qdbusxml2cpp is Copyright (C) 2015 The Qt Company Ltd. - * - * This is an auto-generated file. - * This file may have been hand-edited. Look for HAND-EDIT comments - * before re-generating it. - */ - -#include "obex_transfer1_bluez5_p.h" - -/* - * Implementation of interface class OrgBluezObexTransfer1Interface - */ - -OrgBluezObexTransfer1Interface::OrgBluezObexTransfer1Interface(const QString &service, const QString &path, const QDBusConnection &connection, QObject *parent) - : QDBusAbstractInterface(service, path, staticInterfaceName(), connection, parent) -{ -} - -OrgBluezObexTransfer1Interface::~OrgBluezObexTransfer1Interface() -{ -} - diff --git a/src/bluetooth/bluez/obex_transfer1_bluez5_p.h b/src/bluetooth/bluez/obex_transfer1_bluez5_p.h deleted file mode 100644 index ccde588e..00000000 --- a/src/bluetooth/bluez/obex_transfer1_bluez5_p.h +++ /dev/null @@ -1,91 +0,0 @@ -/* - * This file was generated by qdbusxml2cpp version 0.8 - * Command line was: qdbusxml2cpp -p obex_transfer1_bluez5_p.h:obex_transfer1_bluez5_p.h org.bluez.obex.Transfer1.xml - * - * qdbusxml2cpp is Copyright (C) 2017 The Qt Company Ltd. - * - * This is an auto-generated file. - * Do not edit! All changes made to it will be lost. - */ - -#ifndef OBEX_TRANSFER1_BLUEZ5_P_H -#define OBEX_TRANSFER1_BLUEZ5_P_H - -#include <QtCore/QObject> -#include <QtCore/QByteArray> -#include <QtCore/QList> -#include <QtCore/QMap> -#include <QtCore/QString> -#include <QtCore/QStringList> -#include <QtCore/QVariant> -#include <QtDBus/QtDBus> - -/* - * Proxy class for interface org.bluez.obex.Transfer1 - */ -class OrgBluezObexTransfer1Interface: public QDBusAbstractInterface -{ - Q_OBJECT -public: - static inline const char *staticInterfaceName() - { return "org.bluez.obex.Transfer1"; } - -public: - OrgBluezObexTransfer1Interface(const QString &service, const QString &path, const QDBusConnection &connection, QObject *parent = nullptr); - - ~OrgBluezObexTransfer1Interface(); - - Q_PROPERTY(QString Filename READ filename) - inline QString filename() const - { return qvariant_cast< QString >(property("Filename")); } - - Q_PROPERTY(QString Name READ name) - inline QString name() const - { return qvariant_cast< QString >(property("Name")); } - - Q_PROPERTY(QDBusObjectPath Session READ session) - inline QDBusObjectPath session() const - { return qvariant_cast< QDBusObjectPath >(property("Session")); } - - Q_PROPERTY(qulonglong Size READ size) - inline qulonglong size() const - { return qvariant_cast< qulonglong >(property("Size")); } - - Q_PROPERTY(QString Status READ status) - inline QString status() const - { return qvariant_cast< QString >(property("Status")); } - - Q_PROPERTY(qulonglong Transferred READ transferred) - inline qulonglong transferred() const - { return qvariant_cast< qulonglong >(property("Transferred")); } - -public Q_SLOTS: // METHODS - inline QDBusPendingReply<> Cancel() - { - QList<QVariant> argumentList; - return asyncCallWithArgumentList(QStringLiteral("Cancel"), argumentList); - } - - inline QDBusPendingReply<> Resume() - { - QList<QVariant> argumentList; - return asyncCallWithArgumentList(QStringLiteral("Resume"), argumentList); - } - - inline QDBusPendingReply<> Suspend() - { - QList<QVariant> argumentList; - return asyncCallWithArgumentList(QStringLiteral("Suspend"), argumentList); - } - -Q_SIGNALS: // SIGNALS -}; - -namespace org { - namespace bluez { - namespace obex { - typedef ::OrgBluezObexTransfer1Interface Transfer1; - } - } -} -#endif diff --git a/src/bluetooth/bluez/obex_transfer_p.h b/src/bluetooth/bluez/obex_transfer_p.h deleted file mode 100644 index b8fa0a5d..00000000 --- a/src/bluetooth/bluez/obex_transfer_p.h +++ /dev/null @@ -1,59 +0,0 @@ -/* - * This file was generated by qdbusxml2cpp version 0.8 - * Command line was: qdbusxml2cpp -p obex_transfer_p.h:obex_transfer.cpp org.openobex.transfer.xml org.openobex.Transfer - * - * qdbusxml2cpp is Copyright (C) 2017 The Qt Company Ltd. - * - * This is an auto-generated file. - * Do not edit! All changes made to it will be lost. - */ - -#ifndef OBEX_TRANSFER_P_H -#define OBEX_TRANSFER_P_H - -#include <QtCore/QObject> -#include <QtCore/QByteArray> -#include <QtCore/QList> -#include <QtCore/QMap> -#include <QtCore/QString> -#include <QtCore/QStringList> -#include <QtCore/QVariant> -#include <QtDBus/QtDBus> - -/* - * Proxy class for interface org.openobex.Transfer - */ -class OrgOpenobexTransferInterface: public QDBusAbstractInterface -{ - Q_OBJECT -public: - static inline const char *staticInterfaceName() - { return "org.openobex.Transfer"; } - -public: - OrgOpenobexTransferInterface(const QString &service, const QString &path, const QDBusConnection &connection, QObject *parent = nullptr); - - ~OrgOpenobexTransferInterface(); - -public Q_SLOTS: // METHODS - inline QDBusPendingReply<> Cancel() - { - QList<QVariant> argumentList; - return asyncCallWithArgumentList(QStringLiteral("Cancel"), argumentList); - } - - inline QDBusPendingReply<QVariantMap> GetProperties() - { - QList<QVariant> argumentList; - return asyncCallWithArgumentList(QStringLiteral("GetProperties"), argumentList); - } - -Q_SIGNALS: // SIGNALS -}; - -namespace org { - namespace openobex { - typedef ::OrgOpenobexTransferInterface Transfer; - } -} -#endif diff --git a/src/bluetooth/bluez/org.bluez.Client1.xml b/src/bluetooth/bluez/org.bluez.Client1.xml deleted file mode 100644 index 8a5a25c1..00000000 --- a/src/bluetooth/bluez/org.bluez.Client1.xml +++ /dev/null @@ -1,15 +0,0 @@ -<!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN" - "http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd"> -<node> - <interface name="org.bluez.obex.Client1"> - <method name="CreateSession"> - <arg name="destination" type="s" direction="in"/> - <arg name="args" type="a{sv}" direction="in"/> - <annotation name="org.qtproject.QtDBus.QtTypeName.In1" value="QVariantMap"/> - <arg name="session" type="o" direction="out"/> - </method> - <method name="RemoveSession"> - <arg name="session" type="o" direction="in"/> - </method> - </interface> -</node> diff --git a/src/bluetooth/bluez/org.bluez.obex.ObjectPush1.xml b/src/bluetooth/bluez/org.bluez.obex.ObjectPush1.xml deleted file mode 100644 index 651f21a5..00000000 --- a/src/bluetooth/bluez/org.bluez.obex.ObjectPush1.xml +++ /dev/null @@ -1,25 +0,0 @@ -<!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN" - "http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd"> -<node> - <interface name="org.bluez.obex.ObjectPush1"> - <method name="SendFile"> - <arg name="sourcefile" type="s" direction="in"/> - <arg name="transfer" type="o" direction="out"/> - <arg name="properties" type="a{sv}" direction="out"/> - <annotation name="org.qtproject.QtDBus.QtTypeName.Out1" value="QVariantMap"/> - </method> - <method name="PullBusinessCard"> - <arg name="targetfile" type="s" direction="in"/> - <arg name="transfer" type="o" direction="out"/> - <arg name="properties" type="a{sv}" direction="out"/> - <annotation name="org.qtproject.QtDBus.QtTypeName.Out1" value="QVariantMap"/> - </method> - <method name="ExchangeBusinessCards"> - <arg name="clientfile" type="s" direction="in"/> - <arg name="targetfile" type="s" direction="in"/> - <arg name="transfer" type="o" direction="out"/> - <arg name="properties" type="a{sv}" direction="out"/> - <annotation name="org.qtproject.QtDBus.QtTypeName.Out1" value="QVariantMap"/> - </method> - </interface> -</node> diff --git a/src/bluetooth/bluez/org.bluez.obex.Transfer1.xml b/src/bluetooth/bluez/org.bluez.obex.Transfer1.xml deleted file mode 100644 index 4ee76f7d..00000000 --- a/src/bluetooth/bluez/org.bluez.obex.Transfer1.xml +++ /dev/null @@ -1,16 +0,0 @@ -<!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN" - "http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd"> -<node> - <interface name="org.bluez.obex.Transfer1"> - <method name="Suspend"/> - <method name="Resume"/> - <method name="Cancel"/> - <property name="Status" type="s" access="read"/> - <property name="Name" type="s" access="read"/> - <property name="Size" type="t" access="read"/> - <property name="Filename" type="s" access="read"/> - <property name="Transferred" type="t" access="read"/> - <property name="Session" type="o" access="read"/> - </interface> -</node> - diff --git a/src/bluetooth/bluez/org.openobex.agent.xml b/src/bluetooth/bluez/org.openobex.agent.xml deleted file mode 100644 index d21f3149..00000000 --- a/src/bluetooth/bluez/org.openobex.agent.xml +++ /dev/null @@ -1,24 +0,0 @@ -<!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN" -"http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd"> -<node> - <interface name="org.openobex.Agent"> - <method name="Release"> - </method> - <method name="Request"> - <arg type="o" direction="in"/> - <arg type="s" direction="out"/> - </method> - <method name="Progress"> - <arg type="o" direction="in"/> - <arg type="t" direction="in"/> - </method> - <method name="Complete"> - <arg type="o" direction="in"/> - </method> - <method name="Error"> - <arg type="o" direction="in"/> - <arg type="s" direction="in"/> - </method> - </interface> -</node> - diff --git a/src/bluetooth/bluez/org.openobex.all.xml b/src/bluetooth/bluez/org.openobex.all.xml deleted file mode 100644 index 4e5b65b2..00000000 --- a/src/bluetooth/bluez/org.openobex.all.xml +++ /dev/null @@ -1,31 +0,0 @@ -<!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN" -"http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd"> -<node name="/"> - <interface name="org.freedesktop.DBus.Introspectable"> - <method name="Introspect"> - <arg type="s" direction="out"/> - </method> - </interface> - <interface name="org.openobex.Manager"> - <method name="RegisterAgent"> - <arg type="o" direction="in"/> - </method> - <method name="UnregisterAgent"> - <arg type="o" direction="in"/> - </method> - <signal name="TransferStarted"> - <arg type="o"/> - </signal> - <signal name="TransferCompleted"> - <arg type="o"/> - <arg type="b"/> - </signal> - <signal name="SessionCreated"> - <arg type="o"/> - </signal> - <signal name="SessionRemoved"> - <arg type="o"/> - </signal> - </interface> -</node> - diff --git a/src/bluetooth/bluez/org.openobex.client.xml b/src/bluetooth/bluez/org.openobex.client.xml deleted file mode 100644 index fad2f6ef..00000000 --- a/src/bluetooth/bluez/org.openobex.client.xml +++ /dev/null @@ -1,40 +0,0 @@ -<!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN" -"http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd"> -<node name="/"> - <interface name="org.freedesktop.DBus.Introspectable"> - <method name="Introspect"> - <arg type="s" direction="out"/> - </method> - </interface> - <interface name="org.openobex.Client"> - <method name="SendFiles"> - <arg type="a{sv}" direction="in"/> - <annotation name="com.trolltech.QtDBus.QtTypeName.In0" value="QVariantMap"/> - <arg type="as" direction="in"/> - <arg type="o" direction="in"/> - </method> - <method name="PullBusinessCard"> - <arg type="a{sv}" direction="in"/> - <annotation name="com.trolltech.QtDBus.QtTypeName.In0" value="QVariantMap"/> - <arg type="s" direction="in"/> - </method> - <method name="ExchangeBusinessCards"> - <arg type="a{sv}" direction="in"/> - <annotation name="com.trolltech.QtDBus.QtTypeName.In0" value="QVariantMap"/> - <arg type="s" direction="in"/> - <arg type="s" direction="in"/> - </method> - <method name="CreateSession"> - <arg type="a{sv}" direction="in"/> - <annotation name="com.trolltech.QtDBus.QtTypeName.In0" value="QVariantMap"/> - <arg type="o" direction="out"/> - </method> - <method name="GetCapabilities"> - <arg type="a{sv}" direction="in"/> - <annotation name="com.trolltech.QtDBus.QtTypeName.In0" value="QVariantMap"/> - <arg type="s" direction="out"/> - </method> - </interface> - <node name="org"/> -</node> - diff --git a/src/bluetooth/bluez/org.openobex.transfer.xml b/src/bluetooth/bluez/org.openobex.transfer.xml deleted file mode 100644 index 21033665..00000000 --- a/src/bluetooth/bluez/org.openobex.transfer.xml +++ /dev/null @@ -1,19 +0,0 @@ -<!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN" -"http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd"> -<node name="/"> - <interface name="org.freedesktop.DBus.Introspectable"> - <method name="Introspect"> - <arg type="s" direction="out"/> - </method> - </interface> - <interface name="org.openobex.Transfer"> - <method name="GetProperties"> - <arg type="a{sv}" direction="out"/> - <annotation name="com.trolltech.QtDBus.QtTypeName.Out0" value="QVariantMap"/> - </method> - <method name="Cancel"> - </method> - </interface> - <node name="org"/> -</node> - diff --git a/src/bluetooth/doc/snippets/doc_src_qtbluetooth.cpp b/src/bluetooth/doc/snippets/doc_src_qtbluetooth.cpp index bb3b702c..870f7cdf 100644 --- a/src/bluetooth/doc/snippets/doc_src_qtbluetooth.cpp +++ b/src/bluetooth/doc/snippets/doc_src_qtbluetooth.cpp @@ -57,9 +57,6 @@ #include <QtCore/QObject> #include <QtBluetooth/QBluetoothDeviceDiscoveryAgent> #include <QtBluetooth/QBluetoothServiceDiscoveryAgent> -#include <QtBluetooth/QBluetoothTransferManager> -#include <QtBluetooth/QBluetoothTransferRequest> -#include <QtBluetooth/QBluetoothTransferReply> #include <QtBluetooth/QLowEnergyController> #include <QtBluetooth/QLowEnergyService> @@ -84,8 +81,6 @@ public: public slots: void deviceDiscovered(const QBluetoothDeviceInfo &device); void serviceDiscovered(const QBluetoothServiceInfo &service); - void transferFinished(QBluetoothTransferReply* reply); - void error(QBluetoothTransferReply::TransferError errorType); void characteristicChanged(const QLowEnergyCharacteristic& ,const QByteArray&); }; @@ -160,40 +155,6 @@ void MyClass::serviceDiscovered(const QBluetoothServiceInfo &service) } //! [service_discovery] -void MyClass::objectPush() -{ -//! [sendfile] -// Create a transfer manager -QBluetoothTransferManager *transferManager = new QBluetoothTransferManager(this); - -// Create the transfer request and file to be sent -QBluetoothAddress remoteAddress("00:11:22:33:44:55:66"); -QBluetoothTransferRequest request(remoteAddress); -QFile *file = new QFile("testfile.txt"); - -// Ask the transfer manager to send it -QBluetoothTransferReply *reply = transferManager->put(request, file); -if (reply->error() == QBluetoothTransferReply::NoError) { - - // Connect to the reply's signals to be informed about the status and do cleanups when done - QObject::connect(reply, SIGNAL(finished(QBluetoothTransferReply*)), - this, SLOT(transferFinished(QBluetoothTransferReply*))); - QObject::connect(reply, SIGNAL(error(QBluetoothTransferReply::TransferError)), - this, SLOT(error(QBluetoothTransferReply::TransferError))); -} else { - qWarning() << "Cannot push testfile.txt:" << reply->errorString(); -} -//! [sendfile] -} - -void MyClass::transferFinished(QBluetoothTransferReply* /*reply*/) -{ -} - -void MyClass::error(QBluetoothTransferReply::TransferError /*errorType*/) -{ -} - void MyClass::characteristicChanged(const QLowEnergyCharacteristic &, const QByteArray &) { } diff --git a/src/bluetooth/doc/src/bluetooth-index.qdoc b/src/bluetooth/doc/src/bluetooth-index.qdoc index 0f5b96d6..4f301e88 100644 --- a/src/bluetooth/doc/src/bluetooth-index.qdoc +++ b/src/bluetooth/doc/src/bluetooth-index.qdoc @@ -188,7 +188,6 @@ A quick way to enable all QtBluetooth logging is to add the following line to th \li QML \list \li \l {scanner}{QML Bluetooth Scanner} - \li \l {picturetransfer}{QML Bluetooth Picture Push} \li \l {pingpong}{QML Bluetooth PingPong} \li \l {chat}{QML Bluetooth Chat} \li \l {heartrate-game}{Bluetooth Low Energy Heart Rate Game} @@ -199,7 +198,6 @@ A quick way to enable all QtBluetooth logging is to add the following line to th \list \li \l {btchat}{Bluetooth Chat} \li \l {btscanner}{Bluetooth Scanner} - \li \l {btfiletransfer}{Bluetooth File Transfer} \endlist \endlist diff --git a/src/bluetooth/doc/src/bluetooth-overview.qdoc b/src/bluetooth/doc/src/bluetooth-overview.qdoc index 60e886a3..9e6c93e5 100644 --- a/src/bluetooth/doc/src/bluetooth-overview.qdoc +++ b/src/bluetooth/doc/src/bluetooth-overview.qdoc @@ -82,18 +82,6 @@ \snippet doc_src_qtbluetooth.cpp device_discovery - \section1 Pushing Files to Remote Devices - - Once the desired device was found, there are two main use cases provided by Qt Bluetooth. The - simpler one is to send files via the Obex Object Push Profile (OPP). As the name describes, this - profile can push files from one device to another. Currently it is not possible to pull files - or browse the remote file system. The profile does not require the two devices to be - paired before exchanging data. To push files to remote devices, create a - QBluetoothTransferRequest and ask the QBluetoothTransferManager to push the file contained in - the request by calling its \l {QBluetoothTransferManager::put()}{put()} function. - - \snippet doc_src_qtbluetooth.cpp sendfile - \section1 Exchanging Data Between Devices The more flexible approach for communication between two Bluetooth enabled devices, is to diff --git a/src/bluetooth/doc/src/examples.qdoc b/src/bluetooth/doc/src/examples.qdoc index e33ae4d8..9cfc1b1d 100644 --- a/src/bluetooth/doc/src/examples.qdoc +++ b/src/bluetooth/doc/src/examples.qdoc @@ -48,9 +48,6 @@ \li \l{btchat}{Bluetooth Chat} \li Simple chat server and client via Bluetooth. \row - \li \l{btfiletransfer}{Bluetooth File Transfer} - \li Transfer files between Bluetooth devices. - \row \li \l{btscanner}{Bluetooth Scanner} \li Scan for Bluetooth devices. \endtable @@ -64,9 +61,6 @@ \li \l{chat}{QML Bluetooth Chat Example} \li Simple chat client via Bluetooth. \row - \li \l{picturetransfer}{QML Bluetooth Picture Push Example} - \li Transfer pictures between Bluetooth devices. - \row \li \l{pingpong}{QML Bluetooth PingPong} \li Ping pong game demonstrating Bluetooth socket communication between two devices. \row diff --git a/src/bluetooth/qbluetoothtransfermanager.cpp b/src/bluetooth/qbluetoothtransfermanager.cpp deleted file mode 100644 index 53798e55..00000000 --- a/src/bluetooth/qbluetoothtransfermanager.cpp +++ /dev/null @@ -1,136 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the QtBluetooth module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or (at your option) the GNU General -** Public license version 3 or any later version approved by the KDE Free -** Qt Foundation. The licenses are as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-2.0.html and -** https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "qbluetoothtransfermanager.h" -#include "qbluetoothtransferrequest.h" -#include "qbluetoothtransferreply.h" -#if QT_CONFIG(bluez) -#include "qbluetoothtransferreply_bluez_p.h" -#elif QT_OSX_BLUETOOTH -#include "qbluetoothtransferreply_macos_p.h" -#else -#if !defined(QT_ANDROID_BLUETOOTH) && !defined(QT_IOS_BLUETOOTH) -#include "dummy/dummy_helper_p.h" -#endif -#endif - -QT_BEGIN_NAMESPACE - -/*! - \class QBluetoothTransferManager - \inmodule QtBluetooth - \brief The QBluetoothTransferManager class transfers data to another device - using Object Push Profile (OPP). - - \since 5.2 - - QBluetoothTransferManager uses OBEX to send put commands to remote devices. A typical - OBEX transfer is initialized as follows: - - \snippet doc_src_qtbluetooth.cpp sendfile - - Note that this API is not currently supported on Android. -*/ - -/*! - \fn QBluetoothTransferReply *QBluetoothTransferManager::put(const QBluetoothTransferRequest &request, QIODevice *data) - - Sends the contents of \a data to the remote device identified by \a request, and returns a new - QBluetoothTransferReply that can be used to track the request's progress. \a data must remain valid - until the \l finished() signal is emitted. - - The returned \l QBluetoothTransferReply object must be immediately checked for its - \l {QBluetoothTransferReply::error()}{error()} state. This is required in case - this function detects an error during the initialization of the - \l QBluetoothTransferReply. In such cases \l {QBluetoothTransferReply::isFinished()} returns - \c true as well. - - If the platform does not support the Object Push profile, this function will return \c 0. -*/ - - - -/*! - \fn void QBluetoothTransferManager::finished(QBluetoothTransferReply *reply) - - This signal is emitted when the transfer for \a reply finishes. -*/ - -/*! - Constructs a new QBluetoothTransferManager with \a parent. -*/ -QBluetoothTransferManager::QBluetoothTransferManager(QObject *parent) -: QObject(parent) -{ - qRegisterMetaType<QBluetoothTransferReply*>(); - qRegisterMetaType<QBluetoothTransferReply::TransferError>(); -} - -/*! - Destroys the QBluetoothTransferManager. -*/ -QBluetoothTransferManager::~QBluetoothTransferManager() -{ -} - -QBluetoothTransferReply *QBluetoothTransferManager::put(const QBluetoothTransferRequest &request, - QIODevice *data) -{ -#if QT_CONFIG(bluez) - QBluetoothTransferReplyBluez *rep = new QBluetoothTransferReplyBluez(data, request, this); - connect(rep, SIGNAL(finished(QBluetoothTransferReply*)), this, SIGNAL(finished(QBluetoothTransferReply*))); - return rep; -#elif QT_OSX_BLUETOOTH - QBluetoothTransferReply *reply = new QBluetoothTransferReplyOSX(data, request, this); - connect(reply, SIGNAL(finished(QBluetoothTransferReply*)), this, SIGNAL(finished(QBluetoothTransferReply*))); - return reply; -#else - // Android, iOS, and Win/WinRT have no implementation -#if !defined(QT_ANDROID_BLUETOOTH) && !defined(QT_IOS_BLUETOOTH) && !defined(QT_WINRT_BLUETOOTH) && !defined(QT_WIN_BLUETOOTH) - printDummyWarning(); -#endif - Q_UNUSED(request); - Q_UNUSED(data); - return 0; -#endif -} - -QT_END_NAMESPACE - -#include "moc_qbluetoothtransfermanager.cpp" diff --git a/src/bluetooth/qbluetoothtransfermanager.h b/src/bluetooth/qbluetoothtransfermanager.h deleted file mode 100644 index 98850392..00000000 --- a/src/bluetooth/qbluetoothtransfermanager.h +++ /dev/null @@ -1,73 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the QtBluetooth module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or (at your option) the GNU General -** Public license version 3 or any later version approved by the KDE Free -** Qt Foundation. The licenses are as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-2.0.html and -** https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QBLUETOOTHTRANSFERMANAGER_H -#define QBLUETOOTHTRANSFERMANAGER_H - -#include <QtBluetooth/qtbluetoothglobal.h> -#include <QtBluetooth/QBluetoothAddress> - -#include <QtCore/QObject> - -QT_FORWARD_DECLARE_CLASS(QIODevice) - -QT_BEGIN_NAMESPACE - -class QBluetoothTransferReply; -class QBluetoothTransferRequest; -class QBluetoothTranferManagerPrivate; - -class Q_BLUETOOTH_EXPORT QBluetoothTransferManager : public QObject -{ - Q_OBJECT - -public: - explicit QBluetoothTransferManager(QObject *parent = nullptr); - ~QBluetoothTransferManager(); - - QBluetoothTransferReply *put(const QBluetoothTransferRequest &request, QIODevice *data); - -Q_SIGNALS: - void finished(QBluetoothTransferReply *reply); - -}; - -QT_END_NAMESPACE - -#endif // QBLUETOOTHTRANSFERMANAGER_H diff --git a/src/bluetooth/qbluetoothtransferreply.cpp b/src/bluetooth/qbluetoothtransferreply.cpp deleted file mode 100644 index a5da8f8f..00000000 --- a/src/bluetooth/qbluetoothtransferreply.cpp +++ /dev/null @@ -1,214 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the QtBluetooth module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or (at your option) the GNU General -** Public license version 3 or any later version approved by the KDE Free -** Qt Foundation. The licenses are as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-2.0.html and -** https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "qbluetoothtransferreply.h" -#include "qbluetoothtransferreply_p.h" -#include "qbluetoothaddress.h" - -QT_BEGIN_NAMESPACE - -/*! - \class QBluetoothTransferReply - \inmodule QtBluetooth - \brief The QBluetoothTransferReply class stores the response for a data - transfer request. - - \since 5.2 - - In additional to a copy of the QBluetoothTransferRequest object used to create the request, - QBluetoothTransferReply contains the contents of the reply itself. - - After the file transfer has started, QBluetoothTransferReply emits the transferProgress() signal, - which indicates the progress of the file transfer. -*/ - -/*! - \enum QBluetoothTransferReply::TransferError - - This enum describes the type of error that occurred - - \value NoError No error. - \value UnknownError Unknown error, no better enum available. - \value FileNotFoundError Unable to open the file specified. - \value HostNotFoundError Unable to connect to the target host. - \value UserCanceledTransferError User terminated the transfer. - \value IODeviceNotReadableError File was not open before initiating the sending command. - \value ResourceBusyError Unable to access the resource.. - \value SessionError An error occurred during the handling of the session. This enum was - introduced by Qt 5.4. -*/ - - - -/*! - \fn QBluetoothTransferReply::abort() - - Aborts this reply. -*/ -void QBluetoothTransferReply::abort() -{ -} - -/*! - \fn void QBluetoothTransferReply::finished(QBluetoothTransferReply *reply) - - This signal is emitted when the transfer is complete for \a reply. - - To avoid the loss of signal emissions it is recommend to immidiately connect - to this signal once a \c QBluetoothTransferReply instance has been created. -*/ - -/*! - \fn void QBluetoothTransferReply::transferProgress(qint64 bytesTransferred, qint64 bytesTotal) - - This signal is emitted whenever data is transferred. The \a bytesTransferred parameter contains the total - number of bytes transferred so far out of \a bytesTotal. - - - To avoid the loss of signal emissions it is recommend to immidiately connect - to this signal once a QBluetoothTransferReply instance has been created. -*/ - -/*! - \fn void QBluetoothTransferReply::error(QBluetoothTransferReply::TransferError errorType) - \since 5.4 - - This signal is emitted whenever an error has occurred. The \a errorType - parameter indicates the type of error. - - To avoid the loss of signal emissions it is recommend to immidiately connect - to this signal once a QBluetoothTransferReply instance has been created. - - \sa error(), errorString() -*/ - -/*! - Constructs a new QBluetoothTransferReply with \a parent. -*/ -QBluetoothTransferReply::QBluetoothTransferReply(QObject *parent) - : QObject(parent), d_ptr(new QBluetoothTransferReplyPrivate()) -{ -} - -/*! - Destroys the QBluetoothTransferReply object. -*/ -QBluetoothTransferReply::~QBluetoothTransferReply() -{ - delete d_ptr; -} - -/*! - \fn bool QBluetoothTransferReply::isFinished() const - - Returns true if this reply has finished, otherwise false. -*/ - -/*! - \fn bool QBluetoothTransferReply::isRunning() const - - Returns true if this reply is running, otherwise false. -*/ - -/*! - Returns the QBluetoothTransferManager that was used to create this QBluetoothTransferReply - object. Initially, it is also the parent object. -*/ -QBluetoothTransferManager *QBluetoothTransferReply::manager() const -{ - Q_D(const QBluetoothTransferReply); - return d->m_manager; -} - -/*! - Returns the QBluetoothTransferRequest that was used to create this QBluetoothTransferReply - object. -*/ -QBluetoothTransferRequest QBluetoothTransferReply::request() const -{ - Q_D(const QBluetoothTransferReply); - return d->m_request; -} - -/*! - \fn QBluetoothTransferReply::setManager(QBluetoothTransferManager *manager) - - Set the reply's manager to the \a manager. -*/ - -void QBluetoothTransferReply::setManager(QBluetoothTransferManager *manager) -{ - Q_D(QBluetoothTransferReply); - d->m_manager = manager; -} - -/*! - \fn QBluetoothTransferReply::setRequest(const QBluetoothTransferRequest &request) - - Set the reply's request to \a request. -*/ -void QBluetoothTransferReply::setRequest(const QBluetoothTransferRequest &request) -{ - Q_D(QBluetoothTransferReply); - d->m_request = request; -} - -/*! - \fn TransferError QBluetoothTransferReply::error() const - - The error code of the error that occurred. - - \sa errorString() -*/ - -/*! - \fn QString QBluetoothTransferReply::errorString() const - - String describing the error. Can be displayed to the user. - - \sa error() -*/ - -QBluetoothTransferReplyPrivate::QBluetoothTransferReplyPrivate() -{ -} - -QT_END_NAMESPACE - -#include "moc_qbluetoothtransferreply.cpp" diff --git a/src/bluetooth/qbluetoothtransferreply.h b/src/bluetooth/qbluetoothtransferreply.h deleted file mode 100644 index 8f0679f5..00000000 --- a/src/bluetooth/qbluetoothtransferreply.h +++ /dev/null @@ -1,107 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the QtBluetooth module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or (at your option) the GNU General -** Public license version 3 or any later version approved by the KDE Free -** Qt Foundation. The licenses are as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-2.0.html and -** https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QBLUETOOTHTRANSFERREPLY_H -#define QBLUETOOTHTRANSFERREPLY_H - -#include <QtCore/QIODevice> - -#include <QtBluetooth/QBluetoothTransferRequest> -#include <QtBluetooth/QBluetoothTransferManager> - -QT_BEGIN_NAMESPACE - -class QBluetoothTransferReplyPrivate; - -class Q_BLUETOOTH_EXPORT QBluetoothTransferReply : public QObject -{ - Q_OBJECT - -public: - enum TransferError { - NoError = 0, - UnknownError, - FileNotFoundError, - HostNotFoundError, - UserCanceledTransferError, - IODeviceNotReadableError, - ResourceBusyError, - SessionError - }; - Q_ENUM(TransferError) - - ~QBluetoothTransferReply(); - - virtual bool isFinished() const = 0; - virtual bool isRunning() const = 0; - - QBluetoothTransferManager *manager() const; - - virtual TransferError error() const = 0; - virtual QString errorString() const = 0; - - QBluetoothTransferRequest request() const; - -public Q_SLOTS: - void abort(); - -Q_SIGNALS: - //TODO Remove QBluetoothTransferReply* parameter in Qt 6 - void finished(QBluetoothTransferReply *); - void transferProgress(qint64 bytesTransferred, qint64 bytesTotal); - void error(QBluetoothTransferReply::TransferError lastError); - -protected: - explicit QBluetoothTransferReply(QObject *parent = nullptr); - void setManager(QBluetoothTransferManager *manager); - void setRequest(const QBluetoothTransferRequest &request); - -protected: - QBluetoothTransferReplyPrivate *d_ptr; - -private: - Q_DECLARE_PRIVATE(QBluetoothTransferReply) - -}; - -QT_END_NAMESPACE - -Q_DECLARE_METATYPE(QBluetoothTransferReply::TransferError) - -#endif // QBLUETOOTHTRANSFERREPLY_H diff --git a/src/bluetooth/qbluetoothtransferreply_bluez.cpp b/src/bluetooth/qbluetoothtransferreply_bluez.cpp deleted file mode 100644 index bc1f035f..00000000 --- a/src/bluetooth/qbluetoothtransferreply_bluez.cpp +++ /dev/null @@ -1,474 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the QtBluetooth module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or (at your option) the GNU General -** Public license version 3 or any later version approved by the KDE Free -** Qt Foundation. The licenses are as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-2.0.html and -** https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - - -#include "qbluetoothtransferreply_bluez_p.h" -#include "qbluetoothaddress.h" - -#include "bluez/obex_client_p.h" -#include "bluez/obex_agent_p.h" -#include "bluez/obex_transfer_p.h" -#include "bluez/bluez5_helper_p.h" -#include "bluez/obex_client1_bluez5_p.h" -#include "bluez/obex_objectpush1_bluez5_p.h" -#include "bluez/obex_transfer1_bluez5_p.h" -#include "bluez/properties_p.h" -#include "qbluetoothtransferreply.h" - -#include <QtCore/QAtomicInt> -#include <QtCore/QList> -#include <QtCore/QLoggingCategory> -#include <QFuture> -#include <QFutureWatcher> -#include <QtConcurrentRun> - -static const QLatin1String agentPath("/qt/agent"); -static QAtomicInt agentPathCounter; - -QT_BEGIN_NAMESPACE - -Q_DECLARE_LOGGING_CATEGORY(QT_BT_BLUEZ) - -QBluetoothTransferReplyBluez::QBluetoothTransferReplyBluez(QIODevice *input, const QBluetoothTransferRequest &request, - QBluetoothTransferManager *parent) -: QBluetoothTransferReply(parent), - m_source(input), - m_running(false), m_finished(false), m_size(0), - m_error(QBluetoothTransferReply::NoError), m_errorStr(), m_transfer_path() -{ - setRequest(request); - setManager(parent); - - if (!input) { - qCWarning(QT_BT_BLUEZ) << "Invalid input device (null)"; - m_errorStr = QBluetoothTransferReply::tr("Invalid input device (null)"); - m_error = QBluetoothTransferReply::FileNotFoundError; - m_finished = true; - return; - } - - if (isBluez5()) { - m_clientBluez = new OrgBluezObexClient1Interface(QStringLiteral("org.bluez.obex"), - QStringLiteral("/org/bluez/obex"), - QDBusConnection::sessionBus(), this); - - - } else { - m_client = new OrgOpenobexClientInterface(QStringLiteral("org.openobex.client"), - QStringLiteral("/"), - QDBusConnection::sessionBus()); - - m_agent_path = agentPath; - m_agent_path.append(QStringLiteral("/%1%2/%3"). - arg(sanitizeNameForDBus(QCoreApplication::applicationName())). - arg(QCoreApplication::applicationPid()). - arg(agentPathCounter.fetchAndAddOrdered(1))); - - m_agent = new AgentAdaptor(this); - - if (!QDBusConnection::sessionBus().registerObject(m_agent_path, this)) - qCWarning(QT_BT_BLUEZ) << "Failed creating obex agent dbus objects"; - } - - QMetaObject::invokeMethod(this, "start", Qt::QueuedConnection); - m_running = true; -} - -/*! - Destroys the QBluetoothTransferReply object. -*/ -QBluetoothTransferReplyBluez::~QBluetoothTransferReplyBluez() -{ - QDBusConnection::sessionBus().unregisterObject(m_agent_path); - delete m_client; -} - -bool QBluetoothTransferReplyBluez::start() -{ - QFile *file = qobject_cast<QFile *>(m_source); - - if(!file){ - m_tempfile = new QTemporaryFile(this ); - m_tempfile->open(); - qCDebug(QT_BT_BLUEZ) << "Not a QFile, making a copy" << m_tempfile->fileName(); - if (!m_source->isReadable()) { - m_errorStr = QBluetoothTransferReply::tr("QIODevice cannot be read. " - "Make sure it is open for reading."); - m_error = QBluetoothTransferReply::IODeviceNotReadableError; - m_finished = true; - m_running = false; - - emit QBluetoothTransferReply::error(m_error); - emit finished(this); - return false; - } - - QFutureWatcher<bool> *watcher = new QFutureWatcher<bool>(); - QObject::connect(watcher, SIGNAL(finished()), this, SLOT(copyDone())); - - QFuture<bool> results = QtConcurrent::run(QBluetoothTransferReplyBluez::copyToTempFile, m_tempfile, m_source); - watcher->setFuture(results); - } - else { - if (!file->exists()) { - m_errorStr = QBluetoothTransferReply::tr("Source file does not exist"); - m_error = QBluetoothTransferReply::FileNotFoundError; - m_finished = true; - m_running = false; - - emit QBluetoothTransferReply::error(m_error); - emit finished(this); - return false; - } - if (request().address().isNull()) { - m_errorStr = QBluetoothTransferReply::tr("Invalid target address"); - m_error = QBluetoothTransferReply::HostNotFoundError; - m_finished = true; - m_running = false; - - emit QBluetoothTransferReply::error(m_error); - emit finished(this); - return false; - } - m_size = file->size(); - startOPP(file->fileName()); - } - return true; -} - -bool QBluetoothTransferReplyBluez::copyToTempFile(QIODevice *to, QIODevice *from) -{ - QList<char> block(4096); - int size; - - while ((size = from->read(block.data(), block.size())) > 0) { - if (size != to->write(block.data(), size)) { - return false; - } - } - - return true; -} - -void QBluetoothTransferReplyBluez::cleanupSession() -{ - if (!m_objectPushBluez) - return; - - QDBusPendingReply<> reply = m_clientBluez->RemoveSession(QDBusObjectPath(m_objectPushBluez->path())); - reply.waitForFinished(); - if (reply.isError()) - qCWarning(QT_BT_BLUEZ) << "Abort: Cannot remove obex session"; - - delete m_objectPushBluez; - m_objectPushBluez = nullptr; -} - -void QBluetoothTransferReplyBluez::copyDone() -{ - m_size = m_tempfile->size(); - startOPP(m_tempfile->fileName()); - QObject::sender()->deleteLater(); -} - -void QBluetoothTransferReplyBluez::sessionCreated(QDBusPendingCallWatcher *watcher) -{ - QDBusPendingReply<QDBusObjectPath> reply = *watcher; - if (reply.isError()) { - qCWarning(QT_BT_BLUEZ) << "Failed to create obex session:" - << reply.error().name() << reply.reply().errorMessage(); - - m_errorStr = QBluetoothTransferReply::tr("Invalid target address"); - m_error = QBluetoothTransferReply::HostNotFoundError; - m_finished = true; - m_running = false; - - emit QBluetoothTransferReply::error(m_error); - emit finished(this); - - watcher->deleteLater(); - return; - } - - m_objectPushBluez = new OrgBluezObexObjectPush1Interface(QStringLiteral("org.bluez.obex"), - reply.value().path(), - QDBusConnection::sessionBus(), this); - QDBusPendingReply<QDBusObjectPath, QVariantMap> newReply = m_objectPushBluez->SendFile(fileToTranser); - QDBusPendingCallWatcher *newWatcher = new QDBusPendingCallWatcher(newReply, this); - connect(newWatcher, SIGNAL(finished(QDBusPendingCallWatcher*)), - SLOT(sessionStarted(QDBusPendingCallWatcher*))); - watcher->deleteLater(); -} - -void QBluetoothTransferReplyBluez::sessionStarted(QDBusPendingCallWatcher *watcher) -{ - QDBusPendingReply<QDBusObjectPath, QVariantMap> reply = *watcher; - if (reply.isError()) { - qCWarning(QT_BT_BLUEZ) << "Failed to start obex session:" - << reply.error().name() << reply.reply().errorMessage(); - - m_errorStr = QBluetoothTransferReply::tr("Push session cannot be started"); - m_error = QBluetoothTransferReply::SessionError; - m_finished = true; - m_running = false; - - cleanupSession(); - - emit QBluetoothTransferReply::error(m_error); - emit finished(this); - - watcher->deleteLater(); - return; - } - - const QDBusObjectPath path = reply.argumentAt<0>(); - const QVariantMap map = reply.argumentAt<1>(); - m_transfer_path = path.path(); - - //watch the transfer - OrgFreedesktopDBusPropertiesInterface *properties = new OrgFreedesktopDBusPropertiesInterface( - QStringLiteral("org.bluez.obex"), path.path(), - QDBusConnection::sessionBus(), this); - connect(properties, &OrgFreedesktopDBusPropertiesInterface::PropertiesChanged, - this, &QBluetoothTransferReplyBluez::sessionChanged); - - watcher->deleteLater(); -} - -void QBluetoothTransferReplyBluez::sessionChanged(const QString &interface, - const QVariantMap &changed_properties, - const QStringList &, const QDBusMessage &) -{ - if (changed_properties.contains(QStringLiteral("Transferred"))) { - emit transferProgress( - changed_properties.value(QStringLiteral("Transferred")).toULongLong(), - m_size); - } - - if (changed_properties.contains(QStringLiteral("Status"))) { - const QString s = changed_properties. - value(QStringLiteral("Status")).toString(); - if (s == QStringLiteral("complete") - || s == QStringLiteral("error")) { - - m_transfer_path.clear(); - m_finished = true; - m_running = false; - - if (s == QStringLiteral("error")) { - m_error = QBluetoothTransferReply::UnknownError; - m_errorStr = tr("Unknown Error"); - - emit QBluetoothTransferReply::error(m_error); - } else { // complete - // allow progress bar to complete - emit transferProgress(m_size, m_size); - } - - cleanupSession(); - - emit finished(this); - } // ignore "active", "queued" & "suspended" status - } - qCDebug(QT_BT_BLUEZ) << "Transfer update:" << interface << changed_properties; -} - -void QBluetoothTransferReplyBluez::startOPP(const QString &filename) -{ - if (m_client) { // Bluez 4 - QVariantMap device; - QStringList files; - - device.insert(QStringLiteral("Destination"), request().address().toString()); - files << filename; - - QDBusObjectPath path(m_agent_path); - QDBusPendingReply<> sendReply = m_client->SendFiles(device, files, path); - - QDBusPendingCallWatcher *watcher = new QDBusPendingCallWatcher(sendReply, this); - connect(watcher, SIGNAL(finished(QDBusPendingCallWatcher*)), - this, SLOT(sendReturned(QDBusPendingCallWatcher*))); - } else { //Bluez 5 - fileToTranser = filename; - QVariantMap mapping; - mapping.insert(QStringLiteral("Target"), QStringLiteral("opp")); - - QDBusPendingReply<QDBusObjectPath> reply = m_clientBluez->CreateSession( - request().address().toString(), mapping); - - QDBusPendingCallWatcher *watcher = new QDBusPendingCallWatcher(reply, this); - connect(watcher, SIGNAL(finished(QDBusPendingCallWatcher*)), - SLOT(sessionCreated(QDBusPendingCallWatcher*))); - } -} - -void QBluetoothTransferReplyBluez::sendReturned(QDBusPendingCallWatcher *watcher) -{ - QDBusPendingReply<> sendReply = *watcher; - if(sendReply.isError()){ - m_finished = true; - m_running = false; - m_errorStr = sendReply.error().message(); - if (m_errorStr == QStringLiteral("Could not open file for sending")) { - m_error = QBluetoothTransferReply::FileNotFoundError; - m_errorStr = tr("Could not open file for sending"); - } else if (m_errorStr == QStringLiteral("The transfer was canceled")) { - m_error = QBluetoothTransferReply::UserCanceledTransferError; - m_errorStr = tr("The transfer was canceled"); - } else { - m_error = QBluetoothTransferReply::UnknownError; - } - - emit QBluetoothTransferReply::error(m_error); - emit finished(this); - } -} - -QBluetoothTransferReply::TransferError QBluetoothTransferReplyBluez::error() const -{ - return m_error; -} - -QString QBluetoothTransferReplyBluez::errorString() const -{ - return m_errorStr; -} - -void QBluetoothTransferReplyBluez::Complete(const QDBusObjectPath &in0) -{ - Q_UNUSED(in0); - m_transfer_path.clear(); - m_finished = true; - m_running = false; -} - -void QBluetoothTransferReplyBluez::Error(const QDBusObjectPath &in0, const QString &in1) -{ - Q_UNUSED(in0); - m_transfer_path.clear(); - m_finished = true; - m_running = false; - m_errorStr = in1; - if (in1 == QStringLiteral("Could not open file for sending")) { - m_error = QBluetoothTransferReply::FileNotFoundError; - m_errorStr = tr("Could not open file for sending"); - } else if (in1 == QStringLiteral("Operation canceled")) { - m_error = QBluetoothTransferReply::UserCanceledTransferError; - m_errorStr = QBluetoothTransferReply::tr("Operation canceled"); - } else { - m_error = QBluetoothTransferReply::UnknownError; - } - - emit QBluetoothTransferReply::error(m_error); - emit finished(this); -} - -void QBluetoothTransferReplyBluez::Progress(const QDBusObjectPath &in0, qulonglong in1) -{ - Q_UNUSED(in0); - emit transferProgress(in1, m_size); -} - -void QBluetoothTransferReplyBluez::Release() -{ - if(m_errorStr.isEmpty()) - emit finished(this); -} - -QString QBluetoothTransferReplyBluez::Request(const QDBusObjectPath &in0) -{ - m_transfer_path = in0.path(); - - return QString(); -} - -/*! - Returns true if this reply has finished; otherwise returns false. -*/ -bool QBluetoothTransferReplyBluez::isFinished() const -{ - return m_finished; -} - -/*! - Returns true if this reply is running; otherwise returns false. -*/ -bool QBluetoothTransferReplyBluez::isRunning() const -{ - return m_running; -} - -void QBluetoothTransferReplyBluez::abort() -{ - if (m_transfer_path.isEmpty()) - return; - - if (m_client) { - OrgOpenobexTransferInterface xfer(QStringLiteral("org.openobex.client"), - m_transfer_path, - QDBusConnection::sessionBus()); - - QDBusPendingReply<> reply = xfer.Cancel(); - reply.waitForFinished(); - if (reply.isError()) - qCWarning(QT_BT_BLUEZ) << "Failed to abort transfer" << reply.error().message(); - - } else if (m_clientBluez) { - OrgBluezObexTransfer1Interface iface(QStringLiteral("org.bluez.obex"), - m_transfer_path, - QDBusConnection::sessionBus()); - - QDBusPendingReply<> reply = iface.Cancel(); - reply.waitForFinished(); - if (reply.isError()) - qCDebug(QT_BT_BLUEZ) << "Failed to abort transfer" << reply.error().message(); - - m_error = QBluetoothTransferReply::UserCanceledTransferError; - m_errorStr = tr("Operation canceled"); - - cleanupSession(); - - emit QBluetoothTransferReply::error(m_error); - emit finished(this); - } -} - -#include "moc_qbluetoothtransferreply_bluez_p.cpp" - -QT_END_NAMESPACE diff --git a/src/bluetooth/qbluetoothtransferreply_bluez_p.h b/src/bluetooth/qbluetoothtransferreply_bluez_p.h deleted file mode 100644 index 798f99ca..00000000 --- a/src/bluetooth/qbluetoothtransferreply_bluez_p.h +++ /dev/null @@ -1,137 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the QtBluetooth module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or (at your option) the GNU General -** Public license version 3 or any later version approved by the KDE Free -** Qt Foundation. The licenses are as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-2.0.html and -** https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QBLUETOOTHTRANSFERREPLY_BLUEZ_P_H -#define QBLUETOOTHTRANSFERREPLY_BLUEZ_P_H - -// -// W A R N I N G -// ------------- -// -// This file is not part of the Qt API. It exists purely as an -// implementation detail. This header file may change from version to -// version without notice, or even be removed. -// -// We mean it. -// - -#include <QtCore/QIODevice> -#include <QtDBus/QtDBus> - -#include <QtBluetooth/QBluetoothTransferRequest> -#include <QtBluetooth/QBluetoothTransferManager> - -#include "qbluetoothtransferreply.h" - -class OrgOpenobexClientInterface; -class AgentAdaptor; -class OrgBluezObexClient1Interface; -class OrgBluezObexObjectPush1Interface; - -QT_BEGIN_NAMESPACE - -class Q_BLUETOOTH_EXPORT QBluetoothTransferReplyBluez : public QBluetoothTransferReply -{ - Q_OBJECT - -public: - explicit QBluetoothTransferReplyBluez(QIODevice *input, const QBluetoothTransferRequest &request, - QBluetoothTransferManager *parent = nullptr); - ~QBluetoothTransferReplyBluez(); - - bool isFinished() const override; - bool isRunning() const override; - - QBluetoothTransferReply::TransferError error() const override; - QString errorString() const override; - -private slots: - bool start(); - -private: - void startOPP(const QString &filename); - - OrgOpenobexClientInterface *m_client = nullptr; - AgentAdaptor *m_agent = nullptr; - OrgBluezObexClient1Interface *m_clientBluez = nullptr; - OrgBluezObexObjectPush1Interface *m_objectPushBluez = nullptr; - - - QTemporaryFile *m_tempfile = nullptr; - QIODevice *m_source = nullptr; - - bool m_running; - bool m_finished; - - quint64 m_size; - - QBluetoothTransferReply::TransferError m_error; - QString m_errorStr; - - QString m_agent_path; - - QString m_transfer_path; - QString fileToTranser; - - static bool copyToTempFile(QIODevice *to, QIODevice *from); - void cleanupSession(); - -private slots: - void copyDone(); - void sessionCreated(QDBusPendingCallWatcher *watcher); - void sessionStarted(QDBusPendingCallWatcher *watcher); - void sessionChanged(const QString &interface, - const QVariantMap &changed_properties, - const QStringList &invalidated_properties, - const QDBusMessage &); - -public slots: - void abort(); - void Complete(const QDBusObjectPath &in0); - void Error(const QDBusObjectPath &in0, const QString &in1); - void Progress(const QDBusObjectPath &in0, qulonglong in1); - void Release(); - QString Request(const QDBusObjectPath &in0); - void sendReturned(QDBusPendingCallWatcher*); - -}; - -QT_END_NAMESPACE - -#endif // QBLUETOOTHTRANSFERREPLY_H diff --git a/src/bluetooth/qbluetoothtransferreply_macos.mm b/src/bluetooth/qbluetoothtransferreply_macos.mm deleted file mode 100644 index 10ae0f7a..00000000 --- a/src/bluetooth/qbluetoothtransferreply_macos.mm +++ /dev/null @@ -1,480 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the QtBluetooth module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or (at your option) the GNU General -** Public license version 3 or any later version approved by the KDE Free -** Qt Foundation. The licenses are as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-2.0.html and -** https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "qbluetoothservicediscoveryagent.h" -#include "qbluetoothtransferreply_macos_p.h" -#include "darwin/btobexsession_p.h" -#include "qbluetoothserviceinfo.h" -#include "darwin/btutility_p.h" -#include "darwin/uistrings_p.h" -#include "qbluetoothuuid.h" - - -#include <QtCore/qcoreapplication.h> -#include <QtCore/qloggingcategory.h> -#include <QtCore/qtemporaryfile.h> -#include <QtCore/qmetaobject.h> -#include <QtCore/qfileinfo.h> -#include <QtCore/qstring.h> -#include <QtCore/qdebug.h> -#include <QtCore/qfile.h> -#include <QtCore/qdir.h> - -QT_BEGIN_NAMESPACE - -class QBluetoothTransferReplyOSXPrivate : DarwinBluetooth::OBEXSessionDelegate -{ - friend class QBluetoothTransferReplyOSX; -public: - QBluetoothTransferReplyOSXPrivate(QBluetoothTransferReplyOSX *q, QIODevice *inputStream); - - ~QBluetoothTransferReplyOSXPrivate(); - - bool isActive() const; - bool startOPP(const QBluetoothAddress &device); - - // - void sendConnect(const QBluetoothAddress &device, quint16 channelID); - void sendPut(); - -private: - // OBEX session delegate: - void OBEXConnectError(OBEXError errorCode, OBEXOpCode response) override; - void OBEXConnectSuccess() override; - - void OBEXAbortSuccess() override; - - void OBEXPutDataSent(quint32 current, quint32 total) override; - void OBEXPutSuccess() override; - void OBEXPutError(OBEXError error, OBEXOpCode response) override; - - QBluetoothTransferReplyOSX *q_ptr; - - QIODevice *inputStream; - - QBluetoothTransferReply::TransferError error; - QString errorString; - - // Set requestComplete, error, description, emit error, emit finished. - // Too many things in one, but not to repeat this code everywhere. - void setReplyError(QBluetoothTransferReply::TransferError errorCode, - const QString &errorMessage); - - // With a given API, we have to discover a service first - // since we need a channel ID to work with OBEX session. - // Also, service discovery agent does not have an interface - // to test discovery mode, that's why we have this bool here. - bool minimalScan; - QScopedPointer<QBluetoothServiceDiscoveryAgent> agent; - - // The next step is to create an OBEX session: - typedef DarwinBluetooth::ObjCScopedPointer<ObjCOBEXSession> OBEXSession; - OBEXSession session; - - // Both success and failure to send - transfer is complete. - bool requestComplete; - - // We need a temporary file to generate an unique name - // in case inputStream is not a file. QTemporaryFile not - // only creates a random name, it also guarantees this name - // is unique. The amount of code to generate such a name - // is amaizingly huge (and will require global variables) - // - so a temporary file can help. - QScopedPointer<QTemporaryFile> temporaryFile; -}; - -QBluetoothTransferReplyOSXPrivate::QBluetoothTransferReplyOSXPrivate(QBluetoothTransferReplyOSX *q, - QIODevice *input) - : q_ptr(q), - inputStream(input), - error(QBluetoothTransferReply::NoError), - minimalScan(true), - requestComplete(false) -{ - Q_ASSERT_X(q, Q_FUNC_INFO, "invalid q_ptr (null)"); -} - -QBluetoothTransferReplyOSXPrivate::~QBluetoothTransferReplyOSXPrivate() -{ - // closeSession will set a delegate to null. - // The OBEX session will be closed then. If - // somehow IOBluetooth/OBEX still has a reference to our - // session, it will not call any of delegate's callbacks. - if (session) - [session closeSession]; -} - -bool QBluetoothTransferReplyOSXPrivate::isActive() const -{ - return agent || (session && [session hasActiveRequest]); -} - -bool QBluetoothTransferReplyOSXPrivate::startOPP(const QBluetoothAddress &device) -{ - Q_ASSERT_X(!isActive(), Q_FUNC_INFO, "already started"); - Q_ASSERT_X(!device.isNull(), Q_FUNC_INFO, "invalid device address"); - - errorString.clear(); - error = QBluetoothTransferReply::NoError; - - agent.reset(new QBluetoothServiceDiscoveryAgent); - - agent->setRemoteAddress(device); - agent->setUuidFilter(QBluetoothUuid(QBluetoothUuid::ObexObjectPush)); - - QObject::connect(agent.data(), SIGNAL(finished()), q_ptr, SLOT(serviceDiscoveryFinished())); - QObject::connect(agent.data(), SIGNAL(error(QBluetoothServiceDiscoveryAgent::Error)), - q_ptr, SLOT(serviceDiscoveryError(QBluetoothServiceDiscoveryAgent::Error))); - - minimalScan = true; - agent->start(QBluetoothServiceDiscoveryAgent::MinimalDiscovery); - - // We probably failed already. - return error == QBluetoothTransferReply::NoError; -} - -void QBluetoothTransferReplyOSXPrivate::sendConnect(const QBluetoothAddress &device, quint16 channelID) -{ - using namespace DarwinBluetooth; - - Q_ASSERT_X(!session, Q_FUNC_INFO, "session is already active"); - - error = QBluetoothTransferReply::NoError; - errorString.clear(); - - if (device.isNull() || !channelID) { - qCWarning(QT_BT_DARWIN) << "invalid device address or port"; - setReplyError(QBluetoothTransferReply::HostNotFoundError, - QCoreApplication::translate(TRANSFER_REPLY, TR_INVAL_TARGET)); - return; - } - - OBEXSession newSession([[ObjCOBEXSession alloc] initWithDelegate:this - remoteDevice:device channelID:channelID], - RetainPolicy::noInitialRetain); - if (!newSession) { - qCWarning(QT_BT_DARWIN) << "failed to allocate DarwinBTOBEXSession object"; - - setReplyError(QBluetoothTransferReply::UnknownError, - QCoreApplication::translate(TRANSFER_REPLY, TR_SESSION_NO_START)); - return; - } - - const OBEXError status = [newSession OBEXConnect]; - - if ((status == kOBEXSuccess || status == kOBEXSessionAlreadyConnectedError) - && error == QBluetoothTransferReply::NoError) { - session.swap(newSession); - if ([session isConnected]) - sendPut();// Connected, send a PUT request. - } else { - qCWarning(QT_BT_DARWIN) << "OBEXConnect failed"; - - if (error == QBluetoothTransferReply::NoError) { - // The error is not set yet. - error = QBluetoothTransferReply::SessionError; - errorString = QCoreApplication::translate(TRANSFER_REPLY, TR_CONNECT_FAILED); - } - - requestComplete = true; - emit q_ptr->error(error); - emit q_ptr->finished(q_ptr); - } -} - -void QBluetoothTransferReplyOSXPrivate::sendPut() -{ - Q_ASSERT_X(inputStream, Q_FUNC_INFO, "invalid input stream (null)"); - Q_ASSERT_X(session, Q_FUNC_INFO, "invalid OBEX session (nil)"); - Q_ASSERT_X([session isConnected], Q_FUNC_INFO, "not connected"); - Q_ASSERT_X(![session hasActiveRequest], Q_FUNC_INFO, - "session already has an active request"); - - QString fileName; - QFile *const file = qobject_cast<QFile *>(inputStream); - if (file) { - if (!file->exists()) { - setReplyError(QBluetoothTransferReply::FileNotFoundError, - QCoreApplication::translate(TRANSFER_REPLY, TR_FILE_NOT_EXIST)); - return; - } else if (!file->isReadable()) { - file->open(QIODevice::ReadOnly); - if (!file->isReadable()) { - setReplyError(QBluetoothTransferReply::IODeviceNotReadableError, - QCoreApplication::translate(TRANSFER_REPLY, TR_NOT_READ_IODEVICE)); - return; - } - } - - fileName = file->fileName(); - } else { - if (!inputStream->isReadable()) { - setReplyError(QBluetoothTransferReply::IODeviceNotReadableError, - QCoreApplication::translate(TRANSFER_REPLY, TR_NOT_READ_IODEVICE)); - return; - } - - temporaryFile.reset(new QTemporaryFile); - temporaryFile->open(); - fileName = temporaryFile->fileName(); - } - - const QFileInfo fileInfo(fileName); - fileName = fileInfo.fileName(); - - if ([session OBEXPutFile:inputStream withName:fileName] != kOBEXSuccess) { - // TODO: convert OBEXError into something reasonable? - setReplyError(QBluetoothTransferReply::SessionError, - QCoreApplication::translate(TRANSFER_REPLY, TR_SESSION_FAILED)); - } -} - - -void QBluetoothTransferReplyOSXPrivate::OBEXConnectError(OBEXError errorCode, OBEXOpCode response) -{ - Q_UNUSED(errorCode); - Q_UNUSED(response); - - if (session) { - setReplyError(QBluetoothTransferReply::SessionError, - QCoreApplication::translate(TRANSFER_REPLY, TR_CONNECT_FAILED)); - } else { - // Else we're still in OBEXConnect, in a call-back - // and do not want to emit yet (will be done a bit later). - error = QBluetoothTransferReply::SessionError; - errorString = QCoreApplication::translate(TRANSFER_REPLY, TR_CONNECT_FAILED); - requestComplete = true; - } -} - -void QBluetoothTransferReplyOSXPrivate::OBEXConnectSuccess() -{ - // Now that OBEX connect succeeded, we can send an OBEX put request. - if (!session) { - // We're still in OBEXConnect(), it'll take care of next steps. - return; - } - - sendPut(); -} - -void QBluetoothTransferReplyOSXPrivate::OBEXAbortSuccess() -{ - // TODO: -} - -void QBluetoothTransferReplyOSXPrivate::OBEXPutDataSent(quint32 current, quint32 total) -{ - emit q_ptr->transferProgress(current, total); -} - -void QBluetoothTransferReplyOSXPrivate::OBEXPutSuccess() -{ - requestComplete = true; - emit q_ptr->finished(q_ptr); -} - -void QBluetoothTransferReplyOSXPrivate::OBEXPutError(OBEXError errorCode, OBEXOpCode responseCode) -{ - // Error can be reported by errorCode or responseCode - // (that's how errors are reported in OBEXSession events). - // errorCode and responseCode are "mutually exclusive". - - Q_UNUSED(responseCode); - - if (errorCode != kOBEXSuccess) { - // TODO: errorCode -> TransferError. - } else { - // TODO: a response code can give some interesting information, - // like "forbidden" etc. - convert this into more reasonable error. - } - - setReplyError(QBluetoothTransferReply::SessionError, - QCoreApplication::translate(TRANSFER_REPLY, TR_SESSION_FAILED)); -} - -void QBluetoothTransferReplyOSXPrivate::setReplyError(QBluetoothTransferReply::TransferError errorCode, - const QString &description) -{ - // Not to be used to clear an error! - - error = errorCode; - errorString = description; - requestComplete = true; - emit q_ptr->error(error); - emit q_ptr->finished(q_ptr); -} - - -QBluetoothTransferReplyOSX::QBluetoothTransferReplyOSX(QIODevice *input, - const QBluetoothTransferRequest &request, - QBluetoothTransferManager *manager) - : QBluetoothTransferReply(manager) - -{ - Q_UNUSED(input); - - setManager(manager); - setRequest(request); - - osx_d_ptr.reset(new QBluetoothTransferReplyOSXPrivate(this, input)); - - if (input) { - QMetaObject::invokeMethod(this, "start", Qt::QueuedConnection); - } else { - qCWarning(QT_BT_DARWIN) << "invalid input stream (null)"; - osx_d_ptr->requestComplete = true; - osx_d_ptr->errorString = QCoreApplication::translate(TRANSFER_REPLY, TR_INVALID_DEVICE); - osx_d_ptr->error = FileNotFoundError; - QMetaObject::invokeMethod(this, "error", Qt::QueuedConnection, - Q_ARG(QBluetoothTransferReply::TransferError, FileNotFoundError)); - } -} - -QBluetoothTransferReplyOSX::~QBluetoothTransferReplyOSX() -{ - // A dtor to make a scoped pointer with incomplete type happy. -} - -QBluetoothTransferReply::TransferError QBluetoothTransferReplyOSX::error() const -{ - return osx_d_ptr->error; -} - -QString QBluetoothTransferReplyOSX::errorString() const -{ - return osx_d_ptr->errorString; -} - -bool QBluetoothTransferReplyOSX::isFinished() const -{ - return osx_d_ptr->requestComplete; -} - -bool QBluetoothTransferReplyOSX::isRunning() const -{ - return osx_d_ptr->isActive(); -} - -bool QBluetoothTransferReplyOSX::abort() -{ - // Reset a delegate. - [osx_d_ptr->session closeSession]; - // Should never be called from an OBEX callback! - osx_d_ptr->session.reset(); - - // Not setReplyError, we emit finished only! - osx_d_ptr->requestComplete = true; - osx_d_ptr->errorString = QCoreApplication::translate(TRANSFER_REPLY, TR_OP_CANCEL); - osx_d_ptr->error = UserCanceledTransferError; - - emit finished(this); - - return true; -} - -bool QBluetoothTransferReplyOSX::start() -{ - // OBEXSession requires a channel ID and we have to find it first, - // using QBluetoothServiceDiscoveryAgent (singleDevice, OBEX uuid filter, start - // from MinimalDiscovery mode and continue with FullDiscovery if - // MinimalDiscovery fails. - - if (!osx_d_ptr->isActive()) { - // Step 0: find a channelID. - if (request().address().isNull()) { - qCWarning(QT_BT_DARWIN) << "invalid device address"; - osx_d_ptr->setReplyError(HostNotFoundError, - QCoreApplication::translate(TRANSFER_REPLY, TR_INVAL_TARGET)); - return false; - } - - return osx_d_ptr->startOPP(request().address()); - } else { - osx_d_ptr->setReplyError(UnknownError, - QCoreApplication::translate(TRANSFER_REPLY, TR_IN_PROGRESS)); - return false; - } -} - -void QBluetoothTransferReplyOSX::serviceDiscoveryFinished() -{ - Q_ASSERT_X(osx_d_ptr->agent.data(), Q_FUNC_INFO, - "invalid service discovery agent (null)"); - - const QList<QBluetoothServiceInfo> services = osx_d_ptr->agent->discoveredServices(); - if (services.size()) { - // TODO: what if we have several? - const QBluetoothServiceInfo &foundOBEX = services.front(); - osx_d_ptr->sendConnect(request().address(), foundOBEX.serverChannel()); - } else { - if (osx_d_ptr->minimalScan) { - // Try full discovery now. - osx_d_ptr->minimalScan = false; - osx_d_ptr->agent->start(QBluetoothServiceDiscoveryAgent::FullDiscovery); - } else { - // No service record, no channel ID, no OBEX session. - osx_d_ptr->setReplyError(HostNotFoundError, - QCoreApplication::translate(TRANSFER_REPLY, TR_SERVICE_NO_FOUND)); - } - } -} - -void QBluetoothTransferReplyOSX::serviceDiscoveryError(QBluetoothServiceDiscoveryAgent::Error errorCode) -{ - Q_ASSERT_X(osx_d_ptr->agent.data(), Q_FUNC_INFO, - "invalid service discovery agent (null)"); - - if (errorCode == QBluetoothServiceDiscoveryAgent::PoweredOffError) { - // There's nothing else we can do. - osx_d_ptr->setReplyError(UnknownError, - QCoreApplication::translate(DEV_DISCOVERY, DD_POWERED_OFF)); - return; - } - - if (osx_d_ptr->minimalScan) {// Try again, this time in FullDiscovery mode. - osx_d_ptr->minimalScan = false; - osx_d_ptr->agent->start(QBluetoothServiceDiscoveryAgent::FullDiscovery); - } else { - osx_d_ptr->setReplyError(HostNotFoundError, - QCoreApplication::translate(TRANSFER_REPLY, TR_INVAL_TARGET)); - } -} - -QT_END_NAMESPACE diff --git a/src/bluetooth/qbluetoothtransferreply_macos_p.h b/src/bluetooth/qbluetoothtransferreply_macos_p.h deleted file mode 100644 index e7b6f683..00000000 --- a/src/bluetooth/qbluetoothtransferreply_macos_p.h +++ /dev/null @@ -1,101 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the QtBluetooth module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or (at your option) the GNU General -** Public license version 3 or any later version approved by the KDE Free -** Qt Foundation. The licenses are as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-2.0.html and -** https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QBLUETOOTHTRANSFERREPLY_OSX_P_H -#define QBLUETOOTHTRANSFERREPLY_OSX_P_H - -// -// W A R N I N G -// ------------- -// -// This file is not part of the Qt API. It exists purely as an -// implementation detail. This header file may change from version to -// version without notice, or even be removed. -// -// We mean it. -// - -#include "qbluetoothservicediscoveryagent.h" -#include "qbluetoothtransferreply.h" - -#include <QtCore/qscopedpointer.h> -#include <QtCore/qglobal.h> - -QT_BEGIN_NAMESPACE - -class QBluetoothTransferReplyOSXPrivate; -class QBluetoothServiceInfo; -class QBluetoothAddress; -class QIODevice; - -class Q_BLUETOOTH_EXPORT QBluetoothTransferReplyOSX : public QBluetoothTransferReply -{ - Q_OBJECT - -public: - QBluetoothTransferReplyOSX(QIODevice *input, const QBluetoothTransferRequest &request, - QBluetoothTransferManager *parent); - ~QBluetoothTransferReplyOSX(); - - TransferError error() const override; - QString errorString() const override; - - bool isFinished() const override; - bool isRunning() const override; - -Q_SIGNALS: - void error(QBluetoothTransferReply::TransferError lastError); - -public slots: - bool abort(); - -private slots: - bool start(); - - void serviceDiscoveryFinished(); - void serviceDiscoveryError(QBluetoothServiceDiscoveryAgent::Error error); - -private: - // OS X private data (not to be seen by moc). - QScopedPointer<QBluetoothTransferReplyOSXPrivate> osx_d_ptr; -}; - -QT_END_NAMESPACE - -#endif diff --git a/src/bluetooth/qbluetoothtransferreply_p.h b/src/bluetooth/qbluetoothtransferreply_p.h deleted file mode 100644 index 375a89a3..00000000 --- a/src/bluetooth/qbluetoothtransferreply_p.h +++ /dev/null @@ -1,70 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the QtBluetooth module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or (at your option) the GNU General -** Public license version 3 or any later version approved by the KDE Free -** Qt Foundation. The licenses are as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-2.0.html and -** https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QBLUETOOTHTRANSFERREPLY_P_H -#define QBLUETOOTHTRANSFERREPLY_P_H - -// -// W A R N I N G -// ------------- -// -// This file is not part of the Qt API. It exists purely as an -// implementation detail. This header file may change from version to -// version without notice, or even be removed. -// -// We mean it. -// - -#include "qbluetoothtransferreply.h" - -QT_BEGIN_NAMESPACE - -class Q_BLUETOOTH_EXPORT QBluetoothTransferReplyPrivate -{ -public: - QBluetoothTransferReplyPrivate(); - - QBluetoothTransferManager *m_manager = nullptr; - - QBluetoothTransferRequest m_request; -}; - -QT_END_NAMESPACE - -#endif // QBLUETOOTHTRANSFERREPLY_H diff --git a/src/bluetooth/qbluetoothtransferrequest.cpp b/src/bluetooth/qbluetoothtransferrequest.cpp deleted file mode 100644 index 1138f7d8..00000000 --- a/src/bluetooth/qbluetoothtransferrequest.cpp +++ /dev/null @@ -1,184 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the QtBluetooth module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or (at your option) the GNU General -** Public license version 3 or any later version approved by the KDE Free -** Qt Foundation. The licenses are as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-2.0.html and -** https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "qbluetoothtransferrequest.h" -#include "qbluetoothaddress.h" -#include "qbluetoothtransferrequest_p.h" - - -QT_BEGIN_NAMESPACE - -/*! - \class QBluetoothTransferRequest - \inmodule QtBluetooth - \brief The QBluetoothTransferRequest class stores information about a - data transfer request. - - \since 5.2 - - QBluetoothTransferRequest is part of the Bluetooth Transfer API and is the class holding the - information necessary to initiate a transfer over Bluetooth. - - \sa QBluetoothTransferReply, QBluetoothTransferManager -*/ - -/*! - \enum QBluetoothTransferRequest::Attribute - - Attribute codes for QBluetoothTransferRequest and QBluetoothTransferReply. - - \value DescriptionAttribute A textual description of the object being transferred. - May be displayed in the UI of the remote device. - \value TimeAttribute Time attribute of the object being transferred. - \value TypeAttribute MIME type of the object being transferred. - \value LengthAttribute Length in bytes of the object being transferred. - \value NameAttribute Name of the object being transferred. May be displayed in the UI of - the remote device. -*/ - -/*! - Constructs a new Bluetooth transfer request to the device with \a address. -*/ -QBluetoothTransferRequest::QBluetoothTransferRequest(const QBluetoothAddress &address) -:d_ptr(new QBluetoothTransferRequestPrivate) -{ - Q_D(QBluetoothTransferRequest); - - d->m_address = address; -} - -/*! - Constructs a new Bluetooth transfer request that is a copy of \a other. -*/ -QBluetoothTransferRequest::QBluetoothTransferRequest(const QBluetoothTransferRequest &other) -:d_ptr(new QBluetoothTransferRequestPrivate) -{ - *this = other; -} - -/*! - Destorys the Bluetooth transfer request. -*/ -QBluetoothTransferRequest::~QBluetoothTransferRequest() -{ - delete d_ptr; -} - -/*! - Returns the attribute associated with \a code. If the attribute has not been set, it - returns \a defaultValue. - - \sa setAttribute(), QBluetoothTransferRequest::Attribute -*/ -QVariant QBluetoothTransferRequest::attribute(Attribute code, const QVariant &defaultValue) const -{ - Q_D(const QBluetoothTransferRequest); - - if (d->m_parameters.contains((int)code)) { - return d->m_parameters.value((int)code); - } else { - return defaultValue; - } -} - -/*! - Sets the attribute associated with \a code to \a value. If the attribute is - already set, the previous value is discarded. If \a value is an invalid QVariant, the attribute - is unset. - - \sa attribute(), QBluetoothTransferRequest::Attribute -*/ -void QBluetoothTransferRequest::setAttribute(Attribute code, const QVariant &value) -{ - Q_D(QBluetoothTransferRequest); - - d->m_parameters.insert((int)code, value); -} - -/*! - Returns the address associated with the Bluetooth transfer request. -*/ -QBluetoothAddress QBluetoothTransferRequest::address() const -{ - Q_D(const QBluetoothTransferRequest); - - return d->m_address; -} - - -/*! - Returns true if this object is not the same as \a other. - - \sa operator==() -*/ -bool QBluetoothTransferRequest::operator!=(const QBluetoothTransferRequest &other) const -{ - return !(*this == other); -} - -/*! - Creates a copy of \a other. -*/ -QBluetoothTransferRequest &QBluetoothTransferRequest::operator=(const QBluetoothTransferRequest &other) -{ - Q_D(QBluetoothTransferRequest); - - d->m_address = other.d_func()->m_address; - d->m_parameters = other.d_func()->m_parameters; - - return *this; -} - -/*! - Returns true if this object is the same as \a other. -*/ -bool QBluetoothTransferRequest::operator==(const QBluetoothTransferRequest &other) const -{ - Q_D(const QBluetoothTransferRequest); - if (d->m_address == other.d_func()->m_address && d->m_parameters == other.d_func()->m_parameters) { - return true; - } - return false; -} - -QBluetoothTransferRequestPrivate::QBluetoothTransferRequestPrivate() -{ -} - -QT_END_NAMESPACE diff --git a/src/bluetooth/qbluetoothtransferrequest.h b/src/bluetooth/qbluetoothtransferrequest.h deleted file mode 100644 index 5485a0d9..00000000 --- a/src/bluetooth/qbluetoothtransferrequest.h +++ /dev/null @@ -1,88 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the QtBluetooth module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or (at your option) the GNU General -** Public license version 3 or any later version approved by the KDE Free -** Qt Foundation. The licenses are as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-2.0.html and -** https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QBLUETOOTHTRANSFERREQUEST_H -#define QBLUETOOTHTRANSFERREQUEST_H - -#include <QtBluetooth/qtbluetoothglobal.h> -#include <QtBluetooth/QBluetoothAddress> - -#include <QtCore/QtGlobal> -#include <QtCore/QVariant> - -QT_BEGIN_NAMESPACE - -class QBluetoothAddress; -class QBluetoothTransferRequestPrivate; - -class Q_BLUETOOTH_EXPORT QBluetoothTransferRequest -{ -public: - enum Attribute { - DescriptionAttribute, - TimeAttribute, - TypeAttribute, - LengthAttribute, - NameAttribute - }; - - explicit QBluetoothTransferRequest(const QBluetoothAddress &address = QBluetoothAddress()); - QBluetoothTransferRequest(const QBluetoothTransferRequest &other); - ~QBluetoothTransferRequest(); - - QVariant attribute(Attribute code, const QVariant &defaultValue = QVariant()) const; - void setAttribute(Attribute code, const QVariant &value); - - QBluetoothAddress address() const; - - bool operator!=(const QBluetoothTransferRequest &other) const; - QBluetoothTransferRequest &operator=(const QBluetoothTransferRequest &other); - bool operator==(const QBluetoothTransferRequest &other) const; - -protected: - QBluetoothTransferRequestPrivate *d_ptr; - -private: - Q_DECLARE_PRIVATE(QBluetoothTransferRequest) - -}; - -QT_END_NAMESPACE - -#endif // QBLUETOOTHTRANSFERREQUEST_H diff --git a/src/bluetooth/qbluetoothtransferrequest_p.h b/src/bluetooth/qbluetoothtransferrequest_p.h deleted file mode 100644 index 410a9709..00000000 --- a/src/bluetooth/qbluetoothtransferrequest_p.h +++ /dev/null @@ -1,72 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the QtBluetooth module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or (at your option) the GNU General -** Public license version 3 or any later version approved by the KDE Free -** Qt Foundation. The licenses are as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-2.0.html and -** https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QBLUETOOTHTRANSFERREQUESTPRIVATE_H -#define QBLUETOOTHTRANSFERREQUESTPRIVATE_H - -// -// W A R N I N G -// ------------- -// -// This file is not part of the Qt API. It exists purely as an -// implementation detail. This header file may change from version to -// version without notice, or even be removed. -// -// We mean it. -// - -#include <QtBluetooth/qtbluetoothglobal.h> -#include "qbluetoothtransferrequest.h" - -QT_BEGIN_NAMESPACE - -class QBluetoothAddress; - -class QBluetoothTransferRequestPrivate -{ -public: - QBluetoothTransferRequestPrivate(); - - QBluetoothAddress m_address; - QMap<int, QVariant> m_parameters; -}; - -QT_END_NAMESPACE - -#endif // QBLUETOOTHTRANSFERREQUESTPRIVATE_H |