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
androidconnectivitymanager.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 ANDROIDCONNECTIVITYMANAGER_H
6#define ANDROIDCONNECTIVITYMANAGER_H
7
8#include <QObject>
9#include <QtCore/qjniobject.h>
10
11QT_BEGIN_NAMESPACE
12
13class AndroidConnectivityManager : public QObject
14{
15 Q_OBJECT
16public:
17 // Keep synchronized with AndroidConnectivity in QtAndroidNetworkInformation.java
18 enum class AndroidConnectivity { Connected, Unknown, Disconnected };
19 Q_ENUM(AndroidConnectivity);
20
21 // Keep synchronized with Transport in QtAndroidNetworkInformation.java
22 enum class AndroidTransport {
23 Unknown,
24 Bluetooth,
25 Cellular,
26 Ethernet,
27 LoWPAN,
28 Usb,
29 WiFi,
30 WiFiAware,
31 };
32 Q_ENUM(AndroidTransport);
33
34 static AndroidConnectivityManager *getInstance();
35 ~AndroidConnectivityManager();
36
37 inline bool isValid() const;
38
39Q_SIGNALS:
40 void connectivityChanged(AndroidConnectivity connectivity);
41 void captivePortalChanged(bool state);
42 void transportMediumChanged(AndroidTransport transport);
43 void meteredChanged(bool state);
44
45private:
46 friend struct AndroidConnectivityManagerInstance;
47 AndroidConnectivityManager();
48 bool registerNatives() const;
49
50 Q_DISABLE_COPY_MOVE(AndroidConnectivityManager);
51};
52
54
55#endif // ANDROIDCONNECTIVITYMANAGER_H
QNetworkInformation::Features featuresSupported() const override
Features supported, return the same in QNetworkInformationBackend::featuresSupported().
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.
static QNetworkInformation::Features featuresSupportedStatic()
QNetworkInformation::Features featuresSupported() const override
Features supported, return the same in QNetworkInformationBackendFactory::featuresSupported().
QString name() const override
Backend name, return the same in QNetworkInformationBackendFactory::name().
static QString backendName()