BluezQt 5.109.0
obextransfer.h
1/*
2 * BluezQt - Asynchronous BlueZ wrapper library
3 *
4 * SPDX-FileCopyrightText: 2014-2015 David Rosca <nowrep@gmail.com>
5 *
6 * SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
7 */
8
9#ifndef BLUEZQT_OBEXTRANSFER_H
10#define BLUEZQT_OBEXTRANSFER_H
11
12#include <QObject>
13
14#include "bluezqt_export.h"
15#include "types.h"
16
17class QDBusObjectPath;
18
19namespace BluezQt
20{
21class PendingCall;
22
30class BLUEZQT_EXPORT ObexTransfer : public QObject
31{
32 Q_OBJECT
33
34 Q_PROPERTY(Status status READ status NOTIFY statusChanged)
35 Q_PROPERTY(QString name READ name)
36 Q_PROPERTY(QString type READ type)
37 Q_PROPERTY(quint64 time READ time)
38 Q_PROPERTY(quint64 size READ size)
39 Q_PROPERTY(quint64 transferred READ transferred NOTIFY transferredChanged)
40 Q_PROPERTY(QString fileName READ fileName NOTIFY fileNameChanged)
41 Q_PROPERTY(bool suspendable READ isSuspendable)
42
43public:
47 enum Status {
60 };
61 Q_ENUM(Status)
62
63
66 ~ObexTransfer() override;
67
73 ObexTransferPtr toSharedPtr() const;
74
80 QDBusObjectPath objectPath() const;
81
87 Status status() const;
88
94 QString name() const;
95
101 QString type() const;
102
108 quint64 time() const;
109
115 quint64 size() const;
116
122 quint64 transferred() const;
123
129 QString fileName() const;
130
136 bool isSuspendable() const;
137
147
160
169
170Q_SIGNALS:
174 void statusChanged(Status status);
175
179 void transferredChanged(quint64 transferred);
180
184 void fileNameChanged(const QString &fileName);
185
186private:
187 BLUEZQT_NO_EXPORT explicit ObexTransfer(const QString &path, const QVariantMap &properties);
188
189 class ObexTransferPrivate *const d;
190
191 friend class ObexTransferPrivate;
192 friend class ObexAgentAdaptor;
193 friend class PendingCallPrivate;
194};
195
196} // namespace BluezQt
197
198#endif // BLUEZQT_OBEXTRANSFER_H
OBEX transfer.
Definition obextransfer.h:31
PendingCall * resume()
Resumes the current transfer.
void statusChanged(Status status)
Indicates that the status of transfer have changed.
PendingCall * suspend()
Suspends the current transfer.
~ObexTransfer() override
Destroys an ObexTransfer object.
void transferredChanged(quint64 transferred)
Indicates that the number of transferred bytes have changed.
ObexTransferPtr toSharedPtr() const
Returns a shared pointer from this.
bool isSuspendable() const
Returns whether the transfer is suspendable.
void fileNameChanged(const QString &fileName)
Indicates that the name of transferred file have changed.
PendingCall * cancel()
Stops the current transfer.
Status status() const
Returns the status of the transfer.
quint64 transferred() const
Returns the number of bytes transferred.
quint64 time() const
Returns the time of the transferred object.
quint64 size() const
Returns the total size of the transferred object.
QString type() const
Returns the type of the transferred object.
Status
Status of transfer.
Definition obextransfer.h:47
@ Unknown
Indicates that the transfer status is unknown.
Definition obextransfer.h:59
@ Error
Indicates that the transfer have failed with error.
Definition obextransfer.h:57
@ Active
Indicates that the transfer is active.
Definition obextransfer.h:51
@ Suspended
Indicates that the transfer is suspended.
Definition obextransfer.h:53
@ Queued
Indicates that the transfer is queued.
Definition obextransfer.h:49
@ Complete
Indicates that the transfer have completed successfully.
Definition obextransfer.h:55
QDBusObjectPath objectPath() const
D-Bus object path of the transfer.
QString fileName() const
Returns the full name of the transferred file.
QString name() const
Returns the name of the transferred object.
Pending method call.
Definition pendingcall.h:33