blob: d15faf0e8e6deb7bc1389ed1d6544acfde002d9f (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
|
// Copyright (C) 2021 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#ifndef ANDROIDCONNECTIVITYMANAGER_H
#define ANDROIDCONNECTIVITYMANAGER_H
#include <QObject>
#include <QtCore/qjniobject.h>
QT_BEGIN_NAMESPACE
class AndroidConnectivityManager : public QObject
{
Q_OBJECT
public:
// Keep synchronized with AndroidConnectivity in QtAndroidNetworkInformation.java
enum class AndroidConnectivity { Connected, Unknown, Disconnected };
Q_ENUM(AndroidConnectivity);
// Keep synchronized with Transport in QtAndroidNetworkInformation.java
enum class AndroidTransport {
Unknown,
Bluetooth,
Cellular,
Ethernet,
LoWPAN,
Usb,
WiFi,
WiFiAware,
};
Q_ENUM(AndroidTransport);
static AndroidConnectivityManager *getInstance();
~AndroidConnectivityManager();
inline bool isValid() const;
Q_SIGNALS:
void connectivityChanged(AndroidConnectivity connectivity);
void captivePortalChanged(bool state);
void transportMediumChanged(AndroidTransport transport);
void meteredChanged(bool state);
private:
friend struct AndroidConnectivityManagerInstance;
AndroidConnectivityManager();
bool registerNatives() const;
Q_DISABLE_COPY_MOVE(AndroidConnectivityManager);
};
QT_END_NAMESPACE
#endif // ANDROIDCONNECTIVITYMANAGER_H
|