1 /* qdbusmessage.h QDBusMessage object
3 * Copyright (C) 2005 Harald Fernengel <harry@kdevelop.org>
5 * Licensed under the Academic Free License version 2.1
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23 #ifndef QDBUSMESSAGE_H
24 #define QDBUSMESSAGE_H
26 #include "dbus/qdbus.h"
28 #include <QtCore/qlist.h>
29 #include <QtCore/qvariant.h>
33 class QDBusMessagePrivate;
36 class QDBUS_EXPORT QDBusMessage: public QList<QVariant>
38 friend class QDBusConnection;
40 enum { DefaultTimeout = -1, NoTimeout = INT_MAX};
41 enum MessageType { InvalidMessage, MethodCallMessage, ReplyMessage,
42 ErrorMessage, SignalMessage };
45 QDBusMessage(const QDBusMessage &other);
48 QDBusMessage &operator=(const QDBusMessage &other);
50 static QDBusMessage signal(const QString &path, const QString &interface,
52 static QDBusMessage methodCall(const QString &service, const QString &path,
53 const QString &interface, const QString &method);
54 static QDBusMessage methodReply(const QDBusMessage &other);
57 QString interface() const;
58 QString name() const; //rename to member?
59 QString sender() const; //rename to service?
60 MessageType type() const;
63 void setTimeout(int ms);
67 DBusMessage *toDBusMessage() const;
68 static QDBusMessage fromDBusMessage(DBusMessage *dmsg);
69 int serialNumber() const;
70 int replySerialNumber() const;
73 QDBusMessagePrivate *d;
77 QDebug operator<<(QDebug, const QDBusMessage &);