Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qbluetoothutils_winrt_p.h
Go to the documentation of this file.
1// Copyright (C) 2021 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 QBLUETOOTHUTILS_WINRT_P_H
5#define QBLUETOOTHUTILS_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// Workaround for Windows SDK bug.
19// See https://github.com/microsoft/Windows.UI.Composition-Win32-Samples/issues/47
20 #include <winrt/base.h>
21#include <QtCore/private/qfactorycacheregistration_p.h>
22namespace winrt::impl
23{
24 template <typename Async>
25 auto wait_for(Async const& async, Windows::Foundation::TimeSpan const& timeout);
26}
27
28#include <QtCore/QtGlobal>
29#include <QtCore/private/qglobal_p.h>
30
31#include <wrl/client.h>
32
33namespace ABI {
34 namespace Windows {
35 namespace Storage {
36 namespace Streams {
37 struct IBuffer;
38 }
39 }
40 }
41}
42
43QT_BEGIN_NAMESPACE
44
45using NativeBuffer = ABI::Windows::Storage::Streams::IBuffer;
46QByteArray byteArrayFromBuffer(const Microsoft::WRL::ComPtr<NativeBuffer> &buffer,
47 bool isWCharString = false);
48
49// The calls to Co(Un)init must be balanced
50void mainThreadCoInit(void* caller);
51void mainThreadCoUninit(void* caller);
52
53QT_END_NAMESPACE
54
55#endif // QBLUETOOTHSOCKET_WINRT_P_H
void deviceAdded(const QBluetoothAddress &address)
void deviceRemoved(const QBluetoothAddress &address)
void updateMode(winrt::hstring adapterId, QBluetoothLocalDevice::HostMode mode)
void modeChanged(winrt::hstring id, QBluetoothLocalDevice::HostMode mode)
QList< QBluetoothAddress > connectedDevices()
void adapterRemoved(winrt::hstring id)
void removeClient(winrt::hstring adapterId)
QBluetoothLocalDevicePrivate(QBluetoothLocalDevice *=nullptr, QBluetoothAddress=QBluetoothAddress())
void init(AdapterManager *manager, AddedSlot onAdded, RemovedSlot onRemoved)
WatcherWrapper(winrt::hstring selector)
auto wait_for(Async const &async, Windows::Foundation::TimeSpan const &timeout)
Windows::Foundation::AsyncStatus AsyncStatus
static DeviceInformationCollection getAvailableAdapters()
DeviceInformationPairing pairingInfoFromAddress(const QBluetoothAddress &address)
static const int kMaximumAttempts
static BluetoothInfo getBluetoothInfo(winrt::hstring id)
QByteArray byteArrayFromBuffer(const Microsoft::WRL::ComPtr< NativeBuffer > &buffer, bool isWCharString=false)
void mainThreadCoInit(void *caller)
void mainThreadCoUninit(void *caller)
~PairingWorker()=default
PairingWorker(QBluetoothLocalDevice *device)
void pairAsync(const QBluetoothAddress &addr, QBluetoothLocalDevice::Pairing pairing)