BluezQt

obexobjectpush.h
1 /*
2  * BluezQt - Asynchronous BlueZ wrapper library
3  *
4  * SPDX-FileCopyrightText: 2014-2015 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 #ifndef BLUEZQT_OBEXOBJECTPUSH_H
10 #define BLUEZQT_OBEXOBJECTPUSH_H
11 
12 #include <QObject>
13 
14 #include "bluezqt_export.h"
15 
16 class QDBusObjectPath;
17 
18 namespace BluezQt
19 {
20 class PendingCall;
21 
22 /**
23  * @class BluezQt::ObexObjectPush obexobjectpush.h <BluezQt/ObexObjectPush>
24  *
25  * OBEX object push.
26  *
27  * This class represents an OBEX object push interface.
28  */
29 class BLUEZQT_EXPORT ObexObjectPush : public QObject
30 {
31  Q_OBJECT
32 
33 public:
34  /**
35  * Creates a new ObexObjectPush object.
36  *
37  * This class will be typically used with a @p path
38  * from result of ObexManager::createSession().
39  *
40  * @param path path of session
41  * @param parent
42  */
43  explicit ObexObjectPush(const QDBusObjectPath &path, QObject *parent = nullptr);
44 
45  /**
46  * Destroys an ObexObjectPush object.
47  */
48  ~ObexObjectPush() override;
49 
50  /**
51  * D-Bus object path of the object push session.
52  *
53  * @return object path of session
54  */
55  QDBusObjectPath objectPath() const;
56 
57  /**
58  * Sends one local file to the remote device.
59  *
60  * The returned ObexTransfer can be used to track progress of transfer.
61  *
62  * Possible errors: PendingCall::InvalidArguments, PendingCall::Failed
63  *
64  * @param fileName full path of file to send
65  * @return ObexTransfer * pending call
66  */
67  PendingCall *sendFile(const QString &fileName);
68 
69  /**
70  * Pulls the business card from a remote device.
71  *
72  * If an empty @p targetFileName is given, a name will be
73  * automatically calculated for the temporary file.
74  *
75  * The returned ObexTransfer can be used to track progress of transfer.
76  *
77  * Possible errors: PendingCall::InvalidArguments, PendingCall::Failed
78  *
79  * @param targetFileName full path where the business card will be saved
80  * @return ObexTransfer * pending call
81  */
82  PendingCall *pullBusinessCard(const QString &targetFileName);
83 
84  /**
85  * Exchanges the business cards on the remote device.
86  *
87  * This method pushes the local business card to the remote
88  * device and then retrieve the remote business card and store
89  * it in a local file.
90  *
91  * If an empty @p targetFileName is given, a name will be
92  * automatically calculated for the temporary file.
93  *
94  * The returned ObexTransfer can be used to track progress of transfer.
95  *
96  * Possible errors: PendingCall::InvalidArguments, PendingCall::Failed
97  *
98  * @param clientFileName full path to local business card
99  * @param targetFileName full path where the business card will be saved
100  * @return ObexTransfer * pending call
101  */
102  PendingCall *exchangeBusinessCards(const QString &clientFileName, const QString &targetFileName);
103 
104 private:
105  class ObexObjectPushPrivate *const d;
106 
107  friend class ObexObjectPushPrivate;
108 };
109 
110 } // namespace BluezQt
111 
112 #endif // BLUEZQT_OBEXOBJECTPUSH_H
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.