BluezQt

obexobjectpush.cpp
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 
27  : QObject(parent)
28  , d(new ObexObjectPushPrivate)
29 {
30  d->m_bluezObjectPush = new BluezObjectPush(Strings::orgBluezObex(), path.path(), DBusConnection::orgBluezObex(), this);
31 }
32 
34 {
35  delete d;
36 }
37 
39 {
40  return QDBusObjectPath(d->m_bluezObjectPush->path());
41 }
42 
44 {
45  return new PendingCall(d->m_bluezObjectPush->SendFile(fileName), PendingCall::ReturnTransferWithProperties, this);
46 }
47 
49 {
50  return new PendingCall(d->m_bluezObjectPush->PullBusinessCard(targetFileName), PendingCall::ReturnTransferWithProperties, this);
51 }
52 
53 PendingCall *ObexObjectPush::exchangeBusinessCards(const QString &clientFileName, const QString &targetFileName)
54 {
55  return new PendingCall(d->m_bluezObjectPush->ExchangeBusinessCards(clientFileName, targetFileName), PendingCall::ReturnTransferWithProperties, this);
56 }
57 
58 } // namespace BluezQt
~ObexObjectPush() override
Destroys an ObexObjectPush object.
PendingCall * pullBusinessCard(const QString &targetFileName)
Pulls the business card from a remote device.
PendingCall * exchangeBusinessCards(const QString &clientFileName, const QString &targetFileName)
Exchanges the business cards on the remote device.
ObexObjectPush(const QDBusObjectPath &path, QObject *parent=nullptr)
Creates a new ObexObjectPush object.
PendingCall * sendFile(const QString &fileName)
Sends one local file to the remote device.
QDBusObjectPath objectPath() const
D-Bus object path of the object push session.
QString path() const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2022 The KDE developers.
Generated on Sun Sep 25 2022 04:19:10 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.