Debian Codegraph @

src/obexobjectpush.cpp

raw
1 /*
2 * BluezQt - Asynchronous Bluez wrapper library
3 *
4 * SPDX-FileCopyrightText: 2014 David Rosca <[email protected]>
5 *
6 * SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
7 */
8
9 #include "obexobjectpush.h"
10 #include "pendingcall.h"
11 #include "utils.h"
12
13 #include "obexobjectpush1.h"
14
15 namespace BluezQt
16 {
17 typedef org::bluez::obex::ObjectPush1 BluezObjectPush;
18
19 class ObexObjectPushPrivate
20 {
21 public:
22 ObexObjectPush *q;
23 BluezObjectPush *m_bluezObjectPush;
24 };
25
26 ObexObjectPush::ObexObjectPush(const QDBusObjectPath &path, QObject *parent)
27 : QObject(parent)
28 , d(new ObexObjectPushPrivate)
29 {
30 d->m_bluezObjectPush = new BluezObjectPush(Strings::orgBluezObex(), path.path(), DBusConnection::orgBluezObex(), this);
31 }
32
33 ObexObjectPush::~ObexObjectPush() = default;
34
35 QDBusObjectPath ObexObjectPush::objectPath() const
36 {
37 return QDBusObjectPath(d->m_bluezObjectPush->path());
38 }
39
40 PendingCall *ObexObjectPush::sendFile(const QString &fileName)
41 {
42 return new PendingCall(d->m_bluezObjectPush->SendFile(fileName), PendingCall::ReturnTransferWithProperties, this);
43 }
44
45 PendingCall *ObexObjectPush::pullBusinessCard(const QString &targetFileName)
46 {
47 return new PendingCall(d->m_bluezObjectPush->PullBusinessCard(targetFileName), PendingCall::ReturnTransferWithProperties, this);
48 }
49
50 PendingCall *ObexObjectPush::exchangeBusinessCards(const QString &clientFileName, const QString &targetFileName)
51 {
52 return new PendingCall(d->m_bluezObjectPush->ExchangeBusinessCards(clientFileName, targetFileName), PendingCall::ReturnTransferWithProperties, this);
53 }
54
55 } // namespace BluezQt
56
57 #include "moc_obexobjectpush.cpp"