Debian Codegraph @

src/systeminfo/qnetworkinfo.h

raw symbols ◀ ▶ SCIP
1 Debian patch touch this file
1 /****************************************************************************
2 **
3 ** Copyright (C) 2018 The Qt Company Ltd and/or its subsidiary(-ies).
4 ** Contact: http://www.qt-project.org/legal
5 **
6 ** This file is part of the QtSystems module of the Qt Toolkit.
7 **
8 ** $QT_BEGIN_LICENSE:LGPL$
9 ** Commercial License Usage
10 ** Licensees holding valid commercial Qt licenses may use this file in
11 ** accordance with the commercial license agreement provided with the
12 ** Software or, alternatively, in accordance with the terms contained in
13 ** a written agreement between you and The Qt Company. For licensing terms
14 ** and conditions see https://www.qt.io/terms-conditions. For further
15 ** information use the contact form at https://www.qt.io/contact-us.
16 **
17 ** GNU Lesser General Public License Usage
18 ** Alternatively, this file may be used under the terms of the GNU Lesser
19 ** General Public License version 3 as published by the Free Software
20 ** Foundation and appearing in the file LICENSE.LGPL3 included in the
21 ** packaging of this file. Please review the following information to
22 ** ensure the GNU Lesser General Public License version 3 requirements
23 ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
24 **
25 ** GNU General Public License Usage
26 ** Alternatively, this file may be used under the terms of the GNU
27 ** General Public License version 2.0 or (at your option) the GNU General
28 ** Public license version 3 or any later version approved by the KDE Free
29 ** Qt Foundation. The licenses are as published by the Free Software
30 ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
31 ** included in the packaging of this file. Please review the following
32 ** information to ensure the GNU General Public License requirements will
33 ** be met: https://www.gnu.org/licenses/gpl-2.0.html and
34 ** https://www.gnu.org/licenses/gpl-3.0.html.
35 **
36 ** $QT_END_LICENSE$
37 **
38 ****************************************************************************/
39
40 #ifndef QNETWORKINFO_H
41 #define QNETWORKINFO_H
42
43 #include "qsysteminfoglobal.h"
44 #include <QtCore/qobject.h>
45 #include <QtNetwork/qnetworkinterface.h>
46
47 QT_BEGIN_NAMESPACE
48
49 class QNetworkInfoPrivate;
50
51 class Q_SYSTEMINFO_EXPORT QNetworkInfo : public QObject
52 {
53 Q_OBJECT
54
55 public:
56 enum CellDataTechnology {
57 UnknownDataTechnology = 0,
58 GprsDataTechnology,
59 EdgeDataTechnology,
60 UmtsDataTechnology,
61 HspaDataTechnology
62 };
63
64 enum NetworkMode {
65 UnknownMode = 0,
66 GsmMode,
67 CdmaMode,
68 WcdmaMode,
69 WlanMode,
70 EthernetMode,
71 BluetoothMode,
72 WimaxMode,
73 LteMode,
74 TdscdmaMode
75 };
76
77 enum NetworkStatus {
78 UnknownStatus = 0,
79 NoNetworkAvailable,
80 EmergencyOnly,
81 Searching,
82 Busy,
83 Denied,
84 HomeNetwork,
85 Roaming
86 // ,Connected //desktop
87 };
88
89 explicit QNetworkInfo(QObject *parent = Q_NULLPTR);
90 virtual ~QNetworkInfo();
91
92 int networkInterfaceCount(QNetworkInfo::NetworkMode mode) const;
93 int networkSignalStrength(QNetworkInfo::NetworkMode mode, int interfaceDevice) const;
94 QNetworkInfo::CellDataTechnology currentCellDataTechnology(int interfaceDevice) const;
95 QNetworkInfo::NetworkMode currentNetworkMode() const;
96 QNetworkInfo::NetworkStatus networkStatus(QNetworkInfo::NetworkMode mode, int interfaceDevice) const;
97 #ifndef QT_NO_NETWORKINTERFACE
98 QNetworkInterface interfaceForMode(QNetworkInfo::NetworkMode mode, int interfaceDevice) const;
99 #endif // QT_NO_NETWORKINTERFACE
100 QString cellId(int interfaceDevice) const;
101 QString currentMobileCountryCode(int interfaceDevice) const;
102 QString currentMobileNetworkCode(int interfaceDevice) const;
103 QString homeMobileCountryCode(int interfaceDevice) const;
104 QString homeMobileNetworkCode(int interfaceDevice) const;
105 QString imsi(int interfaceDevice) const;
106 QString locationAreaCode(int interfaceDevice) const;
107 QString macAddress(QNetworkInfo::NetworkMode mode, int interfaceDevice) const;
108 QString networkName(QNetworkInfo::NetworkMode mode, int interfaceDevice) const;
109
110 Q_SIGNALS:
111 void cellIdChanged(int interfaceDevice, const QString &id);
112 void currentCellDataTechnologyChanged(int interfaceDevice, QNetworkInfo::CellDataTechnology tech);
113 void currentMobileCountryCodeChanged(int interfaceDevice, const QString &mcc);
114 void currentMobileNetworkCodeChanged(int interfaceDevice, const QString &mnc);
115 void currentNetworkModeChanged(QNetworkInfo::NetworkMode mode);
116 void locationAreaCodeChanged(int interfaceDevice, const QString &lac);
117 void networkInterfaceCountChanged(QNetworkInfo::NetworkMode mode, int count);
118 void networkNameChanged(QNetworkInfo::NetworkMode mode, int interfaceDevice, const QString &name);
119 void networkSignalStrengthChanged(QNetworkInfo::NetworkMode mode, int interfaceDevice, int strength);
120 void networkStatusChanged(QNetworkInfo::NetworkMode mode, int interfaceDevice, QNetworkInfo::NetworkStatus status);
121
122 protected:
•123 void connectNotify(const QMetaMethod &signal) override;
124 void disconnectNotify(const QMetaMethod &signal) override;
125
126 private:
127 Q_DISABLE_COPY(QNetworkInfo)
128 QNetworkInfoPrivate * const d_ptr;
129 Q_DECLARE_PRIVATE(QNetworkInfo)
130 };
131
132 QT_END_NAMESPACE
133
134 #endif // QNETWORKINFO_H