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
qnetworkmanagernetworkinformationbackend.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 QNETWORKMANAGERINFORMATIONBACKEND_H
6#define QNETWORKMANAGERINFORMATIONBACKEND_H
7
8//
9// W A R N I N G
10// -------------
11//
12// This file is not part of the Qt API. It exists purely as an
13// implementation detail. This header file may change from version to
14// version without notice, or even be removed.
15//
16// We mean it.
17//
18
19#include <QtNetwork/private/qnetworkinformation_p.h>
21
23
25{
27public:
30
31 QString name() const override;
33 {
34 if (!isValid())
35 return {};
36 return featuresSupportedStatic();
37 }
38
40 {
41 using Feature = QNetworkInformation::Feature;
42 return QNetworkInformation::Features(Feature::Reachability | Feature::CaptivePortal
43 | Feature::TransportMedium | Feature::Metered);
44 }
45
46 bool isValid() const { return iface.isValid(); }
47
48 void onStateChanged(QNetworkManagerInterface::NMState state);
49 void onConnectivityChanged(QNetworkManagerInterface::NMConnectivityState connectivityState);
50 void onDeviceTypeChanged(QNetworkManagerInterface::NMDeviceType deviceType);
52
53private:
55
57};
58
59QT_END_NAMESPACE
60
61#endif
QString name() const override
Backend name, return the same in QNetworkInformationBackend::name().
QNetworkInformationBackend * create(QNetworkInformation::Features requiredFeatures) const override
Create and return an instance of QNetworkInformationBackend.
QNetworkInformation::Features featuresSupported() const override
Features supported, return the same in QNetworkInformationBackend::featuresSupported().
void onStateChanged(QNetworkManagerInterface::NMState state)
QString name() const override
Backend name, return the same in QNetworkInformationBackendFactory::name().
void onMeteredChanged(QNetworkManagerInterface::NMMetered metered)
void onConnectivityChanged(QNetworkManagerInterface::NMConnectivityState connectivityState)
void onDeviceTypeChanged(QNetworkManagerInterface::NMDeviceType deviceType)
QNetworkInformation::Features featuresSupported() const override
Features supported, return the same in QNetworkInformationBackendFactory::featuresSupported().