Home · All Classes · All Namespaces · Modules · Functions · Files
dbus-proxy.h
00001 
00023 #ifndef _TelepathyQt4_dbus_proxy_h_HEADER_GUARD_
00024 #define _TelepathyQt4_dbus_proxy_h_HEADER_GUARD_
00025 
00026 #ifndef IN_TELEPATHY_QT4_HEADER
00027 #error IN_TELEPATHY_QT4_HEADER
00028 #endif
00029 
00030 #include <TelepathyQt4/Global>
00031 #include <TelepathyQt4/Object>
00032 #include <TelepathyQt4/ReadyObject>
00033 
00034 class QDBusConnection;
00035 class QDBusError;
00036 
00037 namespace Tp
00038 {
00039 
00040 class TestBackdoors;
00041 
00042 class TELEPATHY_QT4_EXPORT DBusProxy : public Object, public ReadyObject
00043 {
00044     Q_OBJECT
00045     Q_DISABLE_COPY(DBusProxy)
00046 
00047 public:
00048     DBusProxy(const QDBusConnection &dbusConnection, const QString &busName,
00049             const QString &objectPath, const Feature &featureCore);
00050     virtual ~DBusProxy();
00051 
00052     QDBusConnection dbusConnection() const;
00053     QString busName() const;
00054     QString objectPath() const;
00055 
00056     bool isValid() const;
00057     QString invalidationReason() const;
00058     QString invalidationMessage() const;
00059 
00060 Q_SIGNALS:
00061     void invalidated(Tp::DBusProxy *proxy,
00062             const QString &errorName, const QString &errorMessage);
00063 
00064 protected:
00065     void setBusName(const QString &busName);
00066     void invalidate(const QString &reason, const QString &message);
00067     void invalidate(const QDBusError &error);
00068 
00069 private Q_SLOTS:
00070     TELEPATHY_QT4_NO_EXPORT void emitInvalidated();
00071 
00072 private:
00073     friend class TestBackdoors;
00074 
00075     struct Private;
00076     friend struct Private;
00077     Private *mPriv;
00078 };
00079 
00080 class TELEPATHY_QT4_EXPORT StatelessDBusProxy : public DBusProxy
00081 {
00082     Q_OBJECT
00083     Q_DISABLE_COPY(StatelessDBusProxy)
00084 
00085 public:
00086     StatelessDBusProxy(const QDBusConnection &dbusConnection,
00087         const QString &busName, const QString &objectPath, const Feature &featureCore);
00088     virtual ~StatelessDBusProxy();
00089 
00090 private:
00091     struct Private;
00092     friend struct Private;
00093     Private *mPriv;
00094 };
00095 
00096 class TELEPATHY_QT4_EXPORT StatefulDBusProxy : public DBusProxy
00097 {
00098     Q_OBJECT
00099     Q_DISABLE_COPY(StatefulDBusProxy)
00100 
00101 public:
00102     StatefulDBusProxy(const QDBusConnection &dbusConnection,
00103         const QString &busName, const QString &objectPath, const Feature &featureCore);
00104     virtual ~StatefulDBusProxy();
00105 
00106     static QString uniqueNameFrom(const QDBusConnection &bus, const QString &wellKnownOrUnique);
00107     static QString uniqueNameFrom(const QDBusConnection &bus, const QString &wellKnownOrUnique,
00108             QString &error, QString &message);
00109 
00110 private Q_SLOTS:
00111     TELEPATHY_QT4_NO_EXPORT void onServiceOwnerChanged(const QString &name, const QString &oldOwner,
00112             const QString &newOwner);
00113 
00114 private:
00115     struct Private;
00116     friend struct Private;
00117     Private *mPriv;
00118 };
00119 
00120 } // Tp
00121 
00122 #endif


Copyright © 2008-2011 Collabora Ltd. and Nokia Corporation
Telepathy-Qt4 0.8.0