Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef PROPERTYADAPTOR_H
00023 #define PROPERTYADAPTOR_H
00024
00025 #include <QObject>
00026 #include <QDBusAbstractAdaptor>
00027 #include <QDBusMessage>
00028 #include <QDBusConnection>
00029 #include <QSet>
00030 #include <QString>
00031 #include <QDBusServiceWatcher>
00032 #define DBUS_INTERFACE "org.maemo.contextkit.Property"
00033
00034 namespace ContextProvider {
00035
00036 class PropertyPrivate;
00037
00038 class PropertyAdaptor: public QDBusAbstractAdaptor
00039 {
00040 Q_OBJECT
00041 Q_CLASSINFO("D-Bus Interface", "org.maemo.contextkit.Property")
00042
00043 public:
00044 PropertyAdaptor(PropertyPrivate* property, QDBusConnection *connection);
00045 QString objectPath() const;
00046 void forgetClients();
00047
00048 public Q_SLOTS:
00049 void Subscribe(const QDBusMessage& msg, QVariantList& values, quint64& timestamp);
00050 void Unsubscribe(const QDBusMessage& msg);
00051 void Get(QVariantList& values, quint64& timestamp);
00052
00053 Q_SIGNALS:
00054 void ValueChanged(const QVariantList &values, const quint64& timestamp);
00055
00056 private Q_SLOTS:
00057 void onClientExited(const QString&);
00058 void onValueChanged(QVariantList values, quint64 timestamp);
00059
00060 private:
00061 PropertyPrivate *propertyPrivate;
00062 QDBusConnection *connection;
00063 QSet<QString> clientServiceNames;
00064 QDBusServiceWatcher serviceWatcher;
00065
00066 };
00067
00068 }
00069
00070 #endif