Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Toggle main menu visibility
Loading...
Searching...
No Matches
qbluetoothdevicewatcher_winrt_p.h
Go to the documentation of this file.
1
// Copyright (C) 2022 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
QBLUETOOTHDEVICEWATCHER_WINRT_P_H
5
#
define
QBLUETOOTHDEVICEWATCHER_WINRT_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
<
QtCore
/
private
/
qglobal_p
.
h
>
19
#
include
<
QtCore
/
QObject
>
20
21
#
include
<
private
/
qbluetoothutils_winrt_p
.
h
>
22
23
#
include
<
winrt
/
base
.
h
>
24
#
include
<
QtCore
/
private
/
qfactorycacheregistration_p
.
h
>
25
#
include
<
winrt
/
Windows
.
Devices
.
Enumeration
.
h
>
26
27
QT_BEGIN_NAMESPACE
28
29
class
QBluetoothDeviceWatcherWinRT :
public
QObject,
30
public
std::enable_shared_from_this<QBluetoothDeviceWatcherWinRT>
31
{
32
Q_OBJECT
33
public
:
34
QBluetoothDeviceWatcherWinRT(
int
id, winrt::hstring selector);
35
QBluetoothDeviceWatcherWinRT(
int
id, winrt::hstring selector,
36
winrt::Windows::Devices::Enumeration::DeviceInformationKind kind);
37
~QBluetoothDeviceWatcherWinRT();
38
39
bool
init();
40
void
start();
41
void
stop();
42
43
signals:
44
// The signals will be emitted from a separate thread,
45
// so we need to use Qt::QueuedConnection
46
void
deviceAdded(winrt::hstring deviceId,
int
id);
47
void
deviceRemoved(winrt::hstring deviceId,
int
id);
48
void
deviceUpdated(winrt::hstring deviceId,
int
id);
49
void
enumerationCompleted(
int
id);
50
void
watcherStopped(
int
id);
51
52
private
:
53
void
subscribeToEvents();
54
void
unsubscribeFromEvents();
55
bool
canStop()
const
;
56
57
const
int
m_id;
// used to uniquely identify the wrapper
58
winrt::Windows::Devices::Enumeration::DeviceWatcher m_watcher =
nullptr
;
59
60
winrt::event_token m_addedToken;
61
winrt::event_token m_removedToken;
62
winrt::event_token m_updatedToken;
63
winrt::event_token m_enumerationToken;
64
winrt::event_token m_stoppedToken;
65
};
66
67
QT_END_NAMESPACE
68
69
#
endif
// QBLUETOOTHDEVICEWATCHER_WINRT_P_H
qtconnectivity
src
bluetooth
qbluetoothdevicewatcher_winrt_p.h
Generated on
for Qt by
1.18.0