1
/****************************************************************************
3
** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies).
4
** Contact: http://www.qt-project.org/legal
6
** This file is part of the QtSystems module of the Qt Toolkit.
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 Digia. For licensing terms and
14
** conditions see http://qt.digia.com/licensing. For further information
15
** use the contact form at http://qt.digia.com/contact-us.
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 2.1 as published by the Free Software
20
** Foundation and appearing in the file LICENSE.LGPL included in the
21
** packaging of this file. Please review the following information to
22
** ensure the GNU Lesser General Public License version 2.1 requirements
23
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
25
** In addition, as a special exception, Digia gives you certain additional
26
** rights. These rights are described in the Digia Qt LGPL Exception
27
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
29
** GNU General Public License Usage
30
** Alternatively, this file may be used under the terms of the GNU
31
** General Public License version 3.0 as published by the Free Software
32
** Foundation and appearing in the file LICENSE.GPL included in the
33
** packaging of this file. Please review the following information to
34
** ensure the GNU General Public License version 3.0 requirements will be
35
** met: http://www.gnu.org/copyleft/gpl.html.
40
****************************************************************************/
46
// This file is not part of the Qt API. It exists purely as an
47
// implementation detail. This header file may change from version to
48
// version without notice, or even be removed.
53
#ifndef QDECLARATIVENETWORKINFO_P_H
54
#define QDECLARATIVENETWORKINFO_P_H
56
#include <qnetworkinfo.h>
60
class QDeclarativeNetworkInfo : public QObject
64
Q_ENUMS(CellDataTechnology)
66
Q_ENUMS(NetworkStatus)
68
Q_PROPERTY(bool monitorNetworkSignalStrength READ monitorNetworkSignalStrength WRITE setMonitorNetworkSignalStrength NOTIFY monitorNetworkSignalStrengthChanged)
69
Q_PROPERTY(bool monitorNetworkStatus READ monitorNetworkStatus WRITE setMonitorNetworkStatus NOTIFY monitorNetworkStatusChanged)
70
Q_PROPERTY(bool monitorNetworkName READ monitorNetworkName WRITE setMonitorNetworkName NOTIFY monitorNetworkNameChanged)
71
Q_PROPERTY(bool monitorCurrentNetworkMode READ monitorCurrentNetworkMode WRITE setMonitorCurrentNetworkMode NOTIFY monitorCurrentNetworkModeChanged)
73
Q_PROPERTY(NetworkMode currentNetworkMode READ currentNetworkMode NOTIFY currentNetworkModeChanged)
76
Q_PROPERTY(bool monitorNetworkInterfaceCount READ monitorNetworkInterfaceCount WRITE setMonitorNetworkInterfaceCount NOTIFY monitorNetworkInterfaceCountChanged)
77
Q_PROPERTY(bool monitorCurrentCellDataTechnology READ monitorCurrentCellDataTechnology WRITE setMonitorCurrentCellDataTechnology NOTIFY monitorCurrentCellDataTechnologyChanged)
78
Q_PROPERTY(bool monitorCellId READ monitorCellId WRITE setMonitorCellId NOTIFY monitorCellIdChanged)
79
Q_PROPERTY(bool monitorCurrentMobileCountryCode READ monitorCurrentMobileCountryCode WRITE setMonitorCurrentMobileCountryCode NOTIFY monitorCurrentMobileCountryCodeChanged)
80
Q_PROPERTY(bool monitorCurrentMobileNetworkCode READ monitorCurrentMobileNetworkCode WRITE setMonitorCurrentMobileNetworkCode NOTIFY monitorCurrentMobileNetworkCodeChanged)
81
Q_PROPERTY(bool monitorLocationAreaCode READ monitorLocationAreaCode WRITE setMonitorLocationAreaCode NOTIFY monitorLocationAreaCodeChanged)
84
enum CellDataTechnology {
85
UnknownDataTechnology = QNetworkInfo::UnknownDataTechnology,
86
GprsDataTechnology = QNetworkInfo::GprsDataTechnology,
87
EdgeDataTechnology = QNetworkInfo::EdgeDataTechnology,
88
UmtsDataTechnology = QNetworkInfo::UmtsDataTechnology,
89
HspaDataTechnology = QNetworkInfo::HspaDataTechnology
93
UnknownMode = QNetworkInfo::UnknownMode,
94
GsmMode = QNetworkInfo::GsmMode,
95
CdmaMode = QNetworkInfo::CdmaMode,
96
WcdmaMode = QNetworkInfo::WcdmaMode,
97
WlanMode = QNetworkInfo::WlanMode,
98
EthernetMode = QNetworkInfo::EthernetMode,
99
BluetoothMode = QNetworkInfo::BluetoothMode,
100
WimaxMode = QNetworkInfo::WimaxMode,
101
LteMode = QNetworkInfo::LteMode,
102
TdscdmaMode = QNetworkInfo::TdscdmaMode
106
UnknownStatus = QNetworkInfo::UnknownStatus,
107
NoNetworkAvailable = QNetworkInfo::NoNetworkAvailable,
108
EmergencyOnly = QNetworkInfo::EmergencyOnly,
109
Searching = QNetworkInfo::Searching,
110
Busy = QNetworkInfo::Busy,
111
Denied = QNetworkInfo::Denied,
112
HomeNetwork = QNetworkInfo::HomeNetwork,
113
Roaming = QNetworkInfo::Roaming
116
QDeclarativeNetworkInfo(QObject *parent = 0);
117
virtual ~QDeclarativeNetworkInfo();
119
bool monitorCurrentNetworkMode() const;
120
void setMonitorCurrentNetworkMode(bool monitor);
121
NetworkMode currentNetworkMode() const;
123
bool monitorNetworkSignalStrength() const;
124
void setMonitorNetworkSignalStrength(bool monitor);
125
Q_INVOKABLE int networkSignalStrength(NetworkMode mode, int interface) const;
127
bool monitorNetworkInterfaceCount() const;
128
void setMonitorNetworkInterfaceCount(bool monitor);
129
Q_INVOKABLE int networkInterfaceCount(NetworkMode mode) const;
131
bool monitorCurrentCellDataTechnology() const;
132
void setMonitorCurrentCellDataTechnology(bool monitor);
133
Q_INVOKABLE int currentCellDataTechnology(int interface) const;
135
bool monitorNetworkStatus() const;
136
void setMonitorNetworkStatus(bool monitor);
137
Q_INVOKABLE int networkStatus(NetworkMode mode, int interface) const;
139
bool monitorCellId() const;
140
void setMonitorCellId(bool monitor);
141
Q_INVOKABLE QString cellId(int interface) const;
143
bool monitorCurrentMobileCountryCode() const;
144
void setMonitorCurrentMobileCountryCode(bool monitor);
145
Q_INVOKABLE QString currentMobileCountryCode(int interface) const;
147
bool monitorCurrentMobileNetworkCode() const;
148
void setMonitorCurrentMobileNetworkCode(bool monitor);
149
Q_INVOKABLE QString currentMobileNetworkCode(int interface) const;
151
bool monitorLocationAreaCode() const;
152
void setMonitorLocationAreaCode(bool monitor);
153
Q_INVOKABLE QString locationAreaCode(int interface) const;
155
bool monitorNetworkName() const;
156
void setMonitorNetworkName(bool monitor);
157
Q_INVOKABLE QString networkName(NetworkMode mode, int interface) const;
159
Q_INVOKABLE QString homeMobileCountryCode(int interface) const;
160
Q_INVOKABLE QString homeMobileNetworkCode(int interface) const;
161
Q_INVOKABLE QString imsi(int interface) const;
162
Q_INVOKABLE QString macAddress(NetworkMode mode, int interface) const;
165
void monitorCurrentCellDataTechnologyChanged();
166
void monitorCurrentNetworkModeChanged();
167
void monitorNetworkSignalStrengthChanged();
168
void monitorNetworkInterfaceCountChanged();
169
void monitorNetworkStatusChanged();
170
void monitorCellIdChanged();
171
void monitorCurrentMobileCountryCodeChanged();
172
void monitorCurrentMobileNetworkCodeChanged();
173
void monitorLocationAreaCodeChanged();
174
void monitorNetworkNameChanged();
176
void cellIdChanged(int interfaceIndex, const QString &id);
177
void currentCellDataTechnologyChanged(int interfaceIndex, int tech);
178
void currentMobileCountryCodeChanged(int interfaceIndex, const QString &mcc);
179
void currentMobileNetworkCodeChanged(int interfaceIndex, const QString &mnc);
180
void currentNetworkModeChanged();
181
void locationAreaCodeChanged(int interfaceIndex, const QString &lac);
182
void networkInterfaceCountChanged(int mode, int count);
183
void networkNameChanged(int mode, int interfaceIndex, const QString &name);
184
void networkSignalStrengthChanged(int mode, int interfaceIndex, int strength);
185
void networkStatusChanged(int mode, int interfaceIndex, int status);
188
void _q_currentCellDataTechnologyChanged(int interface, QNetworkInfo::CellDataTechnology tech);
189
void _q_networkInterfaceCountChanged(QNetworkInfo::NetworkMode mode, int count);
190
void _q_networkSignalStrengthChanged(QNetworkInfo::NetworkMode mode, int interface, int strength);
191
void _q_networkStatusChanged(QNetworkInfo::NetworkMode mode, int interface, QNetworkInfo::NetworkStatus status);
192
void _q_networkNameChanged(QNetworkInfo::NetworkMode mode, int interface, const QString &name);
195
QNetworkInfo *networkInfo;
197
bool isMonitorCurrentNetworkMode;
198
bool isMonitorNetworkSignalStrength;
199
bool isMonitorNetworkInterfaceCount;
200
bool isMonitorCurrentCellDataTechnology;
201
bool isMonitorNetworkStatus;
202
bool isMonitorCellId;
203
bool isMonitorCurrentMobileCountryCode;
204
bool isMonitorCurrentMobileNetworkCode;
205
bool isMonitorLocationAreaCode;
206
bool isMonitorNetworkName;
211
#endif // QDECLARATIVENETWORKINFO_P_H