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