00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifndef DBUS_QT_MESSAGE_H
00024 #define DBUS_QT_MESSAGE_H
00025
00026 #include <qvariant.h>
00027 #include <qstring.h>
00028 #include <qstringlist.h>
00029
00030 #include "dbus/dbus.h"
00031
00032 namespace DBusQt {
00033
00034 class Message
00035 {
00036 public:
00037 class iterator {
00038 public:
00039 iterator();
00040 iterator( const iterator& );
00041 iterator( DBusMessage* msg );
00042 ~iterator();
00043
00044 iterator& operator=( const iterator& );
00045 const QVariant& operator*() const;
00046 QVariant& operator*();
00047 iterator& operator++();
00048 iterator operator++(int);
00049 bool operator==( const iterator& it );
00050 bool operator!=( const iterator& it );
00051
00052 QVariant var() const;
00053 protected:
00054 QVariant marshallBaseType( DBusMessageIter* i );
00055 void fillVar();
00056 struct IteratorData;
00057 IteratorData *d;
00058 };
00059
00060 Message( int messageType );
00061 Message( DBusMessage * );
00062 Message( const QString& service, const QString& path,
00063 const QString& interface, const QString& method );
00064 Message( const Message& replayingTo );
00065 Message( const QString& path, const QString& interface,
00066 const QString& name );
00067 Message( const Message& replayingTo, const QString& errorName,
00068 const QString& errorMessage );
00069
00070 Message operator=( const Message& other );
00071
00072 virtual ~Message();
00073
00074 int type() const;
00075
00076 void setPath( const QString& );
00077 QString path() const;
00078
00079 void setInterface( const QString& );
00080 QString interface() const;
00081
00082 void setMember( const QString& );
00083 QString member() const;
00084
00085 void setErrorName( const QString& );
00086 QString errorName() const;
00087
00088 void setDestination( const QString& );
00089 QString destination() const;
00090
00091 bool setSender( const QString& sender );
00092 QString sender() const;
00093
00094 QString signature() const;
00095
00096 iterator begin() const;
00097 iterator end() const;
00098
00099 QVariant at( int i );
00100
00101
00102 public:
00103 Message& operator<<( bool );
00104 Message& operator<<( Q_INT8 );
00105 Message& operator<<( Q_INT32 );
00106 Message& operator<<( Q_UINT32 );
00107 Message& operator<<( Q_INT64 );
00108 Message& operator<<( Q_UINT64 );
00109 Message& operator<<( double );
00110 Message& operator<<( const QString& );
00111 Message& operator<<( const QVariant& );
00112
00113
00114
00115
00116
00117
00118
00119
00120 protected:
00121 friend class Connection;
00122 DBusMessage* message() const;
00123
00124 private:
00125 struct Private;
00126 Private *d;
00127 };
00128
00129 }
00130
00131 #endif