Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
remotedevicemanager_p.h
Go to the documentation of this file.
1// Copyright (C) 2020 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
4#ifndef REMOTEDEVICEMANAGER_P_H
5#define REMOTEDEVICEMANAGER_P_H
6
7//
8// W A R N I N G
9// -------------
10//
11// This file is not part of the Qt API. It exists purely as an
12// implementation detail. This header file may change from version to
13// version without notice, or even be removed.
14//
15// We mean it.
16//
17
18#include <deque>
19
20#include <QList>
21#include <QMutex>
22#include <QObject>
23
24#include <QtBluetooth/qbluetoothaddress.h>
25#include <QtCore/private/qglobal_p.h>
26
27
29
30// This API is kept a bit more generic in anticipation of further changes in the future.
31
33{
35public:
36 enum class JobType
37 {
39 };
40
41 explicit RemoteDeviceManager(const QBluetoothAddress& localAddress, QObject *parent = nullptr);
42
43 bool isJobInProgress() const { return jobInProgress; }
44 bool scheduleJob(JobType job, const QList<QBluetoothAddress> &remoteDevices);
45
47 void finished();
48
49private slots:
50 void runQueue();
51 void prepareNextJob();
52
53private:
54 void disconnectDevice(const QBluetoothAddress& remote);
55
56 bool jobInProgress = false;
57 QBluetoothAddress localAddress;
58 std::deque<std::pair<JobType, QBluetoothAddress>> jobQueue;
59 QString adapterPath;
60};
61
63
64#endif // REMOTEDEVICEMANAGER_P_H
\inmodule QtBluetooth
\inmodule QtCore
Definition qobject.h:103
QObject * parent() const
Returns a pointer to the parent object.
Definition qobject.h:346
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:129
bool scheduleJob(JobType job, const QList< QBluetoothAddress > &remoteDevices)
RemoteDeviceManager(const QBluetoothAddress &localAddress, QObject *parent=nullptr)
Convenience wrapper around org.bluez.Device1 management.
Combined button and popup list for selecting options.
#define Q_OBJECT
#define slots
#define signals