Home · All Classes · All Namespaces · Modules · Functions · Files

dbus-proxy.h

00001 /*
00002  * This file is part of TelepathyQt4
00003  *
00004  * Copyright (C) 2008-2010 Collabora Ltd. <http://www.collabora.co.uk/>
00005  * Copyright (C) 2008-2010 Nokia Corporation
00006  *
00007  * This library is free software; you can redistribute it and/or
00008  * modify it under the terms of the GNU Lesser General Public
00009  * License as published by the Free Software Foundation; either
00010  * version 2.1 of the License, or (at your option) any later version.
00011  *
00012  * This library is distributed in the hope that it will be useful,
00013  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00014  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00015  * Lesser General Public License for more details.
00016  *
00017  * You should have received a copy of the GNU Lesser General Public
00018  * License along with this library; if not, write to the Free Software
00019  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
00020  */
00021 
00022 #ifndef _TelepathyQt4_dbus_proxy_h_HEADER_GUARD_
00023 #define _TelepathyQt4_dbus_proxy_h_HEADER_GUARD_
00024 
00025 #ifndef IN_TELEPATHY_QT4_HEADER
00026 #error IN_TELEPATHY_QT4_HEADER
00027 #endif
00028 
00029 #include <TelepathyQt4/Global>
00030 #include <TelepathyQt4/Object>
00031 #include <TelepathyQt4/ReadyObject>
00032 
00033 class QDBusConnection;
00034 class QDBusError;
00035 
00036 namespace Tp
00037 {
00038 
00039 class TestBackdoors;
00040 
00041 class TELEPATHY_QT4_EXPORT DBusProxy : public Object, public ReadyObject
00042 {
00043     Q_OBJECT
00044     Q_DISABLE_COPY(DBusProxy)
00045 
00046 public:
00047     DBusProxy(const QDBusConnection &dbusConnection, const QString &busName,
00048             const QString &objectPath, const Feature &featureCore);
00049     virtual ~DBusProxy();
00050 
00051     QDBusConnection dbusConnection() const;
00052     QString busName() const;
00053     QString objectPath() const;
00054 
00055     bool isValid() const;
00056     QString invalidationReason() const;
00057     QString invalidationMessage() const;
00058 
00059 Q_SIGNALS:
00060     void invalidated(Tp::DBusProxy *proxy,
00061             const QString &errorName, const QString &errorMessage);
00062 
00063 protected:
00064     void setBusName(const QString &busName);
00065     void invalidate(const QString &reason, const QString &message);
00066     void invalidate(const QDBusError &error);
00067 
00068 private Q_SLOTS:
00069     void emitInvalidated();
00070 
00071 private:
00072     friend class TestBackdoors;
00073 
00074     struct Private;
00075     friend struct Private;
00076     Private *mPriv;
00077 };
00078 
00079 class TELEPATHY_QT4_EXPORT StatelessDBusProxy : public DBusProxy
00080 {
00081     Q_OBJECT
00082     Q_DISABLE_COPY(StatelessDBusProxy)
00083 
00084 public:
00085     StatelessDBusProxy(const QDBusConnection &dbusConnection,
00086         const QString &busName, const QString &objectPath, const Feature &featureCore);
00087     virtual ~StatelessDBusProxy();
00088 
00089 private:
00090     struct Private;
00091     friend struct Private;
00092     Private *mPriv;
00093 };
00094 
00095 class TELEPATHY_QT4_EXPORT StatefulDBusProxy : public DBusProxy
00096 {
00097     Q_OBJECT
00098     Q_DISABLE_COPY(StatefulDBusProxy)
00099 
00100 public:
00101     StatefulDBusProxy(const QDBusConnection &dbusConnection,
00102         const QString &busName, const QString &objectPath, const Feature &featureCore);
00103     virtual ~StatefulDBusProxy();
00104 
00105     static QString uniqueNameFrom(const QDBusConnection &bus, const QString &wellKnownOrUnique);
00106     static QString uniqueNameFrom(const QDBusConnection &bus, const QString &wellKnownOrUnique,
00107             QString &error, QString &message);
00108 
00109 private Q_SLOTS:
00110     void onServiceOwnerChanged(const QString &name, const QString &oldOwner,
00111             const QString &newOwner);
00112 
00113 private:
00114     struct Private;
00115     friend struct Private;
00116     Private *mPriv;
00117 };
00118 
00119 } // Tp
00120 
00121 #endif


Copyright © 2008-2010 Collabora Ltd. and Nokia Corporation
Telepathy-Qt4 0.5.6.1