Qt
6.x
The Qt SDK
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
28
QT_BEGIN_NAMESPACE
29
30
// This API is kept a bit more generic in anticipation of further changes in the future.
31
32
class
RemoteDeviceManager
:
public
QObject
33
{
34
Q_OBJECT
35
public
:
36
enum class
JobType
37
{
38
JobDisconnectDevice
,
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
46
signals
:
47
void
finished
();
48
49
private
slots
:
50
void
runQueue();
51
void
prepareNextJob();
52
53
private
:
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
62
QT_END_NAMESPACE
63
64
#endif
// REMOTEDEVICEMANAGER_P_H
QBluetoothAddress
\inmodule QtBluetooth
QList
Definition
qlist.h:74
QObject
\inmodule QtCore
Definition
qobject.h:90
QObject::parent
QObject * parent() const
Returns a pointer to the parent object.
Definition
qobject.h:311
QString
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition
qstring.h:127
RemoteDeviceManager
Definition
remotedevicemanager_p.h:33
RemoteDeviceManager::finished
void finished()
RemoteDeviceManager::isJobInProgress
bool isJobInProgress() const
Definition
remotedevicemanager_p.h:43
RemoteDeviceManager::JobType
JobType
Definition
remotedevicemanager_p.h:37
RemoteDeviceManager::JobType::JobDisconnectDevice
@ JobDisconnectDevice
RemoteDeviceManager::scheduleJob
bool scheduleJob(JobType job, const QList< QBluetoothAddress > &remoteDevices)
Definition
remotedevicemanager.cpp:34
QT_BEGIN_NAMESPACE
Combined button and popup list for selecting options.
Definition
qstandardpaths_haiku.cpp:21
QT_END_NAMESPACE
Definition
qsharedpointer.cpp:1545
Q_OBJECT
#define Q_OBJECT
Definition
qtmetamacros.h:117
slots
#define slots
Definition
qtmetamacros.h:40
signals
#define signals
Definition
qtmetamacros.h:41
qtconnectivity
src
bluetooth
bluez
remotedevicemanager_p.h
Generated by
1.9.7