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
qnetworklistmanagerevents.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 QNETWORKLISTMANAGEREVENTS_H
5#define QNETWORKLISTMANAGEREVENTS_H
6
7#include <QtNetwork/private/qtnetworkglobal_p.h>
8
9#include <QtNetwork/qnetworkinformation.h>
10
11#include <QtCore/qstring.h>
12#include <QtCore/qobject.h>
13#include <QtCore/qloggingcategory.h>
14#include <QtCore/qmutex.h>
15
16#include <objbase.h>
17#include <ocidl.h>
18#include <netlistmgr.h>
19#include <QtCore/private/qcomptr_p.h>
20#include <wrl/wrappers/corewrappers.h>
21
22#if QT_CONFIG(cpp_winrt)
23#include <QtCore/private/qt_winrtbase_p.h>
24#endif
25
26using namespace Microsoft::WRL;
27
30
32{
34public:
37
38 HRESULT STDMETHODCALLTYPE QueryInterface(REFIID riid, void **ppvObject) override;
39
42 {
43 if (--ref == 0) {
44 delete this;
45 return 0;
46 }
47 return ref;
48 }
49
51
52 [[nodiscard]] bool start();
53 void stop();
54
56
60 void isMeteredChanged(bool);
61
62private:
63 ComPtr<INetworkListManager> networkListManager = nullptr;
64 ComPtr<IConnectionPoint> connectionPoint = nullptr;
65
66#if QT_CONFIG(cpp_winrt)
67 void emitWinRTUpdates();
68
71#endif
72
73 QAtomicInteger<ULONG> ref = 0;
74 DWORD cookie = 0;
75};
76
77QT_END_NAMESPACE
78
79#endif // QNETWORKLISTMANAGEREVENTS_H
void transportMediumChanged(QNetworkInformation::TransportMedium)
bool QueryInterfaceImpl(IUnknown *from, REFIID riid, void **ppvObject)
QT_BEGIN_NAMESPACE Q_DECLARE_LOGGING_CATEGORY(lcEventDispatcher)