source: trunk/src/plugins/bearer/connman/qconnmanservice_linux_p.h

Last change on this file was 846, checked in by Dmitry A. Kuminov, 14 years ago

trunk: Merged in qt 4.7.2 sources from branches/vendor/nokia/qt.

File size: 9.2 KB
Line 
1/****************************************************************************
2**
3** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
4** All rights reserved.
5** Contact: Nokia Corporation ([email protected])
6**
7** This file is part of the plugins of the Qt Toolkit.
8**
9** $QT_BEGIN_LICENSE:LGPL$
10** Commercial Usage
11** Licensees holding valid Qt Commercial licenses may use this file in
12** accordance with the Qt Commercial License Agreement provided with the
13** Software or, alternatively, in accordance with the terms contained in
14** a written agreement between you and Nokia.
15**
16** GNU Lesser General Public License Usage
17** Alternatively, this file may be used under the terms of the GNU Lesser
18** General Public License version 2.1 as published by the Free Software
19** Foundation and appearing in the file LICENSE.LGPL included in the
20** packaging of this file. Please review the following information to
21** ensure the GNU Lesser General Public License version 2.1 requirements
22** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
23**
24** In addition, as a special exception, Nokia gives you certain additional
25** rights. These rights are described in the Nokia Qt LGPL Exception
26** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
27**
28** GNU General Public License Usage
29** Alternatively, this file may be used under the terms of the GNU
30** General Public License version 3.0 as published by the Free Software
31** Foundation and appearing in the file LICENSE.GPL included in the
32** packaging of this file. Please review the following information to
33** ensure the GNU General Public License version 3.0 requirements will be
34** met: http://www.gnu.org/copyleft/gpl.html.
35**
36** If you have questions regarding the use of this file, please contact
37** Nokia at [email protected].
38** $QT_END_LICENSE$
39**
40****************************************************************************/
41
42#ifndef QCONNMANSERVICE_H
43#define QCONNMANSERVICE_H
44
45//
46// W A R N I N G
47// -------------
48//
49// This file is not part of the Qt API. It exists purely as an
50// implementation detail. This header file may change from version to
51// version without notice, or even be removed.
52//
53// We mean it.
54//
55
56#include <QtDBus/QtDBus>
57#include <QtDBus/QDBusConnection>
58#include <QtDBus/QDBusError>
59#include <QtDBus/QDBusInterface>
60#include <QtDBus/QDBusMessage>
61#include <QtDBus/QDBusReply>
62
63#include <QtDBus/QDBusPendingCallWatcher>
64#include <QtDBus/QDBusObjectPath>
65#include <QtDBus/QDBusContext>
66#include <QMap>
67
68#ifndef QT_NO_BEARERMANAGEMENT
69#ifndef QT_NO_DBUS
70
71#ifndef __CONNMAN_DBUS_H
72
73#define CONNMAN_SERVICE "net.connman"
74#define CONNMAN_PATH "/net/connman"
75
76#define CONNMAN_DEBUG_INTERFACE CONNMAN_SERVICE ".Debug"
77#define CONNMAN_ERROR_INTERFACE CONNMAN_SERVICE ".Error"
78#define CONNMAN_AGENT_INTERFACE CONNMAN_SERVICE ".Agent"
79#define CONNMAN_COUNTER_INTERFACE CONNMAN_SERVICE ".Counter"
80
81#define CONNMAN_MANAGER_INTERFACE CONNMAN_SERVICE ".Manager"
82#define CONNMAN_MANAGER_PATH "/"
83
84#define CONNMAN_TASK_INTERFACE CONNMAN_SERVICE ".Task"
85#define CONNMAN_PROFILE_INTERFACE CONNMAN_SERVICE ".Profile"
86#define CONNMAN_SERVICE_INTERFACE CONNMAN_SERVICE ".Service"
87#define CONNMAN_PROVIDER_INTERFACE CONNMAN_SERVICE ".Provider"
88#define CONNMAN_TECHNOLOGY_INTERFACE CONNMAN_SERVICE ".Technology"
89#endif
90
91QT_BEGIN_NAMESPACE
92
93QT_END_NAMESPACE
94
95
96QT_BEGIN_NAMESPACE
97
98class QConnmanManagerInterface : public QDBusAbstractInterface
99{
100 Q_OBJECT
101
102public:
103
104 QConnmanManagerInterface( QObject *parent = 0);
105 ~QConnmanManagerInterface();
106
107 QDBusObjectPath path() const;
108
109 QVariantMap getProperties();
110 bool setProperty(const QString &name, const QDBusVariant &value);
111 QDBusObjectPath createProfile(const QString &name);
112 bool removeProfile(QDBusObjectPath path);
113 bool requestScan(const QString &type);
114 bool enableTechnology(const QString &type);
115 bool disableTechnology(const QString &type);
116 QDBusObjectPath connectService(QVariantMap &map);
117 void registerAgent(QDBusObjectPath &path);
118 void unregisterAgent(QDBusObjectPath path);
119 void registerCounter(const QString &path, quint32 interval);
120 void unregisterCounter(const QString &path);
121
122 QString requestSession(const QString &bearerName);
123 void releaseSession();
124
125 // properties
126 QString getState();
127 QStringList getAvailableTechnologies();
128 QStringList getEnabledTechnologies();
129 QStringList getConnectedTechnologies();
130 QString getDefaultTechnology();
131 bool getOfflineMode();
132 QString getActiveProfile();
133 QStringList getProfiles();
134 QStringList getTechnologies();
135 QStringList getServices();
136 QDBusObjectPath lookupService(const QString &);
137
138 QString getPathForTechnology(const QString &tech);
139
140
141Q_SIGNALS:
142 void propertyChanged(const QString &, const QDBusVariant &value);
143 void stateChanged(const QString &);
144 void propertyChangedContext(const QString &,const QString &,const QDBusVariant &);
145
146protected:
147 void connectNotify(const char *signal);
148 void disconnectNotify(const char *signal);
149 QVariant getProperty(const QString &);
150};
151
152class QConnmanProfileInterfacePrivate;
153class QConnmanProfileInterface : public QDBusAbstractInterface
154{
155 Q_OBJECT
156
157public:
158
159 QConnmanProfileInterface(const QString &dbusPathName,QObject *parent = 0);
160 ~QConnmanProfileInterface();
161
162 QVariantMap getProperties();
163// properties
164 QString getName();
165 bool isOfflineMode();
166 QStringList getServices();
167
168Q_SIGNALS:
169 void propertyChanged(const QString &, const QDBusVariant &value);
170private:
171 QConnmanProfileInterfacePrivate *d;
172
173protected:
174 void connectNotify(const char *signal);
175 void disconnectNotify(const char *signal);
176 QVariant getProperty(const QString &);
177};
178
179class QConnmanServiceInterface : public QDBusAbstractInterface
180{
181 Q_OBJECT
182
183public:
184
185 QConnmanServiceInterface(const QString &dbusPathName,QObject *parent = 0);
186 ~QConnmanServiceInterface();
187
188 QVariantMap getProperties();
189 // clearProperty
190 void connect();
191 void disconnect();
192 void remove();
193 // void moveBefore(QDBusObjectPath &service);
194 // void moveAfter(QDBusObjectPath &service);
195
196// properties
197 QString getState();
198 QString getError();
199 QString getName();
200 QString getType();
201 QString getMode();
202 QString getSecurity();
203 QString getPassphrase();
204 bool isPassphraseRequired();
205 quint8 getSignalStrength();
206 bool isFavorite();
207 bool isImmutable();
208 bool isAutoConnect();
209 bool isSetupRequired();
210 QString getAPN();
211 QString getMCC();
212 QString getMNC();
213 bool isRoaming();
214 QStringList getNameservers();
215 QStringList getDomains();
216 QVariantMap getIPv4();
217 QVariantMap getIPv4Configuration();
218 QVariantMap getProxy();
219 QVariantMap getEthernet();
220
221 QString getMethod();
222 QString getInterface();
223 QString getMacAddress();
224 quint16 getMtu();
225 quint16 getSpeed();
226 QString getDuplex();
227
228 bool isOfflineMode();
229 QStringList getServices();
230
231Q_SIGNALS:
232 void propertyChanged(const QString &, const QDBusVariant &value);
233 void propertyChangedContext(const QString &,const QString &,const QDBusVariant &);
234
235protected:
236 void connectNotify(const char *signal);
237 void disconnectNotify(const char *signal);
238 QVariant getProperty(const QString &);
239};
240
241class QConnmanTechnologyInterface : public QDBusAbstractInterface
242{
243 Q_OBJECT
244
245public:
246
247 QConnmanTechnologyInterface(const QString &dbusPathName,QObject *parent = 0);
248 ~QConnmanTechnologyInterface();
249
250 QVariantMap getProperties();
251// properties
252 QString getState();
253 QString getName();
254 QString getType();
255
256Q_SIGNALS:
257 void propertyChanged(const QString &, const QDBusVariant &value);
258 void propertyChangedContext(const QString &,const QString &,const QDBusVariant &);
259protected:
260 void connectNotify(const char *signal);
261 void disconnectNotify(const char *signal);
262 QVariant getProperty(const QString &);
263
264};
265
266class QConnmanAgentInterface : public QDBusAbstractInterface
267{
268 Q_OBJECT
269
270public:
271
272 QConnmanAgentInterface(const QString &dbusPathName,QObject *parent = 0);
273 ~QConnmanAgentInterface();
274
275 void release();
276 void reportError(QDBusObjectPath &path, const QString &error);
277// dict requestInput(QDBusObjectPath &path, dict fields);
278 void cancel();
279protected:
280 void connectNotify(const char *signal);
281 void disconnectNotify(const char *signal);
282};
283
284class QConnmanCounterInterfacePrivate;
285class QConnmanCounterInterface : public QDBusAbstractInterface
286{
287 Q_OBJECT
288
289public:
290
291 QConnmanCounterInterface(const QString &dbusPathName, QObject *parent = 0);
292 ~QConnmanCounterInterface();
293
294// void release();
295 QString getInterface();
296 quint32 getReceivedByteCount();
297 quint32 getTransmittedByteCount();
298 quint64 getTimeOnline();
299
300private:
301 QConnmanCounterInterfacePrivate *d;
302};
303
304class QConnmanDBusHelper: public QObject, protected QDBusContext
305 {
306 Q_OBJECT
307 public:
308 QConnmanDBusHelper(QObject *parent = 0);
309 ~QConnmanDBusHelper();
310
311 public slots:
312 void propertyChanged(const QString &, const QDBusVariant &);
313
314Q_SIGNALS:
315 void propertyChangedContext(const QString &,const QString &,const QDBusVariant &);
316};
317
318QT_END_NAMESPACE
319
320#endif // QT_NO_DBUS
321#endif // QT_NO_BEARERMANAGEMENT
322
323#endif //QCONNMANSERVICE_H
Note: See TracBrowser for help on using the repository browser.