summaryrefslogtreecommitdiffstats
path: root/qt/connection.h
diff options
context:
space:
mode:
authorZack Rusin <zack@kde.org>2003-11-23 20:41:23 +0000
committerZack Rusin <zack@kde.org>2003-11-23 20:41:23 +0000
commit6ce25713dbd1d610afe8c67d90aa6c29720b02d5 (patch)
tree7a690211029d7c576e5a75f587de518b0279d0f4 /qt/connection.h
parentc8881d8a35413a4975f08f5605b60d55322ee7aa (diff)
Coding on dbus is like christmas. Just without christmas tree, presents, santa
clause, shopping, food, cookies, carrols, eggs, bunnies, trick or treating, smoking crack... I don't quite remember where I was going with this but we're getting closer.
Diffstat (limited to 'qt/connection.h')
-rw-r--r--qt/connection.h46
1 files changed, 40 insertions, 6 deletions
diff --git a/qt/connection.h b/qt/connection.h
index d75ca55b..7c0d5bac 100644
--- a/qt/connection.h
+++ b/qt/connection.h
@@ -24,6 +24,7 @@
#define DBUS_QT_CONNECTION_H
#include <qobject.h>
+#include <qstring.h>
#include "dbus/dbus.h"
@@ -33,24 +34,57 @@ namespace DBusQt {
{
Q_OBJECT
public:
- Connection();
+ Connection( const QString& host = QString::null );
- bool isConnected();
- bool isAuthenticated();
+ bool isConnected() const;
+ bool isAuthenticated() const;
public slots:
- bool connect( const QString& );
- bool disconnect();
+ void open( const QString& );
+ void close();
void flush();
+ protected slots:
+ void slotRead( int );
+ void slotWrite( int );
+
protected:
- virtual void* virtual_hook( int id, void* data );
+ void addWatch( DBusWatch* );
+ void removeWatch( DBusWatch* );
+
+ public:
+ friend dbus_bool_t dbusAddWatch( DBusWatch*, void* );
+ friend dbus_bool_t dbusRemoveWatch( DBusWatch*, void* );
+ friend dbus_bool_t dbusToggleWatch( DBusWatch*, void* );
+ protected:
+ void init( const QString& host );
+ virtual void* virtual_hook( int id, void* data );
private:
struct Private;
Private *d;
};
+ //////////////////////////////////////////////////////////////
+ //Friends
+ dbus_bool_t dbusAddWatch( DBusWatch *watch, void *data )
+ {
+ Connection *con = static_cast<Connection*>( data );
+ con->addWatch( watch );
+ }
+ dbus_bool_t dbusRemoveWatch( DBusWatch *watch, void *data )
+ {
+ Connection *con = static_cast<Connection*>( data );
+ con->removeWatch( watch );
+ }
+
+ dbus_bool_t dbusToggleWatch( DBusWatch*, void* )
+ {
+ //I don't know how to handle this one right now
+#warning "FIXME: implement"
+ }
+ //////////////////////////////////////////////////////////////
+
}