1 /****************************************************************************
3 ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
4 ** Contact: http://www.qt-project.org/
6 ** This file is part of the plugins of the Qt Toolkit.
8 ** $QT_BEGIN_LICENSE:LGPL$
9 ** GNU Lesser General Public License Usage
10 ** This file may be used under the terms of the GNU Lesser General Public
11 ** License version 2.1 as published by the Free Software Foundation and
12 ** appearing in the file LICENSE.LGPL included in the packaging of this
13 ** file. Please review the following information to ensure the GNU Lesser
14 ** General Public License version 2.1 requirements will be met:
15 ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
17 ** In addition, as a special exception, Nokia gives you certain additional
18 ** rights. These rights are described in the Nokia Qt LGPL Exception
19 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
21 ** GNU General Public License Usage
22 ** Alternatively, this file may be used under the terms of the GNU General
23 ** Public License version 3.0 as published by the Free Software Foundation
24 ** and appearing in the file LICENSE.GPL included in the packaging of this
25 ** file. Please review the following information to ensure the GNU General
26 ** Public License version 3.0 requirements will be met:
27 ** http://www.gnu.org/copyleft/gpl.html.
30 ** Alternatively, this file may be used in accordance with the terms and
31 ** conditions contained in a signed written agreement between you and Nokia.
40 ****************************************************************************/
42 #ifndef QCONNMANSERVICE_H
43 #define QCONNMANSERVICE_H
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.
56 #include <QtDBus/QtDBus>
57 #include <QtDBus/QDBusConnection>
58 #include <QtDBus/QDBusError>
59 #include <QtDBus/QDBusInterface>
60 #include <QtDBus/QDBusMessage>
61 #include <QtDBus/QDBusReply>
63 #include <QtDBus/QDBusPendingCallWatcher>
64 #include <QtDBus/QDBusObjectPath>
65 #include <QtDBus/QDBusContext>
68 #ifndef QT_NO_BEARERMANAGEMENT
71 #ifndef __CONNMAN_DBUS_H
73 #define CONNMAN_SERVICE "net.connman"
74 #define CONNMAN_PATH "/net/connman"
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"
81 #define CONNMAN_MANAGER_INTERFACE CONNMAN_SERVICE ".Manager"
82 #define CONNMAN_MANAGER_PATH "/"
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"
98 class QConnmanManagerInterface : public QDBusAbstractInterface
104 QConnmanManagerInterface( QObject *parent = 0);
105 ~QConnmanManagerInterface();
107 QDBusObjectPath path() const;
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);
122 QString requestSession(const QString &bearerName);
123 void releaseSession();
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 &);
138 QString getPathForTechnology(const QString &tech);
142 void propertyChanged(const QString &, const QDBusVariant &value);
143 void stateChanged(const QString &);
144 void propertyChangedContext(const QString &,const QString &,const QDBusVariant &);
147 void connectNotify(const QMetaMethod &signal);
148 void disconnectNotify(const QMetaMethod &signal);
149 QVariant getProperty(const QString &);
152 class QConnmanProfileInterfacePrivate;
153 class QConnmanProfileInterface : public QDBusAbstractInterface
159 QConnmanProfileInterface(const QString &dbusPathName,QObject *parent = 0);
160 ~QConnmanProfileInterface();
162 QVariantMap getProperties();
165 bool isOfflineMode();
166 QStringList getServices();
169 void propertyChanged(const QString &, const QDBusVariant &value);
171 QConnmanProfileInterfacePrivate *d;
174 void connectNotify(const QMetaMethod &signal);
175 void disconnectNotify(const QMetaMethod &signal);
176 QVariant getProperty(const QString &);
179 class QConnmanServiceInterface : public QDBusAbstractInterface
185 QConnmanServiceInterface(const QString &dbusPathName,QObject *parent = 0);
186 ~QConnmanServiceInterface();
188 QVariantMap getProperties();
193 // void moveBefore(QDBusObjectPath &service);
194 // void moveAfter(QDBusObjectPath &service);
202 QString getSecurity();
203 QString getPassphrase();
204 bool isPassphraseRequired();
205 quint8 getSignalStrength();
208 bool isAutoConnect();
209 bool isSetupRequired();
214 QStringList getNameservers();
215 QStringList getDomains();
216 QVariantMap getIPv4();
217 QVariantMap getIPv4Configuration();
218 QVariantMap getProxy();
219 QVariantMap getEthernet();
222 QString getInterface();
223 QString getMacAddress();
228 bool isOfflineMode();
229 QStringList getServices();
232 void propertyChanged(const QString &, const QDBusVariant &value);
233 void propertyChangedContext(const QString &,const QString &,const QDBusVariant &);
236 void connectNotify(const QMetaMethod &signal);
237 void disconnectNotify(const QMetaMethod &signal);
238 QVariant getProperty(const QString &);
241 class QConnmanTechnologyInterface : public QDBusAbstractInterface
247 QConnmanTechnologyInterface(const QString &dbusPathName,QObject *parent = 0);
248 ~QConnmanTechnologyInterface();
250 QVariantMap getProperties();
257 void propertyChanged(const QString &, const QDBusVariant &value);
258 void propertyChangedContext(const QString &,const QString &,const QDBusVariant &);
260 void connectNotify(const QMetaMethod &signal);
261 void disconnectNotify(const QMetaMethod &signal);
262 QVariant getProperty(const QString &);
266 class QConnmanAgentInterface : public QDBusAbstractInterface
272 QConnmanAgentInterface(const QString &dbusPathName,QObject *parent = 0);
273 ~QConnmanAgentInterface();
276 void reportError(QDBusObjectPath &path, const QString &error);
277 // dict requestInput(QDBusObjectPath &path, dict fields);
280 void connectNotify(const QMetaMethod &signal);
281 void disconnectNotify(const QMetaMethod &signal);
284 class QConnmanCounterInterfacePrivate;
285 class QConnmanCounterInterface : public QDBusAbstractInterface
291 QConnmanCounterInterface(const QString &dbusPathName, QObject *parent = 0);
292 ~QConnmanCounterInterface();
295 QString getInterface();
296 quint32 getReceivedByteCount();
297 quint32 getTransmittedByteCount();
298 quint64 getTimeOnline();
301 QConnmanCounterInterfacePrivate *d;
304 class QConnmanDBusHelper: public QObject, protected QDBusContext
308 QConnmanDBusHelper(QObject *parent = 0);
309 ~QConnmanDBusHelper();
312 void propertyChanged(const QString &, const QDBusVariant &);
315 void propertyChangedContext(const QString &,const QString &,const QDBusVariant &);
321 #endif // QT_NO_BEARERMANAGEMENT
323 #endif //QCONNMANSERVICE_H