20 #ifndef ABSTRACTDBUSSERVICEMONITOR_H
21 #define ABSTRACTDBUSSERVICEMONITOR_H
25 #include <QDBusConnection>
27 class QDBusAbstractInterface;
28 class QDBusServiceWatcher;
30 class Q_DECL_EXPORT AbstractDBusServiceMonitor :
public QObject
34 Q_PROPERTY(
bool serviceAvailable READ serviceAvailable NOTIFY serviceAvailableChanged)
42 explicit AbstractDBusServiceMonitor(
const QString &service,
const QString &path,
const QString &interface,
43 const Bus bus = SessionBus,
45 ~AbstractDBusServiceMonitor();
47 QDBusAbstractInterface* dbusInterface()
const;
49 bool serviceAvailable()
const;
52 void serviceAvailableChanged(
bool available);
55 void onServiceRegistered(
const QString &service);
56 void onServiceUnregistered(
const QString &service);
59 virtual QDBusAbstractInterface* createInterface(
const QString &service,
const QString &path,
60 const QString &interface,
const QDBusConnection &connection);
62 const QString m_service;
64 const QString m_interface;
66 QDBusServiceWatcher* m_watcher;
67 QDBusAbstractInterface* m_dbusInterface;
70 #endif // ABSTRACTDBUSSERVICEMONITOR_H