DtkBluetooth
BlueZ DBus interface binding for Qt
dbluetoothobexsession.h
浏览该文件的文档.
1// SPDX-FileCopyrightText: 2023 UnionTech Software Technology Co., Ltd.
2//
3// SPDX-License-Identifier: LGPL-3.0-or-later
4
5#ifndef DBLUETOOTHOBEXSESSION_H
6#define DBLUETOOTHOBEXSESSION_H
7
8#include "dbluetoothtypes.h"
9#include <DExpected>
10#include <DObject>
11#include <QFileInfo>
12#include <QDir>
13#include <QBluetoothUuid>
14
15DBLUETOOTH_BEGIN_NAMESPACE
16
17using DTK_CORE_NAMESPACE::DExpected;
18using DTK_CORE_NAMESPACE::DObject;
19
20class DObexTransfer;
21class DObexSessionPrivate;
22
23class DObexSession : public QObject, public DObject
24{
25 Q_OBJECT
26 explicit DObexSession(const ObexSessionInfo &info, QObject *parent = nullptr);
27 friend class DObexManager;
28
29public:
30 ~DObexSession() override = default;
31
32 Q_PROPERTY(QString source READ source CONSTANT)
33 Q_PROPERTY(QString destination READ destination CONSTANT)
34 Q_PROPERTY(QBluetoothUuid target READ target CONSTANT)
35 Q_PROPERTY(QDir root READ root CONSTANT)
36 Q_PROPERTY(ObexSessionInfo currentSession READ currentSession CONSTANT)
37
38 QString source() const;
39 QString destination() const;
40 QBluetoothUuid target() const;
41 QDir root() const;
42 ObexSessionInfo currentSession() const;
43
44 DExpected<QList<quint64>> transfers() const;
45 DExpected<QSharedPointer<DObexTransfer>> transferFromId(quint64 transferId) const;
46
47public Q_SLOTS:
48 DExpected<QString> capabilities();
49 DExpected<quint64> sendFile(const QFileInfo &file) const;
50
51Q_SIGNALS:
52 void transferAdded(quint64 transferId);
53 void transferRemoved(quint64 transferId);
54
55 void removed();
56
57private:
58 D_DECLARE_PRIVATE(DObexSession)
59};
60
61DBLUETOOTH_END_NAMESPACE
62#endif
蓝牙obex管理类
Definition: dbluetoothobexmanager.h:22
蓝牙obex会话类
Definition: dbluetoothobexsession.h:24
蓝牙obex管理类
Definition: dbluetoothobextransfer.h:21
一些自定义类型和枚举
传输会话的信息
Definition: dbluetoothtypes.h:23