File indexing completed on 2024-04-28 15:17:55

0001 /*
0002  * BluezQt - Asynchronous Bluez wrapper library
0003  *
0004  * SPDX-FileCopyrightText: 2014 David Rosca <nowrep@gmail.com>
0005  *
0006  * SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
0007  */
0008 
0009 #include "obexobjectpush.h"
0010 #include "pendingcall.h"
0011 #include "utils.h"
0012 
0013 #include "obexobjectpush1.h"
0014 
0015 namespace BluezQt
0016 {
0017 typedef org::bluez::obex::ObjectPush1 BluezObjectPush;
0018 
0019 class ObexObjectPushPrivate
0020 {
0021 public:
0022     ObexObjectPush *q;
0023     BluezObjectPush *m_bluezObjectPush;
0024 };
0025 
0026 ObexObjectPush::ObexObjectPush(const QDBusObjectPath &path, QObject *parent)
0027     : QObject(parent)
0028     , d(new ObexObjectPushPrivate)
0029 {
0030     d->m_bluezObjectPush = new BluezObjectPush(Strings::orgBluezObex(), path.path(), DBusConnection::orgBluezObex(), this);
0031 }
0032 
0033 ObexObjectPush::~ObexObjectPush()
0034 {
0035     delete d;
0036 }
0037 
0038 QDBusObjectPath ObexObjectPush::objectPath() const
0039 {
0040     return QDBusObjectPath(d->m_bluezObjectPush->path());
0041 }
0042 
0043 PendingCall *ObexObjectPush::sendFile(const QString &fileName)
0044 {
0045     return new PendingCall(d->m_bluezObjectPush->SendFile(fileName), PendingCall::ReturnTransferWithProperties, this);
0046 }
0047 
0048 PendingCall *ObexObjectPush::pullBusinessCard(const QString &targetFileName)
0049 {
0050     return new PendingCall(d->m_bluezObjectPush->PullBusinessCard(targetFileName), PendingCall::ReturnTransferWithProperties, this);
0051 }
0052 
0053 PendingCall *ObexObjectPush::exchangeBusinessCards(const QString &clientFileName, const QString &targetFileName)
0054 {
0055     return new PendingCall(d->m_bluezObjectPush->ExchangeBusinessCards(clientFileName, targetFileName), PendingCall::ReturnTransferWithProperties, this);
0056 }
0057 
0058 } // namespace BluezQt
0059 
0060 #include "moc_obexobjectpush.cpp"