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

dbus-service.h

    00001
    00023 #ifndef _TelepathyQt_dbus_service_h_HEADER_GUARD_
    00024 #define _TelepathyQt_dbus_service_h_HEADER_GUARD_
    00025
    00026 #ifndef IN_TP_QT_HEADER
    00027 #error IN_TP_QT_HEADER
    00028 #endif
    00029
    00030 #include <TelepathyQt/DBusError>
    00031 #include <TelepathyQt/Global>
    00032 #include <TelepathyQt/Object>
    00033 #include <TelepathyQt/ServiceTypes>
    00034
    00035 #include <QObject>
    00036 #include <QVariantMap>
    00037
    00038 class QDBusConnection;
    00039 class QString;
    00040
    00041 namespace Tp
    00042 {
    00043
    00044 class DBusObject;
    00045
    00046 class TP_QT_EXPORT DBusService : public Object
    00047 {
    00048     Q_OBJECT
    00049     Q_DISABLE_COPY(DBusService)
    00050
    00051 public:
    00052     DBusService(const QDBusConnection &dbusConnection);
    00053     virtual ~DBusService();
    00054
    00055     virtual QVariantMap immutableProperties() const = 0;
    00056
    00057     QDBusConnection dbusConnection() const;
    00058     QString busName() const;
    00059     QString objectPath() const;
    00060     DBusObject *dbusObject() const;
    00061     bool isRegistered() const;
    00062
    00063 protected:
    00064     virtual bool registerObject(const QString &busName, const QString &objectPath,
    00065             DBusError *error);
    00066
    00067 private:
    00068     class Private;
    00069     friend class Private;
    00070     Private *mPriv;
    00071 };
    00072
    00073 class TP_QT_EXPORT AbstractDBusServiceInterface : public Object
    00074 {
    00075     Q_OBJECT
    00076     Q_DISABLE_COPY(AbstractDBusServiceInterface)
    00077
    00078 public:
    00079     AbstractDBusServiceInterface(const QString &interfaceName);
    00080     virtual ~AbstractDBusServiceInterface();
    00081
    00082     QString interfaceName() const;
    00083
    00084     virtual QVariantMap immutableProperties() const = 0;
    00085
    00086     DBusObject *dbusObject() const;
    00087     bool isRegistered() const;
    00088
    00089 protected:
    00090     virtual bool registerInterface(DBusObject *dbusObject);
    00091     virtual void createAdaptor() = 0;
    00092
    00093 private:
    00094     class Private;
    00095     friend class Private;
    00096     Private *mPriv;
    00097 };
    00098
    00099 }
    00100
    00101 #endif