~ubuntu-branches/ubuntu/utopic/qtsystems-opensource-src/utopic-proposed

« back to all changes in this revision

Viewing changes to src/imports/systeminfo/qdeclarativenetworkinfo_p.h

  • Committer: Package Import Robot
  • Author(s): Timo Jyrinki
  • Date: 2013-06-14 10:32:13 UTC
  • Revision ID: package-import@ubuntu.com-20130614103213-yao8gdav28kntvvj
Tags: upstream-5.0~git20130614
ImportĀ upstreamĀ versionĀ 5.0~git20130614

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/****************************************************************************
 
2
**
 
3
** Copyright (C) 2012 Digia Plc 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 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.
 
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 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.
 
24
**
 
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.
 
28
**
 
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.
 
36
**
 
37
**
 
38
** $QT_END_LICENSE$
 
39
**
 
40
****************************************************************************/
 
41
 
 
42
//
 
43
//  W A R N I N G
 
44
//  -------------
 
45
//
 
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.
 
49
//
 
50
// We mean it.
 
51
//
 
52
 
 
53
#ifndef QDECLARATIVENETWORKINFO_P_H
 
54
#define QDECLARATIVENETWORKINFO_P_H
 
55
 
 
56
#include <qnetworkinfo.h>
 
57
 
 
58
QT_BEGIN_NAMESPACE
 
59
 
 
60
class QDeclarativeNetworkInfo : public QObject
 
61
{
 
62
    Q_OBJECT
 
63
 
 
64
    Q_ENUMS(CellDataTechnology)
 
65
    Q_ENUMS(NetworkMode)
 
66
    Q_ENUMS(NetworkStatus)
 
67
 
 
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)
 
72
 
 
73
    Q_PROPERTY(NetworkMode currentNetworkMode READ currentNetworkMode NOTIFY currentNetworkModeChanged)
 
74
 
 
75
    // obsoleted
 
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)
 
82
 
 
83
public:
 
84
    enum CellDataTechnology {
 
85
        UnknownDataTechnology = QNetworkInfo::UnknownDataTechnology,
 
86
        GprsDataTechnology = QNetworkInfo::GprsDataTechnology,
 
87
        EdgeDataTechnology = QNetworkInfo::EdgeDataTechnology,
 
88
        UmtsDataTechnology = QNetworkInfo::UmtsDataTechnology,
 
89
        HspaDataTechnology = QNetworkInfo::HspaDataTechnology
 
90
    };
 
91
 
 
92
    enum NetworkMode {
 
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
 
103
    };
 
104
 
 
105
    enum NetworkStatus {
 
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
 
114
    };
 
115
 
 
116
    QDeclarativeNetworkInfo(QObject *parent = 0);
 
117
    virtual ~QDeclarativeNetworkInfo();
 
118
 
 
119
    bool monitorCurrentNetworkMode() const;
 
120
    void setMonitorCurrentNetworkMode(bool monitor);
 
121
    NetworkMode currentNetworkMode() const;
 
122
 
 
123
    bool monitorNetworkSignalStrength() const;
 
124
    void setMonitorNetworkSignalStrength(bool monitor);
 
125
    Q_INVOKABLE int networkSignalStrength(NetworkMode mode, int interface) const;
 
126
 
 
127
    bool monitorNetworkInterfaceCount() const;
 
128
    void setMonitorNetworkInterfaceCount(bool monitor);
 
129
    Q_INVOKABLE int networkInterfaceCount(NetworkMode mode) const;
 
130
 
 
131
    bool monitorCurrentCellDataTechnology() const;
 
132
    void setMonitorCurrentCellDataTechnology(bool monitor);
 
133
    Q_INVOKABLE int currentCellDataTechnology(int interface) const;
 
134
 
 
135
    bool monitorNetworkStatus() const;
 
136
    void setMonitorNetworkStatus(bool monitor);
 
137
    Q_INVOKABLE int networkStatus(NetworkMode mode, int interface) const;
 
138
 
 
139
    bool monitorCellId() const;
 
140
    void setMonitorCellId(bool monitor);
 
141
    Q_INVOKABLE QString cellId(int interface) const;
 
142
 
 
143
    bool monitorCurrentMobileCountryCode() const;
 
144
    void setMonitorCurrentMobileCountryCode(bool monitor);
 
145
    Q_INVOKABLE QString currentMobileCountryCode(int interface) const;
 
146
 
 
147
    bool monitorCurrentMobileNetworkCode() const;
 
148
    void setMonitorCurrentMobileNetworkCode(bool monitor);
 
149
    Q_INVOKABLE QString currentMobileNetworkCode(int interface) const;
 
150
 
 
151
    bool monitorLocationAreaCode() const;
 
152
    void setMonitorLocationAreaCode(bool monitor);
 
153
    Q_INVOKABLE QString locationAreaCode(int interface) const;
 
154
 
 
155
    bool monitorNetworkName() const;
 
156
    void setMonitorNetworkName(bool monitor);
 
157
    Q_INVOKABLE QString networkName(NetworkMode mode, int interface) const;
 
158
 
 
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;
 
163
 
 
164
Q_SIGNALS:
 
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();
 
175
 
 
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);
 
186
 
 
187
private Q_SLOTS:
 
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);
 
193
 
 
194
private:
 
195
    QNetworkInfo *networkInfo;
 
196
 
 
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;
 
207
};
 
208
 
 
209
QT_END_NAMESPACE
 
210
 
 
211
#endif // QDECLARATIVENETWORKINFO_P_H