Qt 4.8
qconnmanservice_linux_p.h
Go to the documentation of this file.
1 /****************************************************************************
2 **
3 ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
4 ** Contact: http://www.qt-project.org/legal
5 **
6 ** This file is part of the plugins 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 #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 #include <QtDBus/QDBusArgument>
63 
64 #include <QtDBus/QDBusPendingCallWatcher>
65 #include <QtDBus/QDBusObjectPath>
66 #include <QtDBus/QDBusContext>
67 #include <QMap>
68 
69 #ifndef QT_NO_BEARERMANAGEMENT
70 #ifndef QT_NO_DBUS
71 
72 #ifndef __CONNMAN_DBUS_H
73 
74 #define CONNMAN_SERVICE "net.connman"
75 #define CONNMAN_PATH "/net/connman"
76 
77 #define CONNMAN_DEBUG_INTERFACE CONNMAN_SERVICE ".Debug"
78 #define CONNMAN_ERROR_INTERFACE CONNMAN_SERVICE ".Error"
79 #define CONNMAN_AGENT_INTERFACE CONNMAN_SERVICE ".Agent"
80 #define CONNMAN_COUNTER_INTERFACE CONNMAN_SERVICE ".Counter"
81 
82 #define CONNMAN_MANAGER_INTERFACE CONNMAN_SERVICE ".Manager"
83 #define CONNMAN_MANAGER_PATH "/"
84 
85 #define CONNMAN_TASK_INTERFACE CONNMAN_SERVICE ".Task"
86 #define CONNMAN_PROFILE_INTERFACE CONNMAN_SERVICE ".Profile"
87 #define CONNMAN_SERVICE_INTERFACE CONNMAN_SERVICE ".Service"
88 #define CONNMAN_PROVIDER_INTERFACE CONNMAN_SERVICE ".Provider"
89 #define CONNMAN_TECHNOLOGY_INTERFACE CONNMAN_SERVICE ".Technology"
90 #endif
91 
93 
94 struct ConnmanMap {
97 };
98 
100 
102 
105 
107 
108 QDBusArgument &operator<<(QDBusArgument &argument, const ConnmanMap &obj);
109 const QDBusArgument &operator>>(const QDBusArgument &argument, ConnmanMap &obj);
110 
111 
113 {
114  Q_OBJECT
115 
116 public:
117 
118  QConnmanManagerInterface( QObject *parent = 0);
120 
121  QDBusObjectPath path() const;
122 
123  QVariantMap getProperties();
124  bool setProperty(const QString &name, const QDBusVariant &value);
125  QDBusObjectPath createProfile(const QString &name);
126  bool removeProfile(QDBusObjectPath path);
127  bool requestScan(const QString &type);
128  bool enableTechnology(const QString &type);
129  bool disableTechnology(const QString &type);
130  QDBusObjectPath connectService(QVariantMap &map);
131  void registerAgent(QDBusObjectPath &path);
132  void unregisterAgent(QDBusObjectPath path);
133  void registerCounter(const QString &path, quint32 interval);
134  void unregisterCounter(const QString &path);
135 
136  QString requestSession(const QString &bearerName);
137  void releaseSession();
138 
139  // properties
140  QString getState();
141  QStringList getAvailableTechnologies();
142  QStringList getEnabledTechnologies();
143  QStringList getConnectedTechnologies();
144  QString getDefaultTechnology();
145  bool getOfflineMode();
146  QString getActiveProfile();
147  QStringList getProfiles();
148  QStringList getTechnologies();
149  QStringList getServices();
150  QDBusObjectPath lookupService(const QString &);
151 
152  QString getPathForTechnology(const QString &tech);
153 
154 
155 Q_SIGNALS:
156  void propertyChanged(const QString &, const QDBusVariant &value);
157  void stateChanged(const QString &);
158  void propertyChangedContext(const QString &,const QString &,const QDBusVariant &);
159 
160 protected:
161  void connectNotify(const char *signal);
162  void disconnectNotify(const char *signal);
163  QVariant getProperty(const QString &);
164 };
165 
166 class QConnmanProfileInterfacePrivate;
168 {
169  Q_OBJECT
170 
171 public:
172 
173  QConnmanProfileInterface(const QString &dbusPathName,QObject *parent = 0);
175 
176  QVariantMap getProperties();
177 // properties
178  QString getName();
179  bool isOfflineMode();
180  QStringList getServices();
181 
182 Q_SIGNALS:
183  void propertyChanged(const QString &, const QDBusVariant &value);
184 private:
185  QConnmanProfileInterfacePrivate *d;
186 
187 protected:
188  void connectNotify(const char *signal);
189  void disconnectNotify(const char *signal);
190  QVariant getProperty(const QString &);
191 };
192 
194 {
195  Q_OBJECT
196 
197 public:
198 
199  QConnmanServiceInterface(const QString &dbusPathName,QObject *parent = 0);
201 
202  QVariantMap getProperties();
203  // clearProperty
204  void connect();
205  void disconnect();
206  void remove();
207  // void moveBefore(QDBusObjectPath &service);
208  // void moveAfter(QDBusObjectPath &service);
209 
210 // properties
211  QString getState();
212  QString getError();
213  QString getName();
214  QString getType();
215  QString getMode();
216  QString getSecurity();
217  QString getPassphrase();
218  bool isPassphraseRequired();
219  quint8 getSignalStrength();
220  bool isFavorite();
221  bool isImmutable();
222  bool isAutoConnect();
223  bool isSetupRequired();
224  QString getAPN();
225  QString getMCC();
226  QString getMNC();
227  bool isRoaming();
228  QStringList getNameservers();
229  QStringList getDomains();
230  QVariantMap getIPv4();
231  QVariantMap getIPv4Configuration();
232  QVariantMap getProxy();
233  QVariantMap getEthernet();
234 
235  QString getMethod();
236  QString getInterface();
237  QString getMacAddress();
238  quint16 getMtu();
239  quint16 getSpeed();
240  QString getDuplex();
241 
242  bool isOfflineMode();
243  QStringList getServices();
244 
245 Q_SIGNALS:
246  void propertyChanged(const QString &, const QDBusVariant &value);
247  void propertyChangedContext(const QString &,const QString &,const QDBusVariant &);
248 
249 protected:
250  void connectNotify(const char *signal);
251  void disconnectNotify(const char *signal);
252  QVariant getProperty(const QString &);
253 };
254 
256 {
257  Q_OBJECT
258 
259 public:
260 
261  QConnmanTechnologyInterface(const QString &dbusPathName,QObject *parent = 0);
263 
264  QVariantMap getProperties();
265 // properties
266  QString getState();
267  QString getName();
268  QString getType();
269 
270 Q_SIGNALS:
271  void propertyChanged(const QString &, const QDBusVariant &value);
272  void propertyChangedContext(const QString &,const QString &,const QDBusVariant &);
273 protected:
274  void connectNotify(const char *signal);
275  void disconnectNotify(const char *signal);
276  QVariant getProperty(const QString &);
277 
278 };
279 
281 {
282  Q_OBJECT
283 
284 public:
285 
286  QConnmanAgentInterface(const QString &dbusPathName,QObject *parent = 0);
288 
289  void release();
290  void reportError(QDBusObjectPath &path, const QString &error);
291 // dict requestInput(QDBusObjectPath &path, dict fields);
292  void cancel();
293 protected:
294  void connectNotify(const char *signal);
295  void disconnectNotify(const char *signal);
296 };
297 
298 class QConnmanCounterInterfacePrivate;
300 {
301  Q_OBJECT
302 
303 public:
304 
305  QConnmanCounterInterface(const QString &dbusPathName, QObject *parent = 0);
307 
308 // void release();
309  QString getInterface();
310  quint32 getReceivedByteCount();
311  quint32 getTransmittedByteCount();
312  quint64 getTimeOnline();
313 
314 private:
315  QConnmanCounterInterfacePrivate *d;
316 };
317 
318 class QConnmanDBusHelper: public QObject, protected QDBusContext
319  {
320  Q_OBJECT
321  public:
322  QConnmanDBusHelper(QObject *parent = 0);
324 
325  public slots:
326  void propertyChanged(const QString &, const QDBusVariant &);
327 
328 Q_SIGNALS:
329  void propertyChangedContext(const QString &,const QString &,const QDBusVariant &);
330 };
331 
333 
334 #endif // QT_NO_DBUS
335 #endif // QT_NO_BEARERMANAGEMENT
336 
337 #endif //QCONNMANSERVICE_H
The QVariant class acts like a union for the most common Qt data types.
Definition: qvariant.h:92
int type
Definition: qmetatype.cpp:239
#define QT_END_NAMESPACE
This macro expands to.
Definition: qglobal.h:90
The QDBusArgument class is used to marshall and demarshall D-Bus arguments.
Definition: qdbusargument.h:69
#define error(msg)
The QDBusContext class allows slots to determine the D-Bus context of the calls.
Definition: qdbuscontext.h:60
unsigned char quint8
Definition: qglobal.h:934
The QString class provides a Unicode character string.
Definition: qstring.h:83
The QObject class is the base class of all Qt objects.
Definition: qobject.h:111
#define Q_SIGNALS
Definition: qobjectdefs.h:72
Q_DECLARE_METATYPE(::ConnmanMap)
The QDBusAbstractInterface class is the base class for all D-Bus interfaces in the QtDBus binding...
#define QT_BEGIN_NAMESPACE
This macro expands to.
Definition: qglobal.h:89
unsigned __int64 quint64
Definition: qglobal.h:943
const char * name
The QStringList class provides a list of strings.
Definition: qstringlist.h:66
#define QT_PREPEND_NAMESPACE(name)
This macro qualifies identifier with the full namespace.
Definition: qglobal.h:87
unsigned short quint16
Definition: qglobal.h:936
#define Q_OBJECT
Definition: qobjectdefs.h:157
QConnmanCounterInterfacePrivate * d
QList< ConnmanMap > ConnmanMapList
const QDBusArgument & operator>>(const QDBusArgument &argument, ConnmanMap &obj)
unsigned int quint32
Definition: qglobal.h:938
The QDBusObjectPath class enables the programmer to identify the OBJECT_PATH type provided by the D-B...
QConnmanProfileInterfacePrivate * d
#define slots
Definition: qobjectdefs.h:68
QDBusObjectPath objectPath
The QDBusVariant class enables the programmer to identify the variant type provided by the D-Bus type...
QDBusArgument & operator<<(QDBusArgument &argument, const ConnmanMap &obj)
The QList class is a template class that provides lists.
Definition: qdatastream.h:62
QVariantMap propertyMap