Qt 4.8
qnetworkmanagerservice.cpp
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 #include <QObject>
43 #include <QList>
44 #include <QtDBus/QtDBus>
45 #include <QtDBus/QDBusConnection>
46 #include <QtDBus/QDBusError>
47 #include <QtDBus/QDBusInterface>
48 #include <QtDBus/QDBusMessage>
49 #include <QtDBus/QDBusReply>
50 #include <QtDBus/QDBusPendingCallWatcher>
51 #include <QtDBus/QDBusObjectPath>
52 #include <QtDBus/QDBusPendingCall>
53 
54 #include "qnetworkmanagerservice.h"
55 #include "qnmdbushelper.h"
56 
57 #ifndef QT_NO_DBUS
58 
60 
62 
64 {
65 public:
67  bool valid;
68 };
69 
71  : QObject(parent)
72 {
77  dbusConnection);
78  if (!d->connectionInterface->isValid()) {
79  d->valid = false;
80  return;
81  }
82  d->valid = true;
83  nmDBusHelper = new QNmDBusHelper(this);
84  connect(nmDBusHelper, SIGNAL(pathForPropertiesChanged(const QString &,QMap<QString,QVariant>)),
86  connect(nmDBusHelper,SIGNAL(pathForStateChanged(const QString &, quint32)),
87  this, SIGNAL(stateChanged(const QString&, quint32)));
88 
89 }
90 
92 {
93  delete d->connectionInterface;
94  delete d;
95 }
96 
98 {
99  return d->valid;
100 }
101 
103 {
104  if(!isValid() )
105  return false;
106  bool allOk = false;
107  if (!dbusConnection.connect(QLatin1String(NM_DBUS_SERVICE),
110  QLatin1String("PropertiesChanged"),
111  nmDBusHelper,SLOT(slotPropertiesChanged( QMap<QString,QVariant>)))) {
112  allOk = true;
113  }
114  if (!dbusConnection.connect(QLatin1String(NM_DBUS_SERVICE),
117  QLatin1String("DeviceAdded"),
119  allOk = true;
120  }
121  if (!dbusConnection.connect(QLatin1String(NM_DBUS_SERVICE),
124  QLatin1String("DeviceRemoved"),
126  allOk = true;
127  }
128 
129  return allOk;
130 }
131 
133 {
134  return d->connectionInterface;
135 }
136 
138 {
140  return reply.value();
141 }
142 
144  QDBusObjectPath connectionPath,
145  QDBusObjectPath devicePath,
146  QDBusObjectPath specificObject)
147 {
148  QDBusPendingCall pendingCall = d->connectionInterface->asyncCall(QLatin1String("ActivateConnection"),
149  QVariant(serviceName),
150  QVariant::fromValue(connectionPath),
151  QVariant::fromValue(devicePath),
152  QVariant::fromValue(specificObject));
153 
154  QDBusPendingCallWatcher *callWatcher = new QDBusPendingCallWatcher(pendingCall, this);
155  connect(callWatcher, SIGNAL(finished(QDBusPendingCallWatcher*)),
157 }
158 
160 {
161  d->connectionInterface->call(QLatin1String("DeactivateConnection"), QVariant::fromValue(connectionPath));
162 }
163 
165 {
166  return d->connectionInterface->property("WirelessEnabled").toBool();
167 }
168 
170 {
171  return d->connectionInterface->property("WirelessHardwareEnabled").toBool();
172 }
173 
175 {
176  QVariant prop = d->connectionInterface->property("ActiveConnections");
177  return prop.value<QList<QDBusObjectPath> >();
178 }
179 
181 {
182  return d->connectionInterface->property("State").toUInt();
183 }
184 
186 {
187 public:
190  bool valid;
191 };
192 
194  : QObject(parent), nmDBusHelper(0)
195 {
197  d->path = dbusPathName;
199  d->path,
201  dbusConnection);
202  if (!d->connectionInterface->isValid()) {
203  d->valid = false;
204  return;
205  }
206  d->valid = true;
207 
208 }
209 
211 {
212  delete d->connectionInterface;
213  delete d;
214 }
215 
217 {
218  return d->valid;
219 }
220 
222 {
223  if(!isValid() )
224  return false;
225 
226  bool allOk = false;
227  delete nmDBusHelper;
228  nmDBusHelper = new QNmDBusHelper(this);
229  connect(nmDBusHelper, SIGNAL(pathForPropertiesChanged(const QString &,QMap<QString,QVariant>)),
231 
232  if(dbusConnection.connect(QLatin1String(NM_DBUS_SERVICE),
233  d->path,
235  QLatin1String("PropertiesChanged"),
236  nmDBusHelper,SLOT(slotPropertiesChanged( QMap<QString,QVariant>))) ) {
237  allOk = true;
238 
239  }
240  return allOk;
241 }
242 
244 {
245  return d->connectionInterface;
246 }
247 
249 {
250  return d->connectionInterface->property("Flags").toUInt();
251 }
252 
254 {
255  return d->connectionInterface->property("WpaFlags").toUInt();
256 }
257 
259 {
260  return d->connectionInterface->property("RsnFlags").toUInt();
261 }
262 
264 {
265  return d->connectionInterface->property("Ssid").toString();
266 }
267 
269 {
270  return d->connectionInterface->property("Frequency").toUInt();
271 }
272 
274 {
275  return d->connectionInterface->property("HwAddress").toString();
276 }
277 
279 {
280  return d->connectionInterface->property("Mode").toUInt();
281 }
282 
284 {
285  return d->connectionInterface->property("MaxBitrate").toUInt();
286 }
287 
289 {
290  return d->connectionInterface->property("Strength").toUInt();
291 }
292 
294 {
295 public:
298  bool valid;
299 };
300 
302  : QObject(parent), nmDBusHelper(0)
303 {
305  d->path = deviceObjectPath;
307  d->path,
309  dbusConnection);
310  if (!d->connectionInterface->isValid()) {
311  d->valid = false;
312  return;
313  }
314  d->valid = true;
315 }
316 
318 {
319  delete d->connectionInterface;
320  delete d;
321 }
322 
324 {
325  return d->valid;
326 }
327 
329 {
330  if(!isValid() )
331  return false;
332 
333  bool allOk = false;
334  delete nmDBusHelper;
335  nmDBusHelper = new QNmDBusHelper(this);
336  connect(nmDBusHelper,SIGNAL(pathForStateChanged(const QString &, quint32)),
337  this, SIGNAL(stateChanged(const QString&, quint32)));
338  if(dbusConnection.connect(QLatin1String(NM_DBUS_SERVICE),
339  d->path,
341  QLatin1String("StateChanged"),
342  nmDBusHelper,SLOT(deviceStateChanged(quint32)))) {
343  allOk = true;
344  }
345  return allOk;
346 }
347 
349 {
350  return d->connectionInterface;
351 }
352 
354 {
355  return d->connectionInterface->property("Udi").toString();
356 }
357 
359 {
360  return d->connectionInterface->property("Interface").toString();
361 }
362 
364 {
365  return d->connectionInterface->property("Ip4Address").toUInt();
366 }
367 
369 {
370  return d->connectionInterface->property("State").toUInt();
371 }
372 
374 {
375  return d->connectionInterface->property("DeviceType").toUInt();
376 }
377 
379 {
380  QVariant prop = d->connectionInterface->property("Ip4Config");
381  return prop.value<QDBusObjectPath>();
382 }
383 
385 {
386 public:
389  bool valid;
390 };
391 
393  : QObject(parent), nmDBusHelper(0)
394 {
396  d->path = ifaceDevicePath;
398  d->path,
400  dbusConnection, parent);
401  if (!d->connectionInterface->isValid()) {
402  d->valid = false;
403  return;
404  }
405  d->valid = true;
406 }
407 
409 {
410  delete d->connectionInterface;
411  delete d;
412 }
413 
415 {
416 
417  return d->valid;
418 }
419 
421 {
422  if(!isValid() )
423  return false;
424 
425  bool allOk = false;
426 
427  delete nmDBusHelper;
428  nmDBusHelper = new QNmDBusHelper(this);
429  connect(nmDBusHelper, SIGNAL(pathForPropertiesChanged(const QString &,QMap<QString,QVariant>)),
431  if(dbusConnection.connect(QLatin1String(NM_DBUS_SERVICE),
432  d->path,
434  QLatin1String("PropertiesChanged"),
435  nmDBusHelper,SLOT(slotPropertiesChanged( QMap<QString,QVariant>))) ) {
436  allOk = true;
437  }
438  return allOk;
439 }
440 
442 {
443  return d->connectionInterface;
444 }
445 
447 {
448  return d->connectionInterface->property("HwAddress").toString();
449 }
450 
452 {
453  return d->connectionInterface->property("Speed").toUInt();
454 }
455 
457 {
458  return d->connectionInterface->property("Carrier").toBool();
459 }
460 
462 {
463 public:
466  bool valid;
467 };
468 
470  : QObject(parent), nmDBusHelper(0)
471 {
473  d->path = ifaceDevicePath;
475  d->path,
477  dbusConnection, parent);
478  if (!d->connectionInterface->isValid()) {
479  d->valid = false;
480  return;
481  }
482  d->valid = true;
483 }
484 
486 {
487  delete d->connectionInterface;
488  delete d;
489 }
490 
492 {
493  return d->valid;
494 }
495 
497 {
498  if(!isValid() )
499  return false;
500 
501  bool allOk = false;
502  delete nmDBusHelper;
503  nmDBusHelper = new QNmDBusHelper(this);
504  connect(nmDBusHelper, SIGNAL(pathForPropertiesChanged(const QString &,QMap<QString,QVariant>)),
506 
507  connect(nmDBusHelper, SIGNAL(pathForAccessPointAdded(const QString &,QDBusObjectPath)),
509 
510  connect(nmDBusHelper, SIGNAL(pathForAccessPointRemoved(const QString &,QDBusObjectPath)),
512 
513  if(!dbusConnection.connect(QLatin1String(NM_DBUS_SERVICE),
514  d->path,
516  QLatin1String("AccessPointAdded"),
517  nmDBusHelper, SLOT(slotAccessPointAdded( QDBusObjectPath )))) {
518  allOk = true;
519  }
520 
521 
522  if(!dbusConnection.connect(QLatin1String(NM_DBUS_SERVICE),
523  d->path,
525  QLatin1String("AccessPointRemoved"),
526  nmDBusHelper, SLOT(slotAccessPointRemoved( QDBusObjectPath )))) {
527  allOk = true;
528  }
529 
530 
531  if(!dbusConnection.connect(QLatin1String(NM_DBUS_SERVICE),
532  d->path,
534  QLatin1String("PropertiesChanged"),
535  nmDBusHelper,SLOT(slotPropertiesChanged( QMap<QString,QVariant>)))) {
536  allOk = true;
537  }
538 
539  return allOk;
540 }
541 
543 {
544  return d->connectionInterface;
545 }
546 
548 {
550  return reply.value();
551 }
552 
554 {
555  return d->connectionInterface->property("HwAddress").toString();
556 }
557 
559 {
560  return d->connectionInterface->property("Mode").toUInt();
561 }
562 
564 {
565  return d->connectionInterface->property("Bitrate").toUInt();
566 }
567 
569 {
570  return d->connectionInterface->property("ActiveAccessPoint").value<QDBusObjectPath>();
571 }
572 
574 {
575  return d->connectionInterface->property("WirelelessCapabilities").toUInt();
576 }
577 
579 {
580 public:
583  bool valid;
584 };
585 
587  : QObject(parent)
588 {
590  d->path = settingsService;
591  d->connectionInterface = new QDBusInterface(settingsService,
594  dbusConnection);
595  if (!d->connectionInterface->isValid()) {
596  d->valid = false;
597  return;
598  }
599  d->valid = true;
600 }
601 
603 {
604  delete d->connectionInterface;
605  delete d;
606 }
607 
609 {
610  return d->valid;
611 }
612 
614 {
615  bool allOk = false;
616 
617  if (!dbusConnection.connect(d->path, QLatin1String(NM_DBUS_PATH_SETTINGS),
620  allOk = true;
621  }
622 
623  return allOk;
624 }
625 
627 {
629  return reply.value();
630 }
631 
633 {
634  return d->connectionInterface;
635 }
636 
637 
639 {
640 public:
645  bool valid;
646 };
647 
649  : QObject(parent), nmDBusHelper(0)
650 {
651  qDBusRegisterMetaType<QNmSettingsMap>();
653  d->path = connectionObjectPath;
654  d->service = settingsService;
655  d->connectionInterface = new QDBusInterface(settingsService,
656  d->path,
658  dbusConnection, parent);
659  if (!d->connectionInterface->isValid()) {
660  d->valid = false;
661  return;
662  }
663  d->valid = true;
664  QDBusReply< QNmSettingsMap > rep = d->connectionInterface->call(QLatin1String("GetSettings"));
665  d->settingsMap = rep.value();
666 }
667 
669 {
670  delete d->connectionInterface;
671  delete d;
672 }
673 
675 {
676  return d->valid;
677 }
678 
680 {
681  if(!isValid() )
682  return false;
683 
684  bool allOk = false;
685  if(!dbusConnection.connect(d->service, d->path,
687  this, SIGNAL(updated(QNmSettingsMap)))) {
688  allOk = true;
689  } else {
690  QDBusError error = dbusConnection.lastError();
691  }
692 
693  delete nmDBusHelper;
694  nmDBusHelper = new QNmDBusHelper(this);
695  connect(nmDBusHelper, SIGNAL(pathForSettingsRemoved(const QString &)),
696  this,SIGNAL(removed( const QString &)));
697 
698  if (!dbusConnection.connect(d->service, d->path,
700  nmDBusHelper, SIGNAL(slotSettingsRemoved()))) {
701  allOk = true;
702  }
703 
704  return allOk;
705 }
706 
708 {
709  return d->connectionInterface;
710 }
711 
713 {
715  d->settingsMap = rep.value();
716  return d->settingsMap;
717 }
718 
720 {
721  const QString devType =
722  d->settingsMap.value(QLatin1String("connection")).value(QLatin1String("type")).toString();
723 
724  if (devType == QLatin1String("802-3-ethernet"))
726  else if (devType == QLatin1String("802-11-wireless"))
728  else
729  return DEVICE_TYPE_UNKNOWN;
730 }
731 
733 {
734  const QVariant autoConnect =
735  d->settingsMap.value(QLatin1String("connection")).value(QLatin1String("autoconnect"));
736 
737  // NetworkManager default is to auto connect
738  if (!autoConnect.isValid())
739  return true;
740 
741  return autoConnect.toBool();
742 }
743 
745 {
746  return d->settingsMap.value(QLatin1String("connection"))
747  .value(QLatin1String("timestamp")).toUInt();
748 }
749 
751 {
752  return d->settingsMap.value(QLatin1String("connection")).value(QLatin1String("id")).toString();
753 }
754 
756 {
757  const QString id = d->settingsMap.value(QLatin1String("connection"))
758  .value(QLatin1String("uuid")).toString();
759 
760  // is no uuid, return the connection path
761  return id.isEmpty() ? d->connectionInterface->path() : id;
762 }
763 
765 {
766  return d->settingsMap.value(QLatin1String("802-11-wireless"))
767  .value(QLatin1String("ssid")).toString();
768 }
769 
771 {
773 
774  if (type == DEVICE_TYPE_802_3_ETHERNET) {
775  return d->settingsMap.value(QLatin1String("802-3-ethernet"))
776  .value(QLatin1String("mac-address")).toString();
777  } else if (type == DEVICE_TYPE_802_11_WIRELESS) {
778  return d->settingsMap.value(QLatin1String("802-11-wireless"))
779  .value(QLatin1String("mac-address")).toString();
780  } else {
781  return QString();
782  }
783 }
784 
786 {
788  return d->settingsMap.value(QLatin1String("802-11-wireless"))
789  .value(QLatin1String("seen-bssids")).toStringList();
790  } else {
791  return QStringList();
792  }
793 }
794 
796 {
797 public:
800  bool valid;
801 };
802 
804  : QObject(parent), nmDBusHelper(0)
805 {
807  d->path = activeConnectionObjectPath;
809  d->path,
811  dbusConnection, parent);
812  if (!d->connectionInterface->isValid()) {
813  d->valid = false;
814  return;
815  }
816  d->valid = true;
817 }
818 
819 QNetworkManagerConnectionActive::~QNetworkManagerConnectionActive()
820 {
821  delete d->connectionInterface;
822  delete d;
823 }
824 
826 {
827  return d->valid;
828 }
829 
831 {
832  if(!isValid() )
833  return false;
834 
835  bool allOk = false;
836  delete nmDBusHelper;
837  nmDBusHelper = new QNmDBusHelper(this);
838  connect(nmDBusHelper, SIGNAL(pathForPropertiesChanged(const QString &,QMap<QString,QVariant>)),
840  if(dbusConnection.connect(QLatin1String(NM_DBUS_SERVICE),
841  d->path,
843  QLatin1String("PropertiesChanged"),
844  nmDBusHelper,SLOT(slotPropertiesChanged( QMap<QString,QVariant>))) ) {
845  allOk = true;
846  }
847 
848  return allOk;
849 }
850 
852 {
853  return d->connectionInterface;
854 }
855 
857 {
858  return d->connectionInterface->property("ServiceName").toString();
859 }
860 
862 {
863  QVariant prop = d->connectionInterface->property("Connection");
864  return prop.value<QDBusObjectPath>();
865 }
866 
868 {
869  QVariant prop = d->connectionInterface->property("SpecificObject");
870  return prop.value<QDBusObjectPath>();
871 }
872 
874 {
875  QVariant prop = d->connectionInterface->property("Devices");
876  return prop.value<QList<QDBusObjectPath> >();
877 }
878 
880 {
881  return d->connectionInterface->property("State").toUInt();
882 }
883 
885 {
886  return d->connectionInterface->property("Default").toBool();
887 }
888 
890 {
891 public:
894  bool valid;
895 };
896 
898  : QObject(parent)
899 {
901  d->path = deviceObjectPath;
903  d->path,
905  dbusConnection, parent);
906  if (!d->connectionInterface->isValid()) {
907  d->valid = false;
908  return;
909  }
910  d->valid = true;
911 }
912 
914 {
915  delete d->connectionInterface;
916  delete d;
917 }
918 
920 {
921  return d->valid;
922 }
923 
925 {
926  return d->connectionInterface->property("Domains").toStringList();
927 }
928 
930 
931 #endif // QT_NO_DBUS
The QVariant class acts like a union for the most common Qt data types.
Definition: qvariant.h:92
QList< QDBusObjectPath > activeConnections() const
void deviceRemoved(QDBusObjectPath)
int type
Definition: qmetatype.cpp:239
#define QT_END_NAMESPACE
This macro expands to.
Definition: qglobal.h:90
void newConnection(QDBusObjectPath)
QString path() const
Returns the object path that this interface is associated with.
QNetworkManagerConnectionActivePrivate * d
QNetworkManagerInterfaceDeviceWired(const QString &ifaceDevicePath, QObject *parent=0)
bool isValid() const
Returns true if this is a valid reference to a remote object.
QList< QDBusObjectPath > devices() const
#define error(msg)
The QDBusReply class stores the reply for a method call to a remote object.
Definition: qdbusreply.h:65
QDBusPendingCall asyncCall(const QString &method, const QVariant &arg1=QVariant(), const QVariant &arg2=QVariant(), const QVariant &arg3=QVariant(), const QVariant &arg4=QVariant(), const QVariant &arg5=QVariant(), const QVariant &arg6=QVariant(), const QVariant &arg7=QVariant(), const QVariant &arg8=QVariant())
Calls the method method on this interface and passes the parameters to this function to the method...
#define SLOT(a)
Definition: qobjectdefs.h:226
void stateChanged(const QString &, quint32)
The QDBusError class represents an error received from the D-Bus bus or from remote applications foun...
Definition: qdbuserror.h:60
The QDBusPendingCall class refers to one pending asynchronous call.
QString toString() const
Returns the variant as a QString if the variant has type() String , Bool , ByteArray ...
Definition: qvariant.cpp:2270
void propertiesChanged(const QString &, QMap< QString, QVariant >)
The QDBusInterface class is a proxy for interfaces on remote objects.
QLatin1String(DBUS_INTERFACE_DBUS))) Q_GLOBAL_STATIC_WITH_ARGS(QString
bool toBool() const
Returns the variant as a bool if the variant has type() Bool.
Definition: qvariant.cpp:2691
static QDBusConnection systemBus()
Returns a QDBusConnection object opened with the system bus.
The QDBusPendingCallWatcher class provides a convenient way for waiting for asynchronous replies...
#define NM_DBUS_INTERFACE_ACCESS_POINT
#define NM_DBUS_PATH_SETTINGS
The QString class provides a Unicode character string.
Definition: qstring.h:83
QNetworkManagerIp4Config(const QString &dbusPathName, QObject *parent=0)
The QObject class is the base class of all Qt objects.
Definition: qobject.h:111
QDBusInterface * connectionInterface() const
void propertiesChanged(QList< QDBusObjectPath >)
#define SIGNAL(a)
Definition: qobjectdefs.h:227
#define NM_DBUS_INTERFACE_DEVICE
QStringList toStringList() const
Returns the variant as a QStringList if the variant has type() StringList, String ...
Definition: qvariant.cpp:2259
QList< QDBusObjectPath > listConnections()
void activationFinished(QDBusPendingCallWatcher *)
void propertiesChanged(const QString &, QMap< QString, QVariant >)
#define QT_BEGIN_NAMESPACE
This macro expands to.
Definition: qglobal.h:89
#define NM_DBUS_PATH
QDBusInterface * connectionInterface() const
#define NM_DBUS_SERVICE
unsigned __int64 quint64
Definition: qglobal.h:943
static bool connect(const QObject *sender, const char *signal, const QObject *receiver, const char *member, Qt::ConnectionType=Qt::AutoConnection)
Creates a connection of the given type from the signal in the sender object to the method in the rece...
Definition: qobject.cpp:2580
bool isEmpty() const
Returns true if the string has no characters; otherwise returns false.
Definition: qstring.h:704
QNetworkManagerSettingsConnectionPrivate * d
const T value(const Key &key) const
Returns the value associated with the key key.
Definition: qmap.h:499
QNetworkManagerInterfaceDeviceWireless(const QString &ifaceDevicePath, QObject *parent=0)
The QStringList class provides a list of strings.
Definition: qstringlist.h:66
QNetworkManagerInterface(QObject *parent=0)
#define NM_DBUS_INTERFACE_DEVICE_WIRELESS
void activateConnection(const QString &serviceName, QDBusObjectPath connection, QDBusObjectPath device, QDBusObjectPath specificObject)
#define NM_DBUS_IFACE_SETTINGS
The QLatin1String class provides a thin wrapper around an US-ASCII/Latin-1 encoded string literal...
Definition: qstring.h:654
void propertiesChanged(const QString &, QMap< QString, QVariant >)
QNetworkManagerInterfaceDeviceWirelessPrivate * d
static QVariant fromValue(const T &value)
Returns a QVariant containing a copy of value.
Definition: qvariant.h:336
QDBusError lastError() const
Returns the last error that happened in this connection.
void deactivateConnection(QDBusObjectPath connectionPath) const
QList< QDBusObjectPath > getDevices() const
#define NM_DBUS_INTERFACE_IP4_CONFIG
QDBusInterface * connectionInterface() const
#define NM_DBUS_INTERFACE_ACTIVE_CONNECTION
QNetworkManagerIp4ConfigPrivate * d
QNetworkManagerConnectionActive(const QString &dbusPathName, QObject *parent=0)
void accessPointAdded(const QString &, QDBusObjectPath)
bool connect(const QString &service, const QString &path, const QString &interface, const QString &name, QObject *receiver, const char *slot)
Connects the signal specified by the service, path, interface and name parameters to the slot slot in...
static QDBusConnection dbusConnection
void accessPointRemoved(const QString &, QDBusObjectPath)
QNetworkManagerSettings(const QString &settingsService, QObject *parent=0)
The QDBusConnection class represents a connection to the D-Bus bus daemon.
QNetworkManagerInterfaceDevice(const QString &deviceObjectPath, QObject *parent=0)
QObject * parent() const
Returns a pointer to the parent object.
Definition: qobject.h:273
uint toUInt(bool *ok=0) const
Returns the variant as an unsigned int if the variant has type() UInt , Bool , ByteArray ...
Definition: qvariant.cpp:2644
unsigned int quint32
Definition: qglobal.h:938
void deviceAdded(QDBusObjectPath)
The QDBusObjectPath class enables the programmer to identify the OBJECT_PATH type provided by the D-B...
QNetworkManagerSettingsPrivate * d
void stateChanged(const QString &, quint32)
#define NM_DBUS_INTERFACE
QVariant property(const char *name) const
Returns the value of the object&#39;s name property.
Definition: qobject.cpp:3807
QNetworkManagerInterfaceAccessPoint(const QString &dbusPathName, QObject *parent=0)
QDBusInterface * connectionInterface() const
QNetworkManagerSettingsConnection(const QString &settingsService, const QString &connectionObjectPath, QObject *parent=0)
#define NM_DBUS_INTERFACE_DEVICE_WIRED
#define NM_DBUS_IFACE_SETTINGS_CONNECTION
void propertiesChanged(QMap< QString, QVariant >)
QDBusInterface * connectionInterface() const
T value() const
Returns the stored value converted to the template type T.
Definition: qvariant.h:332
bool isValid() const
Returns true if the storage type of this variant is not QVariant::Invalid; otherwise returns false...
Definition: qvariant.h:485
void updated(const QNmSettingsMap &settings)
QNetworkManagerInterfaceAccessPointPrivate * d
Type value() const
Returns the remote function&#39;s calls return value.
Definition: qdbusreply.h:118
QNetworkManagerInterfacePrivate * d
QNetworkManagerInterfaceDevicePrivate * d
QNetworkManagerInterfaceDeviceWiredPrivate * d
The QList class is a template class that provides lists.
Definition: qdatastream.h:62
QDBusMessage call(const QString &method, const QVariant &arg1=QVariant(), const QVariant &arg2=QVariant(), const QVariant &arg3=QVariant(), const QVariant &arg4=QVariant(), const QVariant &arg5=QVariant(), const QVariant &arg6=QVariant(), const QVariant &arg7=QVariant(), const QVariant &arg8=QVariant())
Calls the method method on this interface and passes the parameters to this function to the method...
void removed(const QString &path)